Skip to content
Snippets Groups Projects
Commit ca162540 authored by Tengfei Fan's avatar Tengfei Fan Committed by Shiraz Hashim
Browse files

lrdp_v2 : ramdump : Get phys offset dynamically for 32bit kernel

Get phys offset dynamically for 32bit kernel

Change-Id: I8184b0c13f6da6164bf8b72b5701f08343138cfc
parent cf3aff0b
Branches
No related tags found
No related merge requests found
......@@ -507,10 +507,13 @@ class RamDump():
kimage_load_addr = phys_base;
while (kimage_load_addr < phys_end):
kimage_voffset = self.kimage_vaddr - kimage_load_addr
kimage_voffset = self.modules_end - kimage_load_addr
addr = self.address_of("kimage_voffset") - self.kaslr_offset - \
vmalloc_start + kimage_load_addr
if self.arm64:
val = self.read_u64(addr, False)
else:
val = self.read_u32(addr, False)
if val is None:
val = 0
val = long(val)
......@@ -681,6 +684,14 @@ class RamDump():
self.kimage_voffset = self.kimage_vaddr - self.phys_offset
print_out_str("The kimage_voffset extracted is: {:x}".format(self.kimage_voffset))
else:
self.kimage_voffset = self.address_of("kimage_voffset")
if self.kimage_voffset is not None:
if not (options.phys_offset or self.minidump):
phys_offset_dyn = self.determine_phys_offset()
if phys_offset_dyn:
print_out_str("Dynamically determined phys offset is"
": {:x}".format(phys_offset_dyn))
self.phys_offset = phys_offset_dyn
self.kimage_voffset = None
# The address of swapper_pg_dir can be used to determine
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment