CENSUS / shadow

jemalloc heap exploitation framework
Other
447 stars 69 forks source link

gdb shadow support in coredump mode #13

Open fpmystar opened 6 years ago

fpmystar commented 6 years ago

Hi Argp:

I want to use your wonderful tool - CENSUS/shadow to analysis coredump jemalloc layout. But when install all the tool include the pyrsistence, gdb for android and shadow. then load the coredump file with gdb. and parse the jemalloc with jeparse,but it always failed. can you kindly tell me why? does the shadow support the coredump local gdb mode? Thanks very much.

(gdb) source shadow-master/gdb_driver.py [shadow]init (gdb) jeparse -c shadow-master/cfg/android8_32.cfg [shadow] configuration file found [shadow] parsing configuration... [shadow] parsing structures from memory... [shadow] 2018-07-03 13:13:29 Python Exception <class 'gdb.error'> unable to handle request: Error occurred in Python command: unable to handle request

fpmystar commented 6 years ago

when use the jeparse -v, I can't find the debug.log in current directory. (gdb) source ../shadow-master/gdb_driver.py (gdb) jeparse -c ../shadow-master/cfg/android8_32.cfg [shadow] parsing configuration... [shadow] parsing structures from memory... [shadow] 2018-07-04 08:14:00 Python Exception <class 'gdb.error'> unable to handle request: Error occurred in Python command: unable to handle request (gdb) jeparse -v [shadow] parsing structures from memory... [shadow] 2018-07-04 08:14:27 Python Exception <class 'gdb.error'> unable to handle request: Error occurred in Python command: unable to handle request (gdb) pw

hanli-lee commented 5 years ago

resolution: catch the exception,and then return an specific arch,for example: "Aarch64" diff --git a/gdb_engine.py b/gdb_engine.py index 66fc50d..2c2ede6 100644 --- a/gdb_engine.py +++ b/gdb_engine.py @@ -75,10 +75,13 @@ def get_xul_version(): def get_arch():

get the start of text

 text_addr = None
 try:
     for l in execute("info proc stat").split("\n"):
         if l.startswith("Start of text:"):
             text_addr = int(l.split(":")[1], 16)
             break
 except gdb.error:
     return "Aarch64"
argp commented 5 years ago

Great, thanks! Can you submit it as a pull request?