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 


Bug: Dissect structure

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

Joined: 30 Aug 2011
Posts: 2

PostPosted: Tue Aug 30, 2011 2:10 pm    Post subject: Bug: Dissect structure Reply with quote

There is a design flaw in the way automatically generated structures are handled and user defined structures are saved - leads to CE crash.

If you define a structure ST1 at address A, have CE fill it with 4096 bytes worth of variables and then turn on auto structure generation, CE will create structure ST1 as structure 1 and add the auto generated ones at 2+.

Let's say there are 20 autogenerated structures (2-21) and you now create another structure ST2, it will be structure 22. If you now modify a pointer in ST1 and associate it to ST2, the data for ST1 will point to structure 22.

So far so good, but the problem occurs when all of this is saved to a CT file.

Only the user generated structures are saved and there will be exactly two of these, ST1 and ST2. The problem is that when ST1 is saved the data will still point to structure 22, which is not defined in the CT file.

When the CT file is loaded in a future session and ST1 is selected for an address, CE MAY crash because structure 22 does not exist. I say may, because junk data is unpredictable.

For me, the crash happened in ReadProcessMemory at line 821 in Structurefrm.pas
Code:
       //it's a defined structure (has to be a pointer)
        if c=0 then typename:=definedstructures[snr].name;

        if ReadProcessMemoryS(processhandle,pointer(addresses[c].address+elementoffset),@buf[0],8,x) then


The actual problem is further up where SNR became the invalid index 22.

It is clear that the reference to structure 22 needs to be changed to 2 when ST1 is saved, but I don't have a fix for you as I just started looking at CE a few days ago and I only installed Lazarus a few hours ago and I have not seen Pascal in about 25 years. Smile
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Tue Aug 30, 2011 2:46 pm    Post subject: Reply with quote

thank you. I'll look into it
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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