Amiga.org
Amiga computer related discussion => General chat about Amiga topics => Topic started by: ricco32097 on October 23, 2006, 02:53:00 AM
-
Is such a thing available? I made a program and compiled it. I would like to get my source code back, or at least some of it.
Could anyone convert this little program back to code for me? 43KB
-
There are no decompilers available for Amiga.
This is one of the more glaring holes in the Amiga software range.
-
Makes me think.. For a time I ran a BBS on /X and then on a PC using PC Express. I wonder if I could decompile PCE and update it?
-
I wonder if I could decompile PCE and update it?
If you need to ask, no.
-
@Piru Could you decode a 43KB .exe file, or find the password for me? It was a program I made long time ago. It asks for a password, but I can't remember it. When correct password is entered, a menu comes up with some stuff, like jokes, system info and such.
-
Better would be to ask if he could write and release a decompiler. Rather than to ask him to decompile 43K of code by hand :-)
-
Got many friends Piru (real ones not imaginary ones) ??
No, didn't think so and can understand why. There was no need to be so rude.
-
@ricco32097
Could you decode a 43KB .exe file, or find the password for me?
Possibly. I have never decoded a pascal program before, but I doubt it makes any difference really. It won't give you the src though, but I could either figure out the password or bypass it.
-
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?
-
Pascal is compiled, so yes it's m68k asm disassembly. Shouldn't be too hard.
-
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
-
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.
-
Piru wrote:
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...
-
@Piru
File send
-
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.
-
Just how do you say "D'Oh!" in Finnish?
-
Anyone else want to give it a try?
-
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?
-
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 :-)
-
Arent there fundamental differences in the handling of variables etc in Pascal? I thought strings were represented differently than they are in Cfor example?
-
@Minuous
Of course you will end up with C source rather than Pascal source
Uh?
-
Piru wrote:
@Minuous
Of course you will end up with C source rather than Pascal source
Uh?
I was thinking it would be an x86 dissassembly, myself ;-)
-
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. :-)
-
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
-
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.
-
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).
-
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).
-
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.
-
File send...good luck, and thanks.
-
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