Decompilers needed
Does anyone here have an .ff (graphics) and .d (scripts) decompiler? I need to look into some stuff from Dinkers that aren't really around here anymore, so asking them won't do much good.
The Undink source project file has a ff decompiler. I think I've found my D decompiler, so I can re-send it to you if you want (although you should still have it) .
Plese re-send it Ducklord, I think I lost it when you sent it to me, sorry.
A D decompiler? Hey, would you mind emailing it to me as well, I really would like to check one of these out.
The decompiler has been sent to both of you. A little warning, though, it doesn't work on overy computer because I think I accidentally used the wrong parameters when compiling it (sorry). I am unable to recompile it right now (I will try to so soon.
Here's the source code, if anyone's interested :
(As a sidenote, Philip Gage's script required quite a bit of tweaking to make it work .)
Here's the source code, if anyone's interested :
/* expand.c -- Byte Pair Encoding decompression */ /* Copyright 1996 Philip Gage */ #include <stdio.h> void decompress (FILE *in, FILE *out) { unsigned char stack[16], pair[128][2]; short c, top = 0; /* Check for optional pair count and pair table */ if ((c = getc(in)) > 127) fread(pair,2,c-128,in); else putc(c,out); for (; { /* Pop byte from stack or read byte from file */ if (top) c = stack[--top]; else if ((c = getc(in)) == EOF) break; /* Push pair on stack or output byte to file */ if (c > 127) { stack[top++] = pair[c-128][1]; stack[top++] = pair[c-128][0]; } else putc(c,out); } } int main (int argc, char **argv) { FILE *in, *out; char crap[100]; char crap2[100]; printf("\nDinkC Decompiler V1.00 - Ducklord\n\n"); if (argc > 1) { //printf("Char is %c",argv[1][strlen(argv[1])-2]); if (argv[1][strlen(argv[1])-2] != '.') { strcpy(crap, argv[1]); strcat(crap, ".d"); strcpy(crap2, argv[1]); strcat(crap2, ".c"); } else { strcpy(crap, argv[1]); strcpy(crap2, argv[1]); crap2[strlen(crap2)-1] = 'c'; } } if (argc != 2) printf("Usage: decompile crap [.d] (a file called crap.c will be made)\n"); else if ((in=fopen(crap,"rb"))==NULL) printf("Error opening input %s\n",crap); else if ((out=fopen(crap2,"wb"))==NULL) printf("Error opening output %s\n",crap2); else { printf("Creating %s....", crap2); decompress(in,out); fclose(out); fclose(in); printf("Done!\n"); } return 0; }
(As a sidenote, Philip Gage's script required quite a bit of tweaking to make it work .)
Whoops. What's that smiley doing in the middle of my script? Stupid board.
As a sidenote, Philip Gage's script required quite a bit of tweaking to make it work
Would probably have been less work to extract the relevant part out of the Dink source code.
Would probably have been less work to extract the relevant part out of the Dink source code.
Why don't you release the .D compiler. I sure would like it!
I'm not sure, but it may mean cheaters could cheat. And we don't want cheaters cheating, because cheating is bad.
And then the cheaters can't finish the game! Mwhahahahaaa!!
I wonder what kind of nonsense an empty for loop is... Why not just use while (1) rather than for (;; )?
I don't think you're in a position to comment on the code of others, DaVince...
Because his comment offers no technical insight on the proposed change (i.e. the technical benefits of making this change), it just comes across as: 'I know how you should've written your code'. As for not being in the position to comment: I don't get the impression from his website/projects that he has the C-background to comment on this.
It could be me, but the only thing I see is DaVince trying to help and even offering an alternative. I have no knowledge about C whatsoever, but in my opinion it's kind of rude to say what you said.
You probably have no knowledge about playing the saxophone (just a wild guess), does that mean you cannot comment on someone's lousy saxophone playing, maybe even telling him to hold the saxophone with two hands instead of one? (yes, terrible analogy, sue me)
You probably have no knowledge about playing the saxophone (just a wild guess), does that mean you cannot comment on someone's lousy saxophone playing, maybe even telling him to hold the saxophone with two hands instead of one? (yes, terrible analogy, sue me)
If you have no knowledge of playing a saxophone, then in most cases, your suggestions won't improve the other's play and as such, they won't make sense. You can still comment by using common sense and other background knowledge (for example, about playing musical instruments in general) of course.
In this case, the two statements are just different ways of doing the same thing. So, to my knowledge, there's only personal preference of one over the other (differences in the resulting binary, if any, will be minor anyway). So why call the code of someone else 'nonsense' when it's just as valid way of doing it?
In this case, the two statements are just different ways of doing the same thing. So, to my knowledge, there's only personal preference of one over the other (differences in the resulting binary, if any, will be minor anyway). So why call the code of someone else 'nonsense' when it's just as valid way of doing it?
Because I am a geek, hur, I just checked this. (Why not get the facts on the table?
These are the two files I used to test:
===== wh.c =====
void loop(void) {
int i = 0;
while(1)
i++;
}
===== fl.c =====
void loop(void) {
int i = 0;
for( ;; )
i++;
}
I "compiled" both to assembler using the command "gcc -O0 -S <file>.c", which gave me these two files: (I've removed unnecessary, unrelated crud)
===== wh.s =====
loop:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
movl $0, -8(%ebp)
.L2:
movl $0, -4(%ebp)
movl -8(%ebp), %eax
addl %eax, %eax
addl %eax, -4(%ebp)
jmp .L2
===== fl.s =====
loop:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
movl $0, -8(%ebp)
.L2:
movl $0, -4(%ebp)
movl -8(%ebp), %eax
addl %eax, %eax
addl %eax, -4(%ebp)
jmp .L2
If you see any difference between the two outputs, then congratulations. You see something I don't. So, to all of you discussing this, it's settled. They both result in the exact same code, case closed, it's entirely up to personal preference.
These are the two files I used to test:
===== wh.c =====
void loop(void) {
int i = 0;
while(1)
i++;
}
===== fl.c =====
void loop(void) {
int i = 0;
for( ;; )
i++;
}
I "compiled" both to assembler using the command "gcc -O0 -S <file>.c", which gave me these two files: (I've removed unnecessary, unrelated crud)
===== wh.s =====
loop:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
movl $0, -8(%ebp)
.L2:
movl $0, -4(%ebp)
movl -8(%ebp), %eax
addl %eax, %eax
addl %eax, -4(%ebp)
jmp .L2
===== fl.s =====
loop:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
movl $0, -8(%ebp)
.L2:
movl $0, -4(%ebp)
movl -8(%ebp), %eax
addl %eax, %eax
addl %eax, -4(%ebp)
jmp .L2
If you see any difference between the two outputs, then congratulations. You see something I don't. So, to all of you discussing this, it's settled. They both result in the exact same code, case closed, it's entirely up to personal preference.