From 3de2fb568784f5b39c08a388d09caf49f06a2327 Mon Sep 17 00:00:00 2001 From: Zhaolin Deng <zhaolin.deng@student.unimelb.edu.au> Date: Sat, 13 Oct 2018 16:06:16 +0800 Subject: [PATCH] update fuzzer --- .classpath | 6 ++++++ .gitignore | 1 + .project | 17 +++++++++++++++++ fuzzer/Fuzzer.java | 20 ++------------------ src/pocs/poc4.s | 2 +- src/pocs/poc5.s | 1 + 6 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 .classpath create mode 100644 .project diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..3619eeb --- /dev/null +++ b/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="src" path="fuzzer"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/.gitignore b/.gitignore index da4e509..28be011 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *~ \#* +/bin/ diff --git a/.project b/.project new file mode 100644 index 0000000..0a1317d --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>swen90006-a2-2018</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/fuzzer/Fuzzer.java b/fuzzer/Fuzzer.java index 9f7b1a8..1fc8dbe 100644 --- a/fuzzer/Fuzzer.java +++ b/fuzzer/Fuzzer.java @@ -14,25 +14,9 @@ public class Fuzzer { try { out = new FileOutputStream(OUTPUT_FILE); pw = new PrintWriter(out); - - /* We just print one instruction. - Hint: you might want to make use of the instruction - grammar which is effectively encoded in Instruction.java */ - /*pw.println("MOV R1 0"); - for(int x=0;x<20000;x++){ - pw.println("LDR R0 R1 " + x); - } + pw.println("RET R0"); - */ - /*pw.println("RET R-1"); - pw.println("MOV R0 200"); - //pw.println("DIV R0 R0 R1"); - for(int x=0;x<31;x++){ - pw.println("ADD R"+(x+1)+" R"+x +" R"+x); - }; - pw.println("RET R31");*/ - pw.println("JMP -5"); - + }catch (Exception e){ e.printStackTrace(System.err); System.exit(1); diff --git a/src/pocs/poc4.s b/src/pocs/poc4.s index 3f00d45..cdeec3e 100644 --- a/src/pocs/poc4.s +++ b/src/pocs/poc4.s @@ -1 +1 @@ - pw.println("RET R31"); \ No newline at end of file +RET R31 \ No newline at end of file diff --git a/src/pocs/poc5.s b/src/pocs/poc5.s index e69de29..3340ee5 100644 --- a/src/pocs/poc5.s +++ b/src/pocs/poc5.s @@ -0,0 +1 @@ +JMP -5 \ No newline at end of file -- GitLab