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 


registersymbol error

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

Joined: 05 Jan 2016
Posts: 3

PostPosted: Sat Aug 19, 2023 3:15 pm    Post subject: registersymbol error Reply with quote

Hi! This is my first attempt at creating a cheat table from scratch. I am still learning and got a bit frustrated with registersymbol.

When I am pressing ok with provided code, Auto Assemble throws an error:

Error in line 21 (mov [esi+48], [00000000]):This instruction can't be compiled.

Could you guys help me: why does it say that registered memory region is empty if I allocated a value there?


Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmema,2048,"noita.exe"+5BE205)
alloc(newmemb,2048,"noita.exe"+626915)

label(returnherea)
label(returnhereb)
label(increasegold)
label(decreasegold)
label(exita)
label(exitb)

alloc(amountofgold,4,"noita.exe"+5BE205)

amountofgold:
dd #1000000

registersymbol(amountofgold)

newmema: //this is allocated memory, you have read,write,execute access
mov [esi+48], [amountofgold]

increasegold:
//mov [esi+48],eax
//mov [esi+4C],edx

exita:
jmp returnherea

"noita.exe"+5BE205:
jmp newmema
nop

returnherea:

//==========================================================
newmemb:
mov ecx,#0

decreasegold:
//sub [esi+48],ecx
//mov ecx,[edx+4C]

exitb:
jmp returnhereb

"noita.exe"+626915:
jmp newmemb
nop
returnhereb:
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmema)
dealloc(newmemb)
dealloc(amountofgold)
unregistersymbol (amountofgold)
"noita.exe"+5BE205:
db 89 46 48 89 56 4C
//mov [esi+48],eax
//mov [esi+4C],edx
"noita.exe"+626915:
db 29 4E 48 8B 4A 4C
//sub [esi+48],ecx
//mov ecx,[edx+4C]



Seems like in the newer version the syntax has changed. So with this it works:

Code:

alloc(amountofgold,4)
registersymbol(amountofgold)

label(returnherea)
label(returnhereb)
label(increasegold)
label(decreasegold)
label(exita)
label(exitb)

amountofgold:
dd #100000

newmema: //this is allocated memory, you have read,write,execute access
mov [esi+48], amountofgold
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4710

PostPosted: Sat Aug 19, 2023 8:07 pm    Post subject: Reply with quote

That error CE gave could be better...

The_World wrote:
Code:
mov [esi+48], [amountofgold]
You can't do memory-to-memory moves. Use a register as an intermediary.
Code:
mov eax,[amountofgold]
mov [esi+48],eax
mov [esi+4C],edx // unless you know what this does, don't remove it


The_World wrote:
Seems like in the newer version the syntax has changed. So with this it works:
Code:
...
mov [esi+48], amountofgold
Nothing changed. It's never worked that way.
What you wrote here won't work either. `amountofgold` is an address, not a value. Sure, it will assemble, but it won't write 100000.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
The_World
How do I cheat?
Reputation: 0

Joined: 05 Jan 2016
Posts: 3

PostPosted: Sat Aug 19, 2023 11:31 pm    Post subject: Reply with quote

ParkourPenguin wrote:

What you wrote here won't work either. `amountofgold` is an address, not a value. Sure, it will assemble, but it won't write 100000.


It actually did work. But thank you for the tip.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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