Board index » delphi » Help decompiling turbo pascal exe file

Help decompiling turbo pascal exe file

Hi folks first time so please be gentle!

I am trying to reverse engineer an old (circa 1990) turbo pascal 16bit DOS
program and have identified the compiler and got meaningful source code out
of it and now am faced with pages of asm code.

What I am after, if it exists, is a list of common turbo pascal commands and
structures and what they compile to under DOS with Borlands' Turbo Pascal
compiler, is there anything available?
I have tried various places, yahoo, google,fravia's pages and other
craker/reverse engineering resources and am running into brick walls
everywhere, I know that some people know what common asm components are for
C code (having seen this on hacking discussion boards) but cannot find any
listings of these either.

Before you ask no I am not expecting an automatic method of doing this (it
would be nice though wouldn't it), but any info will be gratefully recieved,
even just pointers

TIA

--
Chris :-)

Remove the nospam. from reply address to reply

 

Re:Help decompiling turbo pascal exe file


Quote
cdugan wrote:
> Hi folks first time so please be gentle!

> I am trying to reverse engineer an old (circa 1990) turbo pascal 16bit DOS
> program and have identified the compiler and got meaningful source code out
> of it and now am faced with pages of asm code.

> What I am after, if it exists, is a list of common turbo pascal commands and
> structures and what they compile to under DOS with Borlands' Turbo Pascal
> compiler, is there anything available?
> I have tried various places, yahoo, google,fravia's pages and other
> craker/reverse engineering resources and am running into brick walls
> everywhere, I know that some people know what common asm components are for
> C code (having seen this on hacking discussion boards) but cannot find any
> listings of these either.

> Before you ask no I am not expecting an automatic method of doing this (it
> would be nice though wouldn't it), but any info will be gratefully recieved,
> even just pointers

> TIA

> --
> Chris :-)

> Remove the nospam. from reply address to reply

You can't get this info otherwise? I mean get the source PAS-Files? You
don't know who wrote the program? Because what you want to do will be
hard if even impossible. If the person used some peep-hole optimizer or
something similar the pascal commands aren't 1:1 translated to ASM anymore!

Greetings

Markus

Re:Help decompiling turbo pascal exe file


Quote
"cdugan" <cdu...@nospamntlworld.com> wrote in message <news:RDuX7.5920$4x4.1104865@news2-win.server.ntlworld.com>...
> Hi folks first time so please be gentle!

> I am trying to reverse engineer an old (circa 1990) turbo pascal 16bit DOS
> program and have identified the compiler and got meaningful source code out
> of it and now am faced with pages of asm code.

> What I am after, if it exists, is a list of common turbo pascal commands and
> structures and what they compile to under DOS with Borlands' Turbo Pascal
> compiler, is there anything available?
> I have tried various places, yahoo, google,fravia's pages and other
> craker/reverse engineering resources and am running into brick walls
> everywhere, I know that some people know what common asm components are for
> C code (having seen this on hacking discussion boards) but cannot find any
> listings of these either.

