diff --git a/DotNetCTFDumper/GUI/ErrorLogBox.Designer.cs b/DotNetCTFDumper/GUI/ErrorLogBox.Designer.cs new file mode 100644 index 0000000..79362c7 --- /dev/null +++ b/DotNetCTFDumper/GUI/ErrorLogBox.Designer.cs @@ -0,0 +1,67 @@ +using System.ComponentModel; + +namespace DotNetCTFDumper.GUI +{ + partial class ErrorLogBox + { + /// + /// Required designer variable. + /// + private IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.textBox1 = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // textBox1 + // + this.textBox1.BackColor = System.Drawing.Color.Black; + this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204))); + this.textBox1.ForeColor = System.Drawing.Color.Red; + this.textBox1.Location = new System.Drawing.Point(0, 0); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textBox1.Size = new System.Drawing.Size(603, 274); + this.textBox1.TabIndex = 0; + // + // ErrorLogBox + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(603, 274); + this.Controls.Add(this.textBox1); + this.ForeColor = System.Drawing.Color.Red; + this.Name = "ErrorLogBox"; + this.Text = "Error"; + this.ResumeLayout(false); + this.PerformLayout(); + } + + private System.Windows.Forms.TextBox textBox1; + + #endregion + } +} \ No newline at end of file diff --git a/DotNetCTFDumper/GUI/ErrorLogBox.cs b/DotNetCTFDumper/GUI/ErrorLogBox.cs index 5ed52b5..cf3e8f0 100644 --- a/DotNetCTFDumper/GUI/ErrorLogBox.cs +++ b/DotNetCTFDumper/GUI/ErrorLogBox.cs @@ -13,17 +13,15 @@ namespace DotNetCTFDumper.GUI InitializeComponent(); textBox1.Text += $"{e.Message}\r\n\r\n\r\n"; StackTrace st = new StackTrace(true); - string stackIndent = ""; + for(int i =0; i< st.FrameCount; i++ ) { - // Note that at this level, there are four - // stack frames, one for each method invocation. StackFrame sf = st.GetFrame(i); var filename = Path.GetFileNameWithoutExtension(sf.GetFileName()); if (filename == null) filename = "UnknownFile"; textBox1.Text += $" {(filename)} : {sf.GetMethod()}: Line {sf.GetFileLineNumber()}\r\n\r\n"; - stackIndent += " "; + } //Console.ReadKey(); diff --git a/DotNetCTFDumper/GUI/ErrorLogBox.resx b/DotNetCTFDumper/GUI/ErrorLogBox.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DotNetCTFDumper/GUI/ErrorLogBox.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DotNetCTFDumper/GUI/MainForm.Designer.cs b/DotNetCTFDumper/GUI/MainForm.Designer.cs index 44c8dbe..331d385 100644 --- a/DotNetCTFDumper/GUI/MainForm.Designer.cs +++ b/DotNetCTFDumper/GUI/MainForm.Designer.cs @@ -63,11 +63,6 @@ this.dumpAllPackButton = new System.Windows.Forms.Button(); this.dumpPackButton = new System.Windows.Forms.Button(); this.packDataListBox = new System.Windows.Forms.ListBox(); - this.cryptKeyTab = new System.Windows.Forms.TabPage(); - this.minusCharButton = new System.Windows.Forms.Button(); - this.plusCharBtn = new System.Windows.Forms.Button(); - this.hexBox1 = new Be.Windows.Forms.HexBox(); - this.charBox = new System.Windows.Forms.TextBox(); this.imgViewerTab = new System.Windows.Forms.TabPage(); this.imageViewerInfo = new System.Windows.Forms.Label(); this.imageViewerPlayAnim = new System.Windows.Forms.Button(); @@ -76,6 +71,11 @@ this.soundViewTab = new System.Windows.Forms.TabPage(); this.soundList = new System.Windows.Forms.TreeView(); this.playSoundBtn = new System.Windows.Forms.Button(); + this.cryptKeyTab = new System.Windows.Forms.TabPage(); + this.minusCharButton = new System.Windows.Forms.Button(); + this.plusCharBtn = new System.Windows.Forms.Button(); + this.hexBox1 = new Be.Windows.Forms.HexBox(); + this.charBox = new System.Windows.Forms.TextBox(); this.pluginTab = new System.Windows.Forms.TabPage(); this.pluginLogBox = new System.Windows.Forms.TextBox(); this.activatePluginBtn = new System.Windows.Forms.Button(); @@ -86,10 +86,10 @@ this.mainTab.SuspendLayout(); this.mfaTab.SuspendLayout(); this.packDataTab.SuspendLayout(); - this.cryptKeyTab.SuspendLayout(); this.imgViewerTab.SuspendLayout(); ((System.ComponentModel.ISupportInitialize) (this.imageViewPictureBox)).BeginInit(); this.soundViewTab.SuspendLayout(); + this.cryptKeyTab.SuspendLayout(); this.pluginTab.SuspendLayout(); this.SuspendLayout(); // @@ -389,9 +389,9 @@ this.tabControl1.Controls.Add(this.mainTab); this.tabControl1.Controls.Add(this.mfaTab); this.tabControl1.Controls.Add(this.packDataTab); - this.tabControl1.Controls.Add(this.cryptKeyTab); this.tabControl1.Controls.Add(this.imgViewerTab); this.tabControl1.Controls.Add(this.soundViewTab); + this.tabControl1.Controls.Add(this.cryptKeyTab); this.tabControl1.Controls.Add(this.pluginTab); this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl1.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204))); @@ -486,7 +486,7 @@ // // infoLabel // - this.infoLabel.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204))); + this.infoLabel.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204))); this.infoLabel.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0))))); this.infoLabel.Location = new System.Drawing.Point(204, 11); this.infoLabel.Name = "infoLabel"; @@ -526,10 +526,10 @@ // this.packDataListBox.BackColor = System.Drawing.SystemColors.WindowText; this.packDataListBox.Dock = System.Windows.Forms.DockStyle.Left; - this.packDataListBox.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204))); + this.packDataListBox.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204))); this.packDataListBox.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0))))); this.packDataListBox.FormattingEnabled = true; - this.packDataListBox.ItemHeight = 14; + this.packDataListBox.ItemHeight = 15; this.packDataListBox.Items.AddRange(new object[] {"PackFile1", "PackFile2", "PackFile3", "PackFile4", "PackFile5", "PackFile6"}); this.packDataListBox.Location = new System.Drawing.Point(0, 0); this.packDataListBox.Name = "packDataListBox"; @@ -537,64 +537,6 @@ this.packDataListBox.TabIndex = 4; this.packDataListBox.SelectedIndexChanged += new System.EventHandler(this.packDataListBox_SelectedIndexChanged); // - // cryptKeyTab - // - this.cryptKeyTab.BackColor = System.Drawing.Color.Black; - this.cryptKeyTab.Controls.Add(this.minusCharButton); - this.cryptKeyTab.Controls.Add(this.plusCharBtn); - this.cryptKeyTab.Controls.Add(this.hexBox1); - this.cryptKeyTab.Controls.Add(this.charBox); - this.cryptKeyTab.Location = new System.Drawing.Point(4, 24); - this.cryptKeyTab.Name = "cryptKeyTab"; - this.cryptKeyTab.Size = new System.Drawing.Size(935, 479); - this.cryptKeyTab.TabIndex = 3; - this.cryptKeyTab.Text = "CryptoKey"; - // - // minusCharButton - // - this.minusCharButton.Dock = System.Windows.Forms.DockStyle.Left; - this.minusCharButton.Location = new System.Drawing.Point(0, 21); - this.minusCharButton.Name = "minusCharButton"; - this.minusCharButton.Size = new System.Drawing.Size(20, 458); - this.minusCharButton.TabIndex = 3; - this.minusCharButton.Text = "-"; - this.minusCharButton.UseVisualStyleBackColor = true; - this.minusCharButton.Click += new System.EventHandler(this.minusCharButton_Click); - // - // plusCharBtn - // - this.plusCharBtn.Dock = System.Windows.Forms.DockStyle.Right; - this.plusCharBtn.Location = new System.Drawing.Point(915, 21); - this.plusCharBtn.Name = "plusCharBtn"; - this.plusCharBtn.Size = new System.Drawing.Size(20, 458); - this.plusCharBtn.TabIndex = 2; - this.plusCharBtn.Text = "+"; - this.plusCharBtn.UseVisualStyleBackColor = true; - this.plusCharBtn.Click += new System.EventHandler(this.plusCharBtn_Click); - // - // hexBox1 - // - this.hexBox1.ColumnInfoVisible = true; - this.hexBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.hexBox1.Font = new System.Drawing.Font("Segoe UI", 9F); - this.hexBox1.LineInfoVisible = true; - this.hexBox1.Location = new System.Drawing.Point(0, 21); - this.hexBox1.Name = "hexBox1"; - this.hexBox1.ShadowSelectionColor = System.Drawing.Color.FromArgb(((int) (((byte) (100)))), ((int) (((byte) (60)))), ((int) (((byte) (188)))), ((int) (((byte) (255))))); - this.hexBox1.Size = new System.Drawing.Size(935, 458); - this.hexBox1.StringViewVisible = true; - this.hexBox1.TabIndex = 1; - // - // charBox - // - this.charBox.Dock = System.Windows.Forms.DockStyle.Top; - this.charBox.Location = new System.Drawing.Point(0, 0); - this.charBox.Name = "charBox"; - this.charBox.Size = new System.Drawing.Size(935, 21); - this.charBox.TabIndex = 0; - this.charBox.Text = "54"; - this.charBox.TextChanged += new System.EventHandler(this.charBox_TextChanged); - // // imgViewerTab // this.imgViewerTab.BackColor = System.Drawing.Color.DimGray; @@ -623,9 +565,9 @@ // imageViewerPlayAnim // this.imageViewerPlayAnim.Dock = System.Windows.Forms.DockStyle.Bottom; - this.imageViewerPlayAnim.Location = new System.Drawing.Point(170, 441); + this.imageViewerPlayAnim.Location = new System.Drawing.Point(203, 441); this.imageViewerPlayAnim.Name = "imageViewerPlayAnim"; - this.imageViewerPlayAnim.Size = new System.Drawing.Size(762, 35); + this.imageViewerPlayAnim.Size = new System.Drawing.Size(729, 35); this.imageViewerPlayAnim.TabIndex = 2; this.imageViewerPlayAnim.Text = "Play Animation"; this.imageViewerPlayAnim.UseVisualStyleBackColor = true; @@ -635,9 +577,9 @@ // this.imageViewPictureBox.BackColor = System.Drawing.Color.FromArgb(((int) (((byte) (64)))), ((int) (((byte) (64)))), ((int) (((byte) (64))))); this.imageViewPictureBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.imageViewPictureBox.Location = new System.Drawing.Point(170, 3); + this.imageViewPictureBox.Location = new System.Drawing.Point(203, 3); this.imageViewPictureBox.Name = "imageViewPictureBox"; - this.imageViewPictureBox.Size = new System.Drawing.Size(762, 473); + this.imageViewPictureBox.Size = new System.Drawing.Size(729, 473); this.imageViewPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; this.imageViewPictureBox.TabIndex = 1; this.imageViewPictureBox.TabStop = false; @@ -647,7 +589,7 @@ this.imagesTreeView.Dock = System.Windows.Forms.DockStyle.Left; this.imagesTreeView.Location = new System.Drawing.Point(3, 3); this.imagesTreeView.Name = "imagesTreeView"; - this.imagesTreeView.Size = new System.Drawing.Size(167, 473); + this.imagesTreeView.Size = new System.Drawing.Size(200, 473); this.imagesTreeView.TabIndex = 0; this.imagesTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.advancedTreeView_AfterSelect); // @@ -667,7 +609,7 @@ this.soundList.Dock = System.Windows.Forms.DockStyle.Left; this.soundList.Location = new System.Drawing.Point(0, 0); this.soundList.Name = "soundList"; - this.soundList.Size = new System.Drawing.Size(203, 479); + this.soundList.Size = new System.Drawing.Size(200, 479); this.soundList.TabIndex = 1; this.soundList.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.soundList_AfterSelect); // @@ -681,6 +623,64 @@ this.playSoundBtn.UseVisualStyleBackColor = true; this.playSoundBtn.Click += new System.EventHandler(this.playSoundBtn_Click); // + // cryptKeyTab + // + this.cryptKeyTab.BackColor = System.Drawing.Color.Black; + this.cryptKeyTab.Controls.Add(this.minusCharButton); + this.cryptKeyTab.Controls.Add(this.plusCharBtn); + this.cryptKeyTab.Controls.Add(this.hexBox1); + this.cryptKeyTab.Controls.Add(this.charBox); + this.cryptKeyTab.Location = new System.Drawing.Point(4, 24); + this.cryptKeyTab.Name = "cryptKeyTab"; + this.cryptKeyTab.Size = new System.Drawing.Size(935, 479); + this.cryptKeyTab.TabIndex = 3; + this.cryptKeyTab.Text = "CryptoKey"; + // + // minusCharButton + // + this.minusCharButton.Dock = System.Windows.Forms.DockStyle.Left; + this.minusCharButton.Location = new System.Drawing.Point(0, 21); + this.minusCharButton.Name = "minusCharButton"; + this.minusCharButton.Size = new System.Drawing.Size(20, 458); + this.minusCharButton.TabIndex = 3; + this.minusCharButton.Text = "-"; + this.minusCharButton.UseVisualStyleBackColor = true; + this.minusCharButton.Click += new System.EventHandler(this.minusCharButton_Click); + // + // plusCharBtn + // + this.plusCharBtn.Dock = System.Windows.Forms.DockStyle.Right; + this.plusCharBtn.Location = new System.Drawing.Point(915, 21); + this.plusCharBtn.Name = "plusCharBtn"; + this.plusCharBtn.Size = new System.Drawing.Size(20, 458); + this.plusCharBtn.TabIndex = 2; + this.plusCharBtn.Text = "+"; + this.plusCharBtn.UseVisualStyleBackColor = true; + this.plusCharBtn.Click += new System.EventHandler(this.plusCharBtn_Click); + // + // hexBox1 + // + this.hexBox1.ColumnInfoVisible = true; + this.hexBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.hexBox1.Font = new System.Drawing.Font("Segoe UI", 9F); + this.hexBox1.LineInfoVisible = true; + this.hexBox1.Location = new System.Drawing.Point(0, 21); + this.hexBox1.Name = "hexBox1"; + this.hexBox1.ShadowSelectionColor = System.Drawing.Color.FromArgb(((int) (((byte) (100)))), ((int) (((byte) (60)))), ((int) (((byte) (188)))), ((int) (((byte) (255))))); + this.hexBox1.Size = new System.Drawing.Size(935, 458); + this.hexBox1.StringViewVisible = true; + this.hexBox1.TabIndex = 1; + // + // charBox + // + this.charBox.Dock = System.Windows.Forms.DockStyle.Top; + this.charBox.Location = new System.Drawing.Point(0, 0); + this.charBox.Name = "charBox"; + this.charBox.Size = new System.Drawing.Size(935, 21); + this.charBox.TabIndex = 0; + this.charBox.Text = "54"; + this.charBox.TextChanged += new System.EventHandler(this.charBox_TextChanged); + // // pluginTab // this.pluginTab.BackColor = System.Drawing.Color.Black; @@ -750,11 +750,11 @@ this.mfaTab.ResumeLayout(false); this.mfaTab.PerformLayout(); this.packDataTab.ResumeLayout(false); - this.cryptKeyTab.ResumeLayout(false); - this.cryptKeyTab.PerformLayout(); this.imgViewerTab.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize) (this.imageViewPictureBox)).EndInit(); this.soundViewTab.ResumeLayout(false); + this.cryptKeyTab.ResumeLayout(false); + this.cryptKeyTab.PerformLayout(); this.pluginTab.ResumeLayout(false); this.pluginTab.PerformLayout(); this.ResumeLayout(false); diff --git a/DotNetCTFDumper/GUI/MainForm.cs b/DotNetCTFDumper/GUI/MainForm.cs index c43d274..73b9762 100644 --- a/DotNetCTFDumper/GUI/MainForm.cs +++ b/DotNetCTFDumper/GUI/MainForm.cs @@ -748,7 +748,7 @@ namespace DotNetCTFDumper.GUI var fps = (float)anim.MaxSpeed; float delay = 1f/fps; int i = 0; - if (anim.Repeat > 0) + if (anim.Repeat > 0&& anim.Frames.Count>1) { foreach (Bitmap frame in frames) { @@ -849,6 +849,7 @@ namespace DotNetCTFDumper.GUI { } + protected override void OnKeyDown(KeyEventArgs e) { diff --git a/DotNetCTFDumper/MMFParser/EXE/ChunkList.cs b/DotNetCTFDumper/MMFParser/EXE/ChunkList.cs index 4f2a1ce..ba59f6c 100644 --- a/DotNetCTFDumper/MMFParser/EXE/ChunkList.cs +++ b/DotNetCTFDumper/MMFParser/EXE/ChunkList.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using DotNetCTFDumper.MMFParser.EXE.Loaders; using DotNetCTFDumper.MMFParser.EXE.Loaders.Banks; +using DotNetCTFDumper.MMFParser.EXE.Loaders.Events; using DotNetCTFDumper.Utils; namespace DotNetCTFDumper.MMFParser.EXE @@ -248,7 +249,7 @@ namespace DotNetCTFDumper.MMFParser.EXE loader = new GlobalStrings(chunk); break; case 13117: - //loader = new Events(chunk);//NOT WORKING + // loader = new Events(chunk);//NOT WORKING break; diff --git a/DotNetCTFDumper/MMFParser/EXE/EXE.cs b/DotNetCTFDumper/MMFParser/EXE/EXE.cs index 18c257b..295f1bf 100644 --- a/DotNetCTFDumper/MMFParser/EXE/EXE.cs +++ b/DotNetCTFDumper/MMFParser/EXE/EXE.cs @@ -41,9 +41,9 @@ namespace DotNetCTFDumper.MMFParser.EXE int possition = 0; for (int i = 0; i < numOfSections; i++) { - var entry = exeReader.Tell(); + long entry = exeReader.Tell(); - var sectionName = exeReader.ReadAscii(); + string sectionName = exeReader.ReadAscii(); if (sectionName == ".extra") { diff --git a/DotNetCTFDumper/MMFParser/EXE/Loaders/Banks/ImageBank.cs b/DotNetCTFDumper/MMFParser/EXE/Loaders/Banks/ImageBank.cs index dd7deee..7af03f0 100644 --- a/DotNetCTFDumper/MMFParser/EXE/Loaders/Banks/ImageBank.cs +++ b/DotNetCTFDumper/MMFParser/EXE/Loaders/Banks/ImageBank.cs @@ -46,6 +46,12 @@ namespace DotNetCTFDumper.MMFParser.EXE.Loaders.Banks Settings.DumpImages = cache; } + public ImageItem FromHandle(int handle) + { + Images.TryGetValue(handle, out var img); + if (img == null) return null; + else return img; + } public void LoadByHandle(int handle) diff --git a/DotNetCTFDumper/MMFParser/EXE/PackData.cs b/DotNetCTFDumper/MMFParser/EXE/PackData.cs index c971ac3..0b9892e 100644 --- a/DotNetCTFDumper/MMFParser/EXE/PackData.cs +++ b/DotNetCTFDumper/MMFParser/EXE/PackData.cs @@ -30,7 +30,7 @@ namespace DotNetCTFDumper.MMFParser.EXE uint count = exeReader.ReadUInt32(); - Logger.Log($"Found {count} Pack Files:", true, ConsoleColor.Blue); + Logger.Log($"Found {count} Pack Files", true, ConsoleColor.Blue); long offset = exeReader.Tell(); for (int i = 0; i < count; i++) diff --git a/DotNetCTFDumper/MMFParser/MFA/Loaders/ValueList.cs b/DotNetCTFDumper/MMFParser/MFA/Loaders/ValueList.cs index ef53e0c..dfe1c65 100644 --- a/DotNetCTFDumper/MMFParser/MFA/Loaders/ValueList.cs +++ b/DotNetCTFDumper/MMFParser/MFA/Loaders/ValueList.cs @@ -67,7 +67,7 @@ namespace DotNetCTFDumper.MMFParser.MFA.Loaders Value = Reader.ReadInt32(); break; case 1://double - Value = Reader.ReadDouble(); + Value = Reader.ReadSingle(); break; } } diff --git a/DotNetCTFDumper/MMFParser/MFA/Loaders/mfachunks/ObjectLoader.cs b/DotNetCTFDumper/MMFParser/MFA/Loaders/mfachunks/ObjectLoader.cs index 0e1c78b..91162b5 100644 --- a/DotNetCTFDumper/MMFParser/MFA/Loaders/mfachunks/ObjectLoader.cs +++ b/DotNetCTFDumper/MMFParser/MFA/Loaders/mfachunks/ObjectLoader.cs @@ -27,12 +27,15 @@ namespace DotNetCTFDumper.MMFParser.MFA.Loaders.mfachunks { try { - var value = _qualifiers[i]; - Writer.WriteInt16(value); + //var value = _qualifiers[i]; + Writer.WriteInt16(-1); + break; + } catch { + break; } } diff --git a/DotNetCTFDumper/MMFParser/Translation/PAME2MFA.cs b/DotNetCTFDumper/MMFParser/Translation/PAME2MFA.cs index 19cb135..e9feee4 100644 --- a/DotNetCTFDumper/MMFParser/Translation/PAME2MFA.cs +++ b/DotNetCTFDumper/MMFParser/Translation/PAME2MFA.cs @@ -245,21 +245,24 @@ namespace DotNetCTFDumper.MMFParser.Translation { frameItem = FrameItems[instance.ObjectInfo]; } - catch{} + catch + { + throw new NotImplementedException("ObjectInfo not found, this may cause errors"); + } if (frameItem != null) { - //newFrameItems.Add(frameItem); + newFrameItems.Add(frameItem); var newInstance = new FrameInstance((ByteReader) null); newInstance.X = instance.X; newInstance.Y = instance.Y; - newInstance.Handle = i; + newInstance.Handle = instance.Handle; newInstance.Flags = 0; newInstance.ParentType = (uint) instance.ParentType; newInstance.ItemHandle = instance.ObjectInfo; newInstance.ParentHandle = (uint) instance.ParentHandle; newInstance.Layer = (uint) instance.Layer; - //newInstances.Add(newInstance); + newInstances.Add(newInstance); } break; } diff --git a/DotNetCTFDumper/Program.cs b/DotNetCTFDumper/Program.cs index 666f3f8..18fa0ba 100644 --- a/DotNetCTFDumper/Program.cs +++ b/DotNetCTFDumper/Program.cs @@ -82,7 +82,7 @@ namespace DotNetCTFDumper Settings.DumpSounds = dumpSounds; Settings.Verbose = verbose; - var exeReader = new ByteReader(path, FileMode.OpenOrCreate); + var exeReader = new ByteReader(path, FileMode.Open); var currentExe = new Exe(); Exe.Instance = currentExe; currentExe.ParseExe(exeReader);