Alhexx' ObsCure HVP File Format Description V1.00 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Here we go, another format description. This time we're analysing ObsCure's HVP format. IMPORTANT NOTE: All integers in this file format are BIG ENDIAN !!! (i.e. Motorola Order) There's one exception: HVP_MAIN_ENTRY.ulStructType is in LITTLE ENDIAN order. First, I have to say that I haven't fully decoded this format, but I have enough info to at least decompress the files. Let's start with the structures: Header ------ struct HVP_HEADER { char szId[12]; // "HV PackFile\0" unsigned long ulVersion; // 0x01000300 unsigned long ulNumRootDirs; // Directories in Root unsigned long ulNumEntries; // Files + Directories unsigned long ulNumFiles; unsigned long ulTOCSize; // unsigned long ulUnknown5; // ??? unsigned long ulUnknown6; // ??? }; // 40 Bytes Main Entry ---------- struct HVP_MAIN_ENTRY { unsigned long ulStructSize; // unsigned long ulStructType; // io: 0 = directory, 1 = file }; // 8 Bytes Dir Entry --------- struct HVP_DIR_ENTRY { unsigned char ucUnknown; // 0 unsigned long ulSubFiles; unsigned long ulNameLength; char szName[ulNameLength]; }; // 9 + x Bytes File Entry ---------- struct HVP_FILE_ENTRY { unsigned char ucUnknown; // 1 unsigned long ulPackedSize; unsigned long ulRealSize; unsigned long ulUnknown3; unsigned long ulOffset; unsigned long ulNameLength; char szName[ulNameLength]; }; // 21 + x Bytes The Entries: Dir Entry VS File Entry -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= In this format, both file and dir entries are mixed. After you have read the header, read a HVP_MAIN_ENTRY struct. Then, check the HVP_MAIN_ENTRY.ulStructType member. If it is 0, then a HVP_DIR_ENTRY follows. If it is 1, then a HVP_FILE_ENTRY follows. Quite simple, huh? Note: -=-=- Usually, when you read out a HVP_FILE_ENTRY struct, then the ucUnknown member is 1. However, I had problems when trying to load the archive "datapack.hvp". After deactivating the check, that means after ignoring the ucUnknown member, my decompressor was able to load the archive. Compression: -=-=-=-=-=-= As you can see in the HVP_FILE_ENTRY struct, there's a member called ulPackedSize. If ulPackedSize is smaller that ulRealSize, then the file data is compressed using default ZIP compression. If ulPackedSize is equal to ulRealSize, then the file is uncompressed. That's all for now. ~~ Greetings Fly Out To: ~~ Cici ficedula Jackrabbitz Kaddy #17 Levitikus MatsuJin mirex Pitty Qhimm s_kaspar The SaiNt ... and everyone who misses his/her name here! Visit or contact me: -------------------- Home : http://www.alhexx.com Forum : http://forums.alhexx.com Mail : alhexx@alhexx.com - Alhexx 01:59 2006-02-22