https://github.com/vweevers/pe-signature-offset
Get position of PE signature
https://github.com/vweevers/pe-signature-offset
Last synced: about 1 year ago
JSON representation
Get position of PE signature
- Host: GitHub
- URL: https://github.com/vweevers/pe-signature-offset
- Owner: vweevers
- License: mit
- Created: 2016-12-19T21:24:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-12-11T17:49:48.000Z (over 5 years ago)
- Last Synced: 2025-03-28T21:39:07.246Z (about 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# pe-signature-offset
**Get position of [PE](https://en.wikipedia.org/wiki/Portable_Executable) signature. As specified by [Microsoft PE and COFF Specification 9.3](https://download.microsoft.com/download/9/c/5/9c5b2167-8017-4bae-9fde-d599bac8184a/pecoff_v83.docx) [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 is `PE\0\0` (the letters "P" and "E" followed by two null bytes).
[](https://www.npmjs.org/package/pe-signature-offset) [](https://www.npmjs.org/package/pe-signature-offset) [](http://travis-ci.org/vweevers/pe-signature-offset) [](https://ci.appveyor.com/project/vweevers/pe-signature-offset) [](https://david-dm.org/vweevers/pe-signature-offset)
## example
```js
const getOffset = require('pe-signature-offset')
getOffset('file.exe', function (err, offset) {
console.log(offset)
})
```
## `getOffset(mixed, callback)`
Where `mixed` is either a filename or a file descriptor.
## related
- [pe-signature](https://github.com/vweevers/pe-signature)
## install
With [npm](https://npmjs.org) do:
```
npm install pe-signature-offset
```
## license
[MIT](http://opensource.org/licenses/MIT) © Vincent Weevers