Unofficial Hacker News companion — get notified on comment replies, and more.

Borland's DOS compilers, rebuilt from their own binaries (opens external site)

262 points by frostbyte7 3 days ago | github.com | 100 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (6)

  1. what was Microsoft-C 5.1 build with out of curiosity? was it build with version 4?
    Replies (1)
    1. It seems like it was built with some intermediate version between 5.0 and 5.1.

      The copyright strings have the year 1988, while 5.0 has 1987.

      The runtime library mostly fits the library shipped with 5.1, but a couple of functions fit 5.0 instead, and a couple others don't fit either versions.

      Replies (1)
      1. that must make it much harder to retrieve the sources, how do you know if you found a binary match if neither version fits? or will you leave these at behaviour match only? i have been binary matching with an agent a game built with 6.00 and i did think about starting binary match for the compiler itself, just to get more leverage at the task, because the game pipeline keeps getting stuck.
        Replies (1)
        1. I got distracted by other projects recently, but the idea is that we have two stages to the problem.

          Our main goal from reverse engineering the compiler is to understand how it works and to allow us to decompile other stuff better. That means that for the most part, binary identity of the compiler's decompilation isn't required - we can always use the original to verify the output is identical.

          So at the moment, behavioral identity is good enough.

          Once we have the entire compiler understood, we can try to tweak the reconstructed code to get a binary match, or alternatively, prove it couldn't have been compiled with itself.

          Replies (1)
          1. i would be quite interested to peek into 5.1 source code or maybe start working on 6.00 on top of it. do you plan any releases?
            Replies (1)
            1. It's nowhere near a releasable state, but I'll happily share with you what I currently have. Are you https://github.com/sillyc0n ?

              Btw, what game are you decompiling?