mdttool¶
This a utility for manipulating MDT and MDN files used to load firmware. These files use an ELF header, followed by the certificates used for signing the files. MDT files are used on Android and support a single executable, whereas MBN files are used on Linux and support multiple executables.
The executable is split using the program headers in the ELF header, usually producing 9 separate files. The --split command will split the MBN or ELF file into the seperate files, while the --merge command combines the seperate files into an executable which can be used for disassembly. The --dump command is similar to what the readelf program displays.
Usage¶
usage: mdttool.py [-h] [-v] [-d] [-s] [-e] [-m] [-c] FILE
options:
-h, --help show this help message and exit
-v, --verbose verbose output
-d, --dump Dump All Headers
-s, --split Export the programs from the ELF file
-e, --extract Extract the SSL certificates from the ELF file
-m, --merge Merge all the program headers into an ELF file
-c, --create Create an MDT file
Dump¶
This is a very verbose recursive dump of the ELF header, and program headers, and the section headers.
Split¶
This splits an ELF file into multiple files based on the program header. This is the format expected on Android.
Merge¶
This merges all of the separate files back into a single ELF file for analysis.
Extract¶
This extracts the 3 SSl certificates from a .mdt file into seperate files so they can be validated.
Create¶
This creates a .mdt file from it's separate files. This uses the .b00 file, which contains the ELF header, followed by the 3 SSl certificates.