ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sat Jul 24, 2021 1:21 am

All times are UTC




Post new topic  Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Wed May 20, 2015 8:36 pm 

Joined: Sun Jan 18, 2015 11:22 pm
Posts: 36
using the fact that part of the localization is not encrypted, I compare some lines. took as a basis the Spanish localization, here are a couple of lines from it:
Code:
Armadura temeria
Botas temerias

the English version of these lines are encrypted and look like this (hex):
Code:
0DEF D7DE 09BD B27A CFF5 13EB 95D6 99AD CE5B 9EB7 D76F 1FDF 9BBE AD7D
0DEF D7DE 09BD B27A CFF5 13EB 95D6 99AD CE5B 9DB7 CA6F 1DDF 80BE AC7D


I assumed that in the translation it should look like "Temerian armor" and "Temerian boots". hex view of UTF-16LE:
Code:
0DEF D7DE 09BD B27A CFF5 13EB 95D6 99AD  CE5B  9EB7 D76F 1FDF 9BBE AD7D
5400 6500 6D00 6500 7200 6900 6100 6E00  2000  6100 7200 6D00 6F00 7200
T    e    m    e    r    i    a    n     " "   a    r    m    o    r

0DEF D7DE 09BD B27A CFF5 13EB 95D6 99AD  CE5B  9DB7 CA6F 1DDF 80BE AC7D
5400 6500 6D00 6500 7200 6900 6100 6E00  2000  6200 6F00 6F00 7400 7300
T    e    m    e    r    i    a    n     " "   b    o    o    t    s


is clearly not a direct replacement character by (xor) or (shift), as the same characters in one string are represented by different codes. have any ideas?


Top
   
PostPosted: Sat May 23, 2015 3:55 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 12321
It looks like a XOR with a long sequence of bytes but I don't know if it's a fixed "key" or is continuously generated byte-per-byte (like increment key + byte ^ key).


Top
   
PostPosted: Sat May 23, 2015 8:46 am 

Joined: Tue May 19, 2015 8:20 pm
Posts: 13
I waiting open tool editor tool and replace tool, for this files... Because this game have very hard language and We need it translate for game...


Top
   
PostPosted: Sat May 23, 2015 10:52 am 

Joined: Sat May 16, 2015 11:58 pm
Posts: 47
I absolutely agree with the SLaYeR983. And I want to translate this game...


Top
   
PostPosted: Sat May 23, 2015 11:44 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 12321
Just for curiosity, can you upload the english and spanish w3string?


Top
   
PostPosted: Sat May 23, 2015 12:37 pm 

Joined: Sat May 16, 2015 11:58 pm
Posts: 47
aluigi wrote:
Just for curiosity, can you upload the english and spanish w3string?


of course.
https://yadi.sk/d/nJBAMaCagp7yH


Top
   
PostPosted: Sat May 23, 2015 5:03 pm 

Joined: Sun Jan 18, 2015 11:22 pm
Posts: 36
br-en-esMX from dlc (they are very small): https://mega.co.nz/#!WlgxRJxY!DNcs0lWJf ... U8cWlxuqLM


Top
   
PostPosted: Mon May 25, 2015 7:28 am 

Joined: Tue May 19, 2015 8:20 pm
Posts: 13
Is there any improvement?


Top
   
PostPosted: Mon May 25, 2015 12:10 pm 

Joined: Sun Jan 18, 2015 11:22 pm
Posts: 36
so, decoding strings were similar as in the Witcher 2.
Code:
string_key = magic >> 8 & 0xffff
for (i = 0; i < strings_count; i += 2) {
    char_key = ((string_len + 1) * string_key) & 0xffff
    string_buffer[i+0] ^= ((char_key >> 0) & 0xff)
    string_buffer[i+1] ^= ((char_key >> 8) & 0xff)
    string_key = ((string_key << 1 ) | (string_key >> 15)) && 0xffff
}


Lua implementation is here. test output:
Code:
>lua inspect_w3strings.lua DLC1\content\en.w3strings . debug
magic: 0x43975139 -> 0x79321793
block 1, count = 11     132 bytes
block 2, count = 11     88 bytes
block 3, count = 331    662 bytes
-- block 2 content ----------------
1:      0x13C88E93      0x00109992   <-- second column — some id/crc/hash
2:      0x1F2AC3DE      0x001083f6   <-- third column — string id, unique for the entire localization
3:      0x474BF324      0x001083ef
4:      0x4C4FF12E      0x00109994
5:      0x519C8F13      0x00109996
6:      0x59FEAB16      0x00109991
7:      0x692198D8      0x0010999f
8:      0x736E017E      0x00109390
9:      0xB1BB516D      0x00109997
10:     0xC0EB3DE0      0x00109993
11:     0xFC5E14AB      0x001083f7
-----------------------------------
sorting...
sorted.
done!

I do not know what to do with the second data block. also I do not know how to get linking between "item_category_light_armor_description" and "0x00109390" :(

ready strings from english part of dlc1:
Code:
0x001083ef ## Saddlebags allow you to carry more weight.
0x001083f6 ## A horse equipped with blinders won't panic as easily.
0x001083f7 ## A horse equipped with a saddle won't tire as easily.
0x00109390 ## Light gear. Increases Armor and Stamina regeneration.
0x00109991 ## Temerian Armor
0x00109992 ## Temerian Boots
0x00109993 ## Temerian Gauntlets
0x00109994 ## Temerian Trousers
0x00109996 ## Temerian Horse Blinders
0x00109997 ## Temerian Saddle
0x0010999f ## Temerian Saddlebags


Top
   
PostPosted: Tue May 26, 2015 10:52 pm 

Joined: Sat May 16, 2015 11:58 pm
Posts: 47
hhrhhr wrote:
so, decoding strings were similar as in the Witcher 2.
Code:
string_key = magic >> 8 & 0xffff
for (i = 0; i < strings_count; i += 2) {
    char_key = ((string_len + 1) * string_key) & 0xffff
    string_buffer[i+0] ^= ((char_key >> 0) & 0xff)
    string_buffer[i+1] ^= ((char_key >> 8) & 0xff)
    string_key = ((string_key << 1 ) | (string_key >> 15)) && 0xffff
}


Lua implementation is here. test output:
Code:
>lua inspect_w3strings.lua DLC1\content\en.w3strings . debug
magic: 0x43975139 -> 0x79321793
block 1, count = 11     132 bytes
block 2, count = 11     88 bytes
block 3, count = 331    662 bytes
-- block 2 content ----------------
1:      0x13C88E93      0x00109992   <-- second column — some id/crc/hash
2:      0x1F2AC3DE      0x001083f6   <-- third column — string id, unique for the entire localization
3:      0x474BF324      0x001083ef
4:      0x4C4FF12E      0x00109994
5:      0x519C8F13      0x00109996
6:      0x59FEAB16      0x00109991
7:      0x692198D8      0x0010999f
8:      0x736E017E      0x00109390
9:      0xB1BB516D      0x00109997
10:     0xC0EB3DE0      0x00109993
11:     0xFC5E14AB      0x001083f7
-----------------------------------
sorting...
sorted.
done!

I do not know what to do with the second data block. also I do not know how to get linking between "item_category_light_armor_description" and "0x00109390" :(

ready strings from english part of dlc1:
Code:
0x001083ef ## Saddlebags allow you to carry more weight.
0x001083f6 ## A horse equipped with blinders won't panic as easily.
0x001083f7 ## A horse equipped with a saddle won't tire as easily.
0x00109390 ## Light gear. Increases Armor and Stamina regeneration.
0x00109991 ## Temerian Armor
0x00109992 ## Temerian Boots
0x00109993 ## Temerian Gauntlets
0x00109994 ## Temerian Trousers
0x00109996 ## Temerian Horse Blinders
0x00109997 ## Temerian Saddle
0x0010999f ## Temerian Saddlebags


Wow, you are awesome!
you can give directly tools? Unp/Repack?


Top
   
PostPosted: Wed May 27, 2015 1:16 am 

Joined: Sun Jan 18, 2015 11:22 pm
Posts: 36
Nobody wrote:
you can give directly tools?
hhrhhr wrote:
Lua implementation is here.


Nobody wrote:
Repack?
hhrhhr wrote:
I do not know what to do with the second data block. also I do not know how to get linking between "item_category_light_armor_description" and "0x00109390"


Top
   
PostPosted: Wed May 27, 2015 3:22 pm 

Joined: Tue May 19, 2015 8:20 pm
Posts: 13
This is good news...But, How to use this tool. This format foreign to me. preferably .exe format, as unpack.exe

There is a Gibbed red tool, for witcher 2. I guess, it will be help to you.

The Witcher 2 Gibbed Red Tool


Top
   
PostPosted: Sun Sep 06, 2015 9:05 pm 

Joined: Tue May 19, 2015 8:20 pm
Posts: 13
Is there any news? Translate projects still wait, because of .w3strings file system...


Top
   
PostPosted: Tue Sep 15, 2015 2:56 pm 

Joined: Tue Sep 15, 2015 2:53 pm
Posts: 1
Sarcenzzz on Nexus mod just released a tool to export and import w3strings file: http://www.nexusmods.com/witcher3/mods/676/?

Check it out.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 14 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited