Page 1 of 1

Question about readmem and je command

Posted: Mon Jul 04, 2022 2:43 am
by wannaknow
HELLO

lblPlayerGrabber:
readmem(aobPlayerGrabber,7)
je lblPlayerGrabberSkip
mov dword ptr [pPlayerCharacter],edi

Above is a part of the script of some game already written by someone and it works fine.

Im trying to learn CE through scripts already written like this.

the cmp command usually comes before je so that i could know what the je would compare at that situation.

But the command "readmem" is just before the command "je" at the above script.

Then what does je compare?

And one more thing, I wanna know why actually readmem is needed.

Could you please give me some or just one example to show the role of readmem command?

I know readmem copies bytes of the variable but I couldn't get why it is needed.

Sorry about such a elementary question but please consider that I have no source to get information about this language.

Re: Question about readmem and je command

Posted: Mon Jul 04, 2022 7:10 am
by GreenHouse
wannaknow wrote:
Mon Jul 04, 2022 2:43 am
Then what does je compare? And one more thing, I wanna know why actually readmem is needed.
Seeing that "aobPlayerGrabber" is the first thing there, I'd say that readmem is reading the bytes from the original AOB which includes a compare. Which is why the "je" is there. Also the readmem there is probably used to avoid update problems when the offsets change. So you add a wildcard to the offset part of the AOB, and then use readmem to read the original offset, and then also save it in an alloc to use it again when disabling, so the offset is correct again.

Re: Question about readmem and je command

Posted: Tue Jul 05, 2022 1:28 am
by wannaknow
Thanks. Finally understood the role of readmem. But I found that the je line was useless. I tried to remove the line and nothing different happened. Anyway thank you.

Re: Question about readmem and je command

Posted: Wed Jul 06, 2022 10:57 pm
by jgoemat
From looking at the code you supplied, you may find if you remove the je that pPlayerCharacter sometimes points to enemies :)