Determine which CPU architecture is used in a binary file.

Overview

cpu_rec_rs

Determine which CPU architecture is used in a binary file. Example:

$ cpu_rec_rs /bin/bash /usr/lib/firmware/rtlwifi/rtl8821aefw*
Loading corpus from cpu_rec_corpus/*.corpus
----------------------------------------------------------------------------------------
                      File                       |     Range     | Detected Architecture
----------------------------------------------------------------------------------------
/bin/bash                                        | Whole file    | X86-64
/usr/lib/firmware/rtlwifi/rtl8821aefw_29.bin     | 0x3200-0x4400 | 8051
/usr/lib/firmware/rtlwifi/rtl8821aefw_29.bin     | 0x4600-0x5000 | 8051
/usr/lib/firmware/rtlwifi/rtl8821aefw_29.bin     | 0x6000-0x6600 | 8051
/usr/lib/firmware/rtlwifi/rtl8821aefw_29.bin     | 0x6600-0x6c00 | 8051
/usr/lib/firmware/rtlwifi/rtl8821aefw.bin        | Whole file    | 8051
/usr/lib/firmware/rtlwifi/rtl8821aefw_wowlan.bin | Whole file    | 8051
----------------------------------------------

Note: as the approach is based on statistics, false positives are definitely possible. You should cross check with other sources and validate the results with a disassembler.

In particular, small files are more prone to false positives, as well as smaller sliding windows. Common false positives include:

  • xmos_xs2a
  • NDS32

About

cpu_rec_rs is a Rust reimplementation of the original cpu_rec. Why reimplement it?

  • Performance
  • Code simplification
  • Rust practice

The original cpu_rec contains a lot of code necessary for experimenting and updating the corpus. If you want to play with various settings for prediction, please use cpu_rec. It also contains documentation and links to the theory behind it (SSTIC presentation).

You might also like...
The first web framework in Rust to adopt the Model-View-Controller (MVC) architecture

Integra Web Framework Integra is a sleek, performant web framework for Rust, harnessing the power of the hyper library. Will become the first highly p

An enhanced version of filetime, which can set file creation time on Windows.

filetime_creation Documentation An enhanced version of filetime, which can set file creation time on Windows. Internally, this use SetFileTime Win32 A

Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage
Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage

Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage

Blink program on RISC L106 80Mhz 32bit CPU

esp8266-blink Blink program on RISC L106 80Mhz 32bit CPU Flashing Running rust on ESP* is sort of hard... We won't cover the installation process, ins

Sample and plot power consumption, average frequency and cpu die temperatures over time.
Sample and plot power consumption, average frequency and cpu die temperatures over time.

sense Sense is a small tool to gather data on cpu temperature, power usage and clock frequency and plot graphs during some load. Dependencies Sense is

A tool to control the fan speed by monitoring the temperature of CPU via IPMI.

ipmi-fan-control A tool to control the fan speed by monitoring the temperature of CPU via IPMI. Why Our Dell R730 server's iDRAC is not works as expec

Raspberry Pi's CPU and GPU temperature exporter for Prometheus consumption.
Raspberry Pi's CPU and GPU temperature exporter for Prometheus consumption.

Pi Temperature Exporter A simple application for collecting Raspberry Pi's CPU and GPU temperatures and exporting them for Prometheus consumption. Ins

A small script in rust to get the cpu usage in %'s with a gradient color for the text
A small script in rust to get the cpu usage in %'s with a gradient color for the text

cpu_usage-polybar A small script in rust to get the cpu usage in %'s with a gradient color for the text To get it to work on your PC you will have to

App to collect ram/cpu usage from OS and show it in pretty graphs
App to collect ram/cpu usage from OS and show it in pretty graphs

System info collector This is simple app to collect data about system cpu and memory usage over time. After collecting results into csv file, html fil

Owner
Raphaël Rigo
Raphaël Rigo
This tool will profile official instances of OpenSUSE mirrorcache to determine the fastest repositories for your system

Mirror Magic tool to Magically make OpenSUSE Mirrors Magic-er This tool will profile official instances of OpenSUSE mirrorcache to determine the faste

Firstyear 30 Dec 22, 2022
A command-line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.

Pup A command line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the return

SteveLau 11 Aug 17, 2022
A CLI tool which can help you automatically kill process of your choice. Useful for freeing up memory and CPU usage!

Quickiller There are always programs such as chrome that keep eating up your resources even when closed! The only way to prevent this is to kill all o

Codingsquirrel 1 Dec 8, 2021
A simple hinting Rust binary to be used in the Kakoune editor

Hop: hinting brought to Kakoune selections Table of content: Install Configuration Kakoune options hop-kak options Usage Workflow examples Default key

Dimitri Sabadie 11 Dec 29, 2023
A rust binary that will flip one or more bits of a file (mostly for messing with images for fun).

file-bitflipper A rust binary that will flip one or more bits of a file (mostly for messing with images for fun). Example (bitflipped bentley) Usage $

null 1 Aug 31, 2022
🦀️atos for linux by rust - A partial replacement for Apple's atos tool for converting addresses within a binary file to symbols.

atosl-rs ??️ atos for linux by rust - A partial replacement for Apple's atos tool for converting addresses within a binary file to symbols. tested on

everettjf 60 Dec 29, 2022
Patch binary file using IDA signatures and defined replacement bytes in YAML.

fabricbin Patch binary file using IDA signatures and defined replacement bytes in YAML. Install: cargo install --git https://github.com/makindotcc/fab

makin 3 Oct 24, 2023
Multi-Architecture Code Emission Library

macel Multi-Architecture Code Emission Library (macel) is a library which implements a low-level intermediate representation meant to expose on machin

merry 10 Dec 5, 2022
An easy-to-use TUI crate for Rust, based off of the Elm architecture.

Rustea An easy-to-use TUI crate for Rust, based off of the Elm architecture. This is a re-implementation of Go's Tea, created by TJ Holowaychuk. Featu

Laz 82 Dec 21, 2022
Write Cross-platform application with React-like decralative UI framework and scalable ECS architecture all in Rust.

bevy_dioxus Dioxus Plugin for Bevy Write Cross-platform application with React-like decralative UI framework and scalable ECS architecture all in Rust

Junichi Sugiura 269 Dec 29, 2022