Hi All,
How can raw Hex values be displayed in a MessageBox / EditBoxes, they only seem to display Ascii characters, and I need the raw hex values for debugging purposes.

In the following example I need the value in eax, which could be any Hex value to be placed on the stack, before placement I need to display the Hex value, in this case it's 10000H

----------------------------------
.Data
DataStore dd 1

.code
mov eax, 10000H
mov DataStore, eax
invoke MessageBox,0,DataStore,0,MB_OK ; Need to display Raw Hex here
push DataStore
----------------------------------

Regards
Enforcer
Posted on 2001-10-07 11:07:03 by Enforcer
You need to convert the value to a string. The USER32 wsprintf
function will be your friend, and the format string "%08X" should do
the trick.
Posted on 2001-10-07 11:16:51 by f0dder
Nice one for your quick responce f0dder, I've been trying to implement what you suggested, but I'm having a little trouble getting it to work.
Can see what I'm missing, or what's stopping the funcion from working.
I have the User32 Inc & lib incuded.
This is what I have at present...
---------------------------------------------
.Data
RxBuffer DD ?
DataStore DD 1

.Code
mov eax, 10000H
mov DataStore, eax
invoke wsprintf, RxBuffer, "%08X", DataStore
---------------------------------------------

RxBuffer is empty!

Enforcer
Posted on 2001-10-07 14:03:13 by Enforcer


.data?
szBuffer db 128 dup ?
ddTemporary dd ?

.data
szFormat db "%08X", 0

.code
mov [ddTemporary], 10000h
invoke wsprintf, offset szBuffer, offset szFormat, [ddTemporary]


...
you can write the format number directly if you want (ie, without ddTemporary),
and you can use registers as well.
Posted on 2001-10-07 15:36:21 by f0dder
Respect for that f0dder, work's perfectly, thanks for your rapid response.

Regards
Enforcer
Posted on 2001-10-07 17:14:54 by Enforcer