Open NicknineTheEagle opened 7 months ago
Figured out the root cause, it looks like the new injection mechanism involving overwriting the entry point from https://github.com/RibShark/SafeDiscShim/commit/8fedebb00cf7f73a8514f0bff292dd3a6f7a2d1e does not work for SafeDisc 1 ICDs. Simply calling Initialize
from DllMain
for ICD like in older revisions makes the game work.
While initializing from DllMain is unsafe due to loader lock, as far as I can tell, there's literally no other way to do this for ICD specifically. dplayerx.dll seems to be loaded before ICD entry point (from import table?) and it needs Secdrv driver in its own DllMain meaning that the shim must be initialized by this point or dplayerx.dll will crash.
My memory aches trying to remember what rule of thumb I must have read in the past, but you might want to take a notice at: https://www.vogons.org/viewtopic.php?t=51818 https://github.com/ElliotKillick/LdrLockLiberator
I have a solution in mind for this; I will work on it once I have completed some other obligations.
It appears that none of SafeDisc 1 games work for me, ICD always crashes in dplayerx.dll. Tried the following games:
Running Windows 10. Using Alcohol 120% to mount Redump disc images. Not an issue with the game code since cracked exe produced by UnSafeDisc works fine. The games do work if Alcohol virtual drive is passed through to Windows XP VM.
Logs: LEGORacers.exe_SafeDiscShim.log LEGORacers.ICD_SafeDiscShim.log
Windows event log entries: