{"id":21145995,"url":"https://github.com/trou/cpu_rec_rs","last_synced_at":"2025-07-09T07:32:11.602Z","repository":{"id":176359194,"uuid":"652260582","full_name":"trou/cpu_rec_rs","owner":"trou","description":"Determine which CPU architecture is used in a binary file.","archived":false,"fork":false,"pushed_at":"2024-03-04T21:13:29.000Z","size":10574,"stargazers_count":87,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-04T22:30:52.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trou.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","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}},"created_at":"2023-06-11T15:40:47.000Z","updated_at":"2024-02-24T20:26:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"21178413-975b-412e-bb63-77e5be49f144","html_url":"https://github.com/trou/cpu_rec_rs","commit_stats":null,"previous_names":["trou/cpu_rec_rs"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trou%2Fcpu_rec_rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trou%2Fcpu_rec_rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trou%2Fcpu_rec_rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trou%2Fcpu_rec_rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trou","download_url":"https://codeload.github.com/trou/cpu_rec_rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225492617,"owners_count":17482924,"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":[],"created_at":"2024-11-20T08:45:02.937Z","updated_at":"2024-11-20T08:45:03.547Z","avatar_url":"https://github.com/trou.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## cpu_rec_rs\n\nDetermine which CPU architecture is used in a binary file.\nExample:\n\n```\n$ cpu_rec_rs /bin/bash /usr/lib/firmware/rtlwifi/rtl8821aefw*\nLoading corpus from cpu_rec_corpus/*.corpus\n----------------------------------------------------------------------------------------\n                      File                       |     Range     | Detected Architecture\n----------------------------------------------------------------------------------------\n/bin/bash                                        | Whole file    | X86-64\n/usr/lib/firmware/rtlwifi/rtl8821aefw_29.bin     | 0x3200-0x4400 | 8051\n/usr/lib/firmware/rtlwifi/rtl8821aefw_29.bin     | 0x4600-0x5000 | 8051\n/usr/lib/firmware/rtlwifi/rtl8821aefw_29.bin     | 0x6000-0x6600 | 8051\n/usr/lib/firmware/rtlwifi/rtl8821aefw_29.bin     | 0x6600-0x6c00 | 8051\n/usr/lib/firmware/rtlwifi/rtl8821aefw.bin        | Whole file    | 8051\n/usr/lib/firmware/rtlwifi/rtl8821aefw_wowlan.bin | Whole file    | 8051\n----------------------------------------------\n```\n\nNote: as the approach is based on statistics, false positives are definitely\npossible. You should cross check with other sources and validate the results\nwith a disassembler.\n\nIn particular, small files are more prone to false positives, as well as smaller\nsliding windows. Common false positives include:\n\n* `xmos_xs2a`\n* `NDS32`\n\n### About\n\n`cpu_rec_rs` is a Rust reimplementation of the original\n[`cpu_rec`](https://github.com/airbus-seclab/cpu_rec/). Why reimplement it?\n\n* Performance\n* Code simplification\n* Rust practice\n\n\nThe original `cpu_rec` contains a lot of code necessary for experimenting and\nupdating the corpus. If you want to play with various settings for prediction,\nplease use `cpu_rec`. It also contains documentation and links to the theory\nbehind it ([SSTIC presentation](https://github.com/airbus-seclab/cpu_rec/blob/master/doc/cpu_rec_slides_english.pdf)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrou%2Fcpu_rec_rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrou%2Fcpu_rec_rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrou%2Fcpu_rec_rs/lists"}