proc string2hex2 s { global txtfile binary scan $s H* hex regsub -all (..) $hex {\x\0} }