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 


Help, Unable to activate script 2

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

Joined: 02 Jan 2017
Posts: 12

PostPosted: Thu Jan 26, 2017 5:54 am    Post subject: Help, Unable to activate script 2 Reply with quote

Hello, I have the following problem, I have some script, I can activate them and they work fine, but I can not activate more than one, they are in the same address of memory, can someone help correct it?

See below hp and mp full, I can not use the 2 remains only the last one to be activated

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


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


originalcode:
fld dword ptr [esi+04]
fucompp

cmp [esi] CC
je hp
jmp returnhere

hp:
mov [esi+04], (float)254

exit:
jmp returnhere
"epic.exe"+15222:
jmp newmem
returnhere:

[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"epic.exe"+15222:
fld dword ptr [esi+04]
fucompp
//Alt: db D9 46 04 DA E9


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


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


originalcode:
fld dword ptr [esi+04]
fucompp

cmp [esi], 40800000000009A7
je mphack
jmp returnhere

mphack:
mov [esi+04] (float)4.0

exit:
jmp returnhere

"epic.exe"+15222:
jmp newmem
returnhere:

[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"epic.exe"+15222:
fld dword ptr [esi+04]
fucompp
//Alt: db D9 46 04 DA E9
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Jan 26, 2017 9:46 am    Post subject: Reply with quote

Use one injection for both manipulations.

For example:

Code:
[ENABLE]

alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(mphack)
label(hp)


newmem:

cmp [esi], 40800000000009A7
je mphack
cmp [esi], CC
je hp
jmp originalcode

mphack:
mov [esi+04], (float)4.0
jmp originalcode

hp:
mov [esi+04], (float)254
jmp originalcode

originalcode:
fld dword ptr [esi+04]
fucompp
jmp returnhere

"epic.exe"+15222:
jmp newmem
returnhere:

[DISABLE]

dealloc(newmem)
"epic.exe"+15222:
fld dword ptr [esi+04]
fucompp
//Alt: db D9 46 04 DA E9
Back to top
View user's profile Send private message
rajada1
Newbie cheater
Reputation: 0

Joined: 02 Jan 2017
Posts: 12

PostPosted: Thu Jan 26, 2017 10:00 am    Post subject: Reply with quote

Thanks for the answer.
But I figured it out but on some occasion I wanted to use only hphack or just mp hack. Or how to disable only one of them?
it's possible ?
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Jan 26, 2017 10:19 am    Post subject: Reply with quote

Yes, it's possible. Set up a trigger using custom labels/symbols (see script below). Then, in your cheat table, create entries for those symbols after the script is activated (add address manually and use mp_enabled and hp_enabled as the address values) and assign hotkeys to them (1 for on, 0 for off).

Code:
[ENABLE]

alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(hp)
label(mp)
label(hp_enabled)
label(mp_enabled)

registersymbol(hp_enabled)
registersymbol(mp_enabled)

newmem:
cmp [esi], 40800000000009A7
je mp
cmp [esi], CC
je hp
jmp originalcode

mp:
cmp byte ptr [mp_enabled],1
jne originalcode
mov [esi+04], (float)4.0
jmp originalcode

hp:
cmp byte ptr [hp_enabled],1
jne originalcode
mov [esi+04], (float)254
jmp originalcode

originalcode:
fld dword ptr [esi+04]
fucompp
jmp returnhere

hp_enabled:
db 0
mp_enabled:
db 0

"epic.exe"+15222:
jmp newmem
returnhere:

[DISABLE]

dealloc(newmem)
"epic.exe"+15222:
fld dword ptr [esi+04]
fucompp
//Alt: db D9 46 04 DA E9

unregistersymbol(hp_enabled)
unregistersymbol(mp_enabled)
Back to top
View user's profile Send private message
rajada1
Newbie cheater
Reputation: 0

Joined: 02 Jan 2017
Posts: 12

PostPosted: Thu Jan 26, 2017 12:02 pm    Post subject: Reply with quote

Thanks, this was very useful, my idea is to make a Trainer a little more automated, I need now learn to leave this automatic manual change, and in the end put increment check box to do this
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