Click to See Complete Forum and Search --> : xor file encrypted


mc0282
October 18th, 2004, 03:12 AM
ok, this my little situation i'm trying to decrypt Grand Theft Auto vice city radio statio
they are in *.adf, so i ask a coder that create a program to decoded the file into normal mp3, and he said that file *.adf is only encrpyt with xor this his actual quote:
it's mp3 :-) just try to xor file with value 34
small delphi codes he provide because he said is simple program:
P := FView.Memory; // a pointer but what kind of a pointer keyword int,long.float etc.. ?
for i := 0 to FViewSize - 1 do
begin
P^ := P^ xor 34;
Inc(P); // well i believe this mean increment
end;

he said:

but you must alocate memory, load data, decode, write data, ... you can read and write all values directly to file, but it's too slow fol large files

so i only got this far because i got lost what to do next





int *p;
unsigned long size;
char temp;
int * t; //i took guess what kind of pointer it is


FILE *file;
FILE *file2;

file = fopen("test.adf","rb");
file2 = fopen("test.mp3","wb");

if(file == NULL)
{
return;
}
//gets file size
while(!feof(file))
{

temp = fgetc(file);
size++;
}

t = (int *)malloc(size);


could anyone help?

thank you for your time

mc0282
October 18th, 2004, 04:01 AM
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int *p;
unsigned long size;
char temp;
int * t;


void main()
{




FILE *file;
FILE *file2;

file = fopen("WILD.adf","rb");
file2 = fopen("WILD.mp3","wb");

int c;
while((c=fgetc(file)) != EOF)
{
c = c^34;


fputc(c,file2);




}



fclose(file);
fclose(file2);







return;
}


YES! i got it few cursing and banging on my head i when throuh my C book again and another cursing BOOM came to me and got it working..

even thou the code is slow i could have allocate memory made the processing faster but i didnt do it

you could test the code if you have gta vice city