dionach / PANhunt

PANhunt searches for credit card numbers (PANs) in directories.
BSD 3-Clause "New" or "Revised" License
133 stars 74 forks source link

nameid_guidstream not accessible from outside #6

Closed srepmub closed 7 years ago

srepmub commented 7 years ago

I'd like to see nameid guids, but nameid.wGuid is just the index, and 'nameid_guidstream' is not accessible from the outside. seems useful to interpret wGuid in (1,2) as well. what I currently use:

@@ -1495,6 +1495,14 @@ class Messaging:
             if nameid.N == 1:
                 name_len = struct.unpack('I', nameid_stringstream[nameid.dwPropertyID:nameid.dwPropertyID+4])[0]
                 nameid.name = nameid_stringstream[nameid.dwPropertyID+4:nameid.dwPropertyID+4+name_len].decode('utf-16-le') # unicode
+            if nameid.wGuid == 0:
+                nameid.guid = None
+            elif nameid.wGuid == 1: # PS_MAPI
+                nameid.guid = '(\x03\x02\x00\x00\x00\x00\x00\xc0\x00\x00\x00\x00\x00\x00F'
+            elif nameid.wGuid == 2: # PS_PUBLIC_STRINGS
+                nameid.guid = ')\x03\x02\x00\x00\x00\x00\x00\xc0\x00\x00\x00\x00\x00\x00F'
+            else:
+                nameid.guid = nameid_guidstream[16*(nameid.wGuid-3):16*(nameid.wGuid-2)]
bli-dn commented 7 years ago

pst.py updated