{"id":22951517,"url":"https://github.com/0xamined/pe-pwn","last_synced_at":"2025-04-01T22:47:07.154Z","repository":{"id":265253756,"uuid":"895599317","full_name":"0xAminED/pe-pwn","owner":"0xAminED","description":"A Python script for analyzing Portable Executable (PE) files.","archived":false,"fork":false,"pushed_at":"2024-11-28T20:19:39.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T15:12:09.179Z","etag":null,"topics":["exploit-development","malware-analysis","pe-file","pe-format","reverse-engineering"],"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/0xAminED.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-28T14:06:24.000Z","updated_at":"2024-11-28T20:28:45.000Z","dependencies_parsed_at":"2024-11-28T14:47:44.221Z","dependency_job_id":"351d7e26-028c-4f7b-aa4a-32c45fb4ffae","html_url":"https://github.com/0xAminED/pe-pwn","commit_stats":null,"previous_names":["0xamined/pe-pwn"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xAminED%2Fpe-pwn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xAminED%2Fpe-pwn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xAminED%2Fpe-pwn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xAminED%2Fpe-pwn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xAminED","download_url":"https://codeload.github.com/0xAminED/pe-pwn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246724798,"owners_count":20823544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["exploit-development","malware-analysis","pe-file","pe-format","reverse-engineering"],"created_at":"2024-12-14T15:16:21.182Z","updated_at":"2025-04-01T22:47:07.129Z","avatar_url":"https://github.com/0xAminED.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PE-PWN\n\nA Python script for analyzing **Portable Executable (PE)** files. This tool extracts detailed information about PE file structures such as headers, sections, imports, exports, and resources. It is useful for malware analysis, reverse engineering, and exploring PE file internals.\n\n---\n\n## Features\n\n- **DOS Header**: Displays basic information such as the magic number and address of the NT header.\n- **NT Headers**: Provides metadata about the PE file structure.\n- **File Header**: Details about the machine type, number of sections, timestamp, and more.\n- **Optional Header**: Information about the entry point, image base, and other execution-related data.\n- **Sections**: Displays details about sections like `.text`, `.data`, and `.rsrc`.\n- **Imports**: Lists all libraries and functions imported by the PE file.\n- **Exports**: Displays functions and symbols exported by the PE file.\n- **Resources**: Extracts embedded resources such as icons, version info, and other assets.\n\n---\n\n## Requirements\n\n- Python 3.x\n- `pefile` library\n\nYou can install the required library using pip:\n\n```bash\npip install pefile\n```\nOR\n```bash\npip install -r requirements.txt\n```\n## Usage\n\n### 1. Clone the Repository\nFirst, clone the repository to your local machine:\n\n```bash\ngit clone https://github.com/0xAminED/pe-pwn.git\ncd pe-pwn\n```\n### 2. Run the Script\nUse the following command to analyze a PE file. Replace \u003cpath_to_pe_file\u003e with the path to the PE file you want to analyze.\n```bash\npython pe_pwn.py \u003cpath_to_pe_file\u003e\n```\nExample:\n```bash\npython pe_pwn.py C:\\path\\to\\file.exe\n```\n### 3. Output\nThe script will display detailed information about the PE file, including headers, sections, imports, exports, and resources. Here is an example of the output format:\n\n```bash\n====== PE File Analysis ======\nFile: C:\\path\\to\\file.exe\n\n== DOS Header ==\n{\n  'e_magic': 23117, \n  'e_cblp': 0, \n  'e_cp': 0, \n  ...\n}\n\n== NT Headers ==\n{\n  'Signature': b'PE\\0\\0',\n  'FileHeader': { ... },\n  'OptionalHeader': { ... }\n}\n\n== File Header ==\n{\n  'Machine': 332, \n  'NumberOfSections': 5, \n  'TimeDateStamp': 1390763812, \n  ...\n}\n\n== Sections ==\nName: .text\n  Virtual Address: 0x1000\n  Virtual Size: 0x2000\n  Raw Size: 0x4000\n  Characteristics: 0x60000020\n\n...\n\n== Imported Functions ==\nLibrary: user32.dll\n  MessageBoxW at 0x12345678\n\n...\n\n== Exported Functions ==\n  MyFunction at 0x10001234\n\n== Resources ==\n  Resource Type: 0x1 (RT_ICON)\n\n```\n\n\n## Supported File Formats\nThis tool works with the following Windows PE file formats:\n- **Executable files (.exe)**\n- **Dynamic-Link Libraries (.dll)**\n- **Driver files (.sys)**\n- **Control Panel files (.cpl)**\n- **Screensaver files (.scr)**\n- **Legacy .com files (if they are in PE format)**\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Thanks to the contributors for their valuable feedback and improvements.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xamined%2Fpe-pwn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xamined%2Fpe-pwn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xamined%2Fpe-pwn/lists"}