Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Featured Replies

  • Author
  • Localization

Lord Vaako, posted Tue Oct 17, 2017 7:39 pm (27388)


Is anyone going to create Elex *.pak files extractor? :-)

Code:
17.10.2017  21:08                84 c_0_en.pak
17.10.2017  20:53                84 c_0_na.pak
17.10.2017  20:21     3?094?840?069 c_1_en.pak
17.10.2017  20:21    24?153?842?686 c_1_na.pak
  • Author
  • Localization

aluigi, posted Tue Oct 17, 2017 7:45 pm (27389)


Please download the filecutter script:
http://aluigi.org/bms/filecutter.bms

Open it with a text editor.
Near the beginning you can see a math "MEGABYTES = 2", replace 2 with 10 (or more if you prefer).
Now launch the script on "c_1_en.pak" and upload the two files it generates.
  • Author
  • Localization

aluigi, posted Tue Oct 17, 2017 7:48 pm (27390)


Ah maybe in the meantime try also the tools and script made for the first Risen/Gothic3, just in case the format is the same.
For example this is the script I made some years ago:
http://aluigi.org/bms/risen.bms
  • Author
  • Localization

Lord Vaako, posted Tue Oct 17, 2017 9:21 pm (27391)


it looks like risen.bms works :-)
it extracted a lot of *.rom files and *.db file
all files (rom and db) start with GAR5

Code:
- 31510 files found in 110 seconds
  coverage file 0   100%   3094840069 3094840069 . offset 00000000b8778305


btw, when I try to extract c_1_na.pak (24GB):

error in src\extra\xalloc.c line 618: xdbg_malloc()
Error: memory allocation problem
...

I use 0.8.1 (64bit test) 4GB version
I have 16GB only, will more RAM fix this problem? :-)))))
  • Author
  • Localization

aluigi, posted Tue Oct 17, 2017 10:13 pm (27399)


Good for c_1_en.pak.
Instead for c_1_na.pak I need the samples generated with filecutter as I said in my previous post so I can "tune" the script
  • Author
  • Localization

ponaromixxx, posted Tue Oct 17, 2017 11:05 pm (27404)


This for a large archive is suitable!

risenaut.7z

  • Author
  • Localization

aluigi, posted Wed Oct 18, 2017 12:04 am (27405)


Ah right the 64bit fields.
Wow I guess that quickbms didn't even have support for longlong when I wrote that script years ago :D
Script 0.2.2 should work perfectly
  • Author
  • Localization

Lord Vaako, posted Wed Oct 18, 2017 12:19 am (27406)


2 x 4MB only - upload limit :/
  • Author
  • Localization

aluigi, posted Wed Oct 18, 2017 7:56 am (27419)


You can use any external file hosting and put the link here.
Have you tried the new version of the script?
  • Author
  • Localization

Lord_Vaako, posted Wed Oct 18, 2017 7:49 pm (27445)


It works wery well now :-)

Code:
- 124496 files found in 543 seconds
  coverage file 0   100%   24153842686 24153842686 . offset 000000059fae63fe


Now I'm looking for a tool to convert /documents/*.hdr files -> text file :-)
  • Author
  • Localization

ponaromixxx, posted Thu Oct 19, 2017 9:12 pm (27476)


Just drag your .hdr file to r3resman and get .hdrdoc, open it through a text editor, you can also convert it back to .hdr

r3resman.zip

  • Author
  • Localization

NicoDE, posted Fri Oct 20, 2017 9:58 am (27484)


ponaromixxx wrote:
This for a large archive is suitable!

Nope, it doesn't even support compression mode 1 ('auto' for Risen 1 and Risen 2, 'zlib' for Risen 3 and ELEX). Well, and LFS (Large File Support) is broken.
Use the updated QuickBMS script or this: (source)

elexebra.zip

  • Author
  • Localization

NicoDE, posted Mon Oct 23, 2017 11:21 am (27625)


