No, I did not. By funny result I meant 0x6016026030a00, while the correct output is 6162630a00.You missed my correction.

[How To] Manipulate Binary data with Pointers
![[How To] Manipulate Binary data with Pointers: post #31](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)
Hmm, RegExReplace(RegExReplace(h, "0x(.)(?=$|0x)", "0$1"), "0x") seems to work. I don't know what the impact of two calls would be but it shouldn't be much.I meant 0x6016026030a00, while the correct output is 6162630a00.
![[How To] Manipulate Binary data with Pointers: post #32](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)
autohotkey.com/net Site Manager
Contact me by email (polyethene at autohotkey.net) or message tidbit
This is only 15ms faster, but two lines longer:
h := RegExReplace(h, "0x(.)(?=0x|$)", "0$1") StringReplace h, h, 0x,,All Return h
![[How To] Manipulate Binary data with Pointers: post #33](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)
Hmm, RegExReplace(RegExReplace(h, "0x(.)(?=$|0x)", "0$1"), "0x") seems to work.
Ah! Then it can be applied to your RgbToHex() !
Thanks!

![[How To] Manipulate Binary data with Pointers: post #34](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)
Cool, looks like I underestimated StringReplace.This is only 15ms faster, but two lines longer
DoneAh! Then it can be applied to your RgbToHex()

![[How To] Manipulate Binary data with Pointers: post #35](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)
autohotkey.com/net Site Manager
Contact me by email (polyethene at autohotkey.net) or message tidbit
BTW, change the "ownage (req. 1.0.46.x+)" !

![[How To] Manipulate Binary data with Pointers: post #36](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)
Rotate( pointer, dataSz=0, factor=47 ) { ; Defaults to ROT47 L0 := 32+factor, L1 := 127+factor, pointer-- Loop %dataSz% { Asc := *(++pointer) + factor If ( Asc > L0 and Asc < L1 ) DllCall("RtlFillMemory", Int,pointer, Int,1, UChar,Asc<127 ? Asc : Asc-94) } }
![[How To] Manipulate Binary data with Pointers: post #39](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)

![[How To] Manipulate Binary data with Pointers: post #40](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)
I will allow a few days and then update the original post with the function.
Many Thanks & Regards,

![[How To] Manipulate Binary data with Pointers: post #41](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)
Rotate(&x,StrLen(x),80) ; replace x with encrypted text Rotate(&x,StrLen(x),14) ; replace x with decrypted originalROT47 happens to be its own inverse. factor = 13 is NOT ROT13!
![[How To] Manipulate Binary data with Pointers: post #42](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)
ROT47 happens to be its own inverse. factor = 13 is NOT ROT13!
Thanks for informing it. I had not tried a number other than 47!
Regards,

![[How To] Manipulate Binary data with Pointers: post #43](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)
Not any more. The old style hex converter script is 15% faster with today's AHK release (version 1.0.46.01) than the RegEx version, thanks to the speedup of expressions. The lesson: because AHK is constantly improving, don't trust old speed comparisons.we have a nice example, when regular expressions speed up the code
#NoEnv SetBatchLines -1 file = C:\Program Files\AutoHotkey\license.txt FileRead b, %file% b := b b b b b b b b b b t2 := A_TickCount h := tHex(b) t2 := A_TickCount - t2 t1 := A_TickCount h := toHex(b) t1 := A_TickCount - t1 MsgBox Old style = %t2%`nRegEx = %t1% tHex(ByRef b, s = 0) { f := A_FormatInteger SetFormat Integer, H VarSetCapacity(h, 5*(VarSetCapacity(b) * !s + s)) Loop % VarSetCapacity(b) * !s + s h := h . *(&b+A_Index-1)+256 StringReplace h, h, 0x1,,All SetFormat Integer, %f% Return h } toHex(ByRef b, s = 0) { f = %A_FormatInteger% SetFormat, Integer, H Loop, % VarSetCapacity(b) * !s + s h := h . *(&b + A_Index - 1) SetFormat, Integer, %f% h := RegExReplace(h, "0x(.)(?=0x|$)", "0$1") StringReplace h, h, 0x,,All Return h }
![[How To] Manipulate Binary data with Pointers: post #44](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)
The lesson: because AHK is constantly improving, don't trust old speed comparisons.
Thanks,

![[How To] Manipulate Binary data with Pointers: post #45](http://autohotkey.com/board/public/style_images/ortem/icon_share.png)