Skip to content
Snippets Groups Projects
Commit f89d7406 authored by ryuzakighost's avatar ryuzakighost
Browse files

fixed jmp

parent 95a0d1bb
Branches
No related tags found
No related merge requests found
......@@ -51,12 +51,22 @@ public class Fuzzer {
else if(strat == 7){
pw.println(generateDirtyMemoryRead(rg));
}
else if(strat ==8){
if(rg.nextBoolean()){
pw.println(jmpOverflow(rg));
}
else{
pw.println(jzOverflow(rg));
}
}
if(strat != 8){
int paddingLines = rg.nextInt(maxPadding);
pw.println(generateDivideByZero());
pw.println(generateInstructionComment(rg));
for(int x=0;x<paddingLines;x++){
pw.println(generateValidString(rg,paddingLines-x+3,x+3));
}
}
if(strat == 0){
pw.println(generateValidReturn(rg));
}
......@@ -80,14 +90,6 @@ public class Fuzzer {
else if(strat == 5){
pw.println(generateInstructionOverflow());
}
else if(strat == 8){
if(rg.nextBoolean()){
pw.println(jmpOverflow(rg));
}
else{
pw.println(jzOverflow(rg));
}
}
else if(strat == 9){
if(rg.nextBoolean()){
pw.println(intOverflow());
......@@ -344,10 +346,14 @@ public class Fuzzer {
public static String jmpOverflow(Random rg) {
String line = new String();
int val;
int offset = rg.nextInt(10);
if(offset == 0){
offset = 10;
}
if(rg.nextBoolean()) {
val = -1*maxMemory;
val = -1*offset;
} else {
val = maxMemory;
val = offset;
}
line = line +"JMP "+val;
return line;
......@@ -357,10 +363,14 @@ public class Fuzzer {
String line = new String();
int val;
int offset = rg.nextInt(10);
if(offset == 0){
offset = 10;
}
if(rg.nextBoolean()) {
val = -1*maxMemory;
val = -1*offset;
} else {
val = maxMemory;
val = offset;
}
line = line +"MOV R0 0\n";
line = line +"JZ R0 "+val;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment