GithubHelp home page GithubHelp logo

spacecase123 / mortal-kombat-trilogy-pc-decompressor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nightshades1/mortal-kombat-trilogy-pc-decompressor

0.0 0.0 0.0 17 KB

Work in progress Reverse Engineering MKTrilogy with the help of the symbols

mortal-kombat-trilogy-pc-decompressor's Introduction

Mortal Kombat Trilogy PC Decompressor

Reversing a 1996 Win95 Game

Work in progress Reverse Engineering MKTrilogy with the help of the symbols
PC version is basically the PS1 Version, they did use PSY-Q and compile with OpenWatcom, the version is a "Beta" that's why there was embedded debug symbols ๐Ÿ˜‚.

spdriver aka Sprite Driver

This is managing the drawing process and texture cache management.

The PC Version is in fact the PS1 Version Ported to PC

It seem that it load the data into the VRAM texture cache (mostly our Fighter data .DAT), it then iterate the texture cache and uncompress the texture(s) if it's flagged as compressed then it assign the palette by looking at the Color LookUp Table, there's a good global called 'decompBuffer' or something, it's used a lot by the game, once all of their algorithm has finished to decompress what's inside the texture cache, the sprite driver will create a new object and 'clip' a rectangle on the screen, which is our sprite x/y/u/v mapped, as the PS1 used PolyFT4 to draw a RECT as a primitive (Sprite).

It is important to note that Motaro and Shao Kahn are 'compressed' because they are huge, but by this i mean, their file seem more than simply encoded (or is all files just compressed ๐Ÿค” dunno yet).

I just started today and i found it quite amazing, it has even the globals marked which contain all the routine of the fighter animation since this game is a combination of "C" and ".S/.ASM" file, the game has many part of code which doesn't look right because it's there where they 'assembled' their file and it make sense when we know that.

Any character/background is called a "Module" as defined by the debug symbol, basically a "Module" is simply the character/background data that was assembled on this SEGMENT,it seem to be about the "commands/routine" it execute to call/spawn the attack/special moves, for the background it's perhaps that 'assembled' Module that handle the coordinate of the 'tiles' and assemble all the textures to make the level (it's probably different than the background Animation table) which is surely only made to tell that at X/Y coord we want to "draw this" with that "Frame" and possibly play the next frame/adjust the X/Y coordinate to make it moving if it should.

All of that in one day, symbols is pretty much efficient in the research ๐Ÿ˜Ž

My Workflow

image

Then i wrote a python script to import all function name/variables name into IDA, it work for both Dos/WIN32 PC version, Dos seem easier to reverse

Win32 Version: image

Dos Version: image

mortal-kombat-trilogy-pc-decompressor's People

Contributors

nightshades1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.