Printing out registers/ints to console | FASM | WI

2020-07-23 03:50发布

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条回答
Deceive 欺骗
2楼-- · 2020-07-23 03:56

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'
查看更多
登录 后发表回答