BlobPE 1.1.2

dotnet add package BlobPE --version 1.1.2
                    
NuGet\Install-Package BlobPE -Version 1.1.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BlobPE" Version="1.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlobPE" Version="1.1.2" />
                    
Directory.Packages.props
<PackageReference Include="BlobPE" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BlobPE --version 1.1.2
                    
#r "nuget: BlobPE, 1.1.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BlobPE@1.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BlobPE&version=1.1.2
                    
Install as a Cake Addin
#tool nuget:?package=BlobPE&version=1.1.2
                    
Install as a Cake Tool

BlobPE CodeQL Published NugetUpToDate

Description

BlobPE is a lightweight and experimental .NET (C#) library that enables standalone applications to persist structured data directly within their own executable files. By injecting a compact blob (typically JSON) into the binary, BlobPE allows applications to store and modify internal key/value data without relying on external files or configurations.

The library is intended for advanced use cases such as proof-of-concept tools, binary experiments, or environments where minimizing external traces is desired. Data is stored within the executable itself, delimited by clear markers (e.g., [BLOB_START]... [BLOB_END]), and can be read, updated, and re-injected at runtime.

Warning ⚠️: BlobPE uses a non-standard approach to binary self-modification. It is not recommended for production environments, but rather for educational, exploratory, or controlled scenarios.

Builds :

  • .NET 8.0
  • .NET Standard 2.0
  • .NET 40

Features

  • Inject structured data (JSON format) directly into the application's binary.
  • Read and update key/value pairs embedded in the executable.
  • Rewrite the binary to persist updated data.
  • Self-relaunch after patching.
  • Automatic padding and blob size enforcement to ensure binary integrity.
  • No need for external configuration or storage files.
  • Automatic injection of blob headers.
  • Simple reset of the blob values to their dafault size (only space padding).
  • Supports basic data types: string, int, bool, and object serialization.
  • Blob removal and clearing functionality.

Features in Development

Binary offset alignment More robust detection and modification of embedded blobs
Obfuscation Support for basic encoding or encryption of stored data
Custom section placement Ability to store the blob in custom PE sections instead of only at the end of the file

Prerequisites

  • .NET 6.0 SDK or later
  • Windows operating system
  • Write permissions on the application’s executable file

Dependencies

User Usages (Blob.cs)

Method Description
CheckForUpdates(string[] args, Dictionary<string, int> defaultData) Checks for update args and applies updates if specified. defaultData is used when no blob is found in the binaries, using the string for key name and int for maximalData size.
RemoveUpdateFiles() Removes any update files created during the update process.
Get(string key) Retrieves a value as a string from the blob data by its key.
GetBool(string key) Retrieves a value as boolean from the blob data by its key.
GetInt(string key) Retrieves a value as integer from the blob data by its key.
Set(string key, object value) Sets the value for a specified key in the blob data.
Save() Saves the current state of the app data back into his own executable file.
Reset() Clears the blob data, removing all value, keeping the key and size value.
Delete() Deletes the blob data from the executable file, removing all traces of the stored data.

You can find a simple options setting save application example at BlobPOC.

Internal mechanics

img

Can probably be clearer or better, but give you a little idea of the workflow.

Contributing

Contributions are welcome! To contribute to this project:

  1. Fork the repository.
  2. Create a new branch (git checkout -b my-feature).
  3. Make your changes.
  4. Commit (git commit -m 'Add my feature').
  5. Push to your branch (git push origin my-feature).
  6. Open a Pull Request.

Issues and Suggestions

If you encounter issues or have suggestions for improvements, please open a ticket via the GitHub issue tracker.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Authors

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.