diff --git a/laikaboss/modules/meta_pe.py b/laikaboss/modules/meta_pe.py index 673685f..f1573d8 100644 --- a/laikaboss/modules/meta_pe.py +++ b/laikaboss/modules/meta_pe.py @@ -244,7 +244,9 @@ def parseRich(self, pe): result['Rich Header Values'] = data result['Checksum'] = pe.RICH_HEADER.checksum - result['Hashes'] = self.richHeaderHashes(pe) + hashes = self.richHeaderHashes(pe) + if hashes: + result['Hashes'] = hashes return result @@ -253,17 +255,15 @@ def richHeaderHashes(pe): """ Returns hashes of the Rich PE header """ - rich_data = pe.get_data(0x80, 0x80) - data = list(struct.unpack('<32I', rich_data)) - checksum = data[1] - rich_end = data.index(0x68636952) - md5 = hashlib.md5() - sha1 = hashlib.sha1() - sha256 = hashlib.sha256() - for i in range(rich_end): - md5.update(struct.pack('