Win2kgaming: Quick Fix Guide

The wrapper, tools, and info you need to get games working

Win2kgaming: Quick Fix Guide

PostPosted by OldBoy2k » Mon Nov 30, 2009 3:40 pm

Hi,

its time to write down a Quick Fix Guide which should help you fix your games and applications very fast.One of the most important tools we need today is Dependency Walker which we now need to download from here:

Download: Dependency Walker v2.2.6000

Install this tool.You can principially fix most of the applications and games and even driver files (*.sys) with this tool and if you are experienced enough also create fixes from game updates by extracting the main game executables from update and patch archives.If you are working with game updates you need to find and download most of the yellow marked missing driver libraries fist before starting with the main fix.Most of the fixes are based on game updates since i didn't want to download terabytes of demos :mrgreen:

Now i'll explain everything by fixing the 007: Quantum of Solace update v1.1 patch.These files are included in the fix after extraction:

j:\temp\setup\data\
==================
JB_Launcher_s.exe.cfg
JB_LiveEngine_s.exe
JB_LiveEngine_s.exe.cat
JB_LiveEngine_s.exe.cfg
jb_mp_s.dll
jb_sp_s.dll
JB_UpdateService.exe.cfg
version.inf


When loading JB_LiveEngine_s.exe in Dependency Walker (File->Open->JB_LiveEngine_s.exe) this gives us the following libraries structure:
Image
As we can see,this game requires Games for Windows Live (xlive.dll).We first will add binkw32.dll which is a common RAD Video Tools library and also the Miles Sound System MSS32.dll library which usually get installed with the game.Yellow :?: means,that files are missing;red underlayed libraries stand for not completely "satisfied" libraries (missing APIs marked red which you can see listed in the right upper window,working and present APIs marked green).We will forget about XMASSIVEADCLIENTDYN.DLL because i didn't find any download location for this library but since its a non-systemfile its not important for this Fix Guide and demonstration.

So,after adding the libaries we open the executable again in Dependency Walker and the scenario now looks like this:
Image

All binkw32.dll and MSS32.dll :?: are gone now,only one function "_AIL_init_sample@8" in MSS32.dll is not covered.Thats because i used some other non game related MSS32.dll library.When you click the Xinput1_3.dll all exports are listed in the right upper window.Usually the program lists the API function names but not this time but since we already know that this library is missing completely we don't need to go any further.Next we will start with fixing the game.Some of you probably know Xinput1_3.dll already :wink: So we need to add this from the X3daudio driver.
Image
After adding this Win2k compatible Xinput1_3.dll library this export is fixed.

Next we are adding the Xlive.dll from the Games for Windows Live v2.0.0687 version.Since this game is quite new this would be the best Xlive.dll version to fix.The guide for the content extraction and the detailed Windows Live v2.0.0687 fix mentioned here can be found in the Tools & Info section.

The directory now contains the following files:
J:\TEMP\Setup\Data\
==================
binkw32.dll
JB_Launcher_s.exe.cfg
JB_LiveEngine_s.exe
JB_LiveEngine_s.exe.cat
JB_LiveEngine_s.exe.cfg
jb_mp_s.dll
jb_sp_s.dll
JB_UpdateService.exe.cfg
mss32.dll
msvcm90.dll
msvcp90.dll
msvcr90.dll
msidcrl40.dll
version.inf
xinput1_3.dll
xlive.dll
xlive.dll.cat
xlivefnt.dll


and re-opening the executable again results in this scenario:
Image

Missing Exports:
Kernel32.dll - GetUserGeoID,GetGeoInfoA,WTSGetActiveConsoleSessionId
IPHLPAPI.dll - GetAdaptersAddresses (appears because of the just added Xlive.dll)
Advapi32.dll - CredFree,CredWriteW,CredReadW,CredEnumerateW,CredDeleteW

Note: Things we don't need to fix are APPHELP.DLL and MPR.DLL errors since they are WinXP Helper libraries and appear when oppening any WinXP executable on Win2k in Dependency Walker.

Now we are adding the Wrapper Kernel32.dll and renamed system Kernel32_ORG.dll to fix the Kernel exports.
Image

The iphlpapi.dll missing export "GetAdaptersAddresses" can be fixed by adding iphlpapi.dll v5.1.2600.2180 to the binaries directory of the patch.Now we have calls for WS2_32.dll - freeaddrinfo,getaddrinfo.To fix these exports we add the Wrapper WS2_32.dll and WS2_32_ORG.dll.

Image
Fine.That was the tricky manual part.Now we let the Dependency Walker check the rest of the problems for us.We need to verify if the MSIDCRL40.DLL -> ADVAPI32.DLL export is important for fixing or not.To check this we now switch to Profile Mode and run the application in Dependency Walker protected environment.

