Menu

Unable to hook Metal Gear Solid

GoaLitiuM
2015-09-27
2020-07-13
1 2 > >> (Page 1 of 2)
  • GoaLitiuM

    GoaLitiuM - 2015-09-27

    I'm trying to run Metal Gear Solid in windowed mode since game's own windowed mode commandline switch (-w) doesn't support hardware acceleration and defaults to crappy looking software renderer with lower resolution. I've tried wrappers like DXGL, but it doesn't handle transparent textures properly (most UI elements are missing).

    So back to DxWnd. Game seems to run with default settings just fine, but DxWnd doesn't seem to hook the game at all. I tried toggling "use DLL injection" option, which works in software mode, but crashes right after launching the game with hardware accelerated settings.

    Here's some debug logs.
    Run with default DxWnd settings: http://pastebin.com/z35pMz2g
    Run with DLL injection enabled: http://pastebin.com/0t0thTBA (has 80004005 / DDERR_GENERIC errors at GetDisplayMode and SetCooperativeLevel)

    OS is 64-bit Windows 10, and no antivirus software.

     
  • gho

    gho - 2015-09-27

    Logs show that you're not using the default configuration. I believe these flags don't come by default:
    SHOWFPS SHOWFPSOVERLAY
    I don't know if they could give troubles. In my Win7 pc the game runs perfectly (it doesn't even switch to software mode!) with default config plus setting "Flip emulation" (needed to support hardware acceleration) and "DirectX Version Hook" set to "DirectX1~6" (needed to hook ddraw and run the game in a window). The exported file is in attach. I hope that the same could happen in Win10 as well, though I had a lot of complains about compatibility in this environment.
    The situation is different for the game trainer mgsvr.exe, that should reasonably be similar to the main game, but it is not, and I couldn't run windowed yet.

     

    Last edit: gho 2015-09-27
  • gho

    gho - 2015-09-27

    Metal Gear Solid VR works turning off the hardware acceleration, using the attached exported file. But it's a real pity. I'll try to find out and fix the problem.

     

    Last edit: gho 2015-09-27
  • GoaLitiuM

    GoaLitiuM - 2015-09-27

    Thanks for fast reply.

    The attached export files didn't work as expected. MGS seems to crash in both software and hardware modes now, and MGS:VR runs without crashing, but the viewport is completely green and I can hear the menu music on background.

    Here's the new logs.
    MGS: http://pastebin.com/XjbH76Tk
    MGS:VR: http://pastebin.com/jrG1CQJc

    Edit: With "Flip Emulation" enabled for VR, the green viewport turns into black, but same behaviour. Weirdly the glitchy looking video on startup seems to display "just fine" on top of the green/black background.

    Edit2: After messing around with Windows compatibility settings and reverting back to no compat settings, both executables now crashes and produces same output to log file, and I can't seem to reproduce the earlier results with VR anymore. Running any of the games second time after removing the .cfg files from MGS folder gives different error log, something to do with QueryInterface: IID_IDirectDrawGammaControl.

    1st run: http://pastebin.com/4hbxKDf7 (similar to last MGS log)
    2nd run: http://pastebin.com/P5QxZb1v

     

    Last edit: GoaLitiuM 2015-09-27
    • gho

      gho - 2015-09-28

      I'm currently behind a restrictive firewall and I can't read your log files. I'll try later at home. But Gamma Control problems could be affected by the DxWnd Video / "Disable setting gamma ramp" flag, if you want to make a quick attempt ...

       
      • GoaLitiuM

        GoaLitiuM - 2015-09-28

        Already tried, and with same results, and here's logs hosted in github instead if that helps: https://gist.github.com/GoaLitiuM/4d8ee2d81b6738d3ed06

        Edit: So the logs gets filled with lots of these following lines:

        lpddHookedVersion(350dd40) can't match 0
        Release(D): lpdd=350dd40 dxversion=0
        

        and

        QueryInterface(S): lpdds=34379d0(PRIM) REFIID=69c11c3e(IID_IDirectDrawGammaControl)
        QueryInterface: IID_IDirectDrawGammaControl
        
         

        Last edit: GoaLitiuM 2015-09-28
  • gho

    gho - 2015-09-28

    Despite the strange messages, it's possible that the game sees no errors and the game believe it is working ok. I'll check at home if my logs look similar. I fear that the ddraw is used in this context in such a way that there's no programmatic error, but the image is not rendered. Things that could interfere and possibly fix the situation, apart from the "Flip emulation" flag, are the Direc3D "No SYSTEMMEMORY on Primary / BackBuffer" flags, but it's just a possibility....
    Does the game work switching the DirectX Emulation selector to "None" or any value different form "Primary Surface"?

     
  • GoaLitiuM

    GoaLitiuM - 2015-09-28

    Well that was weird, I removed every single reference of mgsi.exe and mgsvr.exe from registry, mostly all compatibility stuff, and that fixed the weird errors... It seems like Windows had some compat flags enabled for those executables which were not visible from anywhere but in registry.

    Edit: mgsi.exe runs properly with your exported settings, but vr still has that display bug.

    Edit2: Your VR settings had "Texture handling" option set to Highlight, after setting it back to None and enabling "Flip Emulation", it finally runs without any graphical glitches.

    Here's the registry key locations (not sure if I got them all) which had some compatibility flags set for those games, remove any values pointing to the executables and that should reset them back to default slate.

    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store

     

    Last edit: GoaLitiuM 2015-09-28
    • gho

      gho - 2015-09-28

      >> Edit2: Your VR settings had "Texture handling" option set to Highlight

      Wow, thank a lot! This is a stupid missing initialization in the game descriptor creation that could have driven me crazy for weeks! I usually don't check for flags that should have a proper default initialization, and definitely I must have missed it.
      More than this, you gave me a hint that could help a lot of unsatisfied DxWnd Win8/10 users: I didn't know that on these platforms there could be invisible compatibility flags set to the games. It looks as if MicroSoft is not aware of the existence of DxWnd: what a nuisance, Bill!

       
      • GoaLitiuM

        GoaLitiuM - 2015-09-28

        You can trigger this with any program by setting the OS compatibility flag to Windows 95 in file properties and running the executable once. Windows didn't add anything under "Compatibility Assistant\Store", so they can be tossed out, only found two new entries under Layers in both HKCU and HKLM.

         

        Last edit: GoaLitiuM 2015-09-28
  • GoaLitiuM

    GoaLitiuM - 2015-09-29

    One more tiny problem: Video files wont display properly. One of the earliest videos can be seen in MGS:VR startup intro if you wait for a while. The videos are displayed as bunch of colored vertical lines, or in single color if ran with software mode. Is there any workarounds for displaying these properly?

    I found out there's other games (Oddworld: Abe's Oddysee, and maybe Abe's Exoddus too) using the same DDV video format than what MGS does, but I can't verify if they work with DxWnd since I don't have these games.

    Edit: Swapping the corresponding video file (E399.DDV in MOVIE folder) with other videos also produces the same video corruption. These videos display just fine with a tool called Masher which is a DDV video player mainly made for Oddworld games, but seems to work with MGS videos too.

     

    Last edit: GoaLitiuM 2015-09-29
    • gho

      gho - 2015-09-29

      Movies are rendered through quite a lot of different engines. The effect you describe could be caused by a wrong color depth setting, and the only option currently available to fix that is Libs / "Fix movies color depth", though chances that the MGS movies are rendered by the winmm library are little. It could be worth a try to set this flag, while waiting that I get home and I have a look inside ....

       
      • GoaLitiuM

        GoaLitiuM - 2015-09-29

        That didn't work.

        Not sure, but I think the videos are rendered on top of the DirectDraw surface (same thing in software mode), which can be checked by disabling the Flip Emulation, or disabling 3D Textures, and observing the weird lines getting drawn on top of the green/black screen. Changing the resolution to 320x240 turns the video completely purple.

         

        Last edit: GoaLitiuM 2015-09-29
        • gho

          gho - 2015-09-30

          What a surprise! The intro movie is not a movie at all, but a 3D rendered scene using textures and similar to the game. If you want a proof of this, just set the Direct3D / "3D Wireframe" flag, and you'll get the intro movie in wireframe. Is this one of the movies you're referring to?
          In my pc, it is rendered correctly, so there must be a problem related to your configuration. Here are two screenshots of the movie with and without wireframe mode.

          update
          I downloaded masher.exe, tried it with the movies in the CD MOVIE folder and I think you're referring to real movies. Let me see ....

           

          Last edit: gho 2015-09-30
          • GoaLitiuM

            GoaLitiuM - 2015-09-30

            That's not the movie I was talking about. If you start mgsvr.exe, do not press anything or move your mouse and wait after the first two static images (Konami logo and the other one), the video should start.

            Here's how it should look like: https://www.youtube.com/watch?v=LmzUgBZZAe4

             

            Last edit: GoaLitiuM 2015-09-30
            • gho

              gho - 2015-09-30

              No way, it keeps showing 3D sample training sessions. Maybe I should make a full install, my MOVIE folders are still on the two CDs.

              update

              Ok, I replicated the problem. I copied the CD2 movies into the movie folder and now the game shows a dark blue screen while it plays the movie sounds.
              The DxWnd logs show no errors, so I doubt it could be a codec problem. More than this, the very same problem happens without DxWnd in fullscreen native mode.
              I tried to place the legacy ICCVID.DLL close to the executables, but so far the situation didn't change.

               

              Last edit: gho 2015-09-30
              • GoaLitiuM

                GoaLitiuM - 2015-10-04

                Anything new on this? The game itself doesn't seem to use any DLL files in the directory except EBUEula.DLL, most likely because all the other files are already present in more modern systems. According to ProcessMonitor, game doesn't even attempt to load ICCVID.DLL, so replacing it wouldn't change a thing.

                This remaining issue probably doesn't fall into DxWnd territory anymore, other users since Windows XP release have reported same issue happening on their systems as well. Would be really nice if someone who has experience in patching older games could take a look at this and see why the videos aren't getting displayed correctly.

                 
  • Dmitry Vorobyev

    Dmitry Vorobyev - 2020-02-05

    I just can't run this game with HW Acceleration. Thied this:
    "Flip emulation" (needed to support hardware acceleration) and "DirectX Version Hook" set to "DirectX1~6" (needed to hook ddraw and run the game in a window)
    But no luck. Even tried .dxw file from this thread, but no luck. I'm on GeForce 6600.

     
    • gho

      gho - 2020-02-05

      I tried the game on my Win10 64bit and AMD Radeon R5 and here it seems to work with HW acceleration. The graphic is fluid and the logs tell that the game opened a "Direct3D T&L HAL" device. What makes you thing you didn't get hardware acceleration? Could yo describe better your sympthoms and possibly provide a log (in that case, please use the attached log configuration, see screenshot).

       
      • Dmitry Vorobyev

        Dmitry Vorobyev - 2020-02-07

        Well, not having 3d acceleration is quite obvious. Everything is pixelated, plus error message welcomes me on launch and i've got only software option it options. FYI custom patch fixes the issue, but i'm interested in dxwnd working on vanilla exe.

         
        • gho

          gho - 2020-02-07

          If you have a custom patch, please share it. Maybe looking at the different behavior of the patched exe I could replicate the fix within DxWnd ...

           
          • Dmitry Vorobyev

            Dmitry Vorobyev - 2020-02-07

            Here you go. I'll try to ask what this thing do cause for now its a fixed exe.

             
            • gho

              gho - 2020-02-07

              Me too. I wrote an email to the author. If he explains us what happens inside it will be much easier than guessing from logs or reverse engineering.
              No doubt on the fact that if the trick is general enough, it may be of great interest for many other games on Geforce cards!

               
  • gho

    gho - 2020-02-07

    How silly of me! I got this eerie feeling and went checking. The reason why I couldn't replicate your problem was so simple: I had a cracked version with the very same files you have now!!! (checked with CRC32 checksum, they are identical)
    So, I have now a little preach for you: since I can't fix something that isn't broken, could you post here your previous cracked files? Maybe I can get some hint from there and make a DxWnd tweak for a generic game on GeForce cards.

     
  • Dmitry Vorobyev

    Dmitry Vorobyev - 2020-02-07

    Catch this, *_D.EXE is also cracked but it's only cdcheck bypass.

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.