XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Fri Nov 16, 2018 1:11 pm

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Quake Champions .PAK (Saber Engine)
PostPosted: Fri Sep 14, 2018 5:36 pm 
Offline
beginner
User avatar

Joined: Mon Apr 17, 2017 7:13 pm
Posts: 21
Has thanked: 7 times
Have thanks: 3 times

aluigi recently posted this on ZenHAX:
aluigi wrote:
I have just updated the script in case someone wants to test it:
http://aluigi.org/bms/quake_champions.bms

The only sample file I have here uses an older constant so I didn't test it.

https://zenhax.com/viewtopic.php?f=9&t= ... 4&start=20

You can make the ads go away by registering



Top
 Profile  
 
 Post subject: Re: Quake Champions .PAK (Saber Engine)
PostPosted: Sat Sep 15, 2018 9:56 pm 
Offline
beginner
User avatar

Joined: Mon Apr 17, 2017 7:13 pm
Posts: 21
Has thanked: 7 times
Have thanks: 3 times
For some strange reason, I can't register on the ZenHax forum.

I will post my results here.
This is my first time using QuickBMS, so let me know if I'm doing something incorrectly.

I pointed QuickBMS to the shared.pak file (using the Steam version of Quake Champions).
[ steamapps\common\quakechampions\client\preload\paks\shared.pak ]
After selecting the output, my console output shows this:
Code:
insert the constant number for NrRandom initialization, it depends by the version of the game like 0x412e2206 and 0x631A2028

- please insert the content for the variable SEED2:

What do I do?

-EDIT-
Someone please report this to aluigi.


Top
 Profile  
 
 Post subject: Re: Quake Champions .PAK (Saber Engine)
PostPosted: Tue Oct 02, 2018 4:56 am 
Offline
beginner
User avatar

Joined: Mon Apr 17, 2017 7:13 pm
Posts: 21
Has thanked: 7 times
Have thanks: 3 times
Thank you OXOTHuK for reporting on my behalf.

A user, z65536, from the ZenHax forum, replied with an updated script for QuickBMS.

z65536 wrote:
My script that can extract shared.pak is here.
Code:
# Quake Champions
# script for QuickBMS http://quickbms.aluigi.org

quickbmsver "0.8.0"
set MEMORY_FILE10 string "
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned long long ulong;

    // Numerical Recipes 3rd edition
    static ulong u, v, w;

    ulong NextUInt64()
    {
      u = u * 2862933555777941757ULL + 7046029254386353087ULL;
      v ^= v >> 17; v ^= v << 31; v ^= v >> 8;
      w = 4294957665U * (w & 0xffffffff) + (w >> 32);
      ulong x = u ^ (u << 21); x ^= x >> 35; x ^= x << 4;
      return (x + v) ^ w;
    }

    void NrRandom(ulong seed)
    {
      v = 4101842887655102017ULL;
      w = 1;

      u = v ^ seed ^ 0x631A2028; NextUInt64();
      v = u;                     NextUInt64();
      w = v;                     NextUInt64();
    }

// Quake Champions
static ulong    qc_seed = 0;
static uchar    qc_ivec[32] = {0};
static ushort   qc_seed_idx = 0;
static ushort   qc_ivec_idx = 0;

void quake_decrypt_init(uchar *key) {
   int     i;
   for(i = 0; i < sizeof(qc_ivec); i++) {
      qc_ivec[i] = key[i];
   }
   qc_seed = *(ulong *)key;
   qc_seed_idx = 0;
   qc_ivec_idx = 0;
   NrRandom(qc_seed);
}

int quake_decrypt(unsigned char *data, int size) {
    int     i;
    for(i = 0; i < size; i++) {
        uchar old = qc_ivec[qc_ivec_idx];
        qc_ivec[qc_ivec_idx] = data[i] ;
        data[i] ^= (qc_seed_idx == 0 ? qc_seed :0) ^ old ;
        qc_ivec_idx = (qc_ivec_idx + 1) & 0x1f;
        if(++qc_seed_idx == 8) {
            qc_seed = NextUInt64();
            qc_seed_idx = 0;
        }
    }
    return size;
}
"

goto -40
getdstring KEY 40
calldll MEMORY_FILE10 "quake_decrypt_init" "tcc" RET KEY
findloc OFFSET binary "PK\x06\x06" 0 "" 0
goto OFFSET
idstring "PK\x06\x06"
   get ZERO byte
   get central_entries longlong
   get central_size longlong
   get central_offset longlong
   get DUMMY_offset longlong

goto central_offset
for i = 0 < central_entries

    savepos TMP
    log MEMORY_FILE TMP 0x2e
    calldll MEMORY_FILE10 "quake_decrypt" "tcc" RET MEMORY_FILE 0x2e
    goto 0x2e 0 SEEK_CUR

    goto 0 MEMORY_FILE
    idstring MEMORY_FILE "PK\x01\x02"
        get ver_made        short MEMORY_FILE
        get ver_need        short MEMORY_FILE
        get flag            short MEMORY_FILE
        get method          short MEMORY_FILE
        get modtime         short MEMORY_FILE
        get moddate         short MEMORY_FILE
        get zip_crc         long MEMORY_FILE
        get comp_size       long MEMORY_FILE
        get uncomp_size     long MEMORY_FILE
        get name_len        short MEMORY_FILE
        get extra_len       short MEMORY_FILE
        get comm_len        short MEMORY_FILE
        get disknum         short MEMORY_FILE
        get int_attr        short MEMORY_FILE
        get ext_attr        long MEMORY_FILE
        get rel_offset      long MEMORY_FILE

    savepos TMP
    log MEMORY_FILE TMP name_len
    calldll MEMORY_FILE10 "quake_decrypt" "tcc" RET MEMORY_FILE name_len
    goto name_len 0 SEEK_CUR

    goto 0 MEMORY_FILE
        getdstring name     name_len MEMORY_FILE

        # not encrypted
        getdstring extra    extra_len
        getdstring comment  comm_len

      if extra_len >= 12
         getvarchr extra_id extra 0 short
         if extra_id == 0x0001
            if rel_offset == 0xffffffff
               getvarchr rel_offset extra 4 longlong
            endif
         endif
      endif
     
    math offset = 0x1e
    math offset + rel_offset

        if method == 0
            Log name offset uncomp_size # same as comp_size
            #Log name offset comp_size   # was uncomp_size before AES
        else
            if method == 8
                ComType deflate
            else
                print "unsupported compression method %method%"
                cleanexit
            endif
            CLog name offset comp_size uncomp_size
        endif
next i
https://zenhax.com/viewtopic.php?f=9&t=4360&sid=a4456b06aa14422a628a261ad9361914&start=20#p38930

I was able to use the new script with QuickBMS on the shared.pak(12.1 GB).
The extracted folders:
[database] (10.9 MB)
[hkx] (7.30 MB)
[sound] (446 MB)
[textures] (14.6 GB)
[tpl] (1.10 GB)
[video] (727 MB)

I'm looking for the character meshes, and I think they are in the [tpl] folder.
The [tpl] folder contains 803 files with the following file formats:
TPL
TPL_DATA
CDT


This is my first time doing this, and I'm not familiar with the TPL or CDT formats.
How do I proceed with locating the meshes and then import them into Blender?


Top
 Profile  
 
 Post subject: Re: Quake Champions .PAK (Saber Engine)
PostPosted: Tue Oct 02, 2018 11:16 am 
Offline
ultra-n00b
User avatar

Joined: Tue Nov 15, 2011 12:49 am
Posts: 8
Has thanked: 0 time
Have thanks: 0 time
Curtain, how exactly did you used new script on shared.pak? Is your version of Quake Champions latest? I'm using latest version of QC on Steam, and Quick BMS responds with:
Code:
insert the constant number for NrRandom initialization, it depends by the version of the game like 0x412e2206 and 0x631A2028
- please insert the content for the variable SEED2:

