예제 #1
0
 public void Deserialize( IUnrealStream stream )
 {
     FileName = stream.ReadText();
     SerialOffset = (uint)stream.ReadIndex();
     SerialSize = (uint)stream.ReadIndex();
     FileFlags = stream.ReadUInt32();
 }
예제 #2
0
 public void Serialize(IUnrealStream stream)
 {
     stream.Serialize(ref this.R);
     stream.Serialize(ref this.G);
     stream.Serialize(ref this.B);
     stream.Serialize(ref this.A);
 }
예제 #3
0
 public void Deserialize( IUnrealStream stream )
 {
     FileTableOffset = stream.ReadUInt32();
     FileSize = stream.ReadUInt32();
     Version = stream.ReadUInt32();
     CRC32 = stream.ReadUInt32();
 }
예제 #4
0
 public void Serialize(IUnrealStream stream)
 {
     stream.Serialize(ref this.PowerName);
     stream.Serialize(ref this.CurrentRank);
     stream.Serialize(ref this.PowerClassName);
     stream.Serialize(ref this.WheelDisplayIndex);
 }
예제 #5
0
 public void Serialize(IUnrealStream stream)
 {
     stream.Serialize(ref this.SecondsSinceMidnight);
     stream.Serialize(ref this.Day);
     stream.Serialize(ref this.Month);
     stream.Serialize(ref this.Year);
 }
예제 #6
0
        public void Deserialize( IUnrealStream stream )
        {
            Name = stream.ReadText();

            // Mass effect 2
            if (stream.Version == 512)
            {
                Flags = stream.ReadUInt32();
            }
            else
            {
                Flags = stream.Version >= QWORDVersion ? stream.ReadUInt64() : stream.ReadUInt32();
            }
            #if DEOBFUSCATE
            // De-obfuscate names that contain unprintable characters!
            foreach( char c in Name )
            {
                if( !char.IsLetterOrDigit( c ) )
                {
                    Name = "N" + TableIndex + "_OBF";
                    break;
                }
            }
            #endif
        }
예제 #7
0
                public override void Deserialize( IUnrealStream stream )
                {
                    CastedObject = stream.ReadObject();
                    Decompiler.AlignObjectSize();

                    base.Deserialize( stream );
                }
 public void Deserialize( IUnrealStream stream )
 {
     UncompressedOffset = stream.ReadInt32();
     UncompressedSize = stream.ReadInt32();
     CompressedOffset = stream.ReadInt32();
     CompressedSize = stream.ReadInt32();
 }
예제 #9
0
 public static void Deserialize(this List <int> indexes, IUnrealStream stream)
 {
     indexes.Capacity = stream.ReadInt32();
     for (int i = 0; i < indexes.Capacity; ++i)
     {
         indexes.Add(stream.ReadIndex());
     }
 }
예제 #10
0
 public void Serialize(IUnrealStream stream)
 {
     stream.Serialize(ref this._MarkerOwnerPath);
     stream.Serialize(ref this._MarkerOffset);
     stream.Serialize(ref this._MarkerLabel);
     stream.Serialize(ref this._BoneToAttachTo);
     stream.SerializeEnum(ref this._MarkerIconType);
 }
예제 #11
0
 public void Serialize(IUnrealStream stream)
 {
     Console.WriteLine("Writing import " + ObjectName + " at " + stream.Position);
     stream.Write(PackageName);
     stream.Write(_ClassName);
     stream.Write(OuterTable != null ? (int)OuterTable.Object : 0);   // Always an ordinary integer
     stream.Write(ObjectName);
 }
예제 #12
0
 public override void Deserialize(IUnrealStream stream)
 {
     base.Deserialize(stream);
     if (CodeOffset != UInt16.MaxValue)
     {
         DeserializeNext(); // Condition
     }                      // Else "Default:"
 }
예제 #13
0
                public override void Deserialize(IUnrealStream stream)
                {
                    // CodeOffset
                    base.Deserialize(stream);

                    // Condition
                    DeserializeNext();
                }
예제 #14
0
 public void Serialize(IUnrealStream stream)
 {
     Log.Info($"Writing import {ObjectName} at {stream.Position}");
     stream.Write(PackageName);
     stream.Write(_ClassName);
     stream.Write(OuterTable != null ? (int)OuterTable.Object : 0);   // Always an ordinary integer
     stream.Write(ObjectName);
 }
예제 #15
0
        public void Deserialize( IUnrealStream stream )
        {
            var index = stream.ReadNameIndex( out _Number );
            _NameItem = stream.Package.Names[index];

            Debug.Assert( _NameItem != null, "_NameItem cannot be null! " + index );
            Debug.Assert( _Number >= -1, "Invalid _Number value! " + _Number );
        }
                public void Deserialize( IUnrealStream stream )
                {
                    _CompressedSize = stream.ReadInt32();
                    _UncompressedSize = stream.ReadInt32();

                    _CompressedData = new byte[_CompressedSize];
                    stream.Read( _CompressedData, 0, _CompressedSize );
                }
예제 #17
0
                public override void Deserialize( IUnrealStream stream )
                {
                    // Key
                    DeserializeNext();

                    // Array
                    DeserializeNext();
                }
예제 #18
0
 public void Serialize( IUnrealStream stream )
 {
     Console.WriteLine( "Writing import " + ObjectName + " at " + stream.Position );
     stream.Write( PackageName );
     stream.Write( _ClassName );
     stream.Write( OuterTable != null ? (int)OuterTable.Object : 0 ); // Always an ordinary integer
     stream.Write( ObjectName );
 }
 public void Serialize( IUnrealStream stream )
 {
     // TODO: Implement code
     stream.Write( UncompressedOffset );
     stream.Write( UncompressedSize );
     stream.Write( CompressedOffset );
     stream.Write( CompressedSize );
 }
예제 #20
0
                public override void Deserialize(IUnrealStream stream)
                {
                    // Key
                    DeserializeNext();

                    // Array
                    DeserializeNext();
                }
예제 #21
0
 public void Serialize(IUnrealStream stream)
 {
     stream.Serialize(ref this.Unknown0);
     stream.Serialize(ref this.Unknown1);
     stream.Serialize(ref this.Unknown2);
     stream.Serialize(ref this.Unknown3);
     stream.Serialize(ref this.Unknown4);
     stream.Serialize(ref this.Unknown5);
 }
예제 #22
0
 public void Deserialize( IUnrealStream stream )
 {
     Console.WriteLine( "Reading import " + Index + " at " + stream.Position );
     PackageName         = stream.ReadNameReference();
     _ClassName          = stream.ReadNameReference();
     ClassIndex         = (int)_ClassName;
     OuterIndex          = stream.ReadInt32(); // ObjectIndex, though always written as 32bits regardless of build.
     ObjectName          = stream.ReadNameReference();
 }
예제 #23
0
 public void Serialize( IUnrealStream stream )
 {
     stream.WriteIndex( _Index );
     if( stream.Version >= VNameNumbered )
     {
         Console.WriteLine( _Number + " " + _Text );
         stream.Write( (uint)_Number + 1 );
     }
 }
예제 #24
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));
 }
예제 #25
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));
 }
예제 #26
0
                public override void Deserialize(IUnrealStream stream)
                {
                    DeserializeNext();  // Left
                    // ==
                    DeserializeNext();  // Right

                    // End
                    DeserializeNext();
                }
예제 #27
0
        public void Deserialize(IUnrealStream stream)
        {
            var index = stream.ReadNameIndex(out _Number);

            _NameItem = stream.Package.Names[index];

            Debug.Assert(_NameItem != null, "_NameItem cannot be null! " + index);
            Debug.Assert(_Number >= -1, "Invalid _Number value! " + _Number);
        }
예제 #28
0
 public void Serialize(IUnrealStream stream)
 {
     stream.WriteIndex(_Index);
     if (stream.Version >= VNameNumbered)
     {
         Console.WriteLine(_Number + " " + _Text);
         stream.Write((uint)_Number + 1);
     }
 }
예제 #29
0
 public void Serialize( IUnrealStream stream )
 {
     stream.Write( ExportsCount );
     stream.Write( NamesCount );
     if( stream.Version >= VNetObjectsCount )
     {
         stream.Write( NetObjectsCount );
     }
 }
예제 #30
0
 public void Deserialize(IUnrealStream stream)
 {
     Console.WriteLine("Reading import " + Index + " at " + stream.Position);
     PackageName = stream.ReadNameReference();
     _ClassName  = stream.ReadNameReference();
     ClassIndex  = (int)_ClassName;
     OuterIndex  = stream.ReadInt32();         // ObjectIndex, though always written as 32bits regardless of build.
     ObjectName  = stream.ReadNameReference();
 }
예제 #31
0
 public void Serialize(IUnrealStream stream)
 {
     stream.Serialize(ref this._AssaultRifle);
     stream.Serialize(ref this._Shotgun);
     stream.Serialize(ref this._SniperRifle);
     stream.Serialize(ref this._SubmachineGun);
     stream.Serialize(ref this._Pistol);
     stream.Serialize(ref this._HeavyWeapon);
 }
예제 #32
0
 public void Deserialize(IUnrealStream stream)
 {
     Log.Debug($"Reading import {Index} at {stream.Position}");
     PackageName = stream.ReadNameReference();
     _ClassName  = stream.ReadNameReference();
     ClassIndex  = (int)_ClassName;
     OuterIndex  = stream.ReadInt32();         // ObjectIndex, though always written as 32bits regardless of build.
     ObjectName  = stream.ReadNameReference();
 }
예제 #33
0
                public override void Deserialize( IUnrealStream stream )
                {
                    stream.ReadObjectIndex();
                    Decompiler.AlignObjectSize();

                    DeserializeNext();
                    // ==
                    DeserializeNext();
                }
예제 #34
0
                public override void Deserialize( IUnrealStream stream )
                {
                    // TODO: Corrigate version.
                    if( stream.Version <= 300 )
                        return;

                    _ReturnObject = Decompiler._Container.TryGetIndexObject( stream.ReadObjectIndex() );
                    Decompiler.AlignObjectSize();
                }
예제 #35
0
 public void Serialize(IUnrealStream stream)
 {
     stream.Write(ExportsCount);
     stream.Write(NamesCount);
     if (stream.Version >= VNetObjectsCount)
     {
         stream.Write(NetObjectsCount);
     }
 }
예제 #36
0
 public void Deserialize(IUnrealStream stream)
 {
     ExportsCount = stream.ReadInt32();
     NamesCount   = stream.ReadInt32();
     if (stream.Version >= VNetObjectsCount)
     {
         NetObjectsCount = stream.ReadInt32();
     }
 }
예제 #37
0
                public override void Deserialize(IUnrealStream stream)
                {
                    stream.ReadObjectIndex();
                    Decompiler.AlignObjectSize();

                    DeserializeNext();
                    // ==
                    DeserializeNext();
                }
예제 #38
0
 public void Serialize(IUnrealStream stream)
 {
     stream.Serialize(ref this.Unknown0);
     stream.Serialize(ref this.Unknown1);
     stream.Serialize(ref this.Unknown2);
     stream.Serialize(ref this.Unknown3);
     stream.Serialize(ref this.Unknown4);
     stream.Serialize(ref this.Unknown5);
 }
예제 #39
0
            public void Deserialize( IUnrealStream stream )
            {
                _StartU = stream.ReadInt32();
                _StartV = stream.ReadInt32();

                _USize = stream.ReadInt32();
                _VSize = stream.ReadInt32();

                _TextureIndex = stream.ReadByte();
            }
예제 #40
0
            public void Deserialize(IUnrealStream stream)
            {
                _StartU = stream.ReadInt32();
                _StartV = stream.ReadInt32();

                _USize = stream.ReadInt32();
                _VSize = stream.ReadInt32();

                _TextureIndex = stream.ReadByte();
            }
예제 #41
0
 public void Serialize(IUnrealStream stream)
 {
     stream.Serialize(ref this._ClassName);
     stream.Serialize(ref this._AmmoUsedCount);
     stream.Serialize(ref this._AmmoTotal);
     stream.Serialize(ref this._CurrentWeapon);
     stream.Serialize(ref this._WasLastWeapon);
     stream.Serialize(ref this._AmmoPowerName, s => s.Version < 17, () => null);
     stream.Serialize(ref this._AmmoPowerSourceTag, s => s.Version < 59, () => null);
 }
예제 #42
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (!disposing)
            {
                return;
            }

            _UnrealStream = null;
        }
        public override void Write(IUnrealStream stream, UnrealPackage package)
        {
            FixNameIndexAtPosition(package, "SizeX", 4);
            FixNameIndexAtPosition(package, "IntProperty", 12);


            FixNameIndexAtPosition(package, "None", 32);
            stream.Write(minimalByteArray, 0, serialSize - 4);
            stream.Write((int)stream.Position + sizeof(int));
        }
예제 #44
0
            public void Deserialize( IUnrealStream stream )
            {
                Class = stream.ReadObjectIndex();

                // Deep
                stream.ReadInt32();

                // ScriptTextCRC
                stream.ReadUInt32();
            }
예제 #45
0
 internal void Serialize(IUnrealStream stream)
 {
     stream.Write(sizeX);
     stream.Write(sizeY);
     stream.Write(dataSize);
     if (dataSize > 0)
     {
         stream.Write(data, 0, data.Length);
     }
 }
            public void Deserialize(IUnrealStream stream)
            {
                Class = stream.ReadObjectIndex();

                // Deep
                stream.ReadInt32();

                // ScriptTextCRC
                stream.ReadUInt32();
            }
 /// <summary>
 /// Initialize this array with items in the specified stream.
 /// </summary>
 /// <param name="stream">The stream to use for initializing this array.</param>
 /// <param name="count">The size to allocate for the list.</param>
 public void Deserialize(IUnrealStream stream, int count)
 {
     Capacity = count;
     for (int i = 0; i < count; ++i)
     {
         T item = new T();
         item.Deserialize(stream);
         Add(item);
     }
 }
예제 #48
0
        public List <int> CodexIDs;            // +4C

        public void Serialize(IUnrealStream stream)
        {
            stream.Serialize(ref this.BoolVariables);
            stream.Serialize(ref this.IntVariables);
            stream.Serialize(ref this.FloatVariables);
            stream.Serialize(ref this.QuestProgressCounter);
            stream.Serialize(ref this.QuestProgress);
            stream.Serialize(ref this.QuestIDs);
            stream.Serialize(ref this.CodexEntries);
            stream.Serialize(ref this.CodexIDs);
        }
예제 #49
0
                public override void Deserialize( IUnrealStream stream )
                {
                    // Array
                    DeserializeNext();

                    // Param 1
                    DeserializeNext();

                    // EndParms
                    DeserializeNext();
                }
예제 #50
0
                public override void Deserialize(IUnrealStream stream)
                {
                    // TODO: Corrigate version.
                    if (stream.Version <= 300)
                    {
                        return;
                    }

                    _ReturnObject = Decompiler._Container.TryGetIndexObject(stream.ReadObjectIndex());
                    Decompiler.AlignObjectSize();
                }
예제 #51
0
                public override void Deserialize(IUnrealStream stream)
                {
                    // Array
                    DeserializeNext();

                    // Param 1
                    DeserializeNext();

                    // EndParms
                    DeserializeNext();
                }
예제 #52
0
        public List<int> CodexIDs; // +4C

        public void Serialize(IUnrealStream stream)
        {
            stream.Serialize(ref this.BoolVariables);
            stream.Serialize(ref this.IntVariables);
            stream.Serialize(ref this.FloatVariables);
            stream.Serialize(ref this.QuestProgressCounter);
            stream.Serialize(ref this.QuestProgress);
            stream.Serialize(ref this.QuestIDs);
            stream.Serialize(ref this.CodexEntries);
            stream.Serialize(ref this.CodexIDs);
        }
예제 #53
0
        public static string ReadName(this IUnrealStream stream)
        {
            int num;
            var name = stream.Package.GetIndexName(stream.ReadNameIndex(out num));

            if (num > UName.Numeric)
            {
                name += "_" + num;
            }
            return(name);
        }
예제 #54
0
        public void Deserialize( IUnrealStream stream )
        {
            if( stream.ReadUInt32() != Signature )
            {
                throw new System.IO.FileLoadException( stream + " isn't a UnrealMod file!" );
            }

            Summary = new FileSummary();
            Summary.Deserialize( stream );

            stream.Seek( Summary.FileTableOffset, System.IO.SeekOrigin.Begin );
            FileTableList = new UArray<FileTable>( stream );
        }
예제 #55
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();
                }
예제 #56
0
        public void Serialize(IUnrealStream stream)
        {
            stream.Serialize(ref this.WeaponClassName);
            stream.Serialize(ref this.AmmoUsedCount);
            stream.Serialize(ref this.TotalAmmo);
            stream.Serialize(ref this.CurrentWeapon);
            stream.Serialize(ref this.LastWeapon);

            if (stream.Version >= 17)
            {
                stream.Serialize(ref this.AmmoPowerName);
            }
        }
예제 #57
0
 public void Serialize(IUnrealStream stream)
 {
     stream.Serialize(ref this.HairMesh);
     stream.Serialize(ref this.AccessoryMeshes);
     stream.Serialize(ref this.MorphFeatures);
     stream.Serialize(ref this.OffsetBones);
     stream.Serialize(ref this.LOD0Vertices);
     stream.Serialize(ref this.LOD1Vertices);
     stream.Serialize(ref this.LOD2Vertices);
     stream.Serialize(ref this.LOD3Vertices);
     stream.Serialize(ref this.ScalarParameters);
     stream.Serialize(ref this.VectorParameters);
     stream.Serialize(ref this.TextureParameters);
 }
예제 #58
0
 public void Deserialize( IUnrealStream stream )
 {
     if( stream.Version <= 540 )
     {
         // e.g. Core.Object.X
         FieldName = stream.ReadText();
     }
     else
     {
         FieldIndex = stream.ReadObjectIndex();
     }
     MetaTags = new UArray<UMetaTag>();
     MetaTags.Deserialize( stream, tag => tag.Owner = Owner );
 }
            public void Deserialize( IUnrealStream stream )
            {
                _Signature = stream.ReadUInt32();
                if( _Signature != UnrealPackage.Signature )
                {
                    throw new System.IO.FileLoadException( "Unrecognized signature!" );
                }
                _BlockSize = stream.ReadInt32();
                _CompressedSize = stream.ReadInt32();
                _UncompressedSize = stream.ReadInt32();

                int blockCount = (int)Math.Ceiling( _UncompressedSize / (float)_BlockSize );
                Blocks = new UArray<CompressedChunkBlock>( stream, blockCount );
            }
예제 #60
0
                public override void Deserialize( IUnrealStream stream )
                {
                    // Expression
                    DeserializeNext();

                    // Param 1
                    DeserializeNext();

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

                    base.Deserialize( stream );
                }