The MASM Forum
64 bit assembler => 64 Bit Assembler => Topic started by: Gunther on October 01, 2012, 12:48:35 AM
-
I need some help for the Windows 64 bit environment. Since I haven't running a 64 bit windows, I hope one of the members can answer. If one would call the LIBC from an assembly language application, is it:
call printfor
call _printf
Thank you.
Gunther
-
it is printf.
-
Also, the same is true for msvcrt.dll. The function is exported as printf
-
Thank you for the information. In the 32 bit world it's _printf.
Gunther
-
Thank you for the information. In the 32 bit world it's _printf.
Gunther
In the Masm32 world it seems to be printf: call crt_printf ;)
-
In the 32 bit world it's _printf.
I know for some CRTs it is, the lcclibc.dll that I tested recently for example, but for MSVCRT.dll, on my Windows 2000 system and on my Windows XP system, it’s “printf”.
;==============================================================================
; Build as a console app.
;==============================================================================
include \masm32\include\masm32rt.inc
;==============================================================================
.data
hMod dd 0
.code
;==============================================================================
start:
;==============================================================================
invoke LoadLibrary, chr$("msvcrt.dll")
mov hMod, eax
printf("%Xh\n",hMod)
invoke GetProcAddress, hMod, chr$("printf")
mov ebx, eax
printf("%Xh\n\n",ebx)
push ebx
push cfm$("%Xh\n\n")
call ebx
add esp, 8
inkey
exit
;==============================================================================
end start
78000000h
78023626h
78023626h