Board index » delphi » help decompiling

help decompiling

Does anyone know how to decompile a simple Pascal Program.
I'd appreciate the Help.

Thanks,
Zeek

 

Re:help decompiling


Quote
zeek kasous (z...@panix.com) wrote:

: Does anyone know how to decompile a simple Pascal Program.

You can't decompile.

Re:help decompiling


On 18 Oct 1995, zeek kasous wrote:

Quote
> Does anyone know how to decompile a simple Pascal Program.
> I'd appreciate the Help.

You use rename to change the name from .exe to .pas.  DOS automatically
recognizes that you want to convert it from binary executable to Pascal
and does it for you.

SORRY, I just *had* to do it, okay?!?! :)  (And no, this doesn't work.  
Only way you can do this is to disassemble it and learn assembler.)

    ________________________________________________________________________
   / Joshua Shagam                    /    (Quantum Porcupine / Versatile) /
  / mailto:JSha...@nmsu.edu          /       http://web.nmsu.edu/~jshagam /
 / phone://1.505.645.3856/~joshua   /  for the Quantum Porcupine Archive /
/__________________________________/____________________________________/
Q: How many hoards would the monguls board if the mongul hordes got bored?
A: The monguls would board all the hoards if the hordes got really bored.

Re:help decompiling


-----BEGIN PGP SIGNED MESSAGE-----

Quote
Quantum Porcupine <jsha...@nmsu.edu> wrote:
>SORRY, I just *had* to do it, okay?!?! :)  (And no, this doesn't work.  
>Only way you can do this is to disassemble it and learn assembler.)

roflmao!!!!!

What EVER did I start here... :)Quantum Porcupine <jsha...@nmsu.edu> wrote:

Quote
>SORRY, I just *had* to do it, okay?!?! :)  (And no, this doesn't work.  
>Only way you can do this is to disassemble it and learn assembler.)

roflmao!!!!!

What EVER did I start here... :)

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMIe+5avzfq6ID9xpAQEPigP8Cat2tl0JAsY1b5yiAiP/uPpJdaZ6bkmt
/bmfCHdIZaHzazjOZz/ZiwcZKwIitOQ4FjI6oE9lZqcwqpO90j7f2hDOisZIhbSN
WA60k1Q05b3+yRVTyylQa8/cJS3OGwCu5tSykgN6g0Ph2FcwT0VWGgWEMTRmDE4g
qVFBRwzCb4c=
=fhCj
-----END PGP SIGNATURE-----

---
Bryan Erik Slatner,  TurboPower Software Company
k...@rmii.com, 71175.3...@compuserve.com
http://rainbow.rmii.com/~kimk
Fingerprint: C4 0B 76 3F E8 87 C7 BA D1 7F 9E E6 0A 9B 3F 6C

Re:help decompiling


In article <4651vs$...@nntp5.u.washington.edu>, sza...@saul5.u.washington.edu (Janos Szamosfalvi) says:

Quote

>zeek kasous (z...@panix.com) wrote:
>: Does anyone know how to decompile a simple Pascal Program.

>You can't decompile.

If you have the matching version of Turbo Debug you can see what machine
code your Pascal was compiled into, instruction by instruction.  I've used
that to find/fix problems.

/MP

Re:help decompiling


Quote
>>> Does anyone know how to decompile a simple Pascal Program.
>>> I'd appreciate the Help.

>>You use rename to change the name from .exe to .pas.  DOS automatically
>>recognizes that you want to convert it from binary executable to Pascal
>>and does it for you.
>Actually, you have to buy Windows 95 to be able to do that.  It's one of
>the new features!  It also can decompile C++ and VB programs.  And, it
>you ftp an executable from a Sun workstation, it can decompile it into C
>code that will compile and run under Windows 95.  I can't wait to get it
>so I don't have to buy any more software!  Really!

Is that so???

I have Win95, but haven't tried this yet. (I'm goting to try it as
soon as I get home from school)

Would ANYONE who has information on this mail, or drop some news on
it.

Or if you know of another good way to deCompile programs into
highlevel code, Mail or News me at ONCE!!

Bye.

Re:help decompiling


In article <4759qm$...@hasle.oslonett.no>, b...@oslonett.no (Bj?rn Erik Haug) says:
Quote

>>>> Does anyone know how to decompile a simple Pascal Program.
>>>> I'd appreciate the Help.

>>>You use rename to change the name from .exe to .pas.  DOS automatically
>>>recognizes that you want to convert it from binary executable to Pascal
>>>and does it for you.

