BinToHex

Convert binary memory to hex string.

OutputVar := BinToHex(Address or Buffer object , Length)
Function Example: hex := BinToHex(var, 10)

Parameters

OutputVar

The name of the variable in which to store the hex string.

Address or Buffer object

Buffer object or pointer to memory.

Length (optional)

Length of memory in bytes to convert, optional for buffer object.

Related

#DllImport, DynaCall, WinApi

Examples

MsgBox BinToHex(StrPtr("123"),6) ; unicode string to hex
var:=BufferAlloc(10)
StrPut("ABC",var,"CP0")
MsgBox BinToHex(var,4) ; ansi string to hex
Loop 10
	NumPut("Char", A_Index,var,A_Index-1)
MsgBox BinToHex(var) ; memory to hex