Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


help extracting DAT file

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
color
Expert Cheater
Reputation: 0

Joined: 25 Nov 2006
Posts: 106

PostPosted: Thu May 14, 2009 10:07 pm    Post subject: help extracting DAT file Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
manc
Grandmaster Cheater
Reputation: 1

Joined: 16 Jun 2006
Posts: 551

PostPosted: Thu May 14, 2009 11:44 pm    Post subject: Reply with quote

http://www.google.com/search?q=how+to+extract+DAT+files&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

?

_________________
Back to top
View user's profile Send private message
color
Expert Cheater
Reputation: 0

Joined: 25 Nov 2006
Posts: 106

PostPosted: Fri May 15, 2009 12:07 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Sat May 16, 2009 7:46 am    Post subject: Reply with quote

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
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Sat May 16, 2009 4:42 pm    Post subject: Reply with quote

: 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
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Sun May 17, 2009 9:23 am    Post subject: Reply with quote

My maps are always under 512 bytes Razz
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Mon May 18, 2009 2:01 am    Post subject: Reply with quote

: 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
View user's profile Send private message
color
Expert Cheater
Reputation: 0

Joined: 25 Nov 2006
Posts: 106

PostPosted: Mon May 18, 2009 2:49 am    Post subject: Reply with quote

can i use phyton to view .dat file?
_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Mon May 18, 2009 5:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites