diff --git a/fuzzer/Fuzzer.java b/fuzzer/Fuzzer.java index caa553f312d92b2f361dd9134f4400f0847138f1..122a42c695e606f773b930745a5d04741b55a3e7 100644 --- a/fuzzer/Fuzzer.java +++ b/fuzzer/Fuzzer.java @@ -21,7 +21,11 @@ public class Fuzzer { /* 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("ADD R0 R1 R2"); + pw.println("MOV R26 77"); + for(Int x;x<70000;x++){ + pw.println("RET R26"); + } + /*pw.println("ADD R0 R1 R2"); pw.println("ADD R3 R4 R5"); pw.println("ADD R6 R7 R8"); pw.println("ADD R9 R10 R11"); @@ -34,7 +38,7 @@ public class Fuzzer { pw.println("ADD R24 R18 R21"); pw.println("ADD R25 R22 R23"); pw.println("ADD R26 R24 R25"); - pw.println("RET R26"); + pw.println("RET R26");*/ }catch (Exception e){ diff --git a/src/machine-vuln1.c b/src/machine-vuln1.c index 6b69dbf983bb4195344628b9476c2b9df535461f..fd7f2565ff5d24ac5f487b46061f5a5b0e340453 100644 --- a/src/machine-vuln1.c +++ b/src/machine-vuln1.c @@ -60,7 +60,7 @@ static void machine_init(void){ /* memset can be vulnerable - changes to this can result in dirty memory to be read*/ memset(memory,0,sizeof(int32_t)*MEMORY_SIZE); - memset(regs,0,sizeof(int32_t)); //*NUM_REGS + memset(regs,0,sizeof(int32_t)*NUM_REGS); count = 0; } @@ -438,7 +438,8 @@ static int read_program(const char *filename){ memset(program,0,sizeof(program)); int instructionCount = 0; - while (instructionCount < MAX_INSTRUCTIONS){ + while (instructionCount < 2*MAX_INSTRUCTIONS){ + /*VULN*/ char * res = fgets(program[instructionCount],MAX_LINE_LENGTH+2,f); if (res == NULL){ if (feof(f)){