Example #1
0
        public override void Read(IOMemoryStream ms)
        {
            //Read type
            structType = ms.ReadUEString();

            //Skip
            ms.position += length;
        }
        public static ArkClassName ReadFromFile(IOMemoryStream ms)
        {
            ArkClassName cn = new ArkClassName();

            cn.classname = ms.ReadUEString();
            cn.index     = ms.ReadInt();
            return(cn);
        }
        public static ArkClassName ReadFromFileInline(IOMemoryStream ms)
        {
            ArkClassName cn = new ArkClassName();

            //Read classname from the file.
            cn.classname = ms.ReadUEString();
            return(cn);
        }
        public override void Read(IOMemoryStream ms)
        {
            //Read first enum
            enumName = ms.ReadUEString();

            //If this is None, this is a normal byte
            isNormalByte = enumName == "None";

            //Read accordingly
            if (isNormalByte)
            {
                byteValue = ms.ReadByte();
            }
            else
            {
                enumValue = ms.ReadUEString(); //Untested! Todo
            }
        }
        public override void Read(IOMemoryStream ms)
        {
            //We don't care much about arrays, so we'll skip them.

            //Read the type of the array
            arrayType = ms.ReadUEString();

            //Skip
            ms.position += length;
        }
Example #6
0
        public static string[] ReadStringArray(IOMemoryStream ms)
        {
            //Read a standard array. First, read the Int32 of the length
            int length = ms.ReadInt();

            //Create an array and read in strings
            string[] array = new string[length];
            for (int i = 0; i < length; i++)
            {
                array[i] = ms.ReadUEString();
            }
            return(array);
        }
Example #7
0
        static void OpenStructurePlacerBlueprintFile(string path = @"C:\Program Files (x86)\Steam\steamapps\common\ARK\ShooterGame\Content\PrimalEarth\Structures\StructurePlacerBlueprint.uasset")
        {
            //Open a Stream on this file and open an IO memory stream.
            IOMemoryStream ms = OpenMemoryStreamFromFile(path);

            //Skip to strings offset.
            ms.position = 171;
            //Begin reading strings until we fail.
            try
            {
                while (true)
                {
                    Console.WriteLine(ms.ReadUEString(256));
                }
            } catch
            {
            }
        }
        public InlineArrayProperty(IOMemoryStream ms) : base(ms)
        {
            //Read type
            arrayType = ms.ReadInlineArkClassname();

            if (arrayType.classname == "StrProperty")
            {
                //Read string array
                int count = ms.ReadInt();
                data = new string[count];
                for (int i = 0; i < count; i += 1)
                {
                    data[i] = ms.ReadUEString();
                }
            }
            else
            {
                //Skip
                ms.position += length;
            }
        }
Example #9
0
        public DotArkEmbededBinaryData(IOMemoryStream ms)
        {
            //First, read the path.
            path = ms.ReadUEString();
            //Now, read the parts. This seems to be split up into part -> blob -> inner blob
            int parts = ms.ReadInt();

            data = new byte[parts][][];
            //Loop through each of the parts
            for (int i = 0; i < parts; i++)
            {
                int      blobs    = ms.ReadInt();
                byte[][] partData = new byte[blobs][];

                for (int j = 0; j < blobs; j++)
                {
                    int blobSize = ms.ReadInt() * 4; //Array of 32 bit integers.
                    partData[j] = ms.ReadBytes(blobSize);
                }

                data[i] = partData;
            }
        }
Example #10
0
        public InlineFile ReadInlineFile(MemoryStream mms)
        {
            //Open IO ms
            IOMemoryStream ms = new IOMemoryStream(mms, true);

            //Skip the unknown header of 24 bytes
            ms.position = 24;

            //Read in the additional header
            ms.ReadUEString(); //PrimalPlayerDataBP_C
            ms.ReadInt();
            ms.ReadInt();
            ms.ReadUEString(); //PrimalPlayerDataBP_C_5
            ms.ReadUEString(); //ArkGameMode
            ms.ReadUEString(); //PersistentLevel
            ms.ReadUEString(); //Extinction (or map name)
            ms.ReadUEString(); //(Game map path)
            ms.ReadInt();
            ms.ReadInt();
            ms.ReadInt();
            ms.ReadInt();
            ms.ReadInt();

            //Start reading props
            List <InlineProperty> props = new List <InlineProperty>();
            InlineProperty        p     = InlineProperty.ReadProperty(ms);

            while (p != null)
            {
                props.Add(p);
                p = InlineProperty.ReadProperty(ms);
            }

            return(new InlineFile
            {
                props = props
            });
        }
Example #11
0
        public static ARKDinoDataObject ReadFromFile(IOMemoryStream ms)
        {
            //Skip some unknown data, not even sure if this is part of the struct
            ms.position += 4 * 4;

            //Read
            ARKDinoDataObject h = new ARKDinoDataObject();

            h.name     = ms.ReadUEString();
            h.unknown1 = ms.ReadInt();
            h.unknown2 = ms.ReadInt();
            h.type     = ms.ReadUEString();
            h.unknown3 = ms.ReadUEString();
            h.unknown4 = ms.ReadUEString();
            h.unknown5 = ms.ReadUEString();
            if (h.unknown2 == 5) //Don't know why
            {
                h.unknown52 = ms.ReadUEString();
            }

            //Don't understand any of this section, but seems to work
            h.unknown6 = ms.ReadInt();
            h.unknown7 = ms.ReadInt();
            int test = ms.ReadInt();

            if (test == 1)
            {
                ms.position += 6 * 4;
            }

            //Read more
            h.payloadStart = ms.ReadInt();
            h.unknown8     = ms.ReadInt();

            return(h);
        }
 public override void Read(IOMemoryStream ms)
 {
     value = ms.ReadUEString();
 }
Example #13
0
        public static BaseProperty ReadProperty(IOMemoryStream ms)
        {
            //Read name
            string name;

            try
            {
                name = ms.ReadUEString();
                if (name == "None")
                {
                    return(null);
                }
            } catch (Exception ex)
            {
                throw ex;
            }

            //Read type
            string type = ms.ReadUEString();

            if (name == "None")
            {
                return(null);
            }

            //Create type
            BaseProperty p;

            switch (type)
            {
            case "FloatProperty": p = new FloatProperty(); break;

            case "BoolProperty": p = new BoolProperty(); break;

            case "IntProperty": p = new IntProperty(); break;

            case "ObjectProperty": p = new ObjectProperty(); break;

            case "StrProperty": p = new StrProperty(); break;

            case "UInt32Property": p = new UInt32Property(); break;

            case "ByteProperty": p = new ByteProperty(); break;

            case "DoubleProperty": p = new DoubleProperty(); break;

            case "UInt64Property": p = new UInt64Property(); break;

            case "UInt16Property": p = new UInt16Property(); break;

            case "ArrayProperty": p = new ArrayProperty(); break;

            case "Int8Property": p = new Int8Property(); break;

            case "StructProperty": p = new StructProperty(); break;

            default: throw new Exception("Unexpected type " + type + "!");
            }

            //Set values
            p.name = name;
            p.type = type;

            //Read additional parts
            p.length = ms.ReadInt();
            p.index  = ms.ReadInt();

            //Now, read data
            p.Read(ms);

            return(p);
        }
Example #14
0
 public InlineStrProperty(IOMemoryStream ms) : base(ms)
 {
     value = ms.ReadUEString();
 }
Example #15
0
 public override void ReadStruct(IOMemoryStream ms, UAssetFile f, StructProperty s)
 {
     unk   = ms.ReadInt();
     netId = ms.ReadUEString();
 }
Example #16
0
 public override void ReadStruct(IOMemoryStream ms, UAssetFile f, StructProperty s)
 {
     name = ms.ReadUEString();
 }
 public ArkStructUniqueNetId(IOMemoryStream ms, ArkClassName structType)
 {
     unk   = ms.ReadInt();
     netId = ms.ReadUEString();
 }
Example #18
0
 public override void Read(IOMemoryStream ms, UAssetFile f)
 {
     data = ms.ReadUEString();
 }