Lords Of The Fallen .pkg unpack/repack

How to translate the files of a game
ISKA
Posts: 223
Joined: Mon Apr 09, 2018 11:09 pm

Lords Of The Fallen .pkg unpack/repack

Post by ISKA »

Hello everyone.I want to translate lotf
How can I unpack and repack
I unpacked english.bin with LoFPKGUnpacker but I don't have edit tools
Can anyone help me ?
Files: http://www.mediafire.com/file/kqzuwceik ... syalar.rar
Last edited by ISKA on Sat Sep 22, 2018 12:13 am, edited 2 times in total.
DryreL
Posts: 1
Joined: Wed May 30, 2018 2:56 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by DryreL »

Hello, I want to translate this game too. I'm Turkish translator. I unpacked english.bin with LoFPKGUnpacker too. Just like you, I don't have edit tools. Please someone help.
ISKA
Posts: 223
Joined: Mon Apr 09, 2018 11:09 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by ISKA »

up
Delutto
Posts: 561
Joined: Tue Oct 13, 2015 1:26 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by Delutto »

ISKA wrote:up
First: Link dead.
Second: Whats the point in edit localization files if there's no PKG repacker?!?
ISKA
Posts: 223
Joined: Mon Apr 09, 2018 11:09 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by ISKA »

Delutto wrote:
ISKA wrote:up
First: Link dead.
Second: Whats the point in edit localization files if there's no PKG repacker?!?

Here
http://www.mediafire.com/file/kqzuwceik ... syalar.rar
Yes now just unpack.Tools doesnt work import
Delutto
Posts: 561
Joined: Tue Oct 13, 2015 1:26 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by Delutto »

ISKA wrote:Yes now just unpack.Tools doesnt work import
Here some tips for newbies on game mod/translation:

First off all, you need find were are located the resources that you want to mod. For texts, use some "Find in files" text search and point to game root folder, search for some game text, but something simple like "NEW GAME". HEX Editor have this feature, even Notepad++ have this. For textures, you can use that same text search, searching for the resource Magic(e.g. DDS, search for "DDS " text), or try some file ripper focused on game resources, like the HyperRipper from Dragon UnPACKer or similar.

If that resources are packed inside some main package/big file, you'll need a tool/script to unpack those resources from your main package. For recents games, Zenhax is your best choice, but use the forum search before open a new topic asking for help. For older games, maybe you'll have more lucky on Xentax. There's a good chance that package allready cover by some quickbms script, so use the quickbms search: http://aluigi.altervista.org/quickbms.htm#search. And of course, Google it!
Note about quickbms reimport: There's NO guarantees that all script works for reimport, its depends of the file structure and how the script was coded. And reimport doesn't support checksums(not sure).

OK, you was able to extract those resource from main package, the next step is make sure that tool/script have import/repack/pack/compile feature, once you probably need do this for your mod/translation be readed by game. Once you extracted the resources try reimnport the untouched original resources back and check if the game works. If works, next step is mod just ONE resource, reimport and check ingame again.Be ware that reimport solution could not support moded files bigger than original, so try mod a file keeping your original size or smaller. With texts, use the original charset.

If reimport doesn't works, STOP RIGHT THERE!!! There's a good chance that never will be a solution for this(reimport is too much more complex), and you will not waste your time(and the time of those trying helping you) with something that will be useless.

You can ask for help with this kind of incomplete solution, but do this on the same place you found the unpacker/extraction solution.

So ISKA, don't get me wrong, I'm trying to help you, it's the 3th time that I see you asking for help for a game that still not have repack solution. If you read the entire discution about this pkg files, you'll see that both aluigi and Ekey (two experts) worked on this format and still have no repack solution.
I appreciate your determination, but sometimes we need move on.
GHOST DEAD
Posts: 218
Joined: Wed Jul 19, 2017 5:04 am

Re: Lords Of The Fallen .pkg unpack/repack

Post by GHOST DEAD »

lords_of_the_fallen.bms
log MEMORY_FILE CHUNK_OFF CHUNK_ZSIZE

Script Using Chunk To Get files (Export/Import)
As i know... chunk files can't be ReImport in QuickBMS (As i Know)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by aluigi »

Reimporting here is not possible due to:
  • MEMORY_FILEs, necessary for guessing the extension of the nameless filenames
  • chunks, well not a real problem because it should work correctly moreover here where the offset is not sequential
  • lz4 compression because it's a headerless algorithm without terminator bit and so the game will get an error when decompressing the chunk/file
