Home

Awesome

DUMB Logo

This is a very simple architecture (and executable format) made for the purpose of teaching how to write Binja loaders and architectures.

My hope for this repo is that it can be a simple teaching resource for this topic. While it covers the basics, it leaves some important topics (like flags) uncovered. PRs welcome!

An example "firmware image" is included here

DUMB Architecture

Following is a description of the architecture. In this document, we use the following format to specify bitfields:

0:xxyy represents a single byte: 0 means that the first (upper) nibble of the byte is zero, while xxyy indicates two 2-bit fields making up the lower nibble of the byte.

Registers

Instructions

One Byte Instructions

FormatTokenizationMeaning
0:xxyymov rx ryMove the value in ry into rx
1:xxyyadd rx ryAdd the values of ry and rx and store the result in rx
2:xxyyand rx ryAnd the values of ry and rx and store the result in rx
3:xxyyor rx ryOr the values of ry and rx and store the result in rx
4:xxyyxor rx ryXor the values of ry and rx and store the result in rx
9:____retReturn from the current function to the address stored on the stack.

Five Byte Instructions

FormatTokenizationMeaning
a0 XX XX XX XXcall XXXXXXXXXPush addr + 5 onto the stack and transfer execution to XXXXXXXX (little endian dword)
7:xxyy XX XX XX XXjlt rx, ry, XXXXXXXXIf rx is less than ry, jump to XXXXXXXX, otherwise continue to next instr
8:__rr XX XX XX XXmov rr, XXXXXXXXMove the immediate XXXXXXXX into rr

DUMB Format

DUMB files are extremely simple, containing only magic, and metadata for a single section. The format is as follows:

OffsetLengthContents (if applicable)Description
04"DUMB"Magic
44N/ASection length stored as little endian dword
84N/AAddress to load section at, stored as little endian dword