-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use print() function in both Python 2 and Python 3 (#1387)
$ __pip install black future isort__ $ __futurize -f libfuturize.fixes.fix_print_with_import -w android.py__ $ __isort android.py__ $ __black android.py__
- Loading branch information
Showing
1 changed file
with
12 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
from pwn import * | ||
from __future__ import print_function | ||
|
||
import gdb | ||
from pwn import adb, context | ||
|
||
# Tell pwntools that the target is an Android device | ||
context.os='android' | ||
context.arch='aarch64' # or 'arm' | ||
context.os = "android" | ||
context.arch = "aarch64" # or 'arm' | ||
|
||
# Optionally, set the remote ADB server address | ||
context.adb_host='172.16.110.1' | ||
context.adb_host = "172.16.110.1" | ||
|
||
# Wait for a device to become available | ||
print adb.wait_for_device() | ||
print(adb.wait_for_device()) | ||
|
||
# Who am I? | ||
print adb.process('id').recvall().strip() | ||
print(adb.process("id").recvall().strip()) | ||
|
||
# Interactive sessions! | ||
io = adb.shell() | ||
io.sendline('echo Hello, world; exit') | ||
print io.recvall().replace('\r\n', '\n').strip() | ||
io.sendline("echo Hello, world; exit") | ||
print(io.recvall().replace("\r\n", "\n").strip()) | ||
|
||
# Debugging! | ||
gdb.debug('sh').interactive() | ||
gdb.debug("sh").interactive() |