Flag: Tornado! Hurricane!

 Forums >>  Brainstorms - General  >>  pe sections merging

Topic created on: November 16, 2009 12:25 CST by stonerhash .

Hi guys

I've been trying to understand how PE works so I used LordPE and tried to merge same sections like .data, .idata, .rdata and combine them to one paying attention at the offsets and the flags. The resulting binary is always crashing.

Why? The offsets are definitely ok and the flags also any guess?

  RabidCicada     December 28, 2009 11:42.22 CST
You've got a lot more to look at than you thought:).  The PE format is very detailed and was created to be very flexible.  This design also creates many points you need to worry about whne you are trying to alter the structure.  I think it would do you well to read up a lot more on the PE format and understand the implications of what pieces you are modifying with LordPE.

Matt pietrick wrote some very good articles and the PE format has been around and stable for a very long time.  Take a look at In Depth Look Win32 PE
and In Depth Look Win32 PE Part 2.  Both those fill you in a lot.  Then looking directly at the PE-COFF format should definitely let you know how you are affecting the executable.

You could also read up on how the Windows linker does it's job to load an EXE to understand more about how the PE format gets used by windows.

I've given you resources and pointers to teach yourself as I can't possibly know what is causing your particular crash.

You just need to understand as much as you can then experiment to prove your understanding.

I would imagine that in attempting to merge the sections you broke the linking process (Windows load time linker can't figure out where everything is etc) or you broke the application code contained in the PE because of changes in locations of data/code.

  cseagle     December 29, 2009 01:20.43 CST
You may have a permissions problem.  .data is traditionally RW while .rdata is traditionally read only.  What are the permissions on the merged section?

Note: Registration is required to post to the forums.

Active in Last 5 Minutes
jesucito81

There are 28,225 total registered users.


Recently Created Topics
Reverse Engineering ...
Jan/23
Career: DoD Agency I...
Jan/22
"Disappearing&q...
Jan/17
Career: Software Sec...
Jan/11
Where is the call st...
Jan/07
IDA Pro 6.1 Breakpoi...
Jan/01
How to create data s...
Dec/30
can i search all mod...
Dec/23
IDA symbol table exp...
Dec/20
An anti-attach trick
Dec/17


Recent Forum Posts
Reverse Engineering ...
NirIzr
"Disappearing&q...
NirIzr
Reverse Engineering ...
charlie
"Disappearing&q...
charlie
An anti-attach trick
Bass
An anti-attach trick
waleeda...
An anti-attach trick
Bass
An anti-attach trick
waleeda...
An anti-attach trick
Bass
Looking for value in...
NirIzr


Recent Blog Entries
cmathieu
Feb/07
Hacker Carnival

waleedassar
Feb/06
OllyDbg v1.10 And Hardware ...

waleedassar
Jan/31
Yet Another Anti-Debug Trick

RolfRolles
Jan/22
Finding Bugs in VMs with a ...

waleedassar
Jan/13
An OllyDbg Bug Disables Sof...

More ...


Recent Blog Comments
waleedassar on:
Feb/07
OllyDbg v1.10 And Hardware ...

NirIzr on:
Feb/07
OllyDbg v1.10 And Hardware ...

NirIzr on:
Feb/05
Yet Another Anti-Debug Trick

trolotou on:
Feb/05
Doudoune Moncler -Pennies F...

waleedassar on:
Feb/01
Yet Another Anti-Debug Trick

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit