chunhualiu / verify-sigs

Automatically exported from code.google.com/p/verify-sigs
Apache License 2.0
0 stars 0 forks source link

FindPehash failing #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I'm receiving KeyErrors for sha256/sha512 within FindPehash

What is the expected output? What do you see instead?
=========================
When receiving a KeyError:
=========================
$ python verify-sigs-1.2/fingerprint.py file.tmp 
Scanning file.tmp
file.tmp:
  generic fingerprint type
    md5: <removed>
    sha1: <removed>
    sha256: <removed>
    sha512: <removed>
  pecoff fingerprint type
    SignedData: (rev=512, type=2, cert len=960 bytes)
    md5: <removed>
    sha1: <removed>

Traceback (most recent call last):
  File "verify-sigs-1.2/fingerprint.py", line 481, in <module>
    main(sys.argv[1:])
  File "verify-sigs-1.2/fingerprint.py", line 477, in main
    FindPehash(results)
  File "verify-sigs-1.2/fingerprint.py", line 461, in FindPehash
    if res['SignedData'][0][2].find(res[hashes]) != -1:
KeyError: 'sha256'

===============================================
When the keys 'sha256' and 'sha512' are removed
===============================================
$ python verify-sigs-1.2/fingerprint.py file.tmp 
Scanning file.tmp
file:
  generic fingerprint type
    md5: <removed>
    sha1: <removed>
    sha256: <removed>
    sha512: <removed>
  pecoff fingerprint type
    SignedData: (rev=512, type=2, cert len=960 bytes)
    md5: <removed>
    sha1: <removed>

PE File with signature data, NO hash matches.

What version of the product are you using? On what operating system?
v1.2

Please provide any additional information below.
I can provide the file being tested if needed.

Original issue reported on code.google.com by hiddenil...@gmail.com on 4 Dec 2012 at 6:10

GoogleCodeExporter commented 8 years ago
Fixed in my fork

https://code.google.com/r/lilinzhe-verify-sigs/

Original comment by lilinzhe@conew.com on 6 Feb 2015 at 6:41