Skip to content
/ BlobPE Public

Need only one file ? .NET package that adds embedded key/value persistence to any standalone executable.

License

Notifications You must be signed in to change notification settings

Miiraak/BlobPE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Need only one file ? .NET package that adds embedded key/value persistence to any standalone executable.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •  

Languages