pdbdec - palm database decompiler
pdbdec [-h -V -o file -w[01] -v[0-4] -l linebytes -F formatspec] file
pdbdec decompiles a binary Palm DataBase (PDB) file into text source file.
The text source file is in the pdbc(1)
format.
The syntax of the formatspec is explained in detail below.
The -F option demands as argument a formatspec string.
The formatspec is a comma separated list of key=value pairs.
It specifies the format of the decompiled data in the records.
This is ignored if the 'value' specifier is not byte/word/long.
This is ignored if the 'value' specifier is not byte/word/long.
This is ignored if the 'value' specifier is not byte/word/long.
This is ignored if the 'value' specifier is not byte/word/long.
This is ignored if the 'value' specifier is not byte/word/long.
This is similar to the way many hexdump tools show data.
This is ignored if the 'value' specifier is not byte/word/long.
In this mode ASCII strings in the data are recognized by a simple heuristic.
If at least 'n' printable ASCII characters are found then they are shown as a single quoted 'string'.
A value of 0 is equivalent to 'none'.
This is similar to the 'strings' tool on UNIX.
This is especially useful if you have a lot of multiline strings in the data.
This is ignored if the 'string' specifier is not 1-99.
This is especially useful if you have a lot of singleline strings in the data.
This is ignored if the 'string' specifier is not 1-99.
The automatic string recognition will start a new line every time it switches from 'string' to integer representation.
A PDB file has some attributes (e.g. a filename, creator and type id, ...) and zero or more data records.
Optionally it can have 2 special data chunks
--- the appinfo
and the sortinfo
blocks.
Each data record has some record attributes and the user data.
pdbdec converts binary PDB file into an ascii text source file.
For the syntax of the source file format consult pdbc(4).
Possible exit status values:
pdbdec 1.0
The idea of a template file is to write the decompiled output in the form given by the template file. The format of the template file is basically the same as a normal source file. Records from the binary pdb file are then decompiled in the same form as a matching record given in the template file. The values in the template file are then only place-holders for the real values encountered in the binary pdb file.
Several extension to the normal pdbc file format will be necessary to make template files useful.
Here some ideas:
- record matching. Defines which template record matches a record in the pdb file.
- do, while, for, if, else. Constructs to decompile complex structures correctly.
- variables, filled from the binary pdb file. Allows complex structures (e.g. arrays) depending on the data.
Please note: this is a brainstorm of a nice-to-have feature, not a promise.
Eric Obermuhlner (eric@obermuhlner.com)