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 


CheatEngine script to C# Code | Getting register value

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

Joined: 01 Mar 2019
Posts: 2

PostPosted: Thu Mar 07, 2019 7:32 am    Post subject: CheatEngine script to C# Code | Getting register value Reply with quote

Hello. I need your help, I have wrote script in Cheat Engine which puts ecx value to global variable. (and then I use this global variable as pointer with offset and I get needable value)
Script is provided below(for some reason I hidden game-name)

I need to write code in c# which will return to me this ecx value
Code:
mov al,[ecx+00000C58]

(without using CheatEngine)



A possible solution is to write code after this default code which will put ecx value to global variable(so, I implemented it in CE script)

But I don't know how to do similar in C#. I know how to read/write memory in address but I don't know how to write my custom assembly code after currently assembly code, basically I don't know how to allocate memory for code which will be executed after default code
Code:

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

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

originalcode:
mov al,[ecx+00000C58]
mov [fow3],ecx

exit:
jmp returnhere

"game_name.exe"+428220:
jmp newmem
nop
returnhere:


[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"game_name.exe"+428220:
mov al,[ecx+00000C58]
//Alt: db 8A 81 58 0C 00 00
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