Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Mafia II SDS files?

The Original Forum. Game archives, full of resources. How to open them? Get help here.
stgn
ultra-n00b
Posts: 7
Joined: Thu Aug 12, 2010 5:14 pm
Been thanked: 3 times

Re: Mafia II SDS files?

Post by stgn »

sng wrote: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)

Code: Select all

"#define LUA_NUMBER double"
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:

Code: Select all

1B 4C 75 61 51 00 01 04 04 04 [04] 00
Lua Header v5.1:

Code: Select all

1B 4C 75 61 51 00 01 04 04 04 [08] 00
i compiled a modified luadec51 that uses single-precision lua_number. the file you posted began to decompile but it crashed luadec. i guess i was extracting the files wrong.
stgn
ultra-n00b
Posts: 7
Joined: Thu Aug 12, 2010 5:14 pm
Been thanked: 3 times

Re: Mafia II SDS files?

Post by stgn »

Code: Select all

DecompiledFunction = function(l_1_0)
  if game.datastore:IsVariableExist("CON_DEMO") == false then
    player = game.game:GetActivePlayer()
    player:InventoryAddItem(55)
    game.speech:LoadStage(60)
    idMessages = common.messages.Id
    questComM05 = Lokace.Create(idMessages.Distillery, idMessages.QuestDirector)
    game.datastore:SetBool("tempDemoStart", true)
    kteryPartik = game.datastore:GetNumber("missionPart")
    kteraJeMise = game.datastore:GetNumber("missionNumber")
    player:SetFightAbility(false, enums.FightAbility.COUNTER)
    player:SetFightAbility(false, enums.FightAbility.COMBO)
    if kteryPartik == 1 then
      M05Part1(l_1_0)
    elseif kteryPartik == 2 then
      M05Part2(l_1_0)
    elseif kteryPartik == 3 then
      M05Part3(l_1_0)
    elseif kteryPartik == 4 then
      M05Part4(l_1_0)
    elseif kteryPartik == 5 then
      M05Part5(l_1_0)
    elseif kteryPartik == 6 then
      M05Part6(l_1_0)
    elseif kteryPartik == 7 then
      M05Part7(l_1_0)
    elseif kteryPartik == 8 then
      M05Part8(l_1_0)
    elseif kteryPartik == 9 then
      M05Demo(l_1_0)
    elseif kteryPartik == 10 then
      M05DemoDistFlat(l_1_0)
    end
  end
end)
here's a portion though.
Ekey
M-M-M-Monster veteran
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?

Post by Ekey »

Great job WRS :keke:
WRS
ultra-veteran
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?

Post by WRS »

thanks!

here's my final version. the filenames are in the xml - so this needs to be written up in another programming language - but it can decompress the chunks and split all the listed files ;)

leave a message or pm me if you have any problems.
You do not have the required permissions to view the files attached to this post.
Useful tool links:
Ekey
M-M-M-Monster veteran
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?

Post by Ekey »

WRS wrote:thanks!

here's my final version. the filenames are in the xml - so this needs to be written up in another programming language - but it can decompress the chunks and split all the listed files ;)

leave a message or pm me if you have any problems.
trying on m05waytoelgreco.sds

Code: Select all

  offset   filesize   filename
------------------------------
- SCRIPT's MESSAGE:
  Dumping XML description..

  000093c5 3149       m05waytoelgreco_desc.xml
- SCRIPT's MESSAGE:
  total chunks: 6
  decompressed size: 93408 bytes

- SCRIPT's MESSAGE:
  Parsing uncompressed data..

- SCRIPT's MESSAGE:
  warning: next output will keep header information

  0000002a 7001       1__FrameResource
- SCRIPT's MESSAGE:
  warning: next output will keep header information

  00001bbc 6          2__FrameNameTable
- SCRIPT's MESSAGE:
  warning: next output will keep header information

  00001bfb 7476       3__Actors
- SCRIPT's MESSAGE:
  warning: next output will keep header information

