PDA

View Full Version : Solving Unknown OBJD Values with CAW's CSHostWrap.dll (Update 5/31/10)


ChaosMageX
10th May 2010, 5:57 PM
======================================
:alarm: :alarm: UPDATE:

After learning about the wonders of the property grid, I have created a new version of this program that uses that to allow you to edit and make new OBJD files from the various classes in CSHostWrap.dll

As such, the old, make two files and compare the data feature buttons have been disabled, but they and their code are still there and can be re-enabled and recompiled.

The file OBJDer.rar now contains only the EXE, which should be able to be run just by being placed in the IN THE SAME FOLDER AS CAW.exe.

The Microsoft Visual Studio 2008 source code can now be found in OBJDer_Source.rar.

Beware, as this program has been tested very little and is still ripe with errors.
==============================================

With Inge's permission, I am posting this extremely primitive tool here in the S3PI forum, in order to aid those contributing to the S3PI library in fully decoding the OBJD files.

If anyone has looked thoroughly at the CSHostWrap.dll, especially after running it through the dot-deobfuscator, they'd know that it contains several classes for writing the byte[] data for OBJD files, mostly in the Sims3.CSHost.CatalogProduct class and its descendents.
It is my hope that these classes can be used to figure out all the remaining unknown values in the OBJD files and further complete the S3PI libraries.

Below is the repitition of the rest of the PM I originally sent to Inge, stating what I have managed to so far with these classes in CSHostWrap.dll. Also, attached to this thread is the Microsoft Visual Studio 2008 C# source for the tool, ready to be modified and re-compiled.

And now, the PM...

I have been experimenting with some of the other classes in the CSHostWrap.dll program, specifically the classes for writing OBJD files, which include Sims3.CSHost.CatalogProduct and its descendents.

Anyway, I've made an excruciatingly simple program for writing OBJD files that can be differentiated and used to figure out the previously unknown values in them.

And when I say excruciatingly simple, I mean that it has no interface.

You have to go into the C# source code that I've included, manually change the values of the properties of the two OBJD files that will be written, and then recompile it and use it to write those files.

This program should compile properly if it references the necessary the CAW dlls by absolute reference.
If not, then you'll need to reference the following DLLs that came with CAW for it to work:
CSHostWrap.dll
SimIFace.dll
Sims3Metadata.dll
Sims3MetadataToolsOnly.dll
Sims3Common.dll

Once you've managed to compile it, all you have to do is open it and press the first button to get a MessageBox report of the differences in the raw data of the files and the offsets of those differences, and the second button to write files that can be more closely examined in a hex editor.

It is through this program that I believe that the byte for controlling an object's Fire Type (whether or not it burns) is the 5th byte follwoing (part of a uint DWORD at 4 byte offset from) the common block, but I could still be wrong, as I have not confirmed it yet.

In the version of S3PE that I'm using, it's labeled as Unknown4 in the Grid editor for the OBJD file.
This is the version of S3PE that I'm using:
Front-end Distribution: 1003-06-1044
Library Distribution: 1003-06-1044

All I know is that this program can be used to figure out OBJD files if used right, and since you are one of the main people in charge of S3PI, I wanted you to have it. I hope you will find it useful.

Inge Jones
13th May 2010, 4:23 PM
Hope it doesn't look rude that you have had no reply yet, but we've not had time to consider all this yet so have nothing intelligent to say :)