Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Muqriz 48f16bfc3e initail first vor 4 Monaten
..
dist initail first vor 4 Monaten
CHANGELOG.md initail first vor 4 Monaten
LICENSE initail first vor 4 Monaten
README.md initail first vor 4 Monaten
cjs.cjs initail first vor 4 Monaten
cjs.d.ts initail first vor 4 Monaten
package.json initail first vor 4 Monaten

README.md

NPM version Build Status

pe-library

pe-library provides parsing and generating Portable Executable (known as Windows Executables) binaries.

Usage

import * as PE from 'pe-library';
import * as fs from 'fs';

// load and parse data
let data = fs.readFileSync('MyApp.exe');
// (the Node.js Buffer instance can be specified directly to NtExecutable.from)
let exe = PE.NtExecutable.from(data);

// get section data
let exportSection = exe.getSectionByEntry(PE.Format.ImageDirectoryEntry.Export);
// read binary data stored in exportSection.data ...
// to write binary: use exe.setSectionByEntry

// write to buffer
let newBin = exe.generate();
fs.writeFileSync('MyApp_modified.exe', new Buffer(newBin));

from CommonJS (using require)

Starting from v1.0.0, CommonJS support is changed; you must use pe-library/cjs to use from CommonJS file.

const { load } = require('pe-library/cjs');
const fs = require('fs');
load().then((PE) => {
  // load and parse data
  let data = fs.readFileSync('MyApp.exe');
  // (the Node.js Buffer instance can be specified directly to NtExecutable.from)
  let exe = PE.NtExecutable.from(data);

  // get section data
  let exportSection = exe.getSectionByEntry(
    PE.Format.ImageDirectoryEntry.Export
  );
  // read binary data stored in exportSection.data ...
  // to write binary: use exe.setSectionByEntry

  // write to buffer
  let newBin = exe.generate();
  fs.writeFileSync('MyApp_modified.exe', new Buffer(newBin));
});

for CommonJS-based TypeScript module

// you can use PE namespace for type-reference only
import { type PE, load } from 'pe-library/cjs';
load().then((pe: typeof PE) => {
  ...
});

License