resedit-js
(Beta) resedit-js is a library that manipulates resouces contained by Windows Executable files. All implementations are written in JavaScript (TypeScript), so there are no further restrictions for running environment.
Install
npm install resedit
Supported formats
- Windows Executables (PE Format), both 32-bit and 64-bit, are supported.
- Executables for 16-bit Windows is not supported.
- Checksum is always set to zero when generating binary.
.res
file is not supported now.- PNG-based icon data is supported on
require('resedit').Resource.IconGroupEntry
class.
Notes
- It is not strongly recommended that the destination executable file is equal to the source executable file.
- Using from command-line is not supported now.
Examples
For more APIs, please see dist
directory of the package. And, some test codes may help you for usages.
const ResEdit = require('resedit');
const fs = require('fs');
let data = fs.readFileSync('MyApp.exe');
let exe = ResEdit.NtExecutable.from(data.buffer);
let res = ResEdit.NtExecutableResource.from(exe);
let viList = ResEdit.Resource.VersionInfo.fromEntries(res.entries);
let vi = viList[0];
vi.fixedInfo.fileVersionMS = 0x10001;
vi.fixedInfo.fileVersionLS = 0;
vi.setStringValues({ lang: 1033, codepage: 1200 }, {
FileDescription: 'My application',
FileVersion: '1.1',
ProductName: 'My product'
});
vi.outputToResourceEntries(res.entries);
res.outputResource(exe);
let newBinary = exe.generate();
fs.writeFileSync('MyApp_modified.exe', new Buffer(newBinary));
License
MIT License