>>Actually, you have to buy Windows 95 to be able to do that.  It's one of
>>the new features!  It also can decompile C++ and VB programs.  And, it
>>you ftp an executable from a Sun workstation, it can decompile it into C
>>code that will compile and run under Windows 95.  I can't wait to get it
>>so I don't have to buy any more software!  Really!

>Is that so???

>I have Win95, but haven't tried this yet. (I'm goting to try it as
>soon as I get home from school)

>Would ANYONE who has information on this mail, or drop some news on
>it.

>Or if you know of another good way to deCompile programs into
>highlevel code, Mail or News me at ONCE!!

>Bye.

This claim is ABSOLUTELY FALSE!  "Decompiling" is basically impossible.
On a related topic:  Disassembling CAN be done but it is not especially
useful because you tend to get names like L00544, L00545, and V00082 for
routine and variable names.  Not really useful and usually it won't
recompile successfully without extraordinary amounts of work!

It may be that someone has written a decompiler that works only on code for
one exact version of a compiler but it would be so difficult to do and so
specific to that exact version and make of compiler that I doubt anyone has
bothered.

They've tried to fool you.

If you have more questions you can E-mail me directly.

/MP

Re:help decompiling


On 2 Nov 1995, mike pijl wrote:

Quote
> In article <4759qm$...@hasle.oslonett.no>, b...@oslonett.no (Bj=F8rn Erik =
Haug) says:

> >>>> Does anyone know how to decompile a simple Pascal Program.
> >>>> I'd appreciate the Help.
> >>>>=20
> >>>You use rename to change the name from .exe to .pas.  DOS automaticall=
y=20
> >>>recognizes that you want to convert it from binary executable to Pasca=
l=20
> >>>and does it for you.

> >>Actually, you have to buy Windows 95 to be able to do that.  It's one o=
f=20
> >>the new features!  It also can decompile C++ and VB programs.  And, it=
=20
> >>you ftp an executable from a Sun workstation, it can decompile it into =
C=20
> >>code that will compile and run under Windows 95.  I can't wait to get i=
t=20
> >>so I don't have to buy any more software!  Really!

> >Is that so???

> >I have Win95, but haven't tried this yet. (I'm goting to try it as
> >soon as I get home from school)

> >Would ANYONE who has information on this mail, or drop some news on
> >it.

> >Or if you know of another good way to deCompile programs into
> >highlevel code, Mail or News me at ONCE!!

> >Bye.

> This claim is ABSOLUTELY FALSE!  "Decompiling" is basically impossible.=
=20
> On a related topic:  Disassembling CAN be done but it is not especially=
=20
> useful because you tend to get names like L00544, L00545, and V00082 for
> routine and variable names.  Not really useful and usually it won't=20
> recompile successfully without extraordinary amounts of work!
>=20
> It may be that someone has written a decompiler that works only on code f=
or
> one exact version of a compiler but it would be so difficult to do and so
> specific to that exact version and make of compiler that I doubt anyone h=
as
> bothered.
>=20
> They've tried to fool you.
>=20

I'd say we succeeded rather well as well. :)  The only reason I said "You=
=20
have to rename..." bit was because earlier, someone told a newbie that=20
you use rename to "convert .pas to .exe".  If you read my post where I=20
joke about it, you'll notice that after a few lines of whitespace I said=20
"Sorry, just couldn't resist." :)

Quote
> If you have more questions you can E-mail me directly.
>=20

Or all these people on here who actually buy these rename jokes could=20
try, say, reading their DOS manual for once. :)

    _______________________________________________________________________=
_
   / Joshua Shagam                    /    (Quantum Porcupine / Versatile) =
/
  / mailto:JSha...@nmsu.edu          /       http://web.nmsu.edu/~jshagam /
 / phone://1.505.645.3856/~joshua   /  for the Quantum Porcupine Archive /
/__________________________________/____________________________________/
\ The opinions expressed are not   \        Of course, porcupines don't \
 \ necessarily those of anyone else \    *NEED* any damn disclaimers! :) \
  \__________________________________\____________________________________\
Q: How many hoards would the monguls board if the mongul hordes got bored?
A: The monguls would board all the hoards if the hordes got really bored

Re:help decompiling


Hi,

I just read a few articles about decompiling in this newsgroup.
Well, you can't retrieve a Pascal source code, since the compilation implies
an important loss of information.
As far as disassembling in concerned, OK, it works, but I see it as a miracle.
Since machine instructions have differents sizes, and since data can be
inserted (no way do distinguish code from data), I am not sure that the
instructions will be retrieved correctly.
Nevertheless, if you follow the jumps, like with Turbo De{*word*81}, OK, you can
examine the assembler code.

But no decompilation to Pascal or C or any other language at all !!!

