Skip to content

Commit 9a40009

Browse files
authored
Initial commit
0 parents  commit 9a40009

File tree

66 files changed

+1788
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1788
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# PAD (Process Android Dumper)
2+
This dumper is made for il2cpp game but you can use it in any app you want
3+
4+
## How To Use
5+
- Run the process
6+
- Open PADumper
7+
- Put process name manually or you can click `Select Apps` to select running apps
8+
- Put the ELF Name or you can leave it with default name `libil2cpp.so`
9+
- Check `global-metadata.dat` if you want dump unity metadata from memory
10+
- Dump and wait process to finish
11+
- Result will be in `/sdcard/PADumper/[Process]/[startAddress-nameFile]`
12+
13+
## Credits
14+
- [libsu](https://github.com/topjohnwu/libsu)

app/build.gradle

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
id 'kotlin-parcelize'
5+
}
6+
7+
android {
8+
compileSdk 32
9+
namespace "com.dumper.android"
10+
11+
defaultConfig {
12+
applicationId "com.dumper.android"
13+
minSdk 21
14+
targetSdk 32
15+
versionCode 2
16+
versionName "2.0.6"
17+
}
18+
19+
signingConfigs {
20+
debug {
21+
storeFile file("keystore.jks")
22+
keyAlias "PADumper"
23+
storePassword "012345"
24+
keyPassword "012345"
25+
}
26+
release {
27+
storeFile file("keystore.jks")
28+
keyAlias "PADumper"
29+
storePassword "012345"
30+
keyPassword "012345"
31+
}
32+
}
33+
34+
buildTypes {
35+
debug {
36+
minifyEnabled false
37+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
38+
signingConfig signingConfigs.debug
39+
}
40+
release {
41+
minifyEnabled true
42+
shrinkResources true
43+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
44+
signingConfig signingConfigs.release
45+
}
46+
}
47+
48+
compileOptions {
49+
sourceCompatibility JavaVersion.VERSION_1_8
50+
targetCompatibility JavaVersion.VERSION_1_8
51+
}
52+
53+
buildFeatures {
54+
viewBinding true
55+
}
56+
57+
kotlinOptions {
58+
jvmTarget = '1.8'
59+
}
60+
61+
}
62+
63+
dependencies {
64+
//Ui
65+
implementation "androidx.core:core-ktx:1.8.0"
66+
implementation "androidx.fragment:fragment-ktx:1.4.1"
67+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1"
68+
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.1"
69+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.1"
70+
implementation "com.google.android.material:material:1.6.1"
71+
implementation "com.afollestad.material-dialogs:core:3.3.0"
72+
73+
//Root
74+
def libsuVersion = '5.0.2'
75+
implementation "com.github.topjohnwu.libsu:core:${libsuVersion}"
76+
implementation "com.github.topjohnwu.libsu:service:${libsuVersion}"
77+
}

app/keystore.jks

2.5 KB
Binary file not shown.

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

