Advertisement
Guest User

PSP Ram Searcher

a guest
Aug 23rd, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. SIZE_THRESHOLD = 0x80000   #How big a block you want to find (at minimum)
  2. #1   KiB = 0x400
  3. #512 KiB = 0x80000
  4. #1   MiB = 0x100000
  5. with open('ram.dump', 'rb') as f:
  6.     filedata = f.read()
  7. l = []
  8. pos = 0
  9. while pos < len(filedata):
  10.     num = 0
  11.     basepos = filedata.find(b'\x00', pos + 1)
  12.     pos = basepos
  13.     if pos == -1:
  14.         break
  15.     while filedata[pos] == 0 and pos < len(filedata):
  16.         pos += 1
  17.     if pos - basepos > SIZE_THRESHOLD:
  18.         l.append((hex(basepos), pos - basepos))
  19. for pos, size in l:
  20.     print(pos, size)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement