var opencommon = Module . findExportByName ( "libart.so" , "_ZN3art7DexFile10OpenCommonEPKhjRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEjPKNS_10OatDexFileEbbPS9_PNS0_12VerifyResultE" ) ; console . log ( "opencommon addr: " + opencommon ) ; Interceptor . attach ( opencommon , { onEnter : function ( args ) { var begin = args [ 1 ] ; console . log ( begin ) ; console . log ( "magic : " + Memory . readUtf8String ( begin ) ) ; var address = parseInt ( begin , 16 ) + 0x20 ; var dex_size = Memory . readInt ( ptr ( address ) ) ; console . log ( "dex_size :" + dex_size ) ; var file = new File ( "/sdcard/unpack/" + dex_size + ".dex" , "wb" ) ; file . write ( Memory . readByteArray ( begin , dex_size ) ) ; file . flush ( ) ; file . close ( ) ; } , onLeave : function ( retval ) { if ( retval . toInt32 ( ) > 0 ) { } } } ) ;