PackZip 0.3 and files bigger 2GB

Doubts, help and support about QuickBMS and other game research tools
defang
Posts: 1
Joined: Fri Jul 24, 2015 5:30 pm

PackZip 0.3 and files bigger 2GB

Post by defang »

Hello, I was trying to replace textures in Witcher 3. They are in texture.cache files. I tried QuickBMS, it works on small files from DLCs. But it failed when I tried export textures from main pack which was about 3.9GB. So I tried OffZip. It exported textures, and PackZip was able to import them back. But again, only small archives were ok. Big archive failed with "-seek offset....Invalid argument". So I checked your code and found this: you are using "fseek()" which cant work with files bigger than 2GB. I replaced it with "fseeko64()" and it works.

Code: Select all

packzip.c
71:  u32     offset      = 0,      ->  unsigned long long     offset      = 0x0,
138:     case 'o': offset        = get_num(argv[++i]);   break;       ->             case 'o': offset        = strtoull(argv[++i],NULL,0);   break;
179:fprintf(stderr,
        "- offset        0x%08x\n"
        "- windowbits    %d\n",
        offset, wbits);

    if(offset) {
        fprintf(stderr, "- seek offset\n");
        if(fseek(fdo, offset, SEEK_SET)) std_err();
    }
   
   
   
    ->
   
    ¨    fprintf(stderr,
        "- offset        %llx\n",
       
        offset);
fprintf(stderr,
       
        "- windowbits    %d\n"
        ,wbits);
    //fseek();
   if(offset) {
        fprintf(stderr, "- seek offset\n");
        if(fseeko64(fdo, offset, SEEK_SET)) std_err();
    }



So, OffZip/PackZip can modify Witcher 3 textures.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: PackZip 0.3 and files bigger 2GB

Post by aluigi »

Yeah you are right, differently than other tools like offzip and quickbms, packzip doesn't have the support for big files.
I guess the reason is simply because the last times I updated it was in 2013 and 2011 :)
Anyway no problem, I will copy&paste the needed code from offzip and then I will release the new version.
Thanks.

It's strange that quickbms fails with that cache file, I remember that there were some problems but then I found a good way to handle that file.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: PackZip 0.3 and files bigger 2GB

Post by aluigi »

I have just released packzip 0.3.1:
http://aluigi.org/mytoolz.htm#packzip