diff --git a/linux-ramdump-parser-v2/ramdump.py b/linux-ramdump-parser-v2/ramdump.py index 28938ae8b3ada9e37be0ead65bf42d16b714413d..4df88889fbc0f1054b9fbbb6aa0198ac9a84feaf 100644 --- a/linux-ramdump-parser-v2/ramdump.py +++ b/linux-ramdump-parser-v2/ramdump.py @@ -436,7 +436,8 @@ class RamDump(): if urc < 0: break - def __init__(self, vmlinux_path, nm_path, gdb_path, ebi, file_path, phys_offset, outdir, hw_id=None, hw_version=None, arm64=False): + def __init__(self, vmlinux_path, nm_path, gdb_path, ebi, file_path, phys_offset, outdir, hw_id=None, hw_version=None, arm64=False, + page_offset=None): self.ebi_files = [] self.phys_offset = None self.tz_start = 0 @@ -476,11 +477,14 @@ class RamDump(): '[!!!] Phys offset was set to {0:x}'.format(phys_offset)) self.phys_offset = phys_offset self.lookup_table = [] - self.page_offset = 0xc0000000 self.config = [] if self.arm64: self.page_offset = 0xffffffc000000000 self.thread_size = 16384 + if page_offset is not None: + print_out_str( + '[!!!] Page offset was set to {0:x}'.format(page_offset)) + self.page_offset = page_offset self.setup_symbol_tables() # The address of swapper_pg_dir can be used to determine diff --git a/linux-ramdump-parser-v2/ramparse.py b/linux-ramdump-parser-v2/ramparse.py index d43712007e2ae5c3a4fd0fb88744741df431b076..d38aed4dd8bce9d31e4bbcc22b5631eb7d04701f 100755 --- a/linux-ramdump-parser-v2/ramparse.py +++ b/linux-ramdump-parser-v2/ramparse.py @@ -106,6 +106,8 @@ if __name__ == '__main__': dest='stdout', help='Dump to stdout instead of the file') parser.add_option('', '--phys-offset', type='int', dest='phys_offset', help='use custom phys offset') + parser.add_option('', '--page-offset', type='int', + dest='page_offset', help='use custom page offset') parser.add_option('', '--force-hardware', type='int', dest='force_hardware', help='Force the hardware detection') parser.add_option( @@ -260,7 +262,8 @@ if __name__ == '__main__': dump = RamDump(options.vmlinux, nm_path, gdb_path, options.ram_addr, options.autodump, options.phys_offset, options.outdir, options.force_hardware, options.force_hardware_version, - arm64=options.arm64) + arm64=options.arm64, + page_offset=options.page_offset) if options.shell or options.classic_shell: print("Entering interactive shell mode.")