I built a simple Python gui application("App.py") that I am trying to hook using detours. My understanding is that Python should use Windows dll's at some point and I am trying to hook these function calls.
For that purpose I am using detours withdll.exe :
withdll.exe /d:"myDLL.dll" "myprogram.exe"
withdll.exe /d:"myDLL.dll" "starter.bat"
I looked through detours withdll.exe source code and found out that it can take command line arguments, the issue was solved using:
withdll.exe /d:"myDLL.dll" "pathtopython/Python.exe" "pathtoscript/myscript.py"