Hello,
In 32 bit masm was good macro uni$, but in 64 bit this not exists.
I see 2 variants:
1. str1 dw 's','t','r','o','k','a',0,0
2. use TimoVJ program to convert via str dw 73h,74h,72h,6Fh,6Bh,61h,0
but maybe someone wrote simpler macros?
Hi morgot,
In code section perhaps work: uni$ MACRO RegAux, arglist:VARARG
LOCAL DATA@NAME
WSTR DATA@NAME,arglist
lea &RegAux, DATA@NAME
EXITM <&RegAux>
ENDM
Use?:uni$(rax, stroka)
Don't works.
uni$(rax,"rundll.dll")
invoke LoadLibraryW,uni$(rax,"rundll.dll")
and my masm64 don't know WSTR - in macros64\macros64.inc
Hi morgot,
You can import the required macros to your source code. Attached is a quick example.
Thank Vortex, it's very good!
but uni$ macro don't work, only WSTR
Hi morgot,
Some slight modifications in the original macros ( practical solution ) :
uni$ MACRO arglist:VARARG
LOCAL UCdata
WSTR UCdata,arglist
EXITM <ADDR UCdata>
ENDM
uni2$ MACRO arglist:VARARG
LOCAL UCdata
WSTR UCdata,arglist
EXITM <OFFSET UCdata>
ENDM
include \masm32\include64\masm64rt.inc
include UnicodeMacros.asm
.data
WSTR format,"%s"
.code
start PROC
invoke vc_wprintf,uni$("%s"),uni$("This is a UNICODE test.",13,10)
mov rdx,uni2$("This is the second UNICODE test.",13,10)
invoke vc_wprintf,ADDR format,rdx
invoke ExitProcess,0
start ENDP
END
A better version of uni$ is required here to handle both of the usage cases above.