{"id":17398422,"url":"https://github.com/vweevers/pe-coff","last_synced_at":"2026-02-27T00:32:10.879Z","repository":{"id":55828296,"uuid":"76901590","full_name":"vweevers/pe-coff","owner":"vweevers","description":"Parse the COFF file header of a PE.","archived":false,"fork":false,"pushed_at":"2020-12-11T17:48:56.000Z","size":4,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-29T14:18:46.247Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vweevers.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-19T22:14:53.000Z","updated_at":"2020-11-24T18:31:09.000Z","dependencies_parsed_at":"2022-08-15T07:31:19.128Z","dependency_job_id":null,"html_url":"https://github.com/vweevers/pe-coff","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vweevers/pe-coff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fpe-coff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fpe-coff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fpe-coff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fpe-coff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vweevers","download_url":"https://codeload.github.com/vweevers/pe-coff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fpe-coff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29879008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"ssl_error","status_checked_at":"2026-02-26T23:50:46.793Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-16T14:56:07.579Z","updated_at":"2026-02-27T00:32:10.847Z","avatar_url":"https://github.com/vweevers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pe-coff\n\n**Parse the COFF file header of a [PE](https://en.wikipedia.org/wiki/Portable_Executable). 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) \u003csup\u003e[doc]\u003c/sup\u003e, section 3.3.**\n\n[![npm status](http://img.shields.io/npm/v/pe-coff.svg?style=flat-square)](https://www.npmjs.org/package/pe-coff) [![node](https://img.shields.io/node/v/pe-coff.svg?style=flat-square)](https://www.npmjs.org/package/pe-coff) [![Travis build status](https://img.shields.io/travis/vweevers/pe-coff.svg?style=flat-square\u0026label=travis)](http://travis-ci.org/vweevers/pe-coff) [![AppVeyor build status](https://img.shields.io/appveyor/ci/vweevers/pe-coff.svg?style=flat-square\u0026label=appveyor)](https://ci.appveyor.com/project/vweevers/pe-coff) [![Dependency status](https://img.shields.io/david/vweevers/pe-coff.svg?style=flat-square)](https://david-dm.org/vweevers/pe-coff)\n\n## example\n\n```js\nconst pecoff = require('pe-coff')\n\npecoff('file.exe', function (err, header, location) {\n  console.log(header)\n  console.log(location)\n})\n```\n\nThe `header` has these properties:\n\n```json\n{\n  \"machineType\": \"i386\",\n  \"machineDescription\": \"Intel 386 or later processors and compatible processors\",\n  \"numberOfSections\": 3,\n  \"timeDateStamp\": 1480757919,\n  \"pointerToSymbolTable\": 0,\n  \"numberOfSymbols\": 0,\n  \"sizeOfOptionalHeader\": 224,\n  \"characteristics\": 258\n}\n```\n\nAnd `location` contains the offset and length of the header in bytes:\n\n```json\n{\n  \"offset\": 132,\n  \"length\": 20\n}\n```\n\n## `pecoff(mixed, [limit], callback)`\n\nWhere `mixed` is either a filename or a file descriptor. Use `limit` (the number of bytes to read) if you only need the first (few) fields:\n\n```js\npecoff('file.exe', pecoff.NUMBER_OF_SECTIONS, function (err, header) {\n  // Will have machineType, machineDescription, numberOfSections\n  console.log(header)\n})\n\npecoff('file.exe', pecoff.MACHINE_TYPE, function (err, header) {\n  // Will have machineType, machineDescription\n  console.log(header)\n})\n```\n\n## related\n\n- [pe-signature](https://github.com/vweevers/pe-signature)\n- [pe-signature-offset](https://github.com/vweevers/pe-signature-offset)\n- [pe-machine-type-descriptor](https://github.com/vweevers/pe-machine-type-descriptor])\n\n## install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install pe-coff\n```\n\n## license\n\n[MIT](http://opensource.org/licenses/MIT) © Vincent Weevers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Fpe-coff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvweevers%2Fpe-coff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Fpe-coff/lists"}