Page 1 of 14

[REQ][PC]Sleeping Dogs .big files

Posted: Wed Aug 15, 2012 4:50 am
by Lennox775
I've never seen any PC games created by this developer.
Perhaps it takes a long time to release unpack-repack tool.
I think .big is archive and .bix is its index.

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Wed Aug 15, 2012 11:58 am
by onixer
I have try extractor for DeadRising2, FinalBIG, Dragon UnPACKer -nothing does not help.
Maybe someone knows, how to open these files, please!

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Wed Aug 15, 2012 1:30 pm
by Hairless Wookiee
This isn't my sort of thing at all, but it would appear that all BIG files have an empty header of 256 bytes, followed by the first 4 bytes of data being 50 4D 43 51 "PMCQ", which I guess signifies the file type. BIX files seem to all share the same first 4 bytes, A8 40 5C 2C. As Lennox775 suggested, they would appear to be some sort of index file.

My understanding is that the developers United Front Games made their own custom engine, so presumably the file format is custom as well.

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Wed Aug 15, 2012 1:57 pm
by onixer
it's sad ((if we do not get access to files. we can not make mods for this game.
Is there any way out?

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Wed Aug 15, 2012 8:34 pm
by Falo
*.bix is a simple format, but as always with Square Enix Games most of it uses hash's instead of real filenames,
i haven't found the function to calculate hashs yet, could take a while.

here the *.bix structure:

Code: Select all

//--------------------------------------
//--- 010 Editor v4.0.2 Binary Template
//
// File: Sleeping Dogs *.bix
// Author: Falo
// Revision: 1.0
//--------------------------------------
struct{
    ubyte magic1[4];        // A8 40 5C 2C
    int filesize1;
    int filesize2;
    int reserved1[4];
    uint checksum<format=hex>;
    int reserved2[2];
    ubyte magic2[4];        // F9 84 E7 2A
    char archive_name[36];
    int unk1[2];            // 2x -1
    int numFiles;
    int magic3;             // always 0x34
    byte junk[magic3-4];    // this is magic3 - 4 Byte junk data, contains archive name and sometimes "D:\UFG"

    struct ENTRY entry[numFiles]<optimize=false>;
}Header;

struct ENTRY{
    uint hash<format=hex>;
    int Offset;             // Offset *= 4
    int SizeEmpty:12;       // Offset += SizeEmpty
    int unk1:20;            // ???
    int CSize;              // Compressed Size, if 0 use USize
    int unk2;               // ???
    int USize;              // Uncompressed Size, if 0 it's a dummy file

