The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,969 other subscribers

Turbo Pascal: My 1996 answer to Q: How can I reverse a TP .EXE or .TPU back into source code?

Posted by jpluimers on 2014/03/20

Wow, did I really wrote that 18 years ago?

Yes I did, and I was quoted in the (back then famous) FAQPAS3.TXT from (now Professor Emeritus) Timo Salmi: The third set of frequently (and not so frequently) asked Turbo Pascal questions with Timo’s answers. The items are in no particular order.

From Fri Nov 8 00:00:56 1996
Subject: Decompiling a TP .EXE

Q: How can I reverse a TP .EXE or .TPU back into source code?

A: This is simply asking too much. You cannot decompile a TPprogram in a manner that would give you back the original source.This method of reverse engineering is not on in actual practice.

Quoting Jeroen Pluimers

“During thecompilation, important information gets lost about variables,types, identifiers etc. Writing a Pascal Decompiler is impossible.The best you can achieve is a disassembler that can help yourecognize some Pascal statements.”

Since then I learned that compilers emit highly predictable CPU code that – with the right, and sometimes complex, algorithms – can be reconstructed into language structures.

Of course you are missing the identifiers and comments, but you can some remarkable info, especially with well structured code.

Two more links about this:



2 Responses to “Turbo Pascal: My 1996 answer to Q: How can I reverse a TP .EXE or .TPU back into source code?”

  1. Joseph said

    Recently I read about a project that disassembled the Starcraft game binary, turned it back into C, compiled it for ARM and used the WINE windows application compatibility layer on Linux to enable running it on an ARM SoC!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: