Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Assembler - Save base address - weird behavior

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Avoider
How do I cheat?
Reputation: 0

Joined: 10 Jul 2014
Posts: 6

PostPosted: Sat Jul 12, 2014 5:39 pm    Post subject: Assembler - Save base address - weird behavior Reply with quote

Hello,
i want to save the address from esi (base address of entity) whenever a function has been called which changes the address value.

But if i add an entry which accesses this address, i get the wrong address.

I looked into the trace instruction and the address in esi is the correct address.
It just not matches in the address list if i add a address manually and put the registername in the address field (in this case 'lastHitEntity').


Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

registersymbol(lastHitEntity)
alloc(lastHitEntity,4)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here

originalcode:
mov [lastHitEntity],esi
fst dword ptr [esi+00000474]

exit:
jmp returnhere

"unepic.exe"+9C492:
jmp newmem
nop
returnhere:




[DISABLE]
//code from here till the end of the code will be used to disable the cheat
unregistersymbol(lastHitEntity)

dealloc(newmem)
dealloc(lastHitEntity)

"unepic.exe"+9C492:
fst dword ptr [esi+00000474]
//Alt: db D9 96 74 04 00 00


Thanks in advance
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sat Jul 12, 2014 6:09 pm    Post subject: Reply with quote

Two things that come to mind...

1. The instruction accesses more than one address.
2. You haven't added the offset to the custom address in your cheat table (+00000474).
Back to top
View user's profile Send private message
Avoider
How do I cheat?
Reputation: 0

Joined: 10 Jul 2014
Posts: 6

PostPosted: Sun Jul 13, 2014 5:24 am    Post subject: Reply with quote

++METHOS wrote:
Two things that come to mind...

1. The instruction accesses more than one address.
2. You haven't added the offset to the custom address in your cheat table (+00000474).


Thanks for your reply.

I traced the instruction which decreases the health, so i can see what is in the registers and in esi is the correct base address.

What i should have mentioned is, that the difference between the 'real' base address in esi and the custom address (lastHitEntity) is big and if i hit an enemy this address never changes (What it should, because the enity that gets hit changes), but i don't get why the address is wrong and doesn't change.

example difference:
-> esi should be: 8C4756
-> address in lastHitEntity: 142488
(so i don't think it is an offset-thing)


And yes, i also added the offset 474 to the address
(Address field = "lastHitEntity+474" (without quotes), but i also added an address which only contains the custom register name.


Thanks in advance
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Jul 13, 2014 5:40 am    Post subject: Reply with quote

Did you set it up as a pointer?

Back to top
View user's profile Send private message
Avoider
How do I cheat?
Reputation: 0

Joined: 10 Jul 2014
Posts: 6

PostPosted: Sun Jul 13, 2014 7:46 am    Post subject: Reply with quote

No i didn't, i entered it in the address field (the first textbox)
(At your screenshot with the ???????? in it)

I would add an image if i could Very Happy
(To post url you need at least 25 posts)
Back to top
View user's profile Send private message
Xblade Of Heaven
Master Cheater
Reputation: 0

Joined: 16 Oct 2005
Posts: 395
Location: DEAD

PostPosted: Sun Jul 13, 2014 8:12 am    Post subject: Reply with quote

already have saved esi in
Code:
mov [lastHitEntity],esi
, but this in the wrong place, so you can try, but if it is a write instruction must then change the place of the original code to the top.

you no need make this:

Code:
registersymbol(lastHitEntity)
alloc(lastHitEntity,4)


you can make this:

Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(lastHitEntity)<- NEW

registersymbol(lastHitEntity)

newmem:
mov [lastHitEntity],esi <- NEW

originalcode:
fst dword ptr [esi+00000474]

exit:
jmp returnhere

lastHitEntity:<- NEW
dd 0<- NEW

"unepic.exe"+9C492:
jmp newmem
nop
returnhere:




[DISABLE]
dealloc(newmem)

unregistersymbol(lastHitEntity)

"unepic.exe"+9C492:
fst dword ptr [esi+00000474]
//Alt: db D9 96 74 04 00 00


regards

_________________
Welcome to the Hell.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Jul 13, 2014 1:11 pm    Post subject: Reply with quote

Avoider wrote:
No i didn't, i entered it in the address field (the first textbox)
(At your screenshot with the ???????? in it)
-You need to set it up as a pointer, like I have shown. If that doesn't work, write your script as Xblade has shown...as a pointer.
Back to top
View user's profile Send private message
Avoider
How do I cheat?
Reputation: 0

Joined: 10 Jul 2014
Posts: 6

PostPosted: Sun Jul 13, 2014 1:48 pm    Post subject: Reply with quote

Oh my god! 1000 Thanks to you ++METHOS Smile

I wrote it in the address field because cheat engine did not let me enter the register name into the base address field of a pointer.

But this was caused because i have to check the script first, so cheat engine knows that the register exists, otherwise it won't work and cheat engine doesn't save the address!


But yep, now it works like a charm!!! again, 1000 Thanks Very Happy


And of course 1000 Thanks to you Xblade too !!!

I tested it and it would also work with the code i wrote (alloc 4 bytes and store it in it), but you are right that i just need a label which points to the correct address.
First i did that the exact same way (with just a label and register it as symbol and set the default address to zero) but over time i tried it with the alloc method, but yeah, you are totally right, thanks for bring that back in my mind !! Smile


Guys... Did i say, Thank you 1000 times?? no? ok! Thank you guys 1000 times Razz

Now i am happy like hell ^^

Thanks, again

PS: If i would find the reputation button... I would give you both +1 ^^

edit*
Damn, i can't find anything...
If you guys could help me find the reputation button... ^^
Or do i have to gain some first to refer to someone else?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites