void loadhexview() { DynamicFileByteProvider dynamicFileByteProvider = null; try { // try to open in write mode dynamicFileByteProvider = new DynamicFileByteProvider(a); } catch { } hexBox1.ByteProvider = dynamicFileByteProvider; int ccount = (int)(a.Length / 4) - 1; textBox1.Text = ""; for (int i = 0; i < ccount; i++) { a.Position = i * 4; byte[] ntbyte = new[] { (byte)a.ReadByte(), (byte)a.ReadByte() }; textBox1.Text += MVGList.GetMoveName(BitConverter.ToInt16(ntbyte, 0)) + ", "; ntbyte = new[] { (byte)a.ReadByte(), (byte)a.ReadByte() }; textBox1.Text += BitConverter.ToInt16(ntbyte, 0) + Environment.NewLine; } }
void hexBox1_CurrentPositionInLineChanged(object sender, EventArgs e) { long index = ((hexBox1.CurrentPositionInLine + (16 * (hexBox1.CurrentLine - 1))) - 1); try { a.Position = index; byte[] ntbyte = new[] { (byte)a.ReadByte(), (byte)a.ReadByte() }; label1.Text = "Position : " + index + " ID : " + BitConverter.ToInt16(ntbyte, 0) + " Name : " + MVGList.GetMoveName(BitConverter.ToInt16(ntbyte, 0)); } catch { label1.Text = index + " " + index.ToString("X"); } }