I am doing the CMU bomb challenge and am stuck at ( phase 6 ) .
While debugging using GDB I couldn't understand two things , please look into the screenshots for clarity.
Doubt 1 :
As you can see the current instruction to be executed is
mov eax,DWORD PTR [edx+ecx*1]
and the value in registers :
EDX : 0xc
ECX : 0x1
Before Execution : 1st Screenshot
So after calculation the value moved should be 0xd , however it is 0x4 , as you can see in the 2nd screenshot below.
After Execution : 2nd Screenshot
Doubt 2 :
In the above screenshot ( where it's marked as 2 ) , what is eiz, as gdb is showing ?
IDA disassembly of the same 2 instructions
Update :
After some comments although Doubt 2 was cleared but raised some basic doubts about register addressing
Doubt 3:
Assume :
edx = 0xffffd120 and [edx] = 2
ecx = 0xffffd130 and [ecx] = 3
[0x4ffff15e0] = 7
mov eax,DWORD PTR [edx+ecx*4]
Is the above expression equivalent to this : eax = [edx] +[ecx]*4 (i.e. 2 + 3*4 = 0xd ) ?
Or to this : eax = [edx + ecx*4] ( i.e. 7 )
i.e. 0xffffd120+0xffffd130*4 = 0x4ffff15e0 ==> [0x4ffff15e0]