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
b12ea87c
Commit
b12ea87c
authored
Oct 12, 2018
by
ryuzakighost
Browse files
Options
Downloads
Patches
Plain Diff
attempt 3
parent
c9babba7
Branches
Branches containing commit
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
+6
-2
6 additions, 2 deletions
fuzzer/Fuzzer.java
src/machine-vuln1.c
+3
-2
3 additions, 2 deletions
src/machine-vuln1.c
with
9 additions
and
4 deletions
fuzzer/Fuzzer.java
+
6
−
2
View file @
b12ea87c
...
@@ -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
){
...
...
This diff is collapsed.
Click to expand it.
src/machine-vuln1.c
+
3
−
2
View file @
b12ea87c
...
@@ -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
)){
...
...
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