My Analysis of the VC4 Assembly Code from the RPI4

Overview

Use the Ghidra Language Definition in this Pull Request: https://github.com/NationalSecurityAgency/ghidra/pull/1147 - it works for the rpi-eeprom images and using ghidra is a much better approach than using the results in this repository. Thanks @mumbel

Raspberry Pi 4 Bootloader Analysis

This repository contains my "processed" disassembly of the contents of the Raspberry Pi4 bootloader. This is the contents of the rpi-eeprom package, and the files are available on Github here.

I disassembled the various rpi-eeprom.bin files using vc4-toolchain. I also referenced an open-source project that aim{s,ed} for a libre firmware that can be flashed in place of the stock firmware. I referenced this firmware to get an understanding of the load addresses and some of the important memory locations, as well as to try to figure out when the VC4 code starts up the ARM core(s). rpi-open-firmware targets Raspberry Pi 3, meaning its a replacement for bootcode.bin and not rpi-eeprom.bin. Thus, there are surely some differences in the implementation that I am simply not aware of. I'll think about looking at bootcode.bin and doing some comparative analysis between it and rpi-eeprom.bin. Duplicates have been removed, in case you see some files that are in rpi-eeprom but not in this project.

Great?

The disassembly files have some super basic, fairly crappy "analysis" applied to them. Basically I wrote some scripts that compare the strings output to the objdump output and try to match things up. It is definitely prone to error and inaccuracy, but I was aiming for best effort. I also attempted to mark where addresses are branched from with the BREF annotation. This repository contains the original disassembly (*.disassembly.bin) as well as my mapped disassembly (*.map.bin) so you can reference both of them if you want to do some analysis.

Why?

I built these disassembly files and applied my "analysis" to them to help guide me in reverse engineering the RPi4 bootloader. I want to:

  • Understand how the bootloader works, especially the new Secure Boot capabilities and the networking capabilities.
  • Manually diff the various versions of the rpi-eeprom.bin releases to identify fixes from the release notes. This is a precursor for identifying silently patched security issues.
  • Find new security issues, particularly in the Secure Boot capabilities and the networking capabilities.

This seems like a really bad solution?

You're right! The real solution is a Ghidra SLEIGH language definition so we can do real reverse engineering. I unfortunately cannot make the time commitment right now to learn both the ins and the outs of the VC4 assembly language (assuming enough details exist to even feasibly attempt to write a Ghidra language definition) and the process by which to create a new Ghidra language definition. If that wasn't enough, on top of that I'm just not very smart.

Your python and shell scripts are terribly written

Yep.

How can I learn VC4 assembly language?

You can start by reading everything in this wiki entry.

Can I Contribute?

Yes.

How?

Some of the STRING and XREF annotations in the *.map.txt files are invalid. Feel free to remove some of those from the results if you want and submit a PR. Also if you could update the scripts to ensure that a given false positive will not happen again, that would be swell.

Also, please do not create issues saying some part of my annotations are incorrect. If you know they are incorrect and it bothers you enough to want to create an issue, please just submit a pull request fixing the annotation.

Owner
Nicholas Starke
Keep it away from the fire unless you want it to burn
Nicholas Starke
My solution for a MARL problem on a Grid Environment with Q-tables.

To run the project, run: conda create --name env python=3.7 pip install -r requirements.txt python run.py To-do: Add direction to the state space Take

Merve Noyan 12 Dec 25, 2021
This is a simple bank management system based on Python.

Python Bank Management This is a simple bank management system based on Python. It's able to do basic operations of simple bank management. Outcome: W

Md. Rakibul Islam 3 Jan 06, 2022
Assembly example for CadQuery

Spindle and vacuum attachment This is a model of the vacuum attachment for my Workbee CNC router. There is a mist spray coming from the left hand side

Marcus Boyd 20 Sep 16, 2022
A command line interface tool converting starknet warp transpiled outputs into readable cairo contracts.

warp-to-cairo warp-to-cairo is a simple tool converting starknet warp outputs (NethermindEth/warp) outputs into readable cairo contracts. The warp out