- error in src\quickbms.c line 2480: CMD_GetDString_func()
Error: tentative of allocating -1 bytes
demo05.sds

Code: Select all

  offset   filesize   filename
------------------------------
- SCRIPT's MESSAGE:
  Dumping XML description..

  00009de0 2794       demo05_desc.xml
- SCRIPT's MESSAGE:
  total chunks: 9
  decompressed size: 131859 bytes

- SCRIPT's MESSAGE:
  Parsing uncompressed data..

- SCRIPT's MESSAGE:
  warning: next output will keep header information

  0000002a 5518       1__FrameResource
- SCRIPT's MESSAGE:
  warning: next output will keep header information

  000015f1 6          2__FrameNameTable
- SCRIPT's MESSAGE:
  warning: next output will keep header information

  00001630 6824       3__Actors
  00003127 12         4__MemFile
  00003193 18919      5__MemFile
  00007bbf 61848      6__MemFile

- error in src\quickbms.c line 8504: myalloc()
Error: Not enough space
Error: Not enough space - wtf 795gb free :eek:
User avatar
Tosyk
double-veteran
double-veteran
Posts: 1027
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 269 times
Been thanked: 154 times
Contact:

Re: Mafia II SDS files?

Post by Tosyk »

i just get an error with all SDS i've trying :(

Code: Select all

 offset   filesize   filename
------------------------------
- SCRIPT's MESSAGE:
  Dumping XML description..

  00a05599 55351      tunel_desc.xml

Error: the compressed zlib/deflate input is wrong or incomplete (-3)

Error: there is an error with the decompression
       the returned output size is negative (-1)

Press RETURN to quit
anyway great job:)

upd:
or maybe it's not a bms script?? :o
Thank you for all you do here
my blog | my forum
WRS
ultra-veteran
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?

Post by WRS »

i only had 2 files to write my script from. cut me some slack.

Ekey wrote:Error: Not enough space - wtf 795gb free :eek:
memory doesn't refer to hard disk space


can you upload the ones you tried it with?
Useful tool links:
bird
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?

Post by bird »

Tried your script with text_default.sds and it worked like a charm, thanks (I used quickbms)!
It produced 5 files: 1__Texture 2__MemFile 3__MemFile 4__MemFile 5__XML
I hope you'll find a way to recompress those files (especially Memfiles which contain translatable text) easily, without crashing the game.

Great job so far!
User avatar
Tosyk
double-veteran
double-veteran
Posts: 1027
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 269 times
Been thanked: 154 times
Contact:

Re: Mafia II SDS files?

Post by Tosyk »

WRS wrote:can you upload the ones you tried it with?
I think
player - vito and houston car
Thank you for all you do here
my blog | my forum
Ekey
M-M-M-Monster veteran
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?

Post by Ekey »

WRS wrote:i only had 2 files to write my script from. cut me some slack.

Ekey wrote:Error: Not enough space - wtf 795gb free :eek:
memory doesn't refer to hard disk space


can you upload the ones you tried it with?
yup , attached
You do not have the required permissions to view the files attached to this post.
s0beit
ultra-n00b
Posts: 9
Joined: Fri Aug 13, 2010 7:07 am
Been thanked: 1 time

Re: Mafia II SDS files?

Post by s0beit »

The contents of this post was deleted because of possible forum rules violation.
bird
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?

Post by bird »

Thanks for the link from Facepunch's megathread. I knew that board already.
It's awesome!
Ekey
M-M-M-Monster veteran
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?

Post by Ekey »

in folder "Steam\SteamApps\common\mafia ii - public demo\pc\shaders\buildLogs\" i found interesting log file :)

Autobuilder.log


Edit by Rheini: removed the log to keep this thread clean
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Mafia II SDS files?

Post by chrrox »

that is useless dude. please delete that its was to big for the forum posts use an attached text file next time.
WRS
ultra-veteran
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?

Post by WRS »

updated my script. adding some comments before i upload
You do not have the required permissions to view the files attached to this post.
Useful tool links:
Post Reply