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 


It should but doesn't let me compile

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
wayden
Cheater
Reputation: 0

Joined: 09 Dec 2020
Posts: 27

PostPosted: Tue Jul 11, 2023 5:17 pm    Post subject: It should but doesn't let me compile Reply with quote

Hi,
In the following code Adress is a newmem allocated in an other script PlayerBase is a pointer to a struct

Code:

[ENABLE]

define(Setinvincible,Character_CustomModule:PersistentUpdate) // should be unique
define(ResetBytes,Adress+A1)
registersymbol(Setinvincible)
registersymbol(ResetBytes)


ResetBytes:
  db 48 83 EC 08 48 83 C4 08


Adress+50:
  push rax
  mov rax, qword ptr[PlayerBase]
  add rax, 2A1
  mov byte ptr [rax], 01
  mov rax, qword ptr[ResetBytes]
  mov qword [Setinvincible], rax
  pop rax
  jmp Setinvincible

Setinvincible:
  jmp Adress+50
  nop
  nop
  nop

[DISABLE]

Adress+50:
  push rax
  mov rax, qword ptr[PlayerBase]
  add rax, 2A1
  mov byte ptr [rax], 00
  mov rax, qword ptr[ResetBytes]
  mov qword [Setinvincible], rax
  pop rax
  jmp Setinvincible

Setinvincible:
  jmp Adress+50
  nop
  nop
  nop

unregistersymbol(Setinvincible)
unregistersymbol(ResetBytes)


Cheat engine doesn't let me compile this script due to this line : mov rax, qword ptr[ResetBytes]
in the Disable section wich is the same as the one in Enable section, so i found a way to bypass that by just
modifying the Disable section like this :
Code:


[DISABLE]

Adress+5E:
  mov byte ptr [rax], 00

Setinvincible:
  jmp Adress+50
  nop
  nop
  nop

unregistersymbol(Setinvincible)
unregistersymbol(ResetBytes)

this solution works fine but it doesn't explain why it wouldn't let me compile even when it's literaly the same line at the same adress in the enable section
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 150

Joined: 06 Jul 2014
Posts: 4652

PostPosted: Tue Jul 11, 2023 10:59 pm    Post subject: Reply with quote

I'm not sure what's going on. Maybe the symbol `ResetBytes` is getting re-registered elsewhere...?

Does it work if you put `define(ResetBytes,Adress+A1)` above [ENABLE]?

_________________
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
wayden
Cheater
Reputation: 0

Joined: 09 Dec 2020
Posts: 27

PostPosted: Wed Jul 12, 2023 1:59 am    Post subject: Reply with quote

Yep that was the problem apparently. I guess it just "undefine" it automaticly when disabling, im gonna add all my define in the parent script so it won't be a problem. Thanks you for the answer !
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