1
0
mirror of https://github.com/bitdefender/bddisasm.git synced 2024-12-22 22:18:09 +00:00

Switched to internally defined types.

WRUSSD and WRUSSQ cannot be executed when CPL != 0.
This commit is contained in:
BITDEFENDER\vlutas 2022-01-05 14:03:13 +02:00
parent 08103713b2
commit fe6a937f51
29 changed files with 8997 additions and 8459 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugKernel|ARM64">
<Configuration>DebugKernel</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugKernel|Win32">
<Configuration>DebugKernel</Configuration>
<Platform>Win32</Platform>
@ -9,6 +13,10 @@
<Configuration>DebugKernel</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
@ -17,6 +25,10 @@
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseKernel|ARM64">
<Configuration>ReleaseKernel</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseKernel|Win32">
<Configuration>ReleaseKernel</Configuration>
<Platform>Win32</Platform>
@ -25,6 +37,10 @@
<Configuration>ReleaseKernel</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -78,6 +94,12 @@
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
@ -88,11 +110,26 @@
<SupportsPackaging>false</SupportsPackaging>
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<TargetVersion></TargetVersion>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<SupportsPackaging>false</SupportsPackaging>
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
@ -102,6 +139,15 @@
<SupportsPackaging>false</SupportsPackaging>
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<TargetVersion></TargetVersion>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<SupportsPackaging>false</SupportsPackaging>
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
@ -120,15 +166,27 @@
<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>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|ARM64'" Label="PropertySheets">
<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 Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|ARM64'" 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>
<_ProjectFileVersion>14.0.23107.0</_ProjectFileVersion>
@ -145,10 +203,18 @@
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|ARM64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
@ -161,10 +227,18 @@
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|ARM64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
<Command>
@ -250,6 +324,39 @@
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<Midl />
<ClCompile>
<AdditionalOptions>/D "AMD64" %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>include;..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<AdditionalLibraryDirectories>x:\Projects-devel\dacia-hg\bin\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'">
<PreBuildEvent>
<Command>
@ -287,6 +394,42 @@
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|ARM64'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<Midl />
<ClCompile>
<AdditionalOptions>/kernel /D "AMD64" %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>include;..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>
</ForcedIncludeFiles>
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<AdditionalLibraryDirectories>x:\Projects-devel\dacia-hg\bin\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Native</SubSystem>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command>
@ -367,6 +510,48 @@
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<CompileAs>Default</CompileAs>
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<Midl />
<ClCompile>
<AdditionalOptions>/D "AMD64" %(AdditionalOptions)</AdditionalOptions>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>include;..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<CompileAs>Default</CompileAs>
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
@ -419,6 +604,44 @@
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|ARM64'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<Midl />
<ClCompile>
<AdditionalOptions>/kernel /D "AMD64" %(AdditionalOptions)</AdditionalOptions>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>include;..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>
</ForcedIncludeFiles>
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<SubSystem>Native</SubSystem>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="bdformat.c" />
<ClCompile Include="bdhelpers.c" />
@ -426,14 +649,19 @@
<ClCompile Include="bddisasm.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|ARM64'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='DebugKernel|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='DebugKernel|ARM64'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|ARM64'">
</ForcedIncludeFiles>
</ClCompile>
</ItemGroup>
<ItemGroup>

View File

