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 


How Freeze WriteProcessMemory from Cheat Engine Works?

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

Joined: 03 Jan 2015
Posts: 7

PostPosted: Mon Dec 05, 2016 2:53 pm    Post subject: How Freeze WriteProcessMemory from Cheat Engine Works? Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 25974
Location: The netherlands

PostPosted: Mon Dec 05, 2016 3:48 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
douglaspr
How do I cheat?
Reputation: 0

Joined: 03 Jan 2015
Posts: 7

PostPosted: Mon Dec 05, 2016 4:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
douglaspr
How do I cheat?
Reputation: 0

Joined: 03 Jan 2015
Posts: 7

PostPosted: Wed Dec 07, 2016 10:25 am    Post subject: Reply with quote

If you can't help me say and i ask on another forum.
Back to top
View user's profile Send private message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Wed Dec 07, 2016 10:39 am    Post subject: Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 25974
Location: The netherlands

PostPosted: Wed Dec 07, 2016 11:56 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
douglaspr
How do I cheat?
Reputation: 0

Joined: 03 Jan 2015
Posts: 7

PostPosted: Wed Dec 07, 2016 12:02 pm    Post subject: Reply with quote

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
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