Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Vindictus KR server has new hfs format

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
User avatar
Yretenai
veteran
Posts: 126
Joined: Tue Jan 28, 2020 4:39 pm
Has thanked: 20 times
Been thanked: 138 times

Re: Vindictus KR server has new hfs format

Post by Yretenai »

Ekey wrote: Wed Sep 08, 2021 6:25 pm Info content about all HFS's (headers, entries and log) 8) Mirror #1 or Mirror #2
yeah unk1 seems to be compressed size, no idea what unk2 is, seems to grow with both sizes (in most cases)

double compression? :?

As for header, I'm guessing the first int is used to calculate the offset of the entry table, and the second int is used to calculate the offset to the data?
Last edited by Yretenai on Wed Sep 08, 2021 7:08 pm, edited 1 time in total.
Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1823
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1058 times

Re: Vindictus KR server has new hfs format

Post by Ekey »

Header provided by next structure

Code: Select all

Int32 dwPackageCrc  - easy calcs like > version + files :)
Byte  bVersion > always 2
Int32 dwFiles
User avatar
Yretenai
veteran
Posts: 126
Joined: Tue Jan 28, 2020 4:39 pm
Has thanked: 20 times
Been thanked: 138 times

Re: Vindictus KR server has new hfs format

Post by Yretenai »

Ekey wrote: Wed Sep 08, 2021 7:07 pm Header provided by next structure

Code: Select all

Int32 dwPackageCrc  - easy calcs like > version + files :)
Byte  bVersion > always 2
Int32 dwFiles
:o why is the check so simple compared to everything else lol
Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1823
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1058 times

Re: Vindictus KR server has new hfs format

Post by Ekey »

idk :) In entry unk0 named as ElementIndexCrc and generated by next function

lpHash = 16 bytes hash from entry
Image
User avatar
Yretenai
veteran
Posts: 126
Joined: Tue Jan 28, 2020 4:39 pm
Has thanked: 20 times
Been thanked: 138 times

Re: Vindictus KR server has new hfs format

Post by Yretenai »

Ekey wrote: Wed Sep 08, 2021 7:10 pm idk :) In entry unk0 named as ElementIndexCrc and generated by next function

lpHash = 16 bytes hash from entry
Image
it's always 7
what a nice checksum.
Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1823
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1058 times

Re: Vindictus KR server has new hfs format

Post by Ekey »

Yretenai wrote: Wed Sep 08, 2021 7:23 pm it's always 7
what a nice checksum.
Image

I'm confused by this, no ideas whats in SomeIntArray... Maybe offsets? :oops:

Image
User avatar
Yretenai
veteran
Posts: 126
Joined: Tue Jan 28, 2020 4:39 pm
Has thanked: 20 times
Been thanked: 138 times

Re: Vindictus KR server has new hfs format

Post by Yretenai »

Ekey wrote: Wed Sep 08, 2021 7:25 pm I'm confused by this cycle, no ideas what in SomeIntArray :oops:

Image
45 is a size or offset.

5121 (0b1010000000001) -> 6144 (0b1100000000000)
6143 (0b1011111111111) -> 6144 (0b1100000000000)
6145 (0b1100000000001) -> 7168 (0b1110000000000)

which means you need to multiply offset by 1024 to get the actual offset from data start.

it's fast alignment math, it aligns SomeIntArray[45] to 1024. assembly doesn't have modulo so this is what compilers tend to do. Actual code is probably

Code: Select all

if(result % 1024 > 0) {
	result += 1024 - (result % 1024)
}
Index 46 and 47 point to the same thing just at the start and end.
Last edited by Yretenai on Wed Sep 08, 2021 7:45 pm, edited 2 times in total.
Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1823
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1058 times

Re: Vindictus KR server has new hfs format

Post by Ekey »

Okay in [45] table end offset or size :oops: (77EEDAF6871DCC7B83BE580E005294A26F71CDCF_00000)

Code: Select all

0x3CF8 (15608) & 0x3FF = 0xF8
0x3CF8 - 0xF8 = 0x3C00
0x3C00 + 0x400 = 0x4000
User avatar
Yretenai
veteran
Posts: 126
Joined: Tue Jan 28, 2020 4:39 pm
Has thanked: 20 times
Been thanked: 138 times

Re: Vindictus KR server has new hfs format

Post by Yretenai »

Ekey wrote: Wed Sep 08, 2021 7:42 pm Okay in [45] table end offset or size :oops: (77EEDAF6871DCC7B83BE580E005294A26F71CDCF_00000)

Code: Select all

0x3CF8 (15608) & 0x3FF = 0xF8
0x3CF8 - 0xF8 = 0x3C00
0x3C00 + 0x400 = 0x4000
Updated my reply, I was overcomplicating things.
Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1823
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1058 times

Re: Vindictus KR server has new hfs format

Post by Ekey »

Yretenai wrote: Wed Sep 08, 2021 7:46 pm Updated my reply, I was overcomplicating things.

Code: Select all

Table Size = 15152 (0x3B30)
Entry Table Offset = 456 (0x1C8)

15152 + 456 = 15608 (0x3CF8)
0x3CF8 & 0x3FF = 0xF8
0x3CF8 - 0xF8 = 0x3C00
0x3C00 + 0x400 = 0x4000
I guess result here it's a begin offset for files data.

