There is more than one way to skin a cat, here is a method without the use of arrays:
Code:
;region Setup Variables
Dim $so,$Byte_To_Be_Altered,$NewByteData,$Return
$so=SetOption("Explicit", "ON")
$so=SetOption("NoMacrosInStrings", "ON")
$so=SetOption("NoVarsInStrings", "ON")
$so=SetOption("WrapAtEOL", "ON")
;endregion
;set byte to be altered
$Byte_To_Be_Altered = 3
;set new byte data
$NewByteData = 'bc'
;call registry binary data change function
;AlterBinRegVal(< key >,< value >,< byte to be altered >,< new byte data >)
$Return = AlterBinRegVal('HKCU\Software\KiXtart-Learning','Round02',$Byte_To_Be_Altered,$NewByteData)
If Not($Return=0)
;do somthing with error code
EndIf
Function AlterBinRegVal($Key,$Value,$Byte,$Data)
;region Setup Variables
Dim $so,$Result,$AlteredResult,$Return
;endregion
;read registry value
$Result = ReadValue($Key,$Value)
;check for reading error, if so exit function
If @ERROR
Exit @ERROR
EndIf
;create new binary value by adding:
;'bytes Left of byte to be altered' + 'new data byte' + 'bytes Right of byte to be altered'
$AlteredResult = Left($Result,$Byte*2-2) + $Data + Right($Result,Len($Result)-$Byte*2)
;write altered value back to registry
$Return = WriteValue($Key,$Value,$AlteredResult,'Reg_Binary')
;check for writing error, if so exit function
If @ERROR
Exit @ERROR
EndIf
EndFunction