Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- def is_ascii(s):
- return all(ord(c) < 128 for c in s)
- def main():
- #remove file if exist
- filename = 'mem.txt'
- if os.path.exists(filename):
- os.remove('mem.txt')
- #ignore x90 and other read errors
- file = open('mem.dump','r',encoding='utf-8', errors='ignore' )
- myLines=file.readlines()
- str = "".join(myLines)
- with open('mem.txt','w') as f:
- for word in str.split("\x00\x00\x00"):
- if is_ascii(word) and len(word)>5:
- f.write(word.replace("\x00","")+"\n")
- file.close()
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement