portable-executable-signature
TypeScript icon, indicating that this package has built-in type declarations

2.0.5 • Public • Published

Portable Executable Signature

Package for reading and writing PE code signatures (but not creating them)

npm node

size downloads

Build Status

Overview

A broken code signature is often worse than no signature, so it can be desirable to remove a signature.

This package can remove code signatures from PE binaries.

Usage

Just pass an ArrayBuffer or an object that is a view of an ArrayBuffer to the signatureGet and signatureSet functions.

import {readFile, writeFile} from 'node:fs/promises';
import {signatureGet, signatureSet} from 'portable-executable-signature';

const data = await readFile('pe-binary.exe');
const signature = signatureGet(data);
console.log('signature:', signature);
const unsigned = signatureSet(data, null);
console.log('unsigned:', unsigned);
await writeFile('pe-binary-unsigned.exe', Buffer.from(unsigned));

Bugs

If you find a bug or have compatibility issues, please open a ticket under issues section for this repository.

License

Copyright (c) 2019-2024 Alexander O'Mara

Licensed under the Mozilla Public License, v. 2.0.

If this license does not work for you, feel free to contact me.

Package Sidebar

Install

npm i portable-executable-signature

Weekly Downloads

385

Version

2.0.5

License

MPL-2.0

Unpacked Size

77.9 kB

Total Files

33

Last publish

Collaborators

  • alexanderomara