The "call crt_fread" is "call dword ptr ds:[<&msvcrt.fread>]".
But I want "call <jmp.&msvcrt.fread>".
Help!
Here is a quick demo :
\masm32\bin\polib /OUT:msvcrt.lib /DEF:msvcrt.def /MACHINE:X86
\masm32\bin\ml /c /coff msvcrtDemo.asm
\masm32\bin\polink /SUBSYSTEM:CONSOLE msvcrtDemo.obj
.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
includelib msvcrt.lib
printf PROTO C :VARARG
.data
format1 db '%s',0
str1 db 'Hello world!',0
.code
start:
invoke printf,ADDR format1,ADDR str1
invoke ExitProcess,0
END start
\masm32\bin\dumppe.exe -disasm msvcrtDemo.exe
00401000 start:
00401000 6803204000 push 402003h
00401005 6800204000 push 402000h
0040100A E811000000 call fn_00401020
0040100F 83C408 add esp,8
00401012 6A00 push 0
00401014 E801000000 call fn_0040101A
00401019 CC int 3
0040101A fn_0040101A:
0040101A FF255C204000 jmp dword ptr [ExitProcess]
00401020 fn_00401020:
00401020 FF2564204000 jmp dword ptr [printf]
:U
Thanks. It works.
call dword ptr ds:[<&msvcrt.__set_app_type>]:
c_msvcrt typedef proto c:vararg
externdef _imp____set_app_type:ptr c_msvcrt
crt___set_app_type equ <_imp____set_app_type>
##############################################################
call <jmp.&msvcrt.__set_app_type>:
crt___set_app_type equ __set_app_type
__set_app_type PROTO C :VARARG
Just change the msvcrt.inc then it works.