‹ BackHN Continuity

Thread

Resident Evil 4 (GameCube) – complete byte-identical decompilation to C/C++

140 points · 99 comments · metrofun

  1. groundzeros2015 · · focus · HN ↗
    I opened a file at random. This looks more like emulating the behavior in compilable C syntax rather than recovering the game's programming

    void Em1eWeaponSet(cEm10* em) { Em10Work* w = EM10_WK(em);

        w->mot[41] = 0;
        w->mot[42] = 0;
        …
        w->mot[62] = 0;
        w->mot[63] = ARC(0x26C);
        w->mot[64] = ARC(0x26D);
        w->mot[65] = ARC(0x276);
        w->mot[66] = ARC(0x277);
        w->mot[67] = 0;
        w->mot[68] = 0;
        w->mot[69] = ARC(0x26A);
        w->mot[70] = ARC(0x26B);
        w->mot[71] = ARC(0x270);
        w->mot[72] = ARC(0x271);
        w->mot[73] = ARC(0x272);
        w->mot[74] = ARC(0x273);
        w->mot[75] = ARC(0x274);
        w->mot[76] = ARC(0x275);
        w->mot[77] = 0;
        w->mot[78] = 0;
    }
    1. kasool · · focus · HN ↗
      Yes, that is how decompilation projects work.

      The puzzle is then trying to piece the context back together by probing the game to recover something that approximately resembles what the original code might have looked like.

      Eventually you can do things like Dusklight for advanced modding and feature implementation.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.