Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Offical Crackdown 2 Thread

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
KIWIDOGGIE
n00b
Posts: 14
Joined: Mon Jul 27, 2009 6:33 pm
Been thanked: 4 times

Offical Crackdown 2 Thread

Post by KIWIDOGGIE »

Since Crackdown 2 has so many darn formats, why create 50 threads for each one.

Here is what I have done so far.

PACK Files - They also contain the RIFX format which seems to be nothing but junk if you ask me...

Code: Select all

        public struct Entry
        {
            public uint Offset;
            public uint Size;
            public uint Unknown;
        }
        public struct PackHeader
        {
            public string Magic; // PACK
            public byte[] Unknown; // Len16
            public uint numEntires; // Maybe NumberEntries - 1
            public byte[] Unknown2; // Len12
            public List<Entry> Entries;
        }
Here is my source code

Code: Select all

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.IO;
using EndianIO;
using System.Text;

namespace SoundExtractor
{
    class PackFile
    {
        public struct Entry
        {
            public uint Offset;
            public uint Size;
            public uint Unknown;
        }
        public struct PackHeader
        {
            public string Magic; // PACK
            public byte[] Unknown; // Len16
            public uint numEntires; // Maybe NumberEntries - 1
            public byte[] Unknown2; // Len12
            public List<Entry> Entries;
        }
        PackHeader head;
        EndianReader toc; // TOC file
        BinaryReader br; // PACK file
        public void Load(string _toc, string _br, ListView lst)
        {
            toc = new EndianReader(new FileStream(_toc, FileMode.Open, FileAccess.Read), EndianType.BigEndian);
            br = new BinaryReader(new FileStream(_br, FileMode.Open, FileAccess.Read));
            head = new PackHeader();
            head.Entries = new List<Entry>();
            lst.Items.Clear();
            head.Magic = toc.ReadAsciiString(4);
            if (head.Magic == "PACK")
            {
                head.Unknown = toc.ReadBytes(16);
                head.numEntires = toc.ReadUInt32();
                head.Unknown2 = toc.ReadBytes(12);
                for (uint i = 0; i < head.numEntires - 1; i++)
                {
                    Entry temp = new Entry();
                    temp.Offset = toc.ReadUInt32();
                    temp.Size = toc.ReadUInt32();
                    temp.Unknown = toc.ReadUInt32();
                    ListViewItem lvi = new ListViewItem();
                    lvi.Text = "PACK[" + i + "].raw";
                    lvi.SubItems.Add(temp.Size.ToString());
                    lst.Items.Add(lvi);
                    head.Entries.Add(temp);
                }
            }
            toc.Close();
            MessageBox.Show("Done");
        }

        public void Extract(string FileName, int Index)
        {
            BinaryWriter bw = new BinaryWriter(new FileStream(FileName, FileMode.Create, FileAccess.Write));
            br.BaseStream.Position = head.Entries[Index].Offset;
            bw.Write(br.ReadBytes((int)head.Entries[Index].Size));
            bw.Close();
            MessageBox.Show("Done");
        }
    }
}
EDIT: The above code only extracts the SOUND/AUDIO 'PACK' Files. This updated structure will give you extraction for all other pack files.

Code: Select all

  struct Packpher
        {
            public string Magic; // PACK
            public byte[] Unknown; // Len8
            public uint numEntries;
            public byte[] Unknown1; // Len16
            public List<Entry> Entries;
        }

        struct Entry
        {
            public uint FileNameLen;
            public uint FileOffset;
            public uint FileLength;
            public int Unknown; // 0xDEDE
        }
My Program
You do not have the required permissions to view the files attached to this post.
GXavs
ultra-n00b
Posts: 6
Joined: Fri Feb 19, 2010 11:19 am
Has thanked: 1 time

Re: Offical Crackdown 2 Thread

Post by GXavs »

The program seems to work, but what can I do with the files to play/convert them? I would really like to get the audio clips of the voice of the Agency talking.

Also, the program you have up for download doesn't seem to be the updated version that extracts non-audio files.
KIWIDOGGIE
n00b
Posts: 14
Joined: Mon Jul 27, 2009 6:33 pm
Been thanked: 4 times

Re: Offical Crackdown 2 Thread

Post by KIWIDOGGIE »

You need to recompile the source to use the second Pack header I posted. For some reason Crackdown 2 uses a ton of files.
GXavs
ultra-n00b
Posts: 6
Joined: Fri Feb 19, 2010 11:19 am
Has thanked: 1 time

Re: Offical Crackdown 2 Thread

Post by GXavs »

No idea how to play/convert the audio files then?
Everything I tried just gave me static.
OrangeC
double-veteran
double-veteran
Posts: 868
Joined: Sun Apr 20, 2008 2:58 am
Has thanked: 5 times
Been thanked: 41 times

Re: Offical Crackdown 2 Thread

Post by OrangeC »

its because its XMA.
twisted
veteran
Posts: 100
Joined: Mon Apr 23, 2007 11:25 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Offical Crackdown 2 Thread

Post by twisted »

could you include the source files as im getting a few errors compiling this and i dont have the UI, thanks.
KIWIDOGGIE
n00b
Posts: 14
Joined: Mon Jul 27, 2009 6:33 pm
Been thanked: 4 times

Re: Offical Crackdown 2 Thread

Post by KIWIDOGGIE »

Source
You do not have the required permissions to view the files attached to this post.
JORD4N
ultra-n00b
Posts: 1
Joined: Fri Apr 27, 2012 3:24 am

Re: Offical Crackdown 2 Thread

Post by JORD4N »

Any updates on this ? for all the files. so i can edit them
Post Reply