The Forum is up for sale: XeNTaX Forum looking for new owner

Sleeping Dogs Texture Packages (*.perm.bin and *.temp.bin)

Get your graphics formats figures out here! Got details for others? Post here!
Post Reply
Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1822
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1056 times

Sleeping Dogs Texture Packages (*.perm.bin and *.temp.bin)

Post by Ekey »

I found: Width, Height, Offset, Size but dunno where type, mipmaps and ect.

.perm.bin - Info: Width, Height, Offset, Size
.temp.bin - Textures

Count Files = PermBinSize / 304 (Entry Size)

Code: Select all

struct PermBinEntry
{
  dword h01; // Magic
  char h02[24]; // Unknown
  dword h03; // Hash for Texture name without extension
  char h04[12]; // Nulls
  char h05[48]; // Texture name without extension
  word h06; // Width
  word h07; // Heigth
  word h08; // Unknown
  word h09; // Unknown
  char h10[28]; // Unknown
  dword h11; // Offset
  dword h12; // Size
  char h13[168]; // Unknown
};
Anyone can help? (Top Secret Files) :)
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Sleeping Dogs Texture Packages (*.perm.bin and *.temp.bi

Post by howfie »

h08 is number of mipmaps.

0x200 x 0x200 = 0 0x20000 DXT1 size
0x100 x 0x100 = 1 0x8000 DXT1 size
0x080 x 0x080 = 2 0x2000 DXT1 size
0x040 x 0x040 = 3 0x800 DXT1 size
0x020 x 0x020 = 4 0x200 DXT1 size
0x010 x 0x010 = 5 0x080 DXT1 size
0x008 x 0x008 = 6 0x020 DXT1 size
0x004 x 0x004 = 7 0x08 DXT1 size
0x002 x 0x002 = 8 0x08 DXT1 size (anything less than 0x4 x 0x4 always clamp to 4x4)
---------------------------------
total size = 0x2AAB0

what does data in perm.bin file say...
01000000 ... 0002 0002 0800 0100 ... B0AA0200 ...

for another 0x200 by 0x200 image it has
03000000 ... 0002 0002 0800 0100 ...50550500 ...
notice file size is twice as large... probably means DXT5.

so my guess is your h03 is probably type (not file extension has) with 0x0001 being DXT1 and 0x0003 being DXT5.

you have my code ekey... lookup my CreateDXT1Header and CreateDXT5Header in x_dds.h/x_dds.cpp and it will create dds header for you. save to file. paste data from bin file to end of test.dds file. hopefully you see image he he he.

Code: Select all

 DDS_HEADER ddsh;
 CreateDXT1Header(0x200, 0x200, 8, FALSE, &ddsh);
 ofstream ofile("test.dds", ios::binary);
 ofile.write("DDS ", 4);
 ofile.write((char*)&ddsh, sizeof(ddsh));
Image
Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1822
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1056 times

Re: Sleeping Dogs Texture Packages (*.perm.bin and *.temp.bi

Post by Ekey »

h03 - it's 100% texture name hash (string without extension)

Image

You can check it with BIGUnpacker
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Sleeping Dogs Texture Packages (*.perm.bin and *.temp.bi

Post by howfie »

oh i see, i was starting the entry from the filename lol
lemme see, texture type would be part of your h05. i would make h05 only 32 bytes, rather than 48.
Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1822
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1056 times

Re: Sleeping Dogs Texture Packages (*.perm.bin and *.temp.bi

Post by Ekey »

Okay thanks for help.
Post Reply