GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Systemcluster/editpe: Resource Editor for parsing and modification of Windows Executables, supporting icon replacement, resource transfer between files, and more.

BranchesTags
Open more actions menu

Latest commit

 

History

46 Commits
46 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
tests
tests
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.rustfmt.toml
.rustfmt.toml
 
 
.taplo.toml
.taplo.toml
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

editpe

Crates.io Docs.rs Tests & Checks

Resource editor for portable executables.

Enables cross-platform parsing and modification of Windows executables and their resources.

Features

  • Parsing and modification of portable executables
  • Resource editing including icons, manifests, subsystem, version info and more!
  • Resource transfer between files

Compared to other resource editors like rcedit, editpe takes great care to keep the modified executable in a valid state. It does this by parsing and rebuilding the complete resource directory as well as all file and section headers, keeping existing sections intact, and leaving any additional data at the end of the file in place.

Usage

Library

Add editpe as a dependency. The std and images features are enabled by default and can be disabled for no-std support.

editpe = "0.2"
image = { version = "*", features = ["png"] } # to support additional icon file types

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 = image.resource_directory().unwrap();

let mut target = Image::parse_file("fortuna.exe")?;
target.set_resource_directory(resources.clone())?;
target.write_file("fortuna.exe");

See the tests for other usage examples.

Note that packed executables (like packed with UPX) might not allow resource replacement. Edit the resources before packing if required.

About

Resource Editor for parsing and modification of Windows Executables, supporting icon replacement, resource transfer between files, and more.

crates.io/crates/editpe

Topics

cross-platformresource-editorrustwindows

Resources

Readme
BSD-2-Clause license
Activity

Stars

20 stars

Watchers

2 watching

Forks

7 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.