Michael K 5 Jun 10, 2022
Tc-python - A Python script to receive message from a twitch chat

Twitch-Chat 📜 I did a script in Python to receive messages from a twitch chat.

miyucode 2 May 31, 2022
An extensive password manager built using Python, multiple implementations. Something to meet everyone's taste.

An awesome open-sourced password manager! Explore the docs » View Demo · Report Bug · Request Feature 🐍 Python Password Manager 🔐 An extensive passw

Sam R 7 Sep 28, 2021
This is a library for simulate probability theory problems specialy conditional probability

This is a library for simulate probability theory problems specialy conditional probability. It is also useful to create custom single or joint distribution with specific PMF or PDF to get probabilit

Mohamadreza Kariminejad 6 Mar 30, 2022
CuraMultiplyByGrid - Cura Плагин для размножения детали сеткой на весь стол автоматически без поворота

CuraMultiplyByGrid Cura Плагин для размножения детали сеткой на весь стол автоматически без поворота. Размножение в куре настолько ужасно реализовано,

3 Dec 02, 2022
This python application let you check for new announcements from MMLS, take attendance while your lecturer is sharing QR Code on the screen.

This python application let you check for new announcements from MMLS, take attendance while your lecturer is sharing QR Code on the screen.

wyhong3103 5 Jul 17, 2022
Manjaro CN Repository

Manjaro CN Repository Automatically built packages based on archlinuxcn/repo and manjarocn/docker. Install Add manjarocn to /etc/pacman.conf: Please m

Manjaro CN 28 Jun 26, 2022
Blender 2.80+ Timelapse Capture Tool Addon

SimpleTimelapser Blender 2.80+ Timelapse Capture Tool Addon Developed for Blender 3.0.0, tested working on 2.80.0 It's no ZBrush undo history but it's

4 Jan 19, 2022
A curated list of awesome things related to Pydantic! 🌪️

Awesome Pydantic A curated list of awesome things related to Pydantic. These packages have not been vetted or approved by the pydantic team. Feel free

Marcelo Trylesinski 186 Jan 05, 2023
Wrapper for the undocumented CodinGame API. Can be used both synchronously and asynchronlously.

codingame API wrapper Pythonic wrapper for the undocumented CodinGame API. Installation Python 3.6 or higher is required. Install codingame with pip:

Takos 19 Jun 20, 2022
Shared utility scripts for AI for Earth projects and team members

Overview Shared utilities developed by the Microsoft AI for Earth team The general convention in this repo is that users who want to consume these uti

Microsoft 38 Dec 30, 2022
Python library for the Unmand APIs.

Unmand Python SDK This is a simple package to aid in consuming the Unmand APIs. For more help, see our docs. Getting Started Create virtual environmen

Unmand 4 Jul 22, 2022
A free website that keeps the people informed about housing and evictions.

Eviction Tracker Currently helping verify detainer warrant data for middle Tennessee - via Middle TN DSA - Red Door Collective Features Presents data

Red Door Collective 7 Dec 14, 2022
Automatically find solutions when your Python code encounters an issue.

What The Python?! Helping you find answers to the errors Python spits out. Installation You can find the source code on GitHub at: https://github.com/

What The Python?! 139 Dec 14, 2022
Old versions of Deadcord that are problematic or used as reference.

⚠️ Unmaintained and broken. We have decided to release the old version of Deadcord before our v1.0 rewrite. (which will be equiped with much more feat

Galaxzy 1 Feb 10, 2022
Python Monopoly Simulator

Monopoly simulator Original creator: Games Computer Play YouTube: https://www.youtube.com/channel/UCTrp88f-QJ1SqKX8o5IDhWQ Config file (optional) conf

Games Computers Play 37 Jan 03, 2023
Tutorials on advanced python topics, and literate programming framework to write them.

Advanced course on Python3 This course covers several topics Python decorators The python object system / meta classes Also see my text on Python impo

Michael Moser 59 Dec 19, 2022