Jump to content

WIP - Adding UE Explorer support


foxrider67

Recommended Posts

I am currently working on getting UE Explorer (UEE)/UELib to work with Arkham City. I currently have it somewhat decompiling, here is a summary of my changes so far. I'm sorry if the formatting is terrible, I've never made a forum post before. This is also my first time looking at/working with UE3 and I'm not familiar with the engine or it's concepts, so please forgive my ignorance.

 

I haven't looked into identifying City specifically from the package yet, so for now I've been looking at the package version (805) to decide whether to use my changes or not.

 

UExportTableItem

New int following ArchetypeIndex, unknown purpose

 

UObject

Biggest change so far. There are some new bytes at the front, how many depends on if it's a class or not. Default properties seem to come after the UField items (or not at all), and I've only seen "None" so far. Things like UEnum no longer have a default property list, so I've moved the call to DeserializeProperties() to UProperty.

protected virtual void Deserialize()
{
    if (Package.Version >= 805) // City
    {
        if (!IsClassType("Class"))
        { 
            _Buffer.Skip(6);
        } else
        {
            _Buffer.Skip(4);
        }
        return;
    }
    ...
}

UProperty

Here is where the`DerserializeProperties()` call that was originally in UObject is now.

protected override void Deserialize()
{
    base.Deserialize();
    if (Package.Version >= 805) // City
    {
        _Buffer.Skip(4);
        PropertyFlags = _Buffer.ReadUInt64();
        Record("PropertyFlags", PropertyFlags);
        DeserializeProperties(); // name list that ends in none
        _Buffer.Skip(4);
        CategoryIndex = -1;
        return;
    }
    ...
}

The PropertyFlags have changed, too. Here's what I've seen so far:

Parm = 0x00000008U,      // Property is a part of the function parameters
SkipParm = 0x00000020U,      // ??? (not sure about this one, but it is set in ReturnValue)
ReturnParm = 0x00000080U,

UStruct

* New int before ByteScriptSize, unknown purpose

* DataScriptSize does not exist

 

UFunction

I haven't figured out the root cause yet, but it seems like in ByteCodeDecompiler CodePosition is increasing more than it should be for some tokens. This led to the deserialization loop exiting before it finishing parsing all the bytecode tokens. _Container._Buffer.Position is correct, so I'm basing the token deserialization loop off of that instead for now. I've also added a seek after base.Deserialize in UFunction to ensure we pickup the UFunction values even if something funky happened with the bytecode deserialization.

_Buffer.Seek(ScriptOffset + ByteScriptSize, System.IO.SeekOrigin.Begin);

Next up is figuring out where the DefaultPropertys went and resolving their exceptions.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...