So even if I remove the MEMORY_FILE you will still have problems with lz4 and you will get files without extension.
GHOST DEAD
Posts: 218
Joined: Wed Jul 19, 2017 5:04 am

Re: Lords Of The Fallen .pkg unpack/repack

Post by GHOST DEAD »

aluigi wrote:Reimporting here is not possible due to:
  • MEMORY_FILEs, necessary for guessing the extension of the nameless filenames
  • chunks, well not a real problem because it should work correctly moreover here where the offset is not sequential
  • lz4 compression because it's a headerless algorithm without terminator bit and so the game will get an error when decompressing the chunk/file
So even if I remove the MEMORY_FILE you will still have problems with lz4 and you will get files without extension.


What About putarray 0 x CHUNK_OFF?
Can you Tell Me about that ( If you have time, becuase i dont want to waste your Time)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by aluigi »

That instruction simply puts a field read from the file in an array (an ordered location of the memory) for using it later.
Hexaae
Posts: 61
Joined: Sat Mar 04, 2017 10:37 am

Re: Lords Of The Fallen .pkg unpack/repack

Post by Hexaae »

Maybe my msg was ignored some time ago, but… you don't need to "repack it". If you put the english.bin under "...\Lords Of The Fallen\bundles\patch" it works.
The problem is that there's a sort of checksum in the header of file and you can't change even a single byte...
Last edited by Hexaae on Mon Sep 24, 2018 7:53 am, edited 1 time in total.
ISKA
Posts: 223
Joined: Mon Apr 09, 2018 11:09 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by ISKA »

Hexaae wrote:Maybe my msg was ignored some time ago, but… you don't need to "repack it". If you put the english.bin under "...\Lords Of The Fallen\bundles\patch" it works.
The problem is that there's a sort of checksum in the header of file and you can't change even a single byte...

Maybe this is impossible. Whatever never mind :)
Hexaae
Posts: 61
Joined: Sat Mar 04, 2017 10:37 am

Re: Lords Of The Fallen .pkg unpack/repack

Post by Hexaae »

Well… the only problem is understanding that number block in blue:
Image
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.
Hexaae
Posts: 61
Joined: Sat Mar 04, 2017 10:37 am

Re: Lords Of The Fallen .pkg unpack/repack

Post by Hexaae »

After all this time, a solution has been finally found thanks to merlinsvk on XaNTaX: http://forum.xentax.com/viewtopic.php?f=10&t=12173

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

Now we need someone to compile an automated script to:
  • extract strings to a text file
  • add padding correction after strings (0x00000000 80000000 and 0x00000001 80000000 for dialogues + null bytes adjustment for shortened/extended text)
  • recalculate strings length (the 2 bytes in front of each string)
Last edited by Hexaae on Wed Oct 17, 2018 10:29 pm, edited 1 time in total.
Delutto
Posts: 561
Joined: Tue Oct 13, 2015 1:26 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by Delutto »

I'll take a look when got free time.
Delutto
Posts: 561
Joined: Tue Oct 13, 2015 1:26 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by Delutto »

Lords of the Fallen BIN Text Tool
By Delutto
See Readme.txt for instructions.
Lords_of_the_Fallen_BIN_Text_Tool_By_Delutto.7z
InKviZ
Posts: 124
Joined: Fri Oct 24, 2014 2:55 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by InKviZ »

Thanks Merlinsvk and Delutto For your help. Everything works great.
ISKA
Posts: 223
Joined: Mon Apr 09, 2018 11:09 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by ISKA »

Delutto wrote:Lords of the Fallen BIN Text Tool
By Delutto
See Readme.txt for instructions.Lords_of_the_Fallen_BIN_Text_Tool_By_Delutto.7z

It's worked me. Thank you Delutto. You are the best.
Delutto
Posts: 561
Joined: Tue Oct 13, 2015 1:26 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by Delutto »

InKviZ wrote:Thanks Merlinsvk and Delutto For your help. Everything works great.
Just a note: I don't mentioned but my tool update the CRC, so there's no need to use the CRC fixer script, the generated file is ready to use on game.
Alhyprn
Posts: 11
Joined: Fri Apr 27, 2018 9:11 pm

Re: Lords Of The Fallen .pkg unpack/repack

Post by Alhyprn »

Delutto wrote:
InKviZ wrote:Thanks Merlinsvk and Delutto For your help. Everything works great.
Just a note: I don't mentioned but my tool update the CRC, so there's no need to use the CRC fixer script, the generated file is ready to use on game.


Hello, Delutto. How can i repack unpacked .rpg files?
I tried QuickBms scripts but not working.