0

Hello, does anyone know how to read .exe file and put into textbox info from adress 0x61AA04 example? and to allow me to edit in textbox and save?

1
Contributor
1
Reply
16
Views
2 Years
Discussion Span
Last Post by Trle94
0

Can someone tell me whats wrong here:

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
           BinaryReader br = new BinaryReader(File.OpenRead(listBox1.SelectedItem.ToString()));
           for (int i = 0x83C410; i <= 0x83C417; i++)
            {
            br.BaseStream.Position = i;
            textBox1.Text += br.ReadByte().ToString("X2");
            textBox1.Text = ConvertHex(textBox1.Text);
            }

           for (int i = 0x83B568; i <= 0x83B56E; i++)
           {
               br.BaseStream.Position = i;
               textBox2.Text += br.ReadByte().ToString("X2");
               textBox2.Text = ConvertHex(textBox2.Text);
           }

           for (int i = 0x83B55C; i <= 0x83B563; i++)
           {
               br.BaseStream.Position = i;
               textBox3.Text += br.ReadByte().ToString("X2");
               textBox3.Text = ConvertHex(textBox3.Text);
           }

           for (int i = 0x83B570; i <= 0x83B576; i++)
           {
               br.BaseStream.Position = i;
               textBox4.Text += br.ReadByte().ToString("X2");
               textBox4.Text = ConvertHex(textBox4.Text);
           }

            br.Close();
            //MessageBox.Show(listBox1.SelectedItem.ToString());
        }

        public static string ConvertHex(String hexString)
        {
            try
            {
                string ascii = string.Empty;

                for (int i = 0; i < hexString.Length; i += 2)
                {
                    String hs = string.Empty;

                    hs = hexString.Substring(i, 2);
                    uint decval = System.Convert.ToUInt32(hs, 16);
                    char character = System.Convert.ToChar(decval);
                    ascii += character;

                }

                return ascii;
            }
            catch (Exception ex) { Console.WriteLine(ex.Message); }

            return string.Empty;
        }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.