• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Who good C#?

Status
Not open for further replies.
Newbie Spellweaver
Joined
Sep 14, 2013
Messages
5
Reaction score
0
I want to write a small program to read a file, from offset 0xFB650 to offset 0xFB656 and show value in a text box.
Who can help me?
 
Skilled Illusionist
Joined
Jul 10, 2008
Messages
371
Reaction score
94


all is here for binary reading for offset just ignore the offset first byte of the file.
 
Newbie Spellweaver
Joined
Dec 16, 2011
Messages
54
Reaction score
26
BinaryReader bin = new BinaryReader();
byte[] bytes = new bytes[0xFB656 - 0xFB650];
bin.Read(bytes, 0xFB650, bytes.Length);

i just made it from my head, i dont give guarantee that this works.
 
Last edited:
[emoji848]
Legend
Joined
Dec 3, 2011
Messages
2,232
Reaction score
1,518
my god let him have the research....
He wont learn it just by copy and paste code lines, you write to him.

Also, I think what he needs, is the Seek method of the FileStream Class in combination with some methods of the BinaryReader Class...
 
Junior Spellweaver
Joined
Dec 3, 2012
Messages
162
Reaction score
130
Code:
      private void Form1_Load(object sender, EventArgs e)
        {
            string path = @"C:\test.bin";
            using (FileStream fs = File.OpenRead(path))
            {
                byte[] b = new byte[6];
                UTF8Encoding temp = new UTF8Encoding(true);
                fs.Position = 0xFB650;
                fs.Read(b, 0, b.Length);               
                textBox1.Text = temp.GetString(b);
                fs.Close();   
            }
            
        }

:lol:
 
Status
Not open for further replies.
Back
Top