Skip to content

Commit

Permalink
maybe this way
Browse files Browse the repository at this point in the history
  • Loading branch information
yawkat committed Dec 18, 2024
1 parent 0f667de commit 2aad54f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,20 @@ public void run() throws IOException {
} catch (IOException ignored) {
}
CopyOption[] copyOptions = new CopyOption[]{StandardCopyOption.REPLACE_EXISTING};
List<String> cp = new ArrayList<>();
for (File library : getClasspath().getFiles()) {
Files.copy(library.toPath(), libs.resolve(library.getName()), copyOptions);
cp.add("$this_dir/libs/" + library.getName());
}
Files.copy(getAgent().get().getAsFile().toPath(), libs.resolve("jazzer_agent_deploy.jar"), copyOptions);
for (String targetClass : getTargetClasses().get()) {
List<String> args = new ArrayList<>();
collectArgs(args, targetClass);
args.add("--cp=" + String.join(":", cp));
String sh = """
#!/bin/bash
# LLVMFuzzerTestOneInput <-- for fuzzer detection (see test_all.py)
this_dir=$(dirname "$0")
exec $this_dir/jazzer_driver --agent_path=$this_dir/jazzer_agent_deploy.jar --cp=$this_dir'/libs/*' %s $@
exec $this_dir/jazzer_driver --agent_path=$this_dir/jazzer_agent_deploy.jar %s $@
""".formatted(String.join(" ", args));
Path targetPath = getOutputDirectory().file(targetClass).get().getAsFile().toPath();
Files.writeString(targetPath, sh);
Expand Down

0 comments on commit 2aad54f

Please sign in to comment.