Unpacker
About hashes - I have pirated game version but is not working. Unfortunately I do not know which algorithm is used. In game library i found 2 hash function djb2 and sdbm but no good results. Who knows?
Important information: this site is currently scheduled to go offline indefinitely by end of the year.
Lords Of The Fallen (*.PKG)
-
- M-M-M-Monster veteran
- Posts: 1823
- Joined: Wed Mar 31, 2010 6:54 am
- Has thanked: 92 times
- Been thanked: 1058 times
Lords Of The Fallen (*.PKG)
You do not have the required permissions to view the files attached to this post.
My Github repo
-
- advanced
- Posts: 53
- Joined: Tue Oct 28, 2014 7:51 am
- Has thanked: 3 times
- Been thanked: 4 times
Re: Lords Of The Fallen (*.PKG)
That's cool, i was curious about LOTF since a while.
I also found Quick BMS script which does about the same as your tool but extracts .dat files from the PKG.
I hope someone will try and chew through file formats, because at the bottom game seems to use pretty straightforward formats, plus anything in patch folder will override packages, so modding is a real possibility here.
I also found Quick BMS script which does about the same as your tool but extracts .dat files from the PKG.
I hope someone will try and chew through file formats, because at the bottom game seems to use pretty straightforward formats, plus anything in patch folder will override packages, so modding is a real possibility here.
-
- M-M-M-Monster veteran
- Posts: 1823
- Joined: Wed Mar 31, 2010 6:54 am
- Has thanked: 92 times
- Been thanked: 1058 times
Re: Lords Of The Fallen (*.PKG)
My tool unpack the same files that QuickBMS, just without extensionsSkacikPL wrote:That's cool, i was curious about LOTF since a while.
I also found Quick BMS script which does about the same as your tool but extracts .dat files from the PKG.
I hope someone will try and chew through file formats, because at the bottom game seems to use pretty straightforward formats, plus anything in patch folder will override packages, so modding is a real possibility here.
My Github repo
-
- advanced
- Posts: 53
- Joined: Tue Oct 28, 2014 7:51 am
- Has thanked: 3 times
- Been thanked: 4 times
Re: Lords Of The Fallen (*.PKG)
Though, different question is whether there is a way to get what's inside unpacked files.Ekey wrote:My tool unpack the same files that QuickBMS, just without extensionsSkacikPL wrote:That's cool, i was curious about LOTF since a while.
I also found Quick BMS script which does about the same as your tool but extracts .dat files from the PKG.
I hope someone will try and chew through file formats, because at the bottom game seems to use pretty straightforward formats, plus anything in patch folder will override packages, so modding is a real possibility here.
-
- advanced
- Posts: 43
- Joined: Thu May 19, 2016 11:23 pm
- Location: Italy
- Has thanked: 9 times
- Been thanked: 5 times
Re: Lords Of The Fallen (*.PKG)
Nothing new?
I'd still like to fix some Italian texts in this game. There's no need of repacker: you can just put files in "patch\" but they won't work if you alter just a single byte!
The problem is understanding that number block in blue:
From a comparision between the French.bin and Italian.bin (see msg here with attachments) the first block is the same: FC89C5A3, next 4 bytes change between languages… If we understand that we should be able to edit the text and use it in the game simply putting the modified .bin under "...\Lords Of The Fallen\bundles\patch", skipping the unnecessary repack process.
I'd still like to fix some Italian texts in this game. There's no need of repacker: you can just put files in "patch\" but they won't work if you alter just a single byte!
The problem is understanding that number block in blue:
From a comparision between the French.bin and Italian.bin (see msg here with attachments) the first block is the same: FC89C5A3, next 4 bytes change between languages… If we understand that we should be able to edit the text and use it in the game simply putting the modified .bin under "...\Lords Of The Fallen\bundles\patch", skipping the unnecessary repack process.
-
- advanced
- Posts: 43
- Joined: Thu May 19, 2016 11:23 pm
- Location: Italy
- Has thanked: 9 times
- Been thanked: 5 times
Re: Lords Of The Fallen (*.PKG)
You have PMmerlinsvk wrote:Can you upload/send me your modified .bin file? I don't have the game, so I can't test my script for recalculating the hash.
-
- advanced
- Posts: 43
- Joined: Thu May 19, 2016 11:23 pm
- Location: Italy
- Has thanked: 9 times
- Been thanked: 5 times
Re: Lords Of The Fallen (*.PKG)
Attached some .bin files (original, unmodified). If you need more language files tell me...
https://nofile.io/f/aS3AAYoZTva/languages_bin.7z
https://nofile.io/f/aS3AAYoZTva/languages_bin.7z
-
- ultra-veteran
- Posts: 411
- Joined: Mon Oct 27, 2008 12:11 am
- Location: Slovakia
- Has thanked: 35 times
- Been thanked: 121 times
Re: Lords Of The Fallen (*.PKG)
Code: Select all
#------------------------------------------------
# Lords Of The Fallen language *.bin CRC fixer
# Script version: 0.2
#------------------------------------------------
idstring "\xFC\x89\xC5\xA3" # just a test if the input file is a supported .bin file
encryption crc 0x01800063 "32 0 0 19 1 1"
get SIZE asize
xmath TXTSIZE "SIZE - 0x18" # 0x18 = size of header
log MEMORY_FILE 0x18 TXTSIZE # 0x18 = start of the data block
encryption "" ""
get NAME basename
get EXT extension
string NAME p= "%s.%s_FIXED" NAME EXT
get SIZE asize
log MEMORY_FILE2 0 SIZE # create copy of file into RAM
putVarChr MEMORY_FILE2 0x04 QUICKBMS_CRC long # write new CRC value on position 0x04
putVarChr MEMORY_FILE2 0x14 TXTSIZE long # write text block size
log NAME 0 SIZE MEMORY_FILE2 # write new file on disk
Last edited by merlinsvk on Wed Oct 10, 2018 4:47 pm, edited 1 time in total.
-
- advanced
- Posts: 43
- Joined: Thu May 19, 2016 11:23 pm
- Location: Italy
- Has thanked: 9 times
- Been thanked: 5 times
Re: Lords Of The Fallen (*.PKG)
merlinsvk wrote:Use this script on language .bin file. It will create new file with "_FIXED" extension.Code: Select all
#------------------------------------------------ # Lords Of The Fallen language *.bin CRC fixer #------------------------------------------------ idstring "\xFC\x89\xC5\xA3" # just a test if the input file is a supported .bin file encryption crc 0x01800063 "32 0 0 19 1 1" get SIZE asize math SIZE - 0x18 # 0x18 = size of header log MEMORY_FILE 0x18 SIZE # 0x18 = start of the data block encryption "" "" get NAME basename get EXT extension string NAME p= "%s.%s_FIXED" NAME EXT get SIZE asize log MEMORY_FILE2 0 SIZE # create copy of file into RAM putVarChr MEMORY_FILE2 0x04 QUICKBMS_CRC long # write new CRC value on position 0x04 log NAME 0 SIZE MEMORY_FILE2 # write new file on disk
Rename it and put the fixed file into \patch folder.
It does work!
It seems I can finally be able to fix broken Italian text!
Thank you very much!
Can I ask one more thing? As you can see in the picture above with hex-editor starting from byte 18->end is reported (red square in the pic) the size of the whole text block in reverse order. Could you automate also that part and improve the script?
-
- ultra-veteran
- Posts: 411
- Joined: Mon Oct 27, 2008 12:11 am
- Location: Slovakia
- Has thanked: 35 times
- Been thanked: 121 times
Re: Lords Of The Fallen (*.PKG)
And how do you want to edit this text? By hand in hex editor?
EDIT: There has to be something else (a mean some length check or another hash) because, when I make single string bigger, recalculate the length of that string, recalculate text block size and CRC, some strings in the game are missing.
EDIT: There has to be something else (a mean some length check or another hash) because, when I make single string bigger, recalculate the length of that string, recalculate text block size and CRC, some strings in the game are missing.
-
- advanced
- Posts: 43
- Joined: Thu May 19, 2016 11:23 pm
- Location: Italy
- Has thanked: 9 times
- Been thanked: 5 times
Re: Lords Of The Fallen (*.PKG)
Indeed there are more string checks:
The red square byte (0x98) defines the length of the string…
BUT, there is still a problem: if I make it shorter (e.g. 95), and I turn 98->95 it still won't work, unless I replace extra bytes (since I shortened the string) with 0x00 keeping file structure (and length) intact
Maybe we have to respect some bytes alignment when we extend/shorten strings.
The red square byte (0x98) defines the length of the string…
BUT, there is still a problem: if I make it shorter (e.g. 95), and I turn 98->95 it still won't work, unless I replace extra bytes (since I shortened the string) with 0x00 keeping file structure (and length) intact
Maybe we have to respect some bytes alignment when we extend/shorten strings.
-
- ultra-veteran
- Posts: 411
- Joined: Mon Oct 27, 2008 12:11 am
- Location: Slovakia
- Has thanked: 35 times
- Been thanked: 121 times
Re: Lords Of The Fallen (*.PKG)
Yes, exactly. That's padding. When I added one NULL byte after my test string, all missing text was back.Maybe we have to respect some bytes alignment when we extend/shorten strings.
But that means, you will need proper tool to recalculate all paddings and lengths. Or it will be nightmare to do it all manually.
-
- advanced
- Posts: 43
- Joined: Thu May 19, 2016 11:23 pm
- Location: Italy
- Has thanked: 9 times
- Been thanked: 5 times
Re: Lords Of The Fallen (*.PKG)
Indeed it works as I supposed.merlinsvk wrote:Yes, exactly. That's padding. When I added one NULL byte after my test string, all missing text was back.Maybe we have to respect some bytes alignment when we extend/shorten strings.
But that means, you will need proper tool to recalculate all paddings and lengths. Or it will be nightmare to do it all manually.
When I manually "pad" them (thanks for the term, didn't know how to call it ) I can safely change strings length, as explained in the picture below.
E.g.:
I can extend/shrink the text in the cyan rectangle (even colliding the red rectangle) but then I must always add this padding at the end: 0x00000000 80000000 respecting 4bytes+4bytes and, in case, adjusting with null bytes the string length.
Yep, would be great if your script would automagically do:
- recalculate final block length (written in reverse order into the bin)
- add padding correction
- recalculate strings length (the byte before the string itself)
EDIT: there is also the padding variant 0x00000001 80000000 used after dialogue strings...
Last edited by hexaae on Wed Oct 10, 2018 8:17 am, edited 6 times in total.