Concatenating strings from registers and printing them

落花浮王杯 提交于 2020-01-07 02:12:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!