Beispiel #1
0
        public void Write(string path)
        {
            var stream = File.Open(path, FileMode.Create);
            var writer = new MarkedBinaryWriter(stream);

            writer.Write(0x32465052); // RPF2

            writer.Mark("tocSize");
            writer.Write(0);

            writer.Mark("numEntries");
            writer.Write(0);

            writer.Write(0);
            writer.Write(0); // not encrypted; for now

            writer.Align(2048);

            // write a TOC for the file
            RootEntry.Write(writer);
            RootEntry.WriteSubEntries(writer);
            RootEntry.WriteNames(writer);

            writer.WriteMark("numEntries", (uint)writer.WriteIdx);

            writer.Align(2048);

            // this has to be aligned or it will be cut off by 16 byte align
            writer.WriteMark("tocSize", (uint)stream.Position - 2048);

            RootEntry.WriteFiles(writer);

            writer.Close();
        }
Beispiel #2
0
        internal void Write(MarkedBinaryWriter writer)
        {
            // write our entry
            //if (Name != "")
            {
                writer.Mark("nOff_" + Name);
                writer.Write(0);

                if (!IsDirectory)
                {
                    writer.Write(FileData.Length);

                    writer.Mark("fOff_" + Name); // also should contain the resource type
                    writer.Write(0);

                    if (!IsResource)
                    {
                        writer.Write(FileData.Length); // no flags, but apparently size?
                    }
                    else
                    {
                        writer.Write(ResourceFlags);
                    }
                }
                else
                {
                    writer.Write(m_subEntries.Count);

                    writer.Mark("cIdx_" + Name);
                    writer.Write(0);

                    writer.Write(m_subEntries.Count);
                }

                writer.WriteIdx++;
            }
        }
Beispiel #3
0
        internal void Write(MarkedBinaryWriter writer)
        {
            // write our entry
            //if (Name != "")
            {
                writer.Mark("nOff_" + Name);
                writer.Write(0);

                if (!IsDirectory)
                {
                    writer.Write(FileData.Length);

                    writer.Mark("fOff_" + Name); // also should contain the resource type
                    writer.Write(0);

                    if (!IsResource)
                    {
                        writer.Write(FileData.Length); // no flags, but apparently size?
                    }
                    else
                    {
                        writer.Write(ResourceFlags);
                    }
                }
                else
                {
                    writer.Write(m_subEntries.Count);

                    writer.Mark("cIdx_" + Name);
                    writer.Write(0);

                    writer.Write(m_subEntries.Count);
                }

                writer.WriteIdx++;
            }
        }