{"id":37759170,"url":"https://github.com/npjg/nefile","last_synced_at":"2026-01-16T14:34:26.450Z","repository":{"id":61056479,"uuid":"547986583","full_name":"npjg/nefile","owner":"npjg","description":"A Python library to work with 16-bit New Executable (NE) images","archived":false,"fork":false,"pushed_at":"2023-12-28T03:15:54.000Z","size":89,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-10T01:55:07.264Z","etag":null,"topics":["16bit","executable-file","executable-formats","retrocomputing","windows-3"],"latest_commit_sha":null,"homepage":"","language":"Python","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/npjg.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-10-08T17:51:45.000Z","updated_at":"2025-12-07T09:46:55.000Z","dependencies_parsed_at":"2023-12-27T17:47:49.690Z","dependency_job_id":null,"html_url":"https://github.com/npjg/nefile","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/npjg/nefile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npjg%2Fnefile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npjg%2Fnefile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npjg%2Fnefile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npjg%2Fnefile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npjg","download_url":"https://codeload.github.com/npjg/nefile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npjg%2Fnefile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: 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":["16bit","executable-file","executable-formats","retrocomputing","windows-3"],"created_at":"2026-01-16T14:34:25.619Z","updated_at":"2026-01-16T14:34:26.443Z","avatar_url":"https://github.com/npjg.png","language":"Python","readme":"Like its namesake [`pefile`](https://github.com/erocarrera/pefile) does for the modern Portable Executable format, this `nefile` library parses the ancient 16-bit New Executable (NE) format. \n\nI drafted this library because here are not many good cross-platform tools for analyzing and extracting data (more than just code) from NE files. For instance, Ghidra is great at decompilation but not really at resources. `wrestool` and `icoutils` are the only tools I have found to date that can extract resources from NE files, but I ran into multiple issues using `wrestool`, including resources being corrupted upon extraction. \n\nThis library fills the gap. Also, I just love Windows 3.1.\n\nCurrently there is read-only support for the NE header and resources, as that's all I need at the moment. Feel free to contribute if you need other functionality from Python.\n\nIf you like my projects, please consider supporting me!\n\n\u003ca href=\"https://www.buymeacoffee.com/natster\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n\n## Spec References\nThe main spec reference used is the Microsoft Windows 3.1 Programmer's Reference, Volume 4 (Resources), referred to \nin the code as `W3.1PRV4`. \n\nThe Microsoft MS-DOS Programmer's Reference helped provide insight into the DOS MZ header. \n\n## Installation\nGet it [on PyPI](https://pypi.org/project/nefile/): ```pip3 install nefile```\n\n## Usage\n\n```python\nimport nefile\nfrom nefile.resource_table import ResourceType\n\n# OPEN THE WINDOWS 3.1 PROGRAM MANAGER.\nprogman = nefile.NE('/media/windows-3.1/WINDOWS/PROGMAN.EXE')\nprint(progman.header.target_operating_system) # \u003cTargetOperatingSystem.WINDOWS_3X: 2\u003e\nprint(progman.header.expected_windows_version) # 3.10\n# See the resource types defined in Program Manager.\nprint(progman.resource_table.resource_type_tables.keys())\n# Known resource types are replaced with an enum member. There can also be integer and string IDs\n# for resource types that don't have a globally-defined type.\n# dict_keys([\u003cResourceType.RT_GROUP_ICON: 14\u003e, \u003cResourceType.RT_MENU: 4\u003e, \u003cResourceType.RT_DIALOG: 5\u003e, \n#            \u003cResourceType.RT_STRING: 6\u003e, \u003cResourceType.RT_ACCELERATOR: 9\u003e, \u003cResourceType.RT_VERSION: 16\u003e,\n#            \u003cResourceType.RT_ICON: 3\u003e])\n# \n# List all the bitmap resources defined in Program Manager.\nprint(progman.resource_table.resource_type_tables[ResourceType.RT_GROUP_ICON])\n# Individual resource IDs are either integer or string IDs, as dictated in the file.\n# {3: \u003cnefile.resources.Resource object at 0x7f0d72c79fa0\u003e, 6: \u003cnefile.resources.Resource object at 0x7f0d72c7af40\u003e, \n#  'DATAICON': \u003cnefile.resources.Resource object at 0x7f0d72c7a0d0\u003e, 'COMMICON': \u003cnefile.resources.Resource object at 0x7f0d72c7afd0\u003e, \n#  'MSDOSICON': \u003cnefile.resources.Resource object at 0x7f0d72c7ab80\u003e}\n\n# OPEN THE WINDOWS 3.1 SHELL.\n# This is where the famous easter egg is stored! I actually wrote this library\n# because I wanted to get at those resources solely in Python and not bother\n# with `wrestool`.\nshell = nefile.NE('/media/windows-3.1/WINDOWS/SYSTEM/SHELL.DLL')\n# dict_keys([\u003cResourceType.RT_BITMAP: 2\u003e, \u003cResourceType.RT_DIALOG: 5\u003e, \u003cResourceType.RT_STRING: 6\u003e, \n#            \u003cResourceType.RT_RCDATA: 10\u003e, \u003cResourceType.RT_VERSION: 16\u003e, 100])\nshell.export_resources(\"/root/shell\")\n# Produces files with names like \"SHELL.DLL-RT_BITMAP-130.bmp\".\n```\n\n## Tests\nTest data is not included in this repository, but these are the sources  used:\n* [630 Windows 3.x Games](https://archive.org/details/630-windows-3x-games)\n\nTo set up tests, create the `tests/test_data` directory and put NEs in there. Currently DLLs and EXEs are picked up.\nIf any turn out to be PE files or plain DOS EXEs, they will be marked as skipped in the tests. \n\nTo run the tests, just run `pytest` from the root of the repository.","funding_links":["https://www.buymeacoffee.com/natster"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpjg%2Fnefile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpjg%2Fnefile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpjg%2Fnefile/lists"}