A tool for automatic synthesis of DWARF.
Go to file
Théophile Bastian 8fa2bc5952 ml_dwarf_write: write to a separate file
Don't try to write into the ELF file directly, use objcopy.

Updated README
2019-03-18 14:20:53 +01:00
DwarfSynth ml_dwarf_write: write to a separate file 2019-03-18 14:20:53 +01:00
libdwarfw@322e118261 Add libdwarfw as submodule 2018-12-07 17:16:18 +01:00
.gitignore Ignore and remove *.plugin compiled files 2018-12-07 17:15:20 +01:00
.gitmodules Add libdwarfw as submodule 2018-12-07 17:16:18 +01:00
.merlin Generate CFA tracking with RIP 2018-10-23 19:22:19 +02:00
_tags initial commit of ocaml->c wrappers. as bap linking is already complicated, two independent binaries communicate via a tmp.marshall file for now. 2018-12-30 10:10:51 -08:00
dwarfsynth.ml ml_dwarf_write: write to a separate file 2019-03-18 14:20:53 +01:00
DwarfSynth.mlpack initial commit of ocaml->c wrappers. as bap linking is already complicated, two independent binaries communicate via a tmp.marshall file for now. 2018-12-30 10:10:51 -08:00
LICENSE Initial commit 2018-10-12 18:45:04 +02:00
Makefile initial commit of ocaml->c wrappers. as bap linking is already complicated, two independent binaries communicate via a tmp.marshall file for now. 2018-12-30 10:10:51 -08:00
README.md ml_dwarf_write: write to a separate file 2019-03-18 14:20:53 +01:00

dwarf-synthesis

A tool for automatic synthesis of DWARF.

The purpose of this tool is to take any given binary program or library, examine its assembly code and, based solely on that, generate the corresponding .eh_frame DWARF data.

Dependencies

This tool relies on BAP, which is available through OPAM.

Running

First, run make to compile and install the BAP plugin.

Running the BAP plugin

bap prog_to_analyze.bin -p dwarfsynth --dwarfsynth-output tmp.marshal

Running ml_dwarf_write

You can get a help text with ./ml_dwarf_write.bin. Otherwise, you can run

./ml_dwarf_write.bin tmp.marshal prog_to_analyze.bin eh_frame_section`

Stitching the section into a binary

objcopy --add-section .eh_frame=eh_frame_section prog_to_analyze.bin prog_to_analyze.eh.bin

Commonly used commands

List a binary sections

objdump -h blah.bin

Strip a binary of its eh_frame

objcopy --remove-section '.eh_frame' --remove-section '.eh_frame_hdr' blah.bin