Skip to content

Commit a1ea42d

Browse files
committed
Make lore make more sense
1 parent b3bace3 commit a1ea42d

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

buffer_overflow/buffer_overflow

32 Bytes
Binary file not shown.

buffer_overflow/buffer_overflow.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@ void access_vault()
88
execve("/bin/sh", NULL, NULL);
99
}
1010

11-
int main()
11+
void get_password()
1212
{
1313
char input_buffer[16];
1414
puts("Enter the password to access Santa Ono's secret vault:");
1515

16-
fgets(input_buffer, 32, stdin); // Nothing can go wrong here right?
16+
fgets(input_buffer, 64, stdin); // Nothing can go wrong here right?
17+
}
18+
19+
int main()
20+
{
21+
get_password();
22+
23+
puts("HAHA you thought! There was no password, you can NEVER get in >:)");
1724

1825
return EXIT_SUCCESS;
1926
}

rop_chaining/rop_chaining

88 Bytes
Binary file not shown.

rop_chaining/rop_chaining.c

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,37 @@
44

55
void access_vault(int code)
66
{
7-
if (code == 1337) {
7+
if (code == 1337)
8+
{
89
execve("/bin/sh", NULL, NULL);
9-
} else {
10+
}
11+
else
12+
{
1013
puts("Access denied!");
1114
}
1215
}
1316

14-
int main()
17+
int get_password()
1518
{
1619
char input_buffer[16];
1720
puts("Enter the password to access Santa Ono's secret vault:");
1821

19-
fgets(input_buffer, 64, stdin); // Nothing can go wrong here right?
22+
fgets(input_buffer, 64, stdin);
23+
24+
return atoi(input_buffer);
25+
}
26+
27+
int main()
28+
{
29+
int password = get_password();
30+
31+
if (password >= 1000)
32+
{
33+
puts("Only authorized personnel can enter numbers greater than 1000!");
34+
return EXIT_FAILURE;
35+
}
36+
37+
access_vault(password);
2038

2139
return EXIT_SUCCESS;
2240
}

0 commit comments

Comments
 (0)