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 


PE Header

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
iNoobHacker
Advanced Cheater
Reputation: 0

Joined: 05 Nov 2006
Posts: 99

PostPosted: Sat Mar 07, 2009 4:10 am    Post subject: PE Header Reply with quote

Hi,

I'm trying to read the PE Header of a file, so I used the MapViewOfFile API which returned the starting address of the PE Header in the calling process, I want to access the import address for example so I'm adding the RVA to the base address, but when I'm trying to access some address, for example the entry point, I add the RVA to the base address but I get to some diffrent address.

I tested this on notepad.exe and I searched for the entry point manually and I found out that the addresses are subtracted by 0xF00 for some reason, so if the entry point RVA was 0x7604 then the address was base+0x6704, or if the IAT is at 0x1000 then the address was base+0x100.

In runtime, the addresses are correct, however when I read the file the addresses are subtracted by 0xF00, at least on notepad it does.

Does anyone know what the problem might be?

_________________
"Two things are infinite: the universe and human stupidity, but I'm still not sure about the first one."
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Sat Mar 07, 2009 4:23 am    Post subject: Reply with quote

If you read it from a file, you first have to parse the section headers, and then convert the RVA to an offset in one of the sections.
Back to top
View user's profile Send private message
iNoobHacker
Advanced Cheater
Reputation: 0

Joined: 05 Nov 2006
Posts: 99

PostPosted: Sat Mar 07, 2009 12:57 pm    Post subject: Reply with quote

How do I know which section contains the IAT and all the rest?
And how do I get the section headers base addresses? or I just add their offsets to the image base?

Bump...

_________________
"Two things are infinite: the universe and human stupidity, but I'm still not sure about the first one."
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 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