Added performance test

Some minor bugfixes
This commit is contained in:
flobernd 2014-10-30 01:00:05 +01:00
parent 5b7cc47794
commit e31a9119ff
10 changed files with 344 additions and 26 deletions

View File

@ -69,19 +69,19 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>../../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>../../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>../../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>../../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>

View File

@ -3,54 +3,86 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleDemo", "SimpleDemo\SimpleDemo.vcxproj", "{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "1 - Simple Demo", "SimpleDemo\SimpleDemo.vcxproj", "{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CustomDataSource", "CustomDataSource\CustomDataSource.vcxproj", "{EB0F5A04-EE14-4779-9B29-322876CD45C8}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2 - Custom DataSource", "CustomDataSource\CustomDataSource.vcxproj", "{EB0F5A04-EE14-4779-9B29-322876CD45C8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SymbolResolver", "SymbolResolver\SymbolResolver.vcxproj", "{B6CA4362-2714-451C-8063-12195ABD7CD7}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "3 - Symbol Resolver", "SymbolResolver\SymbolResolver.vcxproj", "{B6CA4362-2714-451C-8063-12195ABD7CD7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VerteronDisassemblerEngine", "..\VerteronDisassemblerEngine\VerteronDisassemblerEngine.vcxproj", "{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "4 - Performance Test", "PerformanceTest\PerformanceTest.vcxproj", "{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}.Debug|Win32.ActiveCfg = Debug|Win32
{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}.Debug|Win32.Build.0 = Debug|Win32
{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}.Debug|x64.ActiveCfg = Debug|x64
{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}.Debug|x64.Build.0 = Debug|x64
{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}.Release|Mixed Platforms.Build.0 = Release|Win32
{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}.Release|Win32.ActiveCfg = Release|Win32
{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}.Release|Win32.Build.0 = Release|Win32
{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}.Release|x64.ActiveCfg = Release|x64
{BC5CDE9B-9F84-453E-8131-B56F67FD0E4D}.Release|x64.Build.0 = Release|x64
{EB0F5A04-EE14-4779-9B29-322876CD45C8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{EB0F5A04-EE14-4779-9B29-322876CD45C8}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{EB0F5A04-EE14-4779-9B29-322876CD45C8}.Debug|Win32.ActiveCfg = Debug|Win32
{EB0F5A04-EE14-4779-9B29-322876CD45C8}.Debug|Win32.Build.0 = Debug|Win32
{EB0F5A04-EE14-4779-9B29-322876CD45C8}.Debug|x64.ActiveCfg = Debug|x64
{EB0F5A04-EE14-4779-9B29-322876CD45C8}.Debug|x64.Build.0 = Debug|x64
{EB0F5A04-EE14-4779-9B29-322876CD45C8}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{EB0F5A04-EE14-4779-9B29-322876CD45C8}.Release|Mixed Platforms.Build.0 = Release|Win32
{EB0F5A04-EE14-4779-9B29-322876CD45C8}.Release|Win32.ActiveCfg = Release|Win32
{EB0F5A04-EE14-4779-9B29-322876CD45C8}.Release|Win32.Build.0 = Release|Win32
{EB0F5A04-EE14-4779-9B29-322876CD45C8}.Release|x64.ActiveCfg = Release|x64
{EB0F5A04-EE14-4779-9B29-322876CD45C8}.Release|x64.Build.0 = Release|x64
{B6CA4362-2714-451C-8063-12195ABD7CD7}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{B6CA4362-2714-451C-8063-12195ABD7CD7}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{B6CA4362-2714-451C-8063-12195ABD7CD7}.Debug|Win32.ActiveCfg = Debug|Win32
{B6CA4362-2714-451C-8063-12195ABD7CD7}.Debug|Win32.Build.0 = Debug|Win32
{B6CA4362-2714-451C-8063-12195ABD7CD7}.Debug|x64.ActiveCfg = Debug|x64
{B6CA4362-2714-451C-8063-12195ABD7CD7}.Debug|x64.Build.0 = Debug|x64
{B6CA4362-2714-451C-8063-12195ABD7CD7}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{B6CA4362-2714-451C-8063-12195ABD7CD7}.Release|Mixed Platforms.Build.0 = Release|Win32
{B6CA4362-2714-451C-8063-12195ABD7CD7}.Release|Win32.ActiveCfg = Release|Win32
{B6CA4362-2714-451C-8063-12195ABD7CD7}.Release|Win32.Build.0 = Release|Win32
{B6CA4362-2714-451C-8063-12195ABD7CD7}.Release|x64.ActiveCfg = Release|x64
{B6CA4362-2714-451C-8063-12195ABD7CD7}.Release|x64.Build.0 = Release|x64
{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}.Debug|Win32.ActiveCfg = Debug|Win32
{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}.Debug|Win32.Build.0 = Debug|Win32
{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}.Debug|x64.ActiveCfg = Debug|x64
{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}.Debug|x64.Build.0 = Debug|x64
{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}.Release|Mixed Platforms.Build.0 = Release|Win32
{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}.Release|Win32.ActiveCfg = Release|Win32
{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}.Release|Win32.Build.0 = Release|Win32
{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}.Release|x64.ActiveCfg = Release|x64
{F5C6F0A7-F75D-42BD-A8AB-A2D1D5F67099}.Release|x64.Build.0 = Release|x64
{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}.Debug|Win32.ActiveCfg = Debug|Win32
{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}.Debug|Win32.Build.0 = Debug|Win32
{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}.Debug|x64.ActiveCfg = Debug|x64
{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}.Debug|x64.Build.0 = Debug|x64
{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}.Release|Mixed Platforms.Build.0 = Release|Win32
{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}.Release|Win32.ActiveCfg = Release|Win32
{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}.Release|Win32.Build.0 = Release|Win32
{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}.Release|x64.ActiveCfg = Release|x64
{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,121 @@
/**************************************************************************************************
Verteron Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications :
Last change : 29. October 2014
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
**************************************************************************************************/
#include <tchar.h>
#include <iostream>
#include <iomanip>
#include "VXDisassembler.h"
#include <Windows.h>
using namespace Verteron;
using namespace Disassembler;
void testDecodingAndFormatting(uintptr_t baseAddress, PIMAGE_NT_HEADERS ntHeaders)
{
VXInstructionInfo info;
VXInstructionDecoder decoder;
VXIntelInstructionFormatter formatter;
decoder.setDisassemblerMode(VXDisassemblerMode::M64BIT);
PIMAGE_SECTION_HEADER sectionHeader =
reinterpret_cast<PIMAGE_SECTION_HEADER>(
reinterpret_cast<uintptr_t>(ntHeaders) + sizeof(IMAGE_NT_HEADERS)
+ ntHeaders->FileHeader.SizeOfOptionalHeader - sizeof(IMAGE_OPTIONAL_HEADER));
// Decode all code sections
for (unsigned int i = 0; i < ntHeaders->FileHeader.NumberOfSections; ++i)
{
if (sectionHeader->Characteristics & IMAGE_SCN_CNT_CODE)
{
std::cout << sectionHeader->SizeOfRawData / 1024 << " KiB" << std::endl;
VXMemoryDataSource input(reinterpret_cast<const void*>(
baseAddress + sectionHeader->VirtualAddress), sectionHeader->SizeOfRawData);
decoder.setDataSource(&input);
decoder.setInstructionPointer(baseAddress + sectionHeader->VirtualAddress);
while (decoder.decodeInstruction(info))
{
}
}
sectionHeader++;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
// Find kernel32.dll in memory
void *ntdllBase = GetModuleHandle(L"kernel32.dll");
PIMAGE_DOS_HEADER dosHeader = static_cast<PIMAGE_DOS_HEADER>(ntdllBase);
if (dosHeader->e_magic != IMAGE_DOS_SIGNATURE)
{
std::cout << "Error: kernel32.dll is corrupted.";
return 1;
}
PIMAGE_NT_HEADERS ntHeaders =
reinterpret_cast<PIMAGE_NT_HEADERS>(
reinterpret_cast<uintptr_t>(dosHeader) + dosHeader->e_lfanew);
if (ntHeaders->Signature != IMAGE_NT_SIGNATURE)
{
std::cout << "Error: kernel32.dll is corrupted.";
return 1;
}
double pcFrequency = 0.0;
uint64_t pcStart = 0;
LARGE_INTEGER li;
// Start the performance counter
if (!QueryPerformanceFrequency(&li))
{
std::cout << "Error: QueryPerformanceFrequency failed.";
return 1;
}
pcFrequency = static_cast<double>(li.QuadPart) / 1000.0;
if (!QueryPerformanceCounter(&li))
{
std::cout << "Error: QueryPerformanceCounter failed.";
return 1;
}
pcStart = li.QuadPart;
// Perform decoding test
testDecodingAndFormatting(reinterpret_cast<uintptr_t>(ntdllBase), ntHeaders);
// Stop the performance counter
if (!QueryPerformanceCounter(&li))
{
std::cout << "Error: QueryPerformanceCounter failed.";
return 1;
}
std::cout << "Time: " << static_cast<double>(li.QuadPart - pcStart) / pcFrequency
<< std::endl;
std::cin.get();
return 0;
}

View File

@ -0,0 +1,157 @@
<?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|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</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>{4A0B7BE7-72C9-4A95-90CA-D56C50F10401}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>PerformanceTest</RootNamespace>
<ProjectName>4 - Performance Test</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<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">
<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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Main.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VerteronDisassemblerEngine\VerteronDisassemblerEngine.vcxproj">
<Project>{f5c6f0a7-f75d-42bd-a8ab-a2d1d5f67099}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="Main.cpp" />
</ItemGroup>
</Project>

View File

@ -69,19 +69,19 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>../../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>../../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>../../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>../../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>

View File

@ -22,7 +22,7 @@
<ProjectGuid>{B6CA4362-2714-451C-8063-12195ABD7CD7}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>SymbolResolver</RootNamespace>
<ProjectName>3 - SymbolResolver</ProjectName>
<ProjectName>3 - Symbol Resolver</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@ -69,19 +69,19 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>../../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>../../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>../../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>../../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>

View File

@ -68,19 +68,19 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>../VerteronDisassemblerEngine/;$(IncludePath)</IncludePath>
<IncludePath>..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>

View File

@ -493,7 +493,7 @@ bool VXInstructionDecoder::decodeOperands(VXInstructionInfo& info)
{
if (info.operand[i - 1].type != VXOperandType::NONE)
{
info.operand[i - 1].access_mode = VXOperandAccessMode::READ;
info.operand[i].access_mode = VXOperandAccessMode::READ;
if (!decodeOperand(info, info.operand[i], info.instrDefinition->operand[i].type,
info.instrDefinition->operand[i].size))
{
@ -502,6 +502,7 @@ bool VXInstructionDecoder::decodeOperands(VXInstructionInfo& info)
}
}
// Update operand access modes
info.operand[0].access_mode = VXOperandAccessMode::READ;
if (info.operand[0].type != VXOperandType::NONE)
{
if (info.instrDefinition->flags & IDF_OPERAND1_WRITE)

View File

@ -256,11 +256,12 @@ void VXIntelInstructionFormatter::formatOperand(const VXInstructionInfo &info,
outputAppendFormatted("%s:", registerToString(info.segment));
}
outputAppend("[");
if (operand.base == VXRegister::RIP)
{
// TODO: Add option
outputAppendAddress(info, calcAbsoluteTarget(info, operand));
} else
// TODO: Fix zero sized memory operands (lea eax, [rip+1] | lidt [0])
//if (operand.base == VXRegister::RIP)
//{
// // TODO: Add option
// outputAppendAddress(info, calcAbsoluteTarget(info, operand));
//} else
{
if (operand.base != VXRegister::NONE)
{