今天研究了一下花指令,做下笔记 .386 .model flat, stdcall option casemap :none include windows.inc include kernel32.inc include user32.inc includelib kernel32.lib includelib user32.lib ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; chr$ macro any_text:vararg local txtname, nextcode jmp nextcode txtname db any_text,0 nextcode: exitm <offset txtname> endm flower MACRO local _next1 mov eax, offset _next1 add eax, 1 jmp eax _next1: db 0e8h ENDM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .data stdout dd 0 .code printf proc C fmt :dword, args : vararg local @buf[1024]:byte local @len:dword flower invoke wvsprintf, addr @buf, fmt, addr args mov @len, eax invoke WriteConsole, stdout, addr @buf, @len, addr @len, 0 mov eax, @len ret printf endp main proc invoke printf, chr$("hello world %d",10), 33 flower invoke printf, chr$("hello world",10) xor eax,eax ret main endp start: invoke GetStdHandle, STD_OUTPUT_HANDLE mov stdout, eax invoke main ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; end start comment * *