Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SIZE_THRESHOLD = 0x80000 #How big a block you want to find (at minimum)
- #1 KiB = 0x400
- #512 KiB = 0x80000
- #1 MiB = 0x100000
- with open('ram.dump', 'rb') as f:
- filedata = f.read()
- l = []
- pos = 0
- while pos < len(filedata):
- num = 0
- basepos = filedata.find(b'\x00', pos + 1)
- pos = basepos
- if pos == -1:
- break
- while filedata[pos] == 0 and pos < len(filedata):
- pos += 1
- if pos - basepos > SIZE_THRESHOLD:
- l.append((hex(basepos), pos - basepos))
- for pos, size in l:
- print(pos, size)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement