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 


Confusion about label & symbol

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

Joined: 22 Sep 2023
Posts: 8

PostPosted: Tue Mar 19, 2024 6:46 am    Post subject: Confusion about label & symbol Reply with quote

Have done an easy script, but when I use 'label' for my address, it would say "INJECT Error:Not all results found" and then game would crash if I triggered relevant action.
Code:
aobscanmodule(INJECT,HWR.exe,5C 00 90 0F B7 C5 90 F3 0F 11 44 24 1C 8B 4C 24 1C 81 F1) // should be unique
alloc(newmem,$1000)
alloc(mag,4)

label(code)
label(return)
label(mag)

mag:
  dd (float)1

newmem:
  movss xmm0,[mag]
  jmp code

code:
  movss [esp+1C],xmm0
  jmp return

INJECT+06:
  jmp newmem
  nop
return:
registersymbol(INJECT)

[DISABLE]

INJECT+06:
  db F3 0F 11 44 24 1C

unregistersymbol(INJECT)
dealloc(newmem)

Then I changed to use 'registersymbol', it worked well. Why is that?
PS: I didn't use 'mag' outside the script. The only thing I triggered was this script.
Code:
aobscanmodule(INJECT,HWR.exe,5C 00 90 0F B7 C5 90 F3 0F 11 44 24 1C 8B 4C 24 1C 81 F1) // should be unique
alloc(newmem,$1000)
alloc(mag,4)

label(code)
label(return)

mag:
  dd (float)1

newmem:
  movss xmm0,[mag]
  jmp code

code:
  movss [esp+1C],xmm0
  jmp return

INJECT+06:
  jmp newmem
  nop
return:
registersymbol(INJECT mag)

[DISABLE]

INJECT+06:
  db F3 0F 11 44 24 1C

unregistersymbol(INJECT mag)
dealloc(newmem)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Tue Mar 19, 2024 7:31 am    Post subject: Reply with quote

when you use alloc you must not use label on the same symbol

because you used label(mag) the alloc got erased. and since there's no address specifier before mag: mag will be put at address 00000000, which is not valid. so when the game accesses mag (address 00000000) it'll crash

_________________
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
bmmlst310
How do I cheat?
Reputation: 0

Joined: 22 Sep 2023
Posts: 8

PostPosted: Tue Mar 19, 2024 7:57 am    Post subject: Reply with quote

Dark Byte wrote:
when you use alloc you must not use label on the same symbol

because you used label(mag) the alloc got erased. and since there's no address specifier before mag: mag will be put at address 00000000, which is not valid. so when the game accesses mag (address 00000000) it'll crash


I see. I did found the address 00000000 but not paid much attentino to it. Thank you very much for your prompt reply.
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