Why does calling kernel32.GetModuleHandleA() for msvcr100 fail in Python?

后端 未结 4 943
挽巷
挽巷 2021-01-27 03:06

I am having a problem with calling GetModuleHandleA() using Python. I have a module that attaches as debugger to the process. I\'m working on a function that would

4条回答
  •  醉酒成梦
    2021-01-27 04:02

    After modifying:

    
    ...

    handle = kernel32.GetModuleHandleA(dll) if handle == False: error = GetLastError() print "ERROR: %d - %s" % (error, FormatError(error)) return False

    ...

    I get: ERROR: 126 - The specified module could not be found

    I actually replaced msvcr100.dll with msvcrt.dll in my code and it worked perfect. I found out that msvcrt.dll is system dll. msvcr100.dll ships with Studio 2010. They are both located in C:\Windows\system32. It is still a mystery for me why msvcr100.dll did not work.

提交回复
热议问题