omf
Tool
tools/dos/omf.py(program, 16-bit DOS). Read Intel/Microsoft OMF object files and libraries (.OBJ, .LIB): the format of the DOS and 16-bit Windows compilers (Borland, Microsoft, Watcom).
Run it with ./gameframe run omf ARGS or python3 tools/dos/omf.py. Source on GitHub.
Its own help
This is the help text in the tool itself, as ./gameframe tool omf prints it.
text
Read Intel/Microsoft OMF object files and libraries (.OBJ, .LIB): the format of the DOS and
16-bit Windows compilers (Borland, Microsoft, Watcom). List their modules and public names,
or write a signature for each public function, for tools/triage/sigscan.py.
Usage: omf.py FILE [FILE ...] modules, segments and public names
omf.py FILE [FILE ...] --sigs [--len N] one signature per public code name
A game for DOS carries its compiler's runtime library inside the executable: printf, the
file functions, the long arithmetic helpers, the floating-point emulator. Those functions
have no names in the game, and reading them is wasted work. The library they came from
names them. An OMF library is a set of object modules. Each module holds the bytes of its code
(LEDATA records), the public names and their offsets (PUBDEF), and the fixups (FIXUPP): the
bytes the linker changes when it places the code. The fixups mark exactly the bytes to leave
as wildcards, so a signature made from a library is precise.
python3 tools/dos/omf.py BC31/LIB/CL.LIB --sigs > derived/borland-cl.sigs
python3 tools/triage/sigscan.py scan derived/borland-cl.sigs target/GAME.EXE --labels derived/runtime.tsv
Use the library of the same compiler, version and memory model as the game (re-inventory,
tools/dos/dosinfo.py, names the compiler). The libraries come with the compiler: use your own
copy. Iterated data (LIDATA) and function-level records (COMDAT) are counted, not read.
Standard library only.Named by
Skills: re-inventory.