Jump to content

(PC) Death end re:Quest 2 .DAT files


GabryTheSniper
Go to solution Solved by h3x3r,

Recommended Posts

  • GabryTheSniper changed the title to (PC) Death end re:Quest 2 .DAT files
  • Engineer
//------------------------------------------------
//--- 010 Editor v10.0.2 Binary Template
//
//  File: OrochiDAT.bt
//  Authors: SeleDreams
//  Version: 0.2
//  Purpose: Analyzing Silicon Studio's Orochi / Mizuchi Engine data archiving format
//  Category: Archive
//  File Mask: GxArchivedFile???.dat
//  ID Bytes: 47 44 41 54
//  History: 
//   0.2   2020-05-08 SeleDreams: Implemented a feature allowing to see the file formats
//   0.1   2020-05-06 SeleDreams: Initial Release
//------------------------------------------------

typedef struct{
        uint Offset;
        uint Length;
 } GDATFileDef;


typedef struct {
    char MAGIC[4];
    int FileCount;
    GDATFileDef File_Definitions[FileCount];
} GDATHeader;


typedef struct{
        char MAGIC[4];
        byte Data[File.Header.File_Definitions[i].Length - 4];
} GDATFile<read=DisplayFileType>;

/** 
*  - This structure is an array containing all the files in the order of their definition.
*  - I've added it this way to avoid a mess where all the files are listed at the root of the inspector.
**/
typedef struct{
    local int i = 0;
    for (i = 0; i < File.Header.FileCount; i++){
        Printf("Added %d files to the array...\n",i+1);
        FSeek(File.Header.File_Definitions[i].Offset);
        GDATFile file;
    }
} GDATFiles;


typedef struct {
    GDATHeader Header;
    GDATFiles Files;
} GDAT <read=DisplayFileCount>;


string DisplayFileCount(GDAT &input){
    string s;
    SPrintf(s,"%d Files",input.Header.FileCount);
    return s;
}

string DisplayFileType(GDATFile &input){
    string s;
    local char reversed[4];
    local int i;
    for (i = 3; i > -1; i--)
    {
        reversed[3-i] = input.MAGIC[i];
    }
    if (reversed[1] == '\0'){
        SPrintf(s,"Unknown File");
    }
    else{
    SPrintf(s,"%s File",reversed);
    }
    return s;
}

GDAT File;
Printf("%d Files were found in this GDAT file\n", File.Header.FileCount);




 

Link to comment
Share on other sites

2 hours ago, h3x3r said:
//------------------------------------------------
//--- 010 Editor v10.0.2 Binary Template
//
//  File: OrochiDAT.bt
//  Authors: SeleDreams
//  Version: 0.2
//  Purpose: Analyzing Silicon Studio's Orochi / Mizuchi Engine data archiving format
//  Category: Archive
//  File Mask: GxArchivedFile???.dat
//  ID Bytes: 47 44 41 54
//  History: 
//   0.2   2020-05-08 SeleDreams: Implemented a feature allowing to see the file formats
//   0.1   2020-05-06 SeleDreams: Initial Release
//------------------------------------------------

typedef struct{
        uint Offset;
        uint Length;
 } GDATFileDef;


typedef struct {
    char MAGIC[4];
    int FileCount;
    GDATFileDef File_Definitions[FileCount];
} GDATHeader;


typedef struct{
        char MAGIC[4];
        byte Data[File.Header.File_Definitions[i].Length - 4];
} GDATFile<read=DisplayFileType>;

/** 
*  - This structure is an array containing all the files in the order of their definition.
*  - I've added it this way to avoid a mess where all the files are listed at the root of the inspector.
**/
typedef struct{
    local int i = 0;
    for (i = 0; i < File.Header.FileCount; i++){
        Printf("Added %d files to the array...\n",i+1);
        FSeek(File.Header.File_Definitions[i].Offset);
        GDATFile file;
    }
} GDATFiles;


typedef struct {
    GDATHeader Header;
    GDATFiles Files;
} GDAT <read=DisplayFileCount>;


string DisplayFileCount(GDAT &input){
    string s;
    SPrintf(s,"%d Files",input.Header.FileCount);
    return s;
}

string DisplayFileType(GDATFile &input){
    string s;
    local char reversed[4];
    local int i;
    for (i = 3; i > -1; i--)
    {
        reversed[3-i] = input.MAGIC[i];
    }
    if (reversed[1] == '\0'){
        SPrintf(s,"Unknown File");
    }
    else{
    SPrintf(s,"%s File",reversed);
    }
    return s;
}

GDAT File;
Printf("%d Files were found in this GDAT file\n", File.Header.FileCount);




 

Do i have to use 010 Editor to run it?

Edited by GabryTheSniper
Link to comment
Share on other sites

  • Engineer
  • Solution

Yes, but you can also rewrite it to the bms form.

Well he we go. But not sure how to reverse extension order for example "xet" > "tex" so extensions will be in reversed order. Nothing cardial...

Also no file names either. I bind offset as a file name.

############################################
#     Death end re:Quest 2 *.DAT files     #
############################################

get BaseFileName basename

idstring "GDAT"
get Files uint32

for i = 0 < Files
	get Offset uint32
	get RawSize uint32
	savepos EndTable
	
	goto Offset
	savepos ExtOffset
	get ExtCheck byte
	if ExtCheck == 0
		getdstring Extension 0x3
	else
		goto ExtOffset
		getdstring Extension 0x4
	endif
	getdstring Dummy 0x7C
	endian big
	getdstring CompressionSign 0x4
	get Size uint32
	get ZSize uint32
	get Unknown uint32
	endian little
	savepos Offset
	string Name p "%s/%u.%s" BaseFileName Offset Extension
	clog Name Offset ZSize Size
	goto EndTable
next i

 

Edited by h3x3r
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...