Merge branch 'master' into master

This commit is contained in:
Alone_Monkey 2018-02-07 23:10:36 +08:00 committed by GitHub
commit 5619dfcd28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -1,3 +1,5 @@
Module.ensureInitialized('Foundation');
var O_RDONLY = 0; var O_RDONLY = 0;
var O_WRONLY = 1; var O_WRONLY = 1;
var O_RDWR = 2; var O_RDWR = 2;
@ -208,7 +210,6 @@ function dumpModule(name) {
var modbase = modules[i].base; var modbase = modules[i].base;
var modsize = modules[i].size; var modsize = modules[i].size;
var newmodname = modules[i].name; var newmodname = modules[i].name;
Module.ensureInitialized(newmodname);
var newmodpath = getDocumentDir() + "/" + newmodname + ".fid"; var newmodpath = getDocumentDir() + "/" + newmodname + ".fid";
var oldmodpath = modules[i].path; var oldmodpath = modules[i].path;

10
dump.py
View File

@ -98,7 +98,7 @@ def on_message(message, data):
origin_path = payload['path'] origin_path = payload['path']
dump_path = payload['dump'] dump_path = payload['dump']
scp_from = dump_path.replace(' ', '\ ') scp_from = dump_path
scp_to = PAYLOAD_PATH + u'/' scp_to = PAYLOAD_PATH + u'/'
with SCPClient(ssh.get_transport()) as scp: with SCPClient(ssh.get_transport()) as scp:
@ -117,7 +117,7 @@ def on_message(message, data):
if 'app' in payload: if 'app' in payload:
app_path = payload['app'] app_path = payload['app']
scp_from = app_path.replace(' ', '\ ') scp_from = app_path
scp_to = PAYLOAD_PATH + u'/' scp_to = PAYLOAD_PATH + u'/'
with SCPClient(ssh.get_transport()) as scp: with SCPClient(ssh.get_transport()) as scp:
scp.get(scp_from, scp_to, recursive=True) scp.get(scp_from, scp_to, recursive=True)
@ -229,7 +229,6 @@ def create_dir(path):
path = path.strip() path = path.strip()
path = path.rstrip('\\') path = path.rstrip('\\')
if os.path.exists(path): if os.path.exists(path):
print 'Removing {}'.format(path)
shutil.rmtree(path) shutil.rmtree(path)
try: try:
os.makedirs(path) os.makedirs(path)
@ -283,7 +282,6 @@ if __name__ == '__main__':
if args.list_applications: if args.list_applications:
list_applications(device) list_applications(device)
else: else:
print "Device {}".format(device)
name_or_bundleid = args.target name_or_bundleid = args.target
output_ipa = args.output_ipa output_ipa = args.output_ipa
@ -297,7 +295,8 @@ if __name__ == '__main__':
if output_ipa is None: if output_ipa is None:
output_ipa = display_name output_ipa = display_name
output_ipa = re.sub('\.ipa$', '', output_ipa) output_ipa = re.sub('\.ipa$', '', output_ipa)
start_dump(session, output_ipa) if pid > 0:
start_dump(device, pid, output_ipa)
except paramiko.ssh_exception.NoValidConnectionsError as e: except paramiko.ssh_exception.NoValidConnectionsError as e:
print e print e
exit_code = 1 exit_code = 1
@ -313,7 +312,6 @@ if __name__ == '__main__':
ssh.close() ssh.close()
if os.path.exists(PAYLOAD_PATH): if os.path.exists(PAYLOAD_PATH):
print 'Deleting ' + PAYLOAD_PATH
shutil.rmtree(PAYLOAD_PATH) shutil.rmtree(PAYLOAD_PATH)
sys.exit(exit_code) sys.exit(exit_code)