Another discussion that make me laugh is when I read that
renaming a .pas in .exe will compile it, and renaming a .exe in .pas
will decompiling it.
Hey, if an OS did such a thing, I would worry a bit !
An OS always allows to RENAME a file, ie change it's name regardless of its
contents. (So, no modification, no compilation nor decompilation at all.)

Well, stop joking about this, you're wasting your time and the disk space
of the news servers. Oh I'm doing it now. :-)

That's all,

Bye,

Christophe.

Re:help decompiling


On 3 Nov 1995, parent christophe wrote:

Quote
> Hi,

> I just read a few articles about decompiling in this newsgroup.
> Well, you can't retrieve a Pascal source code, since the compilation implies
> an important loss of information.
> As far as disassembling in concerned, OK, it works, but I see it as a miracle.
> Since machine instructions have differents sizes, and since data can be
> inserted (no way do distinguish code from data), I am not sure that the
> instructions will be retrieved correctly.

I always have this problem... i.e. somewhere along the line it gets one
byte off and so I get complete garbage instead of my code :)

Quote
> Nevertheless, if you follow the jumps, like with Turbo De{*word*81}, OK, you can
> examine the assembler code.

> But no decompilation to Pascal or C or any other language at all !!!

Well, Exec-2-C supposedl disassembles to asm and then writes C
pseudocode, but I can only get the disassemble to asm bit working right :)

Quote
> Another discussion that make me laugh is when I read that
> renaming a .pas in .exe will compile it, and renaming a .exe in .pas
> will decompiling it.
> Hey, if an OS did such a thing, I would worry a bit !
> An OS always allows to RENAME a file, ie change it's name regardless of its
> contents. (So, no modification, no compilation nor decompilation at all.)

Well, originally someone asked "How do I make a .EXE file from my .PAS
file", and after the correct answer had been given a few times, someone
jokingly said you rename from pas to exe.  that caused quite an uproar,
especially among the people who obviously never bothered to READ THE
{*word*30}ING MANUAL and actually TRIED that shit... so anyway, someone asked
"How do I decomiple", and then I said the exact same thing which the
compiling-rename dude said, only the other way around.  A couple lines
down I said "Sorry, *someone* had to say it", and if anyone reading that
didn't get the {*word*30}ing joke then they deserve whatever disappointment
they got.

Quote
> Well, stop joking about this, you're wasting your time and the disk space
> of the news servers. Oh I'm doing it now. :-)

I think that the jokes will stop when people actually read the manual,
for both DOS and whatever program they're using (TP in this case).  
Recently I've been having trouble trying to explain to someone how to
make an ANSI-type viewer and I gave him some example code, and he didn't
understand a single bit of it since it involved data structures, dynamic
memory allocation, and pointers.  He insisted that I tell him how to do
it when he didn't even understand that:

type
  TScrbuf = array[0..24, 0..79] of word;
  PScrbuf = ^Tscrbuf;

were declaring types, not variables.  He tried making a little code on
his own, which looked something like:

move (PScrbuf^, TScrbuf, 4000);

and he was wondering why it wouldn't compile...

So a message to all you lamers out there:

LEARN HOW TO DO SOMETHING BEFORE YOU TRY TO DO IT!!! I don't care how you
learn it... explore, look at other peoples' code, read the helpfiles,
hell - even read the manual! but don't take any advice without at least
thinking about what it may do!!!

Quote
> That's all,

Unfortunately, this is a lost cause.  People without a clue seem to flood
in by the truckload.

    ________________________________________________________________________
   / Joshua Shagam                    /    (Quantum Porcupine / Versatile) /
  / mailto:JSha...@nmsu.edu          /       http://web.nmsu.edu/~jshagam /
 / phone://1.505.645.3856/~joshua   /  for the Quantum Porcupine Archive /
/__________________________________/____________________________________/
\ The opinions expressed are not   \        Of course, porcupines don't \
 \ necessarily those of anyone else \    *NEED* any damn disclaimers! :) \
  \__________________________________\____________________________________\
Q: How many hoards would the monguls board if the mongul hordes got bored?
A: The monguls would board all the hoards if the hordes got really bored

Re:help decompiling


In message <Pine.A32.3.91.951104121022.64362E-100000@paris>
        Quantum Porcupine <jsha...@nmsu.edu> writes:

<snip>

For goodness sake guys...LETS JUST DROP IT OK??!!

Re:help decompiling


In article <ros.90.309DB...@informatik.uni-koblenz.de>, r...@informatik.uni-koblenz.de (Manfred Rosendahl) says:
Quote

