//
// dw2hex - Code::zIron. 2012.
// buf len minimum length 12 bytes
//
function dw2hex(DWord val; char* buf) {
uses ecx edi esi;
edi = buf;
ecx = val;
esi = '0123456789ABCDEF';
$repeat 8:
eax = ecx;
eax >> 28;
al = [esi+eax];
stosb
ecx << 4;
$end;
char*[edi] = "h";
return buf;
}