Skip to content
collection of files to aid with boot loader reversing
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
dap-main.c
dap-struct.h
debug_cmds.py
dot_gdbinit
emulate_partial.py
wrap_directory.py

README.md

boot_loader_reversing

Collection of files to aid with boot loader reversing
Files will be added as needed, feel free to contribute
The reference section contains multiple useful references

overview files

  • dap-main.c
  • dap-struct.h
  • debug_cmds.py
  • dot_gdbinit
  • wrap_directory.py
  • emulate_partial.py

using the files

dot_gdbinit
The dot_gdbinit file should be used as your .~/gdbinit file and it contains some commands to set the a hardware breakpoint, the architecture and load the DAP structure definition. It is assumed that when you start gdb this will be the working directory.

dap-*
The header and C file are used as a trick to load the definition of the DAP structure into GDB. Used by dot_gdbinit. They can be compiled with:

gcc -g -c dap-main.c dap-struct.h

debug_cmds.py
Helper functions for gdb written in python with some useful commands, must be sourced from within gdb with:

source debug_cmds.py

  • brm-ci <mnemonic>
    • run application until it encounters the specified mnemonic brm-ci int
  • brm-pexi
    • parses, executes and displays interrupt calls
  • brm-disassemble [count]
    • disassembles (count=10 by default) and takes address segments into account brm-disassemble 20

wrap_directory.py
Wraps calls to a target directory and the files within with fuse. Can be used to print read and write calls.

python wrap_directory.py target mountpoint

emulate_partial.py
Creates an 'image' of a disk by storing only the read sectors, is also able to emulate boot process.
It defaults to 'imaging' mode when --emulate is not given.

Imaging mode:
python emulate_partial.py ~/disk-images/ mountpoint/

Emulation mode:
python emulate_partial.py --emulate ~/disk-images/ mountpoint/

References

You can’t perform that action at this time.