>For theoretical computer science decompiling Turbo-Pascal programs is very
>simple:
>You take an enumeration of all Turbo-Pascal Programs, that is simple because
>a Turbo-Pascal programs is a finite number of ASCII-characters, what is a
>finite set. You can enumerate the programs by the program length.
>Then you take the programs of your enumeration and put then in the compiler.
>You either get an error, then it was not a correct source or you get an .EXE
>file, which you compare with the .EXE you want to decompile. If your program
>did use only the standard units (system,dos,crt) you sometimes will find the
>source of your program (if you and your computer are still at life).
>But the solution is NP-complete and can only show the difference between
>theory and practice.

Just a few points:
1.You need to compile each program with each enumeration of the compiler
switches.
2.The same EXE file can be generated by an infinite number of source files
  (comments, variable names, white space).  
3.Where it is true that each Pascal program consists of a finite number of
  characters, you will need to assume a maximum if you want to enumerate
  them all in step one.  How about simply designing an enumeration scheme
  an then creating the EXE on the fly until the corresponding one is found?
  It still remains a solvable problem, no?
Jochen

________________________________________________________________________
joch...@berlin.snafu.de                        71270.3...@compuserve.com
I post, therefore I am.

Re:help decompiling


Quote
Manfred Rosendahl (r...@informatik.uni-koblenz.de) wrote:

: For theoretical computer science decompiling Turbo-Pascal programs is very
: simple:
: You take an enumeration of all Turbo-Pascal Programs, that is simple because
: a Turbo-Pascal programs is a finite number of ASCII-characters, what is a
: finite set. You can enumerate the programs by the program length.

Well, even though the ascii set is finite, the Turbo Pascal grammar is
recursive, hence it can generate infinitely many valid Turbo Pascal
programs.   It's kinda hard to enumerate an uncountable number of
programs.

Re:help decompiling


-----BEGIN PGP SIGNED MESSAGE-----

Quote
Chris Labanosky <chr...@csra.net> wrote:
>I wish people would stop giving false advice it really pisses me off!

Grow up, for goodness's sake!  The individual in question already
had the correct answer...the bogus exchanges were from a couple
of folks who were just having fun.

Wanna show me the rule that says a technical-oriented newsgroup
has to be boring?

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMJ/Tnoxuanrdxs15AQFgUwQAhDcdFew1JJddTrKm4t73gYYoCxGbyMeu
xJaMLJO3wC2cJogMaDtQybrEDnGZWyCiAs1KSnXMPZU1zrOhpTvDad43aqCRm4vK
+OcuYdPEb2V9i6W7+aGQ8JjFtWTQbRwFRkYzxYEq1a4Utwc0+N1wR80Z2r+sQ1mi
0T21l14YSgs=
=2T6M
-----END PGP SIGNATURE-----

---
Bryan Erik Slatner,  TurboPower Software Company
bslat...@rmii.com, 71175.3...@compuserve.com
http://rainbow.rmii.com/~bslatner
Fingerprint: FD 66 C9 86 7B F2 AE DB 1E 3B 81 E0 87 70 A6 9D

Read alt.religion.scientology to find out how the Church (spit!)
of Scientology is attempting to destroy your freedom to
communicate electronically and how they're trying to "clear"
the planet...one bank account at a time.

My opinions are my own, not those of my employer.

Re:help decompiling


In article <47odoc$...@nntp5.u.washington.edu>
           sza...@saul6.u.washington.edu "Janos Szamosfalvi" writes:

Quote
> Manfred Rosendahl (r...@informatik.uni-koblenz.de) wrote:

> : For theoretical computer science decompiling Turbo-Pascal programs is very
> : simple:
> : You take an enumeration of all Turbo-Pascal Programs, that is simple because
> : a Turbo-Pascal programs is a finite number of ASCII-characters, what is a
> : finite set. You can enumerate the programs by the program length.

> Well, even though the ascii set is finite, the Turbo Pascal grammar is
> recursive, hence it can generate infinitely many valid Turbo Pascal
> programs.   It's kinda hard to enumerate an uncountable number of
> programs.

Yes, but there is a limit on program size, thus also a limit (without silly
amounts of whitespace) on source size.                               .
Remember that the Turbo Pascal Grammar is a subset of the ascii set . . it
must also be finite.

Agreed that a lot (not infinite -- World DIsk Space has limits ;>), of ascii
source programs will compile to the same binary, so you are extremely unlikely
to get the original source back, exactly how the author wrote it.

--
Tom Wheeley, <holyhorns>
* TQ 1.0 * The 'Just So Quotes'.
"Only a mediocre man is always at his best."
        -- W. Somerset Maugham

Go to page: [1] [2]

Other Threads