Expand description
Resource editor for portable executables.
Supports:
- Parsing and modification of portable executables
- Resource editing including icons, manifests, subsystem, version info and more!
- Resource transfer between files
See Image for the main entry point and ResourceDirectory for working with resource directories.
§Examples
§Adding an icon or manifest to an executable
let mut image = Image::parse_file("damocles.exe")?;
let mut resources = image.resource_directory().cloned().unwrap_or_default();
resources.set_main_icon_file("sword.png")?;
let manifest = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
resources.set_manifest(manifest)?;
image.set_resource_directory(resources)?;
image.write_file("damocles.exe");§Transferring resources between executables
let source = Image::parse_file("damocles.exe")?;
let resources = source.resource_directory().unwrap();
let mut target = Image::parse_file("fortuna.exe")?;
target.set_resource_directory(resources.clone())?;
target.write_file("fortuna.exe");§Cargo features
§Default features
std: Enables standard library features, including reading and writing files.images: Enables support for converting and resizing images in other formats when setting icons. Also enablesstd.
Modules§
Structs§
- Image
- Portable executable image representation.
- Read
Error - Error that can occur when reading and parsing bytes.
- Resource
Data - Raw resource data.
- Resource
Directory - Portable executable resource directory.
- Resource
Table - Portable executable resource table.
- Version
Info - Version info resource. This is a special resource that contains the version information of the executable.
- Version
String Table - Version string table. This is an entry in the version info resource.
Enums§
- Data
Directory Type - Image data directory type enumeration.
- Dynamic
Image images - A Dynamic Image
- Image
Read Error - Errors that can occur when reading a PE image.
- Image
Write Error - Errors that can occur when writing a PE image.
- Resource
Entry - Resource entry in a resource table. This can be either a child table or raw data.
- Resource
Entry Name - Resource directory entry name. This can either be a raw id or a name.
- Resource
Error - Errors that can occur when modifying resource data.
Traits§
- ToIcon
- Trait for data types that can be converted to icon data.