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

Reply
 
Thread Tools Display Modes
  #1  
Old 15-03-2022, 10:05
Masquerade's Avatar
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 1,155
Thanks: 284
Thanked 1,346 Times in 610 Posts
Masquerade is on a distinguished road
Solving the BinkPack Problem [+Oggre]

TL;DR - Stop using FreeArc!

I am sure you will agree that at some point you will have found a game which contains bink videos that BPK can compress, but you get a CRC check error or broken file crash when you try to extract your archive.

The issue with this is that BPK is slightly bugged in that it can extract the files it compresses, but a couple of bytes will be incorrect which causes the crash with FreeArc. FreeArc checks each file it extracts to ensure that the CRC is the same as the file that was compressed.

Since the file that BPK unpacks is different in some places, you can easily just patch the extracted bink video to the original video.

I will demonstrate with a video from Forza Horizon 5 - the issue with this video is that CLS-BPK.DLL will get stuck when decoding and endlessly output to the file. But, by using the EXE version of bpk and a little HDIFFZ magic, we can now avoid all the issues and have a significantly smaller repack.

This works for oggre too! Use the EXE versions of both and ignore the CLS.



*.BINKDIFF = HDiffZ patch between original bink and tmp extracted bink from bugged BPK

*.BK2 = original video.

*.BPK = packed video.

*.TMP = tmp extracted bink from bugged BPK
Reply With Quote
The Following 6 Users Say Thank You to Masquerade For This Useful Post:
:( Sad8669 (15-03-2022), Gehrman (01-09-2022), Junior53 (24-06-2023), L0v3craft (07-04-2022), prince55 (17-03-2022), ScOOt3r (15-03-2022)
Sponsored Links
  #2  
Old 15-03-2022, 10:27
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,363
Thanks: 1,076
Thanked 6,962 Times in 2,632 Posts
KaktoR is on a distinguished road
All binks I got so far were bpk bugs out keeps unpacking infinitely without any error message from arc.exe. Only installers telling me that something is wrong



But thanks anyway for this topic and especially for the information.
__________________
Haters gonna hate
Reply With Quote
  #3  
Old 15-03-2022, 10:33
Masquerade's Avatar
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 1,155
Thanks: 284
Thanked 1,346 Times in 610 Posts
Masquerade is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
...
Can you upload the file? I tested on such a video that would endlessly unpack in the example above.
Reply With Quote
  #4  
Old 15-03-2022, 10:46
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,363
Thanks: 1,076
Thanked 6,962 Times in 2,632 Posts
KaktoR is on a distinguished road
Oh well, I didn't read your tldr.. All is clear now
__________________
Haters gonna hate
Reply With Quote
  #5  
Old 16-03-2022, 16:15
L33THAK0R's Avatar
L33THAK0R L33THAK0R is offline
Registered User
 
Join Date: Feb 2021
Location: Saudi Arabia
Posts: 350
Thanks: 119
Thanked 58 Times in 37 Posts
L33THAK0R is on a distinguished road
Fascinating stuff, will definitely test this method out, got a couple dozen repacks I put on hold due to "Oggre" failing to properly decompress with FreeArc, fingers crossed I can finally finish em now!
Reply With Quote
  #6  
Old 19-03-2022, 06:48
78372 78372 is offline
Registered User
 
Join Date: Dec 2016
Location: Bangladesh
Posts: 650
Thanks: 772
Thanked 949 Times in 309 Posts
78372 is on a distinguished road
Can someone upload a small sample bik file that causes this error? Would like to test.
__________________
NOT AVAILABLE
Reply With Quote
  #7  
Old 19-03-2022, 07:03
:( Sad8669 :( Sad8669 is offline
Registered User
 
Join Date: Oct 2020
Location: -
Posts: 203
Thanks: 97
Thanked 187 Times in 101 Posts
:( Sad8669 is on a distinguished road
It's been a while.

Here

P.S : i asked KaktoR once, while i was looking into bink files, he sent me this sample.

Last edited by :( Sad8669; 19-03-2022 at 17:39.
Reply With Quote
  #8  
Old 19-03-2022, 11:40
kj911 kj911 is offline
Registered User
 
Join Date: Apr 2010
Location: world
Posts: 179
Thanks: 130
Thanked 61 Times in 42 Posts
kj911 is on a distinguished road
Tested the "Kro001_ExoIntro_Drop.bik" file compressed with use various CLS-BPK dll's (91.5/227/663kB size) again and again from decompressing.

unarc.exe: Get "failed CRC check" error message, not decompressing the BIK file from archive.
Arc.exe: Process not finished and still in 100% and infinitely looping decompress the BIK file, writing to again and again in whole time.

Screen: https://i.kek.sh/qtDtatG5oGo.png

Infinitely extracted "Kro001_ExoIntro_Drop.bik" file sample from analyze: https://pixeldrain.com/u/sJHwUPKB
Reply With Quote
  #9  
Old 19-03-2022, 12:24
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,363
Thanks: 1,076
Thanked 6,962 Times in 2,632 Posts
KaktoR is on a distinguished road
Don't use the cls.

Use bink_pack.exe and bink_unpack.exe
__________________
Haters gonna hate
Reply With Quote
  #10  
Old 04-09-2022, 23:49
kuyhaa's Avatar
kuyhaa kuyhaa is offline
Registered User
 
Join Date: Jun 2019
Location: metro
Posts: 54
Thanks: 79
Thanked 8 Times in 4 Posts
kuyhaa is on a distinguished road
i try this, but failed, what wrong with this ?

Reply With Quote
  #11  
Old 04-09-2022, 23:54
Hexagon123 Hexagon123 is offline
Registered User
 
Join Date: Dec 2016
Location: IOWA
Posts: 73
Thanks: 4
Thanked 45 Times in 26 Posts
Hexagon123 is on a distinguished road
Quote:
Originally Posted by kuyhaa View Post
i try this, but failed, what wrong with this ?

You did it wrong, hdiffz (insert temp file) (insert original file) (insert diff file), then hpatchz (insert temp file) (insert diff file) (insert new file)
Reply With Quote
The Following User Says Thank You to Hexagon123 For This Useful Post:
kuyhaa (05-09-2022)
  #12  
Old 05-09-2022, 00:59
kuyhaa's Avatar
kuyhaa kuyhaa is offline
Registered User
 
Join Date: Jun 2019
Location: metro
Posts: 54
Thanks: 79
Thanked 8 Times in 4 Posts
kuyhaa is on a distinguished road
Quote:
Originally Posted by Hexagon123 View Post
You did it wrong, hdiffz (insert temp file) (insert original file) (insert diff file), then hpatchz (insert temp file) (insert diff file) (insert new file)
yeah, thanks,

hpatchz and hdiffz (insert temp file) (insert original file) (insert diff file)
Reply With Quote
  #13  
Old 05-09-2022, 14:04
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,363
Thanks: 1,076
Thanked 6,962 Times in 2,632 Posts
KaktoR is on a distinguished road
Maybe something is not clear enough, here is a example batch.

PS: You can delete echo and pause commands. I just made them to show the steps

Code:
@echo off
echo. Compress bink files
for /r %%f in (*.bik) do bink_pack "%%f" "%%~df%%~pf%%~nf.bpk_compressed
pause

echo. Unpack compressed file
for /r %%f in (*.bpk_compressed) do bink_unpack "%%f" "%%~df%%~pf%%~nf.tmp_for_patch_creation"
pause

echo. Create diff from original vs unpacked file
for /r %%f in (*.tmp_for_patch_creation) do hdiffz "%%f" "%%~df%%~pf%%~nf.bik" "%%~df%%~pf%%~nf.BinkDIFF"
pause

echo. Delete unpacked files ("*.tmp_for_patch_creation") which were just extracted for patch creation purposes, you no longer need them
del /Q /F /S "*.tmp_for_patch_creation"
pause

echo. ------------------------------------------------------------
echo. On this point you should exclude all "*.bik" files or move them to a backup dir (you can use robocopy for ease)
echo. because you only need to pack "*.bpk_compressed" and "BinkDIFF" files.
echo. Now you have to pack your game files like you normally would
echo. ------------------------------------------------------------
echo.
echo. ------------------------------------------------------------
echo. After installing with Setup or similar, app folder should contain
echo. "*.bpk_compressed" and "*.BinkDIFF" files instead of original "*.bik* files
echo. ------------------------------------------------------------

echo. Unpack compressed to "*.bik_bad_crc"
for /r %%f in (*.bpk_compressed) do bink_unpack "%%f" "%%~df%%~pf%%~nf.bik_bad_crc"
pause

echo. Patch "*.bik_bad_crc" back to original with "*.BinkDIFF" files ("input_file"" input_diff" "output_file")
for /r %%f in (*.bik_bad_crc) do hpatchz.exe "%%~df%%~pf%%~nf.bik_bad_crc" "%%~df%%~pf%%~nf.BinkDIFF" "%%~df%%~pf%%~nf.bik_good_crc"
pause

echo. Rename all file extensions from "*.bik_good_crc" to "*.bik"
ren "*.bik_good_crc" "*.bik"
pause

echo. Remove all temp files
del /Q /F /S "*.bik_bad_crc"
del /Q /F /S "*.BinkDIFF"
del /Q /F /S "*.bpk_compressed"
del /S "hdiffz.exe"
del /S "hpatchz.exe"
pause
__________________
Haters gonna hate

Last edited by KaktoR; 05-09-2022 at 14:09.
Reply With Quote
The Following 5 Users Say Thank You to KaktoR For This Useful Post:
Gehrman (05-09-2022), kj911 (07-09-2022), kuyhaa (06-09-2022), Masquerade (05-09-2022), ScOOt3r (06-09-2022)
  #14  
Old 06-09-2022, 04:24
kuyhaa's Avatar
kuyhaa kuyhaa is offline
Registered User
 
Join Date: Jun 2019
Location: metro
Posts: 54
Thanks: 79
Thanked 8 Times in 4 Posts
kuyhaa is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
Maybe something is not clear enough, here is a example batch.

PS: You can delete echo and pause commands. I just made them to show the steps

Code:
@echo off
echo. Compress bink files
for /r %%f in (*.bik) do bink_pack "%%f" "%%~df%%~pf%%~nf.bpk_compressed
pause

echo. Unpack compressed file
for /r %%f in (*.bpk_compressed) do bink_unpack "%%f" "%%~df%%~pf%%~nf.tmp_for_patch_creation"
pause

echo. Create diff from original vs unpacked file
for /r %%f in (*.tmp_for_patch_creation) do hdiffz "%%f" "%%~df%%~pf%%~nf.bik" "%%~df%%~pf%%~nf.BinkDIFF"
pause

echo. Delete unpacked files ("*.tmp_for_patch_creation") which were just extracted for patch creation purposes, you no longer need them
del /Q /F /S "*.tmp_for_patch_creation"
pause

echo. ------------------------------------------------------------
echo. On this point you should exclude all "*.bik" files or move them to a backup dir (you can use robocopy for ease)
echo. because you only need to pack "*.bpk_compressed" and "BinkDIFF" files.
echo. Now you have to pack your game files like you normally would
echo. ------------------------------------------------------------
echo.
echo. ------------------------------------------------------------
echo. After installing with Setup or similar, app folder should contain
echo. "*.bpk_compressed" and "*.BinkDIFF" files instead of original "*.bik* files
echo. ------------------------------------------------------------

echo. Unpack compressed to "*.bik_bad_crc"
for /r %%f in (*.bpk_compressed) do bink_unpack "%%f" "%%~df%%~pf%%~nf.bik_bad_crc"
pause

echo. Patch "*.bik_bad_crc" back to original with "*.BinkDIFF" files ("input_file"" input_diff" "output_file")
for /r %%f in (*.bik_bad_crc) do hpatchz.exe "%%~df%%~pf%%~nf.bik_bad_crc" "%%~df%%~pf%%~nf.BinkDIFF" "%%~df%%~pf%%~nf.bik_good_crc"
pause

echo. Rename all file extensions from "*.bik_good_crc" to "*.bik"
ren "*.bik_good_crc" "*.bik"
pause

echo. Remove all temp files
del /Q /F /S "*.bik_bad_crc"
del /Q /F /S "*.BinkDIFF"
del /Q /F /S "*.bpk_compressed"
del /S "hdiffz.exe"
del /S "hpatchz.exe"
pause
help out, thanks kaktor
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
dvd playing problem... themis_t CD/DVD Software & Utilities 6 20-10-2004 13:44
Problem with Record Now Max ver 4.5 brkr101 PS2 Games 2 22-04-2004 21:40
problem with my xbox mrlucky XBox Games 1 11-01-2004 08:38
A problem about NFS Underground Gilvin PC Games 1 22-11-2003 21:17
Problem with pics on web pages and cookies EVOEvo CD/DVD-Writers 3 05-10-2003 17:57



All times are GMT -7. The time now is 21:20.


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