[PC] Lost Ark : .Upk / .lpk

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
shiroyan
Posts: 1
Joined: Wed Mar 09, 2022 4:07 am

Re: [PC] Lost Ark : .Upk / .lpk

Post by shiroyan »

spiritovod wrote:Here is script for unpacking lpk files from steam (default option) and ru versions of the game. Credits to Brouznouf for algorithm.

Update: Script is updated to properly decrypt databases from lpk files. All issues should be resolved in "fix" update.


thx for the script. i have extracted the font.lpk file successfully. have anyway to repack the files to .lpk file ?

@spiritovod
Last edited by shiroyan on Mon Mar 14, 2022 3:22 am, edited 1 time in total.
ide
Posts: 1
Joined: Thu Mar 10, 2022 11:13 am

Re: [PC] Lost Ark : .Upk / .lpk

Post by ide »

Do you guys know how to read the .loa files like this too?

Image
namvail1234
Posts: 1
Joined: Mon Mar 21, 2022 8:35 pm

Re: [PC] Lost Ark : .Upk / .lpk

Post by namvail1234 »

brekkez wrote:
spiritovod wrote:@brekkez: To simplify things, there are only 3 versions of the game at the moment: steam (regardless of the region), korean and russian. And most tools/scripts are divided accordingly. If you mean the script above, it's compatible with both steam (by default) and ru versions - to switch between them you simply need to edit bms script in any text editor according to included comments.

It worked!. It’s so hard to find the model I’m looking for lmao. I managed to find a costume and a head. I’m still trying to find the missing textures .

Image

how could you find the right model? do you have any tip?
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: [PC] Lost Ark : .Upk / .lpk

Post by spiritovod »

@Htto: Here are databases from july 2019 client, probably first OBT (link). Though they seem exactly the same as current ones, which is quite expected, since most schemes didn't change since then.

@ide: loa files are simple names table, which can be serialized as proper xml/json - in general they are string lengths + strings and additional fields to build data tree from them (like structure -> members -> values).

@ to all other people asking about repacking or anything: I have no plans for the game or its formats. Most things were done thanks to other people and updated lpk script is just a side effect of digging into stuff, required for implementing game support into umodel, that's all.
s2006004
Posts: 3
Joined: Wed May 27, 2020 9:15 am

Re: [PC] Lost Ark : .Upk / .lpk

Post by s2006004 »

shiroyan wrote:
spiritovod wrote:Here is script for unpacking lpk files from steam (default option) and ru versions of the game. Credits to Brouznouf for algorithm.

Update: Script is updated to properly decrypt databases from lpk files. All issues should be resolved in "fix" update.


thx for the script. i have extracted the font.lpk file successfully. have anyway to repack the files to .lpk file ?

@spiritovod


I have the same problem as you. Is the encryption key different from the decryption key? Thanks.
artesprosoul
Posts: 3
Joined: Wed Apr 06, 2022 8:54 am

Re: [PC] Lost Ark : .Upk / .lpk

Post by artesprosoul »

Hello everyone!
I'm looking for a way to take language files from RU client and move them to Steam client (adding or changing any of the Steam client languages to RU).
Is there a way?
I think it's easy to do such thing to voice files, but as for the text - I just don't know what files contains language text data.
Any advice?
prixone
Posts: 12
Joined: Sun Mar 25, 2018 7:24 pm

Re: [PC] Lost Ark : .Upk / .lpk

Post by prixone »

is there an update to the LAUTool for the NA version? thanks
s2006004
Posts: 3
Joined: Wed May 27, 2020 9:15 am

Re: [PC] Lost Ark : .Upk / .lpk

Post by s2006004 »

artesprosoul wrote:Hello everyone!
I'm looking for a way to take language files from RU client and move them to Steam client (adding or changing any of the Steam client languages to RU).
Is there a way?
I think it's easy to do such thing to voice files, but as for the text - I just don't know what files contains language text data.
Any advice?


The text seem stored in EFGame_Extra\ClientData\TableData\EFTable_GameMsg.db, you can check it by notepad.

extracted from simplified chinese patch:
Image

and I am still seeking a way to pack back to the .lpk.
Zsno
Posts: 1
Joined: Sat Apr 09, 2022 3:23 pm

Re: [PC] Lost Ark : .Upk / .lpk

Post by Zsno »

Hello, I'm trying to get esther skill animations locked in .ipk files. how do I open these?
artesprosoul
Posts: 3
Joined: Wed Apr 06, 2022 8:54 am

Re: [PC] Lost Ark : .Upk / .lpk

Post by artesprosoul »

s2006004 wrote:
The text seem stored in EFGame_Extra\ClientData\TableData\EFTable_GameMsg.db, you can check it by notepad.


There's no such directory as EFGame_Extra in Steam client. Only EFGame.
s2006004
Posts: 3
Joined: Wed May 27, 2020 9:15 am

Re: [PC] Lost Ark : .Upk / .lpk

Post by s2006004 »

artesprosoul wrote:
s2006004 wrote:
The text seem stored in EFGame_Extra\ClientData\TableData\EFTable_GameMsg.db, you can check it by notepad.


There's no such directory as EFGame_Extra in Steam client. Only EFGame.


you have to decrypt the lpk file.
you can find the method on page 7 in this post.

elegos wrote:Hello!

I'm new to game client hacking and I'm a little confused.

What I want to achieve: extract bitmaps (skills, maps etc), data info (skill names and props, item names and props, mob names etc) from the Lost Ark game
What I've done so far: I've downloaded and unarchived QuickBMS, downloaded the bms file on page 6 and tried the following command:

Code: Select all

.\quickbms.exe .\scripts\lpk_extract_v2_fix.bms 'C:\Program Files (x86)\Steam\steamapps\common\Lost Ark\EFGame\ReleasePC\Packages' "C:\LostArk_packages"

The result:

Code: Select all

QuickBMS generic files extractor and reimporter 0.11.0
by Luigi Auriemma
e-mail: me@aluigi.org
web:    aluigi.org
        (Apr  5 2021 - 13:56:34)

                          quickbms.com  Homepage
                            zenhax.com  ZenHAX Forum
                     @zenhax @quickbms  Twitter & Scripts

- start the scanning of the input folder: C:\Program Files (x86)\Steam\steamapps\common\Lost Ark\EFGame\ReleasePC\Packages
- open input file C:\Program Files (x86)\Steam\steamapps\common\Lost Ark\EFGame\ReleasePC\Packages\.\07F8Q0K8X0JS8DCXQ6WK8XX0CM5JYDYE40.upk
- open script .\scripts\lpk_extract_v2_fix.bms
- set output folder C:\LostArk_packages
- the folder doesn't exist, do you want to create it (y/N)?:
  y

  offset   filesize   filename
--------------------------------------

Error: incomplete input file 0: C:\Program Files (x86)\Steam\steamapps\common\Lost Ark\EFGame\ReleasePC\Packages\07F8Q0K8X0JS8DCXQ6WK8XX0CM5JYDYE40.upk
       Can't read 934261218 bytes from offset 00000c32.
       Anyway don't worry, it's possible that the BMS script has been written
       to exit in this way if it's reached the end of the archive so check it
       or contact its author or verify that all the files have been extracted.
       Please check the following coverage information to know if it's ok.

  coverage file 0   100%   3122       3122       . offset 00000c32

Last script line before the error or that produced the error:
  15  log MEMORY_FILE 4 SIZE

- OFFSET       0x00000004
- SIZE         0x37afbe10
  coverage file 0   100%   3122       3122       . offset 00000c32


What am I doing wrong? I saw someone suggesting to use umodel, but isn't it a tool to view 3d models?

Thanks :)

EDIT: actually I just manually selected all the lpk files and it worked fine. Now the question is: how to read the db files? According to the header it's a standard SQLite3 file, but with 16 reserved bytes at each page, which means they're using some kind of extension (not excluded an encrypting one). Also there are no bitmaps, but "loa" and "epf" files. Do you have any clue on what they are?
artesprosoul
Posts: 3
Joined: Wed Apr 06, 2022 8:54 am

Re: [PC] Lost Ark : .Upk / .lpk

