1
0
mirror of synced 2025-03-02 16:23:21 +01:00

Fix MKAGPDX models mssing mesh data

This commit is contained in:
KillzXGaming 2019-11-09 13:40:48 -05:00
parent 0435f651e1
commit fb81cc93b0
3 changed files with 119 additions and 93 deletions

View File

@ -522,7 +522,7 @@ namespace FirstPlugin
subMeshNode.lodMeshes = new List<GenericRenderedObject.LOD_Mesh>(); subMeshNode.lodMeshes = new List<GenericRenderedObject.LOD_Mesh>();
var submsh = new GenericRenderedObject.LOD_Mesh(); var submsh = new GenericRenderedObject.LOD_Mesh();
submsh.PrimitiveType = STPolygonType.Triangle; submsh.PrimativeType = STPrimativeType.Triangles;
submsh.FirstVertex = 0; submsh.FirstVertex = 0;
submsh.faces = subMesh.Faces; submsh.faces = subMesh.Faces;
subMeshNode.lodMeshes.Add(submsh); subMeshNode.lodMeshes.Add(submsh);
@ -717,7 +717,7 @@ namespace FirstPlugin
public bool IsBone public bool IsBone
{ {
get { return Name.Contains("jnt") || Name.Contains("center"); } get { return SubMeshes.Count == 0; }
} }
public bool IsMesh public bool IsMesh
@ -748,12 +748,14 @@ namespace FirstPlugin
if (SubMeshArrayOffsetPtr != 0) if (SubMeshArrayOffsetPtr != 0)
{ {
//4 possible sub meshes int i = 0;
reader.SeekBegin(SubMeshArrayOffsetPtr); while (true)
{
reader.SeekBegin((int)SubMeshArrayOffsetPtr + i * 4);
uint SubMeshArrayOffset1 = reader.ReadUInt32(); uint SubMeshArrayOffset1 = reader.ReadUInt32();
uint SubMeshArrayOffset2 = reader.ReadUInt32(); if (SubMeshArrayOffset1 == 0) break;
uint SubMeshArrayOffset3 = reader.ReadUInt32();
uint SubMeshArrayOffset4 = reader.ReadUInt32();
if (SubMeshArrayOffset1 != 0) if (SubMeshArrayOffset1 != 0)
{ {
reader.SeekBegin(SubMeshArrayOffset1); reader.SeekBegin(SubMeshArrayOffset1);
@ -761,37 +763,19 @@ namespace FirstPlugin
subMesh.Read(reader); subMesh.Read(reader);
SubMeshes.Add(subMesh); SubMeshes.Add(subMesh);
} }
if (SubMeshArrayOffset2 != 0)
{ i++;
reader.SeekBegin(SubMeshArrayOffset2);
SubMesh subMesh = new SubMesh(this);
subMesh.Read(reader);
SubMeshes.Add(subMesh);
}
if (SubMeshArrayOffset3 != 0)
{
reader.SeekBegin(SubMeshArrayOffset3);
SubMesh subMesh = new SubMesh(this);
subMesh.Read(reader);
SubMeshes.Add(subMesh);
}
if (SubMeshArrayOffset4 != 0)
{
reader.SeekBegin(SubMeshArrayOffset4);
SubMesh subMesh = new SubMesh(this);
subMesh.Read(reader);
SubMeshes.Add(subMesh);
} }
} }
if (ChildNodeOffsetPtr != 0) if (ChildNodeOffsetPtr != 0)
{ {
//4 possible children //4 possible sub meshes
reader.SeekBegin(ChildNodeOffsetPtr); for (int i = 0; i < 4; i++)
{
reader.SeekBegin((int)ChildNodeOffsetPtr + i * 4);
uint ChildNodeOffset1 = reader.ReadUInt32(); uint ChildNodeOffset1 = reader.ReadUInt32();
uint ChildNodeOffset2 = reader.ReadUInt32();
uint ChildNodeOffset3 = reader.ReadUInt32();
uint ChildNodeOffset4 = reader.ReadUInt32();
if (ChildNodeOffset1 != 0) if (ChildNodeOffset1 != 0)
{ {
reader.SeekBegin(ChildNodeOffset1); reader.SeekBegin(ChildNodeOffset1);
@ -799,26 +783,6 @@ namespace FirstPlugin
ChildNode.Read(reader); ChildNode.Read(reader);
Children.Add(ChildNode); Children.Add(ChildNode);
} }
if (ChildNodeOffset2 != 0)
{
reader.SeekBegin(ChildNodeOffset2);
Node ChildNode = new Node();
ChildNode.Read(reader);
Children.Add(ChildNode);
}
if (ChildNodeOffset3 != 0)
{
reader.SeekBegin(ChildNodeOffset3);
Node ChildNode = new Node();
ChildNode.Read(reader);
Children.Add(ChildNode);
}
if (ChildNodeOffset4 != 0)
{
reader.SeekBegin(ChildNodeOffset4);
Node ChildNode = new Node();
ChildNode.Read(reader);
Children.Add(ChildNode);
} }
} }

