(current_address: int, destination_address: int, reg: str)
| 17 | ks = Ks(KS_ARCH_X86, KS_MODE_64) |
| 18 | |
| 19 | def assemble_lea(current_address: int, destination_address: int, reg: str) -> bytes: |
| 20 | #print("LEAH: 0x{:X} - 0x{:X} = 0x{:X}".format( |
| 21 | # current_address, destination_address, destination_address - current_address)) |
| 22 | offset = destination_address - current_address |
| 23 | encoding, _ = ks.asm(f"lea {reg}, qword ptr ds:[{offset}]") |
| 24 | machine_code = bytes(encoding) |
| 25 | return machine_code |
| 26 | |
| 27 | |
| 28 | def assemble_relative_call(current_address: int, destination_address: int) -> bytes: |
no outgoing calls
no test coverage detected