Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsok/petools
C# Library to handle the Portable Executable format
https://github.com/jsok/petools
Last synced: 3 months ago
JSON representation
C# Library to handle the Portable Executable format
- Host: GitHub
- URL: https://github.com/jsok/petools
- Owner: jsok
- License: mit
- Created: 2014-06-21T07:12:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-21T07:25:21.000Z (over 10 years ago)
- Last Synced: 2023-03-27T16:08:59.551Z (almost 2 years ago)
- Language: C#
- Size: 133 KB
- Stars: 7
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PETools
=======A C# Library for handling and manipulating this Portable Executable format.
Useful for modifying section data of a DLL.
Some preliminary work for supporting COFF with basic ability to read symbol tables.
Usage
-----```csharp
using PETools;
PETool pe = new PETool();
pe.Read("target.dll");
using (MemoryStream stream = new MemoryStream(pe.GetSectionData(".data")))
{
// read contents using `stream` object
stream.Close()
}// It's also possible to replace section data, e.g.:
byte[] data = ...;
pe.WriteSectionData(".data", data);// Call layout to fix up headers and section layout
pe.Layout();// Write it back to disk
pe.WriteFile("target.dll");```