The GOG patch includes a data/packed/c_1_na.p00:
Code:
head {
   char8_t  magic[4];     // "PAK "
   char8_t  version[4];   // "V001"
   uint64_t unknown;      // 0
   uint64_t info_offset;  // relative to head
   uint64_t info_size;    // uint32_t, 0
}
data {
}
info {
   root {
      char8_t  magic[4];     // "VOL "
      uint32_t unknown;      // 1
      uint32_t name_offset;  // relative to info
      uint32_t name_size;
      uint32_t file_offset;  // relative to info
      uint32_t file_count;
      uint32_t jour_offset;  // relative to info
      uint32_t jour_count;
   }
   jour[info.root.jour_count] {
      char8_t  magic[4];  // "JOUR"
      uint32_t unknown[3];
   }
   uint32_t sort[info.root.file_count];
   file[info.root.file_count] {
      char8_t  magic[4];      // "FILE"
      uint32_t unknown1;      // 0
      uint32_t name_offset;   // relative to info.file[*] (into info.name)
      uint32_t path_offset;   // relative to info.file[*] (into info.name)
      uint64_t data_offset;   // relative to head (into data)
      uint32_t file_attrib;
      uint32_t unknown2;      // 0
      uint64_t file_ctime;
      uint64_t file_mtime;
      uint32_t file_size;
      uint32_t data_size;
      char8_t  data_comp[4];  // "\0\0\0\0" (uncompressed), "ZLIB"
      uint32_t unknown3[3];   // 0, 0, 0
   }
   char8_t name[info.root.name_size];
}
Pure guesswork based on looking at the file with a hex-editor. Format is neither supported by Risenaut, nor Elexebra (it's unlikely that I will add support for it - so you might create a QuickBMS script...).
  • Author
  • Localization

hhrhhr, posted Mon Oct 23, 2017 11:42 am (27627)


question: is this file contains whole updated files or only patches of in-game resources?
  • Author
  • Localization

NicoDE, posted Mon Oct 23, 2017 11:52 am (27628)


hhrhhr wrote:
question: is this file contains whole updated files or only patches of in-game resources?

It seems to contain the complete files with the new revision, that replace/override the entries in the original PAK (no incremental updates, would have been needlessly complex).

ps: note that name/path_offset are relative to the current file entry, not the file table
  • Author
  • Localization

aluigi, posted Mon Oct 23, 2017 1:05 pm (27629)


Can someone provide the data/packed/c_1_na.p00 file?
If it's very big go with the filecutter script.
I need it to be 100% sure of the script I'm writing.
  • Author
  • Localization

aluigi, posted Mon Oct 23, 2017 1:59 pm (27634)


Thanks, script 0.2.3:
http://aluigi.org/bms/risen.bms

I have implemented this "PAK " format in the same risen script because, as far as I know after a google search, only the risen-like games on GOG use this format (search: gog patch "p00").
  • Author
  • Localization

Lord Vaako, posted Mon Oct 23, 2017 9:41 pm (27648)


Quote:
Just drag your .hdr file to r3resman and get .hdrdoc, open it through a text editor, you can also convert it back to .hdr

Thnx for info! I also wrote my own script to extract the needed data in the format I need :-)

I have one more question, maybe someone knows the answer :-)
I'm looking for "a connection" between "entity internal name" and its localized name, for example:

It_Misc_BartoxHead_Arx (found inside w_quests.hdr)
and
0xb430f5ac > Bartox's Head (english text from w_strings.bin)

does anybody know where I can find it?
  • Author
  • Localization

NicoDE, posted Tue Oct 24, 2017 6:28 am (27655)


Lord Vaako wrote:
does anybody know where I can find it?

In the previous games it was done by naming convention:
  • b430f5ac|focus:FO_It_Misc_BartoxHead_Arx
  • 574926c6|item:ITEM_It_Misc_BartoxHead_Arx
  • 9affe4a5|item:ITEMDESC_It_Misc_BartoxHead_Arx
