Hex String to Binary File?

Discussion in 'Programming & Scripting' started by Slashr, Jun 20, 2009 with 2 replies and 273 views.

  1. Slashr

    Slashr Enthusiast

    Messages:
    519
    Ratings:
    171
    I have been working on my screenshot inf / extractor program and I am thinking of adding write support and injection.
    Howerver I cant seem to find out how to get a string of hex to go to the hex of the screenshot file


    I can read with
    br.BaseStream.Position = &H0
    Dim swo AsByte() = br.ReadBytes(4)
    TextBox1.Text = BitConverter.ToString(swo).Replace("-", "")

    But my current write:
    txt = UCase$(Trim$(TextBox1.Text))
    If Strings.Left$(txt, 2) <> "&H"Then txt = "&H" & txt
    value = CLng(txt)
    bw.Write(value)

    Has many issues

    Anybody want to help?
     
  2. GoldBl4d3

    GoldBl4d3 Retired Retired

    Messages:
    3,773
    Ratings:
    1,346
    care to explain why you need to convert hex to a string?
     
  3. OP
    Slashr

    Slashr Enthusiast

    Messages:
    519
    Ratings:
    171
    i dont i need a hex string from a textbox converted to binary for writing back with binarywriter
     

Share This Page