Skip to content

Instantly share code, notes, and snippets.

@ISTweak
Created July 4, 2013 00:20
Show Gist options
  • Save ISTweak/5923975 to your computer and use it in GitHub Desktop.
Save ISTweak/5923975 to your computer and use it in GitHub Desktop.
# http://cubeundcube.blogspot.jp/2013/07/xperia-gx-so-04d-sx-so-05djelly.html
# 上記のツールのソースからアドレスをコピペしました
# main.cはrootでコマンド実行出来るようにてきとーにコピペしました
#
--- android_device_database/device_database.c Thu Jul 04 09:03:00 2013
+++ device_database/device_database.c Wed Jul 03 23:47:26 2013
@@ -674,6 +674,17 @@
},
{
+ .device_id = DEVICE_SO04D_9_1_C_0_475,
+ .device = "SO-04D",
+ .build_id = "9.1.C.0.475",
+
+ .prepare_kernel_cred_address = 0xc0095cb0,
+ .commit_creds_address = 0xc00957d4,
+ .remap_pfn_range_address = 0xc010aaf8,
+ .ptmx_fops_address = 0xc0d024a0,
+ },
+
+ {
.device_id = DEVICE_SO04E_10_1_1_D_0_179,
.device = "SO-04E",
.build_id = "10.1.1.D.0.179",
@@ -692,6 +703,17 @@
},
{
+ .device_id = DEVICE_SO05D_9_1_C_0_475,
+ .device = "SO-05D",
+ .build_id = "9.1.C.0.475",
+
+ .prepare_kernel_cred_address = 0xc00958ac,
+ .commit_creds_address = 0xc00953d0,
+ .remap_pfn_range_address = 0xc010a6f4,
+ .ptmx_fops_address = 0xc0d01e50,
+ },
+
+ {
.device_id = DEVICE_SOL21_9_0_F_0_226,
.device = "SOL21",
.build_id = "9.0.F.0.226",
--- android_device_database/device_database.h Thu Jul 04 09:03:00 2013
+++ device_database/device_database.h Wed Jul 03 23:45:37 2013
@@ -61,8 +61,10 @@
DEVICE_SO03E_10_1_E_0_265,
DEVICE_SO03E_10_1_E_0_269,
DEVICE_SO04D_7_0_D_1_137,
+ DEVICE_SO04D_9_1_C_0_475,
DEVICE_SO04E_10_1_1_D_0_179,
DEVICE_SO05D_7_0_D_1_137,
+ DEVICE_SO05D_9_1_C_0_475,
DEVICE_SOL21_9_0_F_0_226,
DEVICE_SOL21_9_1_D_0_395,
DEVICE_SOL22_10_2_F_3_43,
--- android_run_root_shell-master/main.c Thu Jun 27 11:15:40 2013
+++ run_root_shell/main.c Thu Jul 04 00:09:06 2013
@@ -93,6 +93,16 @@
int
main(int argc, char **argv)
{
+ char* command = NULL;
+ int i;
+ for (i = 1; i < argc; i++) {
+ if (!strcmp(argv[i], "-c")) {
+ if (++i < argc) {
+ command = argv[i];
+ }
+ }
+ }
+
set_kernel_phys_offset(0x200000);
remap_pfn_range = get_remap_pfn_range_address();
if (!remap_pfn_range) {
@@ -112,7 +122,11 @@
exit(EXIT_FAILURE);
}
- system("/system/bin/sh");
+ if (command == NULL) {
+ system("/system/bin/sh");
+ } else {
+ execl("/system/bin/sh", "/system/bin/sh", "-c", command, NULL);
+ }
exit(EXIT_SUCCESS);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment