Skip to content

Commit 7139c79

Browse files
committed
v2 Major rewrite / Win32 GUI. Still needs plenty of work.
1 parent 23ce5f1 commit 7139c79

23 files changed

+1805
-216
lines changed

.gitignore

Lines changed: 398 additions & 87 deletions
Large diffs are not rendered by default.

.idea/.gitignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/XPKeygen.iml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.idea/modules.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.

Keygen.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.33516.290
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Keygen", "Keygen.vcxproj", "{BDEA17F1-9D47-31CE-B733-4C1AE77CB243}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Release|x64 = Release|x64
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{BDEA17F1-9D47-31CE-B733-4C1AE77CB243}.Debug|x64.ActiveCfg = Debug|x64
15+
{BDEA17F1-9D47-31CE-B733-4C1AE77CB243}.Debug|x64.Build.0 = Debug|x64
16+
{BDEA17F1-9D47-31CE-B733-4C1AE77CB243}.Release|x64.ActiveCfg = Release|x64
17+
{BDEA17F1-9D47-31CE-B733-4C1AE77CB243}.Release|x64.Build.0 = Release|x64
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {85A3BCED-00B4-3BD6-8AE4-A20F291658B0}
24+
EndGlobalSection
25+
EndGlobal

Keygen.vcxproj

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<PreferredToolArchitecture>
5+
</PreferredToolArchitecture>
6+
</PropertyGroup>
7+
<ItemGroup Label="ProjectConfigurations">
8+
<ProjectConfiguration Include="Debug|x64">
9+
<Configuration>Debug</Configuration>
10+
<Platform>x64</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Release|x64">
13+
<Configuration>Release</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
</ItemGroup>
17+
<PropertyGroup Label="Globals">
18+
<ProjectGuid>{BDEA17F1-9D47-31CE-B733-4C1AE77CB243}</ProjectGuid>
19+
<Keyword>Win32Proj</Keyword>
20+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
21+
<Platform>x64</Platform>
22+
<ProjectName>Keygen</ProjectName>
23+
<VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>
24+
</PropertyGroup>
25+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
26+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
27+
<ConfigurationType>Application</ConfigurationType>
28+
<CharacterSet>Unicode</CharacterSet>
29+
<PlatformToolset>v143</PlatformToolset>
30+
<UseDebugLibraries>true</UseDebugLibraries>
31+
</PropertyGroup>
32+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
33+
<ConfigurationType>Application</ConfigurationType>
34+
<CharacterSet>Unicode</CharacterSet>
35+
<PlatformToolset>v143</PlatformToolset>
36+
<WholeProgramOptimization>true</WholeProgramOptimization>
37+
</PropertyGroup>
38+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
39+
<ImportGroup Label="ExtensionSettings">
40+
</ImportGroup>
41+
<ImportGroup Label="PropertySheets">
42+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
43+
</ImportGroup>
44+
<PropertyGroup Label="UserMacros" />
45+
<PropertyGroup>
46+
<_ProjectFileVersion>10.0.20506.1</_ProjectFileVersion>
47+
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)\</OutDir>
48+
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir>
49+
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)</TargetName>
50+
<TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.exe</TargetExt>
51+
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
52+
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest>
53+
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)\</OutDir>
54+
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</IntDir>
55+
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName)</TargetName>
56+
<TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.exe</TargetExt>
57+
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
58+
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest>
59+
</PropertyGroup>
60+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
61+
<ClCompile>
62+
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
63+
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
64+
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
65+
<ExceptionHandling>Sync</ExceptionHandling>
66+
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
67+
<Optimization>Disabled</Optimization>
68+
<PrecompiledHeader>NotUsing</PrecompiledHeader>
69+
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
70+
<UseFullPaths>true</UseFullPaths>
71+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
72+
<ObjectFileName>$(IntDir)</ObjectFileName>
73+
<AdditionalIncludeDirectories>C:\Program Files\OpenSSL\include</AdditionalIncludeDirectories>
74+
<SDLCheck>false</SDLCheck>
75+
<ConformanceMode>false</ConformanceMode>
76+
<CallingConvention>StdCall</CallingConvention>
77+
<LanguageStandard>stdcpp17</LanguageStandard>
78+
</ClCompile>
79+
<ResourceCompile>
80+
<PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_DEBUG;_WINDOWS;CMAKE_INTDIR=\"Debug\"</PreprocessorDefinitions>
81+
</ResourceCompile>
82+
<Midl>
83+
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
84+
<OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
85+
<HeaderFileName>%(Filename).h</HeaderFileName>
86+
<TypeLibraryName>%(Filename).tlb</TypeLibraryName>
87+
<InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
88+
<ProxyFileName>%(Filename)_p.c</ProxyFileName>
89+
</Midl>
90+
<Link>
91+
<AdditionalDependencies>lib\libcrypto.lib;comctl32.lib;uxtheme.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
92+
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
93+
<AdditionalOptions>%(AdditionalOptions) /machine:x64</AdditionalOptions>
94+
<GenerateDebugInformation>true</GenerateDebugInformation>
95+
<IgnoreSpecificDefaultLibraries>
96+
</IgnoreSpecificDefaultLibraries>
97+
<ImportLibrary>
98+
</ImportLibrary>
99+
<ProgramDataBaseFile>$(OutDir)$(TargetName).pdb</ProgramDataBaseFile>
100+
<SubSystem>Console</SubSystem>
101+
<AdditionalManifestDependencies>"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"</AdditionalManifestDependencies>
102+
</Link>
103+
<ProjectReference>
104+
<LinkLibraryDependencies>true</LinkLibraryDependencies>
105+
</ProjectReference>
106+
</ItemDefinitionGroup>
107+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
108+
<ClCompile>
109+
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
110+
<ExceptionHandling>Sync</ExceptionHandling>
111+
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
112+
<Optimization>MaxSpeed</Optimization>
113+
<PrecompiledHeader>NotUsing</PrecompiledHeader>
114+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
115+
<UseFullPaths>false</UseFullPaths>
116+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
117+
<ObjectFileName>$(IntDir)</ObjectFileName>
118+
<DebugInformationFormat>
119+
</DebugInformationFormat>
120+
<AdditionalIncludeDirectories>C:\Program Files\OpenSSL\include</AdditionalIncludeDirectories>
121+
<CallingConvention>StdCall</CallingConvention>
122+
<LanguageStandard>stdcpp17</LanguageStandard>
123+
</ClCompile>
124+
<ResourceCompile>
125+
<PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR=\"Release\"</PreprocessorDefinitions>
126+
</ResourceCompile>
127+
<Midl>
128+
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
129+
<OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
130+
<HeaderFileName>%(Filename).h</HeaderFileName>
131+
<TypeLibraryName>%(Filename).tlb</TypeLibraryName>
132+
<InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
133+
<ProxyFileName>%(Filename)_p.c</ProxyFileName>
134+
</Midl>
135+
<Link>
136+
<AdditionalDependencies>lib\libcrypto.lib;comctl32.lib;uxtheme.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
137+
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
138+
<AdditionalOptions>%(AdditionalOptions) /machine:x64</AdditionalOptions>
139+
<GenerateDebugInformation>false</GenerateDebugInformation>
140+
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
141+
<ImportLibrary>
142+
</ImportLibrary>
143+
<ProgramDataBaseFile>$(OutDir)$(TargetName).pdb</ProgramDataBaseFile>
144+
<SubSystem>Console</SubSystem>
145+
<AdditionalManifestDependencies>"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"</AdditionalManifestDependencies>
146+
</Link>
147+
<ProjectReference>
148+
<LinkLibraryDependencies>true</LinkLibraryDependencies>
149+
</ProjectReference>
150+
</ItemDefinitionGroup>
151+
<ItemGroup>
152+
<ClCompile Include="D:\Software\Development\XPKeygen\main.cpp" />
153+
<ClCompile Include="D:\Software\Development\XPKeygen\xp.cpp" />
154+
<ClCompile Include="D:\Software\Development\XPKeygen\server.cpp" />
155+
<ClCompile Include="windows.cpp" />
156+
<ClInclude Include="D:\Software\Development\XPKeygen\header.h" />
157+
<ClCompile Include="D:\Software\Development\XPKeygen\utilities.cpp" />
158+
<ClCompile Include="D:\Software\Development\XPKeygen\key.cpp" />
159+
<ClInclude Include="resource.h" />
160+
</ItemGroup>
161+
<ItemGroup>
162+
<ResourceCompile Include="resource.rc" />
163+
</ItemGroup>
164+
<ItemGroup>
165+
<Media Include="resources\neon.wav" />
166+
<Media Include="resources\pxiii.wav" />
167+
</ItemGroup>
168+
<ItemGroup>
169+
<Image Include="resources\ender.bmp" />
170+
<Image Include="resources\icon.ico" />
171+
<Image Include="resources\logo.bmp" />
172+
</ItemGroup>
173+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
174+
<ImportGroup Label="ExtensionTargets">
175+
</ImportGroup>
176+
</Project>

