Skip to content

Instantly share code, notes, and snippets.

@chickendrop89
Last active July 20, 2025 18:49
Show Gist options
  • Save chickendrop89/ae1e947dc3c07de7f3ab573bb1f5fb10 to your computer and use it in GitHub Desktop.
Save chickendrop89/ae1e947dc3c07de7f3ab573bb1f5fb10 to your computer and use it in GitHub Desktop.
How to read pstore/ramoops via mtkclient

How to extract PStore from a device with mtkclient

  • This must be done after a kernel panic/warm boot. Otherwise you might not get any meaningful data.
  • The first two steps can be skipped if you know the address and the length of the region.
  1. Extract expdb partition and run the strings against the image.
$ python mtk.py r expdb expdb.img
$ strings expdb.img > expdb.txt
  1. Search for ramoops.mem_address or similar ramoops props in expdb.txt.
# Example for opal (redmi note 11s 5g, mt6883p)
ramoops.mem_address=0x48090000 ramoops.mem_size=0xe0000 ramoops.console_size=0x40000
  1. Extract the PStore memory region.
# Example for opal (redmi note 11s 5g, mt6883p)
$ python mtk.py da peek 0x48090000 0xe0000 --filename pstore.bin
$ strings pstore.bin > pstore.txt

Now just read the pstore.txt in your editor. The first half might be corrupted due to compression/etc

@chickendrop89
Copy link
Author

chickendrop89 commented Jul 6, 2025

I have made an automation for this along with more info and automation of the expdb step:

https://github.com/chickendrop89/mtk-log-util

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment