Page 2 of 2
Re: .DV2 Archives
Posted: Sat Nov 05, 2022 9:37 pm
by ikskoks
No problem

Re: .DV2 Archives
Posted: Sat Nov 05, 2022 10:33 pm
by xandro
Still I have one more question

about the number 8585216 on the screenshot where did you get that? I understand that's the offset but the file header is not going there when I select 4 bytes of data pointer I'm missing something?
I found that 4 bytes right after number of files are pointing to that offset can you tell me what is that and why?
Also I tried the same thing in different file and it's not like in GUI.dv2 It's pointing me in the middle of nowhere

My app is decompressing some files not all I need to fix that so other .DV2 can't be decompressed at least not yet until I found a solution for this
I'm getting first 9 files and the other does not seems to work I get 0bytes and When I check those files with hex editor 8617984 + 32768 That is the one file right? and I'm doing that same thing for every single file in that file GUI.dv2 I'm doing something wrong?
I understand you told me that my offset is relative on the baseOffset but I still don't know where did you get 8585216
EDIT : I found a solution

now I can extract all .DV2 files the only problem is I'm not getting all files uncompressed some of them can't be loaded I don't understand why.
Some are 0 bytes and some are bigger size but I can't see them.
Re: .DV2 Archives
Posted: Sun Nov 06, 2022 11:49 am
by ikskoks
Try to add this print statement to the script:
Code: Select all
print "file_num: %i%, offset: %OFFSET%, size: %SIZE%, orig_size: %origSIZE%"
and comment out log statements like on the screenshot below:
screenshot000203.png
and run the script to see proper offsets and sizes.
Here are few first entries from the directory:
screenshot000204.png
Then do the same in your code! Print your offsets and sizes in the C# code and see what is the difference.
I can't tell you what is wrong with your code. You need to figure this out.
By the way, 8585216 is not the real offset - it is relative offset for the first entry:
screenshot000205.png
And I've already explained how it works, so I'm not gonna repeat myself

Re: .DV2 Archives
Posted: Sun Nov 06, 2022 12:10 pm
by xandro
Okay I found a problem my offset is not changing for some reason 8617984 is for the first file and for the second my app is doing this : 8617984 + 32768 but on your screenshot for the second file you got 7766016 how?
Re: .DV2 Archives
Posted: Sun Nov 06, 2022 12:22 pm
by ikskoks
You clearly don't read directory entries correctly
Check out the file format on the wiki and script logic once again.
For the second entry it will be:
7733248 + 32768 = 7 766 016
You need to read 7733248 offset from the directory.
Re: .DV2 Archives
Posted: Sun Nov 06, 2022 12:28 pm
by xandro
Yes! I found it.
Re: .DV2 Archives
Posted: Sun Nov 06, 2022 1:10 pm
by xandro
https://prnt.sc/I3b6bPKV8UBh Now my offset's looks just like yours.
And now I'm getting 90% of the files which is good but still not all and I think the one I missing are not compressed I remembered there is some which are starting with DDS.
Re: .DV2 Archives
Posted: Sun Nov 06, 2022 1:51 pm
by ikskoks
You should get exactly 259 files (compressed and uncompressed) from this archive.
Re: .DV2 Archives
Posted: Sun Nov 06, 2022 1:56 pm
by xandro
Hmmm I will try to figure it out.
Re: .DV2 Archives
Posted: Sun Nov 06, 2022 4:06 pm
by xandro
Pal thank you for everything I fixed all problem thanks to you and my app is now working

The problem was I didn't had endOffset

Big thanks again!
Re: .DV2 Archives
Posted: Sun Nov 06, 2022 4:15 pm
by ikskoks
Re: .DV2 Archives
Posted: Mon Nov 07, 2022 5:25 pm
by xandro
So now I can extract files but what about repacking them? I manage to get all files and compress them to ZLIB the thing is how I will write all of that data to .DV2 file what about baseOffset,fileOffset and fileHeader or should I simply use the same .dv2 file and replace the file I need?
Re: .DV2 Archives
Posted: Mon Nov 07, 2022 10:25 pm
by ikskoks
It will be much easier to just replace data in the existing DV2 file.
Recreating whole archive may be too hard for you. It requires full knowledge of the archive format..
(how to recreate header and directory, how the padding size is calculated etc. etc.)