Supports the Unicode strings too (5400720061006E0073006C006100740069006F006E00 = T.r.a.n.s.l.a.t.i.o.n.)
If only ahk supported reading binary files (Chris please! ) we could write a hex editor in ahk or do a full search/replace in any file, make a byte patcher....
Hex(Inp,UC = 0) { OldFmt = %A_FormatInteger% SetFormat, Integer, hex Loop, Parse, Inp { TransForm, Asc, Asc, %A_LoopField% Asc += 0 StringTrimLeft, Hex, Asc, 2 IfEqual, UC, 0 Result = %Result%%Hex% Else Result = %Result%%Hex%00 } SetFormat, Integer, %OldFmt% StringUpper, Result, Result Return Result } Asc(Inp,UC = 0) { StringLen, Len, Inp Len /= 2 OldFmt = %A_FormatInteger% SetFormat, Integer, D Loop, %Len% { StringLeft, Hex, Inp, 2 IfEqual, UC, 0 StringTrimLeft, Inp, Inp, 2 Else StringTrimLeft, Inp, Inp, 4 Hex = 0x%Hex% Hex += 0 TransForm, Chr, Chr, %Hex% Result = %Result%%Chr% } SetFormat, Integer, %OldFmt% Return Result }