delno está baneado por "venga, que te hemos pillado"
Bueno antes queria traducir este juego pero habia un problema con la fuente y es que estaba comprimida, y me dieron el algoritmo de descompresion pero el cao es que no hay algoritmo de recompresion asi que no podia volverlo a comprimir.
este es:
#include
#include
int Decompress (char *compde, char *dest, int taille);
int Compare(char *decomp, int longueur);
//la fonction est à 80014448
int allt, taillegood;
char *good_file;
void main(int argc, char *argv[])
{
FILE *fin,*fout;
char *bufcomp,*bufdecomp;
char filedec[15];
int taillein;
fin=fopen(argv[1],"rb");
if (fin==NULL)
{
printf("Erreur dans l'ouverture de %s.\n",argv[1]);
exit(0);
}
fseek(fin,0,SEEK_END);
taillein=ftell(fin);
printf("La taille du fichier %s est de %d.\n",argv[1],taillein);
fseek(fin,0,0);
bufcomp=(char*)malloc(taillein*sizeof(char));
printf("Buffer de lecture alloué : %d octets.\n",taillein*sizeof(char));
bufdecomp=(char*)malloc(taillein*10*sizeof(char));
printf("Buffer d'écriture alloué : %d octets.\n",10*taillein*sizeof(char));
fread(bufcomp,taillein,1,fin);
fclose(fin);
if (!Decompress(bufcomp,bufdecomp,taillein))
{
printf("Erreur dans la décompression");
free(bufcomp);
free(bufdecomp);
exit(-1);
}
sprintf(filedec,"%s.unc",argv[1]);
fout=fopen(filedec,"wb");
if (fout==NULL)
{
printf("Erreur dans l'ouverture du fichier de sortie.\n");
free(bufcomp);
free(bufdecomp);
exit(0);
}
fwrite(bufdecomp,allt,1,fout);
printf("Fichier de sortie %s ecrit\n",filedec);
fclose(fout);
free(bufcomp);
free(bufdecomp);
free(good_file);
}
int Decompress (char *compde, char *dest, int taille)
{
int taille_decomp = 0;
unsigned int a0=0, v0=0, v1=0, t0=0, t1=0, t2=0, t3=0, t4=0, t5=0;
t1 = (unsigned int)dest;
t4 = (unsigned int)compde + 1;
t2 = t4 + 1;
for(;;)
{
a0 = *(unsigned char *)t4;
switch(*(unsigned char *)t4)
{
case 0xF0:
t3 = *(unsigned char *)t2;
t2 += 2;
t4 += 2;
v0 = t3 & 0xF;
t0 = v0 + 3;
t3 >>= 4;
loop0:
*(unsigned char *)t1 = t3;
t0 += -1;
if(t0)
{
t1 += 1;
goto loop0;
}
t1 += 1;
break;
case 0xF1:
t3 = *(unsigned char *)(t2 + 1);
v0 = *(unsigned char *)t2;
t2 += 3;
t4 += 3;
t0 = v0 + 4;
loop1:
*(unsigned char *)t1 = t3;
t0 += -1;
if(t0)
{
t1 += 1;
goto loop1;
}
t1 += 1;
break;
case 0xF2:
t3 = *(unsigned char *)(t2 + 1);
v0 = *(unsigned char *)t2;
t2 += 3;
t4 += 3;
t0 = v0 + 2;
a0 = t3 >> 4;
t3 &= 0xF;
loop2:
*(unsigned char *)t1 = t3;
*(unsigned char *)(t1 + 1) = a0;
t0 += -1;
if(t0)
{
t1 += 2;
goto loop2;
}
t1 += 2;
break;
case 0xF3:
t3 = *(unsigned char *)(t2 + 1);
a0 = *(unsigned char *)(t2 + 2);
v0 = *(unsigned char *)t2;
t2 += 4;
t4 += 4;
t0 = v0 + 2;
loop3:
*(unsigned char *)t1 = t3;
*(unsigned char *)(t1 + 1) = a0;
t0 += -1;
if(t0)
{
t1 += 2;
goto loop3;
}
t1 += 2;
break;
case 0xF4:
t3 = *(unsigned char *)(t2 + 1);
a0 = *(unsigned char *)(t2 + 2);
t5 = *(unsigned char *)(t2 + 3);
v0 = *(unsigned char *)t2;
t2 += 5;
t4 += 5;
v1 = t1 + 2;
t0 = v0 + 2;
loop4:
*(unsigned char *)t1 = t3;
*(unsigned char *)(v1 - 1) = a0;
*(unsigned char *)v1 = t5;
v1 += 3;
t0 += -1;
if(t0)
{
t1 += 3;
goto loop4;
}
t1 += 3;
break;
case 0xF5:
t3 = *(unsigned char *)(t2 + 1);
v0 = *(unsigned char *)t2;
t2 += 3;
t4 += 3;
t0 = v0 + 4;
loop5:
t2 += 1;
*(unsigned char *)t1 = t3;
v0 = *(unsigned char *)t4;
t4 += 1;
t0 += -1;
*(unsigned char *)(t1 + 1) = v0;
if(t0)
{
t1 += 2;
goto loop5;
}
t1 += 2;
break;
case 0xF6:
t3 = *(unsigned char *)(t2 + 1);
a0 = *(unsigned char *)(t2 + 2);
v0 = *(unsigned char *)t2;
t2 += 4;
t4 += 4;
v1 = t1 + 2;
t0 = v0 + 3;
loop6:
t2+= 1;
*(unsigned char *)t1 = t3;
*(unsigned char *)(v1 + -1) = a0;
v0 = *(unsigned char *)t4;
t4 += 1;
t1 += 3;
t0 += -1;
*(unsigned char *)v1 = v0;
if(t0)
{
v1 += 3;
goto loop6;
}
v1 += 3;
break;
case 0xF7:
t3 = *(unsigned char *)(t2 + 1);
a0 = *(unsigned char *)(t2 + 2);
t5 = *(unsigned char *)(t2 + 3);
v0 = *(unsigned char *)t2;
t2 += 5;
t4 += 5;
v1 = t1 + 3;
t0 = v0 + 2;
loop7:
t2 += 1;
*(unsigned char *)t1 = t3;
*(unsigned char *)(v1 - 2) = a0;
*(unsigned char *)(v1 - 1) = t5;
v0 = *(unsigned char *)t4;
t4 += 1;
t1 += 4;
t0 += -1;
*(unsigned char *)v1 = v0;
if(t0)
{
v1 += 4;
goto loop7;
}
v1 += 4;
break;
case 0xF8:
t3 = *(unsigned char *)(t2 + 1);
v0 = *(unsigned char *)t2;
t2 += 3;
t4 += 3;
t0 = v0 + 4;
loop8:
*(unsigned char *)t1 = t3;
t1 += 1;
t0 += -1;
if(t0)
{
t3 += 1;
goto loop8;
}
t3 += 1;
break;
case 0xF9:
t3 = *(unsigned char *)(t2 + 1);
v0 = *(unsigned char *)t2;
t2 += 3;
t4 += 3;
t0 = v0 + 4;
loop9:
*(unsigned char *)t1 = t3;
t1 += 1;
t0 += -1;
if(t0)
{
t3 += -1;
goto loop9;
}
t3 += -1;
break;
case 0xFA:
t3 = *(unsigned char *)(t2 + 1);
a0 = *(unsigned char *)(t2 + 2);
v0 = *(unsigned char *)t2;
t2 += 4;
t4 += 4;
t0 = v0 + 5;
loopA:
*(unsigned char *)t1 = t3;
t1 += 1;
t0 += -1;
if(t0)
{
t3 += a0;
goto loopA;
}
t3 += a0;
break;
case 0xFB:
t3 = *(unsigned char *)(t2 + 1);
a0 = *(unsigned char *)(t2 + 2);
v0 = *(unsigned char *)t2;
v1 = *(unsigned char *)(t2 + 3);
t2 += 5;
t4 += 5;
t0 = v0 + 3;
t5 = v1 << 24;
loopB:
*(unsigned char *)t1 = t3;
*(unsigned char *)(t1 + 1) = a0;
t1 += 2;
v0 = (int) t5 >> 24;
a0 <<= 8;
v1 = t3 & 0xFF;
v1 |= a0;
v0 += v1;
t3 = v0;
t0 += -1;
if(t0)
{
a0 = v0 >> 8;
goto loopB;
}
a0 = v0 >> 8;
break;
case 0xFC:
t3 = *(unsigned char *)t2;
a0 = *(unsigned char *)(t2 + 1);
t2 += 3;
t4 += 3;
v0 = a0 >> 4;
t0 = v0 + 4;
v0 = a0 & 0xF;
v0 <<= 8;
v0 = t3 | v0;
v1 = t1 - v0;
loopC:
v0 = *(unsigned char *)(v1 - 1);
v1 += 1;
t0 += -1;
*(unsigned char *)t1 = v0;
if(t0)
{
t1 += 1;
goto loopC;
}
t1 += 1;
break;
case 0xFD:
t3 = *(unsigned char *)t2;
v0 = *(unsigned char *)(t2 + 1);
t2 += 3;
t4 += 3;
t0 = v0 + 0x14;
v1 = t1 - t3;
loopD:
v0 = *(unsigned char *)(v1 - 1);
v1 += 1;
t0 += -1;
*(unsigned char *)t1 = v0;
if(t0)
{
t1 += 1;
goto loopD;
}
t1 += 1;
break;
case 0xFE:
t3 = *(unsigned char *)t2;
t2 += 2;
t4 += 2;
v0 = t3 & 0xF;
t0 = v0 + 3;
v0 = t3 & 0xF0;
v0 >>= 1;
v1 = t1 - v0;
loopE:
v0 = *(unsigned char *)(v1 - 8);
v1 += 1;
t0 += -1;
*(unsigned char *)t1 = v0;
if(t0)
{
t1 += 1;
goto loopE;
}
t1 += 1;
break;
case 0xFF:
goto FinDecomp;
break;
default:
t2 += 1;
t4 += 1;
t0 += a0 + 1;
loopDef:
t2 += 1;
v0 = *(unsigned char *)t4;
t4 += 1;
t0 += -1;
*(unsigned char *)t1 = v0;
if(t0)
{
t1 += 1;
goto loopDef;
}
t1 += 1;
} // case
} // for
FinDecomp:
allt = t1 - (unsigned int)dest;
return 1;}
alguien que sepa de programacion puede hacer uno? el archivo de pa fuente se llama "font"