Jump to content
Tuts 4 You
Sign in to follow this  
MindSystem

Dumping section in c#?

Recommended Posts

MindSystem

Hi, I would like to know how I can dump the section of a NATIVE executable using c# ? 

PS : the section I would like to dump is an added section (so not .text, .reloc, .rsrc)

Thanks you 

 

Share this post


Link to post
atom0s

Walk the PE header like normal, enumerate the sections and dump the target section you want. There is nothing special about it being a native image or that you are coding in C#.

Here is code I wrote for my Steamless project to read the PE headers of files:

32bit: https://github.com/atom0s/Steamless/tree/master/Steamless.API/PE32

64bit: https://github.com/atom0s/Steamless/tree/master/Steamless.API/PE64

  • Like 2
  • Thanks 1

Share this post


Link to post
MindSystem
50 minutes ago, atom0s said:

Walk the PE header like normal, enumerate the sections and dump the target section you want. There is nothing special about it being a native image or that you are coding in C#.

Here is code I wrote for my Steamless project to read the PE headers of files:

32bit: https://github.com/atom0s/Steamless/tree/master/Steamless.API/PE32

64bit: https://github.com/atom0s/Steamless/tree/master/Steamless.API/PE64

That's all I need, thanks you :)

Share this post


Link to post
mrexodia
3 hours ago, atom0s said:

Walk the PE header like normal, enumerate the sections and dump the target section you want. There is nothing special about it being a native image or that you are coding in C#.

Here is code I wrote for my Steamless project to read the PE headers of files:

32bit: https://github.com/atom0s/Steamless/tree/master/Steamless.API/PE32

64bit: https://github.com/atom0s/Steamless/tree/master/Steamless.API/PE64

https://github.com/atom0s/Steamless/blob/master/Steamless.API/PE32/Pe32File.cs#L111

You might wanna check https://corkamiwiki.github.io/PE probably steam doesn't output these exotic files, but it's still worth checking out alignment on PointerToRawData and SizeOfRawData being ignored if VirtualSize is smaller.

Share this post


Link to post
MindSystem
32 minutes ago, mrexodia said:

https://github.com/atom0s/Steamless/blob/master/Steamless.API/PE32/Pe32File.cs#L111

You might wanna check https://corkamiwiki.github.io/PE probably steam doesn't output these exotic files, but it's still worth checking out alignment on PointerToRawData and SizeOfRawData being ignored if VirtualSize is smaller.

That was for making an unpacker for BoxedAppPacker (.net) so all is working fine 

Share this post


Link to post
mrexodia
Just now, MindSystem said:

That was for making an unpacker for BoxedAppPacker (.net) so all is working fine 

lol

Share this post


Link to post
MindSystem
Just now, mrexodia said:

lol

?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×
×
  • Create New...