wsprintf.asm
comment *
MASM32 SDK
ml /c /coff wsprintf.asm
link /subsystem:console wsprintf
*
 
includelib <kernel32.lib>
includelib <user32.lib>
 
.386
.model flat, stdcall
option casemap:none
 
include <windows.inc>
include <kernel32.inc>
include <user32.inc>
 
.const
format		db	"%c %d %08X %s", 0dh, 0ah, 0
hello		db	"hello", 0
 
.data?
hConsoleOutput	dd	?
written		dd	?
buf		db	1024+1 dup (?)
 
.code
start:
		invoke	GetStdHandle, STD_OUTPUT_HANDLE
		mov	hConsoleOutput, eax
 
		invoke	wsprintfA, addr buf, addr format, '*', -1, 123beefh, addr hello
 
		invoke	lstrlenA, addr buf
 
		invoke	WriteConsoleA, hConsoleOutput, addr buf, eax, addr written, NULL
 
		invoke	ExitProcess, 0
end start
 

最終更新:2018年08月26日 22:28
添付ファイル