diff --git a/Hex-Rays Plugin contest/2013/HexRaysCodeXplorer v1.0.pdf b/bin/Hex-Rays Plugin contest/2013/HexRaysCodeXplorer v1.0.pdf similarity index 100% rename from Hex-Rays Plugin contest/2013/HexRaysCodeXplorer v1.0.pdf rename to bin/Hex-Rays Plugin contest/2013/HexRaysCodeXplorer v1.0.pdf diff --git a/Hex-Rays Plugin contest/2013/HexRaysCodeXplorer.plw b/bin/Hex-Rays Plugin contest/2013/HexRaysCodeXplorer.plw similarity index 100% rename from Hex-Rays Plugin contest/2013/HexRaysCodeXplorer.plw rename to bin/Hex-Rays Plugin contest/2013/HexRaysCodeXplorer.plw diff --git a/bin/v1.2/win/HexRaysCodeXplorer.plw b/bin/v1.2/win/HexRaysCodeXplorer.plw new file mode 100644 index 0000000..b80c814 Binary files /dev/null and b/bin/v1.2/win/HexRaysCodeXplorer.plw differ diff --git a/sources/HexRaysCodeXplorer.v12.suo b/sources/HexRaysCodeXplorer.v12.suo deleted file mode 100644 index 9a819fc..0000000 Binary files a/sources/HexRaysCodeXplorer.v12.suo and /dev/null differ diff --git a/sources/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj b/sources/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj deleted file mode 100644 index aeb3756..0000000 --- a/sources/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj +++ /dev/null @@ -1,107 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {F7E6B557-41F3-444A-BCA4-3527547DD665} - Win32Proj - HexRaysCodeXplorer - HexRaysCodeXplorer - - - - DynamicLibrary - true - MultiByte - v110_xp - - - DynamicLibrary - false - true - MultiByte - v110 - - - - - - - - - - - - - true - build makefile - .plw - - - false - .plw - - - - - - Level3 - Disabled - __NT__;__IDP__;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(IDADIR)\idasdk64\include;$(IDADIR)\plugins\hexrays_sdk\include - MultiThreadedDebug - - - Console - true - ida.lib - /EXPORT:PLUGIN %(AdditionalOptions) - $(IDADIR)\idasdk64\lib\x86_win_vc_32 - - - - - Level3 - - - MaxSpeed - true - true - __NT__;__IDP__;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(IDADIR)\idasdk64\include;$(IDADIR)\plugins\hexrays_sdk\include - MultiThreaded - - - Console - true - true - true - ida.lib - /EXPORT:PLUGIN %(AdditionalOptions) - $(IDADIR)\idasdk64\lib\x86_win_vc_32 - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sources/HexRaysCodeXplorer.sln b/src/HexRaysCodeXplorer.sln similarity index 64% rename from sources/HexRaysCodeXplorer.sln rename to src/HexRaysCodeXplorer.sln index 375b23b..209e8d6 100644 --- a/sources/HexRaysCodeXplorer.sln +++ b/src/HexRaysCodeXplorer.sln @@ -1,18 +1,26 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30501.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HexRaysCodeXplorer", "HexRaysCodeXplorer\HexRaysCodeXplorer.vcxproj", "{F7E6B557-41F3-444A-BCA4-3527547DD665}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {F7E6B557-41F3-444A-BCA4-3527547DD665}.Debug|Win32.ActiveCfg = Debug|Win32 {F7E6B557-41F3-444A-BCA4-3527547DD665}.Debug|Win32.Build.0 = Debug|Win32 + {F7E6B557-41F3-444A-BCA4-3527547DD665}.Debug|x64.ActiveCfg = Debug|x64 + {F7E6B557-41F3-444A-BCA4-3527547DD665}.Debug|x64.Build.0 = Debug|x64 {F7E6B557-41F3-444A-BCA4-3527547DD665}.Release|Win32.ActiveCfg = Release|Win32 {F7E6B557-41F3-444A-BCA4-3527547DD665}.Release|Win32.Build.0 = Release|Win32 + {F7E6B557-41F3-444A-BCA4-3527547DD665}.Release|x64.ActiveCfg = Release|x64 + {F7E6B557-41F3-444A-BCA4-3527547DD665}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sources/HexRaysCodeXplorer.suo b/src/HexRaysCodeXplorer.suo similarity index 100% rename from sources/HexRaysCodeXplorer.suo rename to src/HexRaysCodeXplorer.suo diff --git a/sources/HexRaysCodeXplorer/CodeXplorer.cpp b/src/HexRaysCodeXplorer/CodeXplorer.cpp similarity index 96% rename from sources/HexRaysCodeXplorer/CodeXplorer.cpp rename to src/HexRaysCodeXplorer/CodeXplorer.cpp index d65b471..735dc4e 100644 --- a/sources/HexRaysCodeXplorer/CodeXplorer.cpp +++ b/src/HexRaysCodeXplorer/CodeXplorer.cpp @@ -190,22 +190,26 @@ static bool idaapi display_graph(void *ud) netnode id; id.create(); - // get function name - qstring title = gi->title;//"Funcion ctree graph"; + qstring title = gi->title; HWND hwnd = NULL; TForm *form = create_tform(title.c_str(), &hwnd); - gi->vu = (vdui_t *)ud; - gi->form = form; - gi->gv = create_graph_viewer(form, id, gr_callback, gi, 0); - open_tform(form, FORM_TAB | FORM_MENU | FORM_QWIDGET); - viewer_fit_window(gi->gv); + if (hwnd != NULL) + { + gi->vu = (vdui_t *)ud; + gi->form = form; + gi->gv = create_graph_viewer(form, id, gr_callback, gi, 0); + open_tform(form, FORM_TAB | FORM_MENU | FORM_QWIDGET); + + if (gi->gv != NULL) + viewer_fit_window(gi->gv); + } return true; } -// Get poinyter to func_t by routine name +// Get pointer to func_t by routine name func_t * get_func_by_name(const char *func_name) { func_t * result_func = NULL; @@ -247,7 +251,7 @@ static bool idaapi decompile_func(vdui_t &vu) { cexpr_t *e = (cexpr_t *)highlight; - // retireve the name of the routine + // retrieve the name of the routine char tmp[1024]; memset(tmp, 0x00, sizeof(tmp)); e->print1(tmp, sizeof(tmp), NULL); @@ -269,7 +273,7 @@ static bool idaapi decompile_func(vdui_t &vu) return true; } -//display Class Explorer +//display Object Explorer static bool idaapi display_objects(void *ud) { vdui_t &vu = *(vdui_t *)ud; diff --git a/sources/HexRaysCodeXplorer/Common.h b/src/HexRaysCodeXplorer/Common.h similarity index 100% rename from sources/HexRaysCodeXplorer/Common.h rename to src/HexRaysCodeXplorer/Common.h diff --git a/sources/HexRaysCodeXplorer/GraphBuilder..cpp b/src/HexRaysCodeXplorer/GraphBuilder..cpp similarity index 100% rename from sources/HexRaysCodeXplorer/GraphBuilder..cpp rename to src/HexRaysCodeXplorer/GraphBuilder..cpp diff --git a/sources/HexRaysCodeXplorer/GraphBuilder.cpp b/src/HexRaysCodeXplorer/GraphBuilder.cpp similarity index 94% rename from sources/HexRaysCodeXplorer/GraphBuilder.cpp rename to src/HexRaysCodeXplorer/GraphBuilder.cpp index d7452ca..9ef945a 100644 --- a/sources/HexRaysCodeXplorer/GraphBuilder.cpp +++ b/src/HexRaysCodeXplorer/GraphBuilder.cpp @@ -110,7 +110,12 @@ char * callgraph_t::get_node_label(int n, char *buf, int bufsize) const // For typed expressions, the third line will have // the expression type in human readable form APPCHAR(ptr, endp, '\n'); - if ( print_type_to_one_line(ptr, endp-ptr, idati, e->type.u_str()) != T_NORMAL ) + qstring out; + if (e->type.print(&out)) + { + APPEND(ptr, endp, out.c_str()); + } + else { // could not print the type? APPCHAR(ptr, endp, '?'); APPZERO(ptr, endp); @@ -118,12 +123,11 @@ char * callgraph_t::get_node_label(int n, char *buf, int bufsize) const if(e->type.is_ptr()) { - typestring ptr_rem = remove_pointer(e->type); + tinfo_t ptr_rem = remove_pointer(e->type); if(ptr_rem.is_struct()) { qstring typenm; - - print_type_to_qstring(&typenm, "prefix ", 0,0, PRTYPE_MULTI | PRTYPE_TYPE | PRTYPE_SEMI, idati, ptr_rem.u_str()); + ptr_rem.print(&typenm, "prefix ", 0, 0, PRTYPE_MULTI | PRTYPE_TYPE | PRTYPE_SEMI); } } } @@ -168,9 +172,8 @@ callgraph_t::nodeinfo_t *callgraph_t::get_info(int nid) if(pfn == highlighted) fi.color = 2000; else - fi.color = 1;//bgcolors.prolog_color;//calc_bg_color(pfn->startEA); + fi.color = 1; - //fi.ea = pfn->startEA; fi.ea = 0; it = cached_funcs.insert(cached_funcs.end(), std::make_pair(nid, fi)); @@ -255,7 +258,7 @@ bool graph_info_t::get_title(ea_t func_ea, size_t num_inst, qstring *out) if ( get_func_name(func_ea, func_name, sizeof(func_name)) == NULL ) return false; - out->sprnt("Call graph of: %s %d", func_name, num_inst); + out->sprnt("ctree graph of: %s %d", func_name, num_inst); return true; } diff --git a/sources/HexRaysCodeXplorer/GraphBuilder.h b/src/HexRaysCodeXplorer/GraphBuilder.h similarity index 99% rename from sources/HexRaysCodeXplorer/GraphBuilder.h rename to src/HexRaysCodeXplorer/GraphBuilder.h index 2786829..0a154ef 100644 --- a/sources/HexRaysCodeXplorer/GraphBuilder.h +++ b/src/HexRaysCodeXplorer/GraphBuilder.h @@ -24,6 +24,8 @@ #pragma once +#include "Common.h" + // function call graph creator class class callgraph_t { diff --git a/sources/HexRaysCodeXplorer/HexRaysCodeXplorer.cpp b/src/HexRaysCodeXplorer/HexRaysCodeXplorer.cpp similarity index 100% rename from sources/HexRaysCodeXplorer/HexRaysCodeXplorer.cpp rename to src/HexRaysCodeXplorer/HexRaysCodeXplorer.cpp diff --git a/sources/HexRaysCodeXplorer/HexRaysCodeXplorer.h b/src/HexRaysCodeXplorer/HexRaysCodeXplorer.h similarity index 100% rename from sources/HexRaysCodeXplorer/HexRaysCodeXplorer.h rename to src/HexRaysCodeXplorer/HexRaysCodeXplorer.h diff --git a/src/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj b/src/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj new file mode 100644 index 0000000..7eaa5b2 --- /dev/null +++ b/src/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj @@ -0,0 +1,183 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {F7E6B557-41F3-444A-BCA4-3527547DD665} + Win32Proj + HexRaysCodeXplorer + HexRaysCodeXplorer + + + + DynamicLibrary + true + MultiByte + v120 + + + DynamicLibrary + true + MultiByte + v120 + + + DynamicLibrary + false + true + MultiByte + v120 + + + DynamicLibrary + false + true + MultiByte + v120 + + + + + + + + + + + + + + + + + + + true + build makefile + .plw + + + true + build makefile + .plw + + + false + .plw + + + false + .p64 + + + + + + Level3 + Disabled + __NT__;__IDP__;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(IDADIR)\plugins\SDK\idasdk\include;$(IDADIR)\plugins\hexrays_sdk\include + MultiThreadedDebug + + + Console + true + ida.lib + /EXPORT:PLUGIN %(AdditionalOptions) + $(IDADIR)\plugins\SDK\idasdk\lib\x86_win_vc_32 + + + + + + + Level3 + Disabled + __NT__;__IDP__;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(IDADIR)\plugins\SDK\idasdk\include;$(IDADIR)\plugins\hexrays_sdk\include + MultiThreadedDebug + + + Console + true + ida.lib + /EXPORT:PLUGIN %(AdditionalOptions) + $(IDADIR)\plugins\SDK\idasdk\lib\x86_win_vc_32 + + + + + Level3 + + + MaxSpeed + true + true + __NT__;__IDP__;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(IDADIR)\plugins\SDK\idasdk\include;$(IDADIR)\plugins\hexrays_sdk\include + MultiThreaded + + + Console + true + true + true + ida.lib + /EXPORT:PLUGIN %(AdditionalOptions) + $(IDADIR)\plugins\SDK\idasdk\lib\x86_win_vc_32 + + + + + Level2 + + + MaxSpeed + true + true + __NT__;__IDP__;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(IDADIR)\plugins\SDK\idasdk\include;$(IDADIR)\plugins\hexrays_sdk\include + MultiThreaded + + + Console + true + true + true + ida.lib + /EXPORT:PLUGIN %(AdditionalOptions) + $(IDADIR)\plugins\SDK\idasdk\lib\x86_win_vc_64 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sources/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj.filters b/src/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj.filters similarity index 100% rename from sources/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj.filters rename to src/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj.filters diff --git a/sources/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj.user b/src/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj.user similarity index 53% rename from sources/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj.user rename to src/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj.user index f80fefa..1277e87 100644 --- a/sources/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj.user +++ b/src/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj.user @@ -4,8 +4,17 @@ $(IDADIR)\idaq.exe WindowsLocalDebugger + + $(IDADIR)\idaq.exe + WindowsLocalDebugger + $(IDADIR)\idaq.exe WindowsLocalDebugger + NativeOnly + + + $(IDADIR)\idaq64.exe + WindowsLocalDebugger \ No newline at end of file diff --git a/sources/HexRaysCodeXplorer/IdaGraphBuilder.cpp b/src/HexRaysCodeXplorer/IdaGraphBuilder.cpp similarity index 100% rename from sources/HexRaysCodeXplorer/IdaGraphBuilder.cpp rename to src/HexRaysCodeXplorer/IdaGraphBuilder.cpp diff --git a/sources/HexRaysCodeXplorer/IdaGraphBuilder.h b/src/HexRaysCodeXplorer/IdaGraphBuilder.h similarity index 100% rename from sources/HexRaysCodeXplorer/IdaGraphBuilder.h rename to src/HexRaysCodeXplorer/IdaGraphBuilder.h diff --git a/sources/HexRaysCodeXplorer/ObjectExplorer.cpp b/src/HexRaysCodeXplorer/ObjectExplorer.cpp similarity index 80% rename from sources/HexRaysCodeXplorer/ObjectExplorer.cpp rename to src/HexRaysCodeXplorer/ObjectExplorer.cpp index f266765..a58f603 100644 --- a/sources/HexRaysCodeXplorer/ObjectExplorer.cpp +++ b/src/HexRaysCodeXplorer/ObjectExplorer.cpp @@ -136,12 +136,12 @@ BOOL get_vtbl_info(ea_t ea_address, VTBL_info_t &vtbl_info) qvector vtbl_t_list; qvector vtbl_list; // list of vtables for ObjectExplrer view -static BOOL process_vtbl(ea_t &ea_rdata) +static BOOL process_vtbl(ea_t &ea_sect) { VTBL_info_t vftable_info_t; - if(get_vtbl_info(ea_rdata, vftable_info_t)) + if(get_vtbl_info(ea_sect, vftable_info_t)) { - ea_rdata = vftable_info_t.ea_end; + ea_sect = vftable_info_t.ea_end; ea_t ea_assumed; verify_32_t((vftable_info_t.ea_begin - 4), ea_assumed); @@ -164,7 +164,7 @@ static BOOL process_vtbl(ea_t &ea_rdata) return(FALSE); } - ea_rdata += sizeof(UINT); + ea_sect += sizeof(UINT); return(FALSE); } @@ -226,7 +226,7 @@ tid_t create_vtbl_struct(ea_t vtbl_addr, char* vtbl_name, uval_t idx, unsigned i //--------------------------------------------------------------------------- // RTTI code parsing -// (simple code init in v1.1 will be refactore in the folowing vesrions) +// (simple code init in v1.1 will be redevelop in the following versions) //--------------------------------------------------------------------------- // Find RTTI objects by signature @@ -278,11 +278,22 @@ void process_rtti() //--------------------------------------------------------------------------- void search_objects() { - segment_t *rdata_seg = get_segm_by_name(".rdata"); - ea_t ea_rdata = rdata_seg->startEA; + segment_t *text_seg = get_segm_by_name(".text"); - while (ea_rdata <= rdata_seg->endEA) - process_vtbl(ea_rdata); + if (text_seg != NULL) + { + ea_t ea_text = text_seg->startEA; + while (ea_text <= text_seg->endEA) + process_vtbl(ea_text); + } + + segment_t *rdata_seg = get_segm_by_name(".rdata"); + if (rdata_seg != NULL) + { + ea_t ea_rdata = rdata_seg->startEA; + while (ea_rdata <= rdata_seg->endEA) + process_vtbl(ea_rdata); + } process_rtti(); } @@ -322,23 +333,30 @@ static bool idaapi ct_rtti_window_click(TCustomControl *v, int shift, void *ud) static bool idaapi show_rtti_window_cb(void *ud) { - HWND hwnd = NULL; - TForm *form = create_tform("RTTI Objects List", &hwnd); + if (!rtti_list.empty() && !rtti_addr.empty()) + { + HWND hwnd = NULL; + TForm *form = create_tform("RTTI Objects List", &hwnd); - object_explorer_info_t *si = new object_explorer_info_t(form); + object_explorer_info_t *si = new object_explorer_info_t(form); - qvector ::iterator rtti_iter; - for (rtti_iter = rtti_list.begin(); rtti_iter != rtti_list.end(); rtti_iter++) - si->sv.push_back(simpleline_t(*rtti_iter)); + qvector ::iterator rtti_iter; + for (rtti_iter = rtti_list.begin(); rtti_iter != rtti_list.end(); rtti_iter++) + si->sv.push_back(simpleline_t(*rtti_iter)); - simpleline_place_t s1; - simpleline_place_t s2(si->sv.size() - 1); - si->cv = create_custom_viewer("", NULL, &s1, &s2, &s1, 0, &si->sv); - si->codeview = create_code_viewer(form, si->cv, CDVF_STATUSBAR); - set_custom_viewer_handlers(si->cv, NULL, NULL, ct_rtti_window_click, NULL, NULL, si); - open_tform(form, FORM_ONTOP | FORM_RESTORE); + simpleline_place_t s1; + simpleline_place_t s2(si->sv.size() - 1); + si->cv = create_custom_viewer("", NULL, &s1, &s2, &s1, 0, &si->sv); + si->codeview = create_code_viewer(form, si->cv, CDVF_STATUSBAR); + set_custom_viewer_handlers(si->cv, NULL, NULL, ct_rtti_window_click, NULL, NULL, si); + open_tform(form, FORM_ONTOP | FORM_RESTORE); - return true; + return true; + } + + warning("HexRaysCodeXplorer don't find any RTTI objects inside"); + + return false; } ////////////////////////////////////////////////////////////////////////// @@ -347,8 +365,6 @@ static void idaapi ct_object_explorer_popup(TCustomControl *v, void *ud) { set_custom_viewer_popup_menu(v, NULL); add_custom_viewer_popup_item(v, "Make VTBL_Srtruct", "S", make_vtbl_struct_cb, ud); - //add_custom_viewer_popup_item(v, "Make VTBL_Srtruct for all found tables", "Shift + S", make_struct_cb, ud); - //add_custom_viewer_popup_item(v, "Dump to File", "D", make_struct_cb, ud); add_custom_viewer_popup_item(v, "Show RTTI objects list", "R", show_rtti_window_cb, ud); } @@ -455,28 +471,33 @@ int idaapi ui_object_explorer_callback(void *ud, int code, va_list va) void object_explorer_form_init() { - HWND hwnd = NULL; - TForm *form = create_tform("Object Explorer", &hwnd); - if ( hwnd == NULL ) + if (!vtbl_list.empty() && !vtbl_t_list.empty()) { - warning("Object Explorer window already open. Switching to it."); - form = find_tform("Object Explorer"); - if ( form != NULL ) - switchto_tform(form, true); - return; - } + HWND hwnd = NULL; + TForm *form = create_tform("Object Explorer", &hwnd); + if (hwnd == NULL) + { + warning("Object Explorer window already open. Switching to it."); + form = find_tform("Object Explorer"); + if (form != NULL) + switchto_tform(form, true); + return; + } - object_explorer_info_t *si = new object_explorer_info_t(form); - - qvector ::iterator vtbl_iter; - for ( vtbl_iter = vtbl_list.begin(); vtbl_iter != vtbl_list.end(); vtbl_iter++ ) - si->sv.push_back(simpleline_t(*vtbl_iter)); - - simpleline_place_t s1; - simpleline_place_t s2(si->sv.size()-1); - si->cv = create_custom_viewer("", NULL, &s1, &s2, &s1, 0, &si->sv); - si->codeview = create_code_viewer(form, si->cv, CDVF_STATUSBAR); - set_custom_viewer_handlers(si->cv, ct_object_explorer_keyboard, ct_object_explorer_popup, ct_object_explorer_click, NULL, NULL, si); - hook_to_notification_point(HT_UI, ui_object_explorer_callback, si); - open_tform(form, FORM_TAB|FORM_MENU|FORM_RESTORE); + object_explorer_info_t *si = new object_explorer_info_t(form); + + qvector ::iterator vtbl_iter; + for (vtbl_iter = vtbl_list.begin(); vtbl_iter != vtbl_list.end(); vtbl_iter++) + si->sv.push_back(simpleline_t(*vtbl_iter)); + + simpleline_place_t s1; + simpleline_place_t s2(si->sv.size() - 1); + si->cv = create_custom_viewer("", NULL, &s1, &s2, &s1, 0, &si->sv); + si->codeview = create_code_viewer(form, si->cv, CDVF_STATUSBAR); + set_custom_viewer_handlers(si->cv, ct_object_explorer_keyboard, ct_object_explorer_popup, ct_object_explorer_click, NULL, NULL, si); + hook_to_notification_point(HT_UI, ui_object_explorer_callback, si); + open_tform(form, FORM_TAB | FORM_MENU | FORM_RESTORE); + } + else + warning("HexRaysCodeXplorer don't find any virtual tables inside"); } \ No newline at end of file diff --git a/sources/HexRaysCodeXplorer/ObjectExplorer.h b/src/HexRaysCodeXplorer/ObjectExplorer.h similarity index 100% rename from sources/HexRaysCodeXplorer/ObjectExplorer.h rename to src/HexRaysCodeXplorer/ObjectExplorer.h diff --git a/sources/HexRaysCodeXplorer/ObjectType.cpp b/src/HexRaysCodeXplorer/ObjectType.cpp similarity index 98% rename from sources/HexRaysCodeXplorer/ObjectType.cpp rename to src/HexRaysCodeXplorer/ObjectType.cpp index aaa997b..7f092c7 100644 --- a/sources/HexRaysCodeXplorer/ObjectType.cpp +++ b/src/HexRaysCodeXplorer/ObjectType.cpp @@ -61,14 +61,14 @@ struct type_builder_t : public ctree_parentee_t int get_idx_type_size(cexpr_t *idx_expr) { - char buff[MAXSTR]; - print_type_to_one_line(buff, MAXSTR, idati, idx_expr->type.u_str()); + qstring *buf; + idx_expr->type.print(buf); - if(strstr(buff, "char")) + if(strstr(buf->c_str(), "char")) return 1; - else if(strstr(buff, "short")) + else if(strstr(buf->c_str(), "short")) return 2; - else if(strstr(buff, "int")) + else if(strstr(buf->c_str(), "int")) return 4; return 0; diff --git a/sources/HexRaysCodeXplorer/ObjectType.h b/src/HexRaysCodeXplorer/ObjectType.h similarity index 100% rename from sources/HexRaysCodeXplorer/ObjectType.h rename to src/HexRaysCodeXplorer/ObjectType.h