项目作者: ChaoticEnigma

项目描述 :
(ARM Thumb) Re-Assembler utility for reverse engineering
高级语言: C++
项目地址: git://github.com/ChaoticEnigma/reassemble.git
创建时间: 2017-02-24T09:19:23Z
项目社区:https://github.com/ChaoticEnigma/reassemble

开源协议:

下载


ReAssembler

The ReAssembler is a tool for producing editable assembly code from compiled or assembled
machine instructions. Currently only Thumb2 is supported (the author’s motivation).

Features

  • Instructions disassembled
  • Branch and call addresses replaced with labels
  • Non-code data preserved in assembly output
  • PC-relative loads given labels (pc offsets remain)
  • Function and data pointers replaced with labels

This tool is intended as a convenience, and cannot guarantee the output will be completely
independent of address dependence (e.g. a vector table, obscure function pointers).
The output will likely need to be verified manually.

In order to follow the code, this tool must be provided with all unique entry points,
including the reset handler, IRQs, and addresses referenced outside the code
(e.g. by a bootloader).

I will admit the current incarnation is somewhat sloppy, but effective. Function and data
pointer auto-analysis is limited. However, you can provide lists of functions, data, and
code/data pointers, with custom lables, and the tool will disassemble as necessary,
add labels, and reference labels in pointers, so address values are re-generated
appropriately by the linker. See the examples directory for sample symbol/pointer lists.

If at this point you do not understand what this tool does, it is probably not for you.
To use this tool correctly, you need to understand the information you are providing it,
know what to expect in the output, and know how to validate the output.

Usage

  1. reassemble input_binary output_asm
  2. [-V] [-E] [-a image_vma]
  3. [-s symbol_address_file]
  4. [-d data_address_file]

Example

  1. # Disassemble to assembly
  2. reassemble example/firmware.bin out.s -a 2c00 -s example/symbols.sym -d example/data.sym
  3. # Reassemble with standard tools, compare output and source binaries
  4. reas.sh out.s example/firmware_v117

Symbol Address File

example/symbols.sym

  1. # Function function1 at 0x2c04
  2. 2c04: function1
  3. # Address of function2 at 0x2d08
  4. * 2d08: function2
  5. # Automatically name function at 0x3a00
  6. 0x3a00
  7. # Define the number of cases in switch instruction at 2ddc as 12
  8. & 2ddc: 12

Data Address File

example/data.sym

  1. # Data data1 at 0x2c04
  2. 2c04: data1
  3. # Address of data2 at 0x2d08
  4. * 2d08: data2