-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmd5_icons.py
More file actions
35 lines (30 loc) · 948 Bytes
/
md5_icons.py
File metadata and controls
35 lines (30 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#-------------------------------------------------------------------------------
# Name: MD5 generator for extracted Upatre icons
#
# Purpose: Identify how many icons are shared among Upatre samples.
#
# Author: Ptr32Void - @Ptr32Void - ptr32void@gmail.com
#-------------------------------------------------------------------------------
import os
import sys
import hashlib
import string
md5list = []
def md5sum(filename, blocksize=65536):
hash = hashlib.md5()
with open(filename, "rb") as f:
for block in iter(lambda: f.read(blocksize), ""):
hash.update(block)
return hash.hexdigest()
def main():
for fn in os.listdir("."):
if (fn.find(".ico")!=-1):
md5file = md5sum(fn)
if (md5file in md5list):
continue
else:
md5list.append(md5file)
for md5 in md5list:
print md5
if __name__ == '__main__':
main()