I was looking at the gdb disassembly of a program
...
0x8048085: cmp eax,ecx
0x8048087: je 0x804809f
0x8048089: mov DWORD PTR [esp+0x4],0x21
0x8048091: mov DWORD PTR [esp],0x8048160
0x8048098: jmp 0x8048157
0x804809d: mov esi,0x115e8ba
0x80480a2: add BYTE PTR [eax],al
...
In the 2nd instruction, there is a jump to address 0x...9f which is in between the two instructions later on. I understand that everything is theoretically possible as the processor should not care as long as we feed him with an address of what to execute, but still... If someone could explain, thanks
Update : ok it seems there is a problem with the addresses. But this is a snippet part of a bigger code (200 lines). I looked at where it said "call 0x..." and replaced them with labels and the code looks like :
func1:
...
asm
...
call func2
...
ret
func2:
...
asm
...
ret
...
So as much I would like to buy the fact that the disassembly was tripped up in the addresses at some point, it doesn't correlate with the fact that everywhere it says call 0x..., the instruction preceding the 0x... is a "ret". If addresses had an offset somewhere this would not be true