PDA

View Full Version : Question about patching in files using SFK


L33THAK0R
17-08-2021, 19:49
Hi all,

Sorry to flood this board with questions but I'm honestly a bit stumped. I'm using this version (https://mega.nz/file/Dy5wjDiZ#ga2qWGIumepoWTdIgR_oaJ66uIcLQhV1oWAz26V4C Xs) of SFK to try and patch back in some files (Bink) that bloat the final output unless packed separate to their data archives. My current patching command (for use in a batch script) looks like: sfk.exe partcopy INPUT_BINK 0 OUTPUT_ARCHIVE START_OFFSET -yes
However only a name less file, identical to the input bink video, with the start offset as its name, is produced. Although uneeded for my purposes, I tested extracting the file via SFK using: sfk.exe partcopy INPUT_ARCHIVE -fromto START_OFFSET END_OFFSET OUTPUT_BINK -yes

I made sure to use the decimal rather than hexadecimal for calculating the offsets, and extraction was successful, however patching this file back in seems to be nigh impossible.

:( Sad8669
17-08-2021, 21:58
1. Are you trying to extract binks to use bpk one them?


And also, the file won't patch back unless all the HEX was copied inside the MAIN file to a new FILE.

I will refer you to Masquerade's Explanation (https://fileforums.com/showpost.php?p=493261&postcount=2485).

The only change is that, if you want to patch back a file, you must select its HEX using Select Blocks and copy it into a NEW file (create a new file using HxD) and then save it. This way you will have a CRC perfect file and it also patchable.

NOTE : All of the above process must be done within the MAIN file.

Which game are you trying to compress, you can use QUICKBMS, if a script exist since its re-import function is convenient.

Make sure that the file doesn't have any streams because the file size will expand upon this method and re-patching is out of question in such cases, unless you are using QUICKBMS.

L33THAK0R
17-08-2021, 23:36
I will refer you to Masquerade's Explanation (https://fileforums.com/showpost.php?p=493261&postcount=2485)

Okay so first of all I'm a massive idiot! I've used the sfk method of patching data in & out a few times with RE2 & 3, and currently with the title I'm working on and Sekiro. Instead of copy pasting my script to a new batch file, I decided to write it out and forgot to include the -allfrom command, thankfully all seems to work, now I just have to run a few tests and all should be good! Thanks for linking me to "Masquerade"'s post, I wouldn't have noticed my error otherwise!