Jump to content

Conversion to Hex...


 Share

Recommended Posts

Hello all,

I am trying to write a script to automatically add web addressess into the allowed sites list of the MSN toolbar but guess what. The MSN toolbar stores that information in Hex in [HKEY_CURRENT_USER\Software\Microsoft\MSN Toolbar] \"PopupAllowList".

I have a text file that I store the web sites in and I want to some how read in each character and convert to hex along with 00 seperating each character, then import the finished item in using the regwrite. I know this will overwrite any sites that are currently there but that does not bother me. Converting from hex into characters is not really difficult using AutoIT but I can't figure out how to go in reverse.

From Hex to Char:

$first = Dec("63")
$Second = Chr($First)
msgbox(0, "", $first & @CRLF & $Second)

how do I got in the opposite direction...

Thanks for any help,

Mike

Link to comment
Share on other sites

$txt = "FFFF"
$num = "0x" & $txt
$num = Int($num)
MsgBox(4096,"",$num)

Lar.

<{POST_SNAPBACK}>

Not sure what you mean Larry? I am really not interested in numbers, just letters.

from my origional code above I can convert the Hex 63 into the Character c but what I really need to do is convert the character c into Hex 63

Link to comment
Share on other sites

Um, the latest unstable version of AutoIt supports binary (hex) registy keys...

From RegWrite docs:

When writing a REG_BINARY key use a string of hex characters, e.g. the REG_BINARY value of 01,a9,ff,77 can be written by using the string "01A9FF77".
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

Um, the latest unstable version of AutoIt supports binary (hex) registy keys...

From RegWrite docs:

When writing a REG_BINARY key use a string of hex characters, e.g. the REG_BINARY value of 01,a9,ff,77 can be written by using the string "01A9FF77".

<{POST_SNAPBACK}>

Yes CyberSlug, that is exactly what I will be doing as soon as I can get the Hex characters.

All I have now is a text file with

www.google.com

www.yahoo.com

etc

etc

How to I convert each of these lines into Hex so I can use the RegWrite.

Link to comment
Share on other sites

Seriously, I don't know this crap any better than a noob. But I look in the help file and learn that I can do like...

MsgBox( 4096, Asc("A"), Hex(Asc("A"), 2) )

@Jon (or any other old timers): Did I ask this many ?s when I was a noob?

Lar.

<{POST_SNAPBACK}>

dang, no matter how many times I look through that help file I always seem to miss something.

Thanks,

Larry,

Link to comment
Share on other sites

  • Administrators

Seriously, I don't know this crap any better than a noob. But I look in the help file and learn that I can do like...

MsgBox( 4096, Asc("A"), Hex(Asc("A"), 2) )

@Jon (or any other old timers): Did I ask this many ?s when I was a noob?

Lar.

You were worse.

*runs away*

Giggling.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...