📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








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.

There are 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit