Valhalla Legends Forums Archive | Battle.net Bot Development | Decoding Hex

AuthorMessageTime
Fr0z3N
I know how to turn text into hex but i don't know how to decode it so i can read it. Would anyone mind giving me any idea's or just give me the source for it?
May 31, 2003, 3:40 AM
Spht
[quote author=Fr0z3N link=board=17;threadid=1489;start=0#msg11187 date=1054352437]
I know how to turn text into hex but i don't know how to decode it so i can read it. Would anyone mind giving me any idea's or just give me the source for it?
[/quote]

Well, for converting text to hex, you looped through each character, converting it to hex and storing it in a variable and returning the result. So to undo that, loop through every second character, and convert the hex to ASCII of the next two characters following each loop using the Chr function and specifying that it's hexidecimal that you want to convert to ASCII.

Edit - I see someone else has beaten me to replying. Now I'm sure he'll just grab that code snippet and hop over my post.
May 31, 2003, 4:01 AM
Fr0z3N
Being lazy, I use his coding but to learn I read your post Spht.
May 31, 2003, 12:13 PM
Fr0z3N
Dim strText As String, sBuf As String, i As Long

For i = 1 To Len(strText) Step 2
sBuf = Chr("&H" & Mid$(strText, i, 2))
Next i

Isn't working any ideas why?
May 31, 2003, 12:29 PM
Soul Taker
[code]
You have:
sBuf = Chr("&H" & Mid$(strText, i, 2))
The example here has:
sBuf = sBuf & chr("&H" & mid$(strText, i, 2))
[/code]
You forgot to prepend the buffer to the character being converted.
May 31, 2003, 2:27 PM
Fr0z3N
I tryed it with the sBuf first but that didn't work so i just forgot to change it back.
niether ways work.
May 31, 2003, 5:04 PM

Search