0

I want to run code from Gray Hat Python book for upx_unpacker. I have downloaded PyEmu, but when I run script I got this error: AttributeError: PEPyEmu instance has no attribute 'load'

My script use PEPyEmu this way:

sys.path.append("C:\PyEmu\pyemu-master")
sys.path.append("C:\PyEmu\pyemu-master\\lib")
from PyEmu import PEPyEmu

exename = sys.argv[1]
outputfile = sys.argv[2]

emu = PEPyEmu()
if exename:
    if not emu.load(exename):
        print "[!] Problem loading %s" %exename
        sys.exit(2)
else:
    print "[!] Blank filename specified"
    sys.exit(3)

This code is same as in the book, but it does not work. I use Python 2.7.14, Pyemu from https://github.com/codypierce/pyemu Anyone know how to resolve it and run this script? I didn't find any help in the internet.

1

Please check example usage in https://github.com/codypierce/pyemu/blob/master/examples/pepyemu.py. It looks like load method is not implemented. Based on example usage it's required to load PE file manually.

  • Yes, I saw it. But I do not understand what should be pass as a second argument, and thats why I got errors when tried to run this script on my exe. – allocer Feb 5 '18 at 16:51
  • That example script allows to start execution from choosen address. For start I would use what's stored and presented as entrypoint. – malikcjm Feb 5 '18 at 19:37

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.