Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception on unnamed exports #12

Closed
macgeiger opened this issue Mar 4, 2016 · 4 comments
Closed

Exception on unnamed exports #12

macgeiger opened this issue Mar 4, 2016 · 4 comments

Comments

@macgeiger
Copy link

When processing a PE file with exports that are unnamed (referenced only by ordinal value), peframe will throw the following exception because func['function'] contains None.

File "/usr/lib/python2.7/site-packages/peframe-5.0-py2.7.egg/peframe/peframe.py", line 362, in stdoutput
print func['function'][0:15].ljust(15), func['address']
TypeError: 'NoneType' object has no attribute 'getitem'

Depending on where you want to address this, one solution would be around line 361:
for func in output['pe_info'][item]:
if func['function'] is None:
print "Unnamed export".ljust(15), func['address']
else:
print func['function'][0:15].ljust(15), func['address']

Thanks.

@macgeiger macgeiger changed the title Exception on unname exports Exception on unnamed exports Mar 4, 2016
@guelfoweb
Copy link
Owner

Hi macgeiger, can you send the sample to check the error?
Thanks.

@macgeiger
Copy link
Author

I can't share the actual file, but have found a similar one that creates the same issue. See attached.
a.zip

@guelfoweb
Copy link
Owner

Ok, I have fixed it. Thanks for suggestion!

@macgeiger
Copy link
Author

And thank you for the quick response and, of course, peframe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants