{"id":47073966,"url":"https://github.com/buzzer-re/hex2raw","last_synced_at":"2026-03-12T06:34:44.793Z","repository":{"id":117236438,"uuid":"275063342","full_name":"buzzer-re/hex2raw","owner":"buzzer-re","description":"Parse .hex firmwares files into a raw file for reversing.","archived":false,"fork":false,"pushed_at":"2024-11-19T14:30:33.000Z","size":119,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-20T08:50:06.073Z","etag":null,"topics":["arduino","avr","microcontroller","microcontroller-firmware","python","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buzzer-re.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-06-26T03:12:47.000Z","updated_at":"2025-11-19T01:28:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"0467ae3a-9a03-4261-a4fd-f3696251a03c","html_url":"https://github.com/buzzer-re/hex2raw","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/buzzer-re/hex2raw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buzzer-re%2Fhex2raw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buzzer-re%2Fhex2raw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buzzer-re%2Fhex2raw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buzzer-re%2Fhex2raw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buzzer-re","download_url":"https://codeload.github.com/buzzer-re/hex2raw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buzzer-re%2Fhex2raw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30417464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T04:41:02.746Z","status":"ssl_error","status_checked_at":"2026-03-12T04:40:12.571Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["arduino","avr","microcontroller","microcontroller-firmware","python","reverse-engineering"],"created_at":"2026-03-12T06:34:44.258Z","updated_at":"2026-03-12T06:34:44.786Z","avatar_url":"https://github.com/buzzer-re.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hex2raw\n\nThis little and useful tool parses firmwares code in .hex format into a dump and readable format for futures manipulation.\n\n\n## Why ?\n\nWhen you compile a firmware for some microcontrollers, like AVR board, a .hex file with the code in string format will be generated for softwares like [avrdude](https://www.nongnu.org/avrdude/) be able to read and flash correctly in the board, but we can't manipulate this .hex file in disassemblies tools.\n\n## .hex example\n\n```\n:100000000C9434000C9451000C9451000C94510049\n:100010000C9451000C9451000C9451000C9451001C\n:100020000C9451000C9451000C9451000C9451000C\n:100030000C9451000C9451000C9451000C945100FC\n:100040000C9451000C9451000C9451000C945100EC\n:100050000C9451000C9451000C9451000C945100DC\n```\n\nThis is a piece of an .hex file that will be flashed inside an ATMEGA328p (AKA Arduino), you can use this tool to convert this .hex back to his blob representation.\n\n```sh\n$ python3 hex_to_asm.py matrix.hex --board atmega328p\nParsing matrix.hex\nWritten as matrix.hex.dump\n```\nWith this dumped file you can use in your favorite binary analysis tool, take a look in the radare2 output.\n\n```\n~/.../python/hex_to_asm \u003e\u003e\u003e rabin2 -I matrix.hex.dump                                                                                                                                                      \narch     avr\nbaddr    0xffffffffffffffff\nbinsz    2636\nbits     8\ncanary   false\nretguard false\ncrypto   false\nendian   little\nhavecode true\nladdr    0x0\nlinenum  false\nlsyms    false\nmachine  ATmel\nmaxopsz  16\nminopsz  1\nnx       false\nos       avr\npcalign  0\npic      false\nrelocs   false\nsanitiz  false\nstatic   true\nstripped false\nva       false\n```\n\n#### Going further\n\nLoading with [Cutter](https://github.com/radareorg/cutter):\n\n![](assets/Cutter.png)\n\n\n# Expanding this\n\nYou can help expading this tool parsing capabilites by adding new entries in the ***prefix_address_size.yml*** file, this tool loads that config files to know where the addressing starts and ends.\n\n####  Example: ATMEGA328P\n\nThe atmega328p has an 32k memory addressing/size, so the first 8 digits is the address part (10004000 for example) and we have the \":\" mark that indicate that a new line started, so we need supply to our configuration file a address size of  ***9***.\n\n```yaml\nboards:\n    atmega328p: 9 #:\u003caddress\u003e\n```\n\nYou can help this project by adding news entries in this file and creating a pull request for each one :)\n\n\n\n## TODO\n\n- [ ] Convert dump files into a .hex files \n\nThanks!\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuzzer-re%2Fhex2raw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuzzer-re%2Fhex2raw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuzzer-re%2Fhex2raw/lists"}