-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplugin.json
More file actions
30 lines (30 loc) · 4.81 KB
/
plugin.json
File metadata and controls
30 lines (30 loc) · 4.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
"pluginmetadataversion": 2,
"name": "DUMB",
"author": "toolCHAINZ",
"type": [
"binaryview",
"architecture"
],
"api": [
"python3"
],
"description": "DUMB: An Example Architecture for Binary Ninja",
"longdescription": "\r\n\r\nThis is a very simple architecture (and executable format) made for the purpose of teaching how to write Binja loaders and architectures.\r\n\r\nMy 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!\r\n\r\nAn example \"firmware image\" is included [here](https://github.com/toolCHAINZ/DUMB/blob/master/test.bin)\r\n\r\n# DUMB Architecture\r\n\r\nFollowing is a description of the architecture. In this document, we use the following format to specify bitfields:\r\n\r\n`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.\r\n\r\n## Registers\r\n\r\n* `sp` (stack pointer)\r\n* `r0` (GPR)\r\n* `r1` (GPR)\r\n* `r2` (GPR)\r\n* `r3` (GPR)\r\n\r\n## Instructions\r\n\r\n### One Byte Instructions\r\n\r\n| Format | Tokenization | Meaning |\r\n| -------- | ------------ | ------------------------------------ |\r\n| `0:xxyy` | `mov rx ry` | Move the value in `ry` into `rx` |\r\n| `1:xxyy` | `add rx ry` | Add the values of `ry` and `rx` and store the result in `rx` |\r\n| `2:xxyy` | `and rx ry` | And the values of `ry` and `rx` and store the result in `rx` |\r\n| `3:xxyy` | `or rx ry` | Or the values of `ry` and `rx` and store the result in `rx` |\r\n| `4:xxyy` | `xor rx ry` | Xor the values of `ry` and `rx` and store the result in `rx` |\r\n| `9:____` | `ret` | Return from the current function to the address stored on the stack. |\r\n\r\n### Five Byte Instructions\r\n| Format | Tokenization | Meaning |\r\n| -------------------- | ---------------------- | -------------------------------------------------------------------------------- |\r\n| `a0 XX XX XX XX` | `call XXXXXXXXX` | Push `addr + 5` onto the stack and transfer execution to `XXXXXXXX` (little endian dword) |\r\n| `7:xxyy XX XX XX XX` | `jlt rx, ry, XXXXXXXX` | If `rx` is less than `ry`, jump to `XXXXXXXX`, otherwise continue to next instr |\r\n| `8:__rr XX XX XX XX` | `mov rr, XXXXXXXX` | Move the immediate `XXXXXXXX` into `rr` |\r\n\r\n# DUMB Format\r\n\r\nDUMB files are extremely simple, containing only magic, and metadata for a single section. The format is as follows:\r\n\r\n| Offset | Length | Contents (if applicable) | Description |\r\n| ------ | ------ | ------------------------ | --------------------------------------------- |\r\n| 0 | 4 | \"`DUMB`\" | Magic |\r\n| 4 | 4 | N/A | Section length stored as little endian dword |\r\n| 8 | 4 | N/A | Address to load section at, stored as little endian dword |\r\n\r\n",
"license": {
"name": "MIT",
"text": "Copyright 2020 toolCHAINZ\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
},
"platforms": [
"Darwin",
"Windows",
"Linux"
],
"installinstructions": {
"Darwin": "",
"Windows": "",
"Linux": ""
},
"version": "1.0.0",
"minimumbinaryninjaversion": 1921
}