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 


Invalid address for ReadMem?

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

Joined: 23 Aug 2009
Posts: 7

PostPosted: Tue Nov 19, 2013 9:45 pm    Post subject: Invalid address for ReadMem? Reply with quote

Hi all, I'm making a cheat for a flash game I'm playing.
This cheat overrides part of the code in a function to un randomize the obtained bonus.

I like keeping things clean & tidy (also I want to re randomize sometimes)
So I'm saving the original code, to recover it when disabling the cheat.

The cheat works aok, I confirmed it by adding the symbols to the cheatlist and I see how the "saved" and "active" code changes as it should.

But for some reason I keep getting this error message when I press the OK button:
Quote:
(Error in line 18 (readmem(mOldCode, 24)) :Invalid address for ReadMem)


This is the code for the cheat, if anyone is able to pinpoint the problem and satiate my curiosity I'll be very grateful Smile

The aob uses plenty of wildcards, specially where I'm modifying the code, since some of them are doubles and object properties, which changes each version.
It's also pretty long (156B), since I want to be sure I found the correct function (and make it fail if the function's structure was changed)

Code:
[ENABLE]
aobscan(_mCode, [aob here])
label(mCode)
registersymbol(mCode)

alloc(mOldCode, 24)
registersymbol(mOldCode)

mOldCode:
readmem(_mCode+78, 24)

_mCode+78:
mCode:
db d3 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02

[DISABLE]
mCode:
readmem(mOldCode, 24)

unregistersymbol(mCode)
unregistersymbol(mOldCode)
dealloc(mOldCode)



Thanks in advance!!


EDIT: Forgot to say: I'm using CheatEngine 6.3 x64
Back to top
View user's profile Send private message
SteveAndrew
Master Cheater
Reputation: 30

Joined: 02 Sep 2012
Posts: 323

PostPosted: Wed Nov 20, 2013 12:16 am    Post subject: Reply with quote

hmm... I was unaware that Auto Assembler had such a feature available to it, but I've tested it an yes it does in fact work in the way you've shown...

I too received that message, at the time of editing the script I guess it can't seem to figure out what address it's supposed to call for the 'readmem' function. However if you just click okay force it to edit to to that, upon actually trying to enable it, it does in fact work! I tried it out for my assassins creed 4 health cheat I made.

It uses the 'readmem' function not only to disable the cheat, but to copy the original code into the script rather than hard coding it!

I see how this could be very useful in certain situations!

Code:

//Assassin's Creed 4: Black Flag
//Infinite Health
//Steve Andrew
[enable]
alloc(InfiniteHealth,1024)
aobscan(HealthAddress,66 89 ? 5c 85 ff 79 ? 80)
label(OriginalCode)
registersymbol(HealthAddress)
registersymbol(OriginalCode)

InfiniteHealth:
mov ax,[esi+5e] //Thanks for offset ColdFusion73! ;)
OriginalCode:
readmem(HealthAddress,6)
jmp HealthAddress+6

HealthAddress:
jmp InfiniteHealth
nop

[disable]

HealthAddress:
readmem(OriginalCode,6)
//db 66 89 46 5c 85 ff
//mov [esi+5c],ax
//test edi,edi

dealloc(InfiniteHealth)
unregistersymbol(HealthAddress)
unregistersymbol(OriginalCode)

_________________
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25296
Location: The netherlands

PostPosted: Wed Nov 20, 2013 12:42 am    Post subject: Reply with quote

Yes, just force ce to use it. This error is because at the time the disable part is syntax checked, the symbol hasn't been registered yet
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
MixerMax
How do I cheat?
Reputation: 0

Joined: 23 Aug 2009
Posts: 7

PostPosted: Wed Nov 20, 2013 6:15 am    Post subject: Reply with quote

Dark Byte wrote:
Yes, just force ce to use it. This error is because at the time the disable part is syntax checked, the symbol hasn't been registered yet
Thought so, thanks a lot for confirming it !!

Tried registering a label instead of the var, and it doesn't recognize this either.
Guess the syntax check for functions params works differently than the one for assembly.

Is there (or will there be) a way to let the syntax checker know the symbol will exist at runtime?
I mean, it sure knows about label mCode Smile

My OCD compels me to work something off to avoid the error message, and I really don't want to replace readMem with a bunch of mov Razz
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 Lua Scripting 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