擅长:python、mysql、java
<p>我相信这意味着它在你的系统上找不到特定的DLL。下面是一个简单的函数,它将返回printf地址:</p>
<pre><code>from ctypes import *
kernel32 = windll.kernel32
def resolve_function(dll, func):
handle = kernel32.GetModuleHandleA(dll)
address = kernel32.GetProcAddress(handle, func)
kernel32.CloseHandle(handle)
return address
address = resolve_function('msvcrt.dll','printf')
print(address)
</code></pre>
<p>我还在学习这些东西,我不太确定<code>msvcrt.dll</code>和{<cd2>}之间的区别。但是,我相信您需要链接到<code>msvcrt.dll</code>,而微软则会做一些魔术来找到<code>msvcrXX.dll</code>。查看此页以了解更多信息:<a href="http://msdn.microsoft.com/en-us/library/abx4dbyh" rel="nofollow">http://msdn.microsoft.com/en-us/library/abx4dbyh</a></p>