I am writing a tool that allows you to view/extract the contents within a VDK file. So far I am able to read in the VDK file and display it's contents in a tree view. When the user clicks an item in the tree it shows the information about the selected file.
One thing I am confused about is the parent directory offset. When selected node is the first node contained within the Vdk file (the "." directory) the value for parent directory offset is shown as 28.
Now, according the the Vdk file specifications there is a header at the beginning of the Vdk file defined as follows:
Code:
struct VDKHeader
{
char VDK_desk[8]; //VDISK1.1(Ragnarok2)/VDISK1.0(Requiem)
int VDK_unk; //unknown
int VDK_CountFile; //file count
int VDK_CountFolder; //folder count
int VDK_size; //vdk file size without root (+91h) and FileList
int VDK_filelist_size; //Files List Size(VDISK1.1 Only)
} Header;
The size (in bytes) of this header is 38 ( 8 x sizeof(char) + sizeof(int) + sizeof(int) + sizeof(int) + sizeof(int) + sizeof(int) ).
My question is, why is the parent directory offset of the first directory (the ".") 28 instead of 38?
Note that if I change the type of VDK_desk to byte[8] instead of char[8] then the size of the header is 28 which matches the parent directory offset. Could it be that VDK_desk is actually an array of bytes and not chars?
Thanks!