Valid HTML 4.01 Transitional Valid CSS Valid SVG 1.0

Me, myself & IT


ATTENTION: due to the termination of my provider's homepage service, the web pages and all content located below http://home.arcor.de/skanthak/ will become unavailable on January 31, 2017!

All web pages and other content will then be available solely on https://skanthak.homepage.t-online.de/.
Please update your bookmarks and references!


Gimmick of the day (or week, month, year, …)

Dirids

The setup scripts DIRID.INF and LDID.INF create the file DIRID.INI or LDID.INI respectively with all known Dirids and the pathnames they resolve to and opens it in Windows'® editor.

Usage

Right-click the downloaded setup script DIRID.INF or LDID.INF respectively to display its context menu and click Install to run it.

MSDM Product Key Reader

MSDM Product Key Reader.exe for Microsoft® Windows® NT displays the individual device-specific product key embedded by (big) OEMs in the MSDM table of the ACPI BIOS.
This product key is used for automatic selection of the product edition and the activation of Windows 8 and Windows 8.1 during their installation, and can since version 1511 alias Threshold 2 be used for manual product activation of Windows 10 too.

Implementation and build details

MSDM Product Key Reader.exe is a pure Win32 binary executable, written in ANSI C without the MSVCRT libraries, built with the platform SDK for Windows Server 2003 R2 for use on Windows Server 2003 and newer versions of Windows NT.
The MSDM table of the ACPI BIOS is specified in a white paper available from Microsoft Software Licensing Tables (SLIC and MSDM) on the MSDN.

Source code

// Copyright © 2012-2017, Stefan Kanthak <skanthak@nexgo.de>

#pragma comment(lib, "KERNEL32.LIB")
#pragma comment(lib, "USER32.LIB")

#pragma comment(linker, "/ENTRY:WinMainCRTStartup")
#pragma comment(linker, "/SUBSYSTEM:WINDOWS")

#define STRICT
#undef UNICODE
#define WIN32_LEAN_AND_MEAN

#include <windows.h>

typedef	struct	_msdm		// 'Microsoft Data Management' table
{
	DWORD	Signature;	// "MSDM" = 0x4D44534D = 'MDSM'
	DWORD	Length;		// size of entire MSDM table: 0x00000055
	BYTE	Revision;
	BYTE	Checksum;	// checksum of entire MSDM table
	CHAR	OEMId[6];	// OEM identification
	CHAR	OEMTableId[8];
	DWORD	OEMRevision;
	CHAR	CreatorId[4];	// creator identification
	DWORD	CreatorRevision;

	DWORD	Version;	// 0x00000001
	DWORD	Reserved;	// 0x00000000
	DWORD	DataType;	// 0x00000001
	DWORD	DataReserved;	// 0x00000000
	DWORD	DataLength;	// 0x0000001D
	CHAR	Data[29];	// product key: "23467-89BCD-FGHJK-MNPQR-TVWXY"
} MSDM;

LONG	WinMainCRTStartup()
{
	MSDM	msdm;
	BYTE	bCheckSum;
	DWORD	dwCheckSum;

	if (GetSystemFirmwareTable('ACPI', 'MDSM', NULL, sizeof(msdm)) == 0L)
		MessageBoxEx((HWND) NULL,
		             "No \'MSDM\' table found!",
		             "\'MSDM\' table reader",
		             MB_OK | MB_ICONQUESTION,
		             MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL));
	else
		if (GetSystemFirmwareTable('ACPI', 'MDSM', &msdm, sizeof(msdm)) > sizeof(msdm))
			MessageBoxEx((HWND) NULL,
			             "Error reading \'MSDM\' table!",
			             "\'MSDM\' table reader",
			             MB_OK | MB_ICONERROR,
			             MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL));
		else
		{
			for (bCheckSum = 0, dwCheckSum = msdm.Length;
			     dwCheckSum > 0L;
			     bCheckSum += ((BYTE *) &msdm)[--dwCheckSum])
				continue;

			if ((bCheckSum != 0)
			 || (msdm.Version != 1L)
			 || (msdm.Reserved != 0L)
			 || (msdm.DataType != 1L)
			 || (msdm.DataReserved != 0L)
			 || (msdm.DataLength != sizeof(msdm.Data)))
				MessageBoxEx((HWND) NULL,
				             "Invalid or unknown \'MSDM\' table found!",
				             "\'MSDM\' table reader",
				             MB_OK | MB_ICONWARNING,
				             MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL));
			else
			{
				msdm.Data[sizeof(msdm.Data)] = '\0';

				MessageBoxEx((HWND) NULL,
				             msdm.Data,
				             "\'MSDM\' table reader",
				             MB_OK | MB_ICONINFORMATION,
				             MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL));
			}
		}

	return GetLastError();
}

Contact

If you miss anything here, have additions, comments, corrections, criticism or questions, want to give feedback, hints or tipps, report broken links, bugs, errors, inaccuracies, omissions, vulnerabilities or weaknesses, …:
don't hesitate to contact me and feel free to ask, comment, criticise, flame, notify or report!

Use the X.509 certificate to send S/MIME encrypted mail.

Notes: I dislike HTML (and even weirder formats too) in email, I prefer to receive plain text.
I also expect to see a full (real) name as sender, not a nickname!
Emails in weird formats and without a proper sender name are likely to be discarded.
I abhor top posts and expect inline quotes in replies.

Terms and conditions

By using this site, you signify your agreement to these terms and conditions. If you do not agree to these terms and conditions, do not use this site!
[Counter]
• Copyright © 1995-2017 • Stefan Kanthak • <­skanthak­@­arcor­.­de­>