|
1 | 1 | # Examples |
2 | 2 |
|
3 | | -## list_class.py |
| 3 | +## list_vmts.py |
4 | 4 |
|
5 | 5 | **Description**: |
6 | 6 |
|
7 | | -TODO |
| 7 | +A simple script displaying all VMTs found for a Delphi binary. |
| 8 | +It displays, for each VMT, its start address as well as the size of the instances of its class. |
8 | 9 |
|
9 | | -**Example**: |
| 10 | +**Dependencies**: |
10 | 11 |
|
11 | | - > python3 list_class.py binary.exe 7 |
| 12 | +- N/A |
| 13 | + |
| 14 | +**Usage**: |
| 15 | + |
| 16 | + > python3 examples/list_vmts.py |
| 17 | + Usage: examples/list_vmts.py <file_name> <delphi_version> |
| 18 | + |
| 19 | + > python3 examples/list_vmts.py binary.exe 7 |
12 | 20 | <DelphiNinja> [13:37:42.724] [InfoLog] File loaded |
13 | 21 | <DelphiNinja> [13:37:42.724] [InfoLog] ----------------------------- |
14 | 22 | <DelphiNinja> [13:37:42.725] [InfoLog] Searching for VMT... |
15 | | - <DelphiNinja> [13:37:42.730] [InfoLog] <TObject start=0x00401058 size=0x4> |
16 | | - <DelphiNinja> [13:37:42.763] [InfoLog] <Exception start=0x00404F20 size=0xC> |
17 | | - <DelphiNinja> [13:37:42.764] [InfoLog] <EHeapException start=0x00404F88 size=0x10> |
18 | | - <DelphiNinja> [13:37:42.765] [InfoLog] <EOutOfMemory start=0x00404FE4 size=0x10> |
19 | | - <DelphiNinja> [13:37:42.765] [InfoLog] <EInOutError start=0x00405040 size=0x10> |
20 | | - <DelphiNinja> [13:37:42.766] [InfoLog] <EExternal start=0x00405098 size=0x10> |
21 | | - <DelphiNinja> [13:37:42.766] [InfoLog] <EExternalException start=0x004050F0 size=0x10> |
22 | | - <DelphiNinja> [13:37:42.767] [InfoLog] <EIntError start=0x00405150 size=0x10> |
23 | | - <DelphiNinja> [13:37:42.767] [InfoLog] <EDivByZero start=0x004051A8 size=0x10> |
24 | | - <DelphiNinja> [13:37:42.768] [InfoLog] <ERangeError start=0x00405200 size=0x10> |
25 | | - <DelphiNinja> [13:37:42.775] [InfoLog] <EIntOverflow start=0x00405258 size=0x10> |
26 | | - <DelphiNinja> [13:37:42.781] [InfoLog] <EMathError start=0x004052B4 size=0x10> |
27 | | - <DelphiNinja> [13:37:42.782] [InfoLog] <EInvalidOp start=0x0040530C size=0x10> |
28 | | - <DelphiNinja> [13:37:42.786] [InfoLog] <EZeroDivide start=0x00405364 size=0x10> |
29 | | - <DelphiNinja> [13:37:42.812] [InfoLog] <EOverflow start=0x004053BC size=0x10> |
30 | | - <DelphiNinja> [13:37:42.820] [InfoLog] <EUnderflow start=0x00405414 size=0x10> |
31 | | - <DelphiNinja> [13:37:42.822] [InfoLog] <EInvalidPointer start=0x0040546C size=0x10> |
32 | | - <DelphiNinja> [13:37:42.824] [InfoLog] <EInvalidCast start=0x004054C8 size=0xC> |
33 | | - <DelphiNinja> [13:37:42.842] [InfoLog] <EConvertError start=0x00405524 size=0xC> |
34 | | - <DelphiNinja> [13:37:42.843] [InfoLog] <EAccessViolation start=0x00405580 size=0x10> |
35 | | - <DelphiNinja> [13:37:42.844] [InfoLog] <EPrivilege start=0x004055E0 size=0x10> |
36 | | - <DelphiNinja> [13:37:42.845] [InfoLog] <EStackOverflow start=0x00405638 size=0x10> |
37 | | - <DelphiNinja> [13:37:42.846] [InfoLog] <EControlC start=0x00405694 size=0x10> |
38 | | - <DelphiNinja> [13:37:42.847] [InfoLog] <EVariantError start=0x004056EC size=0xC> |
39 | | - <DelphiNinja> [13:37:42.848] [InfoLog] <EAssertionFailed start=0x00405748 size=0xC> |
40 | | - <DelphiNinja> [13:37:42.849] [InfoLog] <EAbstractError start=0x004057A8 size=0xC> |
41 | | - <DelphiNinja> [13:37:42.851] [InfoLog] <EIntfCastError start=0x00405804 size=0xC> |
42 | | - <DelphiNinja> [13:37:42.868] [InfoLog] <ESafecallException start=0x00405860 size=0xC> |
43 | | - |
44 | | -## vmt_visualize.py |
| 23 | + <DelphiNinja> [13:37:42.730] [InfoLog] <TObject start=0x00401058 instance_size=0x4> |
| 24 | + <DelphiNinja> [13:37:42.763] [InfoLog] <Exception start=0x00404F20 instance_size=0xC> |
| 25 | + <DelphiNinja> [13:37:42.764] [InfoLog] <EHeapException start=0x00404F88 instance_size=0x10> |
| 26 | + <DelphiNinja> [13:37:42.765] [InfoLog] <EOutOfMemory start=0x00404FE4 instance_size=0x10> |
| 27 | + <DelphiNinja> [13:37:42.765] [InfoLog] <EInOutError start=0x00405040 instance_size=0x10> |
| 28 | + <DelphiNinja> [13:37:42.766] [InfoLog] <EExternal start=0x00405098 instance_size=0x10> |
| 29 | + <DelphiNinja> [13:37:42.766] [InfoLog] <EExternalException start=0x004050F0 instance_size=0x10> |
| 30 | + <DelphiNinja> [13:37:42.767] [InfoLog] <EIntError start=0x00405150 instance_size=0x10> |
| 31 | + <DelphiNinja> [13:37:42.767] [InfoLog] <EDivByZero start=0x004051A8 instance_size=0x10> |
| 32 | + <DelphiNinja> [13:37:42.768] [InfoLog] <ERangeError start=0x00405200 instance_size=0x10> |
| 33 | + <DelphiNinja> [13:37:42.775] [InfoLog] <EIntOverflow start=0x00405258 instance_size=0x10> |
| 34 | + <DelphiNinja> [13:37:42.781] [InfoLog] <EMathError start=0x004052B4 instance_size=0x10> |
| 35 | + <DelphiNinja> [13:37:42.782] [InfoLog] <EInvalidOp start=0x0040530C instance_size=0x10> |
| 36 | + <DelphiNinja> [13:37:42.786] [InfoLog] <EZeroDivide start=0x00405364 instance_size=0x10> |
| 37 | + <DelphiNinja> [13:37:42.812] [InfoLog] <EOverflow start=0x004053BC instance_size=0x10> |
| 38 | + <DelphiNinja> [13:37:42.820] [InfoLog] <EUnderflow start=0x00405414 instance_size=0x10> |
| 39 | + <DelphiNinja> [13:37:42.822] [InfoLog] <EInvalidPointer start=0x0040546C instance_size=0x10> |
| 40 | + <DelphiNinja> [13:37:42.824] [InfoLog] <EInvalidCast start=0x004054C8 instance_size=0xC> |
| 41 | + <DelphiNinja> [13:37:42.842] [InfoLog] <EConvertError start=0x00405524 instance_size=0xC> |
| 42 | + <DelphiNinja> [13:37:42.843] [InfoLog] <EAccessViolation start=0x00405580 instance_size=0x10> |
| 43 | + <DelphiNinja> [13:37:42.844] [InfoLog] <EPrivilege start=0x004055E0 instance_size=0x10> |
| 44 | + <DelphiNinja> [13:37:42.845] [InfoLog] <EStackOverflow start=0x00405638 instance_size=0x10> |
| 45 | + <DelphiNinja> [13:37:42.846] [InfoLog] <EControlC start=0x00405694 instance_size=0x10> |
| 46 | + <DelphiNinja> [13:37:42.847] [InfoLog] <EVariantError start=0x004056EC instance_size=0xC> |
| 47 | + <DelphiNinja> [13:37:42.848] [InfoLog] <EAssertionFailed start=0x00405748 instance_size=0xC> |
| 48 | + <DelphiNinja> [13:37:42.849] [InfoLog] <EAbstractError start=0x004057A8 instance_size=0xC> |
| 49 | + <DelphiNinja> [13:37:42.851] [InfoLog] <EIntfCastError start=0x00405804 instance_size=0xC> |
| 50 | + <DelphiNinja> [13:37:42.868] [InfoLog] <ESafecallException start=0x00405860 instance_size=0xC> |
| 51 | + |
| 52 | +## vmt_visualizer.py |
45 | 53 |
|
46 | 54 | **Description**: |
47 | 55 |
|
48 | | -TODO |
| 56 | +A script to graphically represent the inheritance of all classes for a Delphi binary. |
| 57 | + |
| 58 | +**Dependencies**: |
| 59 | + |
| 60 | +- pip install graphviz |
| 61 | +- Graphviz binaries ([https://graphviz.org/download/](https://graphviz.org/download/#executable-packages)) |
49 | 62 |
|
50 | | -**Example**: |
| 63 | +**Usage**: |
51 | 64 |
|
52 | | - > python3 vmt_visualize.py binary.exe 7 |
| 65 | + > python3 examples/vmt_visualizer.py |
| 66 | + Usage: examples/vmt_visualizer.py <file_name> <delphi_version> |
| 67 | + |
| 68 | + > python3 examples/vmt_visualizer.py binary.exe 7 |
53 | 69 |
|
54 | 70 |  |
55 | 71 |
|
56 | 72 | ## create_vmt_struct.py |
57 | 73 |
|
58 | 74 | **Description**: |
59 | 75 |
|
60 | | -TODO |
| 76 | +This script finds the VMTs of a binary, creates the corresponding structures and saves them in a Binary Ninja (`.bndb`) database. |
| 77 | +It's the equivalent of the `DelphiNinja\Analyze current binary` command in graphical mode. |
| 78 | + |
| 79 | +**Dependencies**: |
| 80 | + |
| 81 | +- N/A |
| 82 | + |
| 83 | +**Usage**: |
61 | 84 |
|
62 | | -**Example**: |
| 85 | + > python3 examples/create_vmt_structs.py |
| 86 | + Usage: examples/create_vmt_structs.py <file_name> <delphi_version> |
63 | 87 |
|
64 | | - > python3 create_vmt_struct.py binary.exe 7 |
| 88 | + > python3 examples/create_vmt_structs.py binary.exe 7 |
| 89 | + [...] |
| 90 | + <DelphiNinja> [13:37:42.089] [InfoLog] Saving database: `binary.exe.bndb`... |
65 | 91 |
|
66 | 92 |  |
0 commit comments