Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swen90006-a2-2018
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Callum Bradshaw
swen90006-a2-2018
Commits
b1af57f9
Commit
b1af57f9
authored
Oct 12, 2018
by
ryuzakighost
Browse files
Options
Downloads
Patches
Plain Diff
tweak
parent
982da26c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
fuzzer/Fuzzer.java
+15
-3
15 additions, 3 deletions
fuzzer/Fuzzer.java
src/machine-vuln1.c
+1
-2
1 addition, 2 deletions
src/machine-vuln1.c
with
16 additions
and
5 deletions
fuzzer/Fuzzer.java
+
15
−
3
View file @
b1af57f9
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
src/machine-vuln1.c
+
1
−
2
View file @
b1af57f9
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment