Welcome to symthic forums! We would love if you'd register!
You don't have to be expert in bit baking, everyone is more than welcome to join our community.

You are not logged in.

  • "Frankelstner" started this thread

Posts: 103

Date of registration
: Feb 19th 2012

Platform: PC

Reputation modifier: 5

  • Send private message

1

Sunday, September 23rd 2012, 10:34pm

pack archives

Python 2.7 as usual: http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi
Place the code as *.py in the same folder as the pack files. Start the script and it should create everything in a folder named "assets". Some flash animations, lots of dds textures. And some jpg orcs and elves.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
##file is in big endian
##
##a pack file has several parts which are all identical in structure.
##there is no global header. not even magic
##
##
##START OF ONE PACK FILE PART
##
##metadata section (0x2000 bytes):
##	uint32: absolute offset for the next part of the pack file (end of current part)
##		if last pack part: 00000000
##	uint32: number of entries
##
##	strings prefixed with uint32 length, no trailing zero!
##	3 uint32 after the string
##		1 absolute offset (this can be in another pack part)
##		2 length
##		3 crc32 of the payload
##		
##	padding so the section has 0x2000 bytes
##
##
##payload section (trivial)

from struct import unpack,pack
import sys
import os

def ps2int(num):
    intstr=str(num)
    if len(intstr)==1:   return "00"+intstr
    elif len(intstr)==2: return"0"+intstr
    else:                return intstr
    
class entry:
    pass

root=sys.path[0]+"\\"
inputfolder=root
targetfolder=root+"assets"+"\\"

ij=0
while 1:
    partSize=1 #anything non-zero to make a do-while
    entrylist=[]
    fname=inputfolder+"Assets_"+ps2int(ij)+".pack"
    if not os.path.exists(fname): break
    f=open(fname,"rb")
    print fname
    while partSize:
        partSize=unpack(">I",f.read(4))[0]
        numEntries=unpack(">I",f.read(4))[0]
        for i in xrange(numEntries):
            ent=entry()
            stringlen=unpack(">I",f.read(4))[0]
            ent.name=f.read(stringlen)
            ent.offset,ent.size,ent.crc32=unpack(">III",f.read(12))
            entrylist.append(ent)

        end=entrylist[-1].offset+entrylist[-1].size
        f.seek(partSize)

    for ent in entrylist:
        extension = os.path.splitext(ent.name)[1][1:]
        f.seek(ent.offset)
        targetfolder2=targetfolder+extension+"\\"
        if not os.path.isdir(targetfolder2): os.makedirs(targetfolder2)
        f2=open(targetfolder2+ent.name,"wb")
        f2.write(f.read(ent.size))
        f2.close()
        
    f.close()
    ij+=1

This post has been edited 6 times, last edit by "Frankelstner" (Nov 2nd 2012, 11:41pm)


ViperFTW

Suidae cathexis

(1,304)

Posts: 6,764

Date of registration
: Jul 1st 2012

Platform: PC

Location: Newcastle upon Tyne, United Kingdom (He's from The North!)

Reputation modifier: 14

  • Send private message

2

Sunday, September 23rd 2012, 10:40pm

Fascinating...Not really, what's this for? :D

Everyone's Favourite Useless Support and LMG Fan :thumbsup:



Steam - Battlefield 3 M60 Guide! - Youtube
Psst! Wanna hear a good song? Words of Farewell - Riven

  • "Frankelstner" started this thread

Posts: 103

Date of registration
: Feb 19th 2012

Platform: PC

Reputation modifier: 5

  • Send private message

3

Sunday, September 23rd 2012, 10:51pm

It's a pack archive extractor.

ViperFTW

Suidae cathexis

(1,304)

Posts: 6,764

Date of registration
: Jul 1st 2012

Platform: PC

Location: Newcastle upon Tyne, United Kingdom (He's from The North!)

Reputation modifier: 14

  • Send private message

4

Sunday, September 23rd 2012, 11:51pm

Hahahaha! I'm flattered that you think I'd know what that meant :D

Everyone's Favourite Useless Support and LMG Fan :thumbsup:



Steam - Battlefield 3 M60 Guide! - Youtube
Psst! Wanna hear a good song? Words of Farewell - Riven

  • "Frankelstner" started this thread

Posts: 103

Date of registration
: Feb 19th 2012

Platform: PC

Reputation modifier: 5

  • Send private message

5

Monday, September 24th 2012, 12:31am

Well, just compare it to zip files. When you open up zip files you usually want to extract the files inside. In the same way pack archives contain many files, but the pack file format is specific to this game so the users need to write their own extractors.

Sym

Head Administrator

(1,555)

Posts: 962

Date of registration
: Nov 29th 2011

Platform: PC

Location: Finland

Reputation modifier: 9

  • Send private message

6

Monday, September 24th 2012, 10:41am

So for those who don't have any idea what this is:

It extracts Planetside 2's .pack archive-files that contain information about weapons, vehicles, and pretty much everything in the game.
This is the thing that makes those files read-able, otherwise they're just unreadable messy data.

Anyways, really impressive and awesome work Frankelstner :thumbup:
BF3: Objective per minute: World top 1%

Dice

50 Shades of Dice

(751)

Posts: 3,046

Date of registration
: Dec 12th 2011

Platform: PC

Location: Auraxis.

Reputation modifier: 9

  • Send private message

7

Monday, September 24th 2012, 3:22pm

At this point they are messy and useless to normal people. I would love to see them decoded. Can you do a step by step on how to decode?

ViperFTW

Suidae cathexis

(1,304)

Posts: 6,764

Date of registration
: Jul 1st 2012

Platform: PC

Location: Newcastle upon Tyne, United Kingdom (He's from The North!)

Reputation modifier: 14

  • Send private message

8

Monday, September 24th 2012, 4:56pm

So for those who don't have any idea what this is:

It extracts Planetside 2's .pack archive-files that contain information about weapons, vehicles, and pretty much everything in the game.
This is the thing that makes those files read-able, otherwise they're just unreadable messy data.


Ah awesome! :)

Everyone's Favourite Useless Support and LMG Fan :thumbsup:



Steam - Battlefield 3 M60 Guide! - Youtube
Psst! Wanna hear a good song? Words of Farewell - Riven

Sym

Head Administrator

(1,555)

Posts: 962

Date of registration
: Nov 29th 2011

Platform: PC

Location: Finland

Reputation modifier: 9

  • Send private message

9

Monday, September 24th 2012, 5:46pm

At this point they are messy and useless to normal people. I would love to see them decoded. Can you do a step by step on how to decode?
- Install python.
- Go to ps2 folder where the packs are
- Make a new textfile called anything.py
- Open the .py in notepad, copy that code there and save
- Open the .py file by double clicking it
- Wait

Done
BF3: Objective per minute: World top 1%

Posts: 761

Date of registration
: Jun 28th 2012

Platform: PC

Location: Finland

Reputation modifier: 3

  • Send private message

10

Monday, September 24th 2012, 6:29pm

Sym, do you already have the weapon files?