Destro
Captain
RegFaker - A Registry Patch for Wing Commander Prophecy & Secret Ops
Current Version: v0.2RegFaker v0.2
- Fixed a bug that required the real registry key to exist in Windows Registry in order for RegFaker to work.
- Modified {Lock} to only lock items after the call allowing for some codes in the registry key to be updated and others to remain locked.
RegFaker v0.1
- Initial Release.
I've created a RegFaker.dll that hooks ADVAPI32.dll that stores the functions that the games use to access registry items for the games. Upon first launch it will dump the registry items to a RegFaker.ini. This gives the user the ability to add custom codes such as {Location} that returns current working directory, this will essentially make Wing Commander Prophecy and Secret Ops portable applications so that the games folder can be renamed and moved around on the drive without breaking the installation.
I did this specifically for Proton and Linux compatibility with Wing Loader and for my own general amusement to learn function hooking via .dll and ghidra better. 😝
I've also included 2 RegFaker.ini files, one for "Wing Commander Prophecy" and one for "Wing Commander Secret Ops" that should work with the GOG release of the game. I have not tested it with the EA App, but it should also work for that as well. If you are running the updated OpenGL renderer, simply run the modified Launcher.exe or Setup.exe, hit "Select Video Card" choose the OpenGL driver, then close the launcher. This will save the new settings and you can then launch the game.
Usage
*Install the game normally so it has valid registry keys. (Or use the included RegFaker.ini files)1. Open the game executable in a hex editor such as "HxD", search for `ADVAPI32.DLL` and rename to `REGFAKER.DLL`. (Do the same with Launcher.exe and/or Setup.exe)
2. Save the modified binary.
3. Place `RegFaker.dll` next to the executable.
4. Run the game (and launcher.exe & setup.exe to get all codes); when it exits, there will be a file `RegFaker.ini` containing all registry values the program used. (In the same format as a RegEdit Export)
5. Open .ini and add any custom codes (listed below) and save the .ini file.
6. The game will now use the RegFaker.ini file instead of the Window Registry.
Custom codes
1. {Location} - This will return the current working directory *Note the \\ as {Location} does not include them[HKEY_LOCAL_MACHINE\Software\Origin Systems\Wing Commander Prophecy]
"Installed To:"="{Location}\\"
2. {Ignore} - Will ignore any local items in that section after that point and fetch from the real registry instead. *Used for things like DirectX Version and things that you actually want to get from the registry.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectX]
"{Ignore}"
[HKEY_CURRENT_USER\Control Panel\Mouse]
"{Ignore}"
3. {Lock} - This will lock the keys in the local RegFaker.ini so that the game cannot overwrite them after custom code are added.
[HKEY_LOCAL_MACHINE\Software\Developer\Game]
"Video Card Major Version:"=dword:00000003
"Video Card Minor Version:"=dword:00000002
"{Lock}"
"Installed To:"="{Location}\\"
"Installed From:"=".\\"
Troubleshooting
- If you get the error VRtuntime 140 DLL missing, download and install it from Microsoft at the link below.www.microsoft.com/en-us/download/details.aspx?id=508d81a8-adff-4b2b-97ad-15f70fd1bdcf
- Program hangs on exit or not launching
Disable compatibility mode as this can cause the window to hang on exit when attempting to safe to the RegFaker.ini file.
Attachments
Last edited:
