I have a large asm file that imports functions from several dll's. Some of them, like kernel32.dll, use decorated names. But one, msvcrt.dll, does not. I've built a library msvcrt.lib by running dumpbin.exe on msvcrt.dll and then running lib /def:msvcrt.def on the resulting file. My problem is this: I can generate an include file msvcrt.inc with the PROTO definitions (proper prototypes) using information from IDA. With this include file and the includelib msvcrt.lib, the asm file assembles under masm32. But there is an error-- the names for the functions in msvcrt.dll come out decorated, so when I try to link these functions can't be found. For example, the linker is looking for _memmove@12 and this decorated name is not in msvcrt.dll. Is there a way to prevent this decoration? I'm using calls, not invokes. What I need is a way to make the entire include msvcrt.inc statement extern C. But masm32 doesn't recognize the externdef C directive, or the other variations on this I've been able to think of. It rejects anything like externdef C func1 PROTO :DWORD Is it possible there's no way to do what I need, short of decorating the names in msvcrt.dll myself so that they match?
Posted on 2001-01-16 20:33:00 by Lolly Dunting
Read my article on creating import libs from DLLs on my site
Posted on 2001-01-17 02:46:00 by Iczelion