Difference between revisions of "Sims 3:0x073FAA07"

From SimsWiki
Jump to: navigation, search
m (Where used)
(Data format)
Line 18: Line 18:
 
== Data format ==
 
== Data format ==
 
(Provided by [[User:Rick|Rick]].)
 
(Provided by [[User:Rick|Rick]].)
  BYTE            unknown1 ;; must be 1
+
  BOOL                    is_encrypted ;; must be 1, could be is_compressed instead, game rejects anything not 1, so...
  DWORD           unknown2 ;; must be 0x2BC4F79F
+
  DWORD                   checksum_typeid ;; must be 0x2BC4F79F
  BYTE[64]       checksum
+
  BYTE[64]                 checksum_data
  WORD           count
+
  WORD                     block_count
  QWORD[count]   ''decryption table''
+
  QWORD[block_count]       ''decryption table''
  BYTE[count*512] ''encrypted data''
+
  BYTE[block_count*512]   ''encrypted data''
 
(I think the checksum and encryption method are MD5Cng -- PLJ.)
 
(I think the checksum and encryption method are MD5Cng -- PLJ.)
  

Revision as of 17:29, 9 June 2009

Sims 3:Main Page -> Sims 3:PackedFileTypes


Signed assemblies, encrypted .NET assemblies. They function as the game scripts.

These are the scripts that run when a Sim interacts with an object, or another Sim, or just performs its own inner metabolic processes.

Currently no way is known to get the game to accept piecemeal overrides, so global hacks for a particular assembly as of 6 / 6 / 2009 are having to replace the entire set - meaning that you can only have global hacks for a particular assembly from one creator at a time.

It is probably possible to create new scripts for new custom objects, however. Technical details coming later.

Contents

Where used

  • gameplay.package
  • scripts.package
  • simcore.package

In addition, scripts can be placed in custom content packages and the game will load them when they are referenced. Use of "bare" assemblies via ddfmap.txt is still under investigation.

Data format

(Provided by Rick.)

BOOL                     is_encrypted ;; must be 1, could be is_compressed instead, game rejects anything not 1, so...
DWORD                    checksum_typeid ;; must be 0x2BC4F79F
BYTE[64]                 checksum_data
WORD                     block_count
QWORD[block_count]       decryption table
BYTE[block_count*512]    encrypted data

(I think the checksum and encryption method are MD5Cng -- PLJ.)

Decryption method

Initialise the decryption seed by scanning the decryption table:

foreach(QWORD q in decryption table) decryption seed += q

Truncate (mask off) the decryption seed to the length of decryption table:

decryption seed = decryption seed & (decryption table Length - 1)

Now process each QWORD in the decryption table. Where an entry has bit 0 set, write 512 zero bytes to the output, otherwise, read 512 bytes into a buffer from the encrypted data and process as follows:

foreach(byte b in buffer)
{
  byte value = b;
  b ^= decryption table[decryption seed];
  decryption seed = (decryption seed + value) % (decryption table Length);
}

Then write out the decrypted buffer.

Encryption Method

To encrypt, reverse the process for Decryption. There is no need to create a valid checksum and the decryption table table can be left full of zeros (which saves identifying empty 512 byte chunks).

Note that you will need to run the game with the d3d9x_31.dll hack to make re-imported assemblies work.

Data Content

The decrypted content is a Common Language Runtime assembly.

How the game uses Assemblies

TBC


Sims 3:Main Page -> Sims 3:PackedFileTypes

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox