hi
i have a little problem for convert hex to ascii
85007200620074006500
this routine stops by the first 00 bytes and print me the first signs
HexDecode proc uses esi edi ebx pHexStr:dword,pOutBuffer:dword
mov esi,pHexStr
mov edi,pOutBuffer
jmp @1
@@:
and ebx,0Fh
add eax,ebx
mov [edi],al
inc edi
@1:
movzx edx,byte ptr[esi]
cmp edx,40h
sbb ebx,ebx
sub edx,37h
and ebx,7
inc esi
add ebx,edx
js @F
mov eax,ebx
shl eax,4
mov [edi],al
movzx edx,byte ptr[esi]
cmp edx,40h
sbb ebx,ebx
sub edx,37h
and ebx,7
inc esi
add ebx,edx
jns @B
@@:
ret
HexDecode endp
can your help me please
greets
You can't see the forest for the trees? The proc works just fine.
ps. WideCharToMultiByte
lol :bg
No Drizz this proc cannot convert if 0 bytes in a hex string
example:
85007200620074006500 convert only the fist byte 85
857262... without 0 bytes works perfect!
i have my problem solved with this
push offset sztext
call remZero
push offset hOut
push offset sztext
call HexDecode
remZero proc txt:DWORD
mov ecx, txt
mov edx, txt
@@:
mov al, [ecx]
add ecx, 1
cmp al, '0' ; is it a space
je @B
mov [edx], al
add edx, 1
test al, al ; is AL zero
jnz @B
ret
remZero endp
HexDecode proc
..
..
.
greets
ragdog