@ -113,7 +113,7 @@ static const char *gRegTile[] =
static const char *gConditionCodes[] =
{
"EQ", "LT", "LE", "UNORD", "NEQ", "NLT", "NLE", "ORD",
"EQ_UQ", "NGE", "NGT", "false", "NEQ_OQ", "GE", "GT", "TRUE",
"EQ_UQ", "NGE", "NGT", "ND_FALSE", "NEQ_OQ", "GE", "GT", "TRUE",
"EQ_OS", "LT_OQ", "LE_OQ", "UNORD_S", "NEQ_US", "NLT_UQ", "NLE_UQ", "ORD_S",
"EQ_US", "NGE_UQ", "NGT_UQ", "FALSE_OS", "NEQ_OS", "GE_OQ", "GT_OQ", "TRUE_US",
};
@ -131,7 +131,7 @@ static const char *gEmbeddedRounding[] =
static NDSTATUS
NdSprintf(
char *Destination,
size_t DestinationSize,
ND_SIZET DestinationSize,
const char *Formatstring,
...
)
@ -142,12 +142,12 @@ NdSprintf(
int res;
va_list args;
if (NULL == Destination)
if (ND_NULL == Destination)
{
return ND_STATUS_INVALID_PARAMETER;
}
if (NULL == Formatstring)
if (ND_NULL == Formatstring)
{
return ND_STATUS_INVALID_PARAMETER;
}
@ -162,7 +162,7 @@ NdSprintf(
va_end(args);
if ((res < 0) || ((size_t)res >= DestinationSize - 1))
if ((res < 0) || ((ND_SIZET)res >= DestinationSize - 1))
{
return ND_STATUS_BUFFER_OVERFLOW;
}
@ -177,32 +177,32 @@ NdSprintf(
NDSTATUS
NdToText(
const INSTRUX *Instrux,
uint64_t Rip,
uint32_t BufferSize,
ND_UINT64 Rip,
ND_UINT32 BufferSize,
char *Buffer
)
{
NDSTATUS status;
char *res, temp[64];
uint32_t opIndex, opsStored;
ND_UINT32 opIndex, opsStored;
const ND_OPERAND *pOp;
bool alignmentStored;
ND_BOOL alignmentStored;
// pre-init
status = ND_STATUS_SUCCESS;
res = NULL;
res = (char *)ND_NULL;
opIndex = 0;
opsStored = 0;
pOp = NULL;
alignmentStored = false;
pOp = (const ND_OPERAND *)ND_NULL;
alignmentStored = ND_FALSE;
// Validate args.
if (NULL == Instrux)
if (ND_NULL == Instrux)
{
return ND_STATUS_INVALID_PARAMETER;
}
if (NULL == Buffer)
if (ND_NULL == Buffer)
{
return ND_STATUS_INVALID_PARAMETER;
}
@ -225,12 +225,12 @@ NdToText(
if (Instrux->Rep == ND_PREFIX_G1_REPE_REPZ)
{
res = nd_strcat_s(Buffer, BufferSize, "REPZ ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
else if (Instrux->Rep == ND_PREFIX_G1_REPNE_REPNZ)
{
res = nd_strcat_s(Buffer, BufferSize, "REPNZ ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
}
@ -240,24 +240,24 @@ NdToText(
if (Instrux->Rep == ND_PREFIX_G1_REPE_REPZ)
{
res = nd_strcat_s(Buffer, BufferSize, "REP ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
else if (Instrux->Rep == ND_PREFIX_G1_REPNE_REPNZ)
{
res = nd_strcat_s(Buffer, BufferSize, "REPNZ ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
}
if (Instrux->IsXreleaseEnabled)
{
res = nd_strcat_s(Buffer, BufferSize, "XRELEASE ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
else if (Instrux->IsXacquireEnabled)
{
res = nd_strcat_s(Buffer, BufferSize, "XACQUIRE ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
}
@ -266,7 +266,7 @@ NdToText(
if (ND_LOCK_SUPPORT(Instrux))
{
res = nd_strcat_s(Buffer, BufferSize, "LOCK ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
}
@ -275,7 +275,7 @@ NdToText(
if (ND_BND_SUPPORT(Instrux))
{
res = nd_strcat_s(Buffer, BufferSize, "BND ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
}
@ -285,17 +285,17 @@ NdToText(
{
case ND_PREFIX_G2_BR_TAKEN:
res = nd_strcat_s(Buffer, BufferSize, "BHT ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_PREFIX_G2_BR_NOT_TAKEN:
res = nd_strcat_s(Buffer, BufferSize, "BHNT ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_PREFIX_G2_BR_ALT:
res = nd_strcat_s(Buffer, BufferSize, "BHALT ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
default:
@ -308,19 +308,19 @@ NdToText(
if (!Instrux->IsCetTracked)
{
res = nd_strcat_s(Buffer, BufferSize, "DNT ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
}
// Store the mnemonic.
res = nd_strcat_s(Buffer, BufferSize, Instrux->Mnemonic);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
// Store condition code, if any.
if (ND_HAS_SSE_CONDITION(Instrux))
{
res = nd_strcat_s(Buffer, BufferSize, gConditionCodes[Instrux->SseCondition]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
// If there are no explicit operands, we can leave.
@ -358,7 +358,7 @@ NdToText(
// Store alignment.
if (!alignmentStored)
{
size_t idx = 0;
ND_SIZET idx = 0;
while ((idx < BufferSize) && (Buffer[idx]))
{
@ -377,14 +377,14 @@ NdToText(
Buffer[idx] = 0;
alignmentStored = true;
alignmentStored = ND_TRUE;
}
// Store the comma, if this isn't the first operand.
if (opsStored > 0)
{
res = nd_strcat_s(Buffer, BufferSize, ", ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
opsStored++;
@ -409,31 +409,31 @@ NdToText(
if ((Instrux->EncMode != ND_ENCM_LEGACY) || Instrux->HasRex)
{
res = nd_strcat_s(Buffer, BufferSize, gReg8Bit64[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
else
{
res = nd_strcat_s(Buffer, BufferSize, gReg8Bit[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
case ND_SIZE_16BIT:
// 16 bit register.
res = nd_strcat_s(Buffer, BufferSize, gReg16Bit[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_32BIT:
// 32 bit register.
res = nd_strcat_s(Buffer, BufferSize, gReg32Bit[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_64BIT:
// 64 bit register.
res = nd_strcat_s(Buffer, BufferSize, gReg64Bit[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
default:
@ -450,7 +450,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, gRegSeg[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -462,7 +462,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, gRegFpu[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -474,7 +474,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, gRegMmx[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -489,15 +489,15 @@ NdToText(
{
case ND_SIZE_128BIT:
res = nd_strcat_s(Buffer, BufferSize, gRegXmm[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_256BIT:
res = nd_strcat_s(Buffer, BufferSize, gRegYmm[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_512BIT:
res = nd_strcat_s(Buffer, BufferSize, gRegZmm[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
default:
return ND_STATUS_INVALID_INSTRUX;
@ -513,7 +513,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, gRegControl[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -525,7 +525,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, gRegDebug[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -537,7 +537,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, gRegTest[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -550,7 +550,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, gRegBound[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -563,7 +563,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, gRegMask[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -576,7 +576,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, gRegTile[pOp->Info.Register.Reg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -593,7 +593,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, temp);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -612,7 +612,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, temp);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -621,16 +621,16 @@ NdToText(
switch (pOp->Size)
{
case 1:
status = NdSprintf(temp, sizeof(temp), "0x%02x", (uint8_t)pOp->Info.Immediate.Imm);
status = NdSprintf(temp, sizeof(temp), "0x%02x", (ND_UINT8)pOp->Info.Immediate.Imm);
break;
case 2:
status = NdSprintf(temp, sizeof(temp), "0x%04x", (uint16_t)pOp->Info.Immediate.Imm);
status = NdSprintf(temp, sizeof(temp), "0x%04x", (ND_UINT16)pOp->Info.Immediate.Imm);
break;
case 4:
status = NdSprintf(temp, sizeof(temp), "0x%08x", (uint32_t)pOp->Info.Immediate.Imm);
status = NdSprintf(temp, sizeof(temp), "0x%08x", (ND_UINT32)pOp->Info.Immediate.Imm);
break;
case 8:
status = NdSprintf(temp, sizeof(temp), "0x%016llx", (uint64_t)pOp->Info.Immediate.Imm);
status = NdSprintf(temp, sizeof(temp), "0x%016llx", (ND_UINT64)pOp->Info.Immediate.Imm);
break;
}
if (!ND_SUCCESS(status))
@ -639,13 +639,13 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, temp);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
case ND_OP_OFFS:
{
uint64_t dest = Rip + Instrux->Length + pOp->Info.RelativeOffset.Rel;
ND_UINT64 dest = Rip + Instrux->Length + pOp->Info.RelativeOffset.Rel;
// Truncate to the actual word length.
switch (Instrux->WordLength)
@ -667,7 +667,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, temp);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -677,15 +677,15 @@ NdToText(
{
case 4:
status = NdSprintf(temp, sizeof(temp), "0x%04x:0x%04x",
pOp->Info.Address.BaseSeg, (uint16_t)pOp->Info.Address.Offset);
pOp->Info.Address.BaseSeg, (ND_UINT16)pOp->Info.Address.Offset);
break;
case 6:
status = NdSprintf(temp, sizeof(temp), "0x%04x:0x%08x",
pOp->Info.Address.BaseSeg, (uint32_t)pOp->Info.Address.Offset);
pOp->Info.Address.BaseSeg, (ND_UINT32)pOp->Info.Address.Offset);
break;
case 10:
status = NdSprintf(temp, sizeof(temp), "0x%04x:0x%016llx",
pOp->Info.Address.BaseSeg, (uint64_t)pOp->Info.Address.Offset);
pOp->Info.Address.BaseSeg, (ND_UINT64)pOp->Info.Address.Offset);
break;
default:
return ND_STATUS_INVALID_INSTRUX;
@ -697,7 +697,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, temp);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -710,43 +710,43 @@ NdToText(
{
case 1:
res = nd_strcat_s(Buffer, BufferSize, "byte ptr ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case 2:
res = nd_strcat_s(Buffer, BufferSize, "word ptr ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case 4:
res = nd_strcat_s(Buffer, BufferSize, "dword ptr ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case 6:
res = nd_strcat_s(Buffer, BufferSize, "fword ptr ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case 8:
res = nd_strcat_s(Buffer, BufferSize, "qword ptr ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case 10:
res = nd_strcat_s(Buffer, BufferSize, "tbyte ptr ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case 16:
res = nd_strcat_s(Buffer, BufferSize, "xmmword ptr ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case 32:
res = nd_strcat_s(Buffer, BufferSize, "ymmword ptr ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case 48:
res = nd_strcat_s(Buffer, BufferSize, "m384 ptr ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case 64:
res = nd_strcat_s(Buffer, BufferSize, "zmmword ptr ");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
default:
break;
@ -764,16 +764,16 @@ NdToText(
(NDR_GS == pOp->Info.Memory.Seg))
{
res = nd_strcat_s(Buffer, BufferSize, gRegSeg[pOp->Info.Memory.Seg]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
res = nd_strcat_s(Buffer, BufferSize, ":");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
}
// Prepend the "["
res = nd_strcat_s(Buffer, BufferSize, "[");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
// Base, if any.
if (pOp->Info.Memory.HasBase)
@ -787,19 +787,19 @@ NdToText(
{
case ND_SIZE_8BIT:
res = nd_strcat_s(Buffer, BufferSize, gReg8Bit[pOp->Info.Memory.Base]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_16BIT:
res = nd_strcat_s(Buffer, BufferSize, gReg16Bit[pOp->Info.Memory.Base]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_32BIT:
res = nd_strcat_s(Buffer, BufferSize, gReg32Bit[pOp->Info.Memory.Base]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_64BIT:
res = nd_strcat_s(Buffer, BufferSize, gReg64Bit[pOp->Info.Memory.Base]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
default:
return ND_STATUS_INVALID_INSTRUX;
@ -817,38 +817,38 @@ NdToText(
if (pOp->Info.Memory.HasBase)
{
res = nd_strcat_s(Buffer, BufferSize, "+");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
switch (pOp->Info.Memory.IndexSize)
{
case ND_SIZE_8BIT:
res = nd_strcat_s(Buffer, BufferSize, gReg8Bit[pOp->Info.Memory.Index]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_16BIT:
res = nd_strcat_s(Buffer, BufferSize, gReg16Bit[pOp->Info.Memory.Index]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_32BIT:
res = nd_strcat_s(Buffer, BufferSize, gReg32Bit[pOp->Info.Memory.Index]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_64BIT:
res = nd_strcat_s(Buffer, BufferSize, gReg64Bit[pOp->Info.Memory.Index]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_128BIT:
res = nd_strcat_s(Buffer, BufferSize, gRegXmm[pOp->Info.Memory.Index]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_256BIT:
res = nd_strcat_s(Buffer, BufferSize, gRegYmm[pOp->Info.Memory.Index]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
case ND_SIZE_512BIT:
res = nd_strcat_s(Buffer, BufferSize, gRegZmm[pOp->Info.Memory.Index]);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
break;
default:
return ND_STATUS_INVALID_INSTRUX;
@ -864,14 +864,14 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, temp);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
}
// Handle displacement.
if (pOp->Info.Memory.HasDisp)
{
uint64_t normDisp, disp;
ND_UINT64 normDisp, disp;
disp = pOp->Info.Memory.Disp;
@ -900,12 +900,12 @@ NdToText(
break;
}
// Handle compressed displacement. It is fine to cast the normDisp to uint32_t, as the
// compressed displacement only works with uint8_t displacements. Also, in this phase,
// Handle compressed displacement. It is fine to cast the normDisp to ND_UINT32, as the
// compressed displacement only works with ND_UINT8 displacements. Also, in this phase,
// the normDisp is converted to a positive quantity, so no sign-extension is needed.
if (pOp->Info.Memory.HasCompDisp)
{
normDisp = (uint64_t)(uint32_t)normDisp * pOp->Info.Memory.CompDispSize;
normDisp = (ND_UINT64)(ND_UINT32)normDisp * pOp->Info.Memory.CompDispSize;
}
}
@ -914,12 +914,12 @@ NdToText(
if (pOp->Info.Memory.HasBase || pOp->Info.Memory.HasIndex)
{
res = nd_strcat_s(Buffer, BufferSize, Instrux->SignDisp ? "-" : "+");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
if (pOp->Info.Memory.IsRipRel)
{
uint64_t target = disp + Rip + Instrux->Length;
ND_UINT64 target = disp + Rip + Instrux->Length;
if (Instrux->AddrMode == ND_ADDR_32)
{
@ -930,7 +930,7 @@ NdToText(
}
else
{
uint8_t trimSize;
ND_UINT8 trimSize;
trimSize = (Instrux->AddrMode == ND_ADDR_16) ? 2 : ((Instrux->AddrMode == ND_ADDR_32) ? 4 : 8);
@ -945,12 +945,12 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, temp);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
// And the ending "]"
res = nd_strcat_s(Buffer, BufferSize, "]");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;
@ -968,7 +968,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, temp);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
// Handle masking.
@ -986,14 +986,14 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, temp);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
// Handle zeroing. Note that zeroing without masking is ignored.
if (pOp->Decorator.HasZero && pOp->Decorator.HasMask)
{
res = nd_strcat_s(Buffer, BufferSize, "{z}");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
// Append Suppress All Exceptions decorator.
@ -1001,7 +1001,7 @@ NdToText(
{
// ER implies SAE, so if we have ER, we will list that.
res = nd_strcat_s(Buffer, BufferSize, ", {sae}");
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
// Append Embedded Rounding decorator.
@ -1019,7 +1019,7 @@ NdToText(
}
res = nd_strcat_s(Buffer, BufferSize, temp);
RET_EQ(res, NULL, ND_STATUS_BUFFER_OVERFLOW);
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
}
@ -1029,18 +1029,18 @@ NdToText(
NDSTATUS
NdToText(
const INSTRUX *Instrux,
uint64_t Rip,
uint32_t BufferSize,
ND_UINT64 Rip,
ND_UINT32 BufferSize,
char *Buffer
)
{
UNREFERENCED_PARAMETER(Instrux);
UNREFERENCED_PARAMETER(Rip);
// At least make sure the buffer is NULL-terminated so integrators can use NdToText without checking if the
// At least make sure the buffer is ND_NULL-terminated so integrators can use NdToText without checking if the
// BDDISASM_NO_FORMAT macro is defined. This makes switching between versions with formatting and versions without
// formatting easier.
if (Buffer != NULL && BufferSize >= 1)
if (Buffer != ND_NULL && BufferSize >= 1)
{
*Buffer = '\0';
}

View File

@ -5,7 +5,7 @@
//
// NdIsInstruxRipRelative
//
bool
ND_BOOL
NdIsInstruxRipRelative(
const INSTRUX *Instrux
)
@ -13,9 +13,9 @@ NdIsInstruxRipRelative(
// Provided for backwards compatibility with existing code that uses disasm 1.0
//
{
if (NULL == Instrux)
if (ND_NULL == Instrux)
{
return false;
return ND_FALSE;
}
else
{
@ -33,20 +33,20 @@ NdGetFullAccessMap(
ND_ACCESS_MAP *AccessMap
)
{
uint32_t i;
ND_UINT32 i;
const ND_OPERAND *pOp;
// pre-init
i = 0;
pOp = NULL;
pOp = (const ND_OPERAND *)ND_NULL;
// validate
if (NULL == Instrux)
if (ND_NULL == Instrux)
{
return ND_STATUS_INVALID_PARAMETER;
}
if (NULL == AccessMap)
if (ND_NULL == AccessMap)
{
return ND_STATUS_INVALID_PARAMETER;
}
@ -96,7 +96,7 @@ NdGetFullAccessMap(
{
case ND_REG_GPR:
{
uint32_t k;
ND_UINT32 k;
for (k = 0; k < pOp->Info.Register.Count; k++)
{
@ -122,7 +122,7 @@ NdGetFullAccessMap(
break;
case ND_REG_SSE:
{
uint32_t k;
ND_UINT32 k;
for (k = 0; k < pOp->Info.Register.Count; k++)
{
@ -175,7 +175,7 @@ NdGetFullAccessMap(
}
else if (ND_OP_BANK == Instrux->Operands[i].Type)
{
uint8_t j;
ND_UINT8 j;
// Bank registers access. This needs special handling. Note that LOADALL/LOADALLD is not supported, as
// it is too old and it's not valid since the good old 486.
@ -225,12 +225,12 @@ NdGetOperandRlut(
ND_OPERAND_RLUT *Rlut
)
{
if (NULL == Instrux)
if (ND_NULL == Instrux)
{
return ND_STATUS_INVALID_PARAMETER;
}
if (NULL == Rlut)
if (ND_NULL == Rlut)
{
return ND_STATUS_INVALID_PARAMETER;
}
@ -238,16 +238,16 @@ NdGetOperandRlut(
// Initialize the RLUT.
nd_memset(Rlut, 0, sizeof(*Rlut));
for (uint8_t i = 0; i < Instrux->OperandsCount; i++)
for (ND_UINT8 i = 0; i < Instrux->OperandsCount; i++)
{
if (!!(Instrux->Operands[i].Access.Access & ND_ACCESS_ANY_WRITE))
{
// We only care about the first 2 destination operands.
if (Rlut->Dst1 == NULL)
if (Rlut->Dst1 == ND_NULL)
{
Rlut->Dst1 = (PND_OPERAND)&Instrux->Operands[i];
}
else if (Rlut->Dst2 == NULL)
else if (Rlut->Dst2 == ND_NULL)
{
Rlut->Dst2 = (PND_OPERAND)&Instrux->Operands[i];
}
@ -256,19 +256,19 @@ NdGetOperandRlut(
if (!!(Instrux->Operands[i].Access.Access & ND_ACCESS_ANY_READ))
{
// We only care about the first 4 source operands.
if (Rlut->Src1 == NULL)
if (Rlut->Src1 == ND_NULL)
{
Rlut->Src1 = (PND_OPERAND)&Instrux->Operands[i];
}
else if (Rlut->Src2 == NULL)
else if (Rlut->Src2 == ND_NULL)
{
Rlut->Src2 = (PND_OPERAND)&Instrux->Operands[i];
}
else if (Rlut->Src3 == NULL)
else if (Rlut->Src3 == ND_NULL)
{
Rlut->Src3 = (PND_OPERAND)&Instrux->Operands[i];
}
else if (Rlut->Src4 == NULL)
else if (Rlut->Src4 == ND_NULL)
{
Rlut->Src4 = (PND_OPERAND)&Instrux->Operands[i];
}
@ -277,11 +277,11 @@ NdGetOperandRlut(
if (Instrux->Operands[i].Type == ND_OP_MEM)
{
// We only care about the first 2 memory operands.
if (Rlut->Mem1 == NULL)
if (Rlut->Mem1 == ND_NULL)
{
Rlut->Mem1 = (PND_OPERAND)&Instrux->Operands[i];
}
else if (Rlut->Mem2 == NULL)
else if (Rlut->Mem2 == ND_NULL)
{
Rlut->Mem2 = (PND_OPERAND)&Instrux->Operands[i];
}

View File

@ -10,12 +10,12 @@
char *
nd_strcat_s(
char *dst,
size_t dst_size,
ND_SIZET dst_size,
const char *src
)
{
char *p;
size_t available;
ND_SIZET available;
p = dst;
available = dst_size;
@ -28,7 +28,7 @@ nd_strcat_s(
if (available == 0)
{
nd_memzero(dst, dst_size);
return NULL;
return (char *)ND_NULL;
}
while ((*p++ = *src++) != 0 && --available > 0);
@ -36,7 +36,7 @@ nd_strcat_s(
if (available == 0)
{
nd_memzero(dst, dst_size);
return NULL;
return (char *)ND_NULL;
}
return dst;
@ -45,18 +45,18 @@ nd_strcat_s(
#if !defined(BDDISASM_NO_FORMAT) && defined(BDDISASM_HAS_VSNPRINTF)
#include <stdio.h>
int nd_vsnprintf_s(char *buffer, size_t sizeOfBuffer, size_t count, const char *format, va_list argptr)
int nd_vsnprintf_s(char *buffer, ND_SIZET sizeOfBuffer, ND_SIZET count, const char *format, va_list argptr)
{
UNREFERENCED_PARAMETER(count);
return vsnprintf(buffer, sizeOfBuffer, format, argptr);
}
#endif // !defined(BDDISASM_NO_FORMAT) && defined(BDDISASM_HAS_VSNPRINTF)
#if !defined(BDDISASM_NO_FORMAT) && defined(BDDISASM_HAS_MEMSET)
#if defined(BDDISASM_HAS_MEMSET)
#include <string.h>
void *nd_memset(void *s, int c, size_t n)
void *nd_memset(void *s, int c, ND_SIZET n)
{
return memset(s, c, n);
}
#endif // !defined(BDDISASM_NO_FORMAT) && defined(BDDISASM_HAS_MEMSET)
#endif // defined(BDDISASM_HAS_MEMSET)

View File

@ -44711,7 +44711,7 @@ const ND_INSTRUCTION gInstructions[2701] =
{
ND_INS_WRUSS, ND_CAT_CET, ND_SET_CET_SS, 1659,
0,
ND_MOD_ANY,
ND_MOD_R0|ND_MOD_REAL|ND_MOD_V8086|ND_MOD_PROT|ND_MOD_COMPAT|ND_MOD_LONG|ND_MOD_VMXR|ND_MOD_VMXN|ND_MOD_VMXR_SEAM|ND_MOD_VMXN_SEAM|ND_MOD_VMX_OFF|ND_MOD_SMM|ND_MOD_SMM_OFF|ND_MOD_SGX_OFF|ND_MOD_TSX|ND_MOD_TSX_OFF,
0, ND_OPS_CNT(2, 0), 0, 0, 0, 0, 0, 0, ND_FLAG_SHS|ND_FLAG_MODRM, ND_CFF_CET_SS,
0,
0,
@ -44727,7 +44727,7 @@ const ND_INSTRUCTION gInstructions[2701] =
{
ND_INS_WRUSS, ND_CAT_CET, ND_SET_CET_SS, 1660,
0,
ND_MOD_ANY,
ND_MOD_R0|ND_MOD_REAL|ND_MOD_V8086|ND_MOD_PROT|ND_MOD_COMPAT|ND_MOD_LONG|ND_MOD_VMXR|ND_MOD_VMXN|ND_MOD_VMXR_SEAM|ND_MOD_VMXN_SEAM|ND_MOD_VMX_OFF|ND_MOD_SMM|ND_MOD_SMM_OFF|ND_MOD_SGX_OFF|ND_MOD_TSX|ND_MOD_TSX_OFF,
0, ND_OPS_CNT(2, 0), 0, 0, 0, 0, 0, 0, ND_FLAG_SHS|ND_FLAG_MODRM, ND_CFF_CET_SS,
0,
0,
@ -44743,7 +44743,7 @@ const ND_INSTRUCTION gInstructions[2701] =
{
ND_INS_XABORT, ND_CAT_UNCOND_BR, ND_SET_TSX, 1661,
0,
ND_MOD_R0|ND_MOD_R1|ND_MOD_R2|ND_MOD_R3|ND_MOD_REAL|ND_MOD_V8086|ND_MOD_PROT|ND_MOD_COMPAT|ND_MOD_LONG|ND_MOD_VMXR|ND_MOD_VMXN|ND_MOD_VMXR_SEAM|ND_MOD_VMXN_SEAM|ND_MOD_VMX_OFF|ND_MOD_SMM|ND_MOD_SMM_OFF|ND_MOD_SGX|ND_MOD_SGX_OFF|ND_MOD_TSX_OFF,
ND_MOD_ANY,
0, ND_OPS_CNT(1, 2), 0, 0, 0, 0, 0, 0, ND_FLAG_MODRM, ND_CFF_RTM,
0,
0,

View File

@ -11,54 +11,8 @@
#define UNREFERENCED_PARAMETER(P) ((void)(P))
#endif
#if defined(_MSC_VER)
#include <vadefs.h>
# ifndef _ADDRESSOF
# ifdef __cplusplus
# define _ADDRESSOF(v) ( &reinterpret_cast<const char &>(v) )
# else
# define _ADDRESSOF(v) ( &(v) )
# endif // __cplusplus
# endif // !_ADDRESSOF
# ifndef _KERNEL_MODE
# if defined(AMD64) || defined(WIN64)
# define _crt_va_start(ap, x) ( __va_start(&ap, x) )
# define _crt_va_arg(ap, t) ( ( sizeof(t) > sizeof(QWORD) || ( sizeof(t) & (sizeof(t) - 1) ) != 0 ) \
? **(t **)( ( ap += sizeof(QWORD) ) - sizeof(QWORD) ) \
: *(t *)( ( ap += sizeof(QWORD) ) - sizeof(QWORD) ) )
# define _crt_va_end(ap) ( ap = (va_list)0 )
# else
// a guess at the proper definitions for other platforms
# ifndef _INTSIZEOF
# define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
# endif // !_INTSIZEOF
# define _crt_va_start(ap,v) ( ap = (va_list)_ADDRESSOF(v) + _INTSIZEOF(v) )
# define _crt_va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
# define _crt_va_end(ap) ( ap = (va_list)0 )
# endif // AMD64 || WIN64
# define va_start _crt_va_start
# define va_arg _crt_va_arg
# define va_end _crt_va_end
#endif // _KERNEL_MODE
#else
# include <stdarg.h>
#if !defined(_MSC_VER)
# define __forceinline inline __attribute__((always_inline))
#endif // _MSC_VER
// By default, an integrator is expected to provide nd_vsnprintf_s and nd_strcat_s.
@ -66,10 +20,12 @@
// If BDDISASM_NO_FORMAT is defined at compile time these requirements are removed. Instruction formatting will no
// longer be available in bddisasm and emulation tracing will no longer be available in bdshemu.
#ifndef BDDISASM_NO_FORMAT
#include <stdarg.h>
extern int nd_vsnprintf_s(
char *buffer,
size_t sizeOfBuffer,
size_t count,
ND_SIZET sizeOfBuffer,
ND_SIZET count,
const char *format,
va_list argptr
);
@ -77,13 +33,13 @@ extern int nd_vsnprintf_s(
char *
nd_strcat_s(
char *dst,
size_t dst_size,
ND_SIZET dst_size,
const char *src
);
#endif // !BDDISASM_NO_FORMAT
// Declared here only. Expecting it to be defined in the integrator.
extern void *nd_memset(void *s, int c, size_t n);
extern void *nd_memset(void *s, int c, ND_SIZET n);
#define nd_memzero(Dest, Size) nd_memset((Dest), 0, (Size))

View File

@ -10,7 +10,7 @@
#define ND_PREF_CODE_EX 2
#define ND_PREF_CODE_REX 3
static const uint8_t gPrefixesMap[256] =
static const ND_UINT8 gPrefixesMap[256] =
{
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,8 @@
#ifndef TABLEDEFS_H
#define TABLEDEFS_H
#include "../inc/disasmtypes.h"
//
// Types of tables.
//
@ -80,104 +82,104 @@ typedef enum _ND_ILUT_TYPE
typedef struct _ND_TABLE
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[1];
} ND_TABLE, *PND_TABLE;
typedef struct _ND_TABLE_INSTRUCTION
{
uint32_t Type;
ND_UINT32 Type;
const void *Instruction;
} ND_TABLE_INSTRUCTION, *PND_TABLE_INSTRUCTION;
typedef struct _ND_TABLE_OPCODE
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[256];
} ND_TABLE_OPCODE, *PND_TABLE_OPCODE;
typedef struct _ND_TABLE_MODRM_MOD
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[2];
} ND_TABLE_MODRM_MOD, *PND_TABLE_MODRM_MOD;
typedef struct _ND_TABLE_MODRM_REG
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[8];
} ND_TABLE_MODRM_REG, *PND_TABLE_MODRM_REG;
typedef struct _ND_TABLE_MODRM_RM
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[8];
} ND_TABLE_MODRM_RM, *PND_TABLE_MODRM_RM;
typedef struct _ND_TABLE_MPREFIX
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[4];
} ND_TABLE_MPREFIX, *PND_TABLE_MPREFIX;
typedef struct _ND_TABLE_AUXILIARY
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[6];
} ND_TABLE_AUXILIARY, *PND_TABLE_AUXILIARY;
typedef struct _ND_TABLE_VENDOR
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[6];
} ND_TABLE_VENDOR;
typedef struct _ND_TABLE_FEATURE
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[4];
} ND_TABLE_FEATURE;
typedef struct _ND_TABLE_DSIZE
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[6];
} ND_TABLE_DSIZE, *PND_TABLE_DSIZE;
typedef struct _ND_TABLE_ASIZE
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[4];
} ND_TABLE_ASIZE, *PND_TABLE_ASIZE;
typedef struct _ND_TABLE_MODE
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[4];
} ND_TABLE_MODE, *PND_TABLE_MODE;
typedef struct _ND_TABLE_VEX_MMMMM
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[32];
} ND_TABLE_VEX_MMMMM, *PND_TABLE_VEX_MMMMM;
typedef struct _ND_TABLE_VEX_PP
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[4];
} ND_TABLE_VEX_PP, *PND_TABLE_VEX_PP;
typedef struct _ND_TABLE_VEX_L
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[4];
} ND_TABLE_VEX_L, *PND_TABLE_VEX_L;
typedef struct _ND_TABLE_VEX_W
{
uint32_t Type;
ND_UINT32 Type;
const void *Table[8];
} ND_TABLE_VEX_W, *PND_TABLE_VEX_W;
@ -194,37 +196,37 @@ __attribute__((aligned(128)))
#endif
typedef struct _ND_INSTRUCTION
{
uint16_t Instruction; // Instruction identifier. Check ND_INS_CLASS definitions.
uint8_t Category; // Instruction category. Check ND_INS_TYPE.
uint8_t IsaSet; // Instruction set. Check ND_INS_SET.
uint16_t Mnemonic; // Mnemonic (index inside the global mnemonic table).
ND_UINT16 Instruction; // Instruction identifier. Check ND_INS_CLASS definitions.
ND_UINT8 Category; // Instruction category. Check ND_INS_TYPE.
ND_UINT8 IsaSet; // Instruction set. Check ND_INS_SET.
ND_UINT16 Mnemonic; // Mnemonic (index inside the global mnemonic table).
uint16_t ValidPrefixes; // Accepted prefixes.
uint32_t ValidModes; // Valid operating modes for the instruction.
uint8_t ValidDecorators;// Accepted decorators (valid for EVEX instructions).
ND_UINT16 ValidPrefixes; // Accepted prefixes.
ND_UINT32 ValidModes; // Valid operating modes for the instruction.
ND_UINT8 ValidDecorators;// Accepted decorators (valid for EVEX instructions).
uint8_t OpsCount; // Low 4 bits: explicit operands count; high 4 bits: implicit ops count.
ND_UINT8 OpsCount; // Low 4 bits: explicit operands count; high 4 bits: implicit ops count.
uint8_t TupleType; // EVEX tuple type.
uint8_t ExcType : 5; // SSE/VEX/EVEX/OPMASK/AMX exception type.
uint8_t ExcClass : 3; // Indicates the exception class (SSE/AVX, EVEX, OPMASK or AMX).
ND_UINT8 TupleType; // EVEX tuple type.
ND_UINT8 ExcType : 5; // SSE/VEX/EVEX/OPMASK/AMX exception type.
ND_UINT8 ExcClass : 3; // Indicates the exception class (SSE/AVX, EVEX, OPMASK or AMX).
uint8_t FpuFlags; // FPU status word C0, C1, C2 & C3 access type.
ND_UINT8 FpuFlags; // FPU status word C0, C1, C2 & C3 access type.
uint8_t Reserved2;
uint16_t Reserved3;
ND_UINT8 Reserved2;
ND_UINT16 Reserved3;
uint32_t Attributes; // Instruction attributes.
uint64_t CpuidFlag; // Required CPUID feature flag.
ND_UINT32 Attributes; // Instruction attributes.
ND_UINT64 CpuidFlag; // Required CPUID feature flag.
// Per-flag access. Undefined flags will have their bit set in both the "Set" and "Cleared" mask, since a flag
// cannot be both cleared and set.
uint32_t TestedFlags; // Tested flags.
uint32_t ModifiedFlags; // Modified flags.
uint32_t SetFlags; // Flags that are always set to 1.
uint32_t ClearedFlags; // Flags that are always cleared.
ND_UINT32 TestedFlags; // Tested flags.
ND_UINT32 ModifiedFlags; // Modified flags.
ND_UINT32 SetFlags; // Flags that are always set to 1.
ND_UINT32 ClearedFlags; // Flags that are always cleared.
uint64_t Operands[10];
ND_UINT64 Operands[10];
} ND_INSTRUCTION, *PND_INSTRUCTION;
#ifdef _MSC_VER
#pragma warning(pop)
@ -241,12 +243,12 @@ typedef struct _ND_INSTRUCTION
// Byte 4: operand decorators
// Byte 5: operand block addressing mode - 0 if not block addressing
//
#define ND_OP(type, size, flags, acc, dec, block) (((uint64_t)((type) & 0xFF) << 0) | \
((uint64_t)((size) & 0xFF) << 8) | \
((uint64_t)((flags) & 0xFF) << 16) | \
((uint64_t)((acc) & 0xFF) << 24) | \
((uint64_t)((dec) & 0xFF) << 32) | \
((uint64_t)((block) & 0xFF) << 40))
#define ND_OP(type, size, flags, acc, dec, block) (((ND_UINT64)((type) & 0xFF) << 0) | \
((ND_UINT64)((size) & 0xFF) << 8) | \
((ND_UINT64)((flags) & 0xFF) << 16) | \
((ND_UINT64)((acc) & 0xFF) << 24) | \
((ND_UINT64)((dec) & 0xFF) << 32) | \
((ND_UINT64)((block) & 0xFF) << 40))
#define OP ND_OP

View File

@ -114,9 +114,9 @@
ISA Set: CET_SS, Ins cat: CET, CET tracked: no
CPUID leaf: 0x00000007, sub-leaf: 0x00000000, reg: ecx, bit: 7
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
R0: yes, R1: no, R2: no, R3: no
Real: yes, V8086: yes, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
SMM on: yes, SMM off: yes, SGX on: no, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no
@ -131,9 +131,9 @@
ISA Set: CET_SS, Ins cat: CET, CET tracked: no
CPUID leaf: 0x00000007, sub-leaf: 0x00000000, reg: ecx, bit: 7
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
R0: yes, R1: no, R2: no, R3: no
Real: yes, V8086: yes, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
SMM on: yes, SMM off: yes, SGX on: no, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no

View File

@ -39,7 +39,7 @@
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
Real: yes, V8086: yes, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: no, TSX off: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no

View File

@ -133,9 +133,9 @@
ISA Set: CET_SS, Ins cat: CET, CET tracked: no
CPUID leaf: 0x00000007, sub-leaf: 0x00000000, reg: ecx, bit: 7
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
R0: yes, R1: no, R2: no, R3: no
Real: yes, V8086: yes, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
SMM on: yes, SMM off: yes, SGX on: no, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no

View File

@ -167,9 +167,9 @@
ISA Set: CET_SS, Ins cat: CET, CET tracked: no
CPUID leaf: 0x00000007, sub-leaf: 0x00000000, reg: ecx, bit: 7
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
R0: yes, R1: no, R2: no, R3: no
Real: yes, V8086: yes, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
SMM on: yes, SMM off: yes, SGX on: no, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no
@ -184,9 +184,9 @@
ISA Set: CET_SS, Ins cat: CET, CET tracked: no
CPUID leaf: 0x00000007, sub-leaf: 0x00000000, reg: ecx, bit: 7
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
R0: yes, R1: no, R2: no, R3: no
Real: yes, V8086: yes, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
SMM on: yes, SMM off: yes, SGX on: no, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugKernel|ARM64">
<Configuration>DebugKernel</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugKernel|Win32">
<Configuration>DebugKernel</Configuration>
<Platform>Win32</Platform>
@ -9,10 +13,18 @@
<Configuration>DebugKernel</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseKernel|ARM64">
<Configuration>ReleaseKernel</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseKernel|Win32">
<Configuration>ReleaseKernel</Configuration>
<Platform>Win32</Platform>
@ -21,6 +33,10 @@
<Configuration>ReleaseKernel</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -79,6 +95,12 @@
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
@ -88,6 +110,15 @@
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<TargetVersion></TargetVersion>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@ -95,6 +126,13 @@
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@ -105,6 +143,16 @@
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<TargetVersion></TargetVersion>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
@ -125,15 +173,27 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|ARM64'" 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|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|ARM64'" 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>
@ -153,12 +213,24 @@
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<LinkIncremental>true</LinkIncremental>
<TargetExt>.lib</TargetExt>
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'">
<LinkIncremental>true</LinkIncremental>
<TargetExt>.lib</TargetExt>
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|ARM64'">
<LinkIncremental>true</LinkIncremental>
<TargetExt>.lib</TargetExt>
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
@ -177,12 +249,24 @@
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
<TargetExt>.lib</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
<TargetExt>.lib</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
<TargetExt>.lib</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|ARM64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
<TargetExt>.lib</TargetExt>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
@ -253,6 +337,37 @@
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>..\inc;..\bddisasm\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<StringPooling>true</StringPooling>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalOptions>/D "AMD64" %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>bddisasm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)bin\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
@ -284,6 +399,37 @@
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|ARM64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>..\inc;..\bddisasm\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<StringPooling>true</StringPooling>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalOptions>/kernel /D "AMD64" %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>bddisasm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)bin\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
@ -363,6 +509,46 @@
<ExceptionHandling>Sync</ExceptionHandling>
<MinimalRebuild>true</MinimalRebuild>
<AdditionalOptions>/D "AMD64" %(AdditionalOptions)</AdditionalOptions>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>bddisasm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)bin\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Lib />
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>
</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>..\inc;..\bddisasm\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
<ShowIncludes>false</ShowIncludes>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<StringPooling>true</StringPooling>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<ExceptionHandling>Sync</ExceptionHandling>
<MinimalRebuild>true</MinimalRebuild>
<AdditionalOptions>/D "AMD64" %(AdditionalOptions)</AdditionalOptions>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@ -415,6 +601,44 @@
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|ARM64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>
</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>..\inc;..\bddisasm\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
<ShowIncludes>false</ShowIncludes>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<StringPooling>true</StringPooling>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<ExceptionHandling>Sync</ExceptionHandling>
<MinimalRebuild>true</MinimalRebuild>
<AdditionalOptions>/kernel /D "AMD64" %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>bddisasm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)bin\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Lib />
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="bdshemu.c" />
</ItemGroup>

View File

@ -12,7 +12,7 @@ from setuptools import find_packages, setup, Command, Extension, Distribution
from codecs import open
VERSION = (0, 1, 3)
LIBRARY_VERSION = (1, 34, 9)
LIBRARY_VERSION = (1, 34, 10)
LIBRARY_INSTRUX_SIZE = 856
packages = ['pybddisasm']

File diff suppressed because it is too large Load Diff

View File

@ -27,13 +27,13 @@ typedef void
// Note that by using the ShemuContext, the integrator knows whether the access is user or supervisor (the Ring field
// inside ShemuContext), and he knows whether it is 16/32/64 bit mode (Mode field inside ShemuContext).
//
typedef bool
typedef ND_BOOL
(*ShemuMemAccess)(
void *ShemuContext, // Shemu emulation context.
uint64_t Gla, // Linear address to be accessed.
size_t Size, // Number of bytes to access.
uint8_t *Buffer, // Contains the read content (if Store is false), or the value to be stored at Gla.
bool Store // If false, read content at Gla. Otherwise, write content at Gla.
ND_UINT64 Gla, // Linear address to be accessed.
ND_SIZET Size, // Number of bytes to access.
ND_UINT8 *Buffer, // Contains the read content (if Store is false), or the value to be stored at Gla.
ND_BOOL Store // If false, read content at Gla. Otherwise, write content at Gla.
);
@ -51,36 +51,35 @@ typedef bool
//
typedef struct _SHEMU_GPR_REGS
{
uint64_t RegRax;
uint64_t RegRcx;
uint64_t RegRdx;
uint64_t RegRbx;
uint64_t RegRsp;
uint64_t RegRbp;
uint64_t RegRsi;
uint64_t RegRdi;
uint64_t RegR8;
uint64_t RegR9;
uint64_t RegR10;
uint64_t RegR11;
uint64_t RegR12;
uint64_t RegR13;
uint64_t RegR14;
uint64_t RegR15;
uint64_t RegCr2;
uint64_t RegFlags;
uint64_t RegDr7;
uint64_t RegRip;
uint64_t RegCr0;
uint64_t RegCr4;
uint64_t RegCr3;
uint64_t RegCr8;
uint64_t RegIdtBase;
uint64_t RegIdtLimit;
uint64_t RegGdtBase;
uint64_t RegGdtLimit;
uint64_t FpuRip;
ND_UINT64 RegRax;
ND_UINT64 RegRcx;
ND_UINT64 RegRdx;
ND_UINT64 RegRbx;
ND_UINT64 RegRsp;
ND_UINT64 RegRbp;
ND_UINT64 RegRsi;
ND_UINT64 RegRdi;
ND_UINT64 RegR8;
ND_UINT64 RegR9;
ND_UINT64 RegR10;
ND_UINT64 RegR11;
ND_UINT64 RegR12;
ND_UINT64 RegR13;
ND_UINT64 RegR14;
ND_UINT64 RegR15;
ND_UINT64 RegCr2;
ND_UINT64 RegFlags;
ND_UINT64 RegDr7;
ND_UINT64 RegRip;
ND_UINT64 RegCr0;
ND_UINT64 RegCr4;
ND_UINT64 RegCr3;
ND_UINT64 RegCr8;
ND_UINT64 RegIdtBase;
ND_UINT64 RegIdtLimit;
ND_UINT64 RegGdtBase;
ND_UINT64 RegGdtLimit;
ND_UINT64 FpuRip;
} SHEMU_GPR_REGS, *PSHEMU_GPR_REGS;
@ -89,10 +88,10 @@ typedef struct _SHEMU_GPR_REGS
//
typedef struct _SHEMU_SEG
{
uint64_t Base;
uint64_t Limit;
uint64_t Selector;
uint64_t AccessRights;
ND_UINT64 Base;
ND_UINT64 Limit;
ND_UINT64 Selector;
ND_UINT64 AccessRights;
} SHEMU_SEG, *PSHEMU_SEG;
@ -127,85 +126,85 @@ typedef struct _SHEMU_CONTEXT
SHEMU_SEG_REGS Segments;
// MMX register state. 8 x 8 bytes = 64 bytes for the MMX registers. Can be provided on input, if needed.
uint64_t MmxRegisters[ND_MAX_MMX_REGS];
ND_UINT64 MmxRegisters[ND_MAX_MMX_REGS];
// SSE registers state. 32 x 64 bytes = 2048 bytes for the SSE registers. Can be provided on input, if needed.
uint8_t SseRegisters[ND_MAX_SSE_REGS * ND_MAX_REGISTER_SIZE];
ND_UINT8 SseRegisters[ND_MAX_SSE_REGS * ND_MAX_REGISTER_SIZE];
// General purpose registers write bitmap. After the first write, a register will be marked dirty in here.
// Should be 0 on input.
uint16_t DirtyGprBitmap;
ND_UINT16 DirtyGprBitmap;
// Operating mode (ND_CODE_16, ND_CODE_32 or ND_CODE_64). Must be provided as input.
uint8_t Mode;
ND_UINT8 Mode;
// Operating ring (0, 1, 2, 3). Must be provided as input.
uint8_t Ring;
ND_UINT8 Ring;
// The suspicious code to be emulated. Must be provided as input.
uint8_t *Shellcode;
ND_UINT8 *Shellcode;
// Virtual stack. RSP will point somewhere inside. Must be allocated as input, and it can be initialized with
// actual stack contents. Can also be 0-filled.
uint8_t *Stack;
ND_UINT8 *Stack;
// Internal use. Must be at least the size of the shell + stack. Needs not be initialized, but must be allocated
// and accessible on input.
uint8_t *Intbuf;
ND_UINT8 *Intbuf;
// Shellcode base address (the address the shellcode would see). Must be provided as input.
uint64_t ShellcodeBase;
ND_UINT64 ShellcodeBase;
// Stack base address (the RSP the shellcode would see). Must be provided as input.
uint64_t StackBase;
ND_UINT64 StackBase;
// Shellcode size. Must be provided as input. Usually just a page in size, but can be larger.
uint32_t ShellcodeSize;
ND_UINT32 ShellcodeSize;
// Stack size. Must be provided as input. Minimum two pages.
uint32_t StackSize;
ND_UINT32 StackSize;
// Internal buffer size. Must be provided as input. Must be at least the size of the shell + stack.
uint32_t IntbufSize;
ND_UINT32 IntbufSize;
// Number of NOPs encountered. Should be 0 on input.
uint32_t NopCount;
ND_UINT32 NopCount;
// The length of the string constructed on the stack, if any. Should be 0 on input.
uint32_t StrLength;
ND_UINT32 StrLength;
// Number of external memory access (outside stack/shellcode). Should be 0 on input.
uint32_t ExtMemAccess;
ND_UINT32 ExtMemAccess;
// Number of emulated instructions. Should be 0 on input. Once InstructionsCount reaches MaxInstructionsCount,
// emulation will stop.
uint32_t InstructionsCount;
ND_UINT32 InstructionsCount;
// Max number of instructions that should be emulated. Once this limit has been reached, emulation will stop.
// Lower values will mean faster processing, but less chances of detection. Higher values mean low performance,
// but very high chances of yielding useful results. Must be provided as input.
uint32_t MaxInstructionsCount;
ND_UINT32 MaxInstructionsCount;
// Base address of the Thread Information Block (the TIB the shellcode would normally see). Must be provided as
// input.
uint64_t TibBase;
ND_UINT64 TibBase;
// Shellcode Flags (see SHEMU_FLAG_*). Must be provided as input.
uint64_t Flags;
ND_UINT64 Flags;
// Emulation options. See SHEMU_OPT_* for possible options. Must be provided as input.
uint32_t Options;
ND_UINT32 Options;
// Percent of NOPs (out of total instructions emulated) that trigger NOP sled detection. Must be provided as input.
uint32_t NopThreshold;
ND_UINT32 NopThreshold;
// Stack string length threshold. Stack-constructed strings must be at least this long to trigger stack string
// detection. Must be provided as input.
uint32_t StrThreshold;
ND_UINT32 StrThreshold;
// Number of external mem accesses threshold. No more than this number of external accesses will be issued. Must
// be provided as input.
uint32_t MemThreshold;
ND_UINT32 MemThreshold;
// Optional auxiliary data, provided by the integrator. Can be NULL, or can point to integrator specific data.
// Shemu will not use this data in any way, but callbacks that receive a SHEMU_CONTEXT pointer (such as

View File

@ -5,7 +5,7 @@
#define ND_CFF_NO_SUBLEAF 0x00FFFFFF
#define ND_CFF(leaf, subleaf, reg, bit) ((uint64_t)(leaf) | ((uint64_t)((subleaf) & 0xFFFFFF) << 32) | ((uint64_t)(reg) << 56) | ((uint64_t)(bit) << 59))
#define ND_CFF(leaf, subleaf, reg, bit) ((ND_UINT64)(leaf) | ((ND_UINT64)((subleaf) & 0xFFFFFF) << 32) | ((ND_UINT64)(reg) << 56) | ((ND_UINT64)(bit) << 59))
#define ND_CFF_FPU ND_CFF(0x00000001, 0xFFFFFFFF, NDR_EDX, 0)
#define ND_CFF_MSR ND_CFF(0x00000001, 0xFFFFFFFF, NDR_EDX, 5)

View File

@ -8,7 +8,7 @@
//
// Return statuses.
//
typedef unsigned int NDSTATUS;
typedef ND_UINT32 NDSTATUS;
// Success codes are all < 0x80000000.
#define ND_STATUS_SUCCESS 0x00000000 // All good.

View File

@ -5,35 +5,96 @@
#ifndef DISASM_TYPES_H
#define DISASM_TYPES_H
#if defined(_KERNEL_MODE) && defined(_MSC_VER)
# include <ntddk.h>
# include <Ntstrsafe.h>
# include <basetsd.h>
typedef UINT8 uint8_t;
typedef UINT16 uint16_t;
typedef UINT32 uint32_t;
typedef UINT64 uint64_t;
#if defined(_MSC_VER) || defined(__ICC) || defined(__INTEL_COMPILER)
typedef INT8 int8_t;
typedef INT16 int16_t;
typedef INT32 int32_t;
typedef INT64 int64_t;
// Microsoft VC compiler.
typedef _Bool bool;
#define false 0
#define true 1
typedef unsigned __int8 ND_UINT8;
typedef unsigned __int16 ND_UINT16;
typedef unsigned __int32 ND_UINT32;
typedef unsigned __int64 ND_UINT64;
typedef signed __int8 ND_SINT8;
typedef signed __int16 ND_SINT16;
typedef signed __int32 ND_SINT32;
typedef signed __int64 ND_SINT64;
#elif defined(__KERNEL__) && defined(__GNUC__)
#elif defined(__GNUC__) || defined(__GNUG__) || defined(__clang__)
# include <linux/types.h>
// clang/GCC compiler.
typedef __UINT8_TYPE__ ND_UINT8;
typedef __UINT16_TYPE__ ND_UINT16;
typedef __UINT32_TYPE__ ND_UINT32;
typedef __UINT64_TYPE__ ND_UINT64;
typedef __INT8_TYPE__ ND_SINT8;
typedef __INT16_TYPE__ ND_SINT16;
typedef __INT32_TYPE__ ND_SINT32;
typedef __INT64_TYPE__ ND_SINT64;
#else
# include <stddef.h>
# include <stdint.h>
# include <stdbool.h>
// other compilers, assume stdint is present.
#include <stdint.h>
typedef uint8_t ND_UINT8;
typedef uint16_t ND_UINT16;
typedef uint32_t ND_UINT32;
typedef uint64_t ND_UINT64;
typedef int8_t ND_SINT8;
typedef int16_t ND_SINT16;
typedef int32_t ND_SINT32;
typedef int64_t ND_SINT64;
#endif
#if defined(_M_AMD64) || defined(__x86_64__)
#define ND_ARCH_X64
#elif defined(_M_IX86) || defined(__i386__)
#define ND_ARCH_X86
#elif defined(_M_ARM64) || defined(__aarch64__)
#define ND_ARCH_AARCH64
#elif defined(_M_ARM) || defined(__arm__)
#define ND_ARCH_ARM
#else
#error "Unknown architecture!"
#endif
// Handle architecture definitions.
#if defined(ND_ARCH_X64) || defined(ND_ARCH_AARCH64)
typedef ND_UINT64 ND_SIZET;
#elif defined(ND_ARCH_X86) || defined(ND_ARCH_ARM)
typedef ND_UINT32 ND_SIZET;
#else
#error "Unknown architecture!"
#endif
// Common definitions.
typedef ND_UINT8 ND_BOOL;
#define ND_NULL ((void *)(0))
#define ND_TRUE (1)
#define ND_FALSE (0)
#endif

View File

@ -7,6 +7,6 @@
#define DISASM_VERSION_MAJOR 1
#define DISASM_VERSION_MINOR 34
#define DISASM_VERSION_REVISION 9
#define DISASM_VERSION_REVISION 10
#endif // DISASM_VER_H

View File

@ -1215,7 +1215,7 @@ def dump_translation_tree_c(t, hname, f):
i = 0
for p in pointers:
if not p:
res += ' /* %02x */ NULL,\n' % i
res += ' /* %02x */ ND_NULL,\n' % i
else:
res += ' /* %02x */ (const void *)&%s,\n' % (i, p)
i += 1
@ -1250,7 +1250,7 @@ def generate_features(features, fname):
f.write('#define ND_CFF_NO_SUBLEAF 0x00FFFFFF\n')
f.write('\n')
f.write('\n')
f.write('#define ND_CFF(leaf, subleaf, reg, bit) ((uint64_t)(leaf) | ((uint64_t)((subleaf) & 0xFFFFFF) << 32) | ((uint64_t)(reg) << 56) | ((uint64_t)(bit) << 59))\n')
f.write('#define ND_CFF(leaf, subleaf, reg, bit) ((ND_UINT64)(leaf) | ((ND_UINT64)((subleaf) & 0xFFFFFF) << 32) | ((ND_UINT64)(reg) << 56) | ((ND_UINT64)(bit) << 59))\n')
f.write('\n')
for c in features:

View File

@ -125,8 +125,8 @@ MOVBE Mv,Gv nil [ 0x0F 0x
MOVBE Mv,Gv nil [ 0x66 0x0F 0x38 0xF1 /r:mem] s:MOVBE, t:DATAXFER, w:W|R, a:S66
CRC32 Gy,Ev nil [ 0xF2 0x0F 0x38 0xF1 /r] s:SSE42, t:SSE, w:RW|R
CRC32 Gy,Ev nil [ 0x66 0xF2 0x0F 0x38 0xF1 /r] s:SSE42, t:SSE, w:RW|R, a:S66
WRUSSD My,Gy nil [ 0x66 0x0F 0x38 0xF5 /r:mem] s:CET_SS, t:CET, c:WRUSS, a:SHS, w:W|R
WRUSSQ My,Gy nil [ rexw 0x66 0x0F 0x38 0xF5 /r:mem] s:CET_SS, t:CET, c:WRUSS, a:SHS, w:W|R
WRUSSD My,Gy nil [ 0x66 0x0F 0x38 0xF5 /r:mem] s:CET_SS, t:CET, c:WRUSS, a:SHS, w:W|R, m:KERNEL
WRUSSQ My,Gy nil [ rexw 0x66 0x0F 0x38 0xF5 /r:mem] s:CET_SS, t:CET, c:WRUSS, a:SHS, w:W|R, m:KERNEL
WRSSD My,Gy nil [ NP 0x0F 0x38 0xF6 /r:mem] s:CET_SS, t:CET, c:WRSS, a:SHS, w:W|R
WRSSQ My,Gy nil [ rexw NP 0x0F 0x38 0xF6 /r:mem] s:CET_SS, t:CET, c:WRSS, a:SHS, w:W|R
ADCX Gy,Ey Fv [ 0x66 0x0F 0x38 0xF6 /r] s:ADX, t:ARITH, w:RW|R|RW, f:CF=m

View File

@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -43,6 +51,12 @@
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@ -50,6 +64,13 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
@ -64,9 +85,15 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" 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|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" 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'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
@ -80,10 +107,18 @@
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
@ -104,6 +139,16 @@
<Command>generate_tables.py instructions</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
<PreBuildEvent>
<Command>generate_tables.py instructions</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
@ -136,6 +181,22 @@
<Command>generate_tables.py instructions</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Command>generate_tables.py instructions</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="disasmlib.py" />
<None Include="generate_tables.py" />