Identifier hashes are case-insensitive ('A'..'Z' lowercase) and the table prefix (including the ':') is excluded.
Code:
ID|German_Text|English_Text|French_Text|Italian_Text|Spanish_Text|Polish_Text|Russian_Text|Czech_Text|German_StageDir|English_StageDir|French_StageDir|Italian_StageDir|Spanish_StageDir|Polish_StageDir|Russian_StageDir|Czech_StageDir
b430f5ac|Bartox Schadel|Bartox's Head|Tete de Bartox|Testa di Bartox|Cabeza de Bartox|Glowa Bartoxa|?????? ?????|Bartoxova hlava||||||||
9affe4a5|Er wurde post mortem abgetrennt.|Bartox's head, removed post mortem.|La tete de Bartox, prelevee post mortem.|La testa di Bartox, rimossa dopo la morte.|La cabeza de Bartox, se la cortaron tras su muerte.|Glowa Bartoxa, usunieta po jego smierci.|?????? ?????, ???????? ?? ?? ? ??? ???.|Bartoxova hlava, odejmuta post mortem.||||||||
  • Author
  • Localization

Lord Vaako, posted Tue Oct 24, 2017 11:12 am (27657)


Thanks a lot NicoDE but could you elaborate a bit more how to calculate these hashes? Algorithm, etc.
  • Author
  • Localization

hhrhhr, posted Tue Oct 24, 2017 11:23 am (27658)


djb2
Code:
    unsigned long
    hash(unsigned char *str)
    {
        unsigned long hash = 5381;
        int c;

        while (c = *str )
            hash = ((hash << 5) hash) c; /* hash * 33 c */

        return hash;
    }


p.s.
Lua playground - https://www.lua.org/cgi-bin/demo
paste this:
Code:
local str = {
"demo1",
"demo2",
"demo3"
}
local hash = 5381
for i = 1, #str do
    local s = str[i]
    for j = 1, #s do
        hash = (((hash << 5) hash) s:byte(i)) & 0xffffffff
    end
    print(("[0xX] = '%s'"):format(hash, s))
end

and run :)
  • Author
  • Localization

Lord Vaako, posted Tue Oct 24, 2017 12:51 pm (27659)


it's not my day :/

Code:
local str = {
"FO_It_Misc_BartoxHead_Arx",
"ITEMDESC_It_Misc_BartoxHead_Arx",
"fo_it_misc_bartoxhead_arx",
"itemdesc_it_misc_bartoxhead_arx",
}
local hash = 5381
for i = 1, #str do
    local s = str[i]
    for j = 1, #s do
        hash = (((hash     end
    print(("[0xX] = '%s'"):format(hash, s))
end


gives

Code:
[0x1B7B1C7B] = 'FO_It_Misc_BartoxHead_Arx'
[0x009A71C7] = 'ITEMDESC_It_Misc_BartoxHead_Arx'
[0x9AD3D36E] = 'fo_it_misc_bartoxhead_arx'
[0xA7362E81] = 'itemdesc_it_misc_bartoxhead_arx'


and I was expecting:

b430f5ac
9affe4a5

What am I doing wrong? :(
  • Author
  • Localization

NicoDE, posted Tue Oct 24, 2017 1:57 pm (27661)


Lord Vaako wrote:
What am I doing wrong? :(

Nothing, the code is buggy :)
(the hash has to be reset/initialized for every string and the character index is j, not i)
Code:
local str = {
  "fo_it_misc_bartoxhead_arx",
  "item_it_misc_bartoxhead_arx",
  "itemdesc_it_misc_bartoxhead_arx"
}
for i = 1, #str do
  local s = str[i]
  local h = 5381
  for j = 1, #s do
    local c = s:byte(j)
    h = (((h   end
  print(("[0xx] = '%s'"):format(h, s))
end
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.