flat assembler
Message board for the users of flat assembler.

Index > Windows > AllocConsole fprintf

Author
Thread Post new topic Reply to topic
asmrox



Joined: 19 Jan 2008
Posts: 160
asmrox
how do i use both functions so i can printf smth on my attached console? its really hard to debug dll with sprintf and messagebox Smile

Code:
format pe gui
section '.code' code readable executable
push -1
push -1
call [AllocConsole]
mov eax, dword [_iob]
add eax,32
push sss
push eax
call [fprintf]
add esp,8
call [Sleep]
sss db 'lol',0
section '.idata' import readable
dd 0,0,0,RVA msvcrt_name,RVA msvcrt_table
dd 0,0,0,RVA kernel32_name,RVA kernel32_table
dd 0,0,0,0,0
msvcrt_table:
fprintf dd RVA _fpritnf
_iob dd RVA __iob
dd 0
kernel32_table:
AllocConsole dd RVA _AllocConsole
Sleep dd RVA _Sleep
dd 0
msvcrt_name db 'msvcrt.dll',0
kernel32_name db 'kernel32.dll',0
_fpritnf db 0,0,'fprintf',0
__iob db 0,0,'_iob',0
_AllocConsole db 0,0,'AllocConsole',0
_Sleep db 0,0,'Sleep',0    

dont work
Post 20 Feb 2008, 00:08
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.