万事笔通
嗯 就是不清楚具体情况 对脚本写法也是 依葫芦画瓢
附加没用、启动瞬间就调用了。等附加上。晚800年了。
只能孵化启动
启动命令
frida -U -l 新建文本文档.txt -f com.sumavision.sanping.gudou --no-pause
附上一部分输出结果
------------------------------------------------------------------------------
Spawned `com.sumavision.sanping.gudou`. Resuming main thread!
[Redmi 4X::com.sumavision.sanping.gudou]-> start-------------->
a is called
a ret value is Y29tLnN1bWF2aXNpb24uc2FucGluZy5ndWRvdQ
b is called
_decrypt_key- after --->
0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
ffde9c5c 08 90 65 f5 a0 92 f9 f3 ab 4c 63 f5 00 00 59 00 ..e......Lc...Y.
ffde9c6c 00 44 f8 f3 a0 92 f9 f3 30 92 f9 f3 00 44 f8 f3 .D......0....D..
ffde9c7c 87 15 4d 47 c0 9c de ff b4 9c de ff 00 00 00 00 ..MG............
ffde9c8c a8 9c de ff 08 90 65 f5 00 00 59 00 00 00 43 00 ......e...Y...C.
_decrypt_key- after --->Sr9!8MI!N!2G5MVoP�˛Pr���:�vx�s�ָ��t;q��""�?�ʡh�
�0u�ᧇMG@���
_decrypt_key- resutl --->0
b ret value is Sr9!8MI!N!2G5MVo
aes decrypt arg1 = [59,18,-85,-85,-55,-119,-70,3,69,-126,-91,9,127,-34,63,100],
arg2 =Sr9!8MI!N!2G5MVo,res=>pVW4U*FlS
var aesResult = 'pVW4U*FlS';
sha1('sumasalt-app-portal' + aesResult +'16498488196762281430freeuser').substr(0
,10)
/*hmac = 'f4cc8ce40a'*/
GetHmac arg =freeuser,ret = f4cc8ce40a,1649848819,6762281430
------------------------------------------------------------------------------
hmac 计算方法
function bytesToString(arr) {
var str = '';
arr = new Uint8Array(arr);
for (var i in arr) {
str += String.fromCharCode(arr[i]);
}
return str;
}
setImmediate(function () {
Java.perform(function () {
let a = Java.use("h.x.a.h.e.a");
a.a.overload('[B', '[B').implementation = function (bArr, bArr2) {
let ret = this.a(bArr, bArr2);
console.log('aes decrypt arg1 = [' + bArr + '], arg2 =' + bytesToString(bArr2) + ',res=>' + bytesToString(ret));
console.log('\r\nvar aesResult = \''+bytesToString(ret)+'\';');
return ret;
};
let d = Java.use("h.x.a.h.e.d");
d.a.overload('java.lang.String').implementation = function (str) {
let ret = this.a(str);
console.log('sha1(\'sumasalt-app-portal\' + aesResult +\'' +ret[1]+ret[2]+str+'\').substr(0,10)' );
console.log('/*hmac = \''+ ret[0] +'\'*/\r\n' );
console.log('GetHmac arg =' + str + ',ret = ' + ret);
return ret;
};
let a1 = Java.use("h.y.e.n.a");
a1.b.implementation = function () {
console.log('b is called');
var soAddr = Module.findBaseAddress("libhello-jni.so");
var old_method = new NativeFunction(soAddr.add(0x8a0c), 'int', ['int']);
Interceptor.replace(soAddr.add(0x8a0c), new NativeCallback(function (a) {
console.log('_decrypt_key- after --->\n' + hexdump(new NativePointer(a) /*.readPointer()*/ , {
offset: 0,
length: 64,
header: true,
ansi: true
}));
var result = old_method(a);
console.log("_decrypt_key- after --->" + new NativePointer(a).readCString());
console.log("_decrypt_key- resutl --->" + result);
return result;
}, 'int', ['int']));
let ret = this.b();
console.log('b ret value is ' + ret);
return ret;
};
a1.a.implementation = function () {
console.log('a is called');
let ret = this.a();
console.log('a ret value is ' + ret);
return ret;
};
console.log('start-------------->');
});
});