private bool loadFile(string fileName, bool fromConsole = false) { bool result = false; if (this.av == null) { this.av = new UnknownDE(); } UnknownB0 b = new UnknownB0(); this.writeToConsole("Loading: " + fileName); b.a(fileName); if (this.bOne(b)) { UnknownBA ba = b.a(VLTOtherValue.VLTMAGIC) as UnknownBA; string text = ba.sa1[0]; MenuItem menuItem = new MenuItem(text, new EventHandler(this.bFour)); // Setting the Name property allows us to use the convenient Key-based methods on the MenuItems collection. menuItem.Name = text; this.miUnload.MenuItems.Add(menuItem); result = true; } if (fromConsole) { this.tvRefresh(); } return(result); }
private void aTwo(UnknownB0 A_0) { UnknownDH dh = A_0.a(VLTOtherValue.TABLE_START) as UnknownDH; for (int i = 0; i < dh.asa1.Length; ++i) { TableEntry @as = dh.asa1[i]; switch (@as.entryType) { case EntryType.ROOT: this.av.am(@as.di1.asRootEntry(), A_0); break; case EntryType.CLASS: this.av.a(@as.di1.asClassEntry(), A_0); break; case EntryType.ROW: RowRecord c = @as.di1.asRowEntry(); if (this.av.genht2 == null) // attempted to load a file with a parent before db.vlt { } VLTClass dq = this.av.genht2[c.ui2]; dq.dqb1.a(c, A_0); break; } } }
// TODO: opt private bool bOne(UnknownB0 A_0) { UnknownBA ba = A_0.a(VLTOtherValue.VLTMAGIC) as UnknownBA; uint num = ba.uia1[0]; foreach (UnknownB0 b in this.au) { UnknownBA ba2 = b.a(VLTOtherValue.VLTMAGIC) as UnknownBA; if (ba2.uia1[0] == num) { MessageBox.Show("This VLT data file has already been loaded.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); return(false); } } this.aTwo(A_0); this.au.Add(A_0); return(true); }
public void am(RootRecord A_0, UnknownB0 A_1) { UnknownA8 a = A_1.a(VLTOtherValue.TABLE_END) as UnknownA8; int num = a.genht1[A_0.position].i2; A_1.ms1.Seek(num, SeekOrigin.Begin); BinaryReader a_ = new BinaryReader(A_1.ms1); this.genht1 = new Dictionary <uint, aclzz>(A_0.i3); for (int i = 0; i < A_0.i3; ++i) { UnknownDE.aclzz a2 = new UnknownDE.aclzz(); a2.s1 = UnknownAP.a(a_); a2.i1 = A_0.ia1[i]; a2.ui1 = JenkinsHash.getHash32(a2.s1); this.genht1.Add(a2.ui1, a2); HashTracker.addHashFromVLTDB(a2.s1); } this.genht2 = new Dictionary <uint, VLTClass>(); }
public void a(ClassRecord A_0, UnknownB0 A_1) { this.b01 = A_1; this.classRecord = A_0; this.classHash = A_0.hash; UnknownA8 a81 = (A_1.a(VLTOtherValue.TABLE_END) as UnknownA8); int num = a81.genht1[A_0.position].i2; A_1.ms1.Seek(num, SeekOrigin.Begin); BinaryReader br = new BinaryReader(A_1.ms1); this.fields = new VLTClass.aclz1[this.classRecord.i2]; for (int i = 0; i < this.classRecord.i2; ++i) { VLTClass.aclz1 a = new VLTClass.aclz1(); a.read(br); HashTracker.getValueForHash(a.hash); this.fields[i] = a; } this.dqb1 = new VLTClass.bie(this); }
// This is where our problems with Carbon and up appear to stem from. public void a(RowRecord A_0, UnknownB0 A_1) { BinaryReader binaryReader = new BinaryReader(A_1.ms1); BinaryReader binaryReader2 = new BinaryReader(A_1.ms2); UnknownDR dr = new UnknownDR(this.vltClass.classRecord.i2); UnknownA8 a = A_1.a(VLTOtherValue.TABLE_END) as UnknownA8; int num; if (a.genht1.ContainsKey(A_0.position)) { num = a.genht1[A_0.position].i2; } else { // NOTE: THIS IS A BUG, IT SHOULD NOT HAPPEN. // The ONLY reason I'm checking ContainsKey instead of using exception handling, // is because exception handling causes huge slowdowns in Visual Studio debugging. if (BuildConfig.DEBUG) { ++numFails; Console.WriteLine("VLTClass.a(): num fail (num" + numFails + ",b" + b8Fails + ")"); } return; } dr.b01 = A_1; dr.dq1 = this.vltClass; dr.c1 = A_0; for (int i = 0; i < this.vltClass.classRecord.i2; ++i) { VLTClass.aclz1 a2 = this.vltClass.fields[i]; BinaryReader binaryReader3; if (!a2.c()) { binaryReader3 = binaryReader; binaryReader3.BaseStream.Seek(num + a2.us1, SeekOrigin.Begin); } else { binaryReader3 = null; for (int j = 0; j < A_0.i1; ++j) { if (A_0.caa1[j].hash == a2.hash) { if (A_0.caa1[j].a()) { binaryReader3 = binaryReader2; binaryReader3.BaseStream.Seek(A_0.caa1[j].position, SeekOrigin.Begin); } else { binaryReader3 = binaryReader; binaryReader3.BaseStream.Seek(a.genht1[A_0.caa1[j].position].i2, SeekOrigin.Begin); } } } if (binaryReader3 == null) { continue; } } Type type = TypeMap.instance.getTypeForKey(a2.ui2); if (type == null) { type = typeof(VLTRawType); } VLTBaseType bb; if (a2.isArray()) { bb = new VLTArrayType(a2, type); } else { bb = VLTBaseType.a(type); bb.size = a2.len; if (bb is VLTRawType) { (bb as VLTRawType).len = a2.len; } } bb.ui1 = (uint)binaryReader3.BaseStream.Position; bb.isVltOffset = (binaryReader3 == binaryReader2); bb.typeHash = a2.ui2; bb.ui3 = a2.hash; bb.dr1 = dr; bb.read(binaryReader3); dr.a(i, bb); } this.drList.Add(dr); }