Pascal decompiler - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Pascal decompiler

FlyingNosehairFlyingNosehair Posts: 58Member
I'd like to know where I can get a Pascal decompiler for DOS. Now before you tell me that a Pascal decompiler is impossible, I'd like to get a few things straight. I know that it's impossible to retrieve the comments that were in the source code, and I know it's impossible for the variables to have meaningful names, but I don't care. I just want a program that produces Pascal code that can be compiled using a Pascal compiler. I don't care if there are no comments or variables with meaningful names.

Comments

  • zibadianzibadian Posts: 6,349Member
    : I'd like to know where I can get a Pascal decompiler for DOS. Now before you tell me that a Pascal decompiler is impossible, I'd like to get a few things straight. I know that it's impossible to retrieve the comments that were in the source code, and I know it's impossible for the variables to have meaningful names, but I don't care. I just want a program that produces Pascal code that can be compiled using a Pascal compiler. I don't care if there are no comments or variables with meaningful names.
    :
    You will lose a lot more than just the variable names and comments. You will also loose all procedures and functions, as these will be replaced by goto's. All variables, except ordinal types, will be cast as untyped pointers. This means that a simple code might become nearly unreadable. More than that it becomes uneditable, because all "type-casting" is done at run-time instead of compile-time. These are the main reasons, why a decompiler doesn't exist, whether it is Pascal, C, or Basic.
  • ManningManning Posts: 1,621Member
    : You will lose a lot more than just the variable names and comments. You will also loose all procedures and functions, as these will be replaced by goto's. All variables, except ordinal types, will be cast as untyped pointers. This means that a simple code might become nearly unreadable. More than that it becomes uneditable, because all "type-casting" is done at run-time instead of compile-time. These are the main reasons, why a decompiler doesn't exist, whether it is Pascal, C, or Basic.
    :

    I dont know about now, but back when I first used Visual Basic (Version 3 I think) many years ago, there were actually many decompilers available. But I guess that was from the fact that it was an interpreted and not a compiled language? I never really did look into that so could be wrong there.

    But back to the original message, depending on why you are wanting to get the original source code, you might want to try a disassembler. Awhile back my C teacher gave us a program that we were supposed to immitate (it performed about a dozen different calculations on a couple variables). After hours of trial and error I hadnt gotten anywhere, but after disassembling the EXE it only took about 15 minutes to see what he was doing. Of course you'll have to know a little ASM if you decide to try this...

    So in other words if you want to make changes to an existing program, you're pretty much SOL. But if you just want to see what the program is doing at a given point, that may be possible.
Sign In or Register to comment.