Hey everybody,
dishonored2.bms can currently only extract game#.resources files, not shared_2_3.sharedrsc. I tried adding support for sharedsrc but extraction fails on some compressed data. My modified version:
Code:
# Dishonored 2
# script for QuickBMS http://quickbms.aluigi.org
endian big
get EXT extension
if EXT == "index" || EXT == "resources"
open FDDE "index"
open FDDE "resources" 1
open FDSE "shared_2_3.sharedrsc" 2
get DUMMY byte # 0x05 for index and 0x04 for resources
idstring "SER"
get SIZE long
getdstring ZERO 0x18
get FILES long
for i = 0 < FILES
get IDX long
endian little
for x = 0 < 3
get NAMESZ long
getdstring NAME NAMESZ
next x
endian big
get OFFSET longlong
get SIZE long
get ZSIZE long
get ZERO long
get FLAGS long
get ZERO short
if FLAGS > 0
if ZSIZE == SIZE
log NAME OFFSET SIZE 2
else
#clog NAME OFFSET ZSIZE SIZE 2 #fails here
endif
else
if ZSIZE == SIZE
log NAME OFFSET SIZE 1
else
clog NAME OFFSET ZSIZE SIZE 1
endif
endif
next i
else
comtype zlib_noerror
get SIZE asize
get NAME basename
string NAME + "_unpack."
string NAME + EXT
clog NAME 0 SIZE SIZE
endif
This is the error I get when trying to extract game1:
Code:
Error: the compressed zlib/deflate input is wrong or incomplete (-3)
Info: algorithm 1
offset 0000000028f03182
input size 0x0000000000002b46 11078
output size 0x0000000000040014 262164
result 0xffffffffffffffff -1
Error: the uncompressed data (-1) is bigger than the allocated buffer (15729302)
This is a 010 template to look at the .index files:
Code:
//------------------------------------------------
//--- 010 Editor v7.0.2 Binary Template
//
// File:
// Authors:
// Version:
// Purpose:
// Category:
// File Mask:
// ID Bytes:
// History:
//------------------------------------------------
BigEndian();
local uint i;
local uint j;
local int files_var;
struct HEADER {
byte type[1] <format=decimal>;
char idstring[3];
int size;
char zero[24];
int files;
files_var = files;
} header <bgcolor=cLtGray>;
for(i=0;i<files_var;i++) {
struct DATA {
BigEndian();
int idx;
LittleEndian();
local string custom_read;
for(j=0;j<3;j++) {
struct FILES {
int namesz;
char name[namesz];
if(j==1) {
if(namesz) {
custom_read = name;
} else {
custom_read = "n/a";
}
}
} record <read=read_FILES>;
}
BigEndian();
int64 offset;
int size;
int zsize;
int zero;
int flags;
LittleEndian();
int16 flags2;
} record <read=read_DATA>;
}
string read_FILES(FILES &in) {
return in.name;
}
string read_DATA(DATA &in) {
local string out;
SPrintf(out, "%d | %u | %s", in.flags, (in.size - in.zsize), in.custom_read);
return out;
}
I'd like to extract all available files. Can somebody help?