14 hours ago14 hr Localization Hello! I am trying to find a way to extract the .dat files from Higurashi Daybreak a Gundam VS. Like Game!Anyhelp is appreciated thanks!! sampleshttps://drive.google.com/drive/folders/1cuPOBPF8ggtZrMdTrshn_QfIzDK99R7e?usp=sharing
10 hours ago10 hr Localization Solution The daybreakNN.dat files are simple: an encrypted file table, then the files back to back, each XORed with a one-byte key taken from its offset. Most assets inside use the engine's own .cnv container (raw BGRA images or raw PCM sounds), and the models are DirectX .x files, some of them MSZIP compressed. The attached script (daybreak_extract.py) extracts:images (.cnv) as PNG, keeping alphavoices and sound effects (.cnv) as WAVskinned, animated DirectX models (.X), unpacked, with their texture names pointed at the PNGsscripts and settings (.txt, .ini), converted from Shift-JIS to UTF-8movies (.mpg) and everything else, decryptedUsageNeeds Python 3 and Pillow. Without Pillow the images are left as decrypted .cnv files.Put daybreak_extract.py next to the .dat files and run it from that folder.python daybreak_extract.py daybreak*.dat every archive python daybreak_extract.py daybreak04.dat one archive python daybreak_extract.py --list daybreak04.dat list the files without extracting python daybreak_extract.py --raw daybreak04.dat decrypt only, keep the game's own formats python daybreak_extract.py -o D:\rips daybreak04.dat different output folderFile layoutEverything is little endian, with no alignment or padding. The first file starts right after the table and the last one ends at the end of the .dat.u16 file_count entry[file_count] file table, 0x10C bytes per entry, encrypted file data the files back to back in table order, each XORed with its own keyFile table0x000 char[260] name, Shift-JIS, zero padded (e.g. data/win/15a.cnv) 0x104 u32 size 0x108 u32 offset from the start of the .datThe whole table (file_count entries of 0x10C bytes, starting at offset 2) is one XOR stream:k = 0x64 t = 0x64 for each byte: byte ^= k k = (k + t) & 0xFF t = (t + 0x4D) & 0xFFThe keystream repeats every 512 bytes, so it can be built once and tiled.File dataEach file is XORed with one byte worked out from its offset in the table:key = ((offset >> 1) | 0x08) & 0xFF.cnv imagesA .cnv is an image when the first byte is 24 or 32 and the file is exactly the 17-byte header plus 4 bytes per pixel.0x00 u8 bpp, 24 or 32 0x01 u32 width 0x05 u32 height 0x09 u32 width again (pitch in pixels) 0x0D u32 0 0x11 u8[] pixels, width * height * 4 bytes, BGRA, top row first.cnv soundsA WAVEFORMATEX, the data length, then raw PCM. Wrapping it in a RIFF/WAVE header gives a normal .wav.0x00 u16 format (1 = PCM) 0x02 u16 channels 0x04 u32 sample rate 0x08 u32 bytes per second 0x0C u16 block align 0x0E u16 bits per sample 0x10 u16 cbSize (0) 0x12 u32 data length 0x16 u8[] PCM dataCompressed .X models0x00 char[16] "xof 0303bzip0032" 0x10 u32 unpacked size + 16 then blocks until the end of the file: u16 unpacked block size u16 packed block size, including the "CK" char[2] "CK" u8[] raw deflate data daybreak_extract.py
9 hours ago9 hr Author Localization 1 hour ago, Hazza12555 said:The daybreakNN.dat files are simple: an encrypted file table, then the files back to back, each XORed with a one-byte key taken from its offset. Most assets inside use the engine's own .cnv container (raw BGRA images or raw PCM sounds), and the models are DirectX .x files, some of them MSZIP compressed. The attached script (daybreak_extract.py) extracts:images (.cnv) as PNG, keeping alphavoices and sound effects (.cnv) as WAVskinned, animated DirectX models (.X), unpacked, with their texture names pointed at the PNGsscripts and settings (.txt, .ini), converted from Shift-JIS to UTF-8movies (.mpg) and everything else, decryptedUsageNeeds Python 3 and Pillow. Without Pillow the images are left as decrypted .cnv files.Put daybreak_extract.py next to the .dat files and run it from that folder.python daybreak_extract.py daybreak*.dat every archive python daybreak_extract.py daybreak04.dat one archive python daybreak_extract.py --list daybreak04.dat list the files without extracting python daybreak_extract.py --raw daybreak04.dat decrypt only, keep the game's own formats python daybreak_extract.py -o D:\rips daybreak04.dat different output folderFile layoutEverything is little endian, with no alignment or padding. The first file starts right after the table and the last one ends at the end of the .dat.u16 file_count entry[file_count] file table, 0x10C bytes per entry, encrypted file data the files back to back in table order, each XORed with its own keyFile table0x000 char[260] name, Shift-JIS, zero padded (e.g. data/win/15a.cnv) 0x104 u32 size 0x108 u32 offset from the start of the .datThe whole table (file_count entries of 0x10C bytes, starting at offset 2) is one XOR stream:k = 0x64 t = 0x64 for each byte: byte ^= k k = (k + t) & 0xFF t = (t + 0x4D) & 0xFFThe keystream repeats every 512 bytes, so it can be built once and tiled.File dataEach file is XORed with one byte worked out from its offset in the table:key = ((offset >> 1) | 0x08) & 0xFF.cnv imagesA .cnv is an image when the first byte is 24 or 32 and the file is exactly the 17-byte header plus 4 bytes per pixel.0x00 u8 bpp, 24 or 32 0x01 u32 width 0x05 u32 height 0x09 u32 width again (pitch in pixels) 0x0D u32 0 0x11 u8[] pixels, width * height * 4 bytes, BGRA, top row first.cnv soundsA WAVEFORMATEX, the data length, then raw PCM. Wrapping it in a RIFF/WAVE header gives a normal .wav.0x00 u16 format (1 = PCM) 0x02 u16 channels 0x04 u32 sample rate 0x08 u32 bytes per second 0x0C u16 block align 0x0E u16 bits per sample 0x10 u16 cbSize (0) 0x12 u32 data length 0x16 u8[] PCM dataCompressed .X models0x00 char[16] "xof 0303bzip0032" 0x10 u32 unpacked size + 16 then blocks until the end of the file: u16 unpacked block size u16 packed block size, including the "CK" char[2] "CK" u8[] raw deflate datadaybreak_extract.pyThanks!! it worked!! Edited 9 hours ago9 hr by Sirduckdude
Create an account or sign in to comment