Keygen.vcxproj.filters

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<ClCompile Include="D:\Software\Development\XPKeygen\main.cpp">
5+
<Filter>Source Files</Filter>
6+
</ClCompile>
7+
<ClCompile Include="D:\Software\Development\XPKeygen\xp.cpp">
8+
<Filter>Source Files</Filter>
9+
</ClCompile>
10+
<ClCompile Include="D:\Software\Development\XPKeygen\server.cpp">
11+
<Filter>Source Files</Filter>
12+
</ClCompile>
13+
<ClCompile Include="D:\Software\Development\XPKeygen\utilities.cpp">
14+
<Filter>Source Files</Filter>
15+
</ClCompile>
16+
<ClCompile Include="D:\Software\Development\XPKeygen\key.cpp">
17+
<Filter>Source Files</Filter>
18+
</ClCompile>
19+
<ClCompile Include="windows.cpp">
20+
<Filter>Source Files</Filter>
21+
</ClCompile>
22+
</ItemGroup>
23+
<ItemGroup>
24+
<ClInclude Include="D:\Software\Development\XPKeygen\header.h">
25+
<Filter>Header Files</Filter>
26+
</ClInclude>
27+
<ClInclude Include="resource.h" />
28+
</ItemGroup>
29+
<ItemGroup>
30+
<Filter Include="Header Files">
31+
<UniqueIdentifier>{174FAF7A-E150-316A-8FA9-DCB2D9FA4C51}</UniqueIdentifier>
32+
</Filter>
33+
<Filter Include="Source Files">
34+
<UniqueIdentifier>{DD359385-3E10-39A8-BDBE-E651CB1745C6}</UniqueIdentifier>
35+
</Filter>
36+
</ItemGroup>
37+
<ItemGroup>
38+
<ResourceCompile Include="resource.rc" />
39+
</ItemGroup>
40+
<ItemGroup>
41+
<Media Include="resources\neon.wav" />
42+
<Media Include="resources\pxiii.wav" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Image Include="resources\icon.ico" />
46+
<Image Include="resources\ender.bmp" />
47+
<Image Include="resources\logo.bmp" />
48+
</ItemGroup>
49+
</Project>