app/src/main/AndroidManifest.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<application
5+
android:allowBackup="true"
6+
android:icon="@mipmap/ic_launcher"
7+
android:label="@string/app_name"
8+
android:name=".core.App"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
11+
android:theme="@style/Theme.PADumper.NoActionBar">
12+
<activity
13+
android:name=".core.SplashActivity"
14+
android:exported="true">
15+
<intent-filter>
16+
<action android:name="android.intent.action.MAIN" />
17+
<category android:name="android.intent.category.LAUNCHER" />
18+
</intent-filter>
19+
</activity>
20+
<activity android:name=".core.MainActivity" />
21+
</application>
22+
23+
</manifest>
89.7 KB
Binary file not shown.
182 KB
Binary file not shown.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.dumper.android.core
2+
3+
import android.app.Application
4+
import android.content.Context
5+
import com.dumper.android.BuildConfig
6+
import com.topjohnwu.superuser.Shell
7+
8+
class App : Application() {
9+
override fun attachBaseContext(base: Context?) {
10+
super.attachBaseContext(base)
11+
12+
Shell.enableVerboseLogging = BuildConfig.DEBUG
13+
Shell.setDefaultBuilder(
14+
Shell.Builder.create().setFlags(Shell.FLAG_MOUNT_MASTER)
15+
)
16+
}
17+
18+
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
package com.dumper.android.core
2+
3+
import android.content.Intent
4+
import android.content.Intent.ACTION_VIEW
5+
import android.net.Uri
6+
import android.os.*
7+
import android.view.Menu
8+
import androidx.activity.viewModels
9+
import androidx.appcompat.app.AppCompatActivity
10+
import androidx.fragment.app.commit
11+
import com.dumper.android.R
12+
import com.dumper.android.core.RootServices.Companion.IS_FIX_NAME
13+
import com.dumper.android.core.RootServices.Companion.IS_FLAG_CHECK
14+
import com.dumper.android.core.RootServices.Companion.LIBRARY_DIR_NAME
15+
import com.dumper.android.core.RootServices.Companion.LIST_FILE
16+
import com.dumper.android.core.RootServices.Companion.MSG_DUMP_PROCESS
17+
import com.dumper.android.core.RootServices.Companion.MSG_GET_PROCESS_LIST
18+
import com.dumper.android.core.RootServices.Companion.PROCESS_NAME
19+
import com.dumper.android.databinding.ActivityMainBinding
20+
import com.dumper.android.dumper.Fixer
21+
import com.dumper.android.messager.MSGConnection
22+
import com.dumper.android.messager.MSGReceiver
23+
import com.dumper.android.ui.ConsoleFragment
24+
import com.dumper.android.ui.MemoryFragment
25+
import com.dumper.android.ui.viewmodel.ConsoleViewModel
26+
import com.dumper.android.ui.viewmodel.MainViewModel
27+
import com.topjohnwu.superuser.ipc.RootService
28+
29+
class MainActivity : AppCompatActivity() {
30+
private lateinit var mainBind: ActivityMainBinding
31+
val mainVm: MainViewModel by viewModels()
32+
val console: ConsoleViewModel by viewModels()
33+
34+
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
35+
super.onCreateOptionsMenu(menu)
36+
menuInflater.inflate(R.menu.appbar_menu, menu)
37+
return true
38+
}
39+
40+
override fun onCreate(savedInstanceState: Bundle?) {
41+
super.onCreate(savedInstanceState)
42+
mainBind = ActivityMainBinding.inflate(layoutInflater)
43+
initService()
44+
45+
with(mainBind) {
46+
setContentView(root)
47+
setSupportActionBar(toolbar)
48+
49+
if (savedInstanceState == null) {
50+
supportFragmentManager
51+
.beginTransaction()
52+
.add(R.id.contentContainer, MemoryFragment.instance)
53+
.commit()
54+
}
55+
56+
57+
bottomBar.setOnItemSelectedListener {
58+
supportFragmentManager.commit {
59+
setCustomAnimations(
60+
R.anim.fade_in,
61+
R.anim.fade_out,
62+
R.anim.fade_in,
63+
R.anim.fade_out
64+
)
65+
replace(
66+
R.id.contentContainer,
67+
when (it.itemId) {
68+
R.id.action_memory -> MemoryFragment.instance
69+
R.id.action_console -> ConsoleFragment.instance
70+
else -> throw IllegalArgumentException("Unknown item selected")
71+
}, null
72+
)
73+
}
74+
true
75+
}
76+
77+
toolbar.setOnMenuItemClickListener {
78+
if (it.itemId == R.id.github) {
79+
startActivity(
80+
Intent(
81+
ACTION_VIEW,
82+
Uri.parse("https://github.com/BryanGIG/PADumper")
83+
)
84+
)
85+
}
86+
true
87+
}
88+
}
89+
}
90+
91+
private fun initService() {
92+
Fixer.extractLibs(this)
93+
if (mainVm.remoteMessenger == null) {
94+
mainVm.dumperConnection = MSGConnection(this)
95+
val intent = Intent(this, RootServices::class.java)
96+
RootService.bind(intent, mainVm.dumperConnection)
97+
mainVm.receiver = Messenger(Looper.myLooper()?.let { Handler(it, MSGReceiver(this)) })
98+
}
99+
}
100+
101+
fun sendRequestAllProcess() {
102+
val message = Message.obtain(null, MSG_GET_PROCESS_LIST)
103+
message.replyTo = mainVm.receiver
104+
mainVm.remoteMessenger?.send(message)
105+
}
106+
107+
fun sendRequestDump(process: String, dump_file: Array<String>, autoFix: Boolean, flagCheck: Boolean) {
108+
val message = Message.obtain(null, MSG_DUMP_PROCESS)
109+
110+
message.data.apply {
111+
putString(PROCESS_NAME, process)
112+
putStringArray(LIST_FILE, dump_file)
113+
putBoolean(IS_FLAG_CHECK, flagCheck)
114+
if (autoFix) {
115+
putBoolean(IS_FIX_NAME, true)
116+
putString(LIBRARY_DIR_NAME, "${filesDir.path}/SoFixer")
117+
}
118+
}
119+
120+
message.replyTo = mainVm.receiver
121+
mainVm.remoteMessenger?.send(message)
122+
}
123+
124+
override fun onDestroy() {
125+
super.onDestroy()
126+
RootService.unbind(mainVm.dumperConnection)
127+
}
128+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
package com.dumper.android.core
2+
3+
import android.content.Intent
4+
import android.os.*
5+
import android.util.Log
6+
import com.dumper.android.dumper.Dumper
7+
import com.dumper.android.dumper.process.Process
8+
import com.dumper.android.utils.TAG
9+
import com.topjohnwu.superuser.ipc.RootService
10+
11+
12+
class RootServices : RootService(), Handler.Callback {
13+
override fun onBind(intent: Intent): IBinder {
14+
val h = Handler(Looper.getMainLooper(), this)
15+
val m = Messenger(h)
16+
return m.binder
17+
}
18+
19+
override fun handleMessage(msg: Message): Boolean {
20+
val reply = Message.obtain()
21+
val data = Bundle()
22+
23+
when (msg.what) {
24+
MSG_GET_PROCESS_LIST -> {
25+
val process = Process(this).getAllProcess()
26+
reply.what = MSG_GET_PROCESS_LIST
27+
data.putParcelableArrayList(LIST_ALL_PROCESS, process)
28+
}
29+
30+
MSG_DUMP_PROCESS -> {
31+
val requestData = msg.data
32+
reply.what = MSG_DUMP_PROCESS
33+
val logOutput = StringBuilder()
34+
val process = requestData.getString(PROCESS_NAME)
35+
val listFile = requestData.getStringArray(LIST_FILE)
36+
val isFlagCheck = requestData.getBoolean(IS_FLAG_CHECK)
37+
val isAutoFix = requestData.getBoolean(IS_FIX_NAME, false)
38+
if (process != null && listFile != null) {
39+
val dumper = Dumper(process)
40+
for (file in listFile) {
41+
dumper.file = file
42+
logOutput.appendLine(dumper.dumpFile(isAutoFix, isFlagCheck))
43+
}
44+
data.putString(DUMP_LOG, logOutput.toString())
45+
} else {
46+
data.putString(DUMP_LOG, "[ERROR] Data Error!")
47+
}
48+
}
49+
else -> {
50+
data.putString(DUMP_LOG, "[ERROR] Unknown command")
51+
}
52+
}
53+
54+
reply.data = data
55+
try {
56+
msg.replyTo.send(reply)
57+
} catch (e: RemoteException) {
58+
Log.e(TAG, "Remote error", e)
59+
}
60+
return false
61+
}
62+
63+
override fun onUnbind(intent: Intent): Boolean {
64+
return false
65+
}
66+
67+
companion object {
68+
const val MSG_DUMP_PROCESS = 1
69+
const val MSG_GET_PROCESS_LIST = 2
70+
const val DUMP_LOG = "DUMP_LOG"
71+
const val LIBRARY_DIR_NAME = "NATIVE_DIR"
72+
const val LIST_ALL_PROCESS = "LIST_ALL_PROCESS"
73+
const val PROCESS_NAME = "PROCESS"
74+
const val LIST_FILE = "LIST_FILE"
75+
const val IS_FLAG_CHECK = "IS_FLAG_CHECK"
76+
const val IS_FIX_NAME = "FIX_ELF"
77+
}
78+
}

0 commit comments

Comments
 (0)