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

tweak

parent 982da26c
No related branches found
No related tags found
No related merge requests found
......@@ -21,9 +21,21 @@ 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("MOV R0 0");
pw.println("LDR R2 R0 0");
pw.println("RET R2");
pw.println("ADD R0 R1 R2");
pw.println("ADD R3 R4 R5");
pw.println("ADD R6 R7 R8");
pw.println("ADD R9 R10 R11");
pw.println("ADD R12 R13 R14");
pw.println("ADD R15 R16 R17");
pw.println("ADD R18 R19 R20");
pw.println("ADD R21 R0 R3");
pw.println("ADD R22 R6 R9");
pw.println("ADD R23 R12 R15");
pw.println("ADD R24 R18 R21");
pw.println("ADD R25 R22 R23");
pw.println("ADD R26 R24 R25");
pw.println("RET R26");
}catch (Exception e){
e.printStackTrace(System.err);
......
......@@ -55,13 +55,12 @@ unsigned int count = 0; /* counts number of instructions executed so far */
static void machine_init(void){
/*Change doesn't clean all of memory, doing a read on the last memory loc vuln*/
memory = malloc(sizeof(int32_t)*(MEMORY_SIZE));
regs = malloc(sizeof(int32_t)*NUM_REGS);
/* 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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment