diff --git a/x86_32/0x1_SyscallBasics/Example_Code/skeleton_oldstyle.c b/x86_32/0x1_SyscallBasics/Example_Code/skeleton_oldstyle.c index cc3f9dc..11e7d0b 100644 --- a/x86_32/0x1_SyscallBasics/Example_Code/skeleton_oldstyle.c +++ b/x86_32/0x1_SyscallBasics/Example_Code/skeleton_oldstyle.c @@ -1,15 +1,12 @@ #include -#include -#include -char shellcode[] = ""; +unsigned char shellcode[] = ""; -int main(void) +main() { - int *ret; - - printf("%d\n",strlen(shellcode)); - ret = (int *)&ret+2; - *ret = (int)shellcode; -return 0; +printf("Shellcode Length: %d\n", sizeof(shellcode) - 1); +int (*ret)() = (int(*)())shellcode; +ret(); } + +