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

ValueError in meta_pe.py #55

Open
agrajag9 opened this issue Dec 28, 2016 · 4 comments
Open

ValueError in meta_pe.py #55

agrajag9 opened this issue Dec 28, 2016 · 4 comments

Comments

@agrajag9
Copy link

meta_pe.py is throwing the following error on some PE samples:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/laikaboss-2.0-py2.7.egg/laikaboss/si_module.py", line 43, in run
    moduleResult = self._run(scanObject, result, depth, args)
  File "/usr/local/lib/python2.7/dist-packages/laikaboss-2.0-py2.7.egg/laikaboss/modules/meta_pe.py", line 201, in _run
    self.module_name, 'Rich Header', self.parseRich(pe))
  File "/usr/local/lib/python2.7/dist-packages/laikaboss-2.0-py2.7.egg/laikaboss/modules/meta_pe.py", line 247, in parseRich
    result['Hashes'] = self.richHeaderHashes(pe)
  File "/usr/local/lib/python2.7/dist-packages/laikaboss-2.0-py2.7.egg/laikaboss/modules/meta_pe.py", line 259, in richHeaderHashes
    rich_end = data.index(0x68636952)
ValueError: 1751345490 is not in list

I'd rather not share details about the sample here, but will say that the data list variable is not empty. I can share the sample and details through an alternate channel.

@agrajag9
Copy link
Author

Suggested change (per discussion with @marnao):

256,257c256,257
<         rich_data = pe.get_data(0x80, 0x80)
<         data = list(struct.unpack('<32I', rich_data))
---
>         rich_data = pe.get_data(0x80)
>         data = list(struct.unpack('<%sI' % str(len(rich_data)/4), rich_data))

Resolves issues with previously identified samples.

@marnao
Copy link
Contributor

marnao commented Dec 29, 2016

we'll get this merged in soon..

@estuart
Copy link

estuart commented Mar 20, 2017

Interestingly, I have the same exact error and have made the code changes per @agrajag9 suggestion but am still having the same error.

@agrajag9
Copy link
Author

@estuart I assume you made the changes and did a fresh build and install?

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

3 participants