samunders-core / le_disasm

libopcodes-based (AT&T syntax) linear executable (MZ/LE/LX DOS EXEs) disassembler modified from http://swars.vexillium.org/files/swdisasm-1.0.tar.bz2
GNU General Public License v3.0
19 stars 5 forks source link

Klei1984/add support to load map file #13

Closed klei1984 closed 5 years ago

klei1984 commented 5 years ago

This change set is based upon PR #12 , that PR should be merged first. Changes:

Example: ./le_disasm GAME.LE GAME.BIN GAME.map 2>output.log >output.S where GAME.LE is an unbound linear executable image, GAME.BIN is the path to the output file where the tool will dump a flat image of the executable and GAME.map is the path to the user map file that needs to be loaded.

Map file format: <symbol name with prefix data_* for .data section entires, lut_* for switch::case entires, sub_* for functions (code16/32)> <\t white space> <type of symbol. Currently unsed, but type is one of data, code32 or code16> <\t white space><address of symbol , virtual address in linear address space> <\t white space> <size of data in bytes following the symbol>

Example map file contents: symbol_name type start_address region_size data_109E96 data 0000000000109E96 00000036 data_140135 data 0000000000140135 00000036 lut_10870 code32 0000000000010870 00000010 lut_1202C code32 000000000001202C 00000014 sub_13D410 code32 000000000013D410 00000058 sub_140000 code16 0000000000140000 0000005C