> Before you ask no I am not expecting an automatic method of doing this (it
> would be nice though wouldn't it), but any info will be gratefully recieved,
> even just pointers

If you're very desperate, I would suggest that you buy IDA Pro
<http://www.datarescue.com/> It's not cheap (USD 299), and if your not
a company, you may have trouble buying it. It uses something called
FLIRT:

"FLIRT, our Fast Library Identification and Recognition Technology
identifies standard function calls for many compilers. See FLIRT in
action <http://www.datarescue.com/idabase/pix/ida_flirt_white.gif>.
Read the FLIRT technological white paper
<http://www.datarescue.com/idabase/flirt.htm>."

I've used it on quite a few TP/BP programs for which no source was
available, and it's quite useful!

Regards,

Robert
--
Robert AH Prins
pr...@bigfoot.com
adira(at)takas(dot)lt (Only until 4 January 2002!)

Re:Help decompiling turbo pascal exe file


I'd love to but I can't afford it being out of work at the moment, Yes I got
hold of the free version from them without realising that it didn't come
with the FLIRT parts. Can't even get it from warez sites, but you can get
everything else!

--
Chris

Remove the nospam. from reply address to reply
Robert AH Prins <pr...@bigfoot.com> wrote in message
news:ed6d5b69.0112301430.cebe4c8@posting.google.com...

Quote
> "cdugan" <cdu...@nospamntlworld.com> wrote in message

<news:RDuX7.5920$4x4.1104865@news2-win.server.ntlworld.com>...
Quote
> > Hi folks first time so please be gentle!

> > I am trying to reverse engineer an old (circa 1990) turbo pascal 16bit
DOS
> > program and have identified the compiler and got meaningful source code
out
> > of it and now am faced with pages of asm code.

> > What I am after, if it exists, is a list of common turbo pascal commands
and
> > structures and what they compile to under DOS with Borlands' Turbo
Pascal
> > compiler, is there anything available?
> > I have tried various places, yahoo, google,fravia's pages and other
> > craker/reverse engineering resources and am running into brick walls
> > everywhere, I know that some people know what common asm components are
for
> > C code (having seen this on hacking discussion boards) but cannot find
any
> > listings of these either.

> > Before you ask no I am not expecting an automatic method of doing this
(it
> > would be nice though wouldn't it), but any info will be gratefully
recieved,
> > even just pointers

> If you're very desperate, I would suggest that you buy IDA Pro
> <http://www.datarescue.com/> It's not cheap (USD 299), and if your not
> a company, you may have trouble buying it. It uses something called
> FLIRT:

> "FLIRT, our Fast Library Identification and Recognition Technology
> identifies standard function calls for many compilers. See FLIRT in
> action <http://www.datarescue.com/idabase/pix/ida_flirt_white.gif>.
> Read the FLIRT technological white paper
> <http://www.datarescue.com/idabase/flirt.htm>."

> I've used it on quite a few TP/BP programs for which no source was
> available, and it's quite useful!

> Regards,

> Robert
> --
> Robert AH Prins
> pr...@bigfoot.com
> adira(at)takas(dot)lt (Only until 4 January 2002!)

Re:Help decompiling turbo pascal exe file


Im Artikel <RDuX7.5920$4x4.1104...@news2-win.server.ntlworld.com>, "cdugan"
<cdu...@nospamntlworld.com> schreibt:

Quote
>What I am after, if it exists, is a list of common turbo pascal commands and
>structures and what they compile to under DOS with Borlands' Turbo Pascal
>compiler, is there anything available?

The code should reside in the according TPUs, which are linked into the EXE
file. Some disassemblers allow to import libraries, and identify the code and
data in the linked programs. But I don't know about support for the import of
TPUs, which have a different format than other object libraries.

DoDi

Re:Help decompiling turbo pascal exe file


Do you mean that the code in the TPU's is copied bit for bit directly into
the EXE file at compile time?

--
Chris

Remove the nospam. from reply address to reply

Quote
VBDis <vb...@aol.com> wrote in message

news:20011230192123.03083.00000662@mb-fr.aol.com...
Quote
> Im Artikel <RDuX7.5920$4x4.1104...@news2-win.server.ntlworld.com>,
"cdugan"
> <cdu...@nospamntlworld.com> schreibt:

> >What I am after, if it exists, is a list of common turbo pascal commands
and
> >structures and what they compile to under DOS with Borlands' Turbo Pascal
> >compiler, is there anything available?

> The code should reside in the according TPUs, which are linked into the
EXE
> file. Some disassemblers allow to import libraries, and identify the code
and
> data in the linked programs. But I don't know about support for the import
of
> TPUs, which have a different format than other object libraries.

> DoDi

Re:Help decompiling turbo pascal exe file


Quote
In article <4uYX7.20177$4x4.2606...@news2-win.server.ntlworld.com>, cdugan wrote:
> Do you mean that the code in the TPU's is copied bit for bit directly into
> the EXE file at compile time?

No. TPU also contains the complete (coded) interface, to avoid needing the
source for a unit, and other info.

Also the "true" code in the TPU is not yet relocated. The linker still
has to process that code to create the .EXE

What the previous poster meant is that the TPU format is not standarised,
and nothing except older Borland tools and some freeware tools can process
it.

IOW you would have to use something that understands this Borland specific
format to disassemble it, or use some tool to transform it into some standard
format (IIRC the basic TPU formats are in SWAG)

Re:Help decompiling turbo pascal exe file


Cheers found it at http://www.gdsoft.com/swag/swag.html  great site for the
insides of pascal in general, thanks.

--
Chris

Remove the nospam. from reply address to reply
Marco van de Voort <mar...@toad.stack.nl> wrote in message
news:slrna30uot.ukk.marcov@toad.stack.nl...

Quote
> In article <4uYX7.20177$4x4.2606...@news2-win.server.ntlworld.com>, cdugan
wrote:
> > Do you mean that the code in the TPU's is copied bit for bit directly
into
> > the EXE file at compile time?

> No. TPU also contains the complete (coded) interface, to avoid needing the
> source for a unit, and other info.

> Also the "true" code in the TPU is not yet relocated. The linker still
> has to process that code to create the .EXE

> What the previous poster meant is that the TPU format is not standarised,
> and nothing except older Borland tools and some freeware tools can process
> it.

> IOW you would have to use something that understands this Borland specific
> format to disassemble it, or use some tool to transform it into some
standard
> format (IIRC the basic TPU formats are in SWAG)

Re:Help decompiling turbo pascal exe file


Quote
"cdugan" <cdu...@nospamntlworld.com> wrote in message <news:0o%X7.18447$ll6.2715097@news6-win.server.ntlworld.com>...
> Cheers found it at http://www.gdsoft.com/swag/swag.html  great site for the
> insides of pascal in general, thanks.

> --
> Chris

> Remove the nospam. from reply address to reply
> Marco van de Voort <mar...@toad.stack.nl> wrote in message
> news:slrna30uot.ukk.marcov@toad.stack.nl...
> > In article <4uYX7.20177$4x4.2606...@news2-win.server.ntlworld.com>, cdugan
>  wrote:
> > > Do you mean that the code in the TPU's is copied bit for bit directly
>  into
> > > the EXE file at compile time?

> > No. TPU also contains the complete (coded) interface, to avoid needing the
> > source for a unit, and other info.

> > Also the "true" code in the TPU is not yet relocated. The linker still
> > has to process that code to create the .EXE

> > What the previous poster meant is that the TPU format is not standarised,
> > and nothing except older Borland tools and some freeware tools can process
> > it.

> > IOW you would have to use something that understands this Borland specific
> > format to disassemble it, or use some tool to transform it into some
> > standard format (IIRC the basic TPU formats are in SWAG)

You might also want to have a look at <http://www.wotsit.org/> and, if
your unit's are TP 6.0 for TWU1.ZIP (and it's, don't remember the
name, TP 5.5 version).

Regards,

Robert
--
Robert AH Prins
pr...@bigfoot.com

Re:Help decompiling turbo pascal exe file


Thanks Robert, i've allready found that link, but now i've got a better
understanding of what the TPU's do and how they work I might just crack it.
Pun NOT intended.

Cheers and Happy New Year

Robert AH Prins <pr...@bigfoot.com> wrote in message
news:ed6d5b69.0112310936.7b41ff43@posting.google.com...

Quote
> "cdugan" <cdu...@nospamntlworld.com> wrote in message

<news:0o%X7.18447$ll6.2715097@news6-win.server.ntlworld.com>...
Quote
> > Cheers found it at http://www.gdsoft.com/swag/swag.html  great site for
the
> > insides of pascal in general, thanks.

> > --
> > Chris

> > Remove the nospam. from reply address to reply
> > Marco van de Voort <mar...@toad.stack.nl> wrote in message
> > news:slrna30uot.ukk.marcov@toad.stack.nl...
> > > In article <4uYX7.20177$4x4.2606...@news2-win.server.ntlworld.com>,
cdugan
> >  wrote:
> > > > Do you mean that the code in the TPU's is copied bit for bit
directly
> >  into
> > > > the EXE file at compile time?

> > > No. TPU also contains the complete (coded) interface, to avoid needing
the
> > > source for a unit, and other info.

> > > Also the "true" code in the TPU is not yet relocated. The linker still
> > > has to process that code to create the .EXE

> > > What the previous poster meant is that the TPU format is not
standarised,
> > > and nothing except older Borland tools and some freeware tools can
process
> > > it.

> > > IOW you would have to use something that understands this Borland
specific
> > > format to disassemble it, or use some tool to transform it into some
> > > standard format (IIRC the basic TPU formats are in SWAG)

> You might also want to have a look at <http://www.wotsit.org/> and, if
> your unit's are TP 6.0 for TWU1.ZIP (and it's, don't remember the
> name, TP 5.5 version).

> Regards,

> Robert
> --
> Robert AH Prins
> pr...@bigfoot.com

Re:Help decompiling turbo pascal exe file


Quote
In article <b62Y7.18154$Zg2.1800...@news11-gui.server.ntli.net>, doog wrote:
> Thanks Robert, i've allready found that link, but now i've got a better
> understanding of what the TPU's do and how they work I might just crack it.
> Pun NOT intended.

I'm not 100% sure, but it could be that TPU file date-time also matters.

Other Threads