Hi!
Anyone succeeded extracting text or other localization related text or data from *.sds files?
I downloaded the demo and I think this sds file could hold some valuable text
Thanks for helping me.
-Bird
Important information: this site is currently scheduled to go offline indefinitely by end of the year.
Mafia II SDS files?
- Gocha
- veteran
- Posts: 109
- Joined: Fri Dec 12, 2008 8:16 pm
- Location: Batumi, Georgia, GE
- Has thanked: 57 times
- Been thanked: 9 times
- Contact:
Re: Mafia II SDS files?
Yeah, i just came in to open thread about...
So i need to translate the game too, so I need the font file too - texture i guess.
My respects to anyone trying to help, i love you for that
So i need to translate the game too, so I need the font file too - texture i guess.
My respects to anyone trying to help, i love you for that
My great respect and appreciation for them, who research game files! Special thanks to: aluigi, bacter, DerPlaya, Rick, Turfster, twig, Zench. Sorry if someone is missing in my list, I'll update when I'll notice it again
-
- M-M-M-Monster veteran
- Posts: 1823
- Joined: Wed Mar 31, 2010 6:54 am
- Has thanked: 92 times
- Been thanked: 1058 times
Re: Mafia II SDS files?
The contents of this post was deleted because of possible forum rules violation.
My Github repo
- Gocha
- veteran
- Posts: 109
- Joined: Fri Dec 12, 2008 8:16 pm
- Location: Batumi, Georgia, GE
- Has thanked: 57 times
- Been thanked: 9 times
- Contact:
Re: Mafia II SDS files?
okey, compressed file got decompressed - we need a tool for decompressing all of sds files or algorithm or like one how to decompress other ones too.
Second, we need to make it editable, with only decompressed format we can't edit text or other file.
Second, we need to make it editable, with only decompressed format we can't edit text or other file.
My great respect and appreciation for them, who research game files! Special thanks to: aluigi, bacter, DerPlaya, Rick, Turfster, twig, Zench. Sorry if someone is missing in my list, I'll update when I'll notice it again
-
- Moderator
- Posts: 652
- Joined: Wed Oct 18, 2006 9:48 pm
- Location: Germany
- Has thanked: 19 times
- Been thanked: 46 times
- Contact:
Re: Mafia II SDS files?
I think there's more to that. In one file I found a plain xml file at the end and other plain text in between.
So I guess the format supports compression on a per-file basis.
So I guess the format supports compression on a per-file basis.
-
- ultra-n00b
- Posts: 7
- Joined: Sun Aug 08, 2010 10:01 am
- Has thanked: 3 times
- Been thanked: 1 time
Re: Mafia II SDS files?
Thanks for putting effort into the matter, with Evin's help I found out that there are 117 pieces of compressed zlib files in text_default.sds Since I'm not a programmer I can't figure out the whole mechanism how the file structure handles those separately compressed files.
-
- Moderator
- Posts: 652
- Joined: Wed Oct 18, 2006 9:48 pm
- Location: Germany
- Has thanked: 19 times
- Been thanked: 46 times
- Contact:
Re: Mafia II SDS files?
Well strangely there's some 36(?) byte info between some file data but between others there seems to be no such data.
-
- M-M-M-Monster veteran
- Posts: 1823
- Joined: Wed Mar 31, 2010 6:54 am
- Has thanked: 92 times
- Been thanked: 1058 times
Re: Mafia II SDS files?
Indeed. Everyone SDS contains some files which compressed with zlibRheini wrote:I think there's more to that. In one file I found a plain xml file at the end and other plain text in between.
So I guess the format supports compression on a per-file basis.
Examples :
m05main.sds contained LuaQ files (compiled lua scripts - 5.x ?)
Code: Select all
/scripts/missions/M05Main/M05ListOfParts.lua
/scripts/missions/M05Main/M05MainScript.lua
/scripts/missions/M05Main/M05Saves.lua
/missions/M05Main/scriptname.txt
2 file offset start - 00008C49
3 file offset start - 0000EEF9
m05waytoelgreco.sds
Code: Select all
/scripts/missions/M05WayToElGreco/SpawnPoliceCars.lua
/scripts/missions/M05WayToElGreco/SpawnPoliceCars2.lua
/scripts/missions/M05WayToElGreco/SpawnPoliceCars3.lua
/scripts/missions/M05WayToElGreco/WayToElGrecoPolice.lua
/scripts/missions/M05WayToElGreco/Script/M05PoliceChase.lua
/scripts/missions/M05WayToElGreco/Script/WayTimer.lua
2 file offset start - 0000BDC4
3 file offset start - 0000BE4A
4 file offset start - 0000F3B4
5 file offset start - 0000FCBC
6 file offset start - 00010014
See attached file, mb who can can extract from there files
You do not have the required permissions to view the files attached to this post.
My Github repo
-
- ultra-veteran
- Posts: 603
- Joined: Fri Nov 06, 2009 12:13 am
- Has thanked: 74 times
- Been thanked: 137 times
Re: Mafia II SDS files?
spent a little bit of time reversing some of the headers. the plaintext xml is for the engine to allocate memory (see the first header).
zlib data looks chunked. haven't yet bothered splitting up the files.
edit: haven't read the latest post - will download these new attachments now!
zlib data looks chunked. haven't yet bothered splitting up the files.
edit: haven't read the latest post - will download these new attachments now!
Code: Select all
# -- WRS
# xentax.com
# .sds BMS script (wip)
print "WARNING: THIS SCRIPT WILL NOT DUMP ANYTHING YET (WIP)"
idstring "SDS\x00"
goto 16
### Part of the header
get P_RES long
get P_DATA long
get P_XML long
get TOT_RAM long # sum of all ram usage (see xml)
get TOT_VRAM long # sum of all vram usage (see xml)
###
get xmlsize asize
math xmlsize -= P_XML
log "sds_desc.xml" P_XML xmlsize
goto 64
### Res info
get RES_COUNT long
get UNKNOWN long
get RES_TYPES long
for i = 1 to RES_TYPES
get RES_INDEX long
get RES_NAME_sIZE long
math RES_NAME_sIZE += 4 # padded byte
getdstring RES_NAME RES_NAME_SIZE
print "%RES_NAME%"
next i
### zlib data
goto P_DATA # will already be here
getdstring UNKNOWN 30 # some sort of header
set chunkcnt long 0
for
get CHUNK_SIZE long
if CHUNK_SIZE == 0
print "Chunks found: %chunkcnt%"
cleanexit
endif
get FLAG byte
if FLAG == 0
getdstring UNKNOWN 11
## zlib data is here
savepos DATASTART
## todo: clog to memory_file, append result to result
math DATASTART += CHUNK_SIZE
goto DATASTART
else
get UNKNOWN long
get SKIP long
savepos SKIPVAL
math SKIPVAL += SKIP
math SKIPVAL -= 8
goto SKIPVAL
savepos DATASTART
## todo: clog to memor_file, append result to result
math CHUNK_SIZE -= SKIP
math DATASTART += CHUNK_SIZE
goto DATASTART
endif
math chunkcnt += 1
next
Useful tool links:
Re: Mafia II SDS files?
the lua files are, more specifically, compiled lua 5.1 scripts. their magic is actually "[0x1b]Lua", not "LuaQ". the "Q" is actually the version (0x51 -> 5.1).
-
- ultra-veteran
- Posts: 603
- Joined: Fri Nov 06, 2009 12:13 am
- Has thanked: 74 times
- Been thanked: 137 times
Re: Mafia II SDS files?
well i'm almost done.
i've attached DEMO_end4.dds from demo_end4.sds (had to scale down so i could upload it).
i've attached DEMO_end4.dds from demo_end4.sds (had to scale down so i could upload it).
You do not have the required permissions to view the files attached to this post.
Useful tool links:
Re: Mafia II SDS files?
mafia ii appears to use a modified lua vm. first obvious sign i could find is that it uses single-precision floats for numbers instead of double according to compiled lua headers. i compiled a custom version of luadec to handle this but i'm still getting errors like "unexpected end in precompiled chunk" or "memory allocation error: block too big", which suggest that there might be more going on.
Re: Mafia II SDS files?
I'm trying to decompile the file M05ListOfParts.luac taken from the file "pc\sds\missionscript\m05main.sds".
I use LuaDec51, but get an error "bad header in precompiled chunk".
Having sorted out, I realized that the error here: (luaconf.h)
I changed it to 8, but a new error "bad constant in precompiled chunk".
I understand, they use a modified Lua script. Am I right?
Mafia Lua Header:
Lua Header v5.1:
I use LuaDec51, but get an error "bad header in precompiled chunk".
Having sorted out, I realized that the error here: (luaconf.h)
Code: Select all
"#define LUA_NUMBER double"
I understand, they use a modified Lua script. Am I right?
Mafia Lua Header:
Code: Select all
1B 4C 75 61 51 00 01 04 04 04 [04] 00
Code: Select all
1B 4C 75 61 51 00 01 04 04 04 [08] 00