View File

@ -36,6 +36,9 @@
this.stLabel3 = new Toolbox.Library.Forms.STLabel(); this.stLabel3 = new Toolbox.Library.Forms.STLabel();
this.chkUseHex = new Toolbox.Library.Forms.STCheckBox(); this.chkUseHex = new Toolbox.Library.Forms.STCheckBox();
this.stPanel1 = new Toolbox.Library.Forms.STPanel(); this.stPanel1 = new Toolbox.Library.Forms.STPanel();
this.chkSearchNumbered = new Toolbox.Library.Forms.STCheckBox();
this.characterStartTB = new Toolbox.Library.Forms.STTextBox();
this.stLabel8 = new Toolbox.Library.Forms.STLabel();
this.maxLengthUD = new Toolbox.Library.Forms.NumericUpDownUint(); this.maxLengthUD = new Toolbox.Library.Forms.NumericUpDownUint();
this.stLabel7 = new Toolbox.Library.Forms.STLabel(); this.stLabel7 = new Toolbox.Library.Forms.STLabel();
this.searchUppercase = new Toolbox.Library.Forms.STCheckBox(); this.searchUppercase = new Toolbox.Library.Forms.STCheckBox();
@ -45,8 +48,6 @@
this.bruteForceHashTB = new Toolbox.Library.Forms.STTextBox(); this.bruteForceHashTB = new Toolbox.Library.Forms.STTextBox();
this.stLabel5 = new Toolbox.Library.Forms.STLabel(); this.stLabel5 = new Toolbox.Library.Forms.STLabel();
this.stLabel4 = new Toolbox.Library.Forms.STLabel(); this.stLabel4 = new Toolbox.Library.Forms.STLabel();
this.characterStartTB = new Toolbox.Library.Forms.STTextBox();
this.stLabel8 = new Toolbox.Library.Forms.STLabel();
this.contentContainer.SuspendLayout(); this.contentContainer.SuspendLayout();
this.stPanel1.SuspendLayout(); this.stPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.maxLengthUD)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.maxLengthUD)).BeginInit();
@ -63,7 +64,7 @@
this.contentContainer.Controls.Add(this.hashTypeCB); this.contentContainer.Controls.Add(this.hashTypeCB);
this.contentContainer.Controls.Add(this.resultTB); this.contentContainer.Controls.Add(this.resultTB);
this.contentContainer.Controls.Add(this.stringTB); this.contentContainer.Controls.Add(this.stringTB);
this.contentContainer.Size = new System.Drawing.Size(624, 359); this.contentContainer.Size = new System.Drawing.Size(704, 362);
this.contentContainer.Controls.SetChildIndex(this.stringTB, 0); this.contentContainer.Controls.SetChildIndex(this.stringTB, 0);
this.contentContainer.Controls.SetChildIndex(this.resultTB, 0); this.contentContainer.Controls.SetChildIndex(this.resultTB, 0);
this.contentContainer.Controls.SetChildIndex(this.hashTypeCB, 0); this.contentContainer.Controls.SetChildIndex(this.hashTypeCB, 0);
@ -143,6 +144,7 @@
// //
// stPanel1 // stPanel1
// //
this.stPanel1.Controls.Add(this.chkSearchNumbered);
this.stPanel1.Controls.Add(this.characterStartTB); this.stPanel1.Controls.Add(this.characterStartTB);
this.stPanel1.Controls.Add(this.stLabel8); this.stPanel1.Controls.Add(this.stLabel8);
this.stPanel1.Controls.Add(this.maxLengthUD); this.stPanel1.Controls.Add(this.maxLengthUD);
@ -155,12 +157,40 @@
this.stPanel1.Controls.Add(this.stLabel5); this.stPanel1.Controls.Add(this.stLabel5);
this.stPanel1.Location = new System.Drawing.Point(5, 100); this.stPanel1.Location = new System.Drawing.Point(5, 100);
this.stPanel1.Name = "stPanel1"; this.stPanel1.Name = "stPanel1";
this.stPanel1.Size = new System.Drawing.Size(610, 250); this.stPanel1.Size = new System.Drawing.Size(690, 250);
this.stPanel1.TabIndex = 18; this.stPanel1.TabIndex = 18;
// //
// chkSearchNumbered
//
this.chkSearchNumbered.AutoSize = true;
this.chkSearchNumbered.Location = new System.Drawing.Point(554, 188);
this.chkSearchNumbered.Name = "chkSearchNumbered";
this.chkSearchNumbered.Size = new System.Drawing.Size(112, 17);
this.chkSearchNumbered.TabIndex = 30;
this.chkSearchNumbered.Text = "Search Numbered";
this.chkSearchNumbered.UseVisualStyleBackColor = true;
//
// characterStartTB
//
this.characterStartTB.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.characterStartTB.Location = new System.Drawing.Point(381, 49);
this.characterStartTB.Multiline = true;
this.characterStartTB.Name = "characterStartTB";
this.characterStartTB.Size = new System.Drawing.Size(159, 156);
this.characterStartTB.TabIndex = 28;
//
// stLabel8
//
this.stLabel8.AutoSize = true;
this.stLabel8.Location = new System.Drawing.Point(378, 32);
this.stLabel8.Name = "stLabel8";
this.stLabel8.Size = new System.Drawing.Size(81, 13);
this.stLabel8.TabIndex = 29;
this.stLabel8.Text = "Starting String:s";
//
// maxLengthUD // maxLengthUD
// //
this.maxLengthUD.Location = new System.Drawing.Point(381, 97); this.maxLengthUD.Location = new System.Drawing.Point(549, 133);
this.maxLengthUD.Maximum = new decimal(new int[] { this.maxLengthUD.Maximum = new decimal(new int[] {
2147483647, 2147483647,
0, 0,
@ -173,7 +203,7 @@
// stLabel7 // stLabel7
// //
this.stLabel7.AutoSize = true; this.stLabel7.AutoSize = true;
this.stLabel7.Location = new System.Drawing.Point(378, 81); this.stLabel7.Location = new System.Drawing.Point(546, 105);
this.stLabel7.Name = "stLabel7"; this.stLabel7.Name = "stLabel7";
this.stLabel7.Size = new System.Drawing.Size(116, 13); this.stLabel7.Size = new System.Drawing.Size(116, 13);
this.stLabel7.TabIndex = 26; this.stLabel7.TabIndex = 26;
@ -182,7 +212,7 @@
// searchUppercase // searchUppercase
// //
this.searchUppercase.AutoSize = true; this.searchUppercase.AutoSize = true;
this.searchUppercase.Location = new System.Drawing.Point(386, 129); this.searchUppercase.Location = new System.Drawing.Point(554, 165);
this.searchUppercase.Name = "searchUppercase"; this.searchUppercase.Name = "searchUppercase";
this.searchUppercase.Size = new System.Drawing.Size(115, 17); this.searchUppercase.Size = new System.Drawing.Size(115, 17);
this.searchUppercase.TabIndex = 24; this.searchUppercase.TabIndex = 24;
@ -245,28 +275,11 @@
this.stLabel4.TabIndex = 19; this.stLabel4.TabIndex = 19;
this.stLabel4.Text = "Brute Force:"; this.stLabel4.Text = "Brute Force:";
// //
// characterStartTB
//
this.characterStartTB.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.characterStartTB.Location = new System.Drawing.Point(381, 49);
this.characterStartTB.Name = "characterStartTB";
this.characterStartTB.Size = new System.Drawing.Size(159, 20);
this.characterStartTB.TabIndex = 28;
//
// stLabel8
//
this.stLabel8.AutoSize = true;
this.stLabel8.Location = new System.Drawing.Point(378, 32);
this.stLabel8.Name = "stLabel8";
this.stLabel8.Size = new System.Drawing.Size(76, 13);
this.stLabel8.TabIndex = 29;
this.stLabel8.Text = "Starting String:";
//
// HashCalculatorForm // HashCalculatorForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(630, 364); this.ClientSize = new System.Drawing.Size(710, 367);
this.Name = "HashCalculatorForm"; this.Name = "HashCalculatorForm";
this.Text = "Hash Calculator"; this.Text = "Hash Calculator";
this.contentContainer.ResumeLayout(false); this.contentContainer.ResumeLayout(false);
@ -299,5 +312,6 @@
private Library.Forms.NumericUpDownUint maxLengthUD; private Library.Forms.NumericUpDownUint maxLengthUD;
private Library.Forms.STTextBox characterStartTB; private Library.Forms.STTextBox characterStartTB;
private Library.Forms.STLabel stLabel8; private Library.Forms.STLabel stLabel8;
private Library.Forms.STCheckBox chkSearchNumbered;
} }
} }

View File

@ -68,6 +68,7 @@ namespace Toolbox
private bool CancelOperation = false; private bool CancelOperation = false;
private bool UseSpeialcase => true; private bool UseSpeialcase => true;
private bool UseNumbered => chkSearchNumbered.Checked;
private bool UseLowercase => true; private bool UseLowercase => true;
private bool UseUppercase => searchUppercase.Checked; private bool UseUppercase => searchUppercase.Checked;
@ -135,10 +136,11 @@ namespace Toolbox
while (true && CancelOperation == false && hashes.Count > 0) while (true && CancelOperation == false && hashes.Count > 0)
{ {
String value = Sb.ToString(); String value = Sb.ToString();
uint calculatedHash = StringToHash($"{characterStartTB.Text}{value}"); uint calculatedHash = StringToHash($"{characterStartTB.Text}{value}");
if (hashes.Contains(calculatedHash)) if (hashes.Contains(calculatedHash))
{ {
UpdateTextbox($"[{calculatedHash}] {characterStartTB.Text}{value}"); UpdateTextbox($"{characterStartTB.Text}{value}");
hashes.Remove(calculatedHash); hashes.Remove(calculatedHash);
if (hashes.Count == 0) if (hashes.Count == 0)
@ -153,6 +155,27 @@ namespace Toolbox
} }
} }
foreach (var line in characterStartTB.Lines)
{
uint calculatedHash2 = StringToHash($"{line}{value}");
if (hashes.Contains(calculatedHash2))
{
UpdateTextbox($"{line}{value}");
hashes.Remove(calculatedHash2);
if (hashes.Count == 0)
{
if (progressBar.InvokeRequired)
{
progressBar.Invoke((MethodInvoker)delegate {
progressBar.Close();
});
}
return;
}
}
}
if (value.All(item => item == lastChar)) if (value.All(item => item == lastChar))
break; break;
@ -164,6 +187,28 @@ namespace Toolbox
break; break;
} }
else if (Sb[i] == '/') else if (Sb[i] == '/')
{
if (UseNumbered)
Sb[i] = '0';
else
{
if (UseUppercase)
Sb[i] = 'A';
else
Sb[i] = 'a';
}
break;
}
else if (Sb[i] == '0') { Sb[i] = '1'; break; }
else if (Sb[i] == '1') { Sb[i] = '2'; break; }
else if (Sb[i] == '2') { Sb[i] = '3'; break; }
else if (Sb[i] == '3') { Sb[i] = '4'; break; }
else if (Sb[i] == '4') { Sb[i] = '5'; break; }
else if (Sb[i] == '5') { Sb[i] = '6'; break; }
else if (Sb[i] == '6') { Sb[i] = '7'; break; }
else if (Sb[i] == '7') { Sb[i] = '8'; break; }
else if (Sb[i] == '8') { Sb[i] = '9'; break; }
else if (Sb[i] == '9')
{ {
if (UseUppercase) if (UseUppercase)
Sb[i] = 'A'; Sb[i] = 'A';
@ -208,7 +253,10 @@ namespace Toolbox
if (bruteForceStringTB.InvokeRequired) if (bruteForceStringTB.InvokeRequired)
{ {
bruteForceStringTB.Invoke((MethodInvoker)delegate { bruteForceStringTB.Invoke((MethodInvoker)delegate {
bruteForceStringTB.AppendText(text); if (bruteForceStringTB.Text.Length == 0)
bruteForceStringTB.Text = text;
else
bruteForceStringTB.AppendText("\r\n" + text);
}); });
} }
else else