cannot load dll using ctypes.open()

462 views Asked by At

I have some dll i'm not able to load using ctypes.open() method. I have no clue why. It has C extern functions, all other dlls from the same path are loaded correctly.

In FF 8 the dll is loaded without issues, I'm trying on FF 22 without any success. Appreciate your assistance here.

Guy

2

There are 2 answers

1
Guy On BEST ANSWER

It was because I had “C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin” in my PATH environment. Don't know why it is related. But I'll explore it further.

1
nmaier On

Since it was working before, my guess is ASLR enforcement on Vista and later. IIRC, the whole LoadLibrary() function is hooked to prevent loading non-ASLR DLLs at runtime.

Try to build your DLL with /DYNAMICBASE.

If it is not that, than the likely reason is that your DLL cannot be found. Try to use absolute paths and make sure the path is actually correct.