Did you had such thing? And if you did, how you managed to proceed?


Top
 Profile  
 
 Post subject: Re: Quake Champions .PAK (Saber Engine)
PostPosted: Tue Oct 02, 2018 12:13 pm 
Offline
beginner
User avatar

Joined: Mon Apr 17, 2017 7:13 pm
Posts: 21
Has thanked: 7 times
Have thanks: 3 times
rev3n4nt wrote:
Curtain, how exactly did you used new script on shared.pak? Is your version of Quake Champions latest? I'm using latest version of QC on Steam, and Quick BMS responds with:
Code:
insert the constant number for NrRandom initialization, it depends by the version of the game like 0x412e2206 and 0x631A2028
- please insert the content for the variable SEED2:

Did you had such thing? And if you did, how you managed to proceed?

The error you had was the same 1 I had when using the script from aluigi's post.
I used the new script from z65536's recent post.

-EDIT- Forgot to mention, I am using steam and have the latest version of Quake Champions.


Top
 Profile  
 
 Post subject: Re: Quake Champions .PAK (Saber Engine)
PostPosted: Tue Oct 02, 2018 10:06 pm 
Offline
ultra-n00b
User avatar

Joined: Tue Nov 15, 2011 12:49 am
Posts: 8
Has thanked: 0 time
Have thanks: 0 time
Quote:
I used the new script from z65536's recent post.

Thanks for checking out Curtain. I used all scripts on that page. I deleted all QC files and downloaded it again - extracts fine.
You mentioned [textures] in previous post, did you managed to extract PCT files? I tried from moddb "QCPCT_v02", but it gives noisy image.


Top
 Profile  
 
 Post subject: Re: Quake Champions .PAK (Saber Engine)
PostPosted: Tue Oct 02, 2018 11:44 pm 
Offline
beginner
User avatar

Joined: Mon Apr 17, 2017 7:13 pm
Posts: 21
Has thanked: 7 times
Have thanks: 3 times
rev3n4nt wrote:
Quote:
I used the new script from z65536's recent post.

Thanks for checking out Curtain. I used all scripts on that page. I deleted all QC files and downloaded it again - extracts fine.
You mentioned [textures] in previous post, did you managed to extract PCT files? I tried from moddb "QCPCT_v02", but it gives noisy image.

I haven't tried using any of the available extraction tools for textures yet. I figured I would focus on getting the meshes first and then use Ninja Ripper to rip the textures in case the other texture tools don't work.
Have you managed to locate and extract the character meshes?


Top
 Profile  
 
 Post subject: Re: Quake Champions .PAK (Saber Engine)
PostPosted: Sat Oct 06, 2018 5:39 am 
Offline
beginner
User avatar

Joined: Mon Apr 17, 2017 7:13 pm
Posts: 21
Has thanked: 7 times
Have thanks: 3 times
Did anyone locate the character meshes?

I believe the game assets in the Steam version are located here:
steamapps\common\quakechampions\client\preload\paks
- awoken.pak (163 MB)
- basic_training_map.pak (267 MB)
- blood_covenant.pak (541 MB)
- bloodrun.pak (243 MB)
- burial_chamber.pak (494 MB)
- cache.pak (172 MB)
- church.pak (447 MB)
- corrupted_keep.pak (150 MB)
- fortress_of_the_deep.pak (218 MB)
- initial.pak (625 MB)
- lighthouse.pak (381 MB)
- lockbox.pak (274 MB)
- longestyard.pak (117 MB)
- main_menu.pak (46.4 MB)
- ruins_of_sarnath.pak (318 MB)
- shared.pak (12.1 GB)
- vale_of_pnath.pak (112 MB)

The shared.pak(12.1 GB) has the following folders:
[database] (10.9 MB)
[hkx] (7.30 MB)
[sound] (446 MB)
[textures] (14.6 GB)
[tpl] (1.10 GB)
[video] (727 MB)

