You may have encountered problems with ml.exe decorating symbols inappropriately in mixed library situations (C and C++). I wasn't able to figure out how to use extern C in masm, and only one .model directive is allowed, typically: .model flat, stdcall. A common situation where decoration is a problem is when you disassemble and then use masm to rebuild exes that make calls to msvcrt.dll; the functions there need to be called extern C and should not be decorated. These problems prompted me to write a utility (11 KB, ANSI C) that will directly undecorate a list of names in the object file that ml.exe generates, so that the linker can find the names. It goes through the string table, changing the strings that match the names in your list, and patches the RVA's in the symbol table to get a new obj file with correctly decorated names. If there is interest, I can make the source code available.
Posted on 2001-01-27 14:21:00 by Alan Mason