Hi,
how can i convert a hexvalue in memory into a string ????
e.g. 0FAB12EDC4 -> in string for output like the hexvalue is.

so 0FAB12EDC4 must result in memory: 30464142313245444334


thx in regard
Posted on 2001-11-11 04:08:33 by beginner1
oki, i have done it to myself.

thx anyway

p.s.: for those who wants to know:

divide the hex pass 10h
check if the rest lower than 9 -> if so add 30h
if over 9 add 37h and store it somewhere.

e.g. 0F /10h -> 0 modulo 0F
0F + 37h -> 66h -> "F"

CU
Posted on 2001-11-11 05:41:53 by beginner1
Here is a sample writen in FAsm. It is the 32b version of the Print16 Linux function.
Posted on 2001-11-11 21:34:00 by eet_1024
A little late, but THANKS!

:)

Not that I understand all the op codes yet but I got it working.



.386
.model flat,STDCALL
extrn MessageBoxA:PROC
extrn ExitProcess : PROC

.data
message db 'XXXXXXXXh', 0

.code

Hex32_ASCII proc, lpsz :DWORD, dwHex :DWORD
mov ecx, 8h
mov edx, [dwHex]
mov edi, [lpsz]
cld
ascii:
rol edx, 4
mov al, 0Fh
and al, dl
add al, 90h
daa
adc al, 40h
daa
stosb
loop ascii
ret
Hex32_ASCII endp

start:
xor ebx, ebx

call Hex32_ASCII, offset[message], 0A7Fh
call MessageBoxA, ebx, offset[message], offset [message], ebx

call ExitProcess, ebx
end start
Posted on 2001-11-20 22:07:58 by -T-
Would have used an index table like:

db '0123456789:;<=>?@ABCDEF'

for faster access but who cares ?

hitch.
Posted on 2001-11-21 03:16:58 by hitchhikr