    Printf("%08X;%08X;%08X;%08X\n",hash,(Offset*4)+SizeEmpty,CSize,USize);
};

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Thu Aug 16, 2012 1:43 pm
by twisted
I don't think the hashes are calculated from the actual file names.
Here's a list of a few of the hashes from the Game.bix, they're far too incremental to be calculated from a filename (unless they're all very similar file names but even then the algorithm must be pretty bad to produce hashes that similar)

Image

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Thu Aug 16, 2012 3:09 pm
by Falo
twisted wrote:I don't think the hashes are calculated from the actual file names.
Here's a list of a few of the hashes from the Game.bix, they're far too incremental to be calculated from a filename (unless they're all very similar file names but even then the algorithm must be pretty bad to produce hashes that similar)
No this is always the case for Square Enix Games, the hashes are sorted to be incremental, it's not sorted after the offsets.
I have seen this in KH1, KH2, KHBBS, Just Cause 2, it is correct.

i found some filenames in HKShip.exe, but not the function

Code: Select all

Data\UI\loading_generic3_tp.perm.bin
Data\UI\loading_generic4_tp.perm.bin
Data\UI\loading_generic7.tp.perm.bin

Data\UI\Icons_Weapon_QSZ92_TP.perm.bin
Data\UI\Icons_Weapon_45CAL_TP.perm.bin
Data\UI\Icons_Weapon_45CAL02_TP.perm.bin
Data\UI\Icons_Weapon_ACT02_TP.perm.bin
Data\UI\Icons_Weapon_ACT_TP.perm.bin
Data\UI\Icons_Weapon_ARGL_TP.perm.bin
Data\UI\Icons_Weapon_PUMPS_TP.perm.bin
Data\UI\Icons_Weapon_SMG_TP.perm.bin
Data\UI\Icons_Weapon_GOLD50_TP.perm.bin
Data\UI\Icons_Weapon_BATON_TP.perm.bin
Data\UI\Icons_Weapon_BROOM_TP.perm.bin
Data\UI\Icons_Weapon_CLEAVER_TP.perm.bin
Data\UI\Icons_Weapon_KNIFE_TP.perm.bin
Data\UI\Icons_Weapon_CROWBAR_TP.perm.bin
Data\UI\Icons_Weapon_STICK_TP.perm.bin
Data\UI\Icons_Weapon_SHOVEL_TP.perm.bin
Data\UI\Icons_Weapon_BRIEFCASE_TP.perm.bin
Data\UI\Icons_Weapon_HAMMER_TP.perm.bin
Data\UI\Icons_Weapon_CANEWALKING_TP.perm.bin
Data\UI\Icons_Weapon_HANDGRINDER_TP.perm.bin
Data\UI\Icons_Weapon_FISHWRAPPED_TP.perm.bin
Data\UI\Icons_Weapon_WOK.perm.bin
Data\UI\Icons_Weapon_FIREEXTINGUISHER.perm.bin
Data\UI\Icons_Weapon_COOKINGPAN.perm.bin
Data\UI\Icons_Weapon_SHOPPINGBAG.perm.bin
Data\UI\Icons_Weapon_DUFFLEBAG.perm.bin
Data\UI\Icons_Weapon_GROCERYBAG.perm.bin

Data\UI\SpyPC_texturepack.perm.bin
Data\UI\casecomplete_texturepack.perm.bin
Data\UI\unlockables_texturepack.perm.bin
Data\UI\garage_texturepack.perm.bin
Data\UI\gametracker_texturepack.perm.bin
Data\UI\camera_texturepack.perm.bin
Data\UI\camera_cctv_texturepack.perm.bin
Data\UI\options_common_texturepack.perm.bin
Data\UI\options_controllers_TexturePack.perm.bin
Data\UI\options_common_texturepack.perm.bin

data\world\game\dlc\%s\dlc%d.perm.bin
%s\Row_%d\TexturePack_%d_%d%s.perm.bin

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Thu Aug 16, 2012 3:22 pm
by aluigi
do you have a sample archive?
I want to test the following script:
*edit* updated script

Code: Select all

open FDDE "BIG" 1

    ubyte magic1[4]        // A8 40 5C 2C
    int filesize1
    int filesize2
    int reserved1[4]
    uint checksum           // <format=hex>
    int reserved2[2]
    ubyte magic2[4]        // F9 84 E7 2A
    char archive_name[36]
    int unk1[2]            // 2x -1
    int numFiles
    int magic3              // always 0x34
    math magic3 -= 4
    byte junk[magic3]

for i = 0 < numFiles
    uint hash               // <format=hex>
    int Offset             // Offset *= 4
    int SizeEmpty:12       // Offset += SizeEmpty
    int unk1:20            // ???
    int CSize              // Compressed Size, if 0 use USize
    int unk2               // ???
    int USize              // Uncompressed Size, if 0 it's a dummy file

    math Offset *= 4
    math Offset += SizeEmpty
    if CSize == 0
        log "" Offset USize 1
    else
        #clog "" Offset CSize USize 1
        log "" Offset CSize 1
    endif
next i
yeah quickbms accepts C structures and bits too :)

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Thu Aug 16, 2012 3:42 pm
by twisted

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Thu Aug 16, 2012 6:32 pm
by Hairless Wookiee
- open input file I:\-=TEMP=-\QuickBMS\Global.bix
- open script SD_BIX.txt
- c_structs: "ubyte" "magic1[4];"
- c_structs: "int" "filesize1"
- c_structs: "int" "filesize2"
- c_structs: "int" "reserved1[4]"
- c_structs: "uint" "checksum"
- c_structs: "int" "reserved2[2]"
- c_structs: "ubyte" "magic2[4];"
- c_structs: "char" "archive_name[36]"
- c_structs: "int" "unk1[2];"
- c_structs: "int" "numFiles"
- c_structs: "int" "magic3;"
- c_structs: "byte" "junk[magic3]"
- c_structs: "uint" "hash"
- c_structs: "int" "Offset;"
- c_structs: "int" "SizeEmpty:12;"
- c_structs: "int" "unk1:20;"
- c_structs: "int" "CSize;"
- c_structs: "int" "unk2;"
- c_structs: "int" "USize;"
- set output folder OUTPUT

offset filesize filename
------------------------------

Error: the requested amount of bytes to allocate is negative (-3)

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Thu Aug 16, 2012 8:25 pm
by Falo
yes because the script is wrong ^^
the bigfile is *.big, the fileindex is *.bix, the script reads files only from *.bix which is wrong, here the correct script:

Code: Select all

// use script on *.big file
open FDDE bix 1
goto 0x58 1
get numFiles long 1
goto 0x90 1

for i = 0 < numFiles
    get hash long 1
    get Offset long 1
    get unk1 long 1
    get CSize long 1
    get unk2 long 1
    get USize long 1
	
    set SizeEmpty unk1
    math SizeEmpty &= 0xFFF
    math Offset *= 4
    math Offset += SizeEmpty
	
    if CSize == 0
        log hash Offset USize
    else
        //clog hash Offset CSize USize
		log hash Offset CSize
    endif
next i
Compressed files have a PMCQ Header, in that header is the uncompressed size at 0x18, there are 3 functions in HKShip.exe that uses PMCQ, one of this should be the decompression:

Code: Select all

.text:0087CD93                 cmp     dword ptr [esi], 'QCMP'

.text:0095E679                 mov     dword ptr [edi], 'QCMP'

.text:00ABFFA7                 cmp     eax, 'QCMP'
.text:00ABFFAC                 jz      short loc_ABFFB5
.text:00ABFFAE                 cmp     eax, 'PMCQ'
.text:00ABFFB3                 jnz     short loc_AC0023
is it legal to post the steam protected exe ?

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Thu Aug 16, 2012 10:05 pm
by Rick
File name hash is modified CRC32, will have code up in repository later.

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Thu Aug 16, 2012 10:23 pm
by onixer
sorry guys I'm in this business just a kid, but I see you're a pro.
please tell me, is it possible to open these .big files?

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Fri Aug 17, 2012 10:02 am
by Lennox775
onixer wrote:sorry guys I'm in this business just a kid, but I see you're a pro.
please tell me, is it possible to open these .big files?
Researching and creating tools cannot be done in just a few days. (especially from scratch)
In case of JustCause2 it took two or three weeks to release extract/repack tools.
Be patient please.

Re: [REQ][PC]Sleeping Dogs .big files

Posted: Sun Aug 19, 2012 10:18 am
by Gishank
Well, least there is the advantage that the devs won't be blocking modding with patches, etc, unlike some other companies. lol