viper-framework / viper

Binary analysis and management framework
Other
1.54k stars 353 forks source link

"pe peid" raised an exception #736

Closed srcr closed 5 years ago

srcr commented 5 years ago

Running the pe peid check on a PE results in the below issue.

[!] The command pe raised an exception:
Traceback (most recent call last):
  File "~/.local/lib/python3.6/site-packages/viper/core/ui/console.py", line 313, in start
    module.run()
  File "~/.local/lib/python3.6/site-packages/viper/modules/pe.py", line 1081, in run
    self.peid()
  File "~/.local/lib/python3.6/site-packages/viper/modules/pe.py", line 399, in peid
    signatures = get_signatures()
  File "~/.local/lib/python3.6/site-packages/viper/modules/pe.py", line 386, in get_signatures
    sig_data = f.read()
  File "/usr/local/lib/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 255843: invalid continuation byte

When i change the encoding from utf-8 to ISO-8859-1 it works normal. https://github.com/viper-framework/viper/blob/944a29cd585e373da0097c9ff4d68c8782836c5b/viper/modules/pe.py#L385

botherder commented 5 years ago

I can reproduce it.