header.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@
2525
#define PK_LENGTH 25
2626
#define NULL_TERMINATOR 1
2727

28+
#define IDC_BUTTON1 1000
29+
#define IDC_BUTTON2 1001
30+
#define IDC_BUTTON3 1002
31+
#define IDC_BUTTON4 1003
32+
33+
#define IDC_RADIO1 1005
34+
#define IDC_RADIO2 1006
35+
36+
#define IDC_EDIT1 1010
37+
38+
#define IDC_INPUT1 1020
39+
#define IDC_INPUT2 1021
40+
41+
#define IDC_IMAGE1 1050
42+
2843
typedef unsigned long ul32;
2944

3045
extern HANDLE hConsole;
@@ -35,6 +50,13 @@ extern const long aXP;
3550
extern const long bXP;
3651

3752
// xp.cpp
53+
int keyXP(
54+
char *pKey,
55+
ul32 *hash,
56+
ul32 *sig,
57+
ul32 nRaw
58+
);
59+
3860
void unpackXP(
3961
ul32 *serial,
4062
ul32 *hash,
@@ -123,4 +145,7 @@ void base24(byte *cdKey, ul32 *byteSeq);
123145
void printProductKey(const char *pKey);
124146
void printProductID(const ul32 *pRaw);
125147

148+
// windows.cpp
149+
bool InitializeWindow(HINSTANCE hInstance);
150+
126151
#endif //KEYGEN_HEADER_H

key.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void printProductID(const ul32 *pRaw) {
7575
char b[6], c[8];
7676

7777
// Cut away last bit of the product key and convert it to an ASCII-number (=raw)
78-
sprintf(raw, "%lu", pRaw[0] >> 1);
78+
sprintf(raw, "%09lu", pRaw[0] >> 1);
7979

8080
// Make B-part {...-640-...} -> most significant 3 digits of Raw Product Key
8181
strncpy(b, raw, 3);
@@ -84,9 +84,6 @@ void printProductID(const ul32 *pRaw) {
8484
// Make C-part {...-123456X-...} -> least significant 6 digits of Raw Product Key
8585
strcpy(c, raw + 3);
8686

87-
// Make checksum digit-part {...56X-}
88-
assert(strlen(c) == 6);
89-
9087
int digit = 0;
9188

9289
// Reverse sum algorithm to find a check digit that would add to the rest to form a sum divisible by 7.

0 commit comments

Comments
 (0)