Skip to content

Commit 8de8dc2

Browse files
authored
Merge pull request hfiref0x#3 from ww898/ww898-add-arm-and-arm64
Add ARM64/ARM architectures
2 parents 41a081a + 17365c9 commit 8de8dc2

5 files changed

+206
-4
lines changed

Source/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
output/
2+
.vs/

Source/AuthHashCalc.sln

+12
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,28 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AuthHashCalc", "AuthHashCal
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|ARM = Debug|ARM
11+
Debug|ARM64 = Debug|ARM64
1012
Debug|x64 = Debug|x64
1113
Debug|x86 = Debug|x86
14+
Release|ARM = Release|ARM
15+
Release|ARM64 = Release|ARM64
1216
Release|x64 = Release|x64
1317
Release|x86 = Release|x86
1418
EndGlobalSection
1519
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Debug|ARM.ActiveCfg = Debug|ARM
21+
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Debug|ARM.Build.0 = Debug|ARM
22+
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Debug|ARM64.ActiveCfg = Debug|ARM64
23+
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Debug|ARM64.Build.0 = Debug|ARM64
1624
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Debug|x64.ActiveCfg = Debug|x64
1725
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Debug|x64.Build.0 = Debug|x64
1826
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Debug|x86.ActiveCfg = Debug|Win32
1927
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Debug|x86.Build.0 = Debug|Win32
28+
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Release|ARM.ActiveCfg = Release|ARM
29+
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Release|ARM.Build.0 = Release|ARM
30+
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Release|ARM64.ActiveCfg = Release|ARM64
31+
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Release|ARM64.Build.0 = Release|ARM64
2032
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Release|x64.ActiveCfg = Release|x64
2133
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Release|x64.Build.0 = Release|x64
2234
{9C56E125-EBEC-4D29-B487-DC7A97661FCE}.Release|x86.ActiveCfg = Release|Win32

Source/AuthHashCalc.vcxproj

