Hi,
I'm currently working on a tiny disassembler and IDA processor modules for microcontroller.
I'm a bit lazy so I'll paste the README here.
udasmTiny disassembler for microcontrollers with configurable memory map. Most of
existing disassemblers for microcontrollers are either a part of binutils or IDA
processor modules with a static memory map. In other words, you usually have
either to recompile the processor module or use a third-party script that
handles internal registers. Thanks to libconfig, with udasm you can easly write
your own memory map with a single configuration file and without recompiling the
whole s**t.
Supported architectures- Intel 8051
- ATMEL AVR 8(16)-bit
Supported file format- Binary
Memory map configurationMemory map configuration contains 2 main parts.
One that defines all specific code location such as interruptions.
And the other one that defines all internal registers mapped in memory.
To specify an interruption in the memory map configuration file you have
to define a global variable named CODE where you can list all interruptions
in a variable named 'interrupts'.
Each interruption has the following format: ( "name", offset, size, "type" ).
- name: quoted string holding the name of the interrupt.
- offset: location of the interrupt in the firmware.
- size: size in byte of the interrupt.
- type: quoted string defining the type of the interrupt.
- data: the location is an address of the routine (e.g. isr vector table in arm cortex-m). Currently not fully supported.
- code: the location is a routine (e.g. most of avr/i8051/etc. usually containing an absolute jump to the routine).
Internal registers mapped in memory can be defined in a global variable name 'IDATA' and listed
in variable named 'map'. Each element of this list may contain the following variables:
- page: memory page which contains the internal registers.
- busid: an architecture specific id for some instructions that use an other memory map layout.
E.g. in some AVR, memory operand of in/out instruction might have an implicit offset from the physical memory layout. lds r0, 0x0020 is the same shit as in r0, 0x00.
- registers: an array of 2 elements, a quoted string of the register's name and a location.
- bits: an array of 2 elements, a quoted string of the bit's name and a location.
See xmega128a1.cfg as an example.
Architecture specific- AVR
- busid: 0x01 for in/out memory operand.
IDA procmod- Intel 8051
- ATMEL Avr 8(16)-bit
TODO-
done Add listview with all internal registers.
-
done Add xref for each internal register.
-
done IDA procmod for avr.
- PIC architecture.
- Ability to define global variables in the memory map configuration file.
- IDA procmod
- select a different page for a specific memory operand in disassembly.
Using IDA procmod- Load a new memory map configuration file
- File -> Load file -> Load new memory map...
- Show all internal registers
- View -> Open subviews -> Internal registers
- Show all internal bit registers
- View -> Open subviews -> Internal bit registers
- Show all interruptions
- View -> Open subviews -> List of interruptions
- Show all xref(s) to an internal register
- Double click on that item in the list of internal registers
IDA procmod screenshot
Any comment(s) or suggestion(s) would be appreciate.