HeyThere How do I cheat? Reputation: 0
Joined: 01 Mar 2019 Posts: 2
|
Posted: Thu Mar 07, 2019 7:32 am Post subject: CheatEngine script to C# Code | Getting register value |
|
|
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 |
|
|