The [tpl] folder (803 files) doesn't appear to have any recognizable 3d mesh formats:
- .TPL
- .TPL_DATA
- .CDT


Anyone know what .CDT and .TPL_DATA are?
Am I looking in the wrong place?

In Aug 26th 2017, a forum member suggested the possibility of the meshes being included in the .PCT files:
Matsilagi wrote:
After checking out the (kinda recent) Quake Champions PAK explorer, i found PCT files, in which it says its textures, however, i think the models may be stored here aswell.

iOrange replied with a release of QCPCT for extracting textures but he didn't mention anything about character meshes.
viewtopic.php?f=16&t=16927&hilit=Quake+Champion


Top
 Profile  
 
 Post subject: Re: Quake Champions .PAK (Saber Engine)
PostPosted: Sat Oct 06, 2018 6:24 pm 
Offline
advanced

Joined: Thu Jul 12, 2012 12:24 pm
Posts: 70
Has thanked: 10 times
Have thanks: 23 times
Curtain wrote:
In Aug 26th 2017, a forum member suggested the possibility of the meshes being included in the .PCT files:
Matsilagi wrote:
After checking out the (kinda recent) Quake Champions PAK explorer, i found PCT files, in which it says its textures, however, i think the models may be stored here aswell.

PCT are only textures. TCIP header means PICTURE. Btw textures are easily convertable by Rawtex. You must just set start offset of raw data + sometimes guess compression. But mostly they are BC7 - RGB/sRGB
About TPL files they have a string S3DRESOURCE means SABER 3D RESOURCE. MESH maybe?... I tried H2O but no luck. Since i still don't know where starts VTBlock and which size has.


Top
 Profile  
 
 Post subject: Re: Quake Champions .PAK (Saber Engine)
PostPosted: Sun Oct 07, 2018 1:40 am 
Offline
beginner
User avatar

Joined: Mon Apr 17, 2017 7:13 pm
Posts: 21
Has thanked: 7 times
Have thanks: 3 times
GRiNDERKILLER wrote:
PCT are only textures. TCIP header means PICTURE. Btw textures are easily convertable by Rawtex. You must just set start offset of raw data + sometimes guess compression. But mostly they are BC7 - RGB/sRGB
Thank you for clarifying.
For the textures, I may just use Ninja Ripper, since I'm not familiar with Rawtex.

GRiNDERKILLER wrote:
About TPL files they have a string S3DRESOURCE means SABER 3D RESOURCE. MESH maybe?... I tried H2O but no luck. Since i still don't know where starts VTBlock and which size has.
Thank you again.
Is this something aluigi or other ZenHax members know more about?
I'm having some difficulty registering on the ZenHax site. I was hoping to share your post with them: https://zenhax.com/viewtopic.php?f=9&t= ... 8&start=20
-EDIT- Not sure if they need a sample TPL file.


Top
 Profile  
 
 Post subject: Re: Quake Champions .PAK (Saber Engine)
PostPosted: Sun Oct 14, 2018 8:26 pm 
Offline
ultra-n00b
User avatar

Joined: Tue Nov 15, 2011 12:49 am
Posts: 8
Has thanked: 0 time
Have thanks: 0 time
So I posted in zenhax forum:
https://zenhax.com/viewtopic.php?f=9&t= ... 9&start=20
Added model & texture files : ripped "Eradicator" Railgun, and same model extracted from PAK packages.
Maybe it might be helpful :)


Top
 Profile  
 
 Post subject: Re: Quake Champions .PAK (Saber Engine)
PostPosted: Sat Nov 03, 2018 10:33 pm 
Offline
n00b

Joined: Wed May 23, 2012 4:45 pm
Posts: 10
Has thanked: 6 times
Have thanks: 1 time
[quote="Curtain"][/quote]

thank you for script, i extract shared.pak\[sound], but what tool to convert "bank" files to wav or mp3?



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group