Code: Select all

int32 unk0; -> Compression flags > 6 not compressed, 7 compressed by zlib
int32 unk1; -> Data Size
int32 unk2; -> Encrypted size
Example

Code: Select all

[HFS ENTRY]: materials/post_process/bandi_video.vmt, 2075, 6, 0, 53, 56, C9F4C367C751564E87F8605F0929771E

Code: Select all

HFS > 2C2B4FDFC40F9120AC976BCB993CD8933AE4B6ED_00000.hfs
Offset > 0x800
Encrypted Size > 56
Real Size > 53
I noticed the file datas must be decrypted 2 times :?

Code: Select all

Decrypt #1 - 13 D4 48 1D A1 96 58 4C AF 5C E1 0D 35 58 35 3B D1 95 98 69 A5 48 A0 CC 62 C0 44 F8 50 33 15 E2 E3 9D D9 47 B6 13 C0 E9 34 CB 4D 50 71 1C 13 0F F0 CA 50 75 19 AE 14 7A

Code: Select all

Decrypt #2 - 22 55 6E 6C 69 74 47 65 6E 65 72 69 63 22 0D 0A 7B 0D 0A 09 22 24 62 61 73 65 74 65 78 74 75 72 65 22 20 22 5F 62 61 6E 64 69 56 69 64 65 6F 22 0D 0A 7D 0D 0A 00 00 00
Result :D

Code: Select all

"UnlitGeneric"
{
	"$basetexture" "_bandiVideo"
}
User avatar
Yretenai
veteran
Posts: 126
Joined: Tue Jan 28, 2020 4:39 pm
Has thanked: 20 times
Been thanked: 138 times

Re: Vindictus KR server has new hfs format

Post by Yretenai »

Ekey wrote: Wed Sep 08, 2021 8:02 pm

Code: Select all

int32 unk0; -> Compression flags > 6 not compressed, 7 compressed by zlib
Looks like flags are

Code: Select all

0x1 0b1   Compressed
0x2 0b10  EncryptedRound1
0x4 0b100 EncryptedRound2
Round 1 and 2 are guesses, but it would explain why it's encrypted twice.
LightXPS
advanced
Posts: 57
Joined: Thu Jan 10, 2019 11:42 am
Has thanked: 8 times
Been thanked: 2 times

Re: Vindictus KR server has new hfs format

Post by LightXPS »

Ekey wrote: Wed Sep 08, 2021 6:25 pm Info content about all HFS's (headers, entries and log) 8) Mirror #1 or Mirror #2
Man, that is REALLY nice! :up: This helps me finding the files I need to get the models I want. But it seems my OpenOffice can't handle close to 5k pages of text when searching for all entries with a certain wording xD

Now for the script to arrive (if there's one in the making)... In the meantime, I'm searching for the files I need :ninja:

Edit:
I just can't seem to find the location of the texture files for the inner armors (e. g. for Hagie) - found the models so far...
silberberg44
n00b
Posts: 15
Joined: Thu Aug 27, 2020 9:41 am
Has thanked: 2 times
Been thanked: 1 time

Re: Vindictus KR server has new hfs format

Post by silberberg44 »

LightXPS wrote: Thu Sep 09, 2021 4:56 am
Ekey wrote: Wed Sep 08, 2021 6:25 pm Info content about all HFS's (headers, entries and log) 8) Mirror #1 or Mirror #2
Man, that is REALLY nice! :up: This helps me finding the files I need to get the models I want. But it seems my OpenOffice can't handle close to 5k pages of text when searching for all entries with a certain wording xD

Now for the script to arrive (if there's one in the making)... In the meantime, I'm searching for the files I need :ninja:

Edit:
I just can't seem to find the location of the texture files for the inner armors (e. g. for Hagie) - found the models so far...
The texture files for inner armors should be located in the characters' texture files. You need to search for the character that first features the character's body archetype (normal, giant or tall). Reason is because each inner armor is treated as a separate body and for other characters it's reused.

In case of characters like Hagie/Sylas, you must seek most of them in Lethita's inner armors textures (aka Lann)
Female characters use either Fiona's body or Evie's (except for certain inner armors that are either changed depending on character or are exclusive to said character)
Giant = Karok
Tall = Hurk
silberberg44
n00b
Posts: 15
Joined: Thu Aug 27, 2020 9:41 am
Has thanked: 2 times
Been thanked: 1 time

Re: Vindictus KR server has new hfs format

Post by silberberg44 »

By the way, did someone figure out what kind of encryption was put on the files? Previously, you guys disproved it being AES, didn't you?
User avatar
Yretenai
veteran
Posts: 126
Joined: Tue Jan 28, 2020 4:39 pm
Has thanked: 20 times
Been thanked: 138 times

Re: Vindictus KR server has new hfs format

Post by Yretenai »

silberberg44 wrote: Fri Sep 10, 2021 10:19 am By the way, did someone figure out what kind of encryption was put on the files? Previously, you guys disproved it being AES, didn't you?
Modified version of AES Serpent using some constants from SNOW and some from Soseman, with multiple rounds of encryption.
Post Reply