Exemplo n.º 1
0
                public override void Deserialize(IUnrealStream stream)
                {
                    if (stream.Version >= 600)
                    {
                        // Points to the object that was passed to the switch,
                        // beware that the followed token chain contains it as well!
                        stream.ReadObjectIndex();
                        Decompiler.AlignObjectSize();
                    }

                    // TODO: Corrigate version
                    if (stream.Version >= 536 && stream.Version <= 587)
                    {
                        PropertyType = stream.ReadUInt16();
                        Decompiler.AlignSize(sizeof(ushort));
                    }
                    else
                    {
                        PropertyType = stream.ReadByte();
                        Decompiler.AlignSize(sizeof(byte));
                    }

                    // Expression
                    DeserializeNext();
                }
Exemplo n.º 2
0
 public override void Deserialize(IUnrealStream stream)
 {
     if (stream.Version == 421)
     {
         Decompiler.AlignSize(sizeof(int));
     }
 }
Exemplo n.º 3
0
                public override void Deserialize(IUnrealStream stream)
                {
#if TRANSFORMERS
                    if (Package.Build == UnrealPackage.GameBuild.BuildName.Transformers)
                    {
                        PropertyType = stream.ReadUInt16();
                        Decompiler.AlignSize(sizeof(ushort));
                        goto deserialize;
                    }
#endif
                    if (stream.Version >= 600)
                    {
                        // Points to the object that was passed to the switch,
                        // beware that the followed token chain contains it as well!
                        stream.ReadObjectIndex();
                        Decompiler.AlignObjectSize();
                    }

                    // TODO: Corrigate version
                    if (stream.Version >= 536 && stream.Version <= 587)
                    {
                        PropertyType = stream.ReadUInt16();
                        Decompiler.AlignSize(sizeof(ushort));
                    }
                    else
                    {
                        PropertyType = stream.ReadByte();
                        Decompiler.AlignSize(sizeof(byte));
                    }

deserialize:
                    // Expression
                    DeserializeNext();
                }
Exemplo n.º 4
0
                public override void Deserialize(IUnrealStream stream)
                {
                    stream.ReadUInt16();    // Size
                    Decompiler.AlignSize(sizeof(ushort));

                    DeserializeNext();
                }
Exemplo n.º 5
0
                public override void Deserialize(IUnrealStream stream)
                {
                    stream.ReadByte();
                    stream.ReadByte();

                    Decompiler.AlignSize(2);
                }
Exemplo n.º 6
0
                public override void Deserialize(IUnrealStream stream)
                {
                    // Property index
                    MemberProperty = Decompiler._Container.TryGetIndexObject(stream.ReadObjectIndex()) as UField;
                    Decompiler.AlignObjectSize();

                    // TODO: Corrigate version. Definitely didn't exist in Roboblitz(369)
                    if (stream.Version > 369)
                    {
                        // Struct index
                        stream.ReadObjectIndex();
                        Decompiler.AlignObjectSize();
#if MKKE
                        if (Package.Build != UnrealPackage.GameBuild.BuildName.MKKE)
                        {
#endif
                        stream.Position++;
                        Decompiler.AlignSize(sizeof(byte));
#if MKKE
                    }
#endif

                        // TODO: Corrigate version. Definitely didn't exist in MKKE(472), first seen in SWG(486).
                        if (stream.Version > 472)
                        {
                            stream.Position++;
                            Decompiler.AlignSize(sizeof(byte));
                        }
                    }
                    // Pre-Context
                    DeserializeNext();
                }
Exemplo n.º 7
0
                public override void Deserialize(IUnrealStream stream)
                {
                    var propertyAdded = stream.Version >= VSizeByteMoved;

                    // A.?
                    DeserializeNext();

                    // SkipSize
                    stream.ReadUInt16();
                    Decompiler.AlignSize(sizeof(ushort));

                    // Doesn't seem to exist in APB
                    if (propertyAdded)
                    {
                        // Property
                        stream.ReadObjectIndex();
                        Decompiler.AlignObjectSize();
                    }

                    // PropertyType
                    stream.ReadByte();
                    Decompiler.AlignSize(sizeof(byte));

                    // Additional byte in APB?
                    if (stream.Version > 512 && !propertyAdded)
                    {
                        stream.ReadByte();
                        Decompiler.AlignSize(sizeof(byte));
                    }

                    // ?.B
                    DeserializeNext();
                }
Exemplo n.º 8
0
 public override void Deserialize(IUnrealStream stream)
 {
     X = stream.UR.ReadSingle();
     Decompiler.AlignSize(sizeof(float));
     Y = stream.UR.ReadSingle();
     Decompiler.AlignSize(sizeof(float));
     Z = stream.UR.ReadSingle();
     Decompiler.AlignSize(sizeof(float));
 }
Exemplo n.º 9
0
 public override void Deserialize(IUnrealStream stream)
 {
     Value.Pitch = stream.ReadInt32();
     Decompiler.AlignSize(sizeof(int));
     Value.Yaw = stream.ReadInt32();
     Decompiler.AlignSize(sizeof(int));
     Value.Roll = stream.ReadInt32();
     Decompiler.AlignSize(sizeof(int));
 }
Exemplo n.º 10
0
                public override void Deserialize(IUnrealStream stream)
                {
                    if (stream.Version == 421)
                    {
                        Decompiler.AlignSize(sizeof(int));
                    }

                    Function = stream.ReadObject() as UFunction;
                    Decompiler.AlignObjectSize();

                    DeserializeCall();
                }
Exemplo n.º 11
0
 public override void Deserialize(IUnrealStream stream)
 {
     // Version
     stream.ReadInt32();
     // Line
     stream.ReadInt32();
     // Pos
     stream.ReadInt32();
     // Code
     stream.ReadByte();
     Decompiler.AlignSize(13);
 }
Exemplo n.º 12
0
                public override void Deserialize(IUnrealStream stream)
                {
                    stream.ReadUInt16();    // Line
                    Decompiler.AlignSize(sizeof(short));

                    // TODO: Corrigate version, at least known since Mirrors Edge(536)
                    if (stream.Version >= 536)
                    {
                        DebugMode = stream.ReadByte() > 0;
                        Decompiler.AlignSize(sizeof(byte));
                    }
                    DeserializeNext();
                }
Exemplo n.º 13
0
                public override void Deserialize(IUnrealStream stream)
                {
                    // Expression
                    DeserializeNext();

                    // Param 1
                    DeserializeNext();

                    HasSecondParm = stream.ReadByte() > 0;
                    Decompiler.AlignSize(sizeof(byte));
                    DeserializeNext();

                    base.Deserialize(stream);
                }
Exemplo n.º 14
0
                public override void Deserialize(IUnrealStream stream)
                {
                    stream.ReadUInt16();    // Size
                    Decompiler.AlignSize(sizeof(ushort));

                    // FIXME: MOHA or general?
                    if (stream.Version == 421)
                    {
                        Decompiler.AlignSize(sizeof(ushort));
                    }

                    DeserializeNext();  // Expression
                    DeserializeNext();  // EndParmValue
                }
Exemplo n.º 15
0
                public override void Deserialize(IUnrealStream stream)
                {
                    // FIXME: MOHA or general?
                    if (stream.Version == 421)
                    {
                        Decompiler.AlignSize(sizeof(int));
                    }

                    // Unknown purpose.
                    NameIndex = stream.ReadNameIndex();
                    Decompiler.AlignNameSize();

                    // TODO: Corrigate version. Seen in version ~648(The Ball) may have been introduced earlier, but not prior 610.
                    if (stream.Version > 610)
                    {
                        base.Deserialize(stream);
                    }
                }
Exemplo n.º 16
0
                public override void Deserialize(IUnrealStream stream)
                {
                    // TODO: Corrigate Version
                    if (stream.Version > 180)
                    {
                        ++stream.Position;  // ReadByte()
                        Decompiler.AlignSize(sizeof(byte));
                    }

                    // Delegate object index
                    stream.ReadObjectIndex();
                    Decompiler.AlignObjectSize();

                    // Delegate name index
                    FunctionNameIndex = stream.ReadNameIndex();
                    Decompiler.AlignNameSize();

                    DeserializeCall();
                }
Exemplo n.º 17
0
                public override void Deserialize(IUnrealStream stream)
                {
                    // TODO: Corrigate Version (Definitely not in MOHA, but in roboblitz(369))
                    if (stream.Version >= 178 && stream.Version < 421 /*MOHA*/)
                    {
                        byte isSuperCall = stream.ReadByte();
                        Decompiler.AlignSize(sizeof(byte));
                    }

                    if (stream.Version == 421)
                    {
                        Decompiler.AlignSize(sizeof(int));
                    }

                    FunctionNameIndex = stream.ReadNameIndex();
                    Decompiler.AlignNameSize();

                    DeserializeCall();
                }
Exemplo n.º 18
0
                public override void Deserialize(IUnrealStream stream)
                {
                    // Condition
                    DeserializeNext();

                    // Size. Used to skip ? if Condition is False.
                    stream.ReadUInt16();
                    Decompiler.AlignSize(sizeof(ushort));

                    // If TRUE expression
                    DeserializeNext();

                    // Size. Used to skip : if Condition is True.
                    stream.ReadUInt16();
                    Decompiler.AlignSize(sizeof(ushort));

                    // If FALSE expression
                    DeserializeNext();
                }
Exemplo n.º 19
0
                protected virtual void DeserializeMethodOne(IUnrealStream stream, bool skipEndParms = false)
                {
                    // Array
                    DeserializeNext();

                    if (stream.Version > ArrayMethodSizeParmsVersion)
                    {
                        // Size
                        stream.Skip(2);
                        Decompiler.AlignSize(sizeof(ushort));
                    }

                    // Param 1
                    DeserializeNext();

                    if (stream.Version > ArrayMethodEndParmsVersion && !skipEndParms)
                    {
                        // EndParms
                        DeserializeNext();
                    }
                }
Exemplo n.º 20
0
                public override void Deserialize(IUnrealStream stream)
                {
                    var topFunc = Decompiler._Container as UFunction;

                    Debug.Assert(topFunc != null, "topf != null");
                    foreach (var property in topFunc.Variables)
                    {
                        if (!property.HasPropertyFlag(Flags.PropertyFlagsLO.Parm | Flags.PropertyFlagsLO.ReturnParm))
                        {
                            continue;
                        }

                        stream.ReadByte(); // Size
                        Decompiler.AlignSize(sizeof(byte));

                        stream.ReadByte(); // bOutParam
                        Decompiler.AlignSize(sizeof(byte));
                    }
                    stream.ReadByte();  // End
                    Decompiler.AlignSize(sizeof(byte));
                }
Exemplo n.º 21
0
                public override void Deserialize(IUnrealStream stream)
                {
                    var propertyAdded = stream.Version >= VSizeByteMoved
#if TERA
                                        && stream.Package.Build != UnrealPackage.GameBuild.BuildName.Tera
#endif
#if TRANSFORMERS
                                        && stream.Package.Build != UnrealPackage.GameBuild.BuildName.Transformers
#endif
                    ;

                    // A.?
                    DeserializeNext();

                    // SkipSize
                    stream.ReadUInt16();
                    Decompiler.AlignSize(sizeof(ushort));

                    // Doesn't seem to exist in APB
                    if (propertyAdded)
                    {
                        // Property
                        stream.ReadObjectIndex();
                        Decompiler.AlignObjectSize();
                    }

                    // PropertyType
                    stream.ReadByte();
                    Decompiler.AlignSize(sizeof(byte));

                    // Additional byte in APB?
                    if (stream.Version > 512 && !propertyAdded)
                    {
                        stream.ReadByte();
                        Decompiler.AlignSize(sizeof(byte));
                    }

                    // ?.B
                    DeserializeNext();
                }
Exemplo n.º 22
0
                public override void Deserialize(IUnrealStream stream)
                {
                    var label    = String.Empty;
                    int labelPos = -1;

                    do
                    {
                        if (label != String.Empty)
                        {
                            Decompiler._Labels.Add
                            (
                                new ULabelEntry
                            {
                                Name     = label,
                                Position = labelPos
                            }
                            );
                        }
                        label = stream.ReadName();
                        Decompiler.AlignNameSize();
                        labelPos = stream.ReadInt32();
                        Decompiler.AlignSize(sizeof(int));
                    } while(String.Compare(label, "None", StringComparison.OrdinalIgnoreCase) != 0);
                }
Exemplo n.º 23
0
 public override void Deserialize(IUnrealStream stream)
 {
     CodeOffset = stream.ReadUInt16();
     Decompiler.AlignSize(sizeof(ushort));
 }
Exemplo n.º 24
0
 public override void Deserialize(IUnrealStream stream)
 {
     Value = stream.UR.ReadAnsi();
     Decompiler.AlignSize(Value.Length + 1);     // inc null char
 }
Exemplo n.º 25
0
 public override void Deserialize(IUnrealStream stream)
 {
     LocalIndex = stream.ReadInt32();
     Decompiler.AlignSize(sizeof(int));
 }
Exemplo n.º 26
0
 public override void Deserialize(IUnrealStream stream)
 {
     Value = stream.UR.ReadUnicode();
     Decompiler.AlignSize((Value.Length * 2) + 2);   // inc null char
 }
Exemplo n.º 27
0
 public override void Deserialize(IUnrealStream stream)
 {
     stream.ReadByte();  // Size
     Decompiler.AlignSize(sizeof(byte));
 }