public EzCommandArg GetEzCommandArg(int offset) { if (DictEzCommandArg.ContainsKey(offset)) { return(DictEzCommandArg[offset]); } var esfp = new EzCommandArg(); DictEzCommandArg.Add(offset, esfp); bin.StepIn(offset); { int bytesOffset = bin.ReadInt32(); int bytesCount = bin.ReadInt32(); bin.StepIn(FILE_OFFSET + bytesOffset); { esfp.Bytes = bin.ReadBytes(bytesCount); } bin.StepOut(); } bin.StepOut(); return(esfp); }
public static FlverDummy Read(DSBinaryReader bin, DataFiles.FLVER ContainingFlver) { var dmy = new FlverDummy(ContainingFlver); dmy.Position = bin.ReadVector3(); dmy.UnknownByte1 = bin.ReadByte(); dmy.UnknownByte2 = bin.ReadByte(); dmy.UnknownShort1 = bin.ReadInt16(); dmy.Row2 = bin.ReadVector3(); dmy.TypeID = bin.ReadInt16(); dmy.ParentBoneIndex = bin.ReadInt16(); dmy.Row3 = bin.ReadVector3(); dmy.SomeSortOfParentIndex = bin.ReadInt16(); dmy.UnknownFlag1 = bin.ReadBoolean(); dmy.UnknownFlag2 = bin.ReadBoolean(); //hit.Row4 = bin.ReadVector3(); //hit.Row4_ID1 = bin.ReadInt16(); //hit.Row4_ID2 = bin.ReadInt16(); bin.ReadBytes(16); return(dmy); }
public BNDEntry GetEntry(DSBinaryReader bin) { if (FileOffset < 0 || FileOffset > bin.Length) { throw new Exception("Invalid BND3 Entry File Offset."); } bin.StepIn(FileOffset); var bytes = bin.ReadBytes(FileSize); bin.StepOut(); string fileName = null; if (FileNameOffset > -1) { bin.StepIn(FileNameOffset); { fileName = bin.ReadStringShiftJIS(); } bin.StepOut(); } return(new BNDEntry(FileID, fileName, Unknown1, bytes)); }
private string ReadUnicodeString(DSBinaryReader bin) { StringBuilder sb = new StringBuilder(); byte[] next = { 0, 0 }; bool endString = false; do { next = bin.ReadBytes(2); endString = (next[0] == 0 && next[1] == 0); if (!endString) { sb.Append(Encoding.Unicode.GetString(next)); } }while (!endString); return(sb.ToString()); }
public TPFEntry ReadNext(DSBinaryReader bin) { Offset = bin.ReadInt32(); Size = bin.ReadInt32(); FlagsA = bin.ReadUInt32(); if (TpfFlags == 0x00020300) //Dark Souls { NameOffset = bin.ReadInt32(); FlagsB = bin.ReadUInt32(); } else if (TpfFlags == 0x02010200 || TpfFlags == 0x02010000) //Demon's Souls { FlagsB = bin.ReadUInt32(); NameOffset = bin.ReadInt32(); } var newEntry = new TPFEntry() { FlagsA = FlagsA, FlagsB = FlagsB }; bin.StepIn(NameOffset); { newEntry.Name = bin.ReadStringShiftJIS(); } bin.StepOut(); bin.StepIn(Offset); { newEntry.DDSBytes = bin.ReadBytes(Size); } bin.StepOut(); return(newEntry); }