Skip to content

Instantly share code, notes, and snippets.

@mouseroot
Created September 1, 2012 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mouseroot/3564643 to your computer and use it in GitHub Desktop.
Save mouseroot/3564643 to your computer and use it in GitHub Desktop.
Simple gdb script to rerturn the eip to libc main
set $s = dyld_stub_rand
set $p = ($s+6+*(int*)($s+2))
call (void*)dlsym((void*)dlopen("myrand.dylib"), "my_rand")
set *(void**)$p = my_rand
c
set $main = __libc_start_main
set $eip = $main
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment