pe-signature
Test if buffer is a PE signature. As specified by Microsoft PE and COFF Specification 9.3 [doc], section 3.2:
After the MS-DOS stub, at the file offset specified at offset
0x3c
, is a 4-byte signature that identifies the file as a PE format image file. This signature isPE\0\0
(the letters "P" and "E" followed by two null bytes).
usage
const psig = const a = const b = const c = console // trueconsole // falseconsole // trueconsole // true
related
Use pe-signature-offset to get the position of the signature in a PE file:
const open = getOffset = fs = len = psiglength { }
install
With npm do:
npm install pe-signature
license
MIT © Vincent Weevers