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 


Accessing PEB to get wow64cpu.dll handle?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Sat Jul 01, 2017 1:00 pm    Post subject: Reply with quote

If you are using Visual Studio, you can use intrinsics to read the needed information.

For 32bit processes, you can do the same as inline asm like this:
Code:

auto pTEB = (BYTE*)__readfsdword(0x18);
auto pPEB = *(PEB32**)(pTEB + 0x30);


You will need to get a valid PEB32 structure definition from either a Windbg dump or from another source.

In 64bit you can do the same via:
Code:

auto pTEB = (BYTE*)__readgsqword(0x30);
auto pPEB = *(PEB64**)(pTEB  + 0x60);


Again you will need a valid PEB64 structure definition.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Mon Jul 03, 2017 1:16 pm    Post subject: Reply with quote

The module linked lists are connected in an "endless loop" list. Meaning that the last entry reconnects back to the first. So when you loop through it, you need to compare if the next FLink is going to be the first module in the list and stop looping at that point, otherwise you are going to loop forever.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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