-
Notifications
You must be signed in to change notification settings - Fork 5
Container Files
Phil edited this page Dec 29, 2018
·
2 revisions
using ShenmueDKSharp.Files.Containers;
public void ExtractAFS(string afsFilepath, string folder)
{
AFS afs = new AFS(afsFilepath);
afs.Unpack(folder);
}
public void ExtractAFSWithIDX(string afsFilepath, string idxFilepath, string folder)
{
AFS afs = new AFS(afsFilepath);
IDX idx = new IDX(idxFilepath);
afs.MapIDXFile(idx);
afs.Unpack(folder);
}
public void PackAFS(string afsFilepath, List<string> filepaths)
{
AFS afs = new AFS();
afs.Pack(filepaths);
afs.Write(afsFilepath);
}
public void ExtractGZ(string gzFilepath, string folder)
{
GZ gz = new GZ(gzFilepath);
gz.Unpack(folder);
}
public void PackGZ(string gzFilepath, string filepath)
{
GZ gz = new GZ();
gz.Pack(filepath);
gz.Write(gzFilepath);
}
public void ExtractIPAC(string ipacFilepath, string folder)
{
IPAC ipac= new IPAC(ipacFilepath);
ipac.Unpack(folder);
}
public void PackIPAC(string ipacFilepath, List<string> filepaths)
{
IPAC ipac = new IPAC();
ipac.Pack(filepaths);
ipac.Write(gzFilepath);
}
public void ExtractPKF(string pkfFilepath, string folder)
{
PKF pkf = new PKF(pkfFilepath);
pkf.Unpack(folder);
}
public void PackPKF(string pkfFilepath, List<string> filepaths)
{
PKF pkf = new PKF();
pkf.Pack(filepaths);
pkf.Write(pkfFilepath);
}
public void ExtractPKS(string pksFilepath, string folder)
{
PKS pks = new PKS(pksFilepath);
pks.Unpack(folder);
}
public void PackPKS(string pksFilepath, List<string> filepaths)
{
PKS pks = new PKS();
pks.Pack(filepaths);
pks.Write(pksFilepath);
}
public void ExtractSPR(string sprFilepath, string folder)
{
SPR spr = new SPR(sprFilepath);
spr.Unpack(folder);
}
public void PackSPR(string sprFilepath, List<string> filepaths)
{
SPR spr = new SPR();
spr.Pack(filepaths);
spr.Write(sprFilepath);
}
public void ExtractTAC(string tadFilepath, string tacFilepath, string folder)
{
TAD tad = new TAD(tadFilepath);
tad.Unpack(tacFilepath, folder);
}
public void PackTAC(string tadFilepath, string tacFilepath, List<TADEntry> entries)
{
TAD tad = new TAD();
tad.Pack(tacFilepath, entries);
tad.Write(tadFilepath);
}
public void ExtractFile(string tadFilepath, string searchFile, string outputFile)
{
TAD tad = new TAD(tadFilepath);
TAC tac = new TAC(tad);
byte[] fileBuffer = tac.GetFileBuffer(searchFile);
using(FileStream stream = new FileStream(outputFile, FileMode.Create))
{
stream.Write(fileBuffer, 0, fileBuffer.Length);
}
}