Jump to content
Sign in to follow this  
jfpricejr

Edit binary registry value

Recommended Posts

jfpricejr

I need to read a binary registry value, search for the 8th byte and change it and write it back.  I'm headed down this trail.  Any suggestions would be appreciated:

RegRead
StringInStr xxx
edit
RegWrite
 
Thanks

Share this post


Link to post
Share on other sites
lolipop

You can use RegRead, BinaryMid and RegWrite to do what you want. Read more of their usage in the help file.

For _BinaryReplace, you can get the UDF from >here

Example

#include <Binary.au3>

;Read the registry
$vRegistry = RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections", "DefaultConnectionSettings")

;Extract a number of bytes from the binary
$Temp1 = BinaryMid($vRegistry , 8, 1)

;Replace the Binary
$Temp2 = _BinaryReplace($vRegistry, $Temp1, "0x09", 1)

;Write registry
RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\", "DefaultConnectionSettings", REG_BINARY", $Temp2)

Share this post


Link to post
Share on other sites
jfpricejr

Thank you.  You nailed the exact key I'm tring to change/verify for browser proxy settings.

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  

×