Post by artesprosoul »

s2006004 wrote:
you have to decrypt the lpk file.
you can find the method on page 7 in this post.


Oh, so it's impossible to just copy and paste encrypted language packages from RU client to Steam client due to different encryption method or something?
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: [PC] Lost Ark : .Upk / .lpk

Post by spiritovod »

@artesprosoul: Yes, steam version and versions for other regions (ru, kr, jp) are using different encryption keys, even though the scheme is the same. In the same time, I suppose decrypted databases are cross-compatible between different versions, because tools like LaoTranslation are doing exactly that.

========================================

Here is test script for packing files into lpk.
Edit: Script and notes are moved to the original post: viewtopic.php?f=9&t=2969&p=69954#p69954
Last edited by spiritovod on Mon Apr 25, 2022 4:05 pm, edited 2 times in total.
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: [PC] Lost Ark : .Upk / .lpk

Post by spiritovod »

Updated script for repacking lpk is added to the original post: viewtopic.php?f=9&t=2969&p=69954#p69954

Read notes in that post for more info.
Last edited by spiritovod on Mon Apr 25, 2022 4:05 pm, edited 1 time in total.
a652311
Posts: 2
Joined: Sat Feb 19, 2022 7:26 am

Re: [PC] Lost Ark : .Upk / .lpk

Post by a652311 »

spiritovod wrote:Updated script for repacking lpk is added to the original post: viewtopic.php?f=9&t=2969&p=69954#p69954

Read notes in that post for more info. It's still not tested with actual game though.


Thank you for your big work:), but for me, repack bms v1 and v2 not working. I using ru version.

update: Sorry, I am a rookie for this, it should be i don't have aligned to 0x100 for database.

Also, I trying to decrypt the EFTable_GameMsg.db, Someone can give me some advice or hints?
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: [PC] Lost Ark : .Upk / .lpk

Post by spiritovod »

Just tested the updated repacking script on ru client - simple re-import of unmodified files works fine and modified archive doesn't break or corrupt the game, which means script is producing compatible archives. The rest depends on particular files, for example, databases seems to have internal integrity checks.

It's highly recommended to always import into original archive to avoid possible issues with re-re-import stuff - though it's fine if you're importing different files each time.
JonnyPhaminator
Posts: 2
Joined: Thu Apr 28, 2022 5:30 pm

Re: [PC] Lost Ark : .Upk / .lpk

Post by JonnyPhaminator »

Does anyone know how to extract the BNK files? I want to be able to extract voice files from the Beserker class and i can't find a proper extractor that extracts these files...
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: [PC] Lost Ark : .Upk / .lpk

Post by spiritovod »

@JonnyPhaminator: You need latest LAUTool from page 6, decrypted files should be playable with latest foobar+vgmstream.
Supamiu
Posts: 1
Joined: Sun May 08, 2022 3:53 pm

Re: [PC] Lost Ark : .Upk / .lpk

Post by Supamiu »

Hi there, thanks to the amazing scripts you provided, I managed to extract the .db files but they are encrypted with an unknown SQLite3 plugin, did anyone manage to decrypt them or find the plugin/key combination?

I kind of expect it to be in the exe somewhere, but that's about it :/
prixone
Posts: 12
Joined: Sun Mar 25, 2018 7:24 pm

Re: [PC] Lost Ark : .Upk / .lpk

Post by prixone »

Would some one be so kind to help me out extracting the steam files for Lost Ark?

I have used LAUTool to decrypt the files, no error were shown, I placed all the dec files in a separated folder than I tried running the lpk_extract_v2_fix.bms and I still get this error:

Code: Select all

Error: incomplete input file 0: decrypted\07F8Q0K8X0JS8DCXQ6WK8XX0CM5JYDYE40.upk.dec
       Can't read 641769814 bytes from offset 00000c2e.
       Anyway don't worry, it's possible that the BMS script has been written
       to exit in this way if it's reached the end of the archive so check it
       or contact its author or verify that all the files have been extracted.
       Please check the following coverage information to know if it's ok.


What am I missing here to extract the files or if u could provide a step by step I would appreciate, thanks.