Skip to content

Commit

Permalink
upd test4
Browse files Browse the repository at this point in the history
  • Loading branch information
RuixiangJiang committed Oct 28, 2023
1 parent 7808b84 commit d6a8d83
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions phase1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ lexer: syntax.tab.* lex.yy.c # For debugging lex.l

.PHONY: test clean
test: splc
@bin/splc extratest/test4.spl > extratest/test4.out
@bin/splc extratest/test1.spl > extratest/test1.myout
diff extratest/test1.out extratest/test1.myout
@bin/splc extratest/test2.spl > extratest/test2.myout
Expand Down
3 changes: 3 additions & 0 deletions phase1/extratest/test4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INCLUDE (1)
stdio.h
Program (1)
19 changes: 19 additions & 0 deletions phase1/extratest/test4.spl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <stdio.h>

/*
Please disable ASLR by sudo sysctl -w kernel.randomize_va_space=0
*/

void win() { // at 0x08048456
puts("Excellent, now let's go hack the world");
}
void vuln() {
char buf[16];
scanf("%s", buf);
}
int main() {
puts("Welcome back to 2023 CS315, let's have some fun!");
vuln();
puts("Have a good day, Bye~");
return 0;
}

0 comments on commit d6a8d83

Please sign in to comment.