Valid HTML 4.01 Transitional Valid CSS Valid SVG 1.0

Me, myself & IT

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

Directory Identifiers MSDM Product Key Reader

Click one of the green buttons to select your gimmick!


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


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, as well as Windows PE 2.0 and newer versions.

The MSDM table of the ACPI BIOS is specified in a white paper available from Microsoft Software Licensing Tables (SLIC and MSDM) on 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

#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"

void	WinMainCRTStartup()
	MSDM	msdm;
	BYTE	bCheckSum;
	DWORD	dwCheckSum;

	// see <>

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

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

				MessageBoxExA((HWND) NULL,
				              "\'MSDM\' table reader",
				              MB_OK | MB_ICONINFORMATION,



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!
Copyright © 1995-2017 • Stefan Kanthak • <‍skanthak‍@‍nexgo‍.‍de‍>