I need a helping hand in order to understand the following assembly instruction. It seems to me that I am calling a address at someUnknownValue += 20994A?
E8 32F6FFFF - call std::_Init_locks::operator=+20994A
Line 8 is also fixed up so that, rather than adding one, it adds the global offset table (GOT) "relative to PC" address. So, after all that, eax contains the absolute address of the global offset table, so you can call whatever functions you want from there.
The x86 instruction set refers to the set of instructions that x86-compatible microprocessors support. The instructions are usually part of an executable program, often stored as a computer file and executed on the processor.
Call/return are used to transfer control between functions. The callq instruction takes one operand, the address of the function being called. It pushes the return address (current value of %rip , which is the next instruction after the call) onto the stack and then jumps to the address of the function being called.
Arithmetic and Logic Instructions. The add instruction adds together its two operands, storing the result in its first operand. Note, whereas both operands may be registers, at most one operand may be a memory location.
Whatever you're using to obtain the disassembly is trying to be helpful, by giving the target of the call as an offset from some symbol that it knows about -- but given that the offset is so large, it's probably confused.
The actual target of the call can be calculated as follows:
E8
is a call
with a relative offset.e.g.
<some address> E8 32 F6 FF FF call <somewhere>
<some address>+5 (next instruction)
0xFFFFF632
.-0x9CE
.call
instruction is at <some address>
and is 5 bytes long; the next instruction is at <some address> + 5
.<some address> + 5 - 0x9CE
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With