public Form1() { InitializeComponent(); for (int loop = 0; loop < (int)Languages.Language_Count; loop++) { string langname = ((Languages)loop).ToString(); int idx = langname.IndexOf('_'); if (idx > 0) langname = string.Format("{0} ({1})", langname.Substring(0, idx), langname.Substring(idx + 1).Replace('_', ' ')); comboBox1.Items.Add(langname); } comboBox1.SelectedIndex = 0; mStubbleEntries = new STBLVault(); PopulateTreeRoot(); }
private void textBox1_TextChanged(object sender, EventArgs e) { UInt64 hash64 = STBLVault.FNV64(textBox1.Text); UInt32 hash32 = STBLVault.FNV32(textBox1.Text); UInt32 hash24 = STBLVault.FNV24(textBox1.Text); val24.Text = hash24.ToString("X6"); val32.Text = hash32.ToString("X8"); val64.Text = hash64.ToString("X16"); byte[] bytes64 = BitConverter.GetBytes(hash64); byte[] bytes32 = BitConverter.GetBytes(hash32); byte[] bytes24 = BitConverter.GetBytes(hash24); val64Byte.Text = string.Format("{0:X2} {1:X2} {2:X2} {3:X2} {4:X2} {5:X2} {6:X2} {7:X2}", bytes64[0], bytes64[1], bytes64[2], bytes64[3], bytes64[4], bytes64[5], bytes64[6], bytes64[7]); val32Byte.Text = string.Format("{0:X2} {1:X2} {2:X2} {3:X2}", bytes32[0], bytes32[1], bytes32[2], bytes32[3]); val24Byte.Text = string.Format("{0:X2} {1:X2} {2:X2}", bytes24[0], bytes24[1], bytes24[2]); }
private void textBox1_TextChanged(object sender, EventArgs e) { if (!byName.Checked) { return; } if (!string.IsNullOrEmpty(textBox1.Text)) { UInt64 newkeyval = STBLVault.FNV64(textBox1.Text); textBox2.Text = string.Format("0x{0:X16}", newkeyval); SetValid(true); SetKey(newkeyval); } else { SetValid(false); } }
static void Main() { try { Dictionary <UInt64, string> keynames = new Dictionary <ulong, string>(); try { STBLVault.InitializeKeyNameMap(Path.Combine(Application.StartupPath, "STBL.txt")); } catch (Exception e) { MessageBox.Show(string.Format("Error opening stbl.txt: {0}", e.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } try { STBLVault.InitializeKeyNameMap(STBLVault.UserMapFilename); } catch (Exception e) { e.ToString(); } Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } catch (Exception ex) { if (MessageBox.Show(string.Format("An error has occurred. Copy details to the clipboard?\n\n{0}", ex), "Error", MessageBoxButtons.YesNo) == DialogResult.Yes) { DataObject obj = new DataObject(); obj.SetText(ex.ToString()); Clipboard.SetDataObject(obj, true); } } }