I recently began to study assembly to do reverse engineering. I read Practical Reverse Engineering and saw the assembly code there:
loop_start:
mov eax, [edi+4]
mov eax, [eax+ebx*4]
test eax, eax
... //They also did the dots here
jz short loc_7F627F
loc_7F627F:
inc ebx
cmp ebx, [edi]
jl short loop_start
Then they said that this information should give us an idea, decompile it on this (I do all the points exactly where they did it):
typedef struct _Foo
{
DWORD size;
DWORD array[...];} FOO, *PFOO;
PFOO bar= ...;
for(i= ...; i < bar->size; i++)
{
if(bar->array[i] != 0){
...
}
}
jz short loc_7F627F , eax , ... jz, jz? , eax, , , , ( , , ..., ZF), , , C-, .