Skip to content

Commit

Permalink
v1.6
Browse files Browse the repository at this point in the history
Bug fixes
VTBL xrefs
x64 support
  • Loading branch information
matrosov committed May 1, 2015
1 parent a199f4c commit 552959e
Show file tree
Hide file tree
Showing 13 changed files with 156 additions and 76 deletions.
Binary file added bin/v1.6/HexRaysCodeXplorer.p64
Binary file not shown.
Binary file added bin/v1.6/HexRaysCodeXplorer.plw
Binary file not shown.
18 changes: 9 additions & 9 deletions src/HexRaysCodeXplorer.sln
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
VisualStudioVersion = 12.0.31101.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 x64|Win32 = Debug x64|Win32
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release x64|Win32 = Release x64|Win32
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F7E6B557-41F3-444A-BCA4-3527547DD665}.Debug x64|Win32.ActiveCfg = Debug x64|Win32
{F7E6B557-41F3-444A-BCA4-3527547DD665}.Debug x64|Win32.Build.0 = Debug x64|Win32
{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
{F7E6B557-41F3-444A-BCA4-3527547DD665}.Release x64|Win32.ActiveCfg = Release x64|Win32
{F7E6B557-41F3-444A-BCA4-3527547DD665}.Release x64|Win32.Build.0 = Release x64|Win32
{F7E6B557-41F3-444A-BCA4-3527547DD665}.Release|Win32.ActiveCfg = Release x64|Win32
{F7E6B557-41F3-444A-BCA4-3527547DD665}.Release|Win32.Build.0 = Release x64|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Binary file removed src/HexRaysCodeXplorer.v12.suo
Binary file not shown.
34 changes: 17 additions & 17 deletions src/HexRaysCodeXplorer/CodeXplorer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2014
/* Copyright (c) 2013-2015
REhints <info@rehints.com>
All rights reserved.
Expand Down Expand Up @@ -36,16 +36,16 @@ hexdsp_t *hexdsp = NULL;
static bool inited = false;

// Hotkey for the new command
static const char hotkey_dg[] = "G";
static const char hotkey_dg[] = "T";
static ushort hotcode_dg;

static const char hotkey_ce[] = "E";
static const char hotkey_ce[] = "O";
static ushort hotcode_ce;

static const char hotkey_rt[] = "R";
static ushort hotcode_rt;

static const char hotkey_gd[] = "D";
static const char hotkey_gd[] = "J";
static ushort hotcode_gd;


Expand Down Expand Up @@ -186,7 +186,7 @@ static int idaapi gr_callback(void *ud, int code, va_list va)

callgraph_t::nodeinfo_t *ni = fg->get_info(mousenode);
result = ni != NULL;
if (result && ni->ea != 0xFFFFFFFF)
if (result && ni->ea != BADADDR)
{
qstring s = get_text_disasm(ni->ea);
*hint = qstrdup(s.c_str());
Expand All @@ -202,7 +202,7 @@ static int idaapi gr_callback(void *ud, int code, va_list va)

callgraph_t::nodeinfo_t *ni = fg->get_info(s->node);
result = ni != NULL;
if (result && s->is_node && ni->ea != 0xFFFFFFFF)
if (result && s->is_node && ni->ea != BADADDR)
jumpto(ni->ea);
}
break;
Expand Down Expand Up @@ -320,8 +320,6 @@ static bool idaapi decompile_func(vdui_t &vu)
static bool idaapi ctree_into_custom_view(void *ud) // TODO
{
vdui_t &vu = *(vdui_t *)ud;


vu.get_current_item(USE_KEYBOARD);
citem_t *highlight = vu.item.is_citem() ? vu.item.e : NULL;

Expand Down Expand Up @@ -380,22 +378,23 @@ static int idaapi callback(void *, hexrays_event_t event, va_list va)
add_custom_viewer_popup_item(vu.ct, "Display Graph", hotkey_dg, display_graph, &vu);
add_custom_viewer_popup_item(vu.ct, "Object Explorer", hotkey_ce, display_objects, &vu);
add_custom_viewer_popup_item(vu.ct, "REconstruct Type", hotkey_rt, reconstruct_type, &vu);
add_custom_viewer_popup_item(vu.ct, "Goto Disasm", hotkey_gd, decompiled_line_to_disasm, &vu);
add_custom_viewer_popup_item(vu.ct, "Jump to Disasm", hotkey_gd, decompiled_line_to_disasm, &vu);
}
break;

case hxe_keyboard:
case hxe_keyboard:
{
vdui_t &vu = *va_arg(va, vdui_t *);
int keycode = va_arg(va, int);
int shift = va_arg(va, int);
// check for the hotkey
if ( lookup_key_code(keycode, shift, true) == hotcode_dg && shift == 0 )
if (keycode == hotcode_dg)
return display_graph(&vu);
if ( lookup_key_code(keycode, shift, true) == hotcode_ce && shift == 0 )
if (keycode == hotcode_ce)
return display_objects(&vu);
if ( lookup_key_code(keycode, shift, true) == hotcode_rt && shift == 0 )
if (keycode == hotcode_rt)
return reconstruct_type(&vu);
if (keycode == hotcode_gd)
return decompiled_line_to_disasm(&vu);
}
break;

Expand All @@ -421,9 +420,10 @@ int idaapi init(void)
const char *hxver = get_hexrays_version();
msg("Hex-rays version %s has been detected, %s ready to use\n", hxver, PLUGIN.wanted_name);
inited = true;
hotcode_dg = get_key_code(hotkey_dg); // convert the hotkey to binary form
hotcode_rt = get_key_code(hotkey_rt); // convert the hotkey to binary form

hotcode_dg = 84; // T
hotcode_ce = 79; // O
hotcode_rt = 82; // R
hotcode_gd = 74; // J
msg(
"\nHexRaysCodeXplorer plugin by @REhints loaded.\n\n\n");

Expand Down
2 changes: 1 addition & 1 deletion src/HexRaysCodeXplorer/Common.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2014
/* Copyright (c) 2013-2015
REhints <info@rehints.com>
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/HexRaysCodeXplorer/GraphBuilder.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2014
/* Copyright (c) 2013-2015
REhints <info@rehints.com>
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/HexRaysCodeXplorer/GraphBuilder.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2014
/* Copyright (c) 2013-2015
REhints <info@rehints.com>
All rights reserved.
Expand Down
44 changes: 22 additions & 22 deletions src/HexRaysCodeXplorer/HexRaysCodeXplorer.vcxproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug x64|Win32">
<Configuration>Debug x64</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
<ProjectConfiguration Include="Release x64|Win32">
<Configuration>Release x64</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F7E6B557-41F3-444A-BCA4-3527547DD665}</ProjectGuid>
Expand All @@ -31,7 +31,7 @@
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
Expand All @@ -44,7 +44,7 @@
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
Expand All @@ -57,13 +57,13 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
Expand All @@ -72,16 +72,16 @@
<NMakeBuildCommandLine>build makefile</NMakeBuildCommandLine>
<TargetExt>.plw</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">
<LinkIncremental>true</LinkIncremental>
<NMakeBuildCommandLine>build makefile</NMakeBuildCommandLine>
<TargetExt>.plw</TargetExt>
<TargetExt>.p64</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetExt>.plw</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetExt>.p64</TargetExt>
</PropertyGroup>
Expand All @@ -103,13 +103,13 @@
<AdditionalLibraryDirectories>$(IDADIR)\plugins\SDK\idasdk\lib\x86_win_vc_32</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>__NT__;__IDP__;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>__NT__;__IDP__;__EA64__;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IDADIR)\plugins\SDK\idasdk\include;$(IDADIR)\plugins\hexrays_sdk\include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
Expand All @@ -118,7 +118,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>ida.lib</AdditionalDependencies>
<AdditionalOptions>/EXPORT:PLUGIN %(AdditionalOptions)</AdditionalOptions>
<AdditionalLibraryDirectories>$(IDADIR)\plugins\SDK\idasdk\lib\x86_win_vc_32</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(IDADIR)\plugins\SDK\idasdk\lib\x86_win_vc_64</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -130,7 +130,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>__NT__;__IDP__;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IDADIR)\plugins\SDK\idasdk\include;$(IDADIR)\plugins\hexrays_sdk\include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(IDADIR)\plugins\SDK\idasdk\include;$(IDADIR)\plugins\SDK\hexrays_sdk\include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
Expand All @@ -143,16 +143,16 @@
<AdditionalLibraryDirectories>$(IDADIR)\plugins\SDK\idasdk\lib\x86_win_vc_32</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>__NT__;__IDP__;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IDADIR)\plugins\SDK\idasdk\include;$(IDADIR)\plugins\hexrays_sdk\include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>__NT__;__IDP__;__EA64__;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IDADIR)\plugins\SDK\idasdk\include;$(IDADIR)\plugins\SDK\hexrays_sdk\include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
Expand Down
Loading

0 comments on commit 552959e

Please sign in to comment.