Hello, i have problem at address:

0x0040E0D6 mov eax,dword ptr [ecx]

the solution would be to place an instruction to check if ecx is 0 and finishing this function, but how to do this?

Thx!

Is it possible to make:

test ecx,ecx
je END OF FUNCTION
jne A CODE WHERE TO CONTINUE?

The easiest thing is to use the jecxz instruction, which executes a conditional jump if ecx contains zero

mov ecx, 0      ;load ecx with zero
jecxz lab1      ;jumps because ecx contains zero

mov ax, 5       ;never executes

lab1;
mov ecx, 9      ;load ecx with nine
jecxz lab2      ;ecx non zero, so doesn't jump

mov ax, 5       ;always executes

lab2:

Note: you can only do this with the ecx register. There are no jeaxz, jebxz or jedxz instructions.

Edited 6 Years Ago by mathematician: n/a

This article has been dead for over six months. Start a new discussion instead.