0

I made a .pyd file with this source:

def hello():
    print("Hello world")

and I want to run hello() from rundll32 (Or any C code in general)

I tried rundll32 hello.pyd,hello() and rundll32 hello.pyd,hello but neither worked

I also looked through the C code, and did not find anything useful

1 Answers1

0

Don't use rundll32 but use C.

Inspect your hello.pyd as a dll with this tool : http://www.nirsoft.net/utils/dll_export_viewer.html

So you will see : if your file is a real .dll.

If it is real DLL :

  • you will see what is exported in your hello.pyd
  • you can use IMPLIB to produce a .lib file for linking .

http://docwiki.embarcadero.com/RADStudio/Sydney/en/IMPLIB.EXE,_the_Import_Library_Tool_for_Win32

  • declare your function in your c source for example

    void hello();

Florent
  • 436
  • 3
  • 8
  • the only function exported is PyInit_test I tried recompiling it as just `print("hello world") and running the function with rundll32 and it not work – DiamondDemon Dec 05 '20 at 23:17