| View previous topic :: View next topic |
| Author |
Message |
color Expert Cheater
Reputation: 0
Joined: 25 Nov 2006 Posts: 106
|
Posted: Thu May 14, 2009 10:07 pm Post subject: help extracting DAT file |
|
|
i need help extracting a DAT file from a game and get all the image from it like monsters, weapons and maps
I dont know how to do it
trying to make a database website of the game
_________________
|
|
| Back to top |
|
 |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
|
| Back to top |
|
 |
color Expert Cheater
Reputation: 0
Joined: 25 Nov 2006 Posts: 106
|
Posted: Fri May 15, 2009 12:07 am Post subject: |
|
|
i went to the 2nd link but the program still missing some dll and i cant find it =/
edit nvm the extrator is for Temple of Elemental Evil
_________________
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Sat May 16, 2009 7:46 am Post subject: |
|
|
Well .dat files differ by the way you write to it. I use .dats for maps.
| Code: |
char* readMap( __in_z const char* mapName ){
FILE * pFile;
char *MapFile = new char[512];
long lFileSize = 0;
fopen_s( (FILE**)&pFile, mapName, "w" );
if( pFile == NULL) { fputs("Cannot find file", stderr); return NULL; }
fseek(pFile, 0, SEEK_END);
lFileSize = ftell(pFile);
if( fread((void*)&MapFile, 1, lFileSize, pFile) != lFileSize ) { fputs("Cannot read file", stderr); return NULL; }
fclose(pFile);
return MapFile;
}
|
My file would be
| Code: |
00 02 02 03 01 04 05 03 \n
00 02 02 03 01 04 05 02 \n
00 02 03 04 05 02 01 02 \n
00 00 00 00 00 00 00 00 \e
|
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Sat May 16, 2009 4:42 pm Post subject: |
|
|
| : wrote: | | Well .dat files differ by the way you write to it. I use .dats for maps. | Exactly, it can be anything. Dat stands for (plain) data, there's no specific format
| : wrote: | | Code: |
char *MapFile = new char[512];
long lFileSize = 0;
..
lFileSize = ftell(pFile);
..
if( fread((void*)&MapFile, 1, lFileSize, pFile) != lFileSize ) { fputs("Cannot read file", stderr); return NULL; }
}
|
| Overflow! I just took over your comp.. :P
Should be: | Code: | long lFileSize = ftell(pFile);
char *MapFile = new char[lFileSize];
fread(...) | + some error checking.
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Sun May 17, 2009 9:23 am Post subject: |
|
|
My maps are always under 512 bytes
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Mon May 18, 2009 2:01 am Post subject: |
|
|
| : wrote: | | My maps are always under 512 bytes :P | But some evil genius might want to exploit one's computer thru your game and you wouldn't know a thing. That's the thing for local exploits.
|
|
| Back to top |
|
 |
color Expert Cheater
Reputation: 0
Joined: 25 Nov 2006 Posts: 106
|
Posted: Mon May 18, 2009 2:49 am Post subject: |
|
|
can i use phyton to view .dat file?
_________________
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Mon May 18, 2009 5:54 am Post subject: |
|
|
| color wrote: | | can i use phyton to view .dat file? | Sure, why not? | Code: | >>> f = open("file.dat", 'r')
>>> f.read()
"This is the dat file." | I actually forgot does Python use "", '' or both.. I'm not a Python coder :P Anyway, the filename is file.dat and it contains text "This is the dat file."
| Jani wrote: | | : wrote: | | My maps are always under 512 bytes :P | But some evil genius might want to exploit one's computer thru your game and you wouldn't know a thing. That's the thing for local exploits. | Uh, I'd like to add that read 512 bytes only then, don't read the whole file, if you want to use a static size for your maps: | Code: | | fread((void*)&MapFile, 1, 512, pFile); |
|
|
| Back to top |
|
 |
|