I'm playing a game that's made in C++ and embeds Python (2.7) for the client interface and most of its functions.

At first, this game used to have dynamically linked Python lib for embedding. So I could easily execute my Python code inside it by either using the Python/C API inside my DLL or hook python27.dll.

But now the game has statically linked the Python lib, and the 2 methods I mentioned don't work anymore. I don't get any errors after injecting. So I was wondering if there are other methods?

This is what I tried:


The code above works perfectly fine on dynamic Python lib.

I'm on Windows 10 and use Visual Studio 2019 as a compiler.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.