-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
content/ctf-writeups/bcactf_5.0/assets/scripts/bpwnage/provided.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
int main() { | ||
// Hint: how do these values get stored? | ||
void* first_var; | ||
char* guess; | ||
char flag[100]; | ||
load_flag(flag, 100); | ||
|
||
puts("Welcome to the most tasmastic game of all time!"); | ||
wait_for(3); | ||
puts("Basically it's just too simple, I've put the"); | ||
puts("flag into the memory and your job is ... to"); | ||
puts("guess where it is!!"); | ||
wait_for(2); | ||
puts("Have fun!"); | ||
wait_for(1); | ||
puts("Oh and before you start, I'll give you a little"); | ||
puts("hint, the address of the current stackframe I'm"); | ||
printf("in is %p\n", (&first_var)[-2]); | ||
wait_for(3); | ||
puts("Okay anyway, back to the game. Make your guess!"); | ||
puts("(hexadecimals only, so something like 0xA would work)"); | ||
printf("guess> "); | ||
|
||
guess = read_pointer(); | ||
|
||
wait_for(3); | ||
|
||
puts("Okay, prepare yourself. If you're right this"); | ||
puts("will print out the flag"); | ||
|
||
wait_for(1); | ||
puts("Oh, and if your wrong, this might crash and"); | ||
puts("disconnect you\nGood luck!"); | ||
|
||
printf("%s\n", guess); | ||
|
||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters