pymhf.utils.iced module#

pymhf.utils.iced.create_jmp_bytes(target: int, rip: int)#

Assemble the required bytes to jump to some address.

pymhf.utils.iced.disassemble(data: bytes, ip: int) None#

Utility function for disassembly bytes.

pymhf.utils.iced.generate_load_stack_pointer_bytes(buff_addr: int, rip: int, bits: int = 64) bytes#
pymhf.utils.iced.get_first_jmp_addr(data: bytes, ip: int) int#

Get the address of the first jmp instruction found in the bytes when disassembled.

pymhf.utils.iced.load_esp(buff_addr: int, rip: int) bytes#

Assemble the required bytes to write the value of the esp register into a buffer which can be accessed by the detour. This is for getting the caller address in a 32 bit process. The asm which is assembled is `x86asm mov eax, [esp] mov [rsp_buff_addr], eax `

pymhf.utils.iced.load_rsp(buff_addr: int, rip: int) bytes#

Assemble the required bytes to write the value of the rsp register into a buffer which can be accessed by the detour. This is for getting the caller address in a 64 bit process. The asm which is assembled is `x86asm mov rax, [rsp] mov [rsp_buff_addr], rax `