+168
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|ARM">
5+
<Configuration>Debug</Configuration>
6+
<Platform>ARM</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Debug|ARM64">
9+
<Configuration>Debug</Configuration>
10+
<Platform>ARM64</Platform>
11+
</ProjectConfiguration>
412
<ProjectConfiguration Include="Debug|Win32">
513
<Configuration>Debug</Configuration>
614
<Platform>Win32</Platform>
715
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|ARM">
17+
<Configuration>Release</Configuration>
18+
<Platform>ARM</Platform>
19+
</ProjectConfiguration>
20+
<ProjectConfiguration Include="Release|ARM64">
21+
<Configuration>Release</Configuration>
22+
<Platform>ARM64</Platform>
23+
</ProjectConfiguration>
824
<ProjectConfiguration Include="Release|Win32">
925
<Configuration>Release</Configuration>
1026
<Platform>Win32</Platform>
@@ -45,13 +61,39 @@
4561
<PlatformToolset>v142</PlatformToolset>
4662
<CharacterSet>Unicode</CharacterSet>
4763
</PropertyGroup>
64+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
65+
<ConfigurationType>Application</ConfigurationType>
66+
<UseDebugLibraries>true</UseDebugLibraries>
67+
<PlatformToolset>v142</PlatformToolset>
68+
<CharacterSet>Unicode</CharacterSet>
69+
</PropertyGroup>
70+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
71+
<ConfigurationType>Application</ConfigurationType>
72+
<UseDebugLibraries>true</UseDebugLibraries>
73+
<PlatformToolset>v142</PlatformToolset>
74+
<CharacterSet>Unicode</CharacterSet>
75+
</PropertyGroup>
4876
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4977
<ConfigurationType>Application</ConfigurationType>
5078
<UseDebugLibraries>false</UseDebugLibraries>
5179
<PlatformToolset>v142</PlatformToolset>
5280
<WholeProgramOptimization>true</WholeProgramOptimization>
5381
<CharacterSet>Unicode</CharacterSet>
5482
</PropertyGroup>
83+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
84+
<ConfigurationType>Application</ConfigurationType>
85+
<UseDebugLibraries>false</UseDebugLibraries>
86+
<PlatformToolset>v142</PlatformToolset>
87+
<WholeProgramOptimization>true</WholeProgramOptimization>
88+
<CharacterSet>Unicode</CharacterSet>
89+
</PropertyGroup>
90+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
91+
<ConfigurationType>Application</ConfigurationType>
92+
<UseDebugLibraries>false</UseDebugLibraries>
93+
<PlatformToolset>v142</PlatformToolset>
94+
<WholeProgramOptimization>true</WholeProgramOptimization>
95+
<CharacterSet>Unicode</CharacterSet>
96+
</PropertyGroup>
5597
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5698
<ImportGroup Label="ExtensionSettings">
5799
</ImportGroup>
@@ -66,9 +108,21 @@
66108
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
67109
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68110
</ImportGroup>
111+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
112+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
113+
</ImportGroup>
114+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
115+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
116+
</ImportGroup>
69117
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70118
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71119
</ImportGroup>
120+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
121+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
122+
</ImportGroup>
123+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
124+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
125+
</ImportGroup>
72126
<PropertyGroup Label="UserMacros" />
73127
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74128
<LinkIncremental>true</LinkIncremental>
@@ -89,12 +143,36 @@
89143
<IntDir>.\output\$(Platform)\$(Configuration)\</IntDir>
90144
<TargetName>ahc64</TargetName>
91145
</PropertyGroup>
146+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
147+
<LinkIncremental>true</LinkIncremental>
148+
<OutDir>.\output\$(Platform)\$(Configuration)\</OutDir>
149+
<IntDir>.\output\$(Platform)\$(Configuration)\</IntDir>
150+
<TargetName>ahc32a</TargetName>
151+
</PropertyGroup>
152+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
153+
<LinkIncremental>true</LinkIncremental>
154+
<OutDir>.\output\$(Platform)\$(Configuration)\</OutDir>
155+
<IntDir>.\output\$(Platform)\$(Configuration)\</IntDir>
156+
<TargetName>ahc64a</TargetName>
157+
</PropertyGroup>
92158
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
93159
<OutDir>.\output\$(Platform)\$(Configuration)\</OutDir>
94160
<IntDir>.\output\$(Platform)\$(Configuration)\</IntDir>
95161
<TargetName>ahc64</TargetName>
96162
<CodeAnalysisRuleSet>NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
97163
</PropertyGroup>
164+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
165+
<OutDir>.\output\$(Platform)\$(Configuration)\</OutDir>
166+
<IntDir>.\output\$(Platform)\$(Configuration)\</IntDir>
167+
<TargetName>ahc32a</TargetName>
168+
<CodeAnalysisRuleSet>NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
169+
</PropertyGroup>
170+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
171+
<OutDir>.\output\$(Platform)\$(Configuration)\</OutDir>
172+
<IntDir>.\output\$(Platform)\$(Configuration)\</IntDir>
173+
<TargetName>ahc64a</TargetName>
174+
<CodeAnalysisRuleSet>NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
175+
</PropertyGroup>
98176
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
99177
<ClCompile>
100178
<WarningLevel>Level4</WarningLevel>
@@ -157,6 +235,40 @@
157235
<AdditionalManifestFiles>ahc.manifest</AdditionalManifestFiles>
158236
</Manifest>
159237
</ItemDefinitionGroup>
238+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
239+
<ClCompile>
240+
<WarningLevel>Level4</WarningLevel>
241+
<SDLCheck>true</SDLCheck>
242+
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
243+
<ConformanceMode>true</ConformanceMode>
244+
</ClCompile>
245+
<Link>
246+
<SubSystem>Windows</SubSystem>
247+
<GenerateDebugInformation>true</GenerateDebugInformation>
248+
<EntryPointSymbol>
249+
</EntryPointSymbol>
250+
</Link>
251+
<Manifest>
252+
<AdditionalManifestFiles>ahc.manifest</AdditionalManifestFiles>
253+
</Manifest>
254+
</ItemDefinitionGroup>
255+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
256+
<ClCompile>
257+
<WarningLevel>Level4</WarningLevel>
258+
<SDLCheck>true</SDLCheck>
259+
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
260+
<ConformanceMode>true</ConformanceMode>
261+
</ClCompile>
262+
<Link>
263+
<SubSystem>Windows</SubSystem>
264+
<GenerateDebugInformation>true</GenerateDebugInformation>
265+
<EntryPointSymbol>
266+
</EntryPointSymbol>
267+
</Link>
268+
<Manifest>
269+
<AdditionalManifestFiles>ahc.manifest</AdditionalManifestFiles>
270+
</Manifest>
271+
</ItemDefinitionGroup>
160272
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
161273
<ClCompile>
162274
<WarningLevel>Level4</WarningLevel>
@@ -185,6 +297,62 @@
185297
<AdditionalManifestFiles>ahc.manifest</AdditionalManifestFiles>
186298
</Manifest>
187299
</ItemDefinitionGroup>
300+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
301+
<ClCompile>
302+
<WarningLevel>Level4</WarningLevel>
303+
<FunctionLevelLinking>true</FunctionLevelLinking>
304+
<IntrinsicFunctions>true</IntrinsicFunctions>
305+
<SDLCheck>true</SDLCheck>
306+
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
307+
<ConformanceMode>true</ConformanceMode>
308+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
309+
<Optimization>MinSpace</Optimization>
310+
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
311+
<StringPooling>true</StringPooling>
312+
<MultiProcessorCompilation>true</MultiProcessorCompilation>
313+
<ControlFlowGuard>Guard</ControlFlowGuard>
314+
</ClCompile>
315+
<Link>
316+
<SubSystem>Windows</SubSystem>
317+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
318+
<OptimizeReferences>true</OptimizeReferences>
319+
<GenerateDebugInformation>false</GenerateDebugInformation>
320+
<SetChecksum>true</SetChecksum>
321+
<EntryPointSymbol>
322+
</EntryPointSymbol>
323+
</Link>
324+
<Manifest>
325+
<AdditionalManifestFiles>ahc.manifest</AdditionalManifestFiles>
326+
</Manifest>
327+
</ItemDefinitionGroup>
328+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
329+
<ClCompile>
330+
<WarningLevel>Level4</WarningLevel>
331+
<FunctionLevelLinking>true</FunctionLevelLinking>
332+
<IntrinsicFunctions>true</IntrinsicFunctions>
333+
<SDLCheck>true</SDLCheck>
334+
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
335+
<ConformanceMode>true</ConformanceMode>
336+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
337+
<Optimization>MinSpace</Optimization>
338+
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
339+
<StringPooling>true</StringPooling>
340+
<MultiProcessorCompilation>true</MultiProcessorCompilation>
341+
<ControlFlowGuard>Guard</ControlFlowGuard>
342+
</ClCompile>
343+
<Link>
344+
<SubSystem>Windows</SubSystem>
345+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
346+
<OptimizeReferences>true</OptimizeReferences>
347+
<GenerateDebugInformation>false</GenerateDebugInformation>
348+
<SetChecksum>true</SetChecksum>
349+
<EntryPointSymbol>
350+
</EntryPointSymbol>
351+
</Link>
352+
<Manifest>
353+
<AdditionalManifestFiles>ahc.manifest</AdditionalManifestFiles>
354+
</Manifest>
355+
</ItemDefinitionGroup>
188356
<ItemGroup>
189357
<ClCompile Include="hash.cpp" />
190358
<ClCompile Include="main.cpp" />

