def on_spawn_picked(self, widget_android_package): editor = JsEditorDialog( self.app, def_text=self.startup_script, placeholder_text= '// Javascript with frida and dwarf api to run at injection') accept, what = editor.show() if accept: self.startup_script = what self.app.get_dwarf().spawn( widget_android_package.get_package_name(), script=what)
def on_spawn_picked(self, widget_android_package): editor = JsEditorDialog(self.app, def_text=self.startup_script, placeholder_text='// Javascript with frida and dwarf api to run at injection') accept, what = editor.show() if accept: self.startup_script = what app_name = widget_android_package.appname package_name = widget_android_package.get_package_name() self.app.get_dwarf().spawn(package_name, script=what) self.app.get_dwarf().app_window.update_title("Dwarf - Attached to %s (%s)" % (app_name, package_name))
def on_proc_picked(self, widget_android_package): editor = JsEditorDialog(self.app, def_text=self.startup_script, placeholder_text='// Javascript with frida and dwarf api to run at injection') accept, what = editor.show() if accept: self.startup_script = what app_name = widget_android_package.appname app_pid = widget_android_package.get_pid() if "\t" in app_name: app_name = app_name.split("\t")[1] self.app.get_dwarf().attach(app_pid, script=what) self.app.get_dwarf().app_window.update_title("Dwarf - Attached to %s (pid %s)" % (app_name, app_pid))
def js_function_box(self): dialog = JsEditorDialog( self.app_window, def_text=self.function_content, file=self.script_file, placeholder_text='// js script with both frida and dwarf api.\n' '// note that it\'s evaluated. Which means, if you define a variable\n' '// or attach an Interceptor, it won\'t be removed by ' 'just deleting the script content') accept, what = dialog.show() if self.script_file is None and dialog.file is not None: # script got saved self.script_file = dialog.file self.function_content = what if self.function_content: if accept: self.app_window.session_manager.session.dwarf.dwarf_api( 'evaluateFunction', self.function_content) if self.script_file is not None: with open(self.script_file, 'w') as f: f.write(self.function_content)