wietze/windows-dll-hijacking

issue with generate_dlls.py

strangerdanger010 opened this issue · 1 comments

Hey there Wietze,

having some issue here with the python script used to compile the DLLs via docker. see image below... not sure as to why its doing this. any help would be greatly appreciated! Thanks

image

Hey strangerdanger010, glad to see you found this research and doing some testing yourself.

Regarding the final KeyError, it suggests you have a CSV file generated for msdrm.dll but does not appear in your entrypoints.dll. Admittedly this should probably throw a nicer error, or even skip over it. I'll add that.

For the other more generic 'Could not compile' issues, that does seem odd. I'd recommend you change line 121 (highlighted here) to the following:

    if subprocess.call(["docker", "run", "--rm", "-ti", "-v", "{}:/mnt".format(os.getcwd()), "mmozeiko/mingw-w64", "x86_64-w64-mingw32-gcc", "-shared", "-mwindows", "-o", dll_path, dll_c_path, dll_def_path]):

In other words, remove the stdout option, so anything outputted by the docker command will be printed to your terminal window. Hopefully that helps in finding out why the command failed.