Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Convert heximal

Convert heximal

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    erikkloeze
    wrote on last edited by
    #1

    How can you convert a heximal string to a "normal string"??? For example, I've got a register file which contains the following: [HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\Default] "Password"=hex:88,bf,a4,48,1a,4b,4d,4d So, I want to know how you can convert the heximal string "88,bf,a4,48,1a,4b,4d,4d" into just normal letters and numers... And I'm using VB 6.0!!!!! (¯`·._.·[eRiK]·._.·´¯)

    J M E D 4 Replies Last reply
    0
    • E erikkloeze

      How can you convert a heximal string to a "normal string"??? For example, I've got a register file which contains the following: [HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\Default] "Password"=hex:88,bf,a4,48,1a,4b,4d,4d So, I want to know how you can convert the heximal string "88,bf,a4,48,1a,4b,4d,4d" into just normal letters and numers... And I'm using VB 6.0!!!!! (¯`·._.·[eRiK]·._.·´¯)

      J Offline
      J Offline
      jzsmith33
      wrote on last edited by
      #2

      Friend Function HexToStr(ByVal strHex As String) As String Dim i As Integer Dim sb As New System.Text.StringBuilder(strHex.Length \ 2) For i = 0 To strHex.Length - 2 Step 2 sb.Append(Microsoft.VisualBasic.Chr(Convert.ToByte(strHex.Substring(i, 2), 16))) Next Return sb.ToString End Function

      1 Reply Last reply
      0
      • E erikkloeze

        How can you convert a heximal string to a "normal string"??? For example, I've got a register file which contains the following: [HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\Default] "Password"=hex:88,bf,a4,48,1a,4b,4d,4d So, I want to know how you can convert the heximal string "88,bf,a4,48,1a,4b,4d,4d" into just normal letters and numers... And I'm using VB 6.0!!!!! (¯`·._.·[eRiK]·._.·´¯)

        M Offline
        M Offline
        Matthew Hazlett
        wrote on last edited by
        #3

        Didn't see and unhex functions built in so you have to build one

        Private Function unHex(ByVal hexStr As String) As Integer
            Dim position As Integer = 1
            Dim Result As Integer = 0
        
            While Not position > hexStr.Length
                Dim thisChar As Char = Mid(hexStr, position, 1)
        
                Select Case UCase(thisChar)
                    Case "A"
                        Result += 10 \* (16 ^ (hexStr.Length - position))
                    Case "B"
                        Result += 11 \* (16 ^ (hexStr.Length - position))
                    Case "C"
                        Result += 12 \* (16 ^ (hexStr.Length - position))
                    Case "D"
                        Result += 13 \* (16 ^ (hexStr.Length - position))
                    Case "E"
                        Result += 14 \* (16 ^ (hexStr.Length - position))
                    Case "F"
                        Result += 15 \* (16 ^ (hexStr.Length - position))
                    Case Else
                        Result += Val(thisChar) \* (16 ^ (hexStr.Length - position))
                End Select
        
                position += 1
            End While
        
            Return Result
        End Function
        

        This will take as input a hexstring of any length and give you a result as an integer. ex. unHex("C17") = 3096 ex. unHex("C17BD") = 792509 Matthew Hazlett Windows 2000/2003 MCSE Never got an MCSD, go figure...

        1 Reply Last reply
        0
        • E erikkloeze

          How can you convert a heximal string to a "normal string"??? For example, I've got a register file which contains the following: [HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\Default] "Password"=hex:88,bf,a4,48,1a,4b,4d,4d So, I want to know how you can convert the heximal string "88,bf,a4,48,1a,4b,4d,4d" into just normal letters and numers... And I'm using VB 6.0!!!!! (¯`·._.·[eRiK]·._.·´¯)

          E Offline
          E Offline
          erikkloeze
          wrote on last edited by
          #4

          One more thing, I'm using VB 6.0, NOT .NET!!!! And I don't only want them to be converted into numbers, nut just into a string, for example a word!!! eRiK

          1 Reply Last reply
          0
          • E erikkloeze

            How can you convert a heximal string to a "normal string"??? For example, I've got a register file which contains the following: [HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\Default] "Password"=hex:88,bf,a4,48,1a,4b,4d,4d So, I want to know how you can convert the heximal string "88,bf,a4,48,1a,4b,4d,4d" into just normal letters and numers... And I'm using VB 6.0!!!!! (¯`·._.·[eRiK]·._.·´¯)

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            If you trying to get that password, you'll be a little disappointed. At a glance, those numbers are way above the normal ascii characters. Your looking at an encrypted password. RageInTheMachine9532

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups