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 


Code injection doesn't writes the adress.

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

Joined: 09 Oct 2015
Posts: 3
Location: Rio de Janeiro

PostPosted: Mon Nov 14, 2016 10:18 am    Post subject: Code injection doesn't writes the adress. Reply with quote

Hello,

I'm trying to make a cheat to Political Machine 2016 0.80. In this cheat i'm trying to increase the awareness of the player in all states to 100%, and decreases the awareness of the AI in all states to 0%. The Awareness of a state is a Float, is easy to found it.

Then, i collect 3 addresses containing the awareness of the player, and 2 addresses containing the awareness of AI. I use a Structure Dissect containing 2 groups, one group contains the addresses of player awareness and the other group the AI awareness. The offset that identifies if is the player is the 1A0 (1= player / 0=AI).

I found the code that writes the awareness, then i inject a code that compare if the offset 1A0 is 1 to writes 100.00 (Float) in the address, if the value of offset is 0 the code jumps to originalcode. But this doesn't work, the player awareness doesn't change to 100.00.

Here is my code:

Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
registersymbol(testa)
label(returnhere)
label(originalcode)
label(exit)
label(esit)
alloc(testa,4)

newmem: //this is allocated memory, you have read,write,execute access
mov [testa],(Float)100.0 //[testa] is the player awareness that i want (in this case: 100%)
cmp [ecx+1A0], 1 //compare if is the player awareness (1=player;0=AI)
jne esit //see the explanation below
fld dword ptr [testa]
fstp dword ptr [ecx]

//i put the code in "originalcode" too because it doesn't work only in the "newmen'
originalcode:
mov [testa],(Float)100.0 //[testa] is the player awareness
cmp [ecx+1A0], 1 //compare if is the player awareness (1=player;0=AI)
jne esit //see the explanation below
fld dword ptr [testa]
fstp dword ptr [ecx]

esit: //this is the original code, if the 1A0 is 0, the code jumps to here
fstp dword ptr [ecx]
mov ecx,[PM2016.exe+31227C]

exit:
jmp returnhere

"PM2016.exe"+12C432:
jmp newmem
nop
nop
nop
returnhere:


 
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"PM2016.exe"+12C432:
fstp dword ptr [ecx]
mov ecx,[PM2016.exe+31227C]
//Alt: db D9 19 8B 0D 7C 22 3D 00
[/code]


Screenshot_4.png
 Description:
Code that writes the Awareness.

Address =PM2016.exe+12c432
 Filesize:  2.31 KB
 Viewed:  3485 Time(s)

Screenshot_4.png



Screenshot_3.png
 Description:
The Structure dissect.

The offset is 01A0. Value type = Float
1 = Player
0 = AI
 Filesize:  44.99 KB
 Viewed:  3485 Time(s)

Screenshot_3.png



Screenshot_2.png
 Description:
Print of Awareness.

PP / AA

Where PP is the Player Awareness and AA the AI Awareness. The Value Type is a Float.
 Filesize:  66.01 KB
 Viewed:  3485 Time(s)

Screenshot_2.png



_________________
“Government is the great fiction, through which everybody endeavors to live at the expense of everybody else.”


― Frédéric Bastiat
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 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