Source/AuthHashCalc.vcxproj.user

+16
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,27 @@
1010
</LocalDebuggerCommandArguments>
1111
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
1212
</PropertyGroup>
13+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
14+
<LocalDebuggerCommandArguments />
15+
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
16+
</PropertyGroup>
17+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
18+
<LocalDebuggerCommandArguments />
19+
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
20+
</PropertyGroup>
1321
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
1422
<LocalDebuggerCommandArguments>
1523
</LocalDebuggerCommandArguments>
1624
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
1725
</PropertyGroup>
26+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
27+
<LocalDebuggerCommandArguments />
28+
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
29+
</PropertyGroup>
30+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
31+
<LocalDebuggerCommandArguments />
32+
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
33+
</PropertyGroup>
1834
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
1935
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
2036
</PropertyGroup>

Source/sup.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ BOOLEAN supxValidateNtHeader(
438438
}
439439

440440
if (pHdr64->FileHeader.Machine != IMAGE_FILE_MACHINE_IA64 &&
441-
pHdr64->FileHeader.Machine != IMAGE_FILE_MACHINE_AMD64)
441+
pHdr64->FileHeader.Machine != IMAGE_FILE_MACHINE_AMD64 &&
442+
pHdr64->FileHeader.Machine != IMAGE_FILE_MACHINE_ARM64)
442443
{
443444
*ErrorCode = IMAGE_VERIFY_BAD_FILE_HEADER_MACHINE;
444445
return FALSE;
@@ -490,8 +491,8 @@ BOOLEAN supxValidateNtHeader(
490491
return FALSE;
491492
}
492493

493-
if ((pHdr32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) &&
494-
!(pHdr32->FileHeader.Machine == IMAGE_FILE_MACHINE_I386))
494+
if (pHdr32->FileHeader.Machine != IMAGE_FILE_MACHINE_I386 &&
495+
pHdr32->FileHeader.Machine != IMAGE_FILE_MACHINE_ARMNT)
495496
{
496497
*ErrorCode = IMAGE_VERIFY_BAD_FILE_HEADER_MACHINE;
497498
return FALSE;
@@ -596,7 +597,10 @@ BOOLEAN supIsValidImage(
596597
}
597598

598599
if (ntHeaders->FileHeader.Machine != IMAGE_FILE_MACHINE_AMD64 &&
599-
ntHeaders->FileHeader.Machine != IMAGE_FILE_MACHINE_I386)
600+
ntHeaders->FileHeader.Machine != IMAGE_FILE_MACHINE_ARM64 &&
601+
ntHeaders->FileHeader.Machine != IMAGE_FILE_MACHINE_IA64 &&
602+
ntHeaders->FileHeader.Machine != IMAGE_FILE_MACHINE_I386 &&
603+
ntHeaders->FileHeader.Machine != IMAGE_FILE_MACHINE_ARMNT)
600604
{
601605
ViewInformation->LastError = IMAGE_VERIFY_BAD_FILE_HEADER_MACHINE;
602606
return FALSE;

0 commit comments

Comments
 (0)