Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Display Modes
  #1  
Old 26-08-2021, 02:27
L33THAK0R's Avatar
L33THAK0R L33THAK0R is offline
Registered User
 
Join Date: Feb 2021
Location: Saudi Arabia
Posts: 344
Thanks: 117
Thanked 57 Times in 37 Posts
L33THAK0R is on a distinguished road
Question about automating generation of start & end file offsets for stored archives

Hi all,

While the subject matter doesn't really relate to this sub-forum, its applications do. I'm asking it here, rather than somewhere like "Stack Overflow", since there are individuals here who have some experience with the manual component of this process, and I don't have anything to contribute, as partial work on a given subject matter is required/strongly encouraged within the submitted inquiry.

Some archives like the ".PCK" sound containers (which can be found in titles such as "A Plague Tale: Innocence) store their containing files uncompressed, and sequentially (based off of initial comparison of the archives hex-code and extracted files, extracted from the container), as well as "Metro 2033" & "Metro: Last Light"s, ".vfs0" archives (using the same methodology).

Currently, while extraction is supported, to my knowledge, tools for repackaging these file-types are not publicly available. While it is possible to manually calculate these offsets, such a process would be incredibly time consuming, as some of these archives have upwards of 1000+ files (ranging from as small as a few hundred kilobytes to a few megabytes).

While this is a long shot, does anyone know of any tool suite capable of being fed a series of files as an input, grabbing the first and last 20 or so offsets (for example), then search through a secondary input (the "main" archive) for the location (if present) of the start and end offsets, then record this to a separate file, such as a simple text document?

If such a tool suite doesn't exist, I'll likely start looking into developing my own tool for it, as I have a strong feeling I'll be dealing with this type of modification a fair bit in my future releases.

Last edited by L33THAK0R; 26-08-2021 at 02:29. Reason: simplified bits and bobs, general editing.
Reply With Quote
Sponsored Links
  #2  
Old 26-08-2021, 07:55
panker1992's Avatar
panker1992 panker1992 is offline
Registered User
 
Join Date: Oct 2015
Location: Always Somewhere
Posts: 539
Thanks: 113
Thanked 763 Times in 299 Posts
panker1992 is on a distinguished road
Quote:
Originally Posted by L33THAK0R View Post
Hi all,

While the subject matter doesn't really relate to this sub-forum, its applications do. I'm asking it here, rather than somewhere like "Stack Overflow", since there are individuals here who have some experience with the manual component of this process, and I don't have anything to contribute, as partial work on a given subject matter is required/strongly encouraged within the submitted inquiry.

Some archives like the ".PCK" sound containers (which can be found in titles such as "A Plague Tale: Innocence) store their containing files uncompressed, and sequentially (based off of initial comparison of the archives hex-code and extracted files, extracted from the container), as well as "Metro 2033" & "Metro: Last Light"s, ".vfs0" archives (using the same methodology).

Currently, while extraction is supported, to my knowledge, tools for repackaging these file-types are not publicly available. While it is possible to manually calculate these offsets, such a process would be incredibly time consuming, as some of these archives have upwards of 1000+ files (ranging from as small as a few hundred kilobytes to a few megabytes).

While this is a long shot, does anyone know of any tool suite capable of being fed a series of files as an input, grabbing the first and last 20 or so offsets (for example), then search through a secondary input (the "main" archive) for the location (if present) of the start and end offsets, then record this to a separate file, such as a simple text document?

If such a tool suite doesn't exist, I'll likely start looking into developing my own tool for it, as I have a strong feeling I'll be dealing with this type of modification a fair bit in my future releases.
Here is how to extract PCK files


quickbms -d -Y pck_to_wem.bms data.pck

quickbms -w -r pck_to_wem.bms data.pck data.pck_extracted

Second one is how to import back in
Attached Files
File Type: zip pck_to_wem.zip (688 Bytes, 36 views)
__________________
My projects : Masked Compression, lzma2(xz) on Freearc, Zstd compressor for windows
My optimizations : packjpg.exe, zstd, lzham, precomp-dev-0.45.

Last edited by panker1992; 26-08-2021 at 07:57.
Reply With Quote
  #3  
Old 26-08-2021, 09:06
L33THAK0R's Avatar
L33THAK0R L33THAK0R is offline
Registered User
 
Join Date: Feb 2021
Location: Saudi Arabia
Posts: 344
Thanks: 117
Thanked 57 Times in 37 Posts
L33THAK0R is on a distinguished road
Quote:
Originally Posted by panker1992 View Post
Here is how to extract PCK files


quickbms -d -Y pck_to_wem.bms data.pck

quickbms -w -r pck_to_wem.bms data.pck data.pck_extracted

Second one is how to import back in
Ah sick, cheers for this, I'll get to testing this with "A Plague Tale: Innocence" right away! Should testing be successful, this'll make separating localised audio as an optional offering to the end-user possible!

I'm still quite interested in the inquiry to the existence of a tool/suite, mentioned in the original post, as should one not exist I'll get straight to work developing one!
Reply With Quote
  #4  
Old 30-08-2021, 15:21
panker1992's Avatar
panker1992 panker1992 is offline
Registered User
 
Join Date: Oct 2015
Location: Always Somewhere
Posts: 539
Thanks: 113
Thanked 763 Times in 299 Posts
panker1992 is on a distinguished road
My repack size of the game which is one of my favourites of course

9.15GB final size
__________________
My projects : Masked Compression, lzma2(xz) on Freearc, Zstd compressor for windows
My optimizations : packjpg.exe, zstd, lzham, precomp-dev-0.45.
Reply With Quote
  #5  
Old 31-10-2022, 01:47
Dragonis40 Dragonis40 is offline
Registered User
 
Join Date: Mar 2021
Location: italy
Posts: 58
Thanks: 0
Thanked 2 Times in 2 Posts
Dragonis40 is on a distinguished road
Quote:
Originally Posted by panker1992 View Post
Here is how to extract PCK files


quickbms -d -Y pck_to_wem.bms data.pck

quickbms -w -r pck_to_wem.bms data.pck data.pck_extracted

Second one is how to import back in
Good morning, how can I use this instructions for videogame repacking? I mean, to reimport files into .pck file, I need the original one. I think it's better to create a new .pck file without the original one, otherwise it's useless in terms of installation videogame.
So, starting from the extracted files from .pck file, how can I "reduild" a new .pck file without the original one?
Reply With Quote
  #6  
Old 31-10-2022, 02:14
Masquerade's Avatar
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 1,111
Thanks: 284
Thanked 1,305 Times in 593 Posts
Masquerade is on a distinguished road
Quote:
Originally Posted by Dragonis40 View Post
Good morning, how can I use this instructions for videogame repacking? I mean, to reimport files into .pck file, I need the original one. I think it's better to create a new .pck file without the original one, otherwise it's useless in terms of installation videogame.
So, starting from the extracted files from .pck file, how can I "reduild" a new .pck file without the original one?
PCK archives don't use compression, so what you can do is the following:

- use Bincat by Aluigi to concatenate the output wems into one large file

- use hdiffz to make a patch between the original PCK and the concatenated data

Then, in your repack installation, concatenate the wems with bincat and apply the patch you made with hpatchz to restore the original PCK.
Reply With Quote
  #7  
Old 31-10-2022, 02:33
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,230
Thanks: 1,069
Thanked 6,807 Times in 2,561 Posts
KaktoR is on a distinguished road
Another solution:

Use xtool erase and decode functions to restore original files back into modified pck archive.
__________________
Haters gonna hate
Reply With Quote
The Following User Says Thank You to KaktoR For This Useful Post:
Masquerade (31-10-2022)
  #8  
Old 01-11-2022, 23:18
Dragonis40 Dragonis40 is offline
Registered User
 
Join Date: Mar 2021
Location: italy
Posts: 58
Thanks: 0
Thanked 2 Times in 2 Posts
Dragonis40 is on a distinguished road
Quote:
Originally Posted by Masquerade View Post
PCK archives don't use compression, so what you can do is the following:

- use Bincat by Aluigi to concatenate the output wems into one large file

- use hdiffz to make a patch between the original PCK and the concatenated data

Then, in your repack installation, concatenate the wems with bincat and apply the patch you made with hpatchz to restore the original PCK.
Thank you for your reply! Once all .pck files have been decompressed with quickbms, the output files are: .wav, .bnk, .dat files and no .wem files.
So how can I correctly use Bincat and hdiffz procedure?
Reply With Quote
  #9  
Old 02-11-2022, 00:06
Masquerade's Avatar
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 1,111
Thanks: 284
Thanked 1,305 Times in 593 Posts
Masquerade is on a distinguished road
Quote:
Originally Posted by Dragonis40 View Post
the output files are: .wav, .bnk, .dat files and no .wem files.
So how can I correctly use Bincat and hdiffz procedure?
No need to worry about the different file types, just make sure all of the extracted files are in the same folder. Then, in cmd do:

Code:
bincat extracted_data\* new.pck
hdiffz-x64 new.pck old.pck patch.diffz
To apply the patch in your repack installation, do:

Code:
bincat extracted_data\* new.pck
hpatchz-x64 new.pck patch.diffz old.pck
Reply With Quote
The Following User Says Thank You to Masquerade For This Useful Post:
Guravkov2010 (02-11-2022)
  #10  
Old 03-11-2022, 13:00
Dragonis40 Dragonis40 is offline
Registered User
 
Join Date: Mar 2021
Location: italy
Posts: 58
Thanks: 0
Thanked 2 Times in 2 Posts
Dragonis40 is on a distinguished road
Quote:
Originally Posted by Masquerade View Post
No need to worry about the different file types, just make sure all of the extracted files are in the same folder. Then, in cmd do:

Code:
bincat extracted_data\* new.pck
hdiffz-x64 new.pck old.pck patch.diffz
To apply the patch in your repack installation, do:

Code:
bincat extracted_data\* new.pck
hpatchz-x64 new.pck patch.diffz old.pck
Hello! I've done what you suggested me, but I can see no improvement at all in terms of file compression. The resulting files from hpatchz have exactly the same size of original .pck file. So, what' the advantage?
Reply With Quote
  #11  
Old 06-11-2022, 02:23
Dragonis40 Dragonis40 is offline
Registered User
 
Join Date: Mar 2021
Location: italy
Posts: 58
Thanks: 0
Thanked 2 Times in 2 Posts
Dragonis40 is on a distinguished road
Quote:
Originally Posted by Dragonis40 View Post
Hello! I've done what you suggested me, but I can see no improvement at all in terms of file compression. The resulting files from hpatchz have exactly the same size of original .pck file. So, what' the advantage?
Hello everybody! what I don't understand is how to correctly compress these pck files. I'm talking about "A Plague Tale: Requiem". There's a file called "VO_MEDIA.PC.PCK"; using WWise.bms and quickbms, I can extract all files inside and they are, of course, .wem files. Then, I've tried to compress them using WemTool.exe, but the resulting compression is very poor. So, I've used bincat.exe to create a concatenated file with all .wem files and hdiffz-x64.exe to create a patch between the original PCK and the concatenated data.
Which file do I have to use in my repack? Only patch.diffz file? I don't think so, because, in order to create the original "VO_MEDIA.PC.PCK" file, I need patch.diffz file and .wem file or the file create by bincat.exe. So I increase the final .bin file, instead of reducing it. So, how can I do?
Reply With Quote
  #12  
Old 06-11-2022, 03:11
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,230
Thanks: 1,069
Thanked 6,807 Times in 2,561 Posts
KaktoR is on a distinguished road
You have to include modified PCK file + the patch file obviously to restore back to original file.
__________________
Haters gonna hate
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cd burner help snatchcrash CD/DVD-Writers 1 14-09-2002 04:32
air force delta snake DC Games 0 15-04-2001 04:34
air force delta snake DC Games 1 13-04-2001 20:04
HELP ME PLZ!!!! Dalvin DC Games 0 02-01-2001 22:15
HELP ME PLZ!!!! Dalvin DC Games 0 02-01-2001 22:14



All times are GMT -7. The time now is 23:13.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright 2000-2020, FileForums @ https://fileforums.com