Users browsing this thread: 1 Guest(s)
Unreadable DDS files
#1
Hi everyone,

I would like to extract data from MySims Kingdom (Wii). Like a bunch of Maxis games, files are stored in game specific *.package files, but S3PE let me open Kingdom ones. The software detects there are image files and let me extract them, however I'm not able to see them. Any ideas?

Here is the error I get in S3PE instead of image preview, it could helps:
Code:
Error reading resource 0x00B2D882-0x00000000-0xBA6D3A63FDA1EED7
Front-end Distribution: 14-0222-1852
Library Distribution: 14-0222-1852

Source: mscorlib
Assembly: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
----
Stack trace:
  à System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
  à System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  à System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
  à System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
  à System.Activator.CreateInstance(Type type, Object[] args)
  à S3PIDemoFE.ABuiltInValueControl.<>c__DisplayClassd.<Lookup>b__a(KeyValuePair`2 x)
  à System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
  à System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
  à System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
  à S3PIDemoFE.MainForm.getPreviewControl()
----

Source: DDSPanel
Assembly: DDSPanel, Version=1402.22.1843.33690, Culture=neutral, PublicKeyToken=null
DDS Magic Number invalid.  Got 0x4901FE14, expected 0x20534444 ('DDS ').  At 0x00000004.
----
Stack trace:
  à System.Drawing.Dds.DdsHeader..ctor(Stream s)
  à System.Drawing.Dds..ctor(Stream s)
  à System.Drawing.DdsFile.Load(Stream input, Boolean supportHSV)
  à System.Windows.Forms.DDSPanel.DDSLoad(Stream stream, Boolean supportHSV)
  à S3PIDemoFE.DDSControl..ctor(Stream s)
----

S3PE let us writting wrappers for each packed file type, maybe is this the key?
I've attached a random extracted DDS, and a whole package containing textures and some other stuff.

Thanks for helping Smile

EDIT: It seems that the image file is not really a DDS but a custom image file format. If anyone could help to find a way to get them, it would be great!


Attached Files
.zip   MSK_DDS.zip (Size: 265.9 KB / Downloads: 244)
Sorry for bad spelling, I don't speak fluent English.
Reply
Thanked by:
#2
Program problem(windows debugger), maybe he isn't compatible.
You can only fix the problem by accessing source code and modifying it.
Reply
Thanked by:
#3
I got 17 files out - two ".dds" files, one ".material" file and 14 ".bnry" files.

It appears the DDS files aren't DDS files at all. Both of them begin with the bytes "14 FE 01 49" while normally all DDS' begin with "44 44 53 20" so unless there's some sort of encryption/compression in there, these are not 'real' DDS files.

EDIT: And that's exactly what the error message "DDS Magic Number invalid. Got 0x4901FE14, expected 0x20534444 ('DDS '). At 0x00000004." you got tells us.
Once there was a way to get back homeward
Reply
Thanked by:
#4
apparently .bnry are .dds
http://www.modthesims.info/d/printthread...ge=2&pp=25
Other solution : Dolphin Emulator with option dump textures.
Or this program : https://github.com/s4ptacle/Sims4Tools
Reply
Thanked by:
#5
None of those bnry-files contain the DDS magic number or DXT* -headers – they're not DDS files.

Couldn't get the Sims4 editor to open the package.
Once there was a way to get back homeward
Reply
Thanked by:
#6
Thank you for all these replies Wink

(04-08-2016, 02:12 AM)Raccoon Sam Wrote: I got 17 files out - two ".dds" files, one ".material" file and 14 ".bnry" files.

It appears the DDS files aren't DDS files at all. Both of them begin with the bytes "14 FE 01 49" while normally all DDS' begin with "44 44 53 20" so unless there's some sort of encryption/compression in there, these are not 'real' DDS files.

EDIT: And that's exactly what the error message "DDS Magic Number invalid.  Got 0x4901FE14, expected 0x20534444 ('DDS ').  At 0x00000004." you got tells us.

The DDS files are texture files for sure.

(04-08-2016, 02:22 AM)iyenal Wrote: apparently .bnry are .dds
http://www.modthesims.info/d/printthread...ge=2&pp=25
Other solution : Dolphin Emulator with option dump textures.
Or this program : https://github.com/s4ptacle/Sims4Tools

BNRY are not DDS files in MySims files, they are models and code files. I can use Dolphin for textures dumping yeah, but there are a lot of unused resources in the game files, such as a whole unused area, so I'd like to get these too.
And S4PE is not able to open MySims Kingdom packages, only S3PE can do that. What is needed is writting wrapper for DDS files in S3PE.

Also, someone here wrote a script to extract models from MySims Agents packages on 3ds Max, perhaps something in it will be useful to understand MySims files?

Code:
gc()
enableSceneRedraw()
clearlistener()

global globalStartTime = timestamp()
global globalImportedFilePath = ""
global globalBoolApplyNormals = false
global globalBoolApplySkinning = false


-- Structs

struct PakEntryInfoStruct
(
   unk1,     -- u32
   unk2,     -- u32
   offset,     -- u32
   size,        -- u32
   type        -- procedural, u32
)

struct VertDescriptorStruct
(
   gxAttr                 = 0, -- byte
   stride                 = 0, -- byte
   unk                     = 0, -- 4 bytes
   vertArrayOffset     = 0  -- u32
)


-- General helper functions

fn GetOpenFile =
(
   clearlistener()
   local fname = getOpenFileName \
   caption:"Open Model" \
   types:"Package file (*.package)|*.package" \
   historyCategory:"PACKAGEWII Object Presets"
   if (fname == undefined) then
   (
       return undefined
   )
   else
   (
       globalImportedFilePath = fname
       local f = fopen fname "rb"
       return f
   )
)

-- Reading functions

fn ReadBEShort fstream =
(
   return bit.swapBytes (ReadShort fstream #unsigned) 1 2
)

fn ReadBELong fstream =
(
   return bit.swapBytes (bit.swapBytes (ReadLong fstream #unsigned) 1 4) 2 3
)

fn ReadBEFloat fstream =
(
   return bit.intAsFloat (bit.swapBytes (bit.swapBytes (ReadLong fstream #unsigned) 1 4) 2 3)
)

fn ReadBEVector3 fstream =
(
   return [(ReadBEFloat fstream), (ReadBEFloat fstream), (ReadBEFloat fstream)]
)

fn ReadBEVector4 fstream =
(
   return [(ReadBEFloat fstream), (ReadBEFloat fstream), (ReadBEFloat fstream), (ReadBEFloat fstream)]
)

fn ReadBEMatrix44 fstream =
(
   return matrix3 (ReadBEVector4 fstream) (ReadBEVector4 fstream) (ReadBEVector4 fstream) (ReadBEVector4 fstream)
)

fn WriteBELong fstream val =
(
   WriteLong fstream (bit.swapBytes (bit.swapBytes val 1 4) 2 3)
)

fn WriteBEShort fstream val =
(
   WriteShort fstream (bit.swapBytes val 1 2)
)

fn GetEntryType fstream offset =
(
   local startPos = ftell fstream
Sorry for bad spelling, I don't speak fluent English.
Reply
Thanked by:
#7
How are you sure the DDS files are textures?
Once there was a way to get back homeward
Reply
Thanked by:
#8
(04-12-2016, 01:08 PM)Raccoon Sam Wrote: How are you sure the DDS files are textures?

They are in the original MySims, S3PE is quite powerful for that so I can't 100% confirm it but I think deeply they are image files.
Sorry for bad spelling, I don't speak fluent English.
Reply
Thanked by:
#9
Any idea?
Sorry for bad spelling, I don't speak fluent English.
Reply
Thanked by:
#10
If you run the maxscript on the file it should output some tpl files that you can then export to png or something else using a program like Brawlbox.
They aren't actually DDS. It's some custom format using gamecube standard stuff.
Reply
Thanked by:
#11
(05-17-2016, 04:17 AM)TGE Wrote: If you run the maxscript on the file it should output some tpl files that you can then export to png or something else using a program like Brawlbox.
They aren't actually DDS. It's some custom format using gamecube standard stuff.

Oh I see, but the maxscript is not working on these kind of packages. It only works on specific MySims Agents packages.
Here are some packages from MySims Kingdom, if you want to suit the first script with these package: http://www.mediafire.com/download/5nsy89...ckages.zip
Sorry for bad spelling, I don't speak fluent English.
Reply
Thanked by:


Forum Jump: