有头绪了,在这里http://mingw.5.n7.nabble.com/Help-exporting-functions-from-an-exe-tt22444.html#a22446这个测试就是有效的方法在 2014年11月19日 下午10:04,lynnux <lynn...@gmail.com>写道:我尝试从头开始,模拟exe导出函数,然后dll去链接。发现原生的MinGW好像不行,于是下载了xunxun的-enable-plugin版本的gcc,在这里下的:http://mingw.5.n7.nabble.com/gcc-enable-plugin-experimental-built-on-windows-td14088.html测试生成的exe确实有导出函数,但是dll去链接就是不行:测试代码:-----------------------------------------------------------------------------------------------ollydbg.cpp:extern "C" int __cdecl Plugingetvalue(int type){return 0;}int main(){return 0;}-----------------------------------------------------------------------------------------------testdll.cpp:extern "C" int __cdecl Plugingetvalue(int type);int main(){return Plugingetvalue(1);}-----------------------------------------------------------------------------------------------makefile:exe: objgcc -o ollydbg.exe ollydbg.o -Wl,--output-def,ollydbg.def,--out-implib,OLLYDBG110.aobj:gcc -c -o ollydbg.o -Wl,--export-all-symbols ollydbg.cpptestdll:gcc -o testdll.dll -shared D:\MinGW_GCC4.6.1_test\MinGW\OLLYDBG110.a testdll.cpp错误提示:gcc -o testdll.dll -shared D:\MinGW_GCC4.6.1_test\MinGW\OLLYDBG110.a testdll.cppC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccKm6nLu.o:testdll.cpp:(.text+0x16): undefined reference to `Plugingetvalue'collect2: ld returned 1 exit statusmakefile:6: recipe for target `dll' failedmingw32-make: *** [dll] Error 1在 2014年11月19日 下午8:33,lynnux <lynn...@gmail.com>写道:我在写一个ollydbg1.1的插件,但是用MinGW编译在link的时候死活链接不上。不知道是不是link exe的问题,因为OD的插件最终会import ollydbg.exe上的函数。网上搜索了下,发现xunxun大哥编译windows平台上的带dragonegg插件就用到了link exe——我在https://code.google.com/p/pcxllvm/downloads/detail?name=Dragonegg_MinGW64CRT_gcc4.6.1_win32.7z&can=1&q= 下了一个看,比如dragonegg-cc1.dll导入表里确实是引入了cc1.exe的导出函数。所以这里也特别请教下xunxun大哥,这是如何做到的?