Given the following x86 assembly instructions:
mov esi, offset off_A
cmp esi, offset off_B
how would I get the offsets (the second operand) at runtime ? This is the scenario: A program (injected into the process at runtime) replaces the offsets with a few of its own, resulting in:
mov esi, offset off_X
cmp esi, offset off_Y
This program allows plugins to be written and loaded through it but doesn't expose the replacement addresses. So, given the addresses at which the above instructions exist, how do I find offsets X and Y ?