File: addrdump.py

package info (click to toggle)
m1n1 1.5.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,468 kB
  • sloc: python: 42,002; ansic: 33,376; asm: 1,101; makefile: 271; xml: 177; sh: 116
file content (28 lines) | stat: -rwxr-xr-x 526 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
import sys, pathlib
sys.path.append(str(pathlib.Path(__file__).resolve().parents[1]))

from m1n1.setup import *

blacklist = []

print("Dumping address space...")
of = None
if len(sys.argv) > 1:
	of = open(sys.argv[1],"w")
	print("Also dumping to file %s")

for i in range(0x0000, 0x10000):
	if i in blacklist:
		v = "%08x: SKIPPED"%(i<<16)
	else:
		a = (i<<16) + 0x1000
		d = p.read32(a)
		v = "%08x: %08x"%(a, d)
	print(v)
	if of:
		of.write(v+"\n")

if of:
	of.close()