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

attempt 3

parent c9babba7
Branches
No related tags found
No related merge requests found
...@@ -21,7 +21,11 @@ public class Fuzzer { ...@@ -21,7 +21,11 @@ public class Fuzzer {
/* We just print one instruction. /* We just print one instruction.
Hint: you might want to make use of the instruction Hint: you might want to make use of the instruction
grammar which is effectively encoded in Instruction.java */ 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 R3 R4 R5");
pw.println("ADD R6 R7 R8"); pw.println("ADD R6 R7 R8");
pw.println("ADD R9 R10 R11"); pw.println("ADD R9 R10 R11");
...@@ -34,7 +38,7 @@ public class Fuzzer { ...@@ -34,7 +38,7 @@ public class Fuzzer {
pw.println("ADD R24 R18 R21"); pw.println("ADD R24 R18 R21");
pw.println("ADD R25 R22 R23"); pw.println("ADD R25 R22 R23");
pw.println("ADD R26 R24 R25"); pw.println("ADD R26 R24 R25");
pw.println("RET R26"); pw.println("RET R26");*/
}catch (Exception e){ }catch (Exception e){
......
...@@ -60,7 +60,7 @@ static void machine_init(void){ ...@@ -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 can be vulnerable - changes to this can result in dirty memory to be read*/
memset(memory,0,sizeof(int32_t)*MEMORY_SIZE); 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; count = 0;
} }
...@@ -438,7 +438,8 @@ static int read_program(const char *filename){ ...@@ -438,7 +438,8 @@ static int read_program(const char *filename){
memset(program,0,sizeof(program)); memset(program,0,sizeof(program));
int instructionCount = 0; int instructionCount = 0;
while (instructionCount < MAX_INSTRUCTIONS){ while (instructionCount < 2*MAX_INSTRUCTIONS){
/*VULN*/
char * res = fgets(program[instructionCount],MAX_LINE_LENGTH+2,f); char * res = fgets(program[instructionCount],MAX_LINE_LENGTH+2,f);
if (res == NULL){ if (res == NULL){
if (feof(f)){ if (feof(f)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment