Windows

Hacking a Game From 2000 To Run On Windows 11



Let’s hack an obscure breakout clone from 2000 to work on Windows 11

*************************
Chad’s rewrite:
My bodged attempt to fix:
*************************

Become a member to get early access to videos –

☕ – I also have coffee | – ☕

Tools:
🐉 – Ghidra –
🐛 – x64dbg –
🔬 – CFF Explorer –

💭 All views are my own 💭

[ad_2]

source

Related Articles

20 Comments

  1. So you just created your own version of wine.
    Very simplistic and limited to just a few functions, but your application is just doing exactly the same thing wine is doing when running windows applications on linux.
    And talking about wine, did you try to run that game using wine or dosbox? It might just work out of the box in the correct emulator.

  2. Hi
    I remember that magenta color was used to render transparency (No rgba was available, just rbg, so one color was reserved to set full transparency)
    For exemple, you can set your backgroud color of the desktop in magenta, and you can have your tv card rendering in place of the magenta on the desktop.
    You can use it in icones too, and I think in that case the first top left pixel set the transparency color.

  3. The thing that I think is kind of funny here is that this game runs perfectly under WINE. I feel like they should port WINE to Windows because I keep finding games that actually run for me on Linux yet refuse to run for people on Windows.

  4. Awesome video. I'm doing something similar for a game of the same era and took some of the same approaches 🙂 Here are some tips:
    – Making the game work in windowed mode if it was not designed for it is actually pretty annoying, because the code assumes all coordinates are screen coordinates. Make it run in a fixed-size, borderless window that is always at (0, 0) first so that screen coordinates, window coordinates and client coordinates line up. This lets you run your tools and get more things working properly before you attempt to make it into an actual movable window.

    – If you're not using exclusive mode, the primary surface will be in the color space and pixel format of your desktop, but in exclusive mode, the game can pick the format it wants. So the game won't look right unless you convert while copying from the off-screen to the primary surface.
    – Windows isn't doing a good job at keeping DirectDraw working correctly on modern systems. Compatibility settings may help. There's an undocumented function exported from modern ddraw.dll called SetAppCompatData that can be useful. The Microsoft-provided debug symbols gives further hints of what each setting does.
    – Rather than trying to make DirectDraw work on modern Windows, the simplest approach is to actually use a build of Wine for Windows! WineD3D provides a DirectDraw-compatible API that renders using OpenGL. This was originally made to run games on Linux, but since OpenGL is well-supported on Windows, and Wine is a very mature project, it is the best compatibility layer for these old games. Bonus points: using OpenGL, you'll have access to modern features from your GPU drivers like AI upscaling and frame generation.
    – Even with WineD3D, you may still need to hook some functions to fix rendering issues. For example, you can hook CreateSurface and make sure to populate DDSURFACEDESC with the correct pixel formats, and WineD3D will do the conversions for you when copying between surfaces with different formats.

  5. I know these videos are an insane amount of work, but I really do love watching them. They're very entertaining- coming from a non-programmer with an interest in the topic.
    I hope you keep doing them!

  6. My guess is that the initial crash with editing the resource could be due to the NXCOMPAT flag. It's possible the game was compiled to use DEP but never tested on an OS that actually had it (like XP or later) so it crashes when it believes it should be able to edit that section. You then editing the permissions on the section to make it writable might have snowballed into the problem with LoadImage, which probably assumes the section is read only (though that's purely speculative.)

    If you see solid magenta (or occasionally blue, or bright green) as a background to the image, that is usually meant to serve as transparency (not white!) in an image format that would otherwise not support transparency. That was common in games of this era, it's like a green screen for sprites. It's magenta specifically because it's a pretty uncommon colour to use in the sprites themselves.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button