Gildor's Forums

Author Topic: [UE3] Lost Ark  (Read 80732 times)
d07riv
Newbie
*
Posts: 5


View Profile
Re: Lost Ark
« Reply #195 on: October 07, 2023, 18:06 »

Is there any way to extract texture atlas information? As in, coordinates and names of individual icons.

Also any way to select what I actually want to export? I unchecked everything but textures but its still exporting tons of other stuff like materials.
« Last Edit: October 07, 2023, 22:02 by d07riv » Logged
Shane
Newbie
*
Posts: 1


View Profile
Re: Lost Ark
« Reply #196 on: October 22, 2023, 10:12 »

Guys, do you know if there is any way to change the game font? for example, arial. If possible, would I need to extract a UPK file?
Logged
vandaa95
Newbie
*
Posts: 19


View Profile
Re: Lost Ark
« Reply #197 on: October 31, 2023, 03:05 »

I am looking for this kind of armors. Can anyone please tell me what .upk are those? Thank you!
https://i.imgur.com/m8HVEf0.png
Logged
d07riv
Newbie
*
Posts: 5


View Profile
Re: Lost Ark
« Reply #198 on: November 15, 2023, 17:02 »

Guys, do you know if there is any way to change the game font? for example, arial. If possible, would I need to extract a UPK file?


Fonts are in LPK files. Fairly sure you can replace them safely, if you follow the same format (it works for replacing .db files for translation purposes).
Logged
spiritovod
Global Moderator
Hero Member
*****
Posts: 2219


View Profile
Re: Lost Ark
« Reply #199 on: November 15, 2023, 20:53 »

I forgot to mention that updated script for lpk files supports proper decryption of databases - as it turned out, the adjustment was required all this time. The script is available in this topic, just look for "other scripts for UE games". It's recommended to use quickbms with -Q argument to significantly speed up the process (it will just disable output logs).
« Last Edit: November 15, 2023, 20:56 by spiritovod » Logged
mutsa
Guest
Re: Lost Ark
« Reply #200 on: November 20, 2023, 08:37 »

The lpk files updated after the 5th anniversary patch of the KR server do not seem to work properly You know about this?
For your information, I think it's because aes and blowfish changed
« Last Edit: November 20, 2023, 08:44 by mutsa » Logged
d07riv
Newbie
*
Posts: 5


View Profile
Re: Lost Ark
« Reply #201 on: November 20, 2023, 17:48 »

Anyone knows where class icons are? I used class_symbol_0 before but they have a gradient/glow on them (I assume there must be a mask version somewhere) and there's no Souleater even after the update.
Logged
d07riv
Newbie
*
Posts: 5


View Profile
Re: Lost Ark
« Reply #202 on: November 20, 2023, 18:06 »

I forgot to mention that updated script for lpk files supports proper decryption of databases - as it turned out, the adjustment was required all this time. The script is available in this topic, just look for "other scripts for UE games". It's recommended to use quickbms with -Q argument to significantly speed up the process (it will just disable output logs).

Does the script actually work? It didn't work for me before (over a year ago) and other people said they got malformed db files as well. I think it was trying to decrypt the whole db at once, instead of resetting IV after every 1024 bytes.

I'm using this JS script instead: https://pastebin.com/BZkk8DFD (it's only unpacking db files because I had some trouble getting zlib to work properly; I think blowfish library needs an older version because the latest one is ESM only).
« Last Edit: November 20, 2023, 18:12 by d07riv » Logged
spiritovod
Global Moderator
Hero Member
*****
Posts: 2219


View Profile
Re: Lost Ark
« Reply #203 on: November 21, 2023, 17:33 »

@mutsa: Korean and chinese versions are region locked and hardly accessible from outside. Unless someone will provide dumped binary from that updated version (here or via PM), I can't do anything.

@d07riv: Yes, quickbms script is doing the same thing now. Anyway, both original scheme and this update were submitted by other people, I've only created implementation for it.
Logged
Icos
Newbie
*
Posts: 12


View Profile
Re: Lost Ark
« Reply #204 on: December 01, 2023, 00:04 »

@spiritovod after recent updates to KR client special build of umodel crashes on some packages with LZ4 error. Probably format of the data was changed. Could you please update the tool?
Logged
Xanathar
Newbie
*
Posts: 2


View Profile
Re: Lost Ark
« Reply #205 on: December 01, 2023, 05:19 »

@mutsa: Korean and chinese versions are region locked and hardly accessible from outside. Unless someone will provide dumped binary from that updated version (here or via PM), I can't do anything.

d07riv: Yes, quickbms script is doing the same thing now. Anyway, both original scheme and this update were submitted by other people, I've only created implementation for it.

@spiritovod
@d07riv

I'm having trouble unpacking the content of the lpk(db files) is the script working with latest Steam version? what I'm doing wrong?

Steps:
1- run: LAUTool_steam.exe -d data2.lpk data2.lpk.dec
command output the message: Done!
so I guess this work

2- run: quickbms.exe lpk_extract_v6.bms data2.lpk.dec folderName
this one fails with the error:

https://imgur.com/a/kRRrOAQ

Logged
Xanathar
Newbie
*
Posts: 2


View Profile
Re: Lost Ark
« Reply #206 on: December 01, 2023, 19:24 »

Thank you for your hard work!
I have managed to extract database files by using Quickbms script only.

However, some files are corrupted (not working) and don't open with SQL db viewers.
I get this error: An error occurred: file is not a database.
95% of files unpacked correctly, Except some large ones.

Code:
EFTable_Item.db - size: 80M
EFTable_SkillEffect.db - size: 42M
EFTable_ItemGradeOptionStatic.db
EFTable_TownNpcDress.db
EFTable_ItemAssemblyNpc.db

if anyone is interested I found Eshter weapon upgrade models in this table: EFTable_ItemEvolutionAppearance.db

1100000   10123   EFDLItem_WP_WWHK_TF01_01.WP_WWHK_TF01_01   HK_Item
1100001   10123   EFDLItem_WP_WWHK_TF01_01.WP_WWHK_TF01_01   HK_Item
1100002   10123   EFDLItem_WP_WWHK_TF01_03.WP_WWHK_TF01_03   HK_Item
1100003   10123   EFDLItem_WP_WWHK_TF01_03.WP_WWHK_TF01_03   HK_Item
1100004   10123   EFDLItem_WP_WWHK_TF01_04.WP_WWHK_TF01_04   HK_Item
1100005   10123   EFDLItem_WP_WWHK_TF01_04.WP_WWHK_TF01_04   HK_Item
1100006   10123   EFDLItem_WP_WWHK_TF01_06.WP_WWHK_TF01_06   HK_Item
1100007   10123   EFDLItem_WP_WWHK_TF01_06.WP_WWHK_TF01_06   HK_Item
1100008   10123   EFDLItem_WP_WWHK_TF01_09.WP_WWHK_TF01_09   HK_Item
Logged
molenzwiebel
Newbie
*
Posts: 2


View Profile
Re: Lost Ark
« Reply #207 on: December 02, 2023, 19:45 »

Spent some time diving into the code to figure out the name obfuscation algorithm. The description from @sylvester334 helped a ton with this, but also cheers to smilegate for leaving the appropriately named FFileManagerWindows::ObfuscateFilename symbol in the EFGame DLL Wink

In short, the names are shifted around by a fixed amount based on the length of the string. Certain characters are first escaped before they are obfuscated, using a pair of characters based on the position % 4 inside the input string. The following table is used for that purpose:

Code:
TABLE = {
    "Q": ["QP", "QD", "QW", "Q4"],
    "-": ["QL", "QB", "QO", "Q5"],
    "_": ["QC", "QN", "QT", "Q9"],
    "X": ["XU", "XN", "XH", "X3"],
    "!": ["XW", "XS", "XZ", "X0"],
}

If Q, -, _, X or ! appear in the input string, they will be replaced by one of these based on the position in the string, % 4. In other words, if the 3rd character (idx = 2) is a _, it will be replaced by QT (since 2 % 4 == 2, TABLE['_'][2] == "QT").

Some examples:

Code:
LV_LUT_Commander_Valtan_Extreme becomes LVQTLUTQ9COMMANDERQTVALTANQTEXNTREME
LV_ELG_Kayangel_ED_01_H         becomes LVQTELGQ9KAYANGELQNEDQN01QNH
SGintro_Warning                 becomes SGINTROQ9WARNING

Afterwards, the ascii values will be rotated according to a simple caesar cipher, where rotation is offset by the length of the escaped string. This works for all strings longer than 20 characters.

For inputs shorter than 20 characters, the input will be padded by adding a `!` and several `.`s until 20 characters are reached. This string is then escaped. The obfuscation loop then overwrites the period characters with earlier emitted characters, roughly according to the following pseudocode:

Code:
if input[i + unpadded_length] == '.' {
  input[i + unpadded_length] = output[i]
}

For deobfuscation of filenames, you simply reverse the shift, undo the escaping (by checking every pair of characters, seeing if they are in the table and the position % 4 matches the expected substitution, and then replacing the pair with the original character), and possibly split by ! if the original input was padded.

Here's an implementation in Rust capable of replicating both obfuscation and deobfuscation, matching 1-to-1 with the values produced by the game: https://gist.github.com/molenzwiebel/284318d9e963672b239f9fca901be89a. The result after renaming is pretty good!



* umodel_lostark_v5_eelxwXoQbp.png (46.25 KB, 1106x638 - viewed 467 times.)
Logged
mutsa
Guest
Re: Lost Ark
« Reply #208 on: December 03, 2023, 10:45 »

For deobfuscation of filenames, you simply reverse the shift, undo the escaping (by checking every pair of characters, seeing if they are in the table and the position % 4 matches the expected substitution, and then replacing the pair with the original character), and possibly split by ! if the original input was padded.

Here's an implementation in Rust capable of replicating both obfuscation and deobfuscation, matching 1-to-1 with the values produced by the game: https://gist.github.com/molenzwiebel/284318d9e963672b239f9fca901be89a. The result after renaming is pretty good!

Oh, Thanks to you, I can deobfuscation everything and watch it neatly. That's cool
Logged
spiritovod
Global Moderator
Hero Member
*****
Posts: 2219


View Profile
Re: Lost Ark
« Reply #209 on: December 04, 2023, 04:04 »

@Icos: Nobody has provided samples with non-working packages so far.

@molenzwiebel: Thank you for the explanation and solution for proper packages renaming. I've added reference for your post to base post on the first page.

@All others: Unfortunately implementing renaming into umodel itself wouldn't be effective for various reasons, and it's better to rename packages externally. Also about lpk in the updated korean client - apparently they've changed keys placement there and further research may take a while. I'll better wait until this change is rolled out to other regions (supposedly around January for NA version) to continue research on easily accessible client. Meanwhile, please don't clutter up the topic with related to that issues.
« Last Edit: December 04, 2023, 04:06 by spiritovod » Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS