Jump to content
Sign in to follow this  
moshi

Insert a REG_BINARY into registry

Recommended Posts

moshi

Hello everyone,

I tries to insert a password for Vnc server by a RegWrite command, but have problem with that.

The problem is that the password is showed in the registry as REG_BINARY type,

When I export it, I get value like this:

[HKEY_CURRENT_USER\Software\ORL\WinVNC3]

"Password"=hex:49,90,e2,3d,ed,0b,be,3b

And then when I put this value in the RegWrite command I don’t get the right value. I assume some conversion is needed. I read this thread

http://www.autoitscript.com/forum/index.php?showtopic=107881&st=0&p=769989&hl=REG_BINARY&fromsearch=1&#entry769989

about creating a REG_BINARY entry but yet didn't what should I do or how to convert this " hex:49,90,e2,3d,ed,0b,be,3b" into the AutoIt RegWrite function.

My line is this, but the value is not good

RegWrite ( "HKEY_CURRENT_USER\Software\ORL\WinVNC3", "Password" ,"REG_BINARY"," 4990e23ded0bbe3b")

Thanks for any help!

Share this post


Link to post
Share on other sites
JFX

Try this:

RegWrite("HKEY_CURRENT_USER\Software\ORL\WinVNC3", "Password" ,"REG_BINARY", binary("0x4990e23ded0bbe3b"))

Share this post


Link to post
Share on other sites
moshi

That's working! thanks!

Can you explain to me the logic behind this?

every time I have binary I should add the "0x" to the exported regsitry data?

Try this:

RegWrite("HKEY_CURRENT_USER\Software\ORL\WinVNC3", "Password" ,"REG_BINARY", binary("0x4990e23ded0bbe3b"))

Share this post


Link to post
Share on other sites
JFX

Can you explain to me the logic behind this?

every time I have binary I should add the "0x" to the exported regsitry data?

Well actually I see no sense to convert a already binary to a binary, but it was recommended in the topic you linked.

"Binary" always begins with "0x" so yes if you want to write REG_BINARY take the hex values from regedit and add a '0x' before it (of course remove the 'comma')

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.