GithubHelp home page GithubHelp logo

yxpscom / batch-resource-updater Goto Github PK

View Code? Open in Web Editor NEW

This project forked from coderforlife/batch-resource-updater

1.0 0.0 0.0 184 KB

Automates extracting, updating, and removing of resources from PE (EXE/DLL) and RES files.

Home Page: http://www.coderforlife.com/projects/utilities/#BatchResourceUpdater

C++ 95.56% C 4.44%

batch-resource-updater's Introduction

batch-resource-updater

The BatchResourceUpdater (BRU) program automates extracting, updating, and removing of resources from PE and RES files. It uses an XML file to describe all the actions it should perform, manipulates the files, saves them, and updates the checksum of the files. This program is not fully tested so backup all files first. However, I have seen no problems yet.

This is meant to complement, not replace, programs such as ResourceHacker. BatchResourceUpdater provides you with no way of finding out which resources already exist and you can only view resources by extracting them. It does nothing special for string, menu, and dialog resource types. Instead you should use ResourceHacker to modify the resources, extract them, and then use BRU. Where BRU really shines is the automation - allowing you to 'instantly' apply resource changes if the binary changes (e.g. because of a Windows Update).

It is written in C++/CLR and requires .NET 2.0 and Visual C++ 2010 SP1 runtimes (download x86 / x64). The PE/RES file-modifying code and ICO/CUR manipulators are written in C++ and do not require any libraries.

Features

  • Extracts, adds, and removes resources from PE (EXE, DLL, OCX, SYS, DRV, MUI, ...) and RES files
  • XML file describes batch resource extracting / updating
  • Uses a custom made PE/RES file writer (haven't seen this fail yet, even when ResourceHacker fails)
  • Smart extracting/updating of:
    • BITMAP to/from BMP
    • ICON and GROUP_ICON to/from ICO
    • CURSOR and GROUP_CURSOR to/from CUR
  • Other resource types are copied as binary (works well for PNG, RCDATA, IMAGE, ANICURSOR, ...)
  • Automatically updates checksum on updated files

Features it will never have

  • Any filetype conversion (e.g. you must use a BMP image for BITMAP resources)
  • Be MUI aware
  • Support for files >2GB (have you ever seen an EXE/DLL that is >2GB? - actually it isn't allowed!)
  • Support for resource script (RC) files (windres can be used to convert between RES and RC)
  • Support for .NET resource formats (RESX, RESOURCES, or text)

Using BRU

To run BatchResourceUpdater, you can do the following:

BatchResourceUpdater test.bru

Where "bru" files are actually just XML files (so they can be double-clicked to run with BatchResourceUpdater), with the following format:

<?xml version="1.0" encoding="UTF-8" ?>
<BatchResourceUpdate>
  <Copy>
    <Source>RESID</Source>
    <Destination>RESID</Destination>
  </Copy>
  ...
  <Remove>RESID</Remove>
  ...
</BatchResourceUpdate>

The <Copy> and <Remove> blocks may come in any order and any number of them. The RESID values are specifications of either files or resource IDs, for example:

  • File: file1.bmp
  • PE Resource: shell32.dll|BITMAP|100|1033
  • RES Resource: rsrc.res|BITMAP|100|1033

PE Files must have an extention of: exe, dll, sys, ocx, mui, drv, cpl, efi, com, fnt, msstyles, scr, ax, acm, ime, pe
RES Files must have an extension of: res

The <Copy> block may have more than one destination, but only one source. It also can have an "overwrite" attribute:

<Copy overwrite="always|never|only">
  • Always means to always overwrite the resource/file, this is the default
  • Never means to save the resource/file only if it does not already exist
  • Only means to save the resource/file only if it does already exist

The other set of blocks that can be used is <Var index="#">, like so:

<Var index="#">
  <Name>...</Name>
  ...
</Var>

The # must be an integer from 0 to 9 (inclusive). There may be any number of <Name> blocks. After this block, whenever a %# (e.g. %1) is used it is replaced with all of the values defined by the <Name> blocks for that index. There are some limitations on replacements that can be made. Also %% is replaced by %.

For more examples see the examples zip file.

batch-resource-updater's People

Contributors

coderforlife avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.