Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnalyzeAPK from androguard is super super helpful #53

Open
lucasduffey opened this issue Oct 10, 2017 · 2 comments
Open

AnalyzeAPK from androguard is super super helpful #53

lucasduffey opened this issue Oct 10, 2017 · 2 comments

Comments

@lucasduffey
Copy link
Owner

lucasduffey commented Oct 10, 2017

https://github.com/androguard/androguard/blob/master/tests/test_decompiler.py

wget https://github.com/latenssi/csawctf13/raw/master/herpderperp/herpderper.apk

from androguard.misc import AnalyzeAPK
apk, dalvik_vm_format, analysis = AnalyzeAPK("herpderper.apk") # I think AnalyzeAPK can take decompiler arg

dalvik_vm_format.get_class('Lcom/path/to/class;').source() # decompile

for class in dalvik_vm_format.get_classes():
  class.source() # decompile
@lucasduffey
Copy link
Owner Author

NOTE: I think dalvik_vm_format can be a list, if multiple dex files

@lucasduffey
Copy link
Owner Author

lucasduffey commented Oct 11, 2017

	apk, dalvik_vm_formats, analysis = AnalyzeAPK(apk_path)

	url_regex = "(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9]\.[^\s]{2,})"
	print(dalvik_vm_formats)

	if type(dalvik_vm_formats) != list:
		dalvik_vm_formats = [dalvik_vm_formats]

	regex_strings = []
	for dalvik_vm_format in dalvik_vm_formats:
		regex_strings += dalvik_vm_format.get_regex_strings(url_regex)
``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant