Jump to content
Tuts 4 You

Dumping section in c#?


MindSystem

Recommended Posts

Posted

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 

 

Posted

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
Posted
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 :)

Posted
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.

Posted
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 

Posted
Just now, MindSystem said:

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

lol

Posted
Just now, mrexodia said:

lol

?

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
×
×
  • Create New...