Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Portable executable file analysing using c#

C/C++ has the set of predefined structures and constants corresponding to an exe-header and so on. Do exist some analogical standard namespaces, classes in C# special for analyzing of portable executable files? Or is it only a prerogative of unmanaged unsafe more native languages?

like image 356
SerG Avatar asked Oct 01 '13 10:10

SerG


2 Answers

There exists an managed library called PeNet which is available as open source and as a NuGet package, too. You can access and change nearly all structures in the PE header with this library. PeNet GitHub

Disclaimer: I'm the main author of the library

like image 74
secana Avatar answered Sep 28 '22 04:09

secana


There's not much built-in to the language (if anything), but there's lots of examples out there, such as

  • https://web.archive.org/web/20160312145447/http://code.cheesydesign.com/?p=572
  • https://web.archive.org/web/20150826092221/http://sergeyakopov.com/2010/11/reading-pe-format-using-data-marshaling-in-net/
like image 31
Surfbutler Avatar answered Sep 28 '22 04:09

Surfbutler