Welcome, Guest. Please login or register.

Author Topic: Pascal decoder?  (Read 4933 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Pascal decoder?
« Reply #14 on: October 24, 2006, 02:52:15 PM »
Excuse me, but this is a MS-DOS program.

As this is amiga.org I thought the program would have been compiled to AmigaOS binary... I'm afraid I can't do much about the DOS app. Sorry.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Pascal decoder?
« Reply #15 on: October 24, 2006, 03:10:51 PM »
Just how do you say "D'Oh!" in Finnish?
int p; // A
 

Offline ricco32097Topic starter

  • Full Member
  • ***
  • Join Date: Feb 2006
  • Posts: 139
    • Show only replies by ricco32097
Re: Pascal decoder?
« Reply #16 on: October 24, 2006, 04:18:39 PM »
Anyone else want to give it a try?
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Pascal decoder?
« Reply #17 on: October 24, 2006, 04:21:17 PM »
Quote

ricco32097 wrote:
Anyone else want to give it a try?


Perhaps someone over on the AROS sites would be better to ask? There are probably (just guessing) more x86 coders there?
int p; // A
 

Offline Minuous

Re: Pascal decoder?
« Reply #18 on: October 24, 2006, 04:23:40 PM »
Then just use an MS-DOS decompiler.

Of course you will end up with C source rather than Pascal source, but that is actually an improvement :-)
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Pascal decoder?
« Reply #19 on: October 24, 2006, 04:37:28 PM »
Arent there fundamental differences in the handling of variables etc in Pascal? I thought strings were represented differently than they are in Cfor example?
int p; // A
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Pascal decoder?
« Reply #20 on: October 24, 2006, 04:45:31 PM »
@Minuous
Quote
Of course you will end up with C source rather than Pascal source

Uh?
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Pascal decoder?
« Reply #21 on: October 24, 2006, 04:55:32 PM »
Quote

Piru wrote:
@Minuous
Quote
Of course you will end up with C source rather than Pascal source

Uh?


I was thinking it would be an x86 dissassembly, myself ;-)
int p; // A
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Pascal decoder?
« Reply #22 on: October 24, 2006, 05:00:46 PM »
Well, I know there are apps that try to convert binaries to C code, but I doubt they produce any more readable code than x86 disassembly, anyway. :-)
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Pascal decoder?
« Reply #23 on: October 24, 2006, 05:04:36 PM »
I suppose it depends how stripped the binaries are, I guess. I also expect OS calling mechanisms can be spotted and properly labelled.

As for the rest...

Try decompiling a duffs device loop to see what you get :-D
int p; // A
 

Offline Minuous

Re: Pascal decoder?
« Reply #24 on: October 24, 2006, 05:43:02 PM »
If you use a disassembler, you'll get x86 source.

But if you use a decompiler you'll get source in a high-level language.

See http://en.wikipedia.org/wiki/Decompiler

Decompiler and disassembler aren't the same. Disassembler stops when it has created assembly code. Decompiler keeps processing and ends up with high-level language source. Of course there are many disassemblers on the Amiga but no decompilers AFAIK.

Most of the decompilers I've heard about produce C output, but in theory you could make one that produced Pascal output.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Pascal decoder?
« Reply #25 on: October 24, 2006, 05:51:16 PM »
I doubt a C decompiler would work well with code not written in C to start with.

There are certain programming constructs you can engineer in assembler that have absolutely no equivalent in C.

I wrote a small emulation core which was optimised in assembler, where each operation calculated the jump to the next code block directly and went there. A bit like having a big switch/case where the switch itself is never executed, but the code in each case clause is able to work out which one to jump to next relative to a base address (each block is padded to a certain 2^n size). There's absolutely no way to represent that in C.

So, code produced by pascal, could in theory contain machine level constructs that have no equivalent in C (not likely given their similarities).
int p; // A
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Pascal decoder?
« Reply #26 on: October 24, 2006, 06:26:07 PM »
Oh well, I still believe decompiler output is far from usable (at least the outputs I've seen, though I must admit it was years ago. Technology has gone forward since then I suppose).
 

Offline Minuous

Re: Pascal decoder?
« Reply #27 on: October 24, 2006, 06:46:37 PM »
Yeah, they are far from perfect, but they automate some of the process: less hand-editing required to convert from assembler to C than if you did the whole thing by hand.

I wrote a program (Aminet:dev/cross/Annotate.lha) that comments Signetics 2650 assembly source with pseudo-C equivalents...a similar principle but not exactly a decompiler in the strictest sense.
 

Offline ricco32097Topic starter

  • Full Member
  • ***
  • Join Date: Feb 2006
  • Posts: 139
    • Show only replies by ricco32097
Re: Pascal decoder?
« Reply #28 on: October 24, 2006, 07:25:23 PM »
File send...good luck, and thanks.
 

Offline TheMagicM

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2857
    • Show only replies by TheMagicM
    • http://www.BartonekDragRacing.com
Re: Pascal decoder?
« Reply #29 from previous page: October 24, 2006, 09:07:41 PM »
decompile it with a AmigaBASIC like decompiler.. LOL.. get a couple of BASIC lines of code then a whole bunch of DATA statements... that should keep you busy. LOL
PowerMac G5 dual 2.0ghz/128meg Radeon/500gb HD/2GB RAM, MorphOS 3.9 registered, user #1900
Powerbook G4 5,6 1.67ghz/2gb RAM, Radeon 9700/250gb hd, MorphOS 3.9 registered #3143