问题
I am trying to call cpuid and print output from EBX, ECX and EDX to console, but it prints empty line instead
here is my code:
.586
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
.data
.data?
mybuffer byte 100 dup(?)
.code
start:
mov eax, 0
cpuid
invoke lstrcpy, addr mybuffer, ebx
invoke lstrcat, addr mybuffer, ecx
invoke lstrcat, addr mybuffer, edx
invoke GetStdHandle, STD_OUTPUT_HANDLE
invoke WriteConsole, eax, addr mybuffer, sizeof mybuffer, NULL, NULL
invoke ExitProcess, 0
end start
来源:https://stackoverflow.com/questions/37165150/concatenating-strings-from-registers-and-printing-them