This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathplugin.json
25 lines (25 loc) · 4.73 KB
/
plugin.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
"pluginmetadataversion": 2,
"name": "MSVC Native",
"author": "Mason Reed",
"type": [
"analysis"
],
"api": [
"python3"
],
"description": "Parses and symbolizes MSVC RTTI information in Binary Ninja",
"longdescription": "# MSVC RTTI\n\nParses and symbolizes MSVC RTTI information in [Binary Ninja].\n\n## Example Virtual Function Table Listing\n\nArguably the most import function of symbolizing RTTI information is the virtual function tables. The listing below is the symbolized view of `simple.cpp` (found in test\\bins).\n\n```cpp\nvoid* data_140010320 = ParentA::`RTTI Complete Object Locator\nstruct ParentA::VTable ParentA::`vftable = \n{\n void* (* const vFunc_0)(void* arg1, int32_t arg2) = ParentB::vFunc_0\n int64_t (* const vFunc_1)() __pure = ParentA::vFunc_1\n int64_t (* const vFunc_2)() __pure = ParentA::vFunc_2\n}\nvoid* data_140010340 = ParentB::`RTTI Complete Object Locator\nstruct ParentB::VTable ParentB::`vftable = \n{\n void* (* const vFunc_0)(void* arg1, int32_t arg2) = ParentB::vFunc_0\n int64_t (* const vFunc_1)() __pure = ParentB::vFunc_1\n}\nvoid* data_140010358 = SomeClass::`RTTI Complete Object Locator\nstruct SomeClass::VTable SomeClass::`vftable = \n{\n void* (* const vFunc_0)(void* arg1, int32_t arg2) = SomeClass::vFunc_0\n int64_t (* const vFunc_1)() __pure = ParentA::vFunc_1\n int64_t (* const vFunc_2)() __pure = ParentA::vFunc_2\n int64_t (* const vFunc_3)() __pure = SomeClass::vFunc_3\n}\nvoid* data_140010380 = SomeClass::`RTTI Complete Object Locator{for `ParentB}\nstruct ParentB::VTable SomeClass::`vftable{for `ParentB} = \n{\n void* (* const vFunc_0)(void* arg1, int32_t arg2) = SomeClass::vFunc_0\n int64_t (* const vFunc_1)() __pure = ParentB::vFunc_1\n}\n```\n\n## Example Constructor Listing\n\nBased off the information collected from the RTTI scan, we can deduce constructors and create types and symbolize their structures. Using the [type inheritence](https://binary.ninja/2023/05/03/3.4-finally-freed.html#inherited-types) in [Binary Ninja] we can make these types easily composable. The listing below shows the fully symbolized constructor function for `Bird` in `overrides.cpp` (found in test\\bins), as well as the accompanying auto created type.\n\n```cpp\nclass __base(Animal, 0) __base(Flying, 0) Bird\n{\n struct `Bird::VTable`* vtable;\n char const* field_8;\n struct `Flying::VTable`* vtable_Flying;\n int32_t field_18;\n __padding char _1C[4];\n int32_t field_20;\n};\n\nclass Bird* Bird::Bird(class Bird* this, int32_t arg2)\n{\n Animal::Animal(this);\n Flying::Flying(&this->vtable_Flying);\n this->vtable = &Bird::`vftable';\n this->vtable_Flying = &Bird::`vftable'{for `Flying};\n this->field_8 = \"A bird\";\n this->field_18 = 0x58;\n this->field_20 = arg2;\n return this;\n}\n```\n\n## Example Virtual Function Listing\n\nUsing the newly created constructor object type in [Example Constructor Listing](#example-constructor-listing) we can apply it to all virtual functions as the first parameter. The listing below shows a fully symbolized virtual function for `Bird` in `overrides.cpp` (found in test\\bins).\n\n```cpp\nuint64_t Bird::vFunc_0(class Bird* this)\n{\n int32_t var_18 = 0;\n uint64_t field_20;\n while (true)\n {\n field_20 = ((uint64_t)this->field_20);\n if (var_18 >= field_20)\n {\n break;\n }\n fputs(\"Tweet!\");\n var_18 = (var_18 + 1);\n }\n return field_20;\n}\n\n```\n\n[Binary Ninja]: https://binary.ninja\n",
"license": {
"name": "MIT",
"text": "Copyright 2023 Mason Reed\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
},
"platforms": [
"Darwin",
"Windows",
"Linux"
],
"dependencies": {},
"version": "1.2.1",
"minimumbinaryninjaversion": 4771
}