├── .gitignore ├── README.md ├── classinformer-code ├── IDA_ClassInformer.sln └── Plugin │ ├── ClassInformerRes.qrc │ ├── Class_Informer.txt │ ├── IDA_ClassInformer_PlugIn.vcxproj │ ├── IDA_ClassInformer_PlugIn.vcxproj.filters │ ├── IDA_ClassInformer_PlugIn.vcxproj.user │ ├── Main.cpp │ ├── Main.h │ ├── MainDialog.cpp │ ├── MainDialog.h │ ├── PropertySheet.props │ ├── RTTI.cpp │ ├── RTTI.h │ ├── StdAfx.h │ ├── Vftable.cpp │ ├── Vftable.h │ ├── banner.png │ ├── checkbox-checked.png │ ├── completed.ogg │ ├── dialog.ui │ ├── icon.png │ ├── progress-style.qss │ ├── style.qss │ ├── undname.h │ └── view-style.qss └── ida-support-library-code ├── IDA_OggPlayer ├── IDA_OggPlayer.sln ├── IDA_OggPlayer.vcxproj ├── IDA_OggPlayer.vcxproj.filters ├── IDA_OggPlayer.vcxproj.user ├── IdaOgg.cpp ├── IdaOgg.h ├── IdaOggPlayer.LiB ├── IdaOggPlayer.pdb ├── IdaOggPlayer64.LiB ├── IdaOggPlayer64.pdb ├── IdaOggPlayer64D.LiB ├── IdaOggPlayer64D.pdb ├── IdaOggPlayerD.LiB ├── IdaOggPlayerD.pdb ├── PropertySheet.props ├── original README.md ├── stb_vorbis.cpp ├── stb_vorbis.h └── stb_vorbis.txt ├── IDA_SegmentSelect ├── IDA_SegmentSelect.sln ├── Lib │ ├── PropertySheet.props │ ├── SegSelect.cpp │ ├── SegSelect.h │ ├── SegSelectRes.qrc │ ├── SegmentDialog.h │ ├── SegmentDialog.ui │ ├── code_seg.png │ ├── data_seg.png │ ├── extrn_seg.png │ ├── idaq_seg.png │ ├── lib.vcxproj │ ├── lib.vcxproj.filters │ ├── lib.vcxproj.user │ └── other_seg.png ├── SegSelect.LiB ├── SegSelect.h ├── SegSelect64.LiB ├── SegSelect64D.LiB └── SegSelectD.LiB ├── IDA_WaitEx ├── IDA_WaitBoxEx.sln ├── IDA_WaitBoxEx.txt ├── Lib │ ├── MyQProgressDialog.h │ ├── PropertySheet.props │ ├── WaitBoxEx.cpp │ ├── WaitBoxEx.h │ ├── WinTaskProgress.cpp │ ├── WinTaskProgress.h │ ├── lib.vcxproj │ ├── lib.vcxproj.filters │ └── lib.vcxproj.user ├── Plugin Example │ ├── Plugin Example.vcxproj │ ├── Plugin Example.vcxproj.filters │ ├── Plugin Example.vcxproj.user │ └── WaitBoxEx_Example.cpp ├── WaitBoxEx.LiB ├── WaitBoxEx.h ├── WaitBoxEx.pdb ├── WaitBoxEx64.LiB ├── WaitBoxEx64.pdb ├── WaitBoxExD.LiB ├── WaitBoxExD.pdb ├── WaitBoxExD64.LiB ├── WaitBoxExD64.pdb ├── WaitBoxExMd.LiB ├── WaitBoxExMd.pdb ├── WaitBoxExMd64.LiB ├── WaitBoxExMd64.pdb ├── WaitBoxExMdD.LiB ├── WaitBoxExMdD.pdb ├── WaitBoxExMdD64.LiB └── WaitBoxExMdD64.pdb └── SupportLib ├── SupportLib.sln ├── SupportLib.vcxproj ├── SupportLib.vcxproj.user ├── Utility.cpp └── Utility.h /.gitignore: -------------------------------------------------------------------------------- 1 | .vs 2 | classinformer-code/x64/ 3 | classinformer-code/Plugin/x64/ 4 | classinformer-code/Plugin/GeneratedFiles 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Class Informer 2 | IDA Class Informer plugin for IDA Pro 9 and older versions. 3 | 4 | - This plugin has been tested with IDA Pro `9.0 Beta`, `7.7` and `8.3`, both 32-bit and 64-bit versions. 5 | - You no longer need a separate version of the plugin for working on 32-bit files in 64-bit IDA. 6 | - For IDA 9, you just need to install `ClassInformer64.dll`. 7 | - For IDA 8 and 7, you need to install both `ClassInformer64.dll` and `ClassInformer.dll`. 8 | 9 | ## Download 10 | - You can download compiled binaries from the [Releases](../../releases) section. 11 | -------------------------------------------------------------------------------- /classinformer-code/IDA_ClassInformer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.10.35122.118 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PlugIn", "Plugin\IDA_ClassInformer_PlugIn.vcxproj", "{DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug64|x64 = Debug64|x64 12 | Release|x64 = Release|x64 13 | Release64|x64 = Release64|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.Debug|x64.ActiveCfg = Debug|x64 17 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.Debug|x64.Build.0 = Debug|x64 18 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.Debug64|x64.ActiveCfg = Debug64|x64 19 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.Debug64|x64.Build.0 = Debug64|x64 20 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.Release|x64.ActiveCfg = Release|x64 21 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.Release|x64.Build.0 = Release|x64 22 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.Release64|x64.ActiveCfg = Release64|x64 23 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.Release64|x64.Build.0 = Release64|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | Qt5Version = 5.6.0 30 | SolutionGuid = {77D3BE15-1509-4763-B26C-456ED1078906} 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/ClassInformerRes.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | banner.png 4 | icon.png 5 | completed.ogg 6 | checkbox-checked.png 7 | progress-style.qss 8 | style.qss 9 | view-style.qss 10 | 11 | 12 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/Class_Informer.txt: -------------------------------------------------------------------------------- 1 | Class Informer for IDA 9: 2 | =========================================================== 3 | IDA Pro class vftable finder, namer, fixer, lister plug-in. 4 | Version 2.9, August 2024 5 | By Rohitab Batra 6 | 7 | https://github.com/rohitab/ClassInformer 8 | 9 | Source code is backwards compatible with IDA 8 and 7. 10 | Version 2.8 was the initial release with support for IDA 9. 11 | 12 | 13 | Class Informer for IDA 8: 14 | =========================================================== 15 | IDA Pro class vftable finder, namer, fixer, lister plug-in. 16 | Version 2.7, January 2023 17 | By Hiroshi Suzuki (By Sirmabus originally) 18 | 19 | https://github.com/herosi/classinformer-ida8/ 20 | I tested on ida 8.2. 21 | 22 | Original: 23 | https://sourceforge.net/projects/classinformer/ 24 | http://www.macromonkey.com/bb/index.php/topic,13.0.html 25 | 26 | --------------------------------------------------------- 27 | Scans MSVC target IDBs for vftables with C++ RTTI data. 28 | Places structures, names, labels, and comments to class vftables 29 | (Virtual Function Table) to aid reverse engineering. 30 | Also further assists by defining and associating known data structures. 31 | Creates a list window for browsing by object name. 32 | 33 | RTTI ("Run-Time Type Identification"): 34 | http://en.wikipedia.org/wiki/RTTI 35 | 36 | It's currently targeted for Microsoft Visual C++ complied binaries only. 37 | Unpredictable results if used on other targets. 38 | 39 | Based off article by Igor Skochinsky: 40 | http://www.openrce.org/articles/full_view/23 41 | Updated 42 | http://www.hexblog.com/wp-content/uploads/2012/06/ 43 | Recon-2012-Skochinsky-Compiler-Internals.pdf 44 | 45 | 46 | -- [Install] -------------------------------------------- 47 | Copy the plug-in to your IDA Pro "plugins" directory. 48 | Then edit your "..\plugins\plugins.cfg" to setup with a hotkey. 49 | 50 | IE: Add these two lines: 51 | ; Sirmabus "Class Informer" plug-in 52 | Class-Informer IDA_ClassInformer_PlugIn.plw Alt-2 0 53 | 54 | See IDA documentation for more on installing and using plug-ins. 55 | 56 | 57 | -- [How to run it] -------------------------------------- 58 | Invoke as usual in IDA with an assigned hot key, or through IDA's 59 | "Edit->Plugins" menu. 60 | 61 | Dialog Options: 62 | "Place structures": Uncheck this if you don't want RTTI data structures to be 63 | defined and placed; instead individual data elements will be cleaned up and 64 | placed with additional comments. 65 | 66 | "Process static initializers & terminators": If unchecked the processing of 67 | static ctor and dtor tables will be skipped. 68 | 69 | "Overwrite anterior comments": Check if you want existing anterior (above) 70 | comments be erased and overwritten. Class Informer will place separation and 71 | information comments above vftables, etc. Default unchecked. 72 | 73 | "Audio on completion": Uncheck this if you don't want any audio completion 74 | sound. 75 | 76 | On completion a list window will come up showing any found vftables and 77 | relevant class information. 78 | Lines with multiple inheritance that are not the main class will be colored 79 | gray. 80 | Click on a line to jump to it's vftable. 81 | 82 | 83 | Example list output: 84 | 0046769C 077 CEdit:CWnd, CCmdTarget, CObject; (SI) 85 | 86 | This is: vftable address, method count, and class hierarchy ended with some 87 | additional class info. 88 | To make things easier to read, all known type names are considered to be a 89 | "class" unless explicitly proceeded with "struct" to indicate "structure" type. 90 | 91 | The addition info at the end: 92 | "(SI)" single inheritance hierarchy, "(MI)" multiple inheritance, 93 | "(VI)" virtual inheritance, or "(MI VI)" multiple virtual inheritance. 94 | 95 | 96 | -- [Design] --------------------------------------------- 97 | 98 | I read Igor Skochinsky's excellent article: 99 | "Reversing Microsoft Visual C++". And ran some his IDC accompanying scripts. 100 | I was amazed at how well it worked on identifying vftables with a gold mine of 101 | type information and how it helped clean up an IDB by defining data structures. 102 | 103 | But the scripts had several problems and I wanted to put it into a plug-in 104 | anyhow for speed, flexibility, and to build as a general test bed for class 105 | information and research. 106 | 107 | I originally I had in mind some sort of automatic object member naming. 108 | But after doing real world tests I found it wasn't so useful. 109 | 110 | For my RE work I really just need to see these classes by name, and then where 111 | to find them for closer examination. Then adding automatic fixing and labeling 112 | of ctor and dtor tables is a bonus. 113 | 114 | As of version 2.0 switched to a different RTTI finding/scanning scheme. 115 | No longer scanning and locating vftables first. Now "Complete Object Locator" 116 | are located directly. This leads to more accuracy; less vftables are missed. 117 | 118 | 119 | -- [Thanks and Appreciation] ---------------------------- 120 | 121 | To Igor Skochinsky for the RTTI information and inspiration. 122 | To "sh!ft" for the source code to his version, and ideas that lead to the new 123 | improved scanning scheme. 124 | To "jlnsrk" for the reversed 64 bit RTTI version information. 125 | To Chris Eagle for mentioning Class Informer in his book: 126 | "The IDA Pro Book: The Unofficial Guide to the World's Most Popular 127 | Disassembler" 128 | 129 | 130 | -- [History] -------------------------------------------- 131 | 132 | 2.7 - 1) Updated to IDA SDK 8.2 and MSVC 2019 133 | 2) Updated the plugin form to the new one to work with IDA SDK 8.2 134 | 3) Created a plugin to analyze PE32 on IDA 64 (IDA_ClassInformer_PlugIn3264.dlL) 135 | because IDA is currently stopping to use IDA for 32-bit. 136 | 4) Linked VC++ runtime statically (/MT*) 137 | 5) Changed how to read user macros such as $(IDADIR), $(QTDIR) and $(IDASUPPORT) 138 | that are necessary to build to reading PropertySheet.props. 139 | And I also added $(IDASDK) to manage IDADIR and IDASDK separately. 140 | Change the setting in the file if you have a different environment. 141 | 142 | 2.6 - 1) Updated to IDA SDK 7.1 143 | 144 | 2.5 - 1) Updated to IDA 7 and MSVC 2017. 145 | Some of the changes for this: 146 | Doesn't place types/structs, nor names or comments if they already exist. 147 | Now the scanning role is more of looking for and fixing things IDA might have missed. 148 | 2) Now catches a rare secondary case where an assumed member function is unresolved bytes to 149 | increase the accuracy of vftable member count scanning. 150 | 151 | 2.4 - 1) Now scans all "DATA" type segments. Before would only scan the first 152 | ".data" and ".rdata" segments. 153 | 2) Added segment select option to plug-in dialog. 154 | 155 | 2.2 - 1) Updated to IDA SDK 6.9 and MSVC 2015. 156 | 157 | 2.1 - 1) Removed the "IDA updating, please wait.." wait for IDA to update thing 158 | at the end of processing to fix an ocassional hang. 159 | 2) Updated to IDA SDK 6.8 version. 160 | 161 | 2.0 - A complete overhaul of the entire plug-in. 162 | 1) Updated namings to better match that of Microsoft's internals. 163 | 2) Moved custom type creation out of the init() call; now gets created 164 | only on the first run and only if the "Place structures" option is 165 | checked. 166 | 3) Descriptive comments are now placed on C/C++ initializer and 167 | terminator table start and end points. 168 | 4) The UI is now a custom Qt one with "material design" elements. 169 | 5) Added a 64bit (32bit IDA's "__E64__") version. 170 | 6) The RTCI (rare MS MFC type) support was removed. 171 | 7) Now locates vftables by RTTI "Complete Object Locator" structures 172 | directly. 173 | 8) Updated to IDA SDK 6.7 version. 174 | 9) No longer has a default hotkey. Set your own using "plugins.cfg". 175 | 10) Updated and improved the static ctor/dtor processing. 176 | 177 | 1.06 - 1) Added persistent vftable list storage. 178 | 2) Removed the many unnecessary "autoWait()" calls that caused a bit 179 | of a slow down. 180 | 3) Fixed broken and updated some custom UI elements. 181 | 4) Fixed the multi-segment select feature for the non-QT version and 182 | added a working setup for the QT version too. For QT, after desired 183 | segments are selected right click on the list and do "Select" 184 | followed by the "Okay" button. 185 | 5) Added the ".data" segment to the default data search since vftables 186 | are often located there (in addition to ".rdata"). 187 | 188 | 1.05 - 1) The problem with the plug-in not being ready on invocation was fixed 189 | by returning PLUGIN_KEEP on init to stay resident. 190 | 2) The fix in 1.04 didn't quite do it for structure placement problems. 191 | In particular there remains a run on problem in IDA when marking some 192 | areas "unknown"; these "do_unknown()" calls have been removed and 193 | each structure element is individually placed one by one before 194 | attempting to place the actual assorted structures. 195 | 196 | 1.04 - 1) Now ensures RTTI type name strings are set. 197 | 198 | 1.03 - 1) Added check and warning message for invalid start and end addresses 199 | with "_initterm" type static/global ctor & dtor tables. 200 | Would cause a negative count run-on condition that could trample over 201 | a large data area. 202 | 2) UI customizations auto-disabled when using IDA Qt version. 203 | 3) Current IDA view is refreshed on completion to show changes. 204 | 4) Fixed a stall that could result from repeated failed attempts at an 205 | RTTI type placement. Plus fixed the pattern for these so they could 206 | be properly placed. 207 | 208 | 1.02 - 1) Added user code and data segment selector. 209 | Allows user to select multiple data and code segments instead of the 210 | default of ".text" and ".rdata" by name. 211 | For those rare executable targets that have multiple code sections, 212 | and, or, unpacked executables with mixed segments, etc. 213 | 2) Added config option for verbose output to the debugger channel. 214 | 3) Improved overall processing speed. 215 | 4) Since there can multiple instances of the same class or structure, 216 | and IDA names must be unique all duplicate names are now serialized. 217 | More things labeled, and no more "duplicate name" warning spam. 218 | Note: Effects only label names, commented names are not altered 219 | 5) Updated to IDA SDK 5.5 220 | 6) Added links to Sirmabus IDA plug-ins support forum. 221 | 222 | 1.01 - 1) No longer pops up an error and exits IDA when an incompatible IDB is 223 | loaded. Just displays a "not loaded" log message now. 224 | 2) Fixed IDA tab page update issue. 225 | 3) Now built with IDA SDK 5.4, and tested with IDA 5.4. 226 | 4) Fixed incorrect string placement in the RTTI type info struct. 227 | Now the structures are right which make a cleaner DB. 228 | This was a major bottleneck that caused the structure placement to be 229 | about 36x slower, now only about 1x. 230 | 5) Fixed some misspellings. 231 | 232 | -- [TODO] ----------------------------------------------- 233 | 1) Add support for more compilers and platforms. 234 | 2) Add distinction for "pre-terminators" and C/C++ _initterm type tables. 235 | 3) Fix cases where _initterm() are register calls. 236 | 237 | Find a problem? Please make a ticket here: 238 | https://sourceforge.net/p/classinformer/tickets/ 239 | 240 | 241 | -- [License] ----------------------------------------------- 242 | http://www.opensource.org/licenses/mit-license.php 243 | The MIT License (MIT) 244 | Copyright(c) 2009 to present Sirmabus. 245 | 246 | Permission is hereby granted, free of charge, to any person obtaining a copy 247 | of this software and associated documentation files (the "Software"), to deal 248 | in the Software without restriction, including without limitation the rights 249 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 250 | copies of the Software, and to permit persons to whom the Software is 251 | furnished to do so, subject to the following conditions: 252 | 253 | The above copyright notice and this permission notice shall be included in 254 | all copies or substantial portions of the Software. 255 | 256 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 257 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 258 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 259 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 260 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 261 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 262 | THE SOFTWARE. 263 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/IDA_ClassInformer_PlugIn.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {a9876874-6172-4c9f-9d7e-e37acb380d0b} 6 | 7 | 8 | {457050d4-f1f3-4a27-972f-11271f76b0de} 9 | 10 | 11 | {99349809-55BA-4b9d-BF79-8FDBB0286EB3} 12 | ui 13 | true 14 | 15 | 16 | {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} 17 | moc;h;cpp 18 | true 19 | 20 | 21 | {dd7ba64d-d074-493d-9850-868de31096d7} 22 | cpp;moc 23 | False 24 | 25 | 26 | {e0c522c9-a6a4-40e2-a4d6-fc62cb3e5aed} 27 | cpp;moc 28 | False 29 | 30 | 31 | {7df04027-bd87-43d2-b942-a438fb7cabc3} 32 | cpp;moc 33 | False 34 | 35 | 36 | {08b1d19d-ae87-4e19-a17b-645dacc30448} 37 | cpp;moc 38 | False 39 | 40 | 41 | {18b1d19d-ae87-4e19-a17b-645dacc30448} 42 | cpp;moc 43 | False 44 | 45 | 46 | {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} 47 | qrc;* 48 | false 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | Generated Files\Debug64 57 | 58 | 59 | Generated Files\Debug 60 | 61 | 62 | Generated Files\Release 63 | 64 | 65 | Generated Files\Release3264 66 | 67 | 68 | Generated Files\Release64 69 | 70 | 71 | Generated Files 72 | 73 | 74 | 75 | Generated Files\Debug 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | Misc 84 | 85 | 86 | Form Files 87 | 88 | 89 | 90 | Resource Files 91 | 92 | 93 | 94 | 95 | Generated Files 96 | 97 | 98 | 99 | Generated Files 100 | 101 | 102 | 103 | 104 | Resource Files 105 | 106 | 107 | Resource Files 108 | 109 | 110 | Resource Files 111 | 112 | 113 | Resource Files 114 | 115 | 116 | 117 | 118 | Resource Files 119 | 120 | 121 | Resource Files 122 | 123 | 124 | Resource Files 125 | 126 | 127 | 128 | 129 | Doc 130 | 131 | 132 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/IDA_ClassInformer_PlugIn.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(IDADIR)ida.exe 5 | WindowsLocalDebugger 6 | PATH=$(QTDIR)bin%3b$(PATH) 7 | 8 | 9 | $(IDADIR)ida64.exe 10 | WindowsLocalDebugger 11 | PATH=$(QTDIR)bin%3b$(PATH) 12 | 13 | 14 | $(IDADIR)ida.exe 15 | WindowsLocalDebugger 16 | PATH=$(QTDIR)bin%3b$(PATH) 17 | 18 | 19 | $(IDADIR)ida64.exe 20 | WindowsLocalDebugger 21 | PATH=$(QTDIR)bin%3b$(PATH) 22 | 23 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/classinformer-code/Plugin/Main.cpp -------------------------------------------------------------------------------- /classinformer-code/Plugin/Main.h: -------------------------------------------------------------------------------- 1 | 2 | // **************************************************************************** 3 | // File: Main.h 4 | // Desc: 5 | // 6 | // **************************************************************************** 7 | 8 | extern void fixEa(ea_t ea); 9 | extern void fixDword(ea_t eaAddress); 10 | extern void fixFunction(ea_t eaFunc); 11 | extern void setUnknown(ea_t ea, int size); 12 | extern BOOL getVerifyEa(ea_t ea, ea_t &rValue); 13 | extern BOOL hasAnteriorComment(ea_t ea); 14 | extern void killAnteriorComments(ea_t ea); 15 | extern int addStrucMember(struc_t *sptr, char *name, ea_t offset, flags_t flag, opinfo_t *type, asize_t nbytes); 16 | extern void addTableEntry(UINT flags, ea_t vft, int methodCount, LPCSTR format, ...); 17 | extern BOOL getPlainTypeName(__in LPCSTR mangled, __out_bcount(MAXSTR) LPSTR outStr); 18 | extern void setName(ea_t ea, __in LPCSTR name); 19 | extern void setComment(ea_t ea, LPCSTR comment, BOOL rptble); 20 | extern void setAnteriorComment(ea_t ea, const char *format, ...); 21 | 22 | // Return TRUE if there is a name at address that is not a dumbly name 23 | inline BOOL hasName(ea_t ea) { return has_name(get_flags(ea)); } 24 | 25 | // Return TRUE if there is a comment at address 26 | inline BOOL hasComment(ea_t ea) { return has_cmt(get_flags(ea)); } 27 | 28 | 29 | // Get IDA 32 bit value with verification 30 | template BOOL getVerify32(ea_t eaPtr, T &rValue) 31 | { 32 | // Location valid? 33 | if (is_loaded(eaPtr)) 34 | { 35 | // Get 32bit value 36 | rValue = (T) get_32bit(eaPtr); 37 | return(TRUE); 38 | } 39 | 40 | return(FALSE); 41 | } 42 | 43 | #if IDA_SDK_VERSION < 800 44 | #define EA_SIZE sizeof(ea_t) 45 | #else 46 | #define EA_SIZE EAH.ea_size 47 | #endif 48 | 49 | extern BOOL isDatabase64Bit; 50 | 51 | // Get address/pointer value 52 | inline ea_t getEa(ea_t ea) 53 | { 54 | return isDatabase64Bit ? get_64bit(ea) : get_32bit(ea); 55 | } 56 | 57 | 58 | // Returns TRUE if ea_t sized value flags 59 | inline BOOL isEa(flags_t f) 60 | { 61 | return isDatabase64Bit ? is_qword(f) : is_dword(f); 62 | } 63 | 64 | extern BOOL optionPlaceStructs; 65 | extern BOOL optionPlaceAtNamed; 66 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/MainDialog.cpp: -------------------------------------------------------------------------------- 1 | 2 | // **************************************************************************** 3 | // File: MainDialog.cpp 4 | // Desc: Main Dialog 5 | // 6 | // **************************************************************************** 7 | #include "stdafx.h" 8 | #include "Main.h" 9 | #include "MainDialog.h" 10 | 11 | #include 12 | 13 | 14 | MainDialog::MainDialog(BOOL& optionPlaceStructs, BOOL& optionProcessStatic, BOOL& optionAudioOnDone, SegSelect::segments** segs) : QDialog(QApplication::activeWindow(), QT::Qt::Widget) 15 | { 16 | Ui::MainCIDialog::setupUi(this); 17 | setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); 18 | buttonBox->addButton("CONTINUE", QDialogButtonBox::AcceptRole); 19 | buttonBox->addButton("CANCEL", QDialogButtonBox::RejectRole); 20 | 21 | #define INITSTATE(obj,state) obj->setCheckState((state == TRUE) ? Qt::Checked : Qt::Unchecked); 22 | INITSTATE(checkBox1, optionPlaceStructs); 23 | INITSTATE(checkBoxAtNamed, optionPlaceAtNamed); 24 | INITSTATE(checkBox2, optionProcessStatic); 25 | INITSTATE(checkBox3, optionAudioOnDone); 26 | #undef INITSTATE 27 | 28 | // Apply style sheet 29 | QFile file(STYLE_PATH "style.qss"); 30 | if (file.open(QFile::ReadOnly | QFile::Text)) 31 | setStyleSheet(QTextStream(&file).readAll()); 32 | 33 | this->segs = segs; 34 | } 35 | 36 | // On choose segments 37 | void MainDialog::segmentSelect() 38 | { 39 | *segs = SegSelect::select((SegSelect::DATA_HINT | SegSelect::RDATA_HINT), "Choose segments to scan"); 40 | } 41 | 42 | // Do main dialog, return TRUE if canceled 43 | BOOL doMainDialog(BOOL &optionPlaceStructs, BOOL &optionProcessStatic, BOOL &optionAudioOnDone, SegSelect::segments **segs) 44 | { 45 | BOOL result = TRUE; 46 | MainDialog *dlg = new MainDialog(optionPlaceStructs, optionProcessStatic, optionAudioOnDone, segs); 47 | if (dlg->exec()) 48 | { 49 | #define CHECKSTATE(obj,var) var = dlg->obj->isChecked() 50 | CHECKSTATE(checkBox1, optionPlaceStructs); 51 | CHECKSTATE(checkBoxAtNamed, optionPlaceAtNamed); 52 | CHECKSTATE(checkBox2, optionProcessStatic); 53 | CHECKSTATE(checkBox3, optionAudioOnDone); 54 | #undef CHECKSTATE 55 | result = FALSE; 56 | } 57 | delete dlg; 58 | return(result); 59 | } -------------------------------------------------------------------------------- /classinformer-code/Plugin/MainDialog.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "stdafx.h" 5 | #include 6 | #include 7 | 8 | #include "ui_dialog.h" 9 | 10 | class MainDialog : public QDialog, public Ui::MainCIDialog 11 | { 12 | Q_OBJECT 13 | public: 14 | MainDialog(BOOL &optionPlaceStructs, BOOL &optionProcessStatic, BOOL &optionAudioOnDone, SegSelect::segments **segs); 15 | 16 | private: 17 | SegSelect::segments **segs; 18 | 19 | private slots: 20 | void segmentSelect(); 21 | }; 22 | 23 | // Do main dialog, return TRUE if canceled 24 | BOOL doMainDialog(BOOL &optionPlaceStructs, BOOL &optionProcessStatic, BOOL &optionAudioOnDone, SegSelect::segments **segs); 25 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/PropertySheet.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | C:\Program Files\IDA Professional 9.0\ 6 | C:\Qt\Qt-5.15.3\ 7 | ..\..\ida-support-library-code\ 8 | $(IDADIR)\sdk\ 9 | 10 | 11 | 12 | 13 | 14 | $(IDADIR) 15 | 16 | 17 | $(QTDIR) 18 | 19 | 20 | $(IDASUPPORT) 21 | 22 | 23 | $(IDASDK) 24 | 25 | 26 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/RTTI.h: -------------------------------------------------------------------------------- 1 | 2 | // **************************************************************************** 3 | // File: RTTI.h 4 | // Desc: Run-Time Type Information (RTTI) support 5 | // 6 | // **************************************************************************** 7 | #pragma once 8 | 9 | namespace RTTI 10 | { 11 | #pragma pack(push, 1) 12 | 13 | // std::type_info class representation 14 | struct type_info 15 | { 16 | static BOOL isValid(ea_t typeInfo); 17 | static BOOL isTypeName(ea_t name); 18 | static int getName(ea_t typeInfo, __out LPSTR bufffer, int bufferSize); 19 | static void tryStruct(ea_t typeInfo); 20 | }; 21 | 22 | struct type_info32 : type_info 23 | { 24 | UINT vfptr; // type_info class vftable 25 | UINT _M_data; // NULL until loaded at runtime 26 | char _M_d_name[1]; // Mangled name (prefix: .?AV=classes, .?AU=structs) 27 | }; 28 | 29 | struct type_info64 : type_info 30 | { 31 | ea_t vfptr; // type_info class vftable 32 | ea_t _M_data; // NULL until loaded at runtime 33 | char _M_d_name[1]; // Mangled name (prefix: .?AV=classes, .?AU=structs) 34 | }; 35 | 36 | const UINT MIN_TYPE_INFO_SIZE_32 = (offsetof(type_info32, _M_d_name) + sizeof(".?AVx")); 37 | const UINT MIN_TYPE_INFO_SIZE_64 = (offsetof(type_info64, _M_d_name) + sizeof(".?AVx")); 38 | typedef type_info _TypeDescriptor; 39 | typedef type_info _RTTITypeDescriptor; 40 | 41 | // Base class "Pointer to Member Data" 42 | struct PMD 43 | { 44 | int mdisp; // 00 Member displacement 45 | int pdisp; // 04 Vftable displacement 46 | int vdisp; // 08 Displacement inside vftable 47 | }; 48 | 49 | // Describes all base classes together with information to derived class access dynamically 50 | // attributes flags 51 | const UINT BCD_NOTVISIBLE = 0x01; 52 | const UINT BCD_AMBIGUOUS = 0x02; 53 | const UINT BCD_PRIVORPROTINCOMPOBJ = 0x04; 54 | const UINT BCD_PRIVORPROTBASE = 0x08; 55 | const UINT BCD_VBOFCONTOBJ = 0x10; 56 | const UINT BCD_NONPOLYMORPHIC = 0x20; 57 | const UINT BCD_HASPCHD = 0x40; 58 | 59 | struct _RTTIBaseClassDescriptor 60 | { 61 | #ifndef __EA64__ 62 | ea_t typeDescriptor; // 00 Type descriptor of the class 63 | #else 64 | UINT typeDescriptor; // 00 Type descriptor of the class *X64 int32 offset 65 | #endif 66 | UINT numContainedBases; // 04 Number of nested classes following in the Base Class Array 67 | PMD pmd; // 08 Pointer-to-member displacement info 68 | UINT attributes; // 14 Flags 69 | // 18 When attributes & BCD_HASPCHD 70 | //_RTTIClassHierarchyDescriptor *classDescriptor; *X64 int32 offset 71 | 72 | static BOOL isValid(ea_t bcd, ea_t colBase64 = NULL); 73 | static void tryStruct(ea_t bcd, __out_bcount(MAXSTR) LPSTR baseClassName, ea_t colBase64 = NULL); 74 | }; 75 | 76 | // "Class Hierarchy Descriptor" describes the inheritance hierarchy of a class; shared by all COLs for the class 77 | // attributes flags 78 | const UINT CHD_MULTINH = 0x01; // Multiple inheritance 79 | const UINT CHD_VIRTINH = 0x02; // Virtual inheritance 80 | const UINT CHD_AMBIGUOUS = 0x04; // Ambiguous inheritance 81 | 82 | /* 83 | struct _RTTIBaseClassArray 84 | { 85 | _RTTIBaseClassDescriptor *arrayOfBaseClassDescriptors[]; 86 | }; 87 | */ 88 | 89 | struct _RTTIClassHierarchyDescriptor 90 | { 91 | UINT signature; // 00 Zero until loaded 92 | UINT attributes; // 04 Flags 93 | UINT numBaseClasses; // 08 Number of classes in the following 'baseClassArray' 94 | #ifndef __EA64__ 95 | ea_t baseClassArray; // 0C _RTTIBaseClassArray* 96 | #else 97 | UINT baseClassArray; // 0C *X64 int32 offset to _RTTIBaseClassArray* 98 | #endif 99 | 100 | static BOOL isValid(ea_t chd, ea_t colBase64 = NULL); 101 | static void tryStruct(ea_t chd, ea_t colBase64 = NULL); 102 | }; 103 | 104 | // "Complete Object Locator" location of the complete object from a specific vftable pointer 105 | struct _RTTICompleteObjectLocator32 106 | { 107 | UINT signature; // 00 32bit zero, 64bit one, until loaded 108 | UINT offset; // 04 Offset of this vftable in the complete class 109 | UINT cdOffset; // 08 Constructor displacement offset 110 | #ifndef __EA64__ 111 | ea_t typeDescriptor; // 0C (type_info *) of the complete class 112 | ea_t classDescriptor; // 10 (_RTTIClassHierarchyDescriptor *) Describes inheritance hierarchy 113 | #else 114 | UINT typeDescriptor; // 0C (type_info *) of the complete class *X64 int32 offset 115 | UINT classDescriptor; // 10 (_RTTIClassHierarchyDescriptor *) Describes inheritance hierarchy *X64 int32 offset 116 | #endif 117 | }; 118 | 119 | struct _RTTICompleteObjectLocator : _RTTICompleteObjectLocator32 120 | { 121 | UINT objectBase; // 14 Object base offset (base = ptr col - objectBase) 122 | 123 | static BOOL isValid(ea_t col); 124 | static BOOL isValid2(ea_t col); 125 | static BOOL tryStruct(ea_t col); 126 | }; 127 | #pragma pack(pop) 128 | 129 | const WORD IS_TOP_LEVEL = 0x8000; 130 | 131 | void freeWorkingData(); 132 | void addDefinitionsToIda(); 133 | BOOL processVftable(ea_t eaTable, ea_t col); 134 | } 135 | 136 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/StdAfx.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #define WIN32_LEAN_AND_MEAN 5 | #define WINVER 0x0601 // _WIN32_WINNT_WIN7 6 | #define _WIN32_WINNT 0x0601 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #pragma intrinsic(memset, memcpy, strcat, strcmp, strcpy, strlen, abs, fabs, labs, atan, atan2, tan, sqrt, sin, cos) 17 | 18 | // IDA libs 19 | #define USE_DANGEROUS_FUNCTIONS 20 | #define USE_STANDARD_FILE_FUNCTIONS 21 | #define NO_OBSOLETE_FUNCS 22 | // Nix the many warning about int type conversions 23 | #pragma warning(push) 24 | #pragma warning(disable:4244) 25 | #pragma warning(disable:4267) 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #if IDA_SDK_VERSION < 900 32 | #include 33 | #endif 34 | #include 35 | #include 36 | #pragma warning(pop) 37 | 38 | // Qt libs 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | // IDA SDK Qt libs 49 | #pragma comment(lib, "Qt5Core.lib") 50 | #pragma comment(lib, "Qt5Gui.lib") 51 | #pragma comment(lib, "Qt5Widgets.lib") 52 | 53 | // QT_NO_UNICODE_LITERAL must be defined (best in preprocessor setting) 54 | // So Qt doesn't a static string pool that will cause IDA to crash on unload 55 | #ifndef QT_NO_UNICODE_LITERAL 56 | # error QT_NO_UNICODE_LITERAL must be defined to avoid Qt string crashes 57 | #endif 58 | 59 | #include 60 | #include "undname.h" 61 | 62 | #include 63 | #include 64 | 65 | typedef qlist eaList; 66 | typedef std::unordered_set eaSet; 67 | typedef std::unordered_map eaRefMap; // address & ref count 68 | 69 | //#define STYLE_PATH "C:/Projects/IDA Pro Work/IDA_ClassInformer_PlugIn/Plugin/" 70 | #define STYLE_PATH ":/classinf/" 71 | 72 | #define MY_VERSION MAKEWORD(9, 2) // Low, high, convention: 0 to 99 73 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/Vftable.cpp: -------------------------------------------------------------------------------- 1 | 2 | // **************************************************************************** 3 | // File: Vftable.cpp 4 | // Desc: Virtual function table parsing support 5 | // 6 | // **************************************************************************** 7 | #include "stdafx.h" 8 | #include "Main.h" 9 | #include "Vftable.h" 10 | #include "RTTI.h" 11 | 12 | /* 13 | namespace vftable 14 | { 15 | int tryKnownMember(LPCTSTR name, ea_t eaMember); 16 | }; 17 | */ 18 | 19 | // Attempt to get information of and fix vftable at address 20 | // Return TRUE along with info if valid vftable parsed at address 21 | BOOL vftable::getTableInfo(ea_t ea, vtinfo &info) 22 | { 23 | // Start of a vft should have an xref and a name (auto, or user, etc). 24 | // Ideal flags 32bit: FF_DWRD, FF_0OFF, FF_REF, FF_NAME, FF_DATA, FF_IVL 25 | //dumpFlags(ea); 26 | flags_t flags = get_flags(ea); 27 | if(has_xref(flags) && has_any_name(flags) && (isEa(flags) || is_unknown(flags))) 28 | { 29 | ZeroMemory(&info, sizeof(vtinfo)); 30 | 31 | // Get raw (auto-generated mangled, or user named) vft name 32 | //if (!get_name(BADADDR, ea, info.name, SIZESTR(info.name))) 33 | // msg(EAFORMAT" ** vftable::getTableInfo(): failed to get raw name!\n", ea); 34 | 35 | // Determine the vft's method count 36 | ea_t start = info.start = ea; 37 | while (TRUE) 38 | { 39 | // Should be an ea_t sized offset to a function here (could be unknown if dirty IDB) 40 | // Ideal flags for 32bit: FF_DWRD, FF_0OFF, FF_REF, FF_NAME, FF_DATA, FF_IVL 41 | //dumpFlags(ea); 42 | flags_t indexFlags = get_flags(ea); 43 | if (!(isEa(indexFlags) || is_unknown(indexFlags))) 44 | { 45 | //msg(" ******* 1\n"); 46 | break; 47 | } 48 | 49 | // Look at what this (assumed vftable index) points too 50 | ea_t memberPtr = getEa(ea); 51 | if (!(memberPtr && (memberPtr != BADADDR))) 52 | { 53 | // vft's often have a trailing zero ea_t (alignment, or?), fix it 54 | if (memberPtr == 0) 55 | fixEa(ea); 56 | 57 | //msg(" ******* 2\n"); 58 | break; 59 | } 60 | 61 | // Should see code for a good vft method here, but it could be dirty 62 | flags_t flags = get_flags(memberPtr); 63 | if (!(is_code(flags) || is_unknown(flags))) 64 | { 65 | // New for version 2.5: there are rare cases where IDA hasn't fix unresolved bytes 66 | // So except if the member pointer is in a code segment as a 2nd chance 67 | if (segment_t *s = getseg(memberPtr)) 68 | { 69 | if (s->type != SEG_CODE) 70 | { 71 | //msg(" ******* 3\n"); 72 | break; 73 | } 74 | } 75 | else 76 | { 77 | //msg(" ******* 3.5\n"); 78 | break; 79 | } 80 | } 81 | 82 | 83 | if (ea != start) 84 | { 85 | // If we see a ref after first index it's probably the beginning of the next vft or something else 86 | if (has_xref(indexFlags)) 87 | { 88 | //msg(" ******* 4\n"); 89 | break; 90 | } 91 | 92 | // If we see a COL here it must be the start of another vftable 93 | if (RTTI::_RTTICompleteObjectLocator::isValid(memberPtr)) 94 | { 95 | //msg(" ******* 5\n"); 96 | break; 97 | } 98 | } 99 | 100 | // As needed fix ea_t pointer, and, or, missing code and function def here 101 | fixEa(ea); 102 | fixFunction(memberPtr); 103 | 104 | ea += EA_SIZE; 105 | }; 106 | 107 | // Reached the presumed end of it 108 | if ((info.methodCount = ((ea - start) / EA_SIZE)) > 0) 109 | { 110 | info.end = ea; 111 | //msg(" vftable: "EAFORMAT"-"EAFORMAT", methods: %d\n", rtInfo.eaStart, rtInfo.eaEnd, rtInfo.uMethods); 112 | return(TRUE); 113 | } 114 | } 115 | 116 | //dumpFlags(ea); 117 | return(FALSE); 118 | } 119 | 120 | 121 | // Get relative jump target address 122 | /* 123 | static ea_t getRelJmpTarget(ea_t eaAddress) 124 | { 125 | BYTE bt = get_byte(eaAddress); 126 | if(bt == 0xEB) 127 | { 128 | bt = get_byte(eaAddress + 1); 129 | if(bt & 0x80) 130 | return(eaAddress + 2 - ((~bt & 0xFF) + 1)); 131 | else 132 | return(eaAddress + 2 + bt); 133 | } 134 | else 135 | if(bt == 0xE9) 136 | { 137 | UINT dw = get_32bit(eaAddress + 1); 138 | if(dw & 0x80000000) 139 | return(eaAddress + 5 - (~dw + 1)); 140 | else 141 | return(eaAddress + 5 + dw); 142 | } 143 | else 144 | return(BADADDR); 145 | } 146 | */ 147 | 148 | /* 149 | #define SN_constructor 1 150 | #define SN_destructor 2 151 | #define SN_vdestructor 3 152 | #define SN_scalardtr 4 153 | #define SN_vectordtr 5 154 | */ 155 | 156 | // Try to identify and place known class member types 157 | /* 158 | int vftable::tryKnownMember(LPCTSTR name, ea_t eaMember) 159 | { 160 | int iType = 0; 161 | 162 | #define IsPattern(Address, Pattern) (find_binary(Address, Address+(SIZESTR(Pattern)/2), Pattern, 16, (SEARCH_DOWN | SEARCH_NOBRK | SEARCH_NOSHOW)) == Address) 163 | 164 | if(eaMember && (eaMember != BADADDR)) 165 | { 166 | // Skip if it already has a name 167 | flags_t flags = get_flags((ea_t) eaMember); 168 | if(!has_name(flags) || has_dummy_name(flags)) 169 | { 170 | // Should be code 171 | if(is_code(flags)) 172 | { 173 | ea_t eaAddress = eaMember; 174 | 175 | // E9 xx xx xx xx jmp xxxxxxx 176 | BYTE Byte = get_byte(eaAddress); 177 | if((Byte == 0xE9) ||(Byte == 0xEB)) 178 | { 179 | return(tryKnownMember(name, getRelJmpTarget(eaAddress))); 180 | } 181 | else 182 | if(IsPattern(eaAddress, " ")) 183 | { 184 | 185 | } 186 | } 187 | else 188 | msg(" "EAFORMAT" ** Not code at this member! **\n", eaMember); 189 | } 190 | } 191 | 192 | return(iType); 193 | } 194 | */ 195 | 196 | /* 197 | TODO: On hold for now. 198 | Do we really care about detected ctors and dtors? 199 | Is it helpful vs the problems of naming member functions? 200 | */ 201 | 202 | 203 | // Process vftable member functions 204 | /* 205 | // TODO: Just try the fix missing function code 206 | void vftable::processMembers(LPCTSTR lpszName, ea_t eaStart, ea_t eaEnd) 207 | { 208 | //msg(" "EAFORMAT" to "EAFORMAT"\n", eaStart, eaEnd); 209 | 210 | ea_t eaAddress = eaStart; 211 | 212 | while(eaAddress < eaEnd) 213 | { 214 | ea_t eaMember; 215 | if(GetVerify32_t(eaAddress, eaMember)) 216 | { 217 | // Missing/bad code? 218 | if(!get_func(eaMember)) 219 | { 220 | //msg(" "EAFORMAT" ** No member function here! **\n", eaMember); 221 | fixFunction(eaMember); 222 | } 223 | 224 | tryKnownMember(lpszName, eaMember); 225 | } 226 | else 227 | msg(" "EAFORMAT" ** Failed to read member pointer! **\n", eaAddress); 228 | 229 | eaAddress += 4; 230 | }; 231 | } 232 | */ -------------------------------------------------------------------------------- /classinformer-code/Plugin/Vftable.h: -------------------------------------------------------------------------------- 1 | 2 | // **************************************************************************** 3 | // File: Vftable.h 4 | // Desc: Virtual function table parsing support 5 | // 6 | // **************************************************************************** 7 | #pragma once 8 | 9 | namespace vftable 10 | { 11 | // vftable info container 12 | struct vtinfo 13 | { 14 | ea_t start, end; 15 | int methodCount; 16 | //char name[MAXSTR]; 17 | }; 18 | 19 | BOOL getTableInfo(ea_t ea, vtinfo &info); 20 | 21 | // Returns TRUE if mangled name indicates a vftable 22 | inline BOOL isValid(LPCSTR name){ return(*((PDWORD) name) == 0x375F3F3F /*"??_7"*/); } 23 | 24 | // Identify and name common member functions 25 | //void processMembers(LPCTSTR name, ea_t eaStart, ea_t eaEnd); 26 | } 27 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/classinformer-code/Plugin/banner.png -------------------------------------------------------------------------------- /classinformer-code/Plugin/checkbox-checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/classinformer-code/Plugin/checkbox-checked.png -------------------------------------------------------------------------------- /classinformer-code/Plugin/completed.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/classinformer-code/Plugin/completed.ogg -------------------------------------------------------------------------------- /classinformer-code/Plugin/dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainCIDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 292 10 | 311 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 292 22 | 311 23 | 24 | 25 | 26 | 27 | 292 28 | 311 29 | 30 | 31 | 32 | Class Informer 33 | 34 | 35 | 36 | :/classinf/icon.png:/classinf/icon.png 37 | 38 | 39 | 40 | 41 | 42 | true 43 | 44 | 45 | 46 | 47 | 120 48 | 272 49 | 156 50 | 24 51 | 52 | 53 | 54 | Qt::Horizontal 55 | 56 | 57 | QDialogButtonBox::NoButton 58 | 59 | 60 | false 61 | 62 | 63 | 64 | 65 | 66 | 15 67 | 94 68 | 121 69 | 17 70 | 71 | 72 | 73 | 74 | Noto Sans 75 | 10 76 | 77 | 78 | 79 | 80 | 81 | 82 | &Place structures 83 | 84 | 85 | 86 | 87 | 88 | 140 89 | 94 90 | 137 91 | 17 92 | 93 | 94 | 95 | 96 | Noto Sans 97 | 10 98 | 99 | 100 | 101 | 102 | 103 | 104 | at &named locations 105 | 106 | 107 | 108 | 109 | 110 | 15 111 | 122 112 | 256 113 | 17 114 | 115 | 116 | 117 | 118 | Noto Sans 119 | 10 120 | 121 | 122 | 123 | 124 | 125 | 126 | Process static &initializers && terminators 127 | 128 | 129 | 130 | 131 | 132 | 15 133 | 148 134 | 151 135 | 17 136 | 137 | 138 | 139 | 140 | Noto Sans 141 | 10 142 | 143 | 144 | 145 | 146 | 147 | 148 | &Audio on completion 149 | 150 | 151 | 152 | 153 | 154 | 15 155 | 225 156 | 106 157 | 18 158 | 159 | 160 | 161 | 162 | Noto Sans 163 | 10 164 | 165 | 166 | 167 | QFrame::Sunken 168 | 169 | 170 | <a href="https://github.com/rohitab/ClassInformer" style="color:#AA00FF;">Source on GitHub</a> 171 | 172 | 173 | Qt::AutoText 174 | 175 | 176 | true 177 | 178 | 179 | 180 | 181 | 182 | 0 183 | 0 184 | 292 185 | 74 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | Qt::PlainText 196 | 197 | 198 | :/classinf/banner.png 199 | 200 | 201 | Qt::NoTextInteraction 202 | 203 | 204 | 205 | 206 | 207 | 205 208 | 6 209 | 81 210 | 61 211 | 212 | 213 | 214 | 215 | Noto Sans 216 | 9 217 | 218 | 219 | 220 | 221 | 222 | 223 | Version: 2.9 224 | By Rohitab Batra 225 | By Hiroshi Suzuki 226 | By Sirmabus 227 | 228 | 229 | Qt::PlainText 230 | 231 | 232 | Qt::NoTextInteraction 233 | 234 | 235 | 236 | 237 | 238 | 15 239 | 186 240 | 129 241 | 27 242 | 243 | 244 | 245 | 246 | Noto Sans 247 | 10 248 | 249 | 250 | 251 | <html><head/><body><p>Optionally select wich segments to scan for strings.</p></body></html> 252 | 253 | 254 | SELECT &SEGMENTS 255 | 256 | 257 | false 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | buttonBox 268 | accepted() 269 | MainCIDialog 270 | accept() 271 | 272 | 273 | 248 274 | 254 275 | 276 | 277 | 157 278 | 274 279 | 280 | 281 | 282 | 283 | buttonBox 284 | rejected() 285 | MainCIDialog 286 | reject() 287 | 288 | 289 | 316 290 | 260 291 | 292 | 293 | 286 294 | 274 295 | 296 | 297 | 298 | 299 | pushButton1 300 | pressed() 301 | MainCIDialog 302 | segmentSelect() 303 | 304 | 305 | 79 306 | 228 307 | 308 | 309 | 145 310 | 169 311 | 312 | 313 | 314 | 315 | 316 | segmentSelect() 317 | 318 | 319 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/classinformer-code/Plugin/icon.png -------------------------------------------------------------------------------- /classinformer-code/Plugin/progress-style.qss: -------------------------------------------------------------------------------- 1 | 2 | QWidget 3 | { 4 | color: #C0C0C0; 5 | background-color: #303030; 6 | 7 | font-family: Noto Sans, Tahoma; 8 | font-size: 13px; 9 | font-style: normal; 10 | } 11 | 12 | QPushButton 13 | { 14 | font-weight: bold; 15 | padding: 7px; 16 | min-width: 37px; 17 | border-style: none; 18 | } 19 | QPushButton:hover 20 | { 21 | background-color: #4A4A4A; 22 | } 23 | QPushButton:pressed 24 | { 25 | background-color: #595959; 26 | } 27 | QPushButton:focus 28 | { 29 | background-color: #4A4A4A; 30 | } 31 | 32 | QProgressBar 33 | { 34 | background-color: #4E4E4E; 35 | border-style: none; 36 | } 37 | QProgressBar::chunk 38 | { 39 | background-color: #AB47BC; 40 | } 41 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/style.qss: -------------------------------------------------------------------------------- 1 | 2 | /* Class Informer Stylesheet by Sirmabus */ 3 | /* Rev 1.0 Feb 22, 2015 */ 4 | /* Dark theme, with some Google Material Design elements in mind */ 5 | 6 | /* Parent */ 7 | QWidget 8 | { 9 | color: #E0E0E0; 10 | background-color: #303030; 11 | 12 | font-family: Noto Sans, Tahoma; 13 | font-size: 13px; 14 | font-style: normal; 15 | } 16 | 17 | /* Push buttons */ 18 | /* MD flat style */ 19 | QPushButton 20 | { 21 | color: #FFF176; 22 | font-weight: bold; 23 | padding: 7px; 24 | min-width: 37px; 25 | border-style: none; 26 | } 27 | QPushButton:hover 28 | { 29 | background-color: #4A4A4A; 30 | } 31 | QPushButton:pressed 32 | { 33 | background-color: #595959; 34 | } 35 | QPushButton:focus 36 | { 37 | background-color: #4A4A4A; 38 | } 39 | 40 | /* Option push button */ 41 | QPushButton#pushButton1 42 | { 43 | color: #CE93D8; 44 | background-color: #3F3F3D; 45 | } 46 | QPushButton#pushButton1:hover 47 | { 48 | background-color: #505050; 49 | } 50 | QPushButton#pushButton1:pressed 51 | { 52 | background-color: #5F5F5D; 53 | } 54 | 55 | QDialogButtonBox 56 | { 57 | /* MD typeically has the cancel/reject button first */ 58 | button-layout: 1; 59 | } 60 | 61 | /* Version label */ 62 | QLabel#versionLabel 63 | { 64 | color: #AB47BC; 65 | font-size: 10px; 66 | background-color: transparent; 67 | } 68 | 69 | /* Hyperlink */ 70 | /* The actual link color is set inside the link text, see UI file */ 71 | QLabel#linkLabel 72 | { 73 | height: 50px; 74 | } 75 | /* Despite what the Qt docs says ':hover' works, albeit limited control */ 76 | QLabel#linkLabel:hover 77 | { 78 | background-color: #4A4A4A; 79 | } 80 | 81 | QCheckBox::indicator 82 | { 83 | background-color: #303030; 84 | border: 2px solid #E4E4E4; 85 | border-radius: 1px; 86 | width: 10px; 87 | height: 10px; 88 | } 89 | QCheckBox::indicator:checked 90 | { 91 | border: 2px solid #CE93D8; 92 | border-radius: 1px; 93 | width: 10px; 94 | height: 10px; 95 | image: url(:/classinf/checkbox-checked.png); 96 | 97 | } 98 | QCheckBox::hover 99 | { 100 | background-color: #4A4A4A; 101 | } 102 | QCheckBox::indicator:unchecked:hover 103 | { 104 | background-color: #4A4A4A; 105 | } 106 | 107 | /* ---- For char set select dialog ---- */ 108 | 109 | QHeaderView 110 | { 111 | border-top: 0px; 112 | border-bottom: 3px solid #C8C8C8; 113 | } 114 | QHeaderView::section 115 | { 116 | height: 23px; 117 | 118 | font-family: Noto Sans,Consolas; 119 | font-weight: bold; 120 | 121 | color: #FFFFFF; 122 | background-color: #9575CD; 123 | border: 0px; 124 | } 125 | 126 | QTableView 127 | { 128 | font-family: Noto Sans,Consolas; 129 | color: #404040; 130 | background-color: #FDFDFD; 131 | selection-color: #404040; 132 | selection-background-color: #FDFDFD; 133 | } 134 | 135 | /* QTableView seperator line */ 136 | QTableWidget::item 137 | { 138 | border-bottom: 1px solid #EEEEEE; 139 | } 140 | -------------------------------------------------------------------------------- /classinformer-code/Plugin/undname.h: -------------------------------------------------------------------------------- 1 | 2 | // Access to CRT C++ demangler/undecorator function 3 | #pragma once 4 | 5 | // Online: http://demangler.com/ 6 | 7 | typedef PVOID (__cdecl * _Alloc)(UINT); 8 | typedef void (__cdecl * _Free)(PVOID); 9 | 10 | const UINT UNDNAME_COMPLETE = 0x00000; // Enable full undecoration 11 | const UINT UNDNAME_NO_LEADING_UNDERSCORES = 0x00001; // Remove leading underscores from MS extended keywords 12 | const UINT UNDNAME_NO_MS_KEYWORDS = 0x00002; // Disable expansion of MS extended keywords 13 | const UINT UNDNAME_NO_FUNCTION_RETURNS = 0x00004; // Disable expansion of return type for primary declaration 14 | const UINT UNDNAME_NO_ALLOCATION_MODEL = 0x00008; // Disable expansion of the declaration model 15 | const UINT UNDNAME_NO_ALLOCATION_LANGUAGE = 0x00010; // Disable expansion of the declaration language specifier 16 | const UINT UNDNAME_NO_MS_THISTYPE = 0x00020; // Disable expansion of MS keywords on the 'this' type for primary declaration 17 | const UINT UNDNAME_NO_CV_THISTYPE = 0x00040; // Disable expansion of CV modifiers on the 'this' type for primary declaration 18 | const UINT UNDNAME_NO_THISTYPE = 0x00060; // Disable all modifiers on the 'this' type 19 | const UINT UNDNAME_NO_ACCESS_SPECIFIERS = 0x00080; // Disable expansion of access specifiers for members 20 | const UINT UNDNAME_NO_THROW_SIGNATURES = 0x00100; // Disable expansion of 'throw-signatures' for functions and pointers to functions 21 | const UINT UNDNAME_NO_MEMBER_TYPE = 0x00200; // Disable expansion of 'static' or 'virtual'ness of members 22 | const UINT UNDNAME_NO_RETURN_UDT_MODEL = 0x00400; // Disable expansion of MS model for UDT returns 23 | const UINT UNDNAME_32_BIT_DECODE = 0x00800; // Undecorate 32-bit decorated names 24 | const UINT UNDNAME_NAME_ONLY = 0x01000; // Crack only the name for primary declaration; return just [scope::]name. Does expand template params 25 | const UINT UNDNAME_TYPE_ONLY = 0x02000; // Input is just a type encoding; compose an abstract declarator 26 | const UINT UNDNAME_HAVE_PARAMETERS = 0x04000; // The real templates parameters are available 27 | const UINT UNDNAME_NO_ECSU = 0x08000; // Suppress enum/class/struct/union 28 | const UINT UNDNAME_NO_IDENT_CHAR_CHECK = 0x10000; // Suppress check for IsValidIdentChar 29 | 30 | inline PVOID mallocWrap(UINT size) { return malloc((UINT) size); } 31 | 32 | /* 33 | To supply a buffer to use use 'buffer' and 'sizeBuffer', else for a allocated buffer 34 | 'buffer' = NULL, 'sizeBuffer' = 0, and use the return string. 35 | Call Free on the return result when done with the string. 36 | Note: CRT documentation error, the Allocator and Free must be supplied regardless if supplied or allocation buffer method desired. 37 | */ 38 | // https://www.winehq.org/pipermail/wine-patches/2004-January/009183.html 39 | extern "C" LPSTR __cdecl __unDName(__out LPSTR buffer, __in LPCSTR name, int sizeBuffer, _Alloc allocator, _Free _free, UINT flags); -------------------------------------------------------------------------------- /classinformer-code/Plugin/view-style.qss: -------------------------------------------------------------------------------- 1 | 2 | /* Make the table easier to read */ 3 | QHeaderView 4 | { 5 | font-family: Noto Sans,Consolas; 6 | font-weight: 100; 7 | font-size: 12px; 8 | } 9 | QTableView 10 | { 11 | font-family: Noto Sans,Consolas; 12 | font-weight: 100; 13 | font-size: 12px; 14 | } 15 | 16 | QTableView::item 17 | { 18 | padding-right: 12px; 19 | } 20 | 21 | /* Color the status bar */ 22 | QStatusBar 23 | { 24 | color: #F0F0F0; 25 | background-color: #9575CD; 26 | } 27 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IDA_OggPlayer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2010 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Library", "IDA_OggPlayer.vcxproj", "{22222222-2222-2222-2222-222222222222}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | DebugEA64|x64 = DebugEA64|x64 12 | Release|x64 = Release|x64 13 | ReleaseEA64|x64 = ReleaseEA64|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {22222222-2222-2222-2222-222222222222}.Debug|x64.ActiveCfg = Debug|x64 17 | {22222222-2222-2222-2222-222222222222}.Debug|x64.Build.0 = Debug|x64 18 | {22222222-2222-2222-2222-222222222222}.DebugEA64|x64.ActiveCfg = DebugEA64|x64 19 | {22222222-2222-2222-2222-222222222222}.DebugEA64|x64.Build.0 = DebugEA64|x64 20 | {22222222-2222-2222-2222-222222222222}.Release|x64.ActiveCfg = Release|x64 21 | {22222222-2222-2222-2222-222222222222}.Release|x64.Build.0 = Release|x64 22 | {22222222-2222-2222-2222-222222222222}.ReleaseEA64|x64.ActiveCfg = ReleaseEA64|x64 23 | {22222222-2222-2222-2222-222222222222}.ReleaseEA64|x64.Build.0 = ReleaseEA64|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | Qt5Version = 5.6.3 30 | SolutionGuid = {B26AD660-E64E-4E68-A67D-77EF965D6EF1} 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IDA_OggPlayer.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | DebugEA64 6 | x64 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | ReleaseEA64 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | Library 23 | {22222222-2222-2222-2222-222222222222} 24 | OggPlayerLib 25 | Win32Proj 26 | 10.0 27 | 28 | 29 | 30 | StaticLibrary 31 | v142 32 | NotSet 33 | false 34 | 35 | 36 | StaticLibrary 37 | v142 38 | NotSet 39 | false 40 | 41 | 42 | StaticLibrary 43 | v142 44 | NotSet 45 | 46 | 47 | StaticLibrary 48 | v142 49 | NotSet 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | <_ProjectFileVersion>12.0.30501.0 73 | 74 | 75 | true 76 | false 77 | IdaOggPlayerD 78 | .LiB 79 | 80 | 81 | true 82 | false 83 | IdaOggPlayer64D 84 | .LiB 85 | 86 | 87 | false 88 | false 89 | IdaOggPlayer 90 | .LiB 91 | 92 | 93 | false 94 | false 95 | IdaOggPlayer64 96 | .LiB 97 | 98 | 99 | 100 | Disabled 101 | $(IDASDK)include;$(SolutionDir);%(AdditionalIncludeDirectories) 102 | __X64__;_DEBUG;_WINDOWS;_LIB;__NT__;__IDP__;__VC__;NO_OBSOLETE_FUNCS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 103 | Sync 104 | EnableFastChecks 105 | MultiThreadedDebug 106 | 107 | 108 | NoListing 109 | Level3 110 | ProgramDatabase 111 | Cdecl 112 | false 113 | $(OutDir)$(TargetName).pdb 114 | 115 | 116 | Windows 117 | true 118 | 119 | 120 | copy "$(OutDir)$(TargetFileName)" "$(SolutionDir)" && copy "$(OutDir)$(TargetName).pdb" "$(SolutionDir)" 121 | 122 | 123 | 124 | 125 | Disabled 126 | $(IDASDK)include;$(SolutionDir);%(AdditionalIncludeDirectories) 127 | __EA64__;__X64__;_DEBUG;_WINDOWS;_LIB;__NT__;__IDP__;__VC__;NO_OBSOLETE_FUNCS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 128 | Sync 129 | EnableFastChecks 130 | MultiThreadedDebug 131 | 132 | 133 | NoListing 134 | Level3 135 | ProgramDatabase 136 | Cdecl 137 | false 138 | $(OutDir)$(TargetName).pdb 139 | 140 | 141 | Windows 142 | true 143 | 144 | 145 | copy "$(OutDir)$(TargetFileName)" "$(SolutionDir)" && copy "$(OutDir)$(TargetName).pdb" "$(SolutionDir)" 146 | 147 | 148 | 149 | 150 | Full 151 | Default 152 | true 153 | Speed 154 | $(IDASDK)include;$(SolutionDir);%(AdditionalIncludeDirectories) 155 | __X64__;NDEBUG;_WINDOWS;_LIB;__NT__;__IDP__;__VC__;NO_OBSOLETE_FUNCS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 156 | true 157 | Sync 158 | MultiThreaded 159 | false 160 | NotSet 161 | 162 | 163 | NoListing 164 | Level3 165 | ProgramDatabase 166 | Cdecl 167 | false 168 | false 169 | $(OutDir)$(TargetName).pdb 170 | 171 | 172 | Windows 173 | true 174 | true 175 | true 176 | 177 | 178 | copy "$(OutDir)$(TargetFileName)" "$(SolutionDir)" && copy "$(OutDir)$(TargetName).pdb" "$(SolutionDir)" 179 | 180 | 181 | 182 | 183 | Full 184 | Default 185 | true 186 | Speed 187 | $(IDASDK)include;$(SolutionDir);%(AdditionalIncludeDirectories) 188 | __EA64__;__X64__;NDEBUG;_WINDOWS;_LIB;__NT__;__IDP__;__VC__;NO_OBSOLETE_FUNCS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 189 | true 190 | Sync 191 | MultiThreaded 192 | false 193 | NotSet 194 | 195 | 196 | NoListing 197 | Level3 198 | ProgramDatabase 199 | Cdecl 200 | false 201 | false 202 | $(OutDir)$(TargetName).pdb 203 | 204 | 205 | Windows 206 | true 207 | true 208 | true 209 | 210 | 211 | copy "$(OutDir)$(TargetFileName)" "$(SolutionDir)" && copy "$(OutDir)$(TargetName).pdb" "$(SolutionDir)" 212 | 213 | 214 | 215 | 216 | Cdecl 217 | Cdecl 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IDA_OggPlayer.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | stb_vorbis 7 | 8 | 9 | 10 | 11 | 12 | stb_vorbis 13 | 14 | 15 | 16 | 17 | 18 | stb_vorbis 19 | 20 | 21 | 22 | 23 | {0d6cb019-1350-4c37-920d-5b28ebcf922e} 24 | 25 | 26 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IDA_OggPlayer.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IdaOgg.cpp: -------------------------------------------------------------------------------- 1 | 2 | // IdaOgg: A mini Vorbis Ogg clip player for IDA 3 | // By Sirmabus 2015 4 | // Site: http://www.macromonkey.com 5 | // License: 6 | #define WIN32_LEAN_AND_MEAN 7 | #define WINVER 0x0601 // _WIN32_WINNT_WIN7 8 | #define _WIN32_WINNT 0x0601 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | // Nix the many warning about int type conversions 15 | #pragma warning(push) 16 | #pragma warning(disable:4244) 17 | #pragma warning(disable:4267) 18 | #include 19 | #include 20 | #pragma warning(pop) 21 | 22 | #include "stb_vorbis.h" 23 | #include "IdaOgg.h" 24 | 25 | // Required libs 26 | #pragma comment(lib, "ida.lib") 27 | #pragma comment(lib, "winmm.lib") 28 | 29 | #undef MYCATCH 30 | #define MYCATCH() catch (...) { msg("** Exception in ogg method: %s()! ***\n", __FUNCTION__); } 31 | 32 | // Only 16bit samples are supported 33 | const int BITS_PER_SAMPLE = 16; 34 | 35 | #if 0 36 | void trace(LPCTSTR pszFormat, ...) 37 | { 38 | if (pszFormat) 39 | { 40 | va_list vl; 41 | char szBuffer[4096]; 42 | va_start(vl, pszFormat); 43 | ::qvsnprintf(szBuffer, (sizeof(szBuffer) - 1), pszFormat, vl); 44 | szBuffer[sizeof(szBuffer) - 1] = 0; 45 | va_end(vl); 46 | 47 | OutputDebugString(szBuffer); 48 | } 49 | } 50 | #endif 51 | 52 | #if 0 53 | typedef double TIMESTAMP; // Time in floating seconds 54 | static TIMESTAMP GetTimeStamp() 55 | { 56 | LARGE_INTEGER tLarge; 57 | QueryPerformanceCounter(&tLarge); 58 | 59 | static TIMESTAMP s_ClockFreq; 60 | if (s_ClockFreq == 0.0) 61 | { 62 | LARGE_INTEGER tLarge; 63 | QueryPerformanceFrequency(&tLarge); 64 | s_ClockFreq = (TIMESTAMP)tLarge.QuadPart; 65 | } 66 | 67 | return((TIMESTAMP)tLarge.QuadPart / s_ClockFreq); 68 | } 69 | #endif 70 | 71 | // RIFF wave header 72 | #pragma pack(push, 1) 73 | struct WAVE_HEADER 74 | { 75 | FOURCC riffTag; 76 | DWORD riffSize; 77 | // 78 | FOURCC waveTag; 79 | FOURCC fmtTag; 80 | int fmtSize; 81 | // 82 | WAVEFORMATEX wfm; 83 | // 84 | FOURCC dataTag; 85 | int dataSize; 86 | } static *gHeader = NULL; 87 | #pragma pack(pop) 88 | 89 | // Play sound from memory 90 | void OggPlay::playFromMemory(const PVOID source, int length, BOOL async /*= FALSE*/) 91 | { 92 | try 93 | { 94 | if (!gHeader) 95 | { 96 | int nChannels = 0, nSamplesPerSec = 0; 97 | short *rawPcm = NULL; 98 | //TIMESTAMP startTime = GetTimeStamp(); 99 | int samples = stb_vorbis_decode_memory((const unsigned char *) source, length, &nChannels, &nSamplesPerSec, &rawPcm); 100 | //TIMESTAMP endTime = (GetTimeStamp() - startTime); 101 | //msg("Decode time: %f\n", endTime); 102 | 103 | if (samples > 0) 104 | { 105 | // Space for WAV header + data 106 | UINT sampleSize = (samples * sizeof(short)); 107 | if (WAVE_HEADER *waveData = (WAVE_HEADER *)_aligned_malloc((sizeof(WAVE_HEADER) + sampleSize + 64), 16)) 108 | { 109 | // Fill header 110 | waveData->riffTag = FOURCC_RIFF; 111 | waveData->riffSize = ((sizeof(WAVE_HEADER) + sampleSize) - 8); // Total file size, not including the first 8 bytes 112 | // 113 | waveData->waveTag = mmioFOURCC('W', 'A', 'V', 'E'); 114 | waveData->fmtTag = mmioFOURCC('f', 'm', 't', ' '); 115 | waveData->fmtSize = sizeof(WAVEFORMATEX); 116 | // 117 | waveData->wfm.wFormatTag = WAVE_FORMAT_PCM; 118 | waveData->wfm.nChannels = nChannels; 119 | waveData->wfm.nSamplesPerSec = nSamplesPerSec; 120 | waveData->wfm.nAvgBytesPerSec = ((nSamplesPerSec * sizeof(short)) * nChannels); 121 | waveData->wfm.nBlockAlign = ((nChannels * BITS_PER_SAMPLE) / 8); 122 | waveData->wfm.wBitsPerSample = BITS_PER_SAMPLE; 123 | waveData->wfm.cbSize = 0; 124 | // 125 | waveData->dataTag = mmioFOURCC('d', 'a', 't', 'a'); 126 | waveData->dataSize = sampleSize; 127 | 128 | // Copy just PCM data & free buffer 129 | memcpy(&waveData[1], rawPcm, sampleSize); 130 | stb_vorbis_free_buffer(rawPcm); 131 | rawPcm = NULL; 132 | 133 | // TODO: Not adding the useless "INFO LIST" chunk causes a problem? 134 | // See: http://en.wikipedia.org/wiki/WAV 135 | 136 | // Play the decoded wave 137 | ::PlaySound((LPCTSTR)waveData, NULL, (SND_MEMORY | ((async == TRUE) ? SND_ASYNC : 0))); 138 | 139 | /// Not async we can clean up now sound is done 140 | if (!async) 141 | endPlay(); 142 | } 143 | } 144 | 145 | stb_vorbis_free_buffer(rawPcm); 146 | } 147 | else 148 | msg(__FUNCTION__": An Ogg is already playing!\n"); 149 | } 150 | MYCATCH() 151 | } 152 | 153 | // Stop the Ogg if it's still playing and do necessary clean up 154 | void OggPlay::endPlay() 155 | { 156 | try 157 | { 158 | // Stop the sound if it's playing 159 | ::PlaySound(NULL, NULL, SND_ASYNC); 160 | 161 | // While async mode 162 | if (gHeader) 163 | { 164 | _aligned_free(gHeader); 165 | gHeader = NULL; 166 | } 167 | 168 | stb_vorbis_heap_destroy(); 169 | } 170 | MYCATCH() 171 | } 172 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IdaOgg.h: -------------------------------------------------------------------------------- 1 | 2 | // IdaOgg: A mini Vorbis Ogg clip player for IDA 3 | // Sean Barrett's "Ogg Vorbis decoder" 4 | // http://nothings.org/stb_vorbis/ 5 | // Public Domain "license" 6 | // IDA Pro wrapper by Sirmabus 2015 7 | // http://www.macromonkey.com 8 | #pragma once 9 | 10 | #ifndef _LIB 11 | #ifndef __EA64__ 12 | #ifndef _DEBUG 13 | #pragma comment(lib, "IdaOggPlayer.LiB") 14 | #else 15 | #pragma comment(lib, "IdaOggPlayerD.LiB") 16 | #endif 17 | #else 18 | #ifndef _DEBUG 19 | #pragma comment(lib, "IdaOggPlayer64.LiB") 20 | #else 21 | #pragma comment(lib, "IdaOggPlayer64D.LiB") 22 | #endif 23 | #endif 24 | #endif // _LIB 25 | 26 | namespace OggPlay 27 | { 28 | // Play Ogg from memory source, optionally asynchronously 29 | void playFromMemory(const PVOID memory, int length, BOOL async = FALSE); 30 | 31 | // Stop the currently playing wave if there is one and clean up. 32 | // This needs to eb called after each playOggFromMemory() when done if async = TRUE 33 | void endPlay(); 34 | }; 35 | 36 | 37 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IdaOggPlayer.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_OggPlayer/IdaOggPlayer.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IdaOggPlayer.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_OggPlayer/IdaOggPlayer.pdb -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IdaOggPlayer64.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_OggPlayer/IdaOggPlayer64.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IdaOggPlayer64.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_OggPlayer/IdaOggPlayer64.pdb -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IdaOggPlayer64D.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_OggPlayer/IdaOggPlayer64D.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IdaOggPlayer64D.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_OggPlayer/IdaOggPlayer64D.pdb -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IdaOggPlayerD.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_OggPlayer/IdaOggPlayerD.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/IdaOggPlayerD.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_OggPlayer/IdaOggPlayerD.pdb -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/PropertySheet.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | C:\Program Files\IDA Pro 8.2\ 6 | ..\..\idasdk_pro82\ 7 | 8 | 9 | 10 | 11 | 12 | $(IDADIR) 13 | 14 | 15 | $(IDASDK) 16 | 17 | 18 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/original README.md: -------------------------------------------------------------------------------- 1 | stb 2 | === 3 | 4 | single-file public domain libraries for C/C++ 5 | 6 | library | lastest version | category | description 7 | --------------------- | ---- | -------- | -------------------------------- 8 | **stb_vorbis.c** | 1.04 | audio | decode ogg vorbis files from file/memory to float/16-bit signed output 9 | **stb_image.h** | 2.02 | graphics | image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC 10 | **stb_truetype.h** | 1.02 | graphics | parse, decode, and rasterize characters from truetype fonts 11 | **stb_image_write.h** | 0.97 | graphics | image writing to disk: PNG, TGA, BMP 12 | **stb_image_resize.h** | 0.90 | graphics | resize images larger/smaller with good quality 13 | **stb_rect_pack.h** | 0.05 | graphics | simple 2D rectangle packer with decent quality 14 | **stretchy_buffer.h** | 1.01 | utility | typesafe dynamic array for C (i.e. approximation to vector<>), doesn't compile as C++ 15 | **stb_textedit.h** | 1.5 | UI | guts of a text editor for games etc implementing them from scratch 16 | **stb_dxt.h** | 1.04 | 3D graphics | Fabian "ryg" Giesen's real-time DXT compressor 17 | **stb_perlin.h** | 0.2 | 3D graphics | revised Perlin noise (3D input, 1D output) 18 | **stb_tilemap_editor.h** | 0.30 | games | embeddable tilemap editor 19 | **stb_herringbone_wang_tile.h** | 0.6 | games | herringbone Wang tile map generator 20 | **stb_c_lexer.h** | 0.06 | parsing | simplify writing parsers for C-like languages 21 | **stb_divide.h** | 0.91 | math | more useful 32-bit modulus e.g. "euclidean divide" 22 | **stb.h** | 2.24 | misc | helper functions for C, mostly redundant in C++; basically author's personal stuff 23 | 24 | FAQ 25 | --- 26 | 27 | #### What's the license? 28 | 29 | These libraries are in the public domain (or the equivalent where that is not 30 | possible). You can do anything you want with them. You have no legal obligation 31 | to do anything else, although I appreciate attribution. 32 | 33 | #### If I wrap an stb library in a new library, does the new library have to be public domain? 34 | 35 | No. 36 | 37 | #### A lot of these libraries seem redundant to existing open source libraries. Are they better somehow? 38 | 39 | Generally they're only better in that they're easier to integrate, 40 | easier to use, and easier to release (single file; good API; no 41 | attribution requirement). They may be less featureful, slower, 42 | and/or use more memory. If you're already using an equivalent 43 | library, there's probably no good reason to switch. 44 | 45 | #### Why "stb"? Is this something to do with Set-Top Boxes? 46 | 47 | No, they are just the initials for my name, Sean T. Barrett. 48 | This was not chosen out of egomania, but as a semi-robust 49 | way of namespacing the filenames and source function names. 50 | 51 | #### Will you add more image types to stb_image.c? 52 | 53 | If people submit them, I generally add them, but the goal of stb_image 54 | is less for applications like image viewer apps (which need to support 55 | every type of image under the sun) and more for things like games which 56 | can choose what images to use, so I may decline to add them if they're 57 | too rare or if the size of implementation vs. apparent benefit is too low. 58 | 59 | #### Are there other single-file public-domain libraries out there? 60 | 61 | Yes. I'll put a list here when people remind me what they are. 62 | 63 | #### Do you have any advice on how to create my own single-file library? 64 | 65 | Yes. https://github.com/nothings/stb/blob/master/docs/stb_howto.txt 66 | 67 | #### Why public domain? 68 | 69 | Because more people will use it. Because it's not viral, people 70 | are not obligated to give back, so you could argue that it hurts 71 | the *development* of it, and then because it doesn't develop as 72 | well it's not as good, and then because it's not as good, in the 73 | long run maybe fewer people will use it. I have total respect for 74 | that opinion, but I just don't believe it myself for most software. 75 | 76 | #### Why C? 77 | 78 | Primarily, because I use C, not C++. But it does also make it easier 79 | for other people to use them from other languages. 80 | 81 | #### Why not C99? stdint.h, declare-anywhere, etc. 82 | 83 | I still use MSVC 6 (1998) as my IDE because it has better human factors 84 | for me than later versions of MSVC. 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/stb_vorbis.h: -------------------------------------------------------------------------------- 1 | 2 | // Ogg Vorbis audio decoder - v1.04 - public domain 3 | // Modified by Sirmabus 4 | #pragma once 5 | 6 | // ************************************ 7 | // My config 8 | 9 | // Only need mono or stereo 10 | #define STB_VORBIS_MAX_CHANNELS 2 11 | 12 | // ************************************ 13 | 14 | typedef struct 15 | { 16 | char *alloc_buffer; 17 | int alloc_buffer_length_in_bytes; 18 | } stb_vorbis_alloc; 19 | 20 | 21 | /////////// FUNCTIONS USEABLE WITH ALL INPUT MODES 22 | 23 | typedef struct stb_vorbis stb_vorbis; 24 | 25 | typedef struct 26 | { 27 | unsigned int sample_rate; 28 | int channels; 29 | 30 | unsigned int setup_memory_required; 31 | unsigned int setup_temp_memory_required; 32 | unsigned int temp_memory_required; 33 | 34 | int max_frame_size; 35 | } stb_vorbis_info; 36 | 37 | // get general information about the file 38 | extern stb_vorbis_info stb_vorbis_get_info(stb_vorbis *f); 39 | 40 | // get the last error detected (clears it, too) 41 | extern int stb_vorbis_get_error(stb_vorbis *f); 42 | 43 | // close an ogg vorbis file and free all memory in use 44 | extern void stb_vorbis_close(stb_vorbis *f); 45 | 46 | // this function returns the offset (in samples) from the beginning of the 47 | // file that will be returned by the next decode, if it is known, or -1 48 | // otherwise. after a flush_pushdata() call, this may take a while before 49 | // it becomes valid again. 50 | // NOT WORKING YET after a seek with PULLDATA API 51 | extern int stb_vorbis_get_sample_offset(stb_vorbis *f); 52 | 53 | // returns the current seek point within the file, or offset from the beginning 54 | // of the memory buffer. In pushdata mode it returns 0. 55 | extern unsigned int stb_vorbis_get_file_offset(stb_vorbis *f); 56 | 57 | 58 | ////////// PULLING INPUT API 59 | 60 | #ifndef STB_VORBIS_NO_PULLDATA_API 61 | // This API assumes stb_vorbis is allowed to pull data from a source-- 62 | // either a block of memory containing the _entire_ vorbis stream, or a 63 | // FILE * that you or it create, or possibly some other reading mechanism 64 | // if you go modify the source to replace the FILE * case with some kind 65 | // of callback to your code. (But if you don't support seeking, you may 66 | // just want to go ahead and use pushdata.) 67 | 68 | #if !defined(STB_VORBIS_NO_INTEGER_CONVERSION) 69 | extern int stb_vorbis_decode_memory(const unsigned char *mem, int len, int *channels, int *sample_rate, short **output); 70 | 71 | // KW: 72 | extern void stb_vorbis_free_buffer(short *buffer); 73 | extern void stb_vorbis_heap_destroy(); 74 | #endif 75 | // decode an entire file and output the data interleaved into a malloc()ed 76 | // buffer stored in *output. The return value is the number of samples 77 | // decoded, or -1 if the file could not be opened or was not an ogg vorbis file. 78 | // When you're done with it, just free() the pointer returned in *output. 79 | 80 | extern stb_vorbis * stb_vorbis_open_memory(const unsigned char *data, int len, 81 | int *error, stb_vorbis_alloc *alloc_buffer); 82 | // create an ogg vorbis decoder from an ogg vorbis stream in memory (note 83 | // this must be the entire stream!). on failure, returns NULL and sets *error 84 | 85 | extern int stb_vorbis_seek_frame(stb_vorbis *f, unsigned int sample_number); 86 | extern int stb_vorbis_seek(stb_vorbis *f, unsigned int sample_number); 87 | // NOT WORKING YET 88 | // these functions seek in the Vorbis file to (approximately) 'sample_number'. 89 | // after calling seek_frame(), the next call to get_frame_*() will include 90 | // the specified sample. after calling stb_vorbis_seek(), the next call to 91 | // stb_vorbis_get_samples_* will start with the specified sample. If you 92 | // do not need to seek to EXACTLY the target sample when using get_samples_*, 93 | // you can also use seek_frame(). 94 | 95 | extern void stb_vorbis_seek_start(stb_vorbis *f); 96 | // this function is equivalent to stb_vorbis_seek(f,0), but it 97 | // actually works 98 | 99 | extern unsigned int stb_vorbis_stream_length_in_samples(stb_vorbis *f); 100 | extern float stb_vorbis_stream_length_in_seconds(stb_vorbis *f); 101 | // these functions return the total length of the vorbis stream 102 | 103 | extern int stb_vorbis_get_frame_float(stb_vorbis *f, int *channels, float ***output); 104 | // decode the next frame and return the number of samples. the number of 105 | // channels returned are stored in *channels (which can be NULL--it is always 106 | // the same as the number of channels reported by get_info). *output will 107 | // contain an array of float* buffers, one per channel. These outputs will 108 | // be overwritten on the next call to stb_vorbis_get_frame_*. 109 | // 110 | // You generally should not intermix calls to stb_vorbis_get_frame_*() 111 | // and stb_vorbis_get_samples_*(), since the latter calls the former. 112 | 113 | #ifndef STB_VORBIS_NO_INTEGER_CONVERSION 114 | extern int stb_vorbis_get_frame_short_interleaved(stb_vorbis *f, int num_c, short *buffer, int num_shorts); 115 | extern int stb_vorbis_get_frame_short(stb_vorbis *f, int num_c, short **buffer, int num_samples); 116 | #endif 117 | // decode the next frame and return the number of samples per channel. the 118 | // data is coerced to the number of channels you request according to the 119 | // channel coercion rules (see below). You must pass in the size of your 120 | // buffer(s) so that stb_vorbis will not overwrite the end of the buffer. 121 | // The maximum buffer size needed can be gotten from get_info(); however, 122 | // the Vorbis I specification implies an absolute maximum of 4096 samples 123 | // per channel. Note that for interleaved data, you pass in the number of 124 | // shorts (the size of your array), but the return value is the number of 125 | // samples per channel, not the total number of samples. 126 | 127 | // Channel coercion rules: 128 | // Let M be the number of channels requested, and N the number of channels present, 129 | // and Cn be the nth channel; let stereo L be the sum of all L and center channels, 130 | // and stereo R be the sum of all R and center channels (channel assignment from the 131 | // vorbis spec). 132 | // M N output 133 | // 1 k sum(Ck) for all k 134 | // 2 * stereo L, stereo R 135 | // k l k > l, the first l channels, then 0s 136 | // k l k <= l, the first k channels 137 | // Note that this is not _good_ surround etc. mixing at all! It's just so 138 | // you get something useful. 139 | 140 | extern int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float *buffer, int num_floats); 141 | extern int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, int num_samples); 142 | // gets num_samples samples, not necessarily on a frame boundary--this requires 143 | // buffering so you have to supply the buffers. DOES NOT APPLY THE COERCION RULES. 144 | // Returns the number of samples stored per channel; it may be less than requested 145 | // at the end of the file. If there are no more samples in the file, returns 0. 146 | 147 | #ifndef STB_VORBIS_NO_INTEGER_CONVERSION 148 | extern int stb_vorbis_get_samples_short_interleaved(stb_vorbis *f, int channels, short *buffer, int num_shorts); 149 | extern int stb_vorbis_get_samples_short(stb_vorbis *f, int channels, short **buffer, int num_samples); 150 | #endif 151 | // gets num_samples samples, not necessarily on a frame boundary--this requires 152 | // buffering so you have to supply the buffers. Applies the coercion rules above 153 | // to produce 'channels' channels. Returns the number of samples stored per channel; 154 | // it may be less than requested at the end of the file. If there are no more 155 | // samples in the file, returns 0. 156 | 157 | #endif 158 | 159 | //////// ERROR CODES 160 | 161 | enum STBVorbisError 162 | { 163 | VORBIS__no_error, 164 | 165 | VORBIS_need_more_data = 1, // not a real error 166 | 167 | VORBIS_invalid_api_mixing, // can't mix API modes 168 | VORBIS_outofmem, // not enough memory 169 | VORBIS_feature_not_supported, // uses floor 0 170 | VORBIS_too_many_channels, // STB_VORBIS_MAX_CHANNELS is too small 171 | VORBIS_file_open_failure, // fopen() failed 172 | VORBIS_seek_without_length, // can't seek in unknown-length file 173 | 174 | VORBIS_unexpected_eof = 10, // file is truncated? 175 | VORBIS_seek_invalid, // seek past EOF 176 | 177 | // decoding errors (corrupt/invalid stream) -- you probably 178 | // don't care about the exact details of these 179 | 180 | // vorbis errors: 181 | VORBIS_invalid_setup = 20, 182 | VORBIS_invalid_stream, 183 | 184 | // ogg errors: 185 | VORBIS_missing_capture_pattern = 30, 186 | VORBIS_invalid_stream_structure_version, 187 | VORBIS_continued_packet_flag_invalid, 188 | VORBIS_incorrect_stream_serial_number, 189 | VORBIS_invalid_first_page, 190 | VORBIS_bad_packet_type, 191 | VORBIS_cant_find_last_page, 192 | VORBIS_seek_failed, 193 | }; -------------------------------------------------------------------------------- /ida-support-library-code/IDA_OggPlayer/stb_vorbis.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Ogg Vorbis audio decoder - v1.04 - public domain 4 | // http://nothings.org/stb_vorbis/ 5 | // 6 | // Written by Sean Barrett in 2007, last updated in 2014 7 | // Sponsored by RAD Game Tools. 8 | // 9 | // Placed in the public domain April 2007 by the author: no copyright 10 | // is claimed, and you may use it for any purpose you like. 11 | // 12 | // No warranty for any purpose is expressed or implied by the author (nor 13 | // by RAD Game Tools). Report bugs and send enhancements to the author. 14 | // 15 | // Limitations: 16 | // 17 | // - seeking not supported except manually via PUSHDATA api 18 | // - floor 0 not supported (used in old ogg vorbis files pre-2004) 19 | // - lossless sample-truncation at beginning ignored 20 | // - cannot concatenate multiple vorbis streams 21 | // - sample positions are 32-bit, limiting seekable 192Khz 22 | // files to around 6 hours (Ogg supports 64-bit) 23 | // 24 | // Bugfix/warning contributors: 25 | // Terje Mathisen Niklas Frykholm Andy Hill 26 | // Casey Muratori John Bolton Gargaj 27 | // Laurent Gomila Marc LeBlanc Ronny Chevalier 28 | // Bernhard Wodo Evan Balster "alxprd"@github 29 | // Tom Beaumont Ingo Leitgeb 30 | // (If you reported a bug but do not appear in this list, it is because 31 | // someone else reported the bug before you. There were too many of you to 32 | // list them all because I was lax about updating for a long time, sorry.) 33 | // 34 | // Partial history: 35 | // 1.04 - 2014/08/27 - fix missing const-correct case in API 36 | // 1.03 - 2014/08/07 - warning fixes 37 | // 1.02 - 2014/07/09 - declare qsort comparison as explicitly _cdecl in Windows 38 | // 1.01 - 2014/06/18 - fix stb_vorbis_get_samples_float (interleaved was correct) 39 | // 1.0 - 2014/05/26 - fix memory leaks; fix warnings; fix bugs in >2-channel; 40 | // (API change) report sample rate for decode-full-file funcs 41 | // 0.99996 - - bracket #include for macintosh compilation 42 | // 0.99995 - - avoid alias-optimization issue in float-to-int conversion 43 | // 44 | // See end of file for full version history. 45 | 46 | /////////// THREAD SAFETY 47 | 48 | // Individual stb_vorbis* handles are not thread-safe; you cannot decode from 49 | // them from multiple threads at the same time. However, you can have multiple 50 | // stb_vorbis* handles and decode from them independently in multiple thrads. 51 | 52 | 53 | /////////// MEMORY ALLOCATION 54 | 55 | // normally stb_vorbis uses malloc() to allocate memory at startup, 56 | // and alloca() to allocate temporary memory during a frame on the 57 | // stack. (Memory consumption will depend on the amount of setup 58 | // data in the file and how you set the compile flags for speed 59 | // vs. size. In my test files the maximal-size usage is ~150KB.) 60 | // 61 | // You can modify the wrapper functions in the source (setup_malloc, 62 | // setup_temp_malloc, temp_malloc) to change this behavior, or you 63 | // can use a simpler allocation model: you pass in a buffer from 64 | // which stb_vorbis will allocate _all_ its memory (including the 65 | // temp memory). "open" may fail with a VORBIS_outofmem if you 66 | // do not pass in enough data; there is no way to determine how 67 | // much you do need except to succeed (at which point you can 68 | // query get_info to find the exact amount required. yes I know 69 | // this is lame). 70 | // 71 | // If you pass in a non-NULL buffer of the type below, allocation 72 | // will occur from it as described above. Otherwise just pass NULL 73 | // to use malloc()/alloca() 74 | 75 | 76 | /* Version history 77 | 1.04 - 2014/08/27 - fix missing const-correct case in API 78 | 1.03 - 2014/08/07 - Warning fixes 79 | 1.02 - 2014/07/09 - Declare qsort compare function _cdecl on windows 80 | 1.01 - 2014/06/18 - fix stb_vorbis_get_samples_float 81 | 1.0 - 2014/05/26 - fix memory leaks; fix warnings; fix bugs in multichannel 82 | (API change) report sample rate for decode-full-file funcs 83 | 0.99996 - bracket #include for macintosh compilation by Laurent Gomila 84 | 0.99995 - use union instead of pointer-cast for fast-float-to-int to avoid alias-optimization problem 85 | 0.99994 - change fast-float-to-int to work in single-precision FPU mode, remove endian-dependence 86 | 0.99993 - remove assert that fired on legal files with empty tables 87 | 0.99992 - rewind-to-start 88 | 0.99991 - bugfix to stb_vorbis_get_samples_short by Bernhard Wodo 89 | 0.9999 - (should have been 0.99990) fix no-CRT support, compiling as C++ 90 | 0.9998 - add a full-decode function with a memory source 91 | 0.9997 - fix a bug in the read-from-FILE case in 0.9996 addition 92 | 0.9996 - query length of vorbis stream in samples/seconds 93 | 0.9995 - bugfix to another optimization that only happened in certain files 94 | 0.9994 - bugfix to one of the optimizations that caused significant (but inaudible?) errors 95 | 0.9993 - performance improvements; runs in 99% to 104% of time of reference implementation 96 | 0.9992 - performance improvement of IMDCT; now performs close to reference implementation 97 | 0.9991 - performance improvement of IMDCT 98 | 0.999 - (should have been 0.9990) performance improvement of IMDCT 99 | 0.998 - no-CRT support from Casey Muratori 100 | 0.997 - bugfixes for bugs found by Terje Mathisen 101 | 0.996 - bugfix: fast-huffman decode initialized incorrectly for sparse codebooks; fixing gives 10% speedup - found by Terje Mathisen 102 | 0.995 - bugfix: fix to 'effective' overrun detection - found by Terje Mathisen 103 | 0.994 - bugfix: garbage decode on final VQ symbol of a non-multiple - found by Terje Mathisen 104 | 0.993 - bugfix: pushdata API required 1 extra byte for empty page (failed to consume final page if empty) - found by Terje Mathisen 105 | 0.992 - fixes for MinGW warning 106 | 0.991 - turn fast-float-conversion on by default 107 | 0.990 - fix push-mode seek recovery if you seek into the headers 108 | 0.98b - fix to bad release of 0.98 109 | 0.98 - fix push-mode seek recovery; robustify float-to-int and support non-fast mode 110 | 0.97 - builds under c++ (typecasting, don't use 'class' keyword) 111 | 0.96 - somehow MY 0.95 was right, but the web one was wrong, so here's my 0.95 rereleased as 0.96, fixes a typo in the clamping code 112 | 0.95 - clamping code for 16-bit functions 113 | 0.94 - not publically released 114 | 0.93 - fixed all-zero-floor case (was decoding garbage) 115 | 0.92 - fixed a memory leak 116 | 0.91 - conditional compiles to omit parts of the API and the infrastructure to support them: STB_VORBIS_NO_PULLDATA_API, STB_VORBIS_NO_PUSHDATA_API, STB_VORBIS_NO_STDIO, STB_VORBIS_NO_INTEGER_CONVERSION 117 | 0.90 - first public release 118 | */ 119 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/IDA_SegmentSelect.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2010 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Library", "Lib\lib.vcxproj", "{DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | DebugEA64|x64 = DebugEA64|x64 12 | Release|x64 = Release|x64 13 | ReleaseEA64|x64 = ReleaseEA64|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.Debug|x64.ActiveCfg = Debug|x64 17 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.Debug|x64.Build.0 = Debug|x64 18 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.DebugEA64|x64.ActiveCfg = DebugEA64|x64 19 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.DebugEA64|x64.Build.0 = DebugEA64|x64 20 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.Release|x64.ActiveCfg = Release|x64 21 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.Release|x64.Build.0 = Release|x64 22 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.ReleaseEA64|x64.ActiveCfg = ReleaseEA64|x64 23 | {DEADBEEF-CAFE-F00D-FEED-C0FFEEC0FFEE}.ReleaseEA64|x64.Build.0 = ReleaseEA64|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | Qt5Version = 5.6.0 30 | SolutionGuid = {230B518D-983E-40F5-AADA-1CED164B3759} 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/PropertySheet.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | C:\Program Files\IDA Pro 8.2\ 6 | C:\Qt\5.15.2-x64\ 7 | ..\..\..\idasdk_pro82\ 8 | 9 | 10 | 11 | 12 | 13 | $(IDADIR) 14 | 15 | 16 | $(QTDIR) 17 | 18 | 19 | $(IDASDK) 20 | 21 | 22 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/SegSelect.cpp: -------------------------------------------------------------------------------- 1 | 2 | // SegSelect: IDA Pro Qt multi-segment select dialog 3 | // By Sirmabus 2015 4 | // Docs: http://www.macromonkey.com/ida-waitboxex/ 5 | // License: Qt LGPL 6 | #define WIN32_LEAN_AND_MEAN 7 | #define WINVER 0x0601 // _WIN32_WINNT_WIN7 8 | #define _WIN32_WINNT 0x0601 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #define QT_NO_STATUSTIP 15 | #define QT_NO_WHATSTHIS 16 | #define QT_NO_ACCESSIBILITY 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #define USE_DANGEROUS_FUNCTIONS 24 | // Nix the many warning about int type conversions 25 | #pragma warning(push) 26 | #pragma warning(disable:4244) 27 | #pragma warning(disable:4267) 28 | #include 29 | #include 30 | #include "SegmentDialog.h" 31 | #pragma warning(pop) 32 | 33 | // IDA SDK Qt libs @ (SDK)\lib\x86_win_qt 34 | #pragma comment(lib, "Qt5Core.lib") 35 | #pragma comment(lib, "Qt5Gui.lib") 36 | #pragma comment(lib, "Qt5Widgets.lib") 37 | 38 | #undef MYCATCH 39 | #define MYCATCH() catch (...) { msg("** Exception @ SegSelect in method: %s()! ***\n", __FUNCTION__); } 40 | #define SIZESTR(x) (sizeof(x) - 1) 41 | 42 | // QT_NO_UNICODE_LITERAL must be defined (best in preprocessor setting) 43 | // So Qt doesn't a static string pool that will cause IDA to crash on unload 44 | #ifndef QT_NO_UNICODE_LITERAL 45 | # error QT_NO_UNICODE_LITERAL must be defined to avoid Qt string crashes 46 | #endif 47 | 48 | QRect SegmentDialog::geom; 49 | 50 | SegmentDialog::SegmentDialog(QWidget *parent, UINT flags, LPCSTR title, LPCSTR styleSheet, LPCSTR icon) : QDialog(parent) 51 | { 52 | // Required for static library resources 53 | Q_INIT_RESOURCE(SegSelectRes); 54 | 55 | setupUi(this); 56 | buttonBox->addButton("CONTINUE", QDialogButtonBox::AcceptRole); 57 | buttonBox->addButton("CANCEL", QDialogButtonBox::RejectRole); 58 | setWindowTitle(title); 59 | setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); 60 | if (icon && icon[0]) 61 | setWindowIcon(QIcon(icon)); 62 | else 63 | setWindowIcon(QIcon(":/seglib/idaq_seg.png")); 64 | 65 | // Enumerate segments, populate table 66 | if (int count = get_segm_qty()) 67 | { 68 | // 1st pass get max character sizes for proportional formating 69 | int biggestStart = 0, biggestEnd = 0, biggestSize = 0; 70 | for (int i = 0; i < count; i++) 71 | { 72 | segment_t *seg = getnseg(i); 73 | char buffer[34]; 74 | int len = strlen(_ui64toa(seg->start_ea, buffer, 16)); 75 | if (len > biggestStart) biggestStart = len; 76 | len = strlen(_ui64toa(seg->end_ea, buffer, 16)); 77 | if (len > biggestEnd) biggestEnd = len; 78 | len = strlen(_ui64toa(seg->size(), buffer, 16)); 79 | if (len > biggestSize) biggestSize = len; 80 | } 81 | 82 | #ifndef __EA64__ 83 | if (++biggestStart > 8) biggestStart = 8; 84 | if (++biggestEnd > 8) biggestEnd = 8; 85 | if (++biggestSize > 8) biggestSize = 8; 86 | char startFormat[18], endFormat[18], sizeFormat[18]; 87 | sprintf(startFormat, "%%0%dX", biggestStart); 88 | sprintf(endFormat, "%%0%dX", biggestEnd); 89 | sprintf(sizeFormat, "%%0%dX", biggestSize); 90 | #else 91 | if (++biggestStart > 16) biggestStart = 16; 92 | if (++biggestEnd > 16) biggestEnd = 16; 93 | if (++biggestSize > 16) biggestSize = 16; 94 | char startFormat[34], endFormat[34], sizeFormat[34]; 95 | sprintf(startFormat, "%%0%dI64X", biggestStart); 96 | sprintf(endFormat, "%%0%dI64X", biggestEnd); 97 | sprintf(sizeFormat, "%%0%dI64X", biggestSize); 98 | #endif 99 | 100 | enum {NAME, TYPE, FLAGS, START, END, SIZE}; 101 | //const int ROW_HEIGHT = 36; // 64dp 102 | 103 | // 2nd pass populate view 104 | segmentTable->setRowCount(count); 105 | segmentTable->setUpdatesEnabled(FALSE); 106 | for (int i = 0; i < count; i++) 107 | { 108 | // Name w/checkbox 109 | segment_t *seg = getnseg(i); 110 | 111 | char buffer[128]; 112 | qstring segName; 113 | if (get_segm_name(&segName, seg, 0) > 0) 114 | strncpy_s(buffer, sizeof(buffer), segName.c_str(), SIZESTR(buffer)); 115 | else 116 | strcpy(buffer, "none"); 117 | 118 | QTableWidgetItem *item = new QTableWidgetItem(buffer); 119 | LPCSTR iconFile; 120 | BOOL checked = FALSE; 121 | switch (seg->type) 122 | { 123 | case SEG_XTRN: 124 | { 125 | iconFile = ":/seglib/extrn_seg.png"; 126 | checked = (flags & SegSelect::XTRN_HINT); 127 | } 128 | break; 129 | 130 | case SEG_CODE: 131 | { 132 | iconFile = ":/seglib/code_seg.png"; 133 | checked = (flags & SegSelect::CODE_HINT); 134 | } 135 | break; 136 | 137 | case SEG_DATA: 138 | { 139 | iconFile = ":/seglib/data_seg.png"; 140 | 141 | if ((flags & SegSelect::RDATA_HINT) && (strcmp(buffer, ".rdata") == 0)) 142 | checked = TRUE; 143 | else 144 | if (flags & SegSelect::DATA_HINT) 145 | { 146 | // Filter out some common data types we normally don't want hinted 147 | static const char *filter[] = 148 | { 149 | "HEADER", ".rsrc", ".tls", ".reloc", 150 | }; 151 | static const int FILTERED = (sizeof(filter) / sizeof(const char *)); 152 | 153 | int j = 0; 154 | for (; j < FILTERED; j++) 155 | { 156 | if (strcmp(buffer, filter[j]) == 0) 157 | break; 158 | 159 | } 160 | checked = (j >= FILTERED); 161 | } 162 | } 163 | break; 164 | default: iconFile = ":/seglib/other_seg.png"; break; 165 | }; 166 | item->setIcon(QIcon(iconFile)); 167 | item->setCheckState(checked ? Qt::Checked : Qt::Unchecked); 168 | segmentTable->setItem(i, NAME, item); 169 | 170 | // Main types seen on PC are: CODE, DATA, XTRN, some times BSS 171 | // Oddity in IDA the get_segm_class() will be 'DATA' for .idata segs even 172 | // though they are the type SEG_XTRN. 173 | // Going by type instead: 174 | static const char *typeName[] = 175 | { 176 | "NORM", // 0 177 | "XTRN", // 1 * 178 | "CODE", // 2 * 179 | "DATA", // 3 * 180 | "JVIMP", // 4 181 | "???", // 5 182 | "GROUP", // 6 183 | "NULL", // 7 184 | "UNDEF", // 8 185 | "BSS", // 9 * 186 | "ABSSYM", // 10 187 | "COMM", // 11 188 | "IMEM " // 12 189 | }; 190 | //if (get_segm_class(seg, buffer, SIZESTR(buffer)) <= 0) 191 | // strcpy(buffer, "none"); 192 | if (seg->type <= 12) 193 | segmentTable->setItem(i, TYPE, new QTableWidgetItem(typeName[seg->type])); 194 | else 195 | segmentTable->setItem(i, TYPE, new QTableWidgetItem("???")); 196 | 197 | // Flags "RWE" 198 | strcpy(buffer, "[...]"); 199 | if (seg->perm & SEGPERM_READ) buffer[1] = 'R'; 200 | if (seg->perm & SEGPERM_WRITE) buffer[2] = 'W'; 201 | if (seg->perm & SEGPERM_EXEC) buffer[3] = 'E'; 202 | segmentTable->setItem(i, FLAGS, new QTableWidgetItem(buffer)); 203 | 204 | // Start - End, Size 205 | sprintf(buffer, startFormat, seg->start_ea); 206 | segmentTable->setItem(i, START, new QTableWidgetItem(buffer)); 207 | sprintf(buffer, endFormat, seg->end_ea); 208 | segmentTable->setItem(i, END, new QTableWidgetItem(buffer)); 209 | sprintf(buffer, sizeFormat, seg->size()); 210 | segmentTable->setItem(i, SIZE, new QTableWidgetItem(buffer)); 211 | 212 | //segmentTable->verticalHeader()->resizeSection(i, ROW_HEIGHT); 213 | } 214 | 215 | // Restore per session geometry 216 | if (geom.bottom() != -1) 217 | setGeometry(geom); 218 | 219 | segmentTable->resizeRowsToContents(); 220 | segmentTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); 221 | segmentTable->resizeColumnsToContents(); 222 | segmentTable->setUpdatesEnabled(TRUE); 223 | 224 | // Optionally set a Qt CSS type style sheet 225 | if (styleSheet && styleSheet[0]) 226 | { 227 | // Load from file? 228 | if (strncmp(styleSheet, "url(", 4) == 0) 229 | { 230 | QString fn(styleSheet + (sizeof("url(") - 1)); 231 | fn.chop(1); 232 | 233 | QFile f(fn); 234 | if (f.open(QFile::ReadOnly | QFile::Text)) 235 | setStyleSheet(QTextStream(&f).readAll()); 236 | } 237 | else 238 | setStyleSheet(styleSheet); 239 | } 240 | 241 | segmentTable->connect(segmentTable, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(onDoubleRowClick(int, int))); 242 | } 243 | else 244 | msg(__FUNCTION__": No segments in this IDB?\n"); 245 | } 246 | 247 | // Toggle check box on double click row 248 | void SegmentDialog::onDoubleRowClick(int row, int column) 249 | { 250 | if (QTableWidgetItem *item = segmentTable->item(row, 0)) 251 | item->setCheckState((item->checkState() == Qt::Checked) ? Qt::Unchecked : Qt::Checked); 252 | } 253 | 254 | SegSelect::segments *SegmentDialog::getSelected() 255 | { 256 | SegSelect::segments *result = new SegSelect::segments(); 257 | int count = segmentTable->rowCount(); 258 | for (int i = 0; i < count; i++) 259 | { 260 | if (QTableWidgetItem *item = segmentTable->item(i, 0)) 261 | if (item->checkState() == Qt::Checked) 262 | result->push_front(getnseg(i)); 263 | } 264 | return(result); 265 | } 266 | 267 | 268 | // Do segment selection dialog 269 | SegSelect::segments *SegSelect::select(UINT flags, LPCSTR title, LPCSTR styleSheet, LPCSTR icon) 270 | { 271 | SegSelect::segments *result = NULL; 272 | try 273 | { 274 | SegmentDialog *dlg = new SegmentDialog(QApplication::activeWindow(), flags, title, styleSheet, icon); 275 | if (dlg->exec()) 276 | { 277 | // Save geometry for restoration during the plugin session 278 | dlg->saveGeometry(); 279 | 280 | // Return vector of segment pointers 281 | result = dlg->getSelected(); 282 | } 283 | delete dlg; 284 | } 285 | MYCATCH() 286 | return(result); 287 | } 288 | 289 | 290 | // Free segments vector returned by select() 291 | void SegSelect::free(segments *list) 292 | { 293 | if (list) 294 | { 295 | try 296 | { 297 | delete list; 298 | } 299 | MYCATCH() 300 | } 301 | } 302 | 303 | // Convenience export of the static Qt function "QApplication::processEvents();" to tick IDA's main msg pump 304 | void SegSelect::processIdaEvents() { QApplication::processEvents(); } 305 | 306 | 307 | 308 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/SegSelect.h: -------------------------------------------------------------------------------- 1 | 2 | // SegSelect: IDA Pro Qt multi-segment select dialog 3 | // By Sirmabus 2015 4 | // Version 1.2 5 | // Docs: http://www.macromonkey.com/ida-waitboxex/ 6 | // License: Qt 5.6.0 LGPL 7 | #pragma once 8 | 9 | #ifndef _LIB 10 | #ifndef __EA64__ 11 | #ifndef _DEBUG 12 | #pragma comment(lib, "SegSelect.LiB") 13 | #else 14 | #pragma comment(lib, "SegSelectD.LiB") 15 | #endif 16 | #else 17 | #ifndef _DEBUG 18 | #pragma comment(lib, "SegSelect64.LiB") 19 | #else 20 | #pragma comment(lib, "SegSelect64D.LiB") 21 | #endif 22 | #endif 23 | #endif 24 | 25 | namespace SegSelect 26 | { 27 | // Option flags 28 | static const UINT CODE_HINT = (1 << 0); // Default check any code segment(s) 29 | static const UINT DATA_HINT = (1 << 1); // Default check any ".data" segment(s) 30 | static const UINT RDATA_HINT = (1 << 2); // "" ".rdata" segment(s) 31 | static const UINT XTRN_HINT = (1 << 3); // "" ".idata" type segment(s) 32 | 33 | typedef qlist segments; 34 | 35 | // Do segment selection dialog 36 | // Results are returned as a 'segments' vector pointer or NULL if canceled or none selected. 37 | // Call free() below to free up segments vector. 38 | segments *select(UINT flags, LPCSTR title = "Choose Segments", LPCSTR styleSheet = NULL, LPCSTR icon = NULL); 39 | 40 | // Free segments vector returned by select() 41 | void free(segments *list); 42 | 43 | // Convenience wrapper of Qt function "QApplication::processEvents();" to tick IDA's main window 44 | void processIdaEvents(); 45 | }; 46 | 47 | 48 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/SegSelectRes.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | code_seg.png 4 | data_seg.png 5 | extrn_seg.png 6 | idaq_seg.png 7 | other_seg.png 8 | 9 | 10 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/SegmentDialog.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | 6 | #include 7 | #include "ui_SegmentDialog.h" 8 | 9 | #define USE_DANGEROUS_FUNCTIONS 10 | #include 11 | #include 12 | #include "SegSelect.h" 13 | 14 | class SegmentDialog : public QDialog, public Ui::SegSelectDialog 15 | { 16 | Q_OBJECT 17 | public: 18 | SegmentDialog(QWidget *parent, UINT flags, LPCSTR title, LPCSTR styleSheet, LPCSTR icon); 19 | virtual ~SegmentDialog() { Q_CLEANUP_RESOURCE(SegSelectRes); } 20 | void saveGeometry() { geom = geometry(); } 21 | SegSelect::segments *getSelected(); 22 | 23 | private: 24 | static QRect geom; 25 | 26 | private slots: 27 | void onDoubleRowClick(int row, int column); 28 | }; 29 | 30 | 31 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/SegmentDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sirmabus 4 | SegSelectDialog 5 | 6 | 7 | Qt::WindowModal 8 | 9 | 10 | 11 | 0 12 | 0 13 | 588 14 | 204 15 | 16 | 17 | 18 | 19 | 0 20 | 0 21 | 22 | 23 | 24 | 25 | 400 26 | 120 27 | 28 | 29 | 30 | 31 | 0 32 | 0 33 | 34 | 35 | 36 | 37 | 0 38 | 0 39 | 40 | 41 | 42 | 43 | Tahoma 44 | 45 | 46 | 47 | 48 | 49 | 50 | true 51 | 52 | 53 | true 54 | 55 | 56 | 57 | 5 58 | 59 | 60 | QLayout::SetDefaultConstraint 61 | 62 | 63 | 0 64 | 65 | 66 | 0 67 | 68 | 69 | 0 70 | 71 | 72 | 9 73 | 74 | 75 | 76 | 77 | 78 | 0 79 | 0 80 | 81 | 82 | 83 | QFrame::StyledPanel 84 | 85 | 86 | QFrame::Raised 87 | 88 | 89 | 90 | 0 91 | 92 | 93 | 0 94 | 95 | 96 | 0 97 | 98 | 99 | 0 100 | 101 | 102 | 0 103 | 104 | 105 | 106 | 107 | true 108 | 109 | 110 | 111 | 0 112 | 0 113 | 114 | 115 | 116 | 117 | 16777215 118 | 16777215 119 | 120 | 121 | 122 | 123 | Noto Sans 124 | 8 125 | 126 | 127 | 128 | Check the segment(s) you want to process. 129 | 130 | 131 | QFrame::StyledPanel 132 | 133 | 134 | QFrame::Plain 135 | 136 | 137 | 0 138 | 139 | 140 | QAbstractItemView::NoEditTriggers 141 | 142 | 143 | false 144 | 145 | 146 | false 147 | 148 | 149 | false 150 | 151 | 152 | QAbstractItemView::SingleSelection 153 | 154 | 155 | QAbstractItemView::SelectRows 156 | 157 | 158 | Qt::ElideRight 159 | 160 | 161 | false 162 | 163 | 164 | false 165 | 166 | 167 | false 168 | 169 | 170 | false 171 | 172 | 173 | false 174 | 175 | 176 | 177 | Names 178 | 179 | 180 | 181 | 182 | 183 | 184 | PreferAntialias 185 | 186 | 187 | 188 | AlignJustify|AlignBottom 189 | 190 | 191 | 192 | 193 | Type 194 | 195 | 196 | 197 | 198 | 199 | 200 | PreferAntialias 201 | 202 | 203 | 204 | AlignJustify|AlignBottom 205 | 206 | 207 | 208 | 209 | Flags 210 | 211 | 212 | 213 | 214 | 215 | 216 | PreferAntialias 217 | 218 | 219 | 220 | AlignJustify|AlignBottom 221 | 222 | 223 | 224 | 225 | Start 226 | 227 | 228 | 229 | 230 | 231 | 232 | PreferAntialias 233 | 234 | 235 | 236 | AlignJustify|AlignBottom 237 | 238 | 239 | 240 | 241 | End 242 | 243 | 244 | 245 | 246 | 247 | 248 | PreferAntialias 249 | 250 | 251 | 252 | AlignJustify|AlignBottom 253 | 254 | 255 | 256 | 257 | Size 258 | 259 | 260 | 261 | 262 | 263 | 264 | PreferAntialias 265 | 266 | 267 | 268 | AlignJustify|AlignBottom 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 0 281 | 0 282 | 283 | 284 | 285 | QFrame::StyledPanel 286 | 287 | 288 | QFrame::Raised 289 | 290 | 291 | 292 | 0 293 | 294 | 295 | 0 296 | 297 | 298 | 4 299 | 300 | 301 | 5 302 | 303 | 304 | 3 305 | 306 | 307 | 308 | 309 | Qt::Horizontal 310 | 311 | 312 | 313 | 40 314 | 20 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 0 324 | 0 325 | 326 | 327 | 328 | 329 | 0 330 | 26 331 | 332 | 333 | 334 | 335 | 16777215 336 | 26 337 | 338 | 339 | 340 | 341 | Noto Sans 342 | 10 343 | 344 | 345 | 346 | Qt::Horizontal 347 | 348 | 349 | QDialogButtonBox::NoButton 350 | 351 | 352 | false 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | buttonBox 365 | accepted() 366 | SegSelectDialog 367 | accept() 368 | 369 | 370 | 449 371 | 182 372 | 373 | 374 | 391 375 | 203 376 | 377 | 378 | 379 | 380 | buttonBox 381 | rejected() 382 | SegSelectDialog 383 | reject() 384 | 385 | 386 | 546 387 | 180 388 | 389 | 390 | 501 391 | 203 392 | 393 | 394 | 395 | 396 | 397 | onDoubleClickRow() 398 | 399 | 400 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/code_seg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_SegmentSelect/Lib/code_seg.png -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/data_seg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_SegmentSelect/Lib/data_seg.png -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/extrn_seg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_SegmentSelect/Lib/extrn_seg.png -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/idaq_seg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_SegmentSelect/Lib/idaq_seg.png -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/lib.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {99349809-55BA-4b9d-BF79-8FDBB0286EB3} 6 | ui 7 | 8 | 9 | {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} 10 | moc;h;cpp 11 | False 12 | 13 | 14 | {3fb17cc4-f550-430e-bab8-a753d1693789} 15 | cpp;moc 16 | False 17 | 18 | 19 | {ac36ff6d-414b-4a61-8720-c3260abf7659} 20 | cpp;moc 21 | False 22 | 23 | 24 | {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} 25 | qrc;* 26 | false 27 | 28 | 29 | 30 | 31 | 32 | Form Files 33 | 34 | 35 | Resource Files 36 | 37 | 38 | 39 | 40 | 41 | Generated Files\Debug 42 | 43 | 44 | Generated Files\Release 45 | 46 | 47 | Generated Files 48 | 49 | 50 | 51 | 52 | Generated Files 53 | 54 | 55 | 56 | 57 | 58 | Resource Files 59 | 60 | 61 | Resource Files 62 | 63 | 64 | Resource Files 65 | 66 | 67 | Resource Files 68 | 69 | 70 | Resource Files 71 | 72 | 73 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/lib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | PATH=$(QTDIR)\bin%3b$(PATH) 6 | 7 | 8 | PATH=$(QTDIR)\bin%3b$(PATH) 9 | 10 | 11 | PATH=$(QTDIR)\bin%3b$(PATH) 12 | 13 | 14 | PATH=$(QTDIR)\bin%3b$(PATH) 15 | 16 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/Lib/other_seg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_SegmentSelect/Lib/other_seg.png -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/SegSelect.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_SegmentSelect/SegSelect.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/SegSelect.h: -------------------------------------------------------------------------------- 1 | 2 | // SegSelect: IDA Pro Qt multi-segment select dialog 3 | // By Sirmabus 2015 4 | // Version 1.2 5 | // Docs: http://www.macromonkey.com/ida-waitboxex/ 6 | // License: Qt 5.6.0 LGPL 7 | #pragma once 8 | 9 | #ifndef _LIB 10 | #ifndef __EA64__ 11 | #ifndef _DEBUG 12 | #pragma comment(lib, "SegSelect.LiB") 13 | #else 14 | #pragma comment(lib, "SegSelectD.LiB") 15 | #endif 16 | #else 17 | #ifndef _DEBUG 18 | #pragma comment(lib, "SegSelect64.LiB") 19 | #else 20 | #pragma comment(lib, "SegSelect64D.LiB") 21 | #endif 22 | #endif 23 | #endif 24 | 25 | namespace SegSelect 26 | { 27 | // Option flags 28 | static const UINT CODE_HINT = (1 << 0); // Default check any code segment(s) 29 | static const UINT DATA_HINT = (1 << 1); // Default check any ".data" segment(s) 30 | static const UINT RDATA_HINT = (1 << 2); // "" ".rdata" segment(s) 31 | static const UINT XTRN_HINT = (1 << 3); // "" ".idata" type segment(s) 32 | 33 | typedef qlist segments; 34 | 35 | // Do segment selection dialog 36 | // Results are returned as a 'segments' vector pointer or NULL if canceled or none selected. 37 | // Call free() below to free up segments vector. 38 | segments *select(UINT flags, LPCSTR title = "Choose Segments", LPCSTR styleSheet = NULL, LPCSTR icon = NULL); 39 | 40 | // Free segments vector returned by select() 41 | void free(segments *list); 42 | 43 | // Convenience wrapper of Qt function "QApplication::processEvents();" to tick IDA's main window 44 | void processIdaEvents(); 45 | }; 46 | 47 | 48 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/SegSelect64.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_SegmentSelect/SegSelect64.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/SegSelect64D.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_SegmentSelect/SegSelect64D.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_SegmentSelect/SegSelectD.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_SegmentSelect/SegSelectD.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/IDA_WaitBoxEx.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.33214.272 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin Example", "Plugin Example\Plugin Example.vcxproj", "{4B47C3F8-33A6-4A56-B165-57A636EC0E9A}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {22222222-2222-2222-2222-222222222222} = {22222222-2222-2222-2222-222222222222} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Library", "Lib\lib.vcxproj", "{22222222-2222-2222-2222-222222222222}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|x64 = Debug|x64 16 | DebugEA64|x64 = DebugEA64|x64 17 | MDS Debug|x64 = MDS Debug|x64 18 | MDS DebugEA64|x64 = MDS DebugEA64|x64 19 | MDS Release|x64 = MDS Release|x64 20 | MSD ReleaseEA64|x64 = MSD ReleaseEA64|x64 21 | Release|x64 = Release|x64 22 | ReleaseEA64|x64 = ReleaseEA64|x64 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {4B47C3F8-33A6-4A56-B165-57A636EC0E9A}.Debug|x64.ActiveCfg = Debug|x64 26 | {4B47C3F8-33A6-4A56-B165-57A636EC0E9A}.DebugEA64|x64.ActiveCfg = DebugEA64|x64 27 | {4B47C3F8-33A6-4A56-B165-57A636EC0E9A}.MDS Debug|x64.ActiveCfg = MDS Debug|x64 28 | {4B47C3F8-33A6-4A56-B165-57A636EC0E9A}.MDS DebugEA64|x64.ActiveCfg = MDS DebugEA64|x64 29 | {4B47C3F8-33A6-4A56-B165-57A636EC0E9A}.MDS Release|x64.ActiveCfg = MDS Release|x64 30 | {4B47C3F8-33A6-4A56-B165-57A636EC0E9A}.MSD ReleaseEA64|x64.ActiveCfg = MSD ReleaseEA64|x64 31 | {4B47C3F8-33A6-4A56-B165-57A636EC0E9A}.Release|x64.ActiveCfg = MDS Release|x64 32 | {4B47C3F8-33A6-4A56-B165-57A636EC0E9A}.ReleaseEA64|x64.ActiveCfg = ReleaseEA64|x64 33 | {22222222-2222-2222-2222-222222222222}.Debug|x64.ActiveCfg = Debug|x64 34 | {22222222-2222-2222-2222-222222222222}.Debug|x64.Build.0 = Debug|x64 35 | {22222222-2222-2222-2222-222222222222}.DebugEA64|x64.ActiveCfg = DebugEA64|x64 36 | {22222222-2222-2222-2222-222222222222}.DebugEA64|x64.Build.0 = DebugEA64|x64 37 | {22222222-2222-2222-2222-222222222222}.MDS Debug|x64.ActiveCfg = MDS Debug|x64 38 | {22222222-2222-2222-2222-222222222222}.MDS Debug|x64.Build.0 = MDS Debug|x64 39 | {22222222-2222-2222-2222-222222222222}.MDS DebugEA64|x64.ActiveCfg = MDS DebugEA64|x64 40 | {22222222-2222-2222-2222-222222222222}.MDS DebugEA64|x64.Build.0 = MDS DebugEA64|x64 41 | {22222222-2222-2222-2222-222222222222}.MDS Release|x64.ActiveCfg = MDS Release|x64 42 | {22222222-2222-2222-2222-222222222222}.MDS Release|x64.Build.0 = MDS Release|x64 43 | {22222222-2222-2222-2222-222222222222}.MSD ReleaseEA64|x64.ActiveCfg = MSD ReleaseEA64|x64 44 | {22222222-2222-2222-2222-222222222222}.Release|x64.ActiveCfg = Release|x64 45 | {22222222-2222-2222-2222-222222222222}.ReleaseEA64|x64.ActiveCfg = ReleaseEA64|x64 46 | {22222222-2222-2222-2222-222222222222}.ReleaseEA64|x64.Build.0 = ReleaseEA64|x64 47 | EndGlobalSection 48 | GlobalSection(SolutionProperties) = preSolution 49 | HideSolutionNode = FALSE 50 | EndGlobalSection 51 | GlobalSection(ExtensibilityGlobals) = postSolution 52 | SolutionGuid = {91BC338E-D142-439E-A147-6405D544AE71} 53 | Qt5Version = 5.6.0 54 | EndGlobalSection 55 | EndGlobal 56 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/IDA_WaitBoxEx.txt: -------------------------------------------------------------------------------- 1 | 2 | IDA WaitBoxEx: 3 | Version 1.5, April 2018 4 | By Sirmabus 5 | A full featured IDA Pro wait box replacement with progress bar and 6 | customization options. 7 | 8 | Features: 9 | 1) A "determinate" or "indeterminate" progress bar. 10 | 2) A minimize button. 11 | 3) Facilitates Qt CSS style sheets application for customization. 12 | Here one can change colors, the font, positions, labels, add texture, etc. 13 | 4) Facilitates the changing of the titlebar icon for yet more customization. 14 | 5) A Windows 7 style taskbar progress indicator. 15 | 6) Low cancel-check overhead using the isUpdateTime() method. 16 | 17 | Fixes: 18 | 1) Fixes the IDA wait box and main window freeze/stall/hangup issue. 19 | 2) Wait box works as a direct child of the main window; avoiding the odd separate 20 | window you see when you tab/switched the default one. 21 | 3) Working "Cancel" button that instantly responds to user input. 22 | 4) The close 'X' button is enabled, acting as an alternate "Cancel" button. 23 | 24 | It's pretty much the same useage as the deault IDA "show_wait_box()". 25 | Example: 26 | #include "WaitBoxEx.h" 27 | 28 | WaitBox::show(); 29 | do 30 | { 31 | // Check if canceled and update progress 32 | if (WaitBox::isUpdateTime()) 33 | if (WaitBox::updateAndCancelCheck(progressPercent)) 34 | break; 35 | 36 | ... 37 | ... 38 | } 39 | while(I'm doing something); 40 | WaitBox::hide(); 41 | 42 | See the "Plugin Example" project. 43 | You do NOT need to have Qt installed to use it. 44 | But you'll need it if you want to make modifications. 45 | 46 | See for more info: 47 | http://www.macromonkey.com/waitboxex-ida-pro-sdk-show_wait_box-replacement/ 48 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/Lib/MyQProgressDialog.h: -------------------------------------------------------------------------------- 1 | 2 | // Subclass of QProgressDialog for customization 3 | #pragma once 4 | 5 | #define WIN32_LEAN_AND_MEAN 6 | #define WINVER 0x0601 // _WIN32_WINNT_WIN7 7 | #define _WIN32_WINNT 0x0601 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | class MyQProgressDialog : public QProgressDialog 20 | { 21 | Q_OBJECT 22 | public: 23 | MyQProgressDialog(LPCSTR titleText, LPCSTR labelText, LPCSTR styleSheet, LPCSTR icon); 24 | ~MyQProgressDialog(); 25 | BOOL updateAndCancelCheck(int progress); 26 | BOOL isCanceled() { return(m_isCanceled); } 27 | 28 | private: 29 | void showEvent(QShowEvent *event); 30 | 31 | int m_lastProgress; 32 | BOOL m_isCanceled, m_indeterminateMode; 33 | HHOOK m_hMouseHook, m_hWinHook; 34 | HANDLE m_hTimerQueue, m_hUpdateTimer; 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/Lib/PropertySheet.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | C:\Program Files\IDA Pro 8.2\ 6 | C:\Qt\5.15.2-x64\ 7 | ..\..\..\idasdk_pro82\ 8 | 9 | 10 | 11 | 12 | 13 | $(IDADIR) 14 | 15 | 16 | $(QTDIR) 17 | 18 | 19 | $(IDASDK) 20 | 21 | 22 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/Lib/WaitBoxEx.cpp: -------------------------------------------------------------------------------- 1 | 2 | // WaitBoxEx: Custom IDA Pro wait box 3 | // By Sirmabus 4 | // http://www.macromonkey.com 5 | // License: Qt LGPL 6 | #define WIN32_LEAN_AND_MEAN 7 | #define WINVER 0x0601 // _WIN32_WINNT_WIN7 8 | #define _WIN32_WINNT 0x0601 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | // IDA SDK Qt libs 21 | #pragma comment(lib, "Qt5Core.lib") 22 | #pragma comment(lib, "Qt5Gui.lib") 23 | #pragma comment(lib, "Qt5Widgets.lib") 24 | 25 | // Nix the many warning about int type conversions 26 | #pragma warning(push) 27 | #pragma warning(disable:4244) 28 | #pragma warning(disable:4267) 29 | #include 30 | #include 31 | #pragma warning(pop) 32 | 33 | #include "WaitBoxEx.h" 34 | #include "WinTaskProgress.h" 35 | #include "MyQProgressDialog.h" 36 | 37 | // Alternate "Material design" inspired style 38 | #ifdef MATERIAL_DESIGN_STYLE 39 | #pragma message("* Material design style build *") 40 | #endif 41 | 42 | static const int DAILOG_WIDTH = 250, DAILOG_HEIGHT = 105; 43 | static const int BUTTON_WIDTH = 90, BUTTON_HEIGHT = 25; 44 | static const char FONT[] = { "Tahoma" }; 45 | static const UINT SHOW_DELAY = (2 * 1000); 46 | static const UINT TARGET_UPDATE_MS = 100; 47 | #ifndef MATERIAL_DESIGN_STYLE 48 | static const LPCSTR CANCEL = "Cancel"; 49 | #else 50 | static const LPCSTR CANCEL = "CANCEL"; 51 | #endif 52 | 53 | static BOOL showState = FALSE, isUpdateReady = TRUE; 54 | static MyQProgressDialog *prgDlg = NULL; 55 | 56 | #undef MYCATCH 57 | #define MYCATCH() catch (...) { msg("** Exception in WaitBoxEx method: %s()! ***\n", __FUNCTION__); } 58 | 59 | // QT_NO_UNICODE_LITERAL must be defined (best in preprocessor setting) 60 | // So Qt doesn't a static string pool that will cause IDA to crash on unload 61 | #ifndef QT_NO_UNICODE_LITERAL 62 | # error QT_NO_UNICODE_LITERAL must be defined to avoid Qt string crashes 63 | #endif 64 | 65 | static HWND WINAPI getIdaHwnd() 66 | { 67 | static HWND mainHwnd = nullptr; 68 | if (!mainHwnd) 69 | { 70 | foreach(QWidget *w, QApplication::topLevelWidgets()) 71 | { 72 | if (QMainWindow *mw = qobject_cast(w)) 73 | { 74 | mainHwnd = HWND(mw->winId()); 75 | break; 76 | } 77 | } 78 | } 79 | return mainHwnd; 80 | } 81 | 82 | static void CALLBACK timerTick(PVOID lpParam, BOOLEAN TimerOrWaitFired) 83 | { 84 | isUpdateReady = TRUE; 85 | } 86 | 87 | // Consume left mouse clicks on title bar to make it undraggable 88 | static LRESULT CALLBACK mouseHook(int nCode, WPARAM wParam, LPARAM lParam) 89 | { 90 | if (nCode == HC_ACTION) 91 | if ((wParam == WM_NCLBUTTONDOWN) && (((LPMOUSEHOOKSTRUCT) lParam)->wHitTestCode == HTCAPTION)) 92 | return(TRUE); 93 | return(CallNextHookEx(NULL, nCode, wParam, lParam)); 94 | } 95 | 96 | // Make the IDA window minimize when the dialog does 97 | // Because of windowslog+M eventFilter() won't do 98 | static LRESULT CALLBACK msgHook(int nCode, WPARAM wParam, LPARAM lParam) 99 | { 100 | if (nCode == HC_ACTION) 101 | { 102 | LPCWPSTRUCT ms = (LPCWPSTRUCT)lParam; 103 | if (ms->message == WM_SIZE) 104 | { 105 | if (prgDlg && (ms->hwnd == (HWND) prgDlg->winId())) 106 | { 107 | if (ms->wParam == SIZE_MINIMIZED) 108 | ::ShowWindow(getIdaHwnd(), SW_MINIMIZE); 109 | else 110 | if (ms->wParam == SIZE_RESTORED) 111 | ::ShowWindow(getIdaHwnd(), SW_SHOW); 112 | } 113 | } 114 | } 115 | return(CallNextHookEx(NULL, nCode, wParam, lParam)); 116 | } 117 | 118 | 119 | // Subclass QProgressDialog() 120 | MyQProgressDialog::MyQProgressDialog(LPCSTR titleText, LPCSTR labelText, LPCSTR styleSheet, LPCSTR icon) : 121 | QProgressDialog(labelText, CANCEL, 0, 100, QApplication::activeWindow(), 0), m_isCanceled(FALSE), m_indeterminateMode(FALSE), m_lastProgress(-1), 122 | m_hMouseHook(NULL), m_hWinHook(NULL), m_hTimerQueue(NULL), m_hUpdateTimer(NULL) 123 | { 124 | setWindowTitle(titleText); 125 | setAutoReset(FALSE); 126 | setAutoClose(FALSE); 127 | setWindowModality(Qt::WindowModal); 128 | setFixedSize(DAILOG_WIDTH, DAILOG_HEIGHT); 129 | setSizeGripEnabled(FALSE); 130 | 131 | // Qt::Tool -- Smaller title bar with smaller 'X' 132 | // Qt::Popup -- Boarderless 133 | // Qt::SubWindow -- Nonmodal on top with no background 134 | //setWindowFlags(Qt::Tool); 135 | // Nix the title bar help button 136 | setWindowFlags((windowFlags() & ~Qt::WindowContextHelpButtonHint) | Qt::WindowMinimizeButtonHint); 137 | 138 | // This time must elapse before dialog shows (default 4sec) 139 | setMinimumDuration(SHOW_DELAY); 140 | 141 | // Set dialog font (and children inherit) 142 | QFont fnt(FONT, 10, QFont::Normal); 143 | fnt.setStyleStrategy(QFont::PreferAntialias); 144 | setFont(fnt); 145 | 146 | // Put the progress text in the middle 147 | if (QProgressBar *bar = findChild()) 148 | bar->setAlignment(Qt::AlignCenter); 149 | 150 | // Optionally set Qt style sheet 151 | if (styleSheet && styleSheet[0]) 152 | { 153 | // From a file? 154 | if (strncmp(styleSheet, "url(", 4) == 0) 155 | { 156 | QString fn(styleSheet + (sizeof("url(") - 1)); 157 | fn.chop(1); 158 | 159 | QFile f(fn); 160 | if (f.open(QFile::ReadOnly | QFile::Text)) 161 | setStyleSheet(QTextStream(&f).readAll()); 162 | } 163 | else 164 | // No, string 165 | setStyleSheet(styleSheet); 166 | } 167 | 168 | // Optionally set titlebar icon 169 | if (icon && icon[0]) 170 | setWindowIcon(QIcon(icon)); 171 | 172 | // Progress 0 for the control to setup internally 173 | setValue(0); 174 | 175 | // Start update interval timer 176 | if (m_hTimerQueue = CreateTimerQueue()) 177 | CreateTimerQueueTimer(&m_hUpdateTimer, m_hTimerQueue, (WAITORTIMERCALLBACK) timerTick, NULL, TARGET_UPDATE_MS, TARGET_UPDATE_MS, 0); 178 | _ASSERT(m_hUpdateTimer != NULL); 179 | } 180 | 181 | MyQProgressDialog::~MyQProgressDialog() 182 | { 183 | if (m_hUpdateTimer) 184 | { 185 | DeleteTimerQueueTimer(m_hTimerQueue, m_hUpdateTimer, NULL); 186 | m_hUpdateTimer = NULL; 187 | } 188 | 189 | if (m_hTimerQueue) 190 | { 191 | DeleteTimerQueueEx(m_hTimerQueue, NULL); 192 | m_hTimerQueue = NULL; 193 | } 194 | 195 | if (m_hWinHook) 196 | { 197 | UnhookWindowsHookEx(m_hWinHook); 198 | m_hWinHook = NULL; 199 | } 200 | 201 | if (m_hMouseHook) 202 | { 203 | UnhookWindowsHookEx(m_hMouseHook); 204 | m_hMouseHook = NULL; 205 | } 206 | } 207 | 208 | 209 | // Have to wait till the dialog is actually shown to tweak some things 210 | void MyQProgressDialog::showEvent(QShowEvent *event) 211 | { 212 | QProgressDialog::showEvent(event); 213 | 214 | // Size and position cancel button 215 | if (QPushButton *button = findChild()) 216 | { 217 | button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); 218 | button->setFixedSize(BUTTON_WIDTH, BUTTON_HEIGHT); 219 | #ifndef MATERIAL_DESIGN_STYLE 220 | const int FROM_BOTTOM = 6; 221 | #else 222 | const int FROM_BOTTOM = 10; 223 | #endif 224 | button->move(((DAILOG_WIDTH - BUTTON_WIDTH) / 2), ((DAILOG_HEIGHT - BUTTON_HEIGHT) - FROM_BOTTOM)); 225 | } 226 | 227 | // Size and position progress bar 228 | if (QProgressBar *bar = findChild()) 229 | { 230 | bar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); 231 | const int BAR_WIDTH = 232; 232 | #ifndef MATERIAL_DESIGN_STYLE 233 | bar->setFixedSize(BAR_WIDTH, 21); 234 | #else 235 | bar->setFixedSize(BAR_WIDTH, 4); 236 | #endif 237 | bar->move(((DAILOG_WIDTH - BAR_WIDTH) / 2), 40); // 41 238 | } 239 | 240 | // Hook locally some windows events 241 | m_hMouseHook = SetWindowsHookEx(WH_MOUSE, mouseHook, NULL, GetCurrentThreadId()); 242 | m_hWinHook = SetWindowsHookEx(WH_CALLWNDPROC, msgHook, NULL, GetCurrentThreadId()); 243 | _ASSERT((m_hMouseHook != NULL) && (m_hWinHook != NULL)); 244 | } 245 | 246 | 247 | // Show the modal wait box dialog 248 | void _cdecl WaitBox::show(LPCSTR titleText, LPCSTR labelText, LPCSTR styleSheet, LPCSTR icon) 249 | { 250 | if (!showState) 251 | { 252 | try 253 | { 254 | // Create the dialog 255 | if (prgDlg = new MyQProgressDialog(titleText, labelText, styleSheet, icon)) 256 | { 257 | // Taskbar progress 258 | showState = isUpdateReady = TRUE; 259 | TaskProgress::start(getIdaHwnd()); 260 | TaskProgress::setTrackingWindow((HWND) prgDlg->winId()); 261 | } 262 | } 263 | MYCATCH() 264 | } 265 | } 266 | 267 | // Stop the wait box 268 | void _cdecl WaitBox::hide() 269 | { 270 | if (showState) 271 | { 272 | showState = FALSE; 273 | try 274 | { 275 | TaskProgress::end(); 276 | if (prgDlg) 277 | { 278 | prgDlg->close(); 279 | delete prgDlg; 280 | prgDlg = NULL; 281 | } 282 | } 283 | MYCATCH() 284 | } 285 | } 286 | 287 | // Returns TRUE if wait box is up 288 | BOOL _cdecl WaitBox::isShowing() 289 | { 290 | return(showState && (prgDlg && !prgDlg->isCanceled())); 291 | } 292 | 293 | // Returns TRUE if wait box is up 294 | BOOL _cdecl WaitBox::isUpdateTime(){ return(isUpdateReady); } 295 | 296 | // Set the label text 297 | void _cdecl WaitBox::setLabelText(LPCSTR labelText) 298 | { 299 | try 300 | { 301 | if (prgDlg && labelText) 302 | prgDlg->setLabelText(labelText); 303 | } 304 | MYCATCH() 305 | } 306 | 307 | // Convenience export of the static Qt function "QApplication::processEvents();" to tick IDA's main msg pump 308 | void _cdecl WaitBox::processIdaEvents() { QApplication::processEvents(); } 309 | 310 | 311 | BOOL MyQProgressDialog::updateAndCancelCheck(int progress) 312 | { 313 | if (!m_isCanceled && isUpdateReady) 314 | { 315 | if (wasCanceled()) 316 | { 317 | m_isCanceled = isUpdateReady = TRUE; 318 | TaskProgress::end(); 319 | } 320 | else 321 | { 322 | isUpdateReady = FALSE; 323 | if (m_indeterminateMode || (progress == -1)) 324 | { 325 | if (!m_indeterminateMode) 326 | { 327 | // Switch to indeterminateMode mode 328 | m_indeterminateMode = TRUE; 329 | TaskProgress::setProgress(-1); 330 | setRange(0, 0); 331 | m_lastProgress = 1; 332 | } 333 | 334 | // Progress value has to fluctuate for Qt animations to occur 335 | setValue(m_lastProgress++); 336 | WaitBox::processIdaEvents(); 337 | } 338 | else 339 | { 340 | if (progress > 100) 341 | progress = 100; 342 | else 343 | // progress 0 is a special case 344 | if (progress < 1) 345 | progress = 1; 346 | 347 | if (progress != m_lastProgress) 348 | { 349 | setValue(progress); 350 | TaskProgress::setProgress(progress); 351 | m_lastProgress = progress; 352 | } 353 | } 354 | 355 | // Let Qt event queue have a tick 356 | WaitBox::processIdaEvents(); 357 | } 358 | } 359 | 360 | return(m_isCanceled); 361 | } 362 | 363 | // Check if user canceled and optionally the update progress too w/built-in timed update limiter. 364 | BOOL _cdecl WaitBox::updateAndCancelCheck(int progress) 365 | { 366 | if (showState) 367 | { 368 | if (prgDlg) 369 | { 370 | if (isUpdateReady) 371 | return(prgDlg->updateAndCancelCheck(progress)); 372 | else 373 | return(FALSE); 374 | } 375 | } 376 | return(FALSE); 377 | } 378 | 379 | 380 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/Lib/WaitBoxEx.h: -------------------------------------------------------------------------------- 1 | 2 | // WaitBoxEx: Custom IDA Pro wait box 3 | // By Sirmabus 4 | // Version 1.5 5 | // http://www.macromonkey.com 6 | // License: Qt LGPL 7 | #pragma once 8 | 9 | // Define MATERIAL_DESIGN_STYLE for a "material design" inspired style 10 | #ifndef _LIB 11 | #ifndef MATERIAL_DESIGN_STYLE 12 | #ifndef __EA64__ 13 | #ifndef _DEBUG 14 | #pragma comment(lib, "WaitBoxEx.LiB") 15 | #else 16 | #pragma comment(lib, "WaitBoxExD.LiB") 17 | #endif 18 | #else 19 | #ifndef _DEBUG 20 | #pragma comment(lib, "WaitBoxEx64.LiB") 21 | #else 22 | #pragma comment(lib, "WaitBoxExD64.LiB") 23 | #endif 24 | #endif 25 | #else 26 | #ifndef __EA64__ 27 | #ifndef _DEBUG 28 | #pragma comment(lib, "WaitBoxExMd.LiB") 29 | #else 30 | #pragma comment(lib, "WaitBoxExMdD.LiB") 31 | #endif 32 | #else 33 | #ifndef _DEBUG 34 | #pragma comment(lib, "WaitBoxExMd64.LiB") 35 | #else 36 | #pragma comment(lib, "WaitBoxExMdD64.LiB") 37 | #endif 38 | #endif 39 | #endif // MATERIAL_DESIGN_STYLE 40 | #endif // _LIB 41 | 42 | namespace WaitBox 43 | { 44 | // Show the modal wait box dialog 45 | void show(LPCSTR titleText = "Progress", LPCSTR labelText = "Please wait..", LPCSTR styleSheet = NULL, LPCSTR icon = NULL); 46 | 47 | // Stop the wait box 48 | void hide(); 49 | 50 | // Check if user canceled and optionally the update progress too w/built-in timed update limiter. 51 | // Progress range: 0 to 100, or -1 to switch to indeterminate mode. 52 | BOOL updateAndCancelCheck(int progress = 0); 53 | 54 | 55 | // Returns TRUE if ready for internal update 56 | BOOL isUpdateTime(); 57 | 58 | // Returns TRUE if wait box up 59 | BOOL isShowing(); 60 | 61 | // Change the label text 62 | void setLabelText(LPCSTR labelText); 63 | 64 | // Convenience wrapper of Qt function "QApplication::processEvents();" to tick IDA's Qt event queue 65 | void processIdaEvents(); 66 | }; 67 | 68 | 69 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/Lib/WinTaskProgress.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Windows 7+ taskbar progress 3 | // Sirmabus 2015 4 | // http://www.macromonkey.com 5 | #define WIN32_LEAN_AND_MEAN 6 | #define WINVER _WIN32_WINNT_WIN7 7 | #define _WIN32_WINNT _WIN32_WINNT_WIN7 8 | #define _WIN32_IE_ _WIN32_WINNT_WIN7 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | // Nix the many warning about int type conversions 15 | #pragma warning(push) 16 | #pragma warning(disable:4244) 17 | #pragma warning(disable:4267) 18 | #include 19 | #include 20 | #include 21 | #include 22 | #pragma warning(pop) 23 | 24 | #include "WinTaskProgress.h" 25 | 26 | static UINT taskBarButtonMsg = RegisterWindowMessage("TaskbarButtonCreated"); 27 | static BOOL indeterminateMode = FALSE; 28 | static HWND hwndOwner = NULL, hwndTrack = NULL; 29 | static ITaskbarList3 *tbi = NULL; 30 | 31 | #undef MYCATCH 32 | #define MYCATCH() catch (...) { msg("** Exception in TaskProgress method: %s()! ***\n", __FUNCTION__); } 33 | 34 | // Make sure ITaskbarList3 is released on exit if end() wan't called 35 | struct OnExit 36 | { 37 | ~OnExit() { TaskProgress::end(); } 38 | } static onExit; 39 | 40 | void TaskProgress::start(HWND hwnd) 41 | { 42 | if (hwnd) 43 | { 44 | hwndTrack = NULL, indeterminateMode = FALSE; 45 | try 46 | { 47 | // Requires at least Windows 7 48 | if (IsWindows7OrGreater()) 49 | { 50 | // Just need to register the message for things to work 51 | // TODO: Could use a window hook off the main HWND to handle taskBarButtonMsg if really needed 52 | ChangeWindowMessageFilterEx(hwndOwner = hwnd, taskBarButtonMsg, MSGFLT_ALLOW, NULL); 53 | 54 | // Get ITaskbarList3 interface 55 | if (SUCCEEDED(CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&tbi)))) 56 | { 57 | if (SUCCEEDED(tbi->HrInit())) 58 | tbi->SetProgressState(hwndOwner, TBPF_NORMAL); 59 | else 60 | { 61 | tbi->Release(); 62 | tbi = NULL; 63 | } 64 | } 65 | } 66 | } 67 | MYCATCH() 68 | } 69 | } 70 | 71 | void TaskProgress::end() 72 | { 73 | if (tbi) 74 | { 75 | try 76 | { 77 | indeterminateMode = FALSE; 78 | if (hwndTrack) 79 | tbi->UnregisterTab(hwndTrack); 80 | tbi->SetProgressState(hwndOwner, TBPF_NOPROGRESS); 81 | tbi->Release(); 82 | tbi = NULL; 83 | } 84 | MYCATCH() 85 | } 86 | } 87 | 88 | void TaskProgress::setProgress(int progress) 89 | { 90 | if (tbi) 91 | { 92 | if (progress < 0) 93 | { 94 | // Note: Animation will not occur if animations are unchecked in Windows "Performance Options" 95 | tbi->SetProgressState(hwndOwner, TBPF_INDETERMINATE); 96 | indeterminateMode = TRUE; 97 | } 98 | else 99 | if (!indeterminateMode) 100 | { 101 | if (progress > 100) progress = 100; 102 | tbi->SetProgressValue(hwndOwner, (ULONG)progress, (ULONG)100); 103 | } 104 | } 105 | } 106 | 107 | void TaskProgress::setTrackingWindow(HWND hwnd) 108 | { 109 | try 110 | { 111 | if (tbi && hwnd) 112 | tbi->RegisterTab(hwndTrack = hwnd, hwndOwner); 113 | else 114 | hwndTrack = NULL; 115 | } 116 | MYCATCH() 117 | } 118 | 119 | 120 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/Lib/WinTaskProgress.h: -------------------------------------------------------------------------------- 1 | 2 | // Windows 7+ taskbar progress 3 | // Sirmabus 2015 4 | // http://www.macromonkey.com 5 | #pragma once 6 | 7 | namespace TaskProgress 8 | { 9 | void start(HWND hwnd); 10 | void end(); 11 | 12 | // Set current progress (from 0 to 100), or -1 to switch to indeterminate mode 13 | // Note: Indeterminate animation will not occur if animations are unchecked in Windows "Performance Options" 14 | void setProgress(int progress); 15 | 16 | // Set taskbar tracking/view window source 17 | void setTrackingWindow(HWND hwnd); 18 | }; -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/Lib/lib.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Taskbar 7 | 8 | 9 | Generated Files\MDS Release 10 | 11 | 12 | Generated Files\Debug 13 | 14 | 15 | Generated Files\Release 16 | 17 | 18 | Generated Files\MDS Debug 19 | 20 | 21 | Generated Files\ReleaseEA64 22 | 23 | 24 | Generated Files\MDS ReleaseEA64 25 | 26 | 27 | Generated Files\MDS DebugEA64 28 | 29 | 30 | Generated Files\DebugEA64 31 | 32 | 33 | 34 | 35 | {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} 36 | moc;h;cpp 37 | False 38 | 39 | 40 | {3fb17cc4-f550-430e-bab8-a753d1693789} 41 | cpp;moc 42 | False 43 | 44 | 45 | {ac36ff6d-414b-4a61-8720-c3260abf7659} 46 | False 47 | cpp;moc 48 | 49 | 50 | {684bc266-3dd5-4a5b-aa5b-933f723de5de} 51 | 52 | 53 | {7283a4d7-c3cf-4265-b276-01eb571f2131} 54 | cpp;moc 55 | False 56 | 57 | 58 | {adb34d0b-4873-49bf-b8d9-f92610d41b33} 59 | cpp;moc 60 | False 61 | 62 | 63 | {2411509d-48f7-4868-a7a5-e4e43a3cd7d3} 64 | 65 | 66 | {b0fce750-d1b2-4372-8fdd-665639b6775a} 67 | 68 | 69 | {bbeb1cff-1799-454f-8dfc-5e262d8badc0} 70 | 71 | 72 | {6ba0ce52-67ed-4c4b-91a6-943eee8db5b6} 73 | 74 | 75 | 76 | 77 | 78 | 79 | Taskbar 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/Lib/lib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | WindowsLocalDebugger 6 | PATH=$(QTDIR)\bin%3b$(PATH) 7 | 8 | 9 | WindowsLocalDebugger 10 | PATH=$(QTDIR)\bin%3b$(PATH) 11 | 12 | 13 | WindowsLocalDebugger 14 | PATH=$(QTDIR)\bin%3b$(PATH) 15 | 16 | 17 | WindowsLocalDebugger 18 | PATH=$(QTDIR)\bin%3b$(PATH) 19 | 20 | 21 | WindowsLocalDebugger 22 | PATH=$(QTDIR)\bin%3b$(PATH) 23 | 24 | 25 | WindowsLocalDebugger 26 | PATH=$(QTDIR)\bin%3b$(PATH) 27 | 28 | 29 | WindowsLocalDebugger 30 | PATH=$(QTDIR)\bin%3b$(PATH) 31 | 32 | 33 | WindowsLocalDebugger 34 | PATH=$(QTDIR)\bin%3b$(PATH) 35 | 36 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/Plugin Example/Plugin Example.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/Plugin Example/Plugin Example.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(_IDADIR)\ida.exe 5 | WindowsLocalDebugger 6 | 7 | 8 | $(_IDADIR)\ida64.exe 9 | WindowsLocalDebugger 10 | 11 | 12 | $(_IDADIR)\ida.exe 13 | WindowsLocalDebugger 14 | 15 | 16 | $(_IDADIR)\ida64.exe 17 | WindowsLocalDebugger 18 | 19 | 20 | $(_IDADIR)\ida.exe 21 | WindowsLocalDebugger 22 | 23 | 24 | $(_IDADIR)\ida64.exe 25 | WindowsLocalDebugger 26 | 27 | 28 | $(_IDADIR)\ida.exe 29 | WindowsLocalDebugger 30 | 31 | 32 | $(_IDADIR)\ida64.exe 33 | WindowsLocalDebugger 34 | 35 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/Plugin Example/WaitBoxEx_Example.cpp: -------------------------------------------------------------------------------- 1 | 2 | // IDA WaitEx plug-in examples 3 | // By Sirmabus 2015 4 | #define WIN32_LEAN_AND_MEAN 5 | #include 6 | 7 | // Minimal IDA SDK includes 8 | //#define PLUGIN_SUBMODULE 9 | #pragma warning(push) 10 | #pragma warning(disable:4244) 11 | #pragma warning(disable:4267) 12 | #include 13 | #include 14 | #pragma warning(pop) 15 | 16 | // Include this header in your project 17 | //#define MATERIAL_DESIGN_STYLE 18 | #include "WaitBoxEx.h" 19 | 20 | #define TEST_TIME_MS (6 * 1000) 21 | 22 | bool idaapi run(size_t arg) 23 | { 24 | /* 25 | It should take about two seconds for the boxes to show up. 26 | Why show a wait box if your plug-in completes in less then two seconds? 27 | This is a design feature (that's normally 4 seconds) built into QProgressDialog(). 28 | */ 29 | 30 | // ======== Determinate/normal progress 31 | msg("- Determinate progress example.\n"); 32 | 33 | // Start up the box with the defaults 34 | WaitBox::show(); 35 | for (int i = 0; i < 100; i++) 36 | { 37 | // Update the progress and check if canceled 38 | if (WaitBox::updateAndCancelCheck(i)) 39 | { 40 | // Bail out on cancel 41 | msg("* Determinate canceled *\n"); 42 | break; 43 | } 44 | 45 | Sleep(TEST_TIME_MS / 100); 46 | } 47 | // We're done, hide it 48 | WaitBox::hide(); 49 | 50 | // A little delay 51 | Sleep(1000); 52 | 53 | // ======== Indeterminate progress 54 | // When you can't determine, or otherwise when it's difficult to calculate, the scope of the progress 55 | msg("- Indeterminate progress example.\n"); 56 | 57 | // This time we'll also set the title and label 58 | WaitBox::show("Indeterminate", "Working.."); 59 | WaitBox::updateAndCancelCheck(-1); 60 | for (int i = 0; i < 100; i++) 61 | { 62 | // This is a preferred way as it has the least amount of overhead 63 | // (Just the overhead of a the call and single BOOL value check) 64 | // Particularity important if it were inside of a inner loop, and or 65 | // in the case where the progress calculation is relatively expensive. 66 | if (WaitBox::isUpdateTime()) 67 | { 68 | // Still need this call to check for cancel and to do the bar animation 69 | if (WaitBox::updateAndCancelCheck()) 70 | { 71 | msg("* Indeterminate canceled *\n"); 72 | break; 73 | } 74 | } 75 | 76 | Sleep(TEST_TIME_MS / 100); 77 | } 78 | WaitBox::hide(); 79 | Sleep(1000); 80 | 81 | // ======== With Qt style sheet visual customizations 82 | msg("- Progress with style.\n"); 83 | 84 | // Qt CSS style style-sheet 85 | static const char myStyle[] = 86 | { 87 | "QWidget {" 88 | "background-color: #336666;" 89 | "color: #ddeeee;" 90 | "font: bold;" 91 | "}" 92 | 93 | "QPushButton {" 94 | "background-color: #77bbbb;" 95 | "border-width: 2px;" 96 | "border-color: #448888;" 97 | "border-style: solid;" 98 | "border-radius: 5;" 99 | "padding: 3px;" 100 | "min-width: 9ex;" 101 | "min-height: 2.5ex;" 102 | "}" 103 | "QPushButton:hover {" 104 | "background-color: #99cccc;" 105 | "}" 106 | "QPushButton:pressed {" 107 | "background-color: #55aaaa;" 108 | "padding-left: 5px;" 109 | "padding-top: 5px;" 110 | "}" 111 | 112 | "QProgressBar {" 113 | "background-color: #77bbbb;" 114 | "border-width: 2px;" 115 | "border-color: #448888;" 116 | "border-style: solid;" 117 | "border-radius: 5;" 118 | "}" 119 | "QProgressBar::chunk {" 120 | "background-color: #ff8247;" 121 | "width: 10px;" 122 | "margin: 0.5px;" 123 | "}" 124 | }; 125 | 126 | WaitBox::show("Styled", "Please wait..", myStyle); 127 | for (int i = 0; i < 100; i++) 128 | { 129 | if (WaitBox::isUpdateTime()) 130 | { 131 | if (WaitBox::updateAndCancelCheck(i)) 132 | { 133 | msg("* Style example canceled *\n"); 134 | break; 135 | } 136 | } 137 | 138 | Sleep(TEST_TIME_MS / 100); 139 | } 140 | WaitBox::hide(); 141 | 142 | /* 143 | // IDA's built-in wait box 144 | msg("IDA wait box.\n"); 145 | show_wait_box("Please wait.."); 146 | for (int i = 0; i < 100; i++) 147 | { 148 | if (wasBreak()) 149 | { 150 | msg("* Canceled *\n"); 151 | break; 152 | } 153 | 154 | Sleep(TEST_TIME_MS / 100); 155 | } 156 | hide_wait_box(); 157 | */ 158 | 159 | msg("That's it for the WaitEx examples.\n\n"); 160 | return TRUE; 161 | } 162 | 163 | int idaapi init() 164 | { 165 | return PLUGIN_KEEP; 166 | } 167 | 168 | 169 | __declspec(dllexport) plugin_t PLUGIN = 170 | { 171 | IDP_INTERFACE_VERSION, 172 | PLUGIN_UNL, 173 | init, 174 | NULL, 175 | run, 176 | "", 177 | "", 178 | "IDA WaitEx example", 179 | NULL 180 | }; 181 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxEx.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxEx.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxEx.h: -------------------------------------------------------------------------------- 1 | 2 | // WaitBoxEx: Custom IDA Pro wait box 3 | // By Sirmabus 4 | // Version 1.5 5 | // http://www.macromonkey.com 6 | // License: Qt LGPL 7 | #pragma once 8 | 9 | // Define MATERIAL_DESIGN_STYLE for a "material design" inspired style 10 | #ifndef _LIB 11 | #ifndef MATERIAL_DESIGN_STYLE 12 | #ifndef __EA64__ 13 | #ifndef _DEBUG 14 | #pragma comment(lib, "WaitBoxEx.LiB") 15 | #else 16 | #pragma comment(lib, "WaitBoxExD.LiB") 17 | #endif 18 | #else 19 | #ifndef _DEBUG 20 | #pragma comment(lib, "WaitBoxEx64.LiB") 21 | #else 22 | #pragma comment(lib, "WaitBoxExD64.LiB") 23 | #endif 24 | #endif 25 | #else 26 | #ifndef __EA64__ 27 | #ifndef _DEBUG 28 | #pragma comment(lib, "WaitBoxExMd.LiB") 29 | #else 30 | #pragma comment(lib, "WaitBoxExMdD.LiB") 31 | #endif 32 | #else 33 | #ifndef _DEBUG 34 | #pragma comment(lib, "WaitBoxExMd64.LiB") 35 | #else 36 | #pragma comment(lib, "WaitBoxExMdD64.LiB") 37 | #endif 38 | #endif 39 | #endif // MATERIAL_DESIGN_STYLE 40 | #endif // _LIB 41 | 42 | namespace WaitBox 43 | { 44 | // Show the modal wait box dialog 45 | void show(LPCSTR titleText = "Progress", LPCSTR labelText = "Please wait..", LPCSTR styleSheet = NULL, LPCSTR icon = NULL); 46 | 47 | // Stop the wait box 48 | void hide(); 49 | 50 | // Check if user canceled and optionally the update progress too w/built-in timed update limiter. 51 | // Progress range: 0 to 100, or -1 to switch to indeterminate mode. 52 | BOOL updateAndCancelCheck(int progress = 0); 53 | 54 | 55 | // Returns TRUE if ready for internal update 56 | BOOL isUpdateTime(); 57 | 58 | // Returns TRUE if wait box up 59 | BOOL isShowing(); 60 | 61 | // Change the label text 62 | void setLabelText(LPCSTR labelText); 63 | 64 | // Convenience wrapper of Qt function "QApplication::processEvents();" to tick IDA's Qt event queue 65 | void processIdaEvents(); 66 | }; 67 | 68 | 69 | -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxEx.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxEx.pdb -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxEx64.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxEx64.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxEx64.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxEx64.pdb -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxExD.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxExD.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxExD.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxExD.pdb -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxExD64.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxExD64.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxExD64.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxExD64.pdb -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxExMd.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxExMd.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxExMd.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxExMd.pdb -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxExMd64.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxExMd64.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxExMd64.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxExMd64.pdb -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxExMdD.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxExMdD.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxExMdD.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxExMdD.pdb -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxExMdD64.LiB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxExMdD64.LiB -------------------------------------------------------------------------------- /ida-support-library-code/IDA_WaitEx/WaitBoxExMdD64.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitab/ClassInformer/b3cb3e800db7694fd9c1031ad0cf7ea8a25b44bb/ida-support-library-code/IDA_WaitEx/WaitBoxExMdD64.pdb -------------------------------------------------------------------------------- /ida-support-library-code/SupportLib/SupportLib.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{11111111-1111-1111-1111-111111111111}") = "Library", "SupportLib.vcxproj", "{22222222-2222-2222-2222-222222222222}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {22222222-2222-2222-2222-222222222222}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {22222222-2222-2222-2222-222222222222}.Debug|Win32.Build.0 = Debug|Win32 16 | {22222222-2222-2222-2222-222222222222}.Release|Win32.ActiveCfg = Release|Win32 17 | {22222222-2222-2222-2222-222222222222}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /ida-support-library-code/SupportLib/SupportLib.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | Library 15 | {22222222-2222-2222-2222-222222222222} 16 | OggPlayerLib 17 | Win32Proj 18 | 10.0.16299.0 19 | 20 | 21 | 22 | StaticLibrary 23 | v141 24 | NotSet 25 | false 26 | 27 | 28 | StaticLibrary 29 | v141 30 | NotSet 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | <_ProjectFileVersion>12.0.30501.0 44 | 45 | 46 | $(SolutionDir)$(Configuration)\ 47 | $(Configuration)\ 48 | true 49 | false 50 | support 51 | .LiB 52 | 53 | 54 | $(SolutionDir)$(Configuration)\ 55 | $(Configuration)\ 56 | false 57 | false 58 | support 59 | .LiB 60 | 61 | 62 | 63 | Disabled 64 | $(_IDADIR)\idasdk\include;$(SolutionDir);%(AdditionalIncludeDirectories) 65 | __X64__;_DEBUG;_WINDOWS;_LIB;__NT__;__IDP__;__VC__;NO_OBSOLETE_FUNCS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 66 | true 67 | Sync 68 | EnableFastChecks 69 | MultiThreadedDebug 70 | 71 | NoListing 72 | Level3 73 | EditAndContinue 74 | Cdecl 75 | false 76 | 77 | 78 | Windows 79 | true 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | Full 89 | Default 90 | true 91 | Speed 92 | $(_IDADIR)\idasdk\include;$(SolutionDir);%(AdditionalIncludeDirectories) 93 | __X64__;NDEBUG;_WINDOWS;_LIB;__NT__;__IDP__;__VC__;NO_OBSOLETE_FUNCS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 94 | true 95 | Sync 96 | MultiThreaded 97 | false 98 | NotSet 99 | 100 | NoListing 101 | Level3 102 | ProgramDatabase 103 | Cdecl 104 | false 105 | false 106 | 107 | 108 | Windows 109 | true 110 | true 111 | true 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | true 124 | true 125 | 126 | 127 | 128 | 129 | true 130 | true 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /ida-support-library-code/SupportLib/SupportLib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ida-support-library-code/SupportLib/Utility.h: -------------------------------------------------------------------------------- 1 | 2 | // **************************************************************************** 3 | // File: Utility.h 4 | // Desc: IDA utility support 5 | // Auth: Sirmabus 2015 6 | // Updated for IDA 7 7 | // **************************************************************************** 8 | #pragma once 9 | 10 | typedef double TIMESTAMP; 11 | #define SECOND 1 12 | #define MINUTE (60 * SECOND) 13 | #define HOUR (60 * MINUTE) 14 | #define DAY (HOUR * 24) 15 | 16 | void trace(const char *format, ...); 17 | TIMESTAMP getTimeStamp(); 18 | TIMESTAMP getTimeStampLow(); 19 | LPCSTR timeString(TIMESTAMP Time); 20 | LPSTR prettyNumberString(UINT64 n, __bcount(32) LPSTR buffer); 21 | LPCTSTR byteSizeString(UINT64 uSize); 22 | UINT getChracterLength(int strtype, UINT byteCount); 23 | void getDisasmText(ea_t ea, __out qstring &s); 24 | void idaFlags2String(flags_t f, __out qstring &s, BOOL withValue = FALSE); 25 | void dumpFlags(ea_t ea, BOOL withValue = FALSE); 26 | BOOL isHexStr(LPCSTR str); 27 | long fsize(FILE *fp); 28 | LPSTR replaceExtInPath(__inout_bcount(MAX_PATH) LPSTR path, __out LPSTR pathNew); 29 | ea_t find_binary2(ea_t start_ea, ea_t end_ea, LPCSTR pattern, LPCSTR file, int lineNumber); 30 | 31 | #define FIND_BINARY(_start, _end, _pattern) find_binary2((_start), (_end), (_pattern), __FILE__, __LINE__) 32 | //#define FIND_BINARY(_start, _end, _pattern) find_binary((_start), (_end), (_pattern), 16, (SEARCH_DOWN | SEARCH_NOBRK | SEARCH_NOSHOW)); 33 | 34 | // Return TRUE if at address is a string (ASCII, Unicode, etc.) 35 | inline BOOL isString(ea_t ea){ return(is_strlit(get_flags(ea))); } 36 | 37 | // Get string type by address 38 | // Should process the result with "get_str_type_code()" to filter any 39 | // potential string encoding from the base type. 40 | inline int getStringType(ea_t ea) 41 | { 42 | opinfo_t oi; 43 | if (get_opinfo(&oi, ea, 0, get_flags(ea))) 44 | return(oi.strtype); 45 | else 46 | return(STRTYPE_C); 47 | } 48 | 49 | // Size of string sans terminator 50 | #define SIZESTR(x) (sizeof(x) - 1) 51 | 52 | // Set object (data or function) alignment 53 | #define ALIGN(_x_) __declspec(align(_x_)) 54 | 55 | #define CATCH() catch (...) { msg("** Exception in %s()! ***\n", __FUNCTION__); } 56 | 57 | // Stack alignment trick, based on Douglas Walker's post 58 | // http://www.gamasutra.com/view/feature/3975/data_alignment_part_2_objects_on_.php 59 | #define STACKALIGN(name, type) \ 60 | BYTE space_##name[sizeof(type) + (16-1)]; \ 61 | type &name = *reinterpret_cast((UINT_PTR) (space_##name + (16-1)) & ~(16-1)) 62 | 63 | // Disable copy and assign in object definitions 64 | #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ 65 | TypeName(TypeName&) = delete; \ 66 | void operator=(TypeName) = delete; 67 | 68 | template inline void swap_t(T &a, T &b) 69 | { 70 | T c = a; 71 | a = b; 72 | b = c; 73 | } 74 | 75 | // ea_t zero padded hex number format 76 | #ifndef __EA64__ 77 | #define EAFORMAT "%08X" 78 | #define EAFORMAT2 "%X" 79 | #else 80 | #define EAFORMAT "%016I64X" 81 | #define EAFORMAT2 "%I64X" 82 | #endif 83 | 84 | // Now you can use the #pragma message to add the location of the message: 85 | // Examples: 86 | // #pragma message(__LOC__ "important part to be changed") 87 | // #pragma message(__LOC2__ "error C9901: wish that error would exist") 88 | #define __STR2__(x) #x 89 | #define __STR1__(x) __STR2__(x) 90 | #define __LOC__ __FILE__ "("__STR1__(__LINE__)") : Warning MSG: " 91 | #define __LOC2__ __FILE__ "("__STR1__(__LINE__)") : " 92 | 93 | // 32 bit flag sequential serializer 94 | struct SBITFLAG 95 | { 96 | inline SBITFLAG() : Index(0) {} 97 | inline UINT First(){ Index = 0; return(1 << Index++); } 98 | inline UINT Next(){ return(1 << Index++); } 99 | UINT Index; 100 | }; 101 | 102 | // Simple cache aligned expanding buffer 103 | // For the performance benefit of skipping of alloc/free calls plus base cache alignment 104 | template class SlideBuffer 105 | { 106 | public: 107 | SlideBuffer() : m_dataPtr(NULL), m_elementCount(0) 108 | { 109 | // Initial reserved buffer size if any 110 | if (t_reserveElementCount) 111 | get(t_reserveElementCount); 112 | } 113 | ~SlideBuffer(){ clear(); } 114 | 115 | // Get buffer expanding the size as needed, or NULL on allocation failure 116 | T *get(size_t wantedElementCount = 0) 117 | { 118 | if (wantedElementCount > m_elementCount) 119 | { 120 | // Attempt to create or expand as needed 121 | wantedElementCount += ((m_dataPtr == NULL) ? 0 : t_elementExpandSize); 122 | //msg("GrowBuffer: %08X expand from %u to %u element count.\n", m_dataPtr, m_elementCount, wantedElementCount); 123 | if (T *dataPtr = (T *)_aligned_realloc(m_dataPtr, (sizeof(T) * wantedElementCount), 16)) 124 | { 125 | m_dataPtr = dataPtr; 126 | m_elementCount = wantedElementCount; 127 | } 128 | else 129 | clear(); 130 | _ASSERT(m_dataPtr); 131 | } 132 | return(m_dataPtr); 133 | } 134 | 135 | // Free up buffer, a clear/reset operation 136 | void clear() 137 | { 138 | if (m_dataPtr) 139 | _aligned_free(m_dataPtr); 140 | m_dataPtr = NULL; 141 | m_elementCount = 0; 142 | } 143 | 144 | // Return element size of current buffer 145 | size_t size(){ return(m_elementCount); } 146 | 147 | private: 148 | DISALLOW_COPY_AND_ASSIGN(SlideBuffer); 149 | 150 | T *m_dataPtr; 151 | size_t m_elementCount; 152 | }; 153 | --------------------------------------------------------------------------------