Profile Mode:
If you start the Profile Mode (Profile ->Start Profiling) you find a profile Module option menu like this.Check everything i outlined red and you are ready to go!
Image
Press OK.And the Dependency Walker should tell you what problems still exist with the game or application.The following error comes up:
Procedure entry "CredFree" in DLL "Advapi32.dll" not found
Okay, so we need to fix the following exports,too:

Missing Exports:
Advapi32.dll - CredFree,CredWriteW,CredReadW,CredEnumerateW,CredDeleteW

We are adding the Wrapper Advapi32.dll and Advapi32_ORG.dll and voila, everything looks green again :lol:
Image

When we start profiling again we finaly get to the missing XMASSIVEADCLIENTDYN.DLL which we don't have so we need to stop here at this point.These missing libraries are the reason why most of the Fixes marked with a * are so called alpha fixes or patch fixes and not got tested on full versions but since most of the important system API functions are covered these fixes should work in principle with the full game.

When the game comes with a extra launcher or setup make sure to check these individually and sometimes you end up having two or more windows opened when profiling your game.You need to Dependency check all important executables from a installation (like dedicatedserver.exe etc) to get the game working completely.

When you have the x3daudio driver installed check the loaded libraries in the Dependency Walker game tree if you can find any X3DAUDIO.DLL or Xinput.dll.Since they won't be marked as missing with installed driver!

Some notes:
Of course you could run the Profile Mode right from the beginning without manual fixing and just add the Wrapper libraries according to the missing exports but its my recommendation to learn something about the structure of libraries and see what will happen when adding different versions of XP libraries.Also it minimizes the risk in running into complete chaos.If you need any kind of help with fixing this is what you need to do.Open the executable,run the Profile Mode once and then save the Dependency Walker LOG (File ->Save as -> *.DWI) and upload this DWI-LOG onto sendspace.com or some other file hoster and post the download link in the forum.

Example 2: El Matador game (Win2k compatible)
Also,you don't need to fix the following APIs (screenshot from El Matador DW Profile) since they don't belong to the game itself and generally won't cause any trouble.Neither the Kernel32.dll and MSVCRT.dll errors below the MSVCR80.dll,D3D9.dll, and HID.dll below the DINPUT.DLL or the User32.dll export must get fixed.
Image
Image

Also problems found below the following System32 libraries mustn't need to be paid any attention too:
c:\winnt\system32\OLEAUT32.DLL
c:\winnt\system32\DXDIAGN.DLL
c:\winnt\system32\VERSION.DLL
c:\winnt\system32\CRYPT32.DLL

Image
Image

If you ain't sure if that particular function needs fixed then just run the executable in profile mode and fix only the main error causing functions!

Thats the Quick Fix Guide for today.Hope you liked it and found it useful.Thankyou for listening and your patience.If you have any questions you can reply here and ask everything you'd like to know or need assistance for.

kind regards
OldBoy2k
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm


Re: Win2kgaming: Quick Fix Guide

PostPosted by OldBoy2k » Wed Nov 03, 2010 6:13 pm

Alright,Per asked me to write a little info which APIs and libs need no fixing.I won't be going into the reasons and explanations why they don't need fixing because thats only needed for theoretical background.

Will extend the list from time to time...
MPR.DLL
APPHELP.DLL
KERNEL32.DLL - FlsAlloc,FlsFree,FlsGetValue,FlsSetValue,IsTNT,FindActCtxSectionStringW
MSVCRT.DLL - _get_terminate
Dbghelp.dll - SymGetModuleInfoEx,SymGetModuleInfoEx64,SymGetSymbolInfo64,SymGetSymbolInfo

All unknown API's can be checked by the MSDN library database:
MSDN Library - API reference
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm

Re: Win2kgaming: Quick Fix Guide

PostPosted by OldBoy2k » Tue May 01, 2012 12:11 pm

Info: Not a valid Windows 32 bit application error

"is not a valid Win32 application"
"ERROR_BAD_EXE_FORMAT; 193 (0xC1). %1 is not a valid Win32 application"

Hi,

forgot to add a important information about how to fix the "Error 193: %1 is not a valid Win32 application" error for example when trying to profile executables in Dependency Walker or running the program.

This error can be solved by opening the executable with PE Tools and setting the MinorSubsystem Version to 0000 instead of 0001 and MajorSubSystem Version to 0005.

Click here: PE Tools usage/download location

BR
OldBoy2k

Thanks to adun at this point for the info.
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm


Return to Tools & Info

Who is online

Users browsing this forum: No registered users and 0 guests

cron