Skip to content

Commit

Permalink
chore: update embedded shellcode
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit committed Dec 10, 2024
1 parent 884780c commit 3ef9cb9
Show file tree
Hide file tree
Showing 5 changed files with 374 additions and 288 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,54 +15,87 @@ private ShellcodeImpl_Arm32() {

@Override
public byte[] getShellcodeBytes() {
//05e0 l O .text 0018 get_hook_info.sHookInfo
//0000 g F .text 0008 NativeBridge_breakpoint
//0008 g F .text 0024 __clear_cache
//002c g F .text 0038 syscall_ext
//0064 g F .text 0040 NativeBridge_nativeSyscall
//00a4 g F .text 0030 NativeBridge_nativeClearCache
//00d4 g F .text 0014 NativeBridge_nativeCallPointerFunction0
//00e8 g F .text 0018 NativeBridge_nativeCallPointerFunction1
//0100 g F .text 001c NativeBridge_nativeCallPointerFunction2
//011c g F .text 0024 NativeBridge_nativeCallPointerFunction3
//0140 g F .text 0028 NativeBridge_nativeCallPointerFunction4
//0168 g F .text 0040 NativeBridge_nativeGetJavaVM
//01a8 g F .text 0010 get_hook_info
//01b8 g F .text 003c lsw_pread64
//01f4 g F .text 0038 lsw_mprotect
//022c g F .text 0104 fake_fstat64
//0330 g F .text 0284 fake_mmap64
//05b4 g F .text 002c fake_mmap
//0000 g DF .text 0008 NativeBridge_breakpoint
//0000 g D .text 0000 ___text_section
//0008 g DF .text 0040 NativeBridge_nativeSyscall
//0048 g DF .text 0038 syscall_ext
//0080 g DF .text 0030 NativeBridge_nativeClearCache
//00b0 g DF .text 0020 __clear_cache
//00d0 g DF .text 0014 NativeBridge_nativeCallPointerFunction0
//00e4 g DF .text 0018 NativeBridge_nativeCallPointerFunction1
//00fc g DF .text 001c NativeBridge_nativeCallPointerFunction2
//0118 g DF .text 0024 NativeBridge_nativeCallPointerFunction3
//013c g DF .text 0028 NativeBridge_nativeCallPointerFunction4
//0164 g DF .text 0040 NativeBridge_nativeGetJavaVM
//01a4 g DF .text 0038 ashmem_dev_get_size_region
//01dc g DF .text 0010 get_hook_info
//01ec g DF .text 0008 get_current_pc
//01f4 g DF .text 00e0 fake_fstat64
//02d4 g DF .text 0480 fake_mmap64
//0858 g DF .text 002c fake_mmap
//0bd0 l O .rodata 0018 _ZZ13get_hook_infoE9sHookInfo
String b64 =
"cAAg4R7/L+GATC3pCLCN4gJwAOMAIKDjD3BA4wAAAO8AAFDjgIy9CP7e/+cwSC3pCLCN4ghQi+ID\n" +
"4KDhAMCg4QEAoOECEKDhOACV6A4goOEEcC3lDHCg4QAAAO8EcJ3kMIi96BBMLekIsI3iENBN4gIA\n" +
"oOEIEJvlECCb5Rgwm+UgwJvlMECb5Sjgm+UAUI3oCECN5eT//+sAEKDjCNBL4hCMveiATC3pCLCN\n" +
"4ggQm+UCcADjAgCg4Q9wQOMCEIHgACCg4wAAAO8AAFDjgIy9CP7e/+cASC3pDbCg4TL/L+EAEKDj\n" +
"AIi96ABILekNsKDhCACb5TL/L+EAEKDjAIi96ABILekNsKDhCACb5RAQm+Uy/y/hABCg4wCIvegA\n" +
"SC3pDbCg4QIwoOEIAJvlEBCb5Rggm+Uz/y/hABCg4wCIvegASC3pDbCg4QLAoOEIAJvlEBCb5Rgg\n" +
"m+UgMJvlPP8v4QAQoOMAiL3oEEwt6QiwjeII0E3iABCQ5QBAoOMEQI3lbCOR5QQQjeIy/y/hBBCd\n" +
"5QAAUOMEEKARAQCg4QAQoOMI0EviEIy96AQAn+UAAI/gHv8v4SwEAAAASC3pDbCg4RDQTeICMKDh\n" +
"ASCg4QAQoOEAAKDjCOCb5QzAm+UBQI3otACg4wjAjeWP///rC9Cg4QCIvegASC3pDbCg4RDQTeIC\n" +
"MKDhASCg4QAQoOEAAKDjAACN5QQAjeUIAI3lfQCg44H//+sL0KDhAIi96PBNLekYsI3iENBN4gFA\n" +
"oOEAUKDhAHCg48UAoOMFEKDhBCCg4QAwoOMAcI3lBHCN5QhwjeVx///rAQpw4xIAAIq0AJ/l0CDE\n" +
"4QAAj+AEAJDlqBCf5QAw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YBMUDjkQMB4AAwYOIDwAPiADCg4Qwg\n" +
"QuAMEKPnA8DC4wwgg+AJAFzjBBAC5R8AADoZAFzjBBCD5QgQg+UMEALlCBAC5RkAADoMEIPlEBCD\n" +
"5RQQg+UYEIPlHBAC5RgQAuUUEALlEBAC5QQgA+IY4ILjDiBM4CAAUuMMAAA6DjCD4CAgQuIAEIPl\n" +
"BBCD5R8AUuMIEIPlDBCD5RAQg+UUEIPlGBCD5RwQg+UgMIPi8///igBIvege/y/hAAAAAAAAAAAA\n" +
"AAAA776v3gAAAAAURREAAAAAAAAQAAAAAAAAGPT/fwEAAAAY9P9/AQAAAFD0/38BAAAAgPT/fwEA\n" +
"AACo9P9/AQAAAMD0/38BAAAAzPT/fwEAAADc9P9/AQAAAPD0/38BAAAADPX/fwEAAAAs9f9/AQAA\n" +
"AGT1/38BAAAAlPX/fwEAAACc9f9/AQAAAJz1/38BAAAAdPb/fwEAAADs+v9/AQAAABz7/38BAAAA\n" +
"bPv/fwEAAACg+/9/AQAAAND7/38BAAAA9Pv/fwEAAAAk/P9/AQAAAFT8/38BAAAAhPz/fwEAAAC4\n" +
"/P9/AQAAAOz8/38BAAAAHP3/fwEAAABM/f9/AQAAAHz9/38BAAAArP3/fwEAAADU/f9/AQAAAND9\n" +
"/38BAAAA1P7/fwEAAAA=\n";
byte[] bytes = android.util.Base64.decode(b64, android.util.Base64.DEFAULT);
int hookInfoOffset = 0x05e0;
int hookInfoOffset = 0x0bd0;
fillInHookInfo(bytes, hookInfoOffset);
return bytes;
}
Expand All @@ -74,57 +107,57 @@ public int getNativeDebugBreakOffset() {

@Override
public int getNativeClearCacheOffset() {
return 0x00a4;
return 0x0080;
}

@Override
public int getNativeSyscallOffset() {
return 0x0064;
return 0x0008;
}

@Override
public int getNativeCallPointerFunction0Offset() {
return 0x00d4;
return 0x00d0;
}

@Override
public int getNativeCallPointerFunction1Offset() {
return 0x00e8;
return 0x00e4;
}

@Override
public int getNativeCallPointerFunction2Offset() {
return 0x0100;
return 0x00fc;
}

@Override
public int getNativeCallPointerFunction3Offset() {
return 0x011c;
return 0x0118;
}

@Override
public int getNativeCallPointerFunction4Offset() {
return 0x0140;
return 0x013c;
}

@Override
public int getNativeGetJavaVmOffset() {
return 0x0168;
return 0x0164;
}

@Override
public int getFakeStat64Offset() {
return 0x022c;
return 0x01f4;
}

@Override
public int getFakeMmap64Offset() {
return 0x0330;
return 0x02d4;
}

@Override
public int getFakeMmapOffset() {
return 0x05b4;
return 0x0858;
}

@Override
Expand Down
Loading

0 comments on commit 3ef9cb9

Please sign in to comment.