| View previous topic :: View next topic |
| Author |
Message |
douglaspr How do I cheat?
Reputation: 0
Joined: 03 Jan 2015 Posts: 7
|
Posted: Mon Dec 05, 2016 2:53 pm Post subject: How Freeze WriteProcessMemory from Cheat Engine Works? |
|
|
Hello,
I need some help, i'm coding a dll who modify some value from a offline game. but if i freeze the value game crashs (Stop Working after some time) and if i freeze this same value with cheat engine game don't crash.
This is my code:
Here i create a thread who updates the address:
[code]CreateThread(nil, 0, @UpdateAddr, Pointer(nil), 0, rodaid)[/code]
and here is the function UpdateAddr:
[code]procedure UpdateAddr;
var
BytesWrite : DWORD;
buf : Cardinal;
begin
while true do begin
buf := Random(38);
WriteProcessMemory(ProcessH, SpeedAddr, addr(buf), sizeof(buf), BytesWrite);
end;[/code]
And here how i open the process:
[code]ProcessH := OpenProcess (PROCESS_ALL_ACCESS, False, ProcessId);[/code]
For any reason who i dont know the game crashs after some time when the thread are created, and with freeze from cheat engine game works fine.
Somebody can help me?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 475
Joined: 09 May 2003 Posts: 25975 Location: The netherlands
|
Posted: Mon Dec 05, 2016 3:48 pm Post subject: |
|
|
is speedaddr always the same addres ?(so not a pointer)
if it is the same,make sure the address is writable
if it isn't (e.g. a pointer) then there can be points where the path is invalid and thus causes a crash
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
douglaspr How do I cheat?
Reputation: 0
Joined: 03 Jan 2015 Posts: 7
|
Posted: Mon Dec 05, 2016 4:09 pm Post subject: |
|
|
Yes speedaddr is always the same address,
How i can see if the address is writable? and if not turn it writable?
i use the same address from cheat engine, and like i said. on cheat engine the game work fine with value freezed. but on my dll the game crashs.
---
On cheat engine the address who i use only appear if i select "writable" so i believe this address is writable no? how the freeze from cheat engine works?
it's just writeprocessmemory on a while true or what? need something more?
|
|
| Back to top |
|
 |
douglaspr How do I cheat?
Reputation: 0
Joined: 03 Jan 2015 Posts: 7
|
Posted: Wed Dec 07, 2016 10:25 am Post subject: |
|
|
| If you can't help me say and i ask on another forum.
|
|
| Back to top |
|
 |
ulysse31 Master Cheater
Reputation: 2
Joined: 19 Mar 2015 Posts: 324 Location: Paris
|
Posted: Wed Dec 07, 2016 10:39 am Post subject: |
|
|
Indeed if you find the address after scans with the writable checked (not partially checked/empty) it does mean that the address is writable.
Instead of opening new threads on dif forums, please consider using google.
change writable state : virtualprotect.
Wonder how CE does it ? i'd bet on writeprocessmemory, you could breakpoint CE's wirteprocmem function to find out for sure. You can also check CE's doc or CE' source, yk, simple researchs..
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 475
Joined: 09 May 2003 Posts: 25975 Location: The netherlands
|
Posted: Wed Dec 07, 2016 11:56 am Post subject: |
|
|
are you sure the address is correct?
e.g a common mistake is that people read game.exe+00561204 as 0x00561204, which it is not
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
douglaspr How do I cheat?
Reputation: 0
Joined: 03 Jan 2015 Posts: 7
|
Posted: Wed Dec 07, 2016 12:02 pm Post subject: |
|
|
Yes, i'm using the correct address. The same as from C.E who is the same as every time who i open the game.
i tried with the code from C.E:
[code]function rewritedata(processhandle: thandle; address:Pointer; buffer: DWORD; size:dword): boolean;
var
original, a : dword;
s : SIZE_T;
begin
//make writable, write, restore, flush
VirtualProtectEx(Processo, address,size,PAGE_EXECUTE_READWRITE,original);
result:=writeprocessmemory(Processo,address,@buffer,size,s);
size:=s;
VirtualProtectEx(Processo,address,size,original,a);
end;[/code]
writing a byte (random(38)) size 1, the game dont crash but lock the screen, i cant move the character or something else.
|
|
| Back to top |
|
 |
|