naksyn / PythonMemoryModule

pure-python implementation of MemoryModule technique to load dll and unmanaged exe entirely from memory
Apache License 2.0
297 stars 46 forks source link

MemoryModule function errors on execution #1

Closed rkbennett closed 1 year ago

rkbennett commented 1 year ago

This is caused by a couple issues, at least in my python instance (3.10.x).

The first issue seems to be that in pefile.py ordlookup isn't defined on import

The second issue is related to importordinal in __init__ which in python3.10 doesn't have a decode method.

naksyn commented 1 year ago

Hi, @rkbennett, please provide more details on your setup and errors encountered. I used stock python v. 3.10.4 without any issue. You can test by dropping pythonmemorymodule folder in python's folder and executing the code in the readme to launch a dll. Make sure you call the right dll procedure though.

Cheers

rkbennett commented 1 year ago

I'm using 3.10.9 on Windows 11, the method I was using for import was just git clone, then cd into PythonMemoryModule and do import pythonmemorymodule, this should effectively be the same, since it's using the normal import process. image This is an example of the ordlookup issue. Once I fixed this locally, that's when I started getting errors that said importordinal didn't have a decode attribute.

rkbennett commented 1 year ago

Also, should say my python was installed through the microsoft store.

naksyn commented 1 year ago

thanks for the information. This comes up in code used to handle dlls with import ordinal entries and I suppose that's the case for the dll you're loading. Will merge your PR to correct this. Thanks!

rkbennett commented 1 year ago

NP, thanks for taking a look into it.