Compile a single application from the leaked Windows source code (take mspaint.exe drawing program as an example)


After testing, the compilation of this article can be completed on the Windows XP operating system in Simplified Chinese, but I still recommend using Windows XP English Version to compile to avoid trouble

Compilation required environment requirements:

  • Windows XP English version
  • 32-bit operating system
  • At least 20GB of free hard disk space and more than 2GB of RAM

Prepare source code

Download nt5src.7z, and extract the XPSP1 folder in it to a single directory

Modify xp.cmd to decompress the source code

Modify as follows:

Set SrcTarget=E:\XPsrc #Change yours here to your drive letter, for example, if you have a drive with drive letter D, change the directory to D:\XPsrc

Click save after modification, and double-click the directory to decompress


Start compiling

Prepare razzle

Razzle is the code name for Windows NT (or NT OS/2 at the time) and the name of the script for preparing the command line environment for Windows development. You open a new command prompt and run the Razzle.cmd script, which prepares your machine to use the Windows source code. It sets the environment variables used by the build tool, adds the build tool to your PATH, installs a test signing certificate, it allows you to specify the builds you want to build for free or checked (free or checked builds), optimized or unoptimized builds .

Since most of the compilation toolchains are included in the source package that was leaked this time, we can easily complete the compilation.

  1. Open cmd cd to

Type and run:


Razzle will detect the environment, you may encounter errors in the process, you need to create a new file in /XPsrc/NT.

create a new file

First create a new text document, and then rename it:

Then create a new text document in /XPsrc/NT/public and modify the file name:


[scode type="yellow"] Note that both of these need to modify the file extension![/scode]

Re-enter the command after the modification is complete


Compile the application

Here I take the Microsoft Paint program (mspaint.exe) as an example. to the location of the source code


Then run

build /D

After compilation, mspaint.exe is located in the root directory


The compiled version of mspaint.exe is 5.1.2600.1106

Link to this article: