Email or username:

Password:

Forgot your password?
a1batross
007: Nightfire for PC has a pretty weird archive format.

There are two type of nodes: files and directories.

Files have one uint8_t field and two uint32_t fields. Compressed flag, real size and compressed size. It's typical.

But directories... Directories have two uint32_t fields: count of subdirectories, ok, and sum of regular file name lengths in that directory.

There is no flag to distinguish directory from regular file. You're supposed to subtract name length from and if there are any bytes left, then it's a file. If not, start decrementing subdirectories count.

Why exactly the sum of name lengths?
1 comment
a1batross
Oh I get it now.

It's probably for easier FindFirst/FindNext implementation, to find subdirectories nodes faster, as they are at the end of the list.
Go Up