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!

Recommended Answers

All 5 Replies

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!

I would investigate the compare opcode and jump equal, jump not equal opcodes

Try this link:
http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_875_7044,00.html

manual 3 General-Purpose and System Instructions

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.

thank you so much!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.