52pojie春节2026_安卓中级复现

分析


lib下查看

1
2
3
4
5
6
7
8
9
// 这里补充 JNI_Onload 函数中动态注册 Native 方法的具体实现细节
// 在 JNI 中,动态注册使用的是 JNINativeMethod 结构体
typedef struct {
const char* name; // Java 方法名 (字符串)
const char* signature; // JNI 签名 (字符串)
void* fnPtr; // C/C++ 函数指针
} JNINativeMethod;
// 在 64 位架构(如 ARM64 或 x86_64)下,每个指针占 8 字节
// DCQ 表示 Define Constant Quad-word,即 8 字节

这里的签名表示函数传参的变量类型


初始化后长度和头部校验,sub_25EF8检测环境


之后是原先的debugbypass校验,hook为0即可,莫名想到课上的三角校验,瑟瑟发抖

接下来就是正常的处理加解密验证等内容

接着就是检测绕过了,处理检测函数,hoge值以及memcpy结果hook,检测函数参考下图,参考链接写的更详细

检测函数基址名字上就已经有了,memcpy这里得强调下,是修改此处调用的寄存器返回值

寄存器关系:
在 ARM64 架构中,W0 是 X0 寄存器的低 32 位。
它们指向同一个物理存储位置。修改 W0 会自动更新 X0 的低 32 位(高 >32 位会被清零);修改 X0 也会改变 W0 的值。

hook脚本

frida -U -f com.zj.wuaipojie2026_2 -l 1.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
const TARGET_LIB = "libhajimi.so";
const ANTI_DEBUG_OFFSET = 0x25ef8;
const MEMCMP_CHECK_OFFSET = 0x25b24;

function performNativeHooks() {
const baseAddr = Module.getBaseAddress(TARGET_LIB);
if (!baseAddr) {
console.error(`[!] Error: ${TARGET_LIB} base address is null inside hook function!`);
return;
}

console.log(`[+] ${TARGET_LIB} found at: ${baseAddr}`);

// 1. Hook 反调试函数
const antiDebugPtr = baseAddr.add(ANTI_DEBUG_OFFSET);
console.log(`[*] Replacing anti-debug at: ${antiDebugPtr}`);
Interceptor.replace(antiDebugPtr, new NativeCallback(function (a) {
return ptr(0);
}, 'pointer', ['pointer']));
console.log(`[+] Anti-debug bypass installed.`);

// 2. Hook Memcmp 校验
const memcmpCheckPtr = baseAddr.add(MEMCMP_CHECK_OFFSET);
const hookAddr = memcmpCheckPtr.add(4); // 移动到下一条指令

console.log(`[*] Attaching to memcmp check at: ${hookAddr}`);
Interceptor.attach(hookAddr, {
onEnter: function (args) {
// 打印原始值以便调试
// console.log(`[.] Memcmp original ret (w0): ${this.context.w0}`);

// 强制返回 0 (相等)
this.context.w0 = 0;
this.context.x0 = ptr(0);
}
});
console.log(`[+] Memcmp bypass installed.`);
}

// 监听 SO 加载
const dlopenFunc = Module.findExportByName(null, "android_dlopen_ext");
if (dlopenFunc) {
Interceptor.attach(dlopenFunc, {
onEnter: function (args) {
this.libName = args[0].readCString();
},
onLeave: function (retval) {
if (this.libName && this.libName.indexOf(TARGET_LIB) !== -1) {
console.log(`[!] Detected load of ${TARGET_LIB}, triggering hooks...`);
performNativeHooks();
}
}
});
console.log(`[*] Waiting for ${TARGET_LIB}...`);

// 预防:如果注入时库已经加载了
if (Module.findBaseAddress(TARGET_LIB)) {
console.log(`[*] ${TARGET_LIB} already loaded, running hooks immediately...`);
performNativeHooks();
}
} else {
console.error("[-] android_dlopen_ext not found!");
}

// Java 层设置
Java.perform(function () {
console.log("[+] Java VM attached.");
try {
const NativeBridge = Java.use("com.zj.wuaipojie2026_2.NativeBridge");
NativeBridge.INSTANCE.value.setDebugBypass(true);
console.log("[+] Java setDebugBypass(true) called.");
} catch (e) {
console.error(`[-] Java hook failed: ${e.message}`);
}
});

参考链接

https://www.52pojie.cn/thread-2094302-1-1.html


52pojie春节2026_安卓中级复现
https://alenirving.github.io/2026/03/06/52pojie春节2026_安卓中级复现/
作者
Ma5k
许可协议
CC-BY-NC-SA