├── .gitignore
├── README.md
├── bin
├── Hex-Rays Plugin contest
│ ├── 2013
│ │ ├── HexRaysCodeXplorer v1.0.pdf
│ │ └── HexRaysCodeXplorer.plw
│ └── 2015
│ │ ├── Linux
│ │ └── HexRaysCodeXplorer.plx
│ │ ├── Mac
│ │ ├── HexRaysCodeXplorer.pmc
│ │ └── HexRaysCodeXplorer.pmc64
│ │ └── Win
│ │ ├── HexRaysCodeXplorer.p64
│ │ └── HexRaysCodeXplorer.plw
├── v1.1 [ZeroNights Edition]
│ └── win
│ │ └── HexRaysCodeXplorer.plw
├── v1.2
│ └── win
│ │ └── HexRaysCodeXplorer.plw
├── v1.5 [H2HC Edition]
│ └── win
│ │ └── HexRaysCodeXplorer.plw
├── v1.6
│ ├── HexRaysCodeXplorer.p64
│ └── HexRaysCodeXplorer.plw
├── v1.7 [NSEC15 Edition]
│ ├── HexRaysCodeXplorer.p64
│ └── HexRaysCodeXplorer.plw
└── v2.0 [BlackHat Edition]
│ ├── IDA 6.95
│ ├── Linux
│ │ ├── HexRaysCodeXplorer.plx
│ │ └── HexRaysCodeXplorer.plx64
│ └── Win
│ │ ├── HexRaysCodeXplorer.p64
│ │ └── HexRaysCodeXplorer.plw
│ ├── IDA v6.8
│ ├── Linux
│ │ └── HexRaysCodeXplorer.plx
│ ├── Mac
│ │ ├── HexRaysCodeXplorer.pmc
│ │ └── HexRaysCodeXplorer.pmc64
│ └── Win
│ │ ├── HexRaysCodeXplorer.p64
│ │ └── HexRaysCodeXplorer.plw
│ └── IDA v6.9
│ └── Win
│ ├── HexRaysCodeXplorer.p64
│ └── HexRaysCodeXplorer.plw
├── img
├── 1.jpg
├── 11.png
├── 12.png
├── 13.png
├── 14.PNG
├── 16.PNG
├── 2.png
├── 3.png
├── 4.png
├── 5.png
├── 6.png
├── 7.png
├── 8.png
└── m1.png
└── src
├── HexRaysCodeXplorer.sln
├── HexRaysCodeXplorer.xcodeproj
└── project.pbxproj
├── HexRaysCodeXplorer
├── CMakeLists.txt
├── CodeXplorer.cpp
├── Common.h
├── Compat.cpp
├── Compat.h
├── CtreeExtractor.cpp
├── CtreeExtractor.h
├── CtreeGraphBuilder.cpp
├── CtreeGraphBuilder.h
├── Debug.cpp
├── Debug.h
├── GCCObjectFormatParser.cpp
├── GCCObjectFormatParser.h
├── GCCTypeInfo.cpp
├── GCCTypeInfo.h
├── GCCVtableInfo.cpp
├── GCCVtableInfo.h
├── HexRaysCodeXplorer.vcxproj
├── IObjectFormatParser.cpp
├── IObjectFormatParser.h
├── Linux.h
├── MSVCObjectFormatParser.cpp
├── MSVCObjectFormatParser.h
├── Makefile.osx
├── MicrocodeExtractor.cpp
├── MicrocodeExtractor.h
├── ObjectExplorer.cpp
├── ObjectExplorer.h
├── PropertySheet.props
├── ReconstructableType.cpp
├── ReconstructableType.h
├── TypeExtractor.cpp
├── TypeExtractor.h
├── TypeReconstructor.cpp
├── TypeReconstructor.h
├── Utility.cpp
├── Utility.h
├── gcc_rtti_til.h
├── makefile.lnx
├── makefile.mac
├── makefile7.mac
├── reconstructed_place_t.cpp
└── reconstructed_place_t.h
└── cmake
└── FindIdaSdk.cmake
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files
2 | *.slo
3 | *.lo
4 | *.o
5 |
6 | # Compiled Dynamic libraries
7 | *.so
8 | *.dylib
9 |
10 | # Compiled Static libraries
11 | *.lai
12 | *.la
13 | *.a
14 | /src/HexRaysCodeXplorer/x64
15 | /src/.vs
16 | /src/*.db
17 | /src/*.opendb
18 |
19 | # CMake
20 | build/
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | _ _ ______ _____ _ __ __ _
3 | | | | | | ___ \ / __ \ | | \ \ / / | |
4 | | |_| | _____ _| |_/ /__ _ _ _ ___| / \/ ___ __| | ___ \ V / _ __ | | ___ _ __ ___ _ __
5 | | _ |/ _ \ \/ / // _` | | | / __| | / _ \ / _` |/ _ \/ \| '_ \| |/ _ \| '__/ _ \ '__|
6 | | | | | __/> <| |\ \ (_| | |_| \__ \ \__/\ (_) | (_| | __/ /^\ \ |_) | | (_) | | | __/ |
7 | \_| |_/\___/_/\_\_| \_\__,_|\__, |___/\____/\___/ \__,_|\___\/ \/ .__/|_|\___/|_| \___|_|
8 | __/ | | |
9 | |___/ |_|
10 | ============================================================================
11 |
12 | [](http://www.gnu.org/licenses/gpl-3.0)
13 | [](https://codeclimate.com/github/REhints/HexRaysCodeXplorer)
14 | [](https://codeclimate.com/github/REhints/HexRaysCodeXplorer)
15 |
16 | The Hex-Rays Decompiler plugin for better code navigation in RE process. CodeXplorer automates code REconstruction of C++ applications or modern malware like Stuxnet, Flame, Equation, Animal Farm ... :octocat:
17 |
18 | The CodeXplorer plugin is one of the [first publicly available](https://www.hex-rays.com/products/decompiler/manual/third_party.shtml) Hex-Rays Decompiler plugins. We keep updated this project [since summer of 2013](https://www.hex-rays.com/contests/2013/) and continue contributing new features frequently. Also most interesting feutures of CodeXplorer have been presented on numerous security conferences like: REcon, ZeroNights, H2HC, NSEC and BHUS :space_invader:
19 |
20 | __Contributors__:
21 |
22 | Alex Matrosov ([@matrosov](https://github.com/matrosov))
23 |
24 | Eugene Rodionov ([@rodionov](https://github.com/rodionov))
25 |
26 | Rodrigo Branco ([@rrbranco](https://github.com/rrbranco))
27 |
28 | Gabriel Barbosa ([@gabrielnb](https://github.com/gabrielnb))
29 |
30 | __Supported versions of Hex-Rays products:__ everytime we focus on last versions of IDA and Decompiler because trying to use new interesting features in new SDK releases. It's also mean we tested just on last versions of Hex-Rays products and not guaranteed stable work on previous ones.
31 |
32 | __Why not IdaPython:__ all code developed on C/C++ because it's more stable way to support complex plugin for Hex-Rays Decompiler.
33 |
34 | __Supported Platforms:__ x86/x64 for Win, Linux and Mac.
35 |
36 | __HexRaysCodeXplorer__ - Hex-Rays Decompiler plugin for easier code navigation. Right-click context menu in the Pseudocode window shows CodeXplorer plugin commands:
37 |
38 | 
39 |
40 | :gem: __Here are the main features of the CodeXplorer plugin:__ :gem:
41 |
42 | * ***Automatic type REconstruction*** for C++ objects. To be able to reconstruct a type using HexRaysCodeXplorer one needs to select the variable holding pointer to the instance of position independed code or to an object and by right-button mouse click select from the context menu «REconstruct Type» option:
43 |
44 | 
45 |
46 | The reconstructed structure is displayed in “Output window”. Detailed information about type Reconstruction feature is provided in the blog post “[Type REconstruction in HexRaysCodeXplorer](http://rehints.com/2013-09-02-Type-REconstruction-in-HexRaysCodeXplorer.html)”.
47 |
48 | Also CodeXplorer plugin supports auto REconstruction type into IDA local types storage.
49 |
50 | 
51 |
52 | * ***Virtual function table identification*** - automatically identifies references to virtual function tables during type reconstruction. When a reference to a virtual function table is identified the plugin generates a corresponding C-structure. As shown below during reconstructing `struct_local_data_storage` two virtual function tables were identified and, as a result, two corresponding structures were generated: `struct_local_data_storage_VTABLE_0` and `struct_local_data_storage_VTABLE_4`.
53 |
54 | 
55 |
56 | * ***C-tree graph visualization*** – a special tree-like structure representing a decompiled routine in citem_t terms (hexrays.hpp). Useful feature for understanding how the decompiler works. The highlighted graph node corresponds to the current cursor position in the HexRays Pseudocode window:
57 |
58 | 
59 |
60 | * ***Ctree Item View*** – show ctree representation for highlighted element:
61 |
62 | 
63 |
64 | * ***Extract Ctrees to File*** – dump calculate SHA1 hash and dump all ctrees to file.
65 |
66 | 
67 |
68 | * ***Extract Types to File*** – dump all types information (include reconstructed types) into file.
69 |
70 | * ***Navigation through virtual function calls*** in HexRays Pseudocode window. After representing C++ objects by C-structures this feature make possible navigation by mouse clicking to the virtual function calls as structure fields:
71 |
72 | 
73 |
74 | * ***Jump to Disasm*** - small feature for navigate to assembly code into "IDA View window" from current Pseudocode line position. It is help to find a place in assembly code associated with decompiled line.
75 |
76 | 
77 |
78 | * ***Object Explorer*** – useful interface for navigation through virtual tables (VTBL) structures. Object Explorer outputs VTBL information into IDA custom view window. The output window is shown by choosing «Object Explorer» option in right-button mouse click context menu:
79 |
80 | 
81 |
82 | __Object Explorer supports following features:__
83 | * Auto structures generation for VTBL into IDA local types
84 |
85 | * Navigation in virtual table list and jump to VTBL address into "IDA View" window by click
86 |
87 | * Show hints for current position in virtual table list
88 |
89 | * Shows cross-references list by click into menu on "Show XREFS to VTBL"
90 |
91 | 
92 |
93 | * Support auto parsing RTTI objects:
94 |
95 | 
96 |
97 | __The Batch mode contains following features:__
98 |
99 | * Batch mode - useful feature to use CodeXplorer for processing multiple files without any interaction from user. We add this feature after Black Hat research in 2015 for processing 2 millions samples.
100 |
101 | ```
102 | Example (dump types and ctrees for functions with name prefix "crypto_"):
103 | idaq.exe -OHexRaysCodeXplorer:dump_types:dump_ctrees:CRYPTOcrypto_path_to_idb
104 | ```
105 |
106 | __Compiling__:
107 |
108 | ***Windows***:
109 | * Open the solution in Visual Studio
110 | * Open file `src/HexRaysCodeXplorer/PropertySheet.props` in notepad(++) and update values of `IDADIR` and `IDASDK` paths to point to IDA installation path and IDA7 SDK path accordingly. HexRays SDK should be in `$IDADIR\plugins\hexrays_sdk` (like by default)
111 | * Build `Release | x64` and `Release x64 | x64` configurations
112 |
113 | ***Linux***:
114 | * cd src/HexRaysCodeXplorer/
115 | * IDA_DIR= IDA_SDK= EA64=0 make -f makefile.lnx
116 | * IDA_DIR= IDA_SDK= EA64=0 make -f makefile.lnx install
117 |
118 | ***Mac***:
119 | * cd src/HexRaysCodeXplorer/
120 | * IDA_DIR= IDA_SDK= make -f makefile.mac
121 | * The Mac makefile might need some hand editing, pull requests welcome!
122 | * IDA 7.0 `.pmc` file extension should be `.dylib`
123 | * bash$ `export IDA_DIR="/Applications/IDA\ Pro\ 7.0/ida.app/Contents/MacOS" && export IDA_SDK="/Applications/IDA\ Pro\ 7.0/ida.app/Contents/MacOS/idasdk" && make -f makefile7.mac`
124 | * Or open project in Xcode `HexRaysCodeXplorer.xcodeproj`
125 |
126 | ***With CMake***:
127 | * cd src/HexRaysCodeXplorer/
128 | * mkdir build && cd build
129 | * cmake .. -DIdaSdk_ROOT_DIR= -DHexRaysSdk_ROOT_DIR=
130 | * cmake --build . --config Release
131 |
132 | ============================================================================
133 |
134 | __Conference talks about CodeXplorer plugin:__
135 | * **2015**
136 | * "Distributing the REconstruction of High-Level IR for Large Scale Malware Analysis", BHUS [[slides]](https://github.com/REhints/Publications/blob/master/Conferences/BH'2015/BH_2015.pdf)
137 | * "Object Oriented Code RE with HexraysCodeXplorer", NSEC [[slides]](https://github.com/REhints/Publications/raw/master/Conferences/Nsec'2015/nsec_2015.pdf)
138 | * **2014**
139 | * "HexRaysCodeXplorer: object oriented RE for fun and profit", H2HC [[slides]](https://github.com/REhints/Publications/blob/master/Conferences/ZeroNights'2013/ZN_2013_pdf.pdf)
140 | * **2013**
141 | * "HexRaysCodeXplorer: make object-oriented RE easier", ZeroNights [[slides]](https://github.com/REhints/Publications/blob/master/Conferences/ZeroNights'2013/ZN_2013_pdf.pdf)
142 | * "Reconstructing Gapz: Position-Independent Code Analysis Problem", REcon [[slides]](https://github.com/REhints/Publications/blob/master/Conferences/RECON'2013/RECON_2013.pdf)
143 |
--------------------------------------------------------------------------------
/bin/Hex-Rays Plugin contest/2013/HexRaysCodeXplorer v1.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/Hex-Rays Plugin contest/2013/HexRaysCodeXplorer v1.0.pdf
--------------------------------------------------------------------------------
/bin/Hex-Rays Plugin contest/2013/HexRaysCodeXplorer.plw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/Hex-Rays Plugin contest/2013/HexRaysCodeXplorer.plw
--------------------------------------------------------------------------------
/bin/Hex-Rays Plugin contest/2015/Linux/HexRaysCodeXplorer.plx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/Hex-Rays Plugin contest/2015/Linux/HexRaysCodeXplorer.plx
--------------------------------------------------------------------------------
/bin/Hex-Rays Plugin contest/2015/Mac/HexRaysCodeXplorer.pmc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/Hex-Rays Plugin contest/2015/Mac/HexRaysCodeXplorer.pmc
--------------------------------------------------------------------------------
/bin/Hex-Rays Plugin contest/2015/Mac/HexRaysCodeXplorer.pmc64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/Hex-Rays Plugin contest/2015/Mac/HexRaysCodeXplorer.pmc64
--------------------------------------------------------------------------------
/bin/Hex-Rays Plugin contest/2015/Win/HexRaysCodeXplorer.p64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/Hex-Rays Plugin contest/2015/Win/HexRaysCodeXplorer.p64
--------------------------------------------------------------------------------
/bin/Hex-Rays Plugin contest/2015/Win/HexRaysCodeXplorer.plw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/Hex-Rays Plugin contest/2015/Win/HexRaysCodeXplorer.plw
--------------------------------------------------------------------------------
/bin/v1.1 [ZeroNights Edition]/win/HexRaysCodeXplorer.plw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v1.1 [ZeroNights Edition]/win/HexRaysCodeXplorer.plw
--------------------------------------------------------------------------------
/bin/v1.2/win/HexRaysCodeXplorer.plw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v1.2/win/HexRaysCodeXplorer.plw
--------------------------------------------------------------------------------
/bin/v1.5 [H2HC Edition]/win/HexRaysCodeXplorer.plw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v1.5 [H2HC Edition]/win/HexRaysCodeXplorer.plw
--------------------------------------------------------------------------------
/bin/v1.6/HexRaysCodeXplorer.p64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v1.6/HexRaysCodeXplorer.p64
--------------------------------------------------------------------------------
/bin/v1.6/HexRaysCodeXplorer.plw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v1.6/HexRaysCodeXplorer.plw
--------------------------------------------------------------------------------
/bin/v1.7 [NSEC15 Edition]/HexRaysCodeXplorer.p64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v1.7 [NSEC15 Edition]/HexRaysCodeXplorer.p64
--------------------------------------------------------------------------------
/bin/v1.7 [NSEC15 Edition]/HexRaysCodeXplorer.plw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v1.7 [NSEC15 Edition]/HexRaysCodeXplorer.plw
--------------------------------------------------------------------------------
/bin/v2.0 [BlackHat Edition]/IDA 6.95/Linux/HexRaysCodeXplorer.plx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v2.0 [BlackHat Edition]/IDA 6.95/Linux/HexRaysCodeXplorer.plx
--------------------------------------------------------------------------------
/bin/v2.0 [BlackHat Edition]/IDA 6.95/Linux/HexRaysCodeXplorer.plx64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v2.0 [BlackHat Edition]/IDA 6.95/Linux/HexRaysCodeXplorer.plx64
--------------------------------------------------------------------------------
/bin/v2.0 [BlackHat Edition]/IDA 6.95/Win/HexRaysCodeXplorer.p64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v2.0 [BlackHat Edition]/IDA 6.95/Win/HexRaysCodeXplorer.p64
--------------------------------------------------------------------------------
/bin/v2.0 [BlackHat Edition]/IDA 6.95/Win/HexRaysCodeXplorer.plw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v2.0 [BlackHat Edition]/IDA 6.95/Win/HexRaysCodeXplorer.plw
--------------------------------------------------------------------------------
/bin/v2.0 [BlackHat Edition]/IDA v6.8/Linux/HexRaysCodeXplorer.plx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v2.0 [BlackHat Edition]/IDA v6.8/Linux/HexRaysCodeXplorer.plx
--------------------------------------------------------------------------------
/bin/v2.0 [BlackHat Edition]/IDA v6.8/Mac/HexRaysCodeXplorer.pmc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v2.0 [BlackHat Edition]/IDA v6.8/Mac/HexRaysCodeXplorer.pmc
--------------------------------------------------------------------------------
/bin/v2.0 [BlackHat Edition]/IDA v6.8/Mac/HexRaysCodeXplorer.pmc64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v2.0 [BlackHat Edition]/IDA v6.8/Mac/HexRaysCodeXplorer.pmc64
--------------------------------------------------------------------------------
/bin/v2.0 [BlackHat Edition]/IDA v6.8/Win/HexRaysCodeXplorer.p64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v2.0 [BlackHat Edition]/IDA v6.8/Win/HexRaysCodeXplorer.p64
--------------------------------------------------------------------------------
/bin/v2.0 [BlackHat Edition]/IDA v6.8/Win/HexRaysCodeXplorer.plw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v2.0 [BlackHat Edition]/IDA v6.8/Win/HexRaysCodeXplorer.plw
--------------------------------------------------------------------------------
/bin/v2.0 [BlackHat Edition]/IDA v6.9/Win/HexRaysCodeXplorer.p64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v2.0 [BlackHat Edition]/IDA v6.9/Win/HexRaysCodeXplorer.p64
--------------------------------------------------------------------------------
/bin/v2.0 [BlackHat Edition]/IDA v6.9/Win/HexRaysCodeXplorer.plw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/bin/v2.0 [BlackHat Edition]/IDA v6.9/Win/HexRaysCodeXplorer.plw
--------------------------------------------------------------------------------
/img/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/1.jpg
--------------------------------------------------------------------------------
/img/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/11.png
--------------------------------------------------------------------------------
/img/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/12.png
--------------------------------------------------------------------------------
/img/13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/13.png
--------------------------------------------------------------------------------
/img/14.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/14.PNG
--------------------------------------------------------------------------------
/img/16.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/16.PNG
--------------------------------------------------------------------------------
/img/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/2.png
--------------------------------------------------------------------------------
/img/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/3.png
--------------------------------------------------------------------------------
/img/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/4.png
--------------------------------------------------------------------------------
/img/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/5.png
--------------------------------------------------------------------------------
/img/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/6.png
--------------------------------------------------------------------------------
/img/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/7.png
--------------------------------------------------------------------------------
/img/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/8.png
--------------------------------------------------------------------------------
/img/m1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/REhints/HexRaysCodeXplorer/0fd0f61dce2ba388a654762c8742d4cb25fae91e/img/m1.png
--------------------------------------------------------------------------------
/src/HexRaysCodeXplorer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29806.167
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HexRaysCodeXplorer", "HexRaysCodeXplorer\HexRaysCodeXplorer.vcxproj", "{F7E6B557-41F3-444A-BCA4-3527547DD665}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug x64|Win32 = Debug x64|Win32
11 | Debug x64|x64 = Debug x64|x64
12 | Debug|Win32 = Debug|Win32
13 | Debug|x64 = Debug|x64
14 | Release x64|Win32 = Release x64|Win32
15 | Release x64|x64 = Release x64|x64
16 | Release|Win32 = Release|Win32
17 | Release|x64 = Release|x64
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {F7E6B557-41F3-444A-BCA4-3527547DD665}.Debug x64|Win32.ActiveCfg = Debug x64|x64
21 | {F7E6B557-41F3-444A-BCA4-3527547DD665}.Debug x64|x64.ActiveCfg = Debug x64|x64
22 | {F7E6B557-41F3-444A-BCA4-3527547DD665}.Debug x64|x64.Build.0 = Debug x64|x64
23 | {F7E6B557-41F3-444A-BCA4-3527547DD665}.Debug|Win32.ActiveCfg = Debug|x64
24 | {F7E6B557-41F3-444A-BCA4-3527547DD665}.Debug|x64.ActiveCfg = Debug|x64
25 | {F7E6B557-41F3-444A-BCA4-3527547DD665}.Debug|x64.Build.0 = Debug|x64
26 | {F7E6B557-41F3-444A-BCA4-3527547DD665}.Release x64|Win32.ActiveCfg = Release x64|x64
27 | {F7E6B557-41F3-444A-BCA4-3527547DD665}.Release x64|x64.ActiveCfg = Release x64|x64
28 | {F7E6B557-41F3-444A-BCA4-3527547DD665}.Release x64|x64.Build.0 = Release x64|x64
29 | {F7E6B557-41F3-444A-BCA4-3527547DD665}.Release|Win32.ActiveCfg = Release|x64
30 | {F7E6B557-41F3-444A-BCA4-3527547DD665}.Release|x64.ActiveCfg = Release|x64
31 | {F7E6B557-41F3-444A-BCA4-3527547DD665}.Release|x64.Build.0 = Release|x64
32 | EndGlobalSection
33 | GlobalSection(SolutionProperties) = preSolution
34 | HideSolutionNode = FALSE
35 | EndGlobalSection
36 | GlobalSection(ExtensibilityGlobals) = postSolution
37 | SolutionGuid = {8C949C23-C6D6-418A-9214-CD10668201BC}
38 | VisualSVNWorkingCopyRoot = .
39 | EndGlobalSection
40 | EndGlobal
41 |
--------------------------------------------------------------------------------
/src/HexRaysCodeXplorer/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.7)
2 |
3 | project(HexRaysCodeXplorer CXX)
4 |
5 | set(CMAKE_CXX_STANDARD 17)
6 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
7 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
8 |
9 | if(APPLE)
10 | set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-fPIC -arch x86_64")
11 | else()
12 | set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-fPIC")
13 | endif()
14 |
15 | list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake)
16 |
17 | find_package(IdaSdk REQUIRED)
18 |
19 | set(HexRaysSdk_INCLUDE_DIRS ${HexRaysSdk_ROOT_DIR}/include)
20 |
21 | include_directories(${HexRaysSdk_INCLUDE_DIRS})
22 | include_directories(${PROJECT_SOURCE_DIR})
23 |
24 | set(src
25 | "CodeXplorer.cpp"
26 | "Common.h"
27 | "Compat.cpp"
28 | "Compat.h"
29 | "CtreeExtractor.cpp"
30 | "CtreeExtractor.h"
31 | "CtreeGraphBuilder.cpp"
32 | "CtreeGraphBuilder.h"
33 | "Debug.cpp"
34 | "Debug.h"
35 | "GCCObjectFormatParser.cpp"
36 | "GCCObjectFormatParser.h"
37 | "GCCTypeInfo.cpp"
38 | "GCCTypeInfo.h"
39 | "GCCVtableInfo.cpp"
40 | "GCCVtableInfo.h"
41 | "IObjectFormatParser.cpp"
42 | "IObjectFormatParser.h"
43 | "Linux.h"
44 | "MSVCObjectFormatParser.cpp"
45 | "MSVCObjectFormatParser.h"
46 | "MicrocodeExtractor.cpp"
47 | "MicrocodeExtractor.h"
48 | "ObjectExplorer.cpp"
49 | "ObjectExplorer.h"
50 | "ReconstructableType.cpp"
51 | "ReconstructableType.h"
52 | "TypeExtractor.cpp"
53 | "TypeExtractor.h"
54 | "TypeReconstructor.cpp"
55 | "TypeReconstructor.h"
56 | "Utility.cpp"
57 | "Utility.h"
58 | "gcc_rtti_til.h"
59 | "reconstructed_place_t.cpp"
60 | "reconstructed_place_t.h")
61 |
62 | add_ida_plugin(HexRaysCodeXplorer ${PROJECT_SOURCE_DIR}/CodeXplorer.cpp)
63 |
64 | set_ida_target_properties(HexRaysCodeXplorer PROPERTIES CXX_STANDARD 17)
65 | ida_target_include_directories(HexRaysCodeXplorer PRIVATE
66 | ${IdaSdk_INCLUDE_DIRS})
67 |
68 | add_ida_library(HexRaysCodeXplorerLib ${src})
69 | ida_target_link_libraries(HexRaysCodeXplorer HexRaysCodeXplorerLib)
70 |
--------------------------------------------------------------------------------
/src/HexRaysCodeXplorer/Common.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2013-2015
2 | REhints
3 | All rights reserved.
4 |
5 | ==============================================================================
6 |
7 | This file is part of HexRaysCodeXplorer
8 |
9 | HexRaysCodeXplorer is free software: you can redistribute it and/or modify it
10 | under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | This program is distributed in the hope that it will be useful, but
15 | WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 | General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with this program. If not, see .
21 |
22 | ==============================================================================
23 | */
24 |
25 | #ifndef __H_COMMON__
26 | #define __H_COMMON__
27 |
28 | #pragma once
29 |
30 | #if !defined (__LINUX__) && !defined (__MAC__)
31 | #ifdef __MAKEDLL__
32 | # define DLLEXPORT __declspec(dllexport)
33 | #else
34 | # define DLLEXPORT __declspec(dllimport)
35 | #endif
36 | #else
37 | #define DLLEXPORT
38 | #endif
39 |
40 |
41 |
42 |
43 | #if !defined (__LINUX__) && !defined (__MAC__)
44 | #pragma warning (disable: 4996 4800 )
45 | #else
46 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
47 | #endif
48 |
49 | #if !defined (__LINUX__) && !defined (__MAC__)
50 | #include
51 | #include
52 | #else
53 | #include "Linux.h"
54 | #endif
55 |
56 | #ifdef __NT__
57 | #pragma warning(push)
58 | #pragma warning(disable:4309 4244 4267) // disable "truncation of constant value" warning from IDA SDK, conversion from 'ssize_t' to 'int', possible loss of data
59 | #endif // __NT__
60 | #ifndef USE_DANGEROUS_FUNCTIONS
61 | #define USE_DANGEROUS_FUNCTIONS
62 | #endif
63 | #ifdef __clang__
64 | #pragma clang diagnostic push
65 | #pragma clang diagnostic ignored "-Wsign-compare"
66 | #pragma clang diagnostic ignored "-Wvarargs"
67 | #pragma clang diagnostic ignored "-Wlogical-op-parentheses"
68 | #pragma clang diagnostic ignored "-Wunused-private-field"
69 | #endif
70 | #include
71 | #include
72 | #include
73 | #include
74 | #include
75 | #include
76 | #include
77 | #include
78 | #include
79 | #include
80 | #include
81 | #include
82 | #include
83 | #include
84 | #include
85 | #include
86 | #include
87 | #include
88 | #include
89 | #include
90 | #include
91 |
92 |
93 | #ifdef __NT__
94 | #pragma warning(pop)
95 | #endif // __NT__
96 | #ifdef __clang__
97 | #pragma clang diagnostic pop
98 | #endif
99 |
100 | #if IDA_SDK_VERSION < 800
101 | #define EA_SIZE sizeof(ea_t)
102 | #else
103 | #define EA_SIZE EAH.ea_size
104 | #endif
105 |
106 | template
107 | struct print1_accepts_qstring
108 | {
109 | template struct yay_sfinae {};
110 | template static char test(yay_sfinae*);
111 | template static int test(...);
112 | static const bool value = sizeof(test(0)) == sizeof(char);
113 | };
114 |
115 | // For IDA7.1 and newer
116 | template
117 | void print1wrapper(std::true_type, const T *e, qstring *qbuf, const cfunc_t *func) {
118 | e->print1(qbuf, func);
119 | };
120 |
121 | // For older SDKs
122 | template
123 | void print1wrapper(std::false_type, const T *e, qstring *qbuf, const cfunc_t *func) {
124 | char lbuf[MAXSTR];
125 | const size_t len = e->print1(lbuf, sizeof(lbuf) - 1, func);
126 | qstring temp(lbuf, len);
127 | qbuf->swap(temp);
128 | };
129 |
130 | template
131 | void print1wrapper(const T *e, qstring *qbuf, const cfunc_t *func) {
132 | return print1wrapper(
133 | std::integral_constant::value>(),
134 | e, qbuf, func);
135 | }
136 |
137 |
138 |
139 | #include
140 | #include
141 | #include
142 |
143 | #include
144 | #include
145 | #include
146 | #include
147 | #include
148 | #include