calling fopen in GAS windows

43 views Asked by At

I'm not going to use gcc here. This is pure as assembly with ld. 32-bit code. I've been able to do a whole lot except use any c functions. I know that in windows, fopen and fwrite are actually functions with an underscore but I am still not able to retrieve these from coredll.dll or msvcrt.dll. Can anyone tell me what dll these are found in? I can load a library through LoadLibrary(thedll.dll)

1

There are 1 answers

3
shawnixer On

the dll that fopen belongs to is located in ucrtbase.dll. in masm 64, this is defined as %includelib ucrt.lib and compiled with ml64.exe. However, in my case, I am strictly using as with ld and so I needed to find this function through a complicated procedure using PEB.