Author SHA1 Message Date
TheTank20 24c9c67b9d Update README.md 2023-07-06 21:57:18 -05:00
TheTank20 eb5afa20ea Update README.md 2023-07-06 21:53:55 -05:00
thepwrtank18 abcccb9f44 Set file names to be different on compile time 2023-07-06 21:47:32 -05:00
thepwrtank18 5772b8f2f3 Fix x64 Edition 2023-07-06 21:39:28 -05:00
thepwrtank18 b831b05b60 credits 2023-06-18 11:06:23 -05:00
3 changed files with 57 additions and 22 deletions

No files matched your search

+11 -1
View File
@@ -2,6 +2,16 @@
Command line interface for Windows XP license management, inspired by Microsoft's "slmgr".
## Usage
**You need to download the right version for your edition of Windows XP/2003!**
In most cases, you'll need `xpmgr_x86.exe`.
If you have Windows XP Professional x64 Edition or an x64 version of Windows Server 2003, you need `xpmgr_x64.exe`.
*If you have an Itanium edition of XP or Server 2003, or a version of XP/Server 2003 we don't even know about, we unfortunately don't have a build for you. We can use your help to make one, though! Contact us at https://umskt.zulipchat.com.*
In general, don't use `xpmgr_debug_[arch].exe` unless you have a reason why.
`--GetProductID`: Gets the product ID (ex: `76477-755-3803223-21229`).
`--SetProductKey`: Sets the product key (tested to work with dashes).
@@ -10,7 +20,7 @@ Command line interface for Windows XP license management, inspired by Microsoft'
`--SetConfirmationID`: Sets a Confirmation ID (tested to work with dashes).
`--GetWPALeft`: Gets the number of days before activation is required, in days.
`--GetWPALeft`: Gets the number of days before activation is required, in days. If successfully activated, this should be 2147483647.
`--GetEvalLeft`: Gets the number of days before the evaluation period expires, in days. In most cases, this should be 2147483647.
+25 -19
View File
@@ -14,9 +14,18 @@
#pragma comment(lib, "comsuppw.lib")
#pragma comment(lib, "kernel32.lib")
// Check windows
#if _WIN32 || _WIN64
#if _WIN64
#define ENVIRONMENT64
#else
#define ENVIRONMENT32
#endif
#endif
// The magic numbers, interface, and LoadLicenseManager() function was made by diamondggg on MyDigitalLife.
// LoadLicenseManager() was modified to suit a CLI rather than a GUI.
// Everything else was made by TheTank20.
// Everything else was either made by TheTank20 or copy pasted from StackOverflow.
static wchar_t strings[14][256];
static CLSID licdllCLSID = { 0xACADF079, 0xCBCD, 0x4032, {0x83, 0xF2, 0xFA, 0x47, 0xC4, 0xDB, 0x09, 0x6F} };
@@ -134,12 +143,6 @@ static BOOL LoadLicenseManager()
LicenseAgent = NULL;
return FALSE;
}
if (dwWPALeft == 0x7FFFFFFF) {
std::cout << "An error occurred: dwWPALeft is 0x7FFFFFFF";
LicenseAgent->Release();
LicenseAgent = NULL;
return FALSE;
}
return TRUE;
}
@@ -156,12 +159,6 @@ static BSTR GetWPALeft() {
LicenseAgent = NULL;
return SysAllocString(L"Failed to get expiration info");
}
if (dwWPALeft == 0x7FFFFFFF) {
std::cout << "An error occurred: dwWPALeft is 0x7FFFFFFF";
LicenseAgent->Release();
LicenseAgent = NULL;
return SysAllocString(L"Failed to get expiration info");
}
return SysAllocString(_bstr_t(dwWPALeft).Detach());
}
@@ -179,12 +176,7 @@ static BSTR GetEvalLeft() {
LicenseAgent = NULL;
return SysAllocString(L"Failed to get expiration info");
}
if (dwWPALeft == 0x7FFFFFFF) {
std::cout << "An error occurred: dwWPALeft is 0x7FFFFFFF";
LicenseAgent->Release();
LicenseAgent = NULL;
return SysAllocString(L"Failed to get expiration info");
}
return SysAllocString(_bstr_t(dwEvalLeft).Detach());
}
@@ -274,6 +266,20 @@ bool cmdOptionExists(char** begin, char** end, const std::string& option)
int main(int argc, char* argv[])
{
SYSTEM_INFO systemInfo;
GetNativeSystemInfo(&systemInfo);
#ifdef ENVIRONMENT32
if (systemInfo.wProcessorArchitecture != PROCESSOR_ARCHITECTURE_INTEL) { // running under WOW64
if (systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) { // is AMD64
std::cout << "An error occurred: Incorrect version of xpmgr. You need to download the x64 version.";
}
else { // is IA64, PPC, megafart 386, whatever else
std::cout << "An error occurred: Incorrect version of xpmgr. Go to https://umskt.zulipchat.com if you want to help us make a version for your platform!";
}
return 0;
}
#endif
if (cmdOptionExists(argv, argv+argc, "--GetInstallationID")) {
std::cout << _com_util::ConvertBSTRToString(GetInstallationID());
return 0;
+21 -2
View File
@@ -23,7 +23,7 @@
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{f76e79ed-b941-49f6-a040-f560aa2b9e09}</ProjectGuid>
<RootNamespace>xpmgr</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>7.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -48,7 +48,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
@@ -70,6 +70,23 @@
<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)'=='Release|x64'">
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)_x64</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>$(ProjectName)_x86</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TargetName>$(ProjectName)_debug_x64</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>$(ProjectName)_debug_x86</TargetName>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
@@ -106,6 +123,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -120,6 +138,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>