AlexanderOMara / portable-executable-signature

Package for reading and writing PE code signatures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Package for reading and writing PE code signatures

License:Mozilla Public License 2.0


Languages

Language:TypeScript 92.2%Language:JavaScript 7.8%