[Notepad 1]
NtReadFile
SetFilePointer
NtClose
NtCreateFile
GetFileType
[Notepad 2]
NtCreateFile
GetFileType
NtAllocateVirtualMemory
GetFileInformationByHandle
RegOpenKeyExA
I read two notepads like this, and there are two overlapping words, so I want to return two 1 I don't know how to do it. Help me
python
Please keep that in mind.
>>> f1 = open('/home/allinux/memo1.txt').read()splitlines()# Save list by line
['NtReadFile', 'SetFilePointer', 'NtClose', 'NtCreateFile', 'GetFileType']
>>> f2 = open('/home/allinux/memo2.txt').read().splitlines()
['NtCreateFile', 'GetFileType', 'NtAllocateVirtualMemory', 'GetFileInformationByHandle', 'RegOpenKeyExA']
>>> set(f1) & set(f2) # Intersection. Extract only the same ones
{'NtCreateFile', 'GetFileType'}
>>> len(set(f1) & set(f2))
2
>>> tuple(map(lambda i:1, set(f1) & set(f2)))
(1, 1)
© 2024 OneMinuteCode. All rights reserved.