Printing out registers/ints to console | FASM | WINAPI

£可爱£侵袭症+ 提交于 2019-12-12 08:56:09

问题


Just wondering if there was a way i could print out a number to the console by invoking. it can be either base 10, or hex I don't mind.

I would like to see the format in which some functions return.

I would prefer not to do it the long way using WriteConsole and a lot of asm

P.S also this is my first question , how do i accept an answer


回答1:


use printf from msvcrt.dll:

                format PE console
                include "win32ax.inc"
start:
                cinvoke printf,formatstring,eax
                invoke  Sleep,-1

formatstring    db "%d",13,10,0

section '.idata' import data readable

library msvcrt,'msvcrt.dll',\
        kernel32,'kernel32.dll'

import  msvcrt,printf,'printf'
import  kernel32,Sleep,'Sleep'


来源:https://stackoverflow.com/questions/8622938/printing-out-registers-ints-to-console-fasm-winapi

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