Hi

Need help to output register content in hex under xp ,like ms vc++ not in a messagebox .
An example code would be helpful.

thx
B.:confused:
Posted on 2004-04-01 09:40:25 by Bal?zs

.data
hex_digits db "0123456789abcdef"
.data?
buffer db 8 dup(?)
.code
mov eax, 0d34dc0d3h ;random number
mov ebx, offset buffer + sizeof buffer ;buffer for the hex digits, filled from the last to the first byte
mov ecx, 8 ;counter, 8 hex digits
hex_loop:
mov edx, eax
dec ebx
and edx, 0fh
add edx, offset hex_digits
movzx edx, byte ptr
mov byte ptr, dl
shr eax, 4 ;shift four new bits into our hex digit 'window'
dec ecx
jnz hex_loop


Untested and poorly conceived. You can print the buffer using WriteConsole.
Posted on 2005-03-21 06:21:57 by binary rapture