Skip to content

Commit 7af747c

Browse files
authored
Update README.md for Android
1 parent 939e4a3 commit 7af747c

File tree

1 file changed

+47
-41
lines changed

1 file changed

+47
-41
lines changed

README.md

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,57 @@
11
# PPPwn c++
22

3-
This is the C++ rewrite of [PPPwn](https://github.com/TheOfficialFloW/PPPwn)
3+
This is the C++ rewrite of [PPPwn](https://github.com/TheOfficialFloW/PPPwn) by [xfangfang](https://github.com/xfangfang/PPPwn_cpp) modified to compile for Android
44

55
# Features
66

7-
- Smaller binary size
8-
- A wide range of CPU architectures and systems are supported
9-
- Run faster under Windows (more accurate sleep time)
10-
- Restart automatically when failing
11-
- Can be compiled as a library integrated into your application
7+
- The same as xfanfang one
8+
- Can compile from NDK or Termux app
9+
- Supported target Android versions from KitKat 4.4 up
1210

13-
# Nightly build
11+
# Building
1412

15-
You can download the latest build from [nightly.link](https://nightly.link/xfangfang/PPPwn_cpp/workflows/ci.yaml/main?status=completed).
13+
### Building from native Linux machine
1614

17-
For Windows users, you need to install [npcap](https://npcap.com) before run this program.
18-
There are lots of GUI wrapper for pppwn_cpp, it's better to use them if you are not familiar with command line.
15+
Download your desired NDK version through Android Studio or directly from official [github](https://github.com/android/ndk/releases). If you want to compile for Android 4.4.x targets you must download version [r25c here](https://dl.google.com/android/repository/android-ndk-r25c-linux.zip), otherwise you can use a more recent one.
1916

20-
For macOS users, you need to run `sudo xattr -rd com.apple.quarantine <path-to-pppwn>` after download.
21-
Please refer to [#10](https://github.com/xfangfang/PPPwn_cpp/issues/10) for more information.
17+
Extract the files in your <home>/Android/Sdk/ndk or other preferred folder.
18+
19+
Clone this repository with
20+
```shell
21+
git clone --recursive https://github.com/deviato/PPPwn_cpp_android.git
22+
cd PPPwn_cpp_android
23+
```
24+
Edit `CMakeLists.txt` file and change the options to reflect your system and desired target (info inside the file).
25+
26+
Run these commands to build the binary:
27+
```shell
28+
cmake -B build
29+
cmake --build build -t pppwn
30+
```
31+
The resulting binary will be in build/pppwn
32+
33+
### Building from Termux app directly on your phone
34+
35+
Download Termux app (not GooglePlay but [F-Droid version here](https://f-droid.org/repo/com.termux_118.apk)) and install on your phone.
36+
Open the app and run these commands:
37+
```shell
38+
apt -y update && apt -y upgrade && apt -y update
39+
# (respond y to every question)
40+
apt install -y git build-essential binutils file ndk-multilib-native-static termux-elf-cleaner tsu
41+
# Clone this repository
42+
git clone --recursive https://github.com/deviato/PPPwn_cpp_android.git
43+
cd PPPwn_cpp_android
44+
# Build for your device
45+
cmake -B build -DTERMUX=1
46+
cmake --build build -t pppwn
47+
# If no errors, your target is in build/pppwn, but you need to realign TLS before running:
48+
termux-elf-cleaner build/pppwn
49+
# Optionally strip debug symbols with:
50+
strip build/pppwn
51+
# You can now try to run the build with root:
52+
tsu
53+
build/pppwn
54+
```
2255

2356
# Usage
2457

@@ -62,34 +95,7 @@ Supplement:
6295
4. For `--groom-delay`, This is an empirical value. The Python version of pppwn does not set any wait at Heap grooming, but if the C++ version does not add some wait, there is a probability of kernel panic on my ps4. You can set any value within 1-4097 (4097 is equivalent to not doing any wait).
6396
5. For `--buffer-size`, When running on low-end devices, this value can be set to reduce memory usage. I tested that setting it to 10240 can run normally, and the memory usage is about 3MB. (Note: A value that is too small may cause some packets to not be captured properly)
6497

65-
# Development
66-
67-
This project depends on [pcap](https://github.com/the-tcpdump-group/libpcap), cmake will search for it in the system path by default.
68-
You can also add cmake option `-DUSE_SYSTEM_PCAP=OFF` to compile pcap from source (can be used when cross-compiling).
69-
70-
Please refer to the workflow file [.github/workflows/ci.yaml](.github/workflows/ci.yaml) for more information.
71-
72-
```shell
73-
# native build (macOS, Linux)
74-
cmake -B build
75-
cmake --build build -t pppwn
76-
77-
# cross compile for mipsel linux (soft float)
78-
cmake -B build -DZIG_TARGET=mipsel-linux-musl -DUSE_SYSTEM_PCAP=OFF -DZIG_COMPILE_OPTION="-msoft-float"
79-
cmake --build build -t pppwn
80-
81-
# cross compile for arm linux (armv7 cortex-a7)
82-
cmake -B build -DZIG_TARGET=arm-linux-musleabi -DUSE_SYSTEM_PCAP=OFF -DZIG_COMPILE_OPTION="-mcpu=cortex_a7"
83-
cmake --build build -t pppwn
84-
85-
# cross compile for Windows
86-
# https://npcap.com/dist/npcap-sdk-1.13.zip
87-
cmake -B build -DZIG_TARGET=x86_64-windows-gnu -DUSE_SYSTEM_PCAP=OFF -DPacket_ROOT=<path to npcap sdk>
88-
cmake --build build -t pppwn
89-
```
90-
9198
# Credits
9299

93-
Big thanks to FloW's magical work, you are my hero.
94-
95-
100+
Big thanks to xfangfang's magical work, you are my hero.
101+
And to FloW's magical work, which is xfangfang's hero (and consequently mine too).

0 commit comments

Comments
 (0)