diff --git a/CASCExplorer/CASCExplorer.csproj b/CASCExplorer/CASCExplorer.csproj
index eef1ec09..00cf5650 100644
--- a/CASCExplorer/CASCExplorer.csproj
+++ b/CASCExplorer/CASCExplorer.csproj
@@ -80,6 +80,12 @@
ExtractProgress.cs
+
+ Form
+
+
+ FindByFileDataIdForm.cs
+
Form
@@ -137,6 +143,9 @@
ExtractProgress.cs
+
+ FindByFileDataIdForm.cs
+
ImagePreviewForm.cs
diff --git a/CASCExplorer/FindByFileDataIdForm.Designer.cs b/CASCExplorer/FindByFileDataIdForm.Designer.cs
new file mode 100644
index 00000000..4af6088b
--- /dev/null
+++ b/CASCExplorer/FindByFileDataIdForm.Designer.cs
@@ -0,0 +1,98 @@
+namespace CASCExplorer
+{
+ partial class FindByFileDataIdForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.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.searchTextBox = new System.Windows.Forms.TextBox();
+ this.resultTextBox = new System.Windows.Forms.TextBox();
+ this.findButton = new System.Windows.Forms.Button();
+ this.fileDataIdLabel = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // searchTextBox
+ //
+ this.searchTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.searchTextBox.Location = new System.Drawing.Point(74, 12);
+ this.searchTextBox.Name = "searchTextBox";
+ this.searchTextBox.Size = new System.Drawing.Size(94, 20);
+ this.searchTextBox.TabIndex = 0;
+ //
+ // resultTextBox
+ //
+ this.resultTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.resultTextBox.Location = new System.Drawing.Point(15, 38);
+ this.resultTextBox.Name = "resultTextBox";
+ this.resultTextBox.Size = new System.Drawing.Size(225, 20);
+ this.resultTextBox.TabIndex = 1;
+ //
+ // findButton
+ //
+ this.findButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.findButton.Location = new System.Drawing.Point(174, 10);
+ this.findButton.Name = "findButton";
+ this.findButton.Size = new System.Drawing.Size(66, 23);
+ this.findButton.TabIndex = 2;
+ this.findButton.Text = "Find";
+ this.findButton.UseVisualStyleBackColor = true;
+ this.findButton.Click += new System.EventHandler(this.findButton_Click);
+ //
+ // fileDataIdLabel
+ //
+ this.fileDataIdLabel.AutoSize = true;
+ this.fileDataIdLabel.Location = new System.Drawing.Point(12, 15);
+ this.fileDataIdLabel.Name = "fileDataIdLabel";
+ this.fileDataIdLabel.Size = new System.Drawing.Size(58, 13);
+ this.fileDataIdLabel.TabIndex = 3;
+ this.fileDataIdLabel.Text = "FileDataId:";
+ //
+ // FindByFileDataIdForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(250, 77);
+ this.Controls.Add(this.fileDataIdLabel);
+ this.Controls.Add(this.findButton);
+ this.Controls.Add(this.resultTextBox);
+ this.Controls.Add(this.searchTextBox);
+ this.Name = "FindByFileDataIdForm";
+ this.Text = "Find by FileDataID";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox searchTextBox;
+ private System.Windows.Forms.TextBox resultTextBox;
+ private System.Windows.Forms.Button findButton;
+ private System.Windows.Forms.Label fileDataIdLabel;
+ }
+}
\ No newline at end of file
diff --git a/CASCExplorer/FindByFileDataIdForm.cs b/CASCExplorer/FindByFileDataIdForm.cs
new file mode 100644
index 00000000..cc9ce5b2
--- /dev/null
+++ b/CASCExplorer/FindByFileDataIdForm.cs
@@ -0,0 +1,50 @@
+using CASCLib;
+using System;
+using System.Windows.Forms;
+
+namespace CASCExplorer
+{
+ public partial class FindByFileDataIdForm : Form
+ {
+ public FindByFileDataIdForm()
+ {
+ InitializeComponent();
+ }
+
+ public CASCHandler handler { get; set; }
+
+ private void findButton_Click(object sender, EventArgs e)
+ {
+ if (searchTextBox.Text.Length == 0)
+ return;
+
+ int FileDataId = 0;
+ try
+ {
+ FileDataId = int.Parse(searchTextBox.Text);
+ }
+ catch
+ {
+ MessageBox.Show("Invalid input", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ if (!handler.FileExists(FileDataId))
+ {
+ MessageBox.Show("File with this id does not exist", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ var root = handler.Root as WowRootHandler;
+ var hash = root.GetHashByFileDataId(FileDataId);
+
+ if (!CASCFile.Files.ContainsKey(hash))
+ {
+ MessageBox.Show("Hash of file does not exist in file name storage", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ resultTextBox.Text = CASCFile.Files[hash].FullName;
+ }
+ }
+}
diff --git a/CASCExplorer/FindByFileDataIdForm.resx b/CASCExplorer/FindByFileDataIdForm.resx
new file mode 100644
index 00000000..1af7de15
--- /dev/null
+++ b/CASCExplorer/FindByFileDataIdForm.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/CASCExplorer/MainForm.Designer.cs b/CASCExplorer/MainForm.Designer.cs
index 62467da0..44dd5354 100644
--- a/CASCExplorer/MainForm.Designer.cs
+++ b/CASCExplorer/MainForm.Designer.cs
@@ -43,6 +43,7 @@ private void InitializeComponent()
this.extractToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyNameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.getSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.getFileDataIDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
@@ -65,6 +66,7 @@ private void InitializeComponent()
this.extractInstallFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.CDNBuildsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.extractCASCSystemFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.findByFileDataIdToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.bruteforceNamesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportListfileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportFoldersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -190,32 +192,40 @@ private void InitializeComponent()
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.extractToolStripMenuItem,
this.copyNameToolStripMenuItem,
- this.getSizeToolStripMenuItem});
+ this.getSizeToolStripMenuItem,
+ this.getFileDataIDToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
- this.contextMenuStrip1.Size = new System.Drawing.Size(138, 70);
+ this.contextMenuStrip1.Size = new System.Drawing.Size(153, 114);
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
//
// extractToolStripMenuItem
//
this.extractToolStripMenuItem.Name = "extractToolStripMenuItem";
- this.extractToolStripMenuItem.Size = new System.Drawing.Size(137, 22);
+ this.extractToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.extractToolStripMenuItem.Text = "Extract...";
this.extractToolStripMenuItem.Click += new System.EventHandler(this.extractToolStripMenuItem_Click);
//
// copyNameToolStripMenuItem
//
this.copyNameToolStripMenuItem.Name = "copyNameToolStripMenuItem";
- this.copyNameToolStripMenuItem.Size = new System.Drawing.Size(137, 22);
+ this.copyNameToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.copyNameToolStripMenuItem.Text = "Copy Name";
this.copyNameToolStripMenuItem.Click += new System.EventHandler(this.copyNameToolStripMenuItem_Click);
//
// getSizeToolStripMenuItem
//
this.getSizeToolStripMenuItem.Name = "getSizeToolStripMenuItem";
- this.getSizeToolStripMenuItem.Size = new System.Drawing.Size(137, 22);
+ this.getSizeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.getSizeToolStripMenuItem.Text = "Get Size";
this.getSizeToolStripMenuItem.Click += new System.EventHandler(this.getSizeToolStripMenuItem_Click);
//
+ // getFileDataIDToolStripMenuItem
+ //
+ this.getFileDataIDToolStripMenuItem.Name = "getFileDataIDToolStripMenuItem";
+ this.getFileDataIDToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.getFileDataIDToolStripMenuItem.Text = "Get FileDataID";
+ this.getFileDataIDToolStripMenuItem.Click += new System.EventHandler(this.getFileDataIdToolStripMenuItem_Click);
+ //
// toolStripContainer1
//
//
@@ -355,7 +365,7 @@ private void InitializeComponent()
//
this.localeFlagsToolStripMenuItem.Enabled = false;
this.localeFlagsToolStripMenuItem.Name = "localeFlagsToolStripMenuItem";
- this.localeFlagsToolStripMenuItem.Size = new System.Drawing.Size(108, 22);
+ this.localeFlagsToolStripMenuItem.Size = new System.Drawing.Size(109, 22);
this.localeFlagsToolStripMenuItem.Text = "Locale";
this.localeFlagsToolStripMenuItem.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.localeToolStripMenuItem_DropDownItemClicked);
//
@@ -363,7 +373,7 @@ private void InitializeComponent()
//
this.useLVToolStripMenuItem.Enabled = false;
this.useLVToolStripMenuItem.Name = "useLVToolStripMenuItem";
- this.useLVToolStripMenuItem.Size = new System.Drawing.Size(108, 22);
+ this.useLVToolStripMenuItem.Size = new System.Drawing.Size(109, 22);
this.useLVToolStripMenuItem.Text = "Use LV";
this.useLVToolStripMenuItem.Click += new System.EventHandler(this.contentFlagsToolStripMenuItem_Click);
//
@@ -375,13 +385,14 @@ private void InitializeComponent()
this.extractInstallFilesToolStripMenuItem,
this.CDNBuildsToolStripMenuItem,
this.extractCASCSystemFilesToolStripMenuItem,
+ this.findByFileDataIdToolStripMenuItem,
this.bruteforceNamesToolStripMenuItem,
this.exportListfileToolStripMenuItem,
this.exportFoldersToolStripMenuItem,
this.analyzeSoundFilesToolStripMenuItem,
this.addFileDataIDToSoundFilesToolStripMenuItem});
this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
- this.toolsToolStripMenuItem.Size = new System.Drawing.Size(47, 20);
+ this.toolsToolStripMenuItem.Size = new System.Drawing.Size(48, 20);
this.toolsToolStripMenuItem.Text = "Tools";
//
// scanFilesToolStripMenuItem
@@ -423,6 +434,14 @@ private void InitializeComponent()
this.extractCASCSystemFilesToolStripMenuItem.Text = "Extract CASC System Files";
this.extractCASCSystemFilesToolStripMenuItem.Click += new System.EventHandler(this.extractCASCSystemFilesToolStripMenuItem_Click);
//
+ // findByFileDataIdToolStripMenuItem
+ //
+ this.findByFileDataIdToolStripMenuItem.Enabled = false;
+ this.findByFileDataIdToolStripMenuItem.Name = "findByFileDataIdToolStripMenuItem";
+ this.findByFileDataIdToolStripMenuItem.Size = new System.Drawing.Size(229, 22);
+ this.findByFileDataIdToolStripMenuItem.Text = "Find by FileDataId";
+ this.findByFileDataIdToolStripMenuItem.Click += new System.EventHandler(this.findByFileDataIdToolStripMenuItem_Click);
+ //
// bruteforceNamesToolStripMenuItem
//
this.bruteforceNamesToolStripMenuItem.Enabled = false;
@@ -611,6 +630,8 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem exportFoldersToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem analyzeSoundFilesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addFileDataIDToSoundFilesToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem findByFileDataIdToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem getFileDataIDToolStripMenuItem;
}
}
diff --git a/CASCExplorer/MainForm.cs b/CASCExplorer/MainForm.cs
index 847e374e..ebea3b04 100644
--- a/CASCExplorer/MainForm.cs
+++ b/CASCExplorer/MainForm.cs
@@ -120,6 +120,7 @@ private void OnStorageChanged()
localeFlagsToolStripMenuItem.Enabled = CASCGame.SupportsLocaleSelection(gameType);
useLVToolStripMenuItem.Enabled = isWoW;
exportListfileToolStripMenuItem.Enabled = true;
+ findByFileDataIdToolStripMenuItem.Enabled = true;
CASCFolder root = viewHelper.Root;
@@ -237,6 +238,7 @@ private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
extractToolStripMenuItem.Enabled = fileList.HasSelection;
copyNameToolStripMenuItem.Enabled = (fileList.HasSelection && CASCFolder.GetFiles(viewHelper.DisplayedEntries, fileList.SelectedIndices.Cast(), false).Count() > 0) || false;
+ getFileDataIDToolStripMenuItem.Enabled = copyNameToolStripMenuItem.Enabled;
getSizeToolStripMenuItem.Enabled = fileList.HasSelection;
}
@@ -345,6 +347,7 @@ private void Cleanup()
localeFlagsToolStripMenuItem.Enabled = false;
useLVToolStripMenuItem.Enabled = false;
exportListfileToolStripMenuItem.Enabled = false;
+ findByFileDataIdToolStripMenuItem.Enabled = false;
statusLabel.Text = "Ready.";
statusProgress.Visible = false;
@@ -479,5 +482,32 @@ private void addFileDataIDToSoundFilesToolStripMenuItem_CheckedChanged(object se
{
viewHelper.AddFileDataIdToSoundFiles = addFileDataIDToSoundFilesToolStripMenuItem.Checked;
}
+
+ private void findByFileDataIdToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var form = new FindByFileDataIdForm();
+ form.handler = viewHelper.CASC;
+
+ form.ShowDialog();
+ }
+
+ private void getFileDataIdToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var root = viewHelper.CASC.Root as WowRootHandler;
+ if (viewHelper.CurrentFolder == null)
+ return;
+
+ if (!fileList.HasSelection)
+ return;
+
+ var files = CASCFolder.GetFiles(viewHelper.DisplayedEntries, fileList.SelectedIndices.Cast(), false);
+ if (files.Count() == 1)
+ MessageBox.Show(root.GetFileDataIdByHash(files.First().Hash).ToString());
+ else
+ {
+ string temp = string.Join("\n", files.Select(_ => string.Format("{0} -> {1}", _.FullName, root.GetFileDataIdByHash(_.Hash))));
+ MessageBox.Show(temp);
+ }
+ }
}
}
diff --git a/CASCExplorer/MainForm.resx b/CASCExplorer/MainForm.resx
index ebd5215a..5f209413 100644
--- a/CASCExplorer/MainForm.resx
+++ b/CASCExplorer/MainForm.resx
@@ -132,9 +132,6 @@
812, 17
-
- 707, 17
-
@@ -152,6 +149,9 @@
g6eHO+A/lyD8ARfG3mk9fv1YAAAAAElFTkSuQmCC
+
+ 707, 17
+
17, 17