I recently ran into an issue where a buddy of mine was unable to find his original Starcraft disc and the CD case, but he had his Broodwar disc, which meant that he was without a CD key. Hoping to help him, I tried to use a few recovery tools, but they all failed to work, or were horribly outdated. I was later determined to figure it out non-the-less, and with a few minutes of your time, you can too. There is one tool we will need however, and that’s going to be a hex editor. In this example, I’m using the CD key of “9999-99999-9999”.
Requirements:
- Frhed (Hex Editor, FOSS)
- Working Starcraft Installation (which uses the CD key you lost)
- Starcraft / Broodwar CD (to load up the game)
- Windows Vista/7/8/8.1
Instructions:
- Make sure Starcraft is fully up to date. (At the time of this writing, it’s at 1.16.1.)
- Open Starcraft, and get to the Battle.net Login Screen but do _not_ log in.
- Hit Alt+Tab on your keyboard to get back to your Desktop.
- Hit Ctrl+Shift+Esc on your keyboard to open up the Windows Task Manager.
- Select the “Processes” tab, and find “StarCraft.exe” in the list.
- Right click on “StarCraft.exe” in the list and select “Create Dump File”.
- Take special note of where it saved the dump to and navigate to that directory. (Usually, it’s in the current user Temp folder, which you can get to by entering “%TEMP%” into the location bar of any Explorer window.)
- Copy the dump file to your desktop. It should be named “StarCraft.DMP”.
- Open up Frhed, and select File > Open to open the Starcraft dump file on your desktop.
- Select Edit > Find and Replace > Find… from the menu.
- In the Find What box, enter “Starcraft\SWAR\lang\grid.cpp” and hit Find. (This should bring you to the first result.)
- Hit F4 two (2) times. (This should bring you to approximately the point where you’ll find your key.)
- On the right side, look for a string starting with “mo” proceeded by some random numbers. (The image below shows you what you should be looking for.)
- Those random numbers are your CD key. (The area in the image highlighted in yellow is the CD key.)
For those that have a history with hex editors, in my quick tests, the CD key was not at the same offset, so I can’t really give a specific offset to try.