[HELP] Write hex in file RRS feed

  • Question

  • How can i write this in file starting in offset 1AC?

    In winhex i see:

    Hex values:

    How can i write this without using this way? (Starting in offset 1AC)

    Dim fs As New IO.FileStream(fileDialogBox.FileName, FileMode.Open, FileAccess.ReadWrite)
                    fs.Position = &H1AC

    I want something like that:

    fs.Position = &H1AC

    • Edited by extream87 Thursday, May 1, 2014 1:52 AM
    Thursday, May 1, 2014 1:50 AM


All replies

  • How can i write this in file starting in offset 1AC?

    You can't write a string as a series of bytes without converting it first.   The write command you are looking for is this one:

    So the task is actually how to convert your string to an array of bytes.   That will depend on what that string represents.  If the string is the hex representation of a value then each pair of hex characters needs to be converted to its byte value equivalent:
        80, 137, 85, 220, ...

    Is that what should be written? See:

    Thursday, May 1, 2014 2:10 AM
  • The computer does not work with hex values. A hex value is only a representation of a digital value for humans for whom are the real binary values impossible direct to understand if it is more than about 1000000. 

    Because the word format of an intel based computer (has nothing to do with ms word or whatever word) is 8 bits. A byte is mostly made presentable in Hex code. 

    In that means an A a for instance 1010 in binary format. 

    Therefore, what you see is an encoded representation not something that should really be stored


    Thursday, May 1, 2014 3:58 AM