Tokyo olympic 2020 .pac files

Textures, recreate headers, conversions, algorithms and parsing of image files
Mishuk598
Posts: 46
Joined: Sat Nov 09, 2019 5:52 am

Tokyo olympic 2020 .pac files

Post by Mishuk598 »

hello guys
I have extracted files form olympic games tokyo 2020. and found all files(textures, models and everything) have .pac extention.
Also all of them have same header " PACx402L" I can't open them for use.Please help me to open them.Here is some samples:
https://drive.google.com/file/d/1PILLGV ... OE8R6/view

Image
Mishuk598
Posts: 46
Joined: Sat Nov 09, 2019 5:52 am

Re: Tokyo olympic 2020 .pac files

Post by Mishuk598 »

Aluigi mate could you please help me?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Tokyo olympic 2020 .pac files

Post by aluigi »

It's difficult.

The format is derived from the one covered by sfpac.bms that uses "PACx301L", but my script is just a simple (and untested) conversion of another tool:
https://gist.github.com/blueskythlikesc ... b6984388cc
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Tokyo olympic 2020 .pac files

Post by spiritovod »

It has been already covered here: viewtopic.php?f=9&t=12735
And models format from those pac here: https://forum.xentax.com/viewtopic.php?f=16&t=21300
People can't even write correct title...
Mishuk598
Posts: 46
Joined: Sat Nov 09, 2019 5:52 am

Re: Tokyo olympic 2020 .pac files

Post by Mishuk598 »

Thanks a lot mates!!!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Tokyo olympic 2020 .pac files

Post by aluigi »

Thanks spiritovod, I added a note in my script (mainly for myself ahahah)
Mishuk598
Posts: 46
Joined: Sat Nov 09, 2019 5:52 am

Re: Tokyo olympic 2020 .pac files

Post by Mishuk598 »

aluigi wrote:Thanks spiritovod, I added a note in my script (mainly for myself ahahah)

I have a data file archive which use MOEG compression. the file size is 3.12 gb. It has no extention.
Image

Any help can i expect?
Last edited by Mishuk598 on Mon Jul 13, 2020 8:21 am, edited 1 time in total.
Mishuk598
Posts: 46
Joined: Sat Nov 09, 2019 5:52 am

Re: Tokyo olympic 2020 .pac files

Post by Mishuk598 »

This file is from ''Olympic Games Beijing 2008'' developed by SEGA.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Tokyo olympic 2020 .pac files

Post by Ekey »

aluigi wrote:It's difficult.

The format is derived from the one covered by sfpac.bms that uses "PACx301L", but my script is just a simple (and untested) conversion of another tool:
https://gist.github.com/blueskythlikesc ... b6984388cc


Spec for PACx402L :)

https://gist.github.com/Radfordhound/ec ... 06dce7b9e2
kumarwaar
Posts: 1
Joined: Wed Aug 26, 2020 2:47 pm

Re: Tokyo olympic 2020 .pac files

Post by kumarwaar »

Finally it works. .22 rifle scope reviews
Last edited by kumarwaar on Tue Jan 12, 2021 1:41 pm, edited 1 time in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Tokyo olympic 2020 .pac files

Post by aluigi »

I tried to convert that struct in a quickbms script but there is something missing.
It's just for fun since a solution has been already found.

This is the non-working script (not the XXX prints for debugging):

Code: Select all

comtype lz4

// Tokyo Olympics 2020 pac format specification 2.0
// By: Radfordhound
// Heavily based off of Skyth's Forces pac specification
callfunction HeaderV4 1//Header;

open "." TEMPORARY_FILE

callfunction EmbeddedPAC 1//EmbeddedPACs[];         // These are LZ4 compressed and need to be decompressed first

startfunction HeaderV4
    char[8] Signature   // = "PACx402L";
    uint PacID;                     // Random number? Might actually be date created/modified.
    uint FileSize;
    uint RootOffset;
    uint RootCompressedSize;
    uint RootUncompressedSize;
    ushort Type //= 1;               // Always 1? Oh gosh can these giant pacs have splits please no
    ushort Constant //= 0x208;        // No idea what this is for
    uint ChunkCount;
    log TEMPORARY_FILE 0 0
    append
    for i = 0 < ChunkCount
        callfunction Chunk 1
        clog TEMPORARY_FILE RootOffset CompressedSize UncompressedSize
        math RootOffset + CompressedSize
    next i
    append
    // Pad to a 0x16 offset
endfunction

startfunction Chunk
    // When decompressing the root pac allocate a buffer of
    // size Header.RootUncompressedSize, then loop through these
    // chunks and decompress each one, one-by-one, into that buffer.
   
    // If you try to decompress all at once instead the data can be corrupted.
    uint CompressedSize;
    uint UncompressedSize;
endfunction

// Once you've decompressed the root PAC it'll look like this:

startfunction EmbeddedPAC
    callfunction HeaderV3 1//PACHeader;
    callfunction NodeTree 1//TypesTree;             // Type nodes point to file node trees
    callfunction SplitsInfo 1//SplitInfo;           // If there are no splits this isn't present
print "XXXXXXXXXXX1"
    for
    callfunction DataEntry 1//DataEntries[];        // If there are no data entries this isn't present
    next
endfunction

startfunction HeaderV3
    char[8] Signature //= "PACx402L"; // Yes, it's the same as HeaderV4 even though it's a different format.
    uint PacID //= Header.PacID;      // Always same as Header.PacID?
    uint FileSize;                  // Size of the pac.
    uint NodesSize;                 // Size of the section containing all of the NodeTrees and their Nodes.
    uint SplitsInfoSize;            // Size of the section containing all of the split information.
    uint DataEntriesSize;           // Size of the section containing all of the DataEntries.
    uint StringTableSize;           // Size of the string table.
    uint DataSize;                  // Size of the section containing all of the file's data.
    uint OffsetTableSize;           // Size of the offset table.
    ushort Type;
    ushort Constant //= 0x108;
    uint SplitCount;
endfunction

startfunction NodeTree
    uint NodeCount;
    uint DataNodeCount;
    ulong NodesOffset;
    ulong DataNodeIndicesOffset;
    for i = 0 < NodeCount
        callfunction Node
    next i
endfunction

startfunction Node
    // Either the type name or the file name, depending on what type of node this is. See below.
    ulong NameOffset;
   
    // If this node is part of the first NodeTree in the pac, this points to
    // another NodeTree which contains files of the type described by this node's name.
    // Otherwise, this points to a DataEntry containing information on the file.
    ulong DataOffset;
   
    ulong ChildIndexTableOffset;
    int ParentIndex;
    int GlobalIndex;
    int DataIndex;
    ushort ChildCount;
    bool HasData;
    byte FullPathSize;              // Not counting this node's name.
endfunction

startfunction SplitsInfo
    ulong SplitCount;               // Could also be a uint with padding but this makes more sense to me
    ulong SplitEntriesOffset;       // Yes, literally points to next 8 bytes.
    for i = 0 < SplitCount
        callfunction SplitEntry //SplitEntries[SplitCount];
    next i
print "XXXXXXXXXXX2"
    for
        callfunction Chunk 1//SplitChunks[];
    next
endfunction

startfunction SplitEntry
    ulong SplitName;                // E.G. ath10n_trr_cmn.pac.000
    uint SplitCompressedSize;
    uint SplitUncompressedSize;
    uint SplitOffset;               // Where this split is within the big pac that contains this pac
    uint SplitChunkCount;
    ulong SplitChunksOffset;
endfunction

startfunction DataEntry
    // Random number? Not the same as Header.PacID or PACHeader.PacID, like it was in Forces.
    // Might actually be date created/modified.
    uint PacID;
    ulong DataSize;
    char Padding1[4];               // Always 0?
    ulong DataPosition;
    char Padding2[8];               // Always 0?
    ulong ExtensionPosition;
    ulong DataType;
endfunction

/*
enum DataType : ulong
{
    RegularFile = 0,
    NotHere = 1,
    BINAFile = 2
}
enum PacType : ushort
{
    // PAC has no splits
    HasNoSplit = 1,
   
    // PAC is a split
    IsSplit = 2,
   
    // PAC has splits
    HasSplit = 5
}
*/
DJ Normality
Posts: 647
Joined: Tue Jul 24, 2018 8:52 am

Re: Tokyo olympic 2020 .pac files

Post by DJ Normality »

Aluigi and Ekey both on this ? Man you got the A-Team Mishuk! :D :D :D