Welcome, Guest. Please login or register.

Author Topic: Pascal decoder?  (Read 4935 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Pascal decoder?
« on: October 24, 2006, 11:18:38 AM »
Isn't Pascal compiled? If so, I assume you'd only be able to get as far as dissassembling it? Or is it converted to some sort of bytecode representation that's executed by an interpreter?
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Pascal decoder?
« Reply #1 on: October 24, 2006, 11:40:51 AM »
Quote

Piru wrote:
Pascal is compiled, so yes it's m68k asm disassembly. Shouldn't be too hard.


Aye, not for you but the guy who wanted his source back might balk at the sight of 40 pages of 68K mnemonics :-D
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Pascal decoder?
« Reply #2 on: October 24, 2006, 12:02:12 PM »
Quote

Piru wrote:
Quote
Aye, not for you but the guy who wanted his source back might balk at the sight of 40 pages of 68K mnemonics

That's why I opted for the "or find the password for me" part.


:lol: I must have missed that bit...
int p; // A
 

Offline Karlos

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

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Pascal decoder?
« Reply #4 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 Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Pascal decoder?
« Reply #5 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 Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Pascal decoder?
« Reply #6 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 Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Pascal decoder?
« Reply #7 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 Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16881
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Pascal decoder?
« Reply #8 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