I got the following disassembly code in IDA pro. I really find it hard to convert it into pseudo code.
push ebp
mov ebp, esp
sub esp, 14h
mov dword ptr [ebp-14h], 1
mov dword ptr [ebp-10h], 2
mov dword ptr [ebp-0Ch], 3
mov dword ptr [ebp-4], 0
loc_401022:
cmp dword ptr [ebp-4], 3
jge loc_40103D
mov eax, [ebp-4]
mov ecx, [ebp+eax*4-14h]
mov [ebp-8], ecx
mov edx, [ebp-4]
add edx, 1
mov [ebp-4], edx
jmp loc_401022
loc_40103D:
xor eax, eax
mov esp, ebp
pop ebp
ret
[ebp-XX]
into stack variables. EitherCtrl+K
or individually by clicking on the instruction parameter and pressingK
to make a local variable. You can also name them, e.g.[ebp-4]
could beidx
. The code will become much clearer.