当前位置:网站首页>寻找消失的类名
寻找消失的类名
2022-07-23 21:12:00 【奋飞安全】
一、目标
前几天有个朋友问了我一个新手问题,frida提示: 找不到 p009cn.com.chinatelecom.gateway.lib.C1402a 这个类

原因是,jadx反编译的时候,为了反混淆,会把类名做个处理,加上几个数字,这样好让你分辨,不会满眼都是变量a。
实际上他已经提示你了,这个类的真实类名是 cn.com.chinatelecom.gateway.lib.a
本以为事情就这么过去了,谁知道没过两天,在一个夜黑风高的的晚上,我也遇到了这个问题。
二、步骤
类名是奇怪字符
老江湖也遇到新问题了,这个类名是什么鬼?

1:step1
现在的App太不讲武德了,混淆我也就忍了,搞出个鬼画符,是什么操作?
这个符可不好打出来,常规操作是直接把类名复制到js里面,结果不好使,frida依然抱怨 找不到这个类。
查了一下js文档,有个 encodeURIComponent() 函数,可以把这种鬼画符通过 UTF-8 编码的转义 然后打印出来。
但是这个类名的转义字符是啥呢?
遍历之
我们可以找个取巧的方式,把这个包下的类都遍历出来,这样不就可以知道这个类名的UTF-8 编码的转义了吗?
Java.enumerateLoadedClasses({
onMatch: function(className) {
if(className.indexOf('com.google.android.material.tooltip') >=0 ){
console.log(className.toString());
console.log(encodeURIComponent(className.toString()));
}
},
onComplete:function(){
}
});
跑一下,符显形了。

1:show1
Hook之
拿到了转义编码之后如何hook呢? 这时候就需要 decodeURIComponent函数了
var hookCls = Java.use(decodeURIComponent('com.google.android.material.tooltip.%DB%A4%DB%A4%DB%9F%DB%A6'));
这次frida就不抱怨找不到类名了。
成员函数名
找到了类名当然不是我们的目的,我们的目的是星辰大海,哦不,是hook成员函数呀。

1:step2
不出所料,它的方法名,依然是鬼画符。
这时候我们就需要去遍历方法名了
var hookCls = Java.use(decodeURIComponent('com.google.android.material.tooltip.%DB%A4%DB%A4%DB%9F%DB%A6'));
var methods = hookCls.class.getDeclaredMethods();
for (var i in methods) {
console.log(methods[i].toString());
console.log(encodeURIComponent(methods[i].toString().replace(/^.*?.([^\s.()]+)(.*?$/, "$1")));
}
结果倒是没问题,就是分辨起来还有点麻烦。只能从成员函数的入参和返回值来分辨我们想要hook的成员函数

1:show2
Hook这个成员函数的代码如下
hookCls[decodeURIComponent("%DB%9F%DB%A3%DB%A5%DB%9F%DB%A3")]
.implementation = function () {
console.log("m1344 =============== ");
return "xxx";
}
搞定,收工~
三、总结
为了抵抗分析,App能想的办法都想了。只能比谁藏的更深,找的更快了。

总把平生入醉乡
边栏推荐
- 《迷失》stray工人帽子获得方法 工人安全帽在哪里?
- 221. Largest square ● &1277. Square submatrix with statistics all 1 ● ●
- "Pulse" to the future! Huawei cloud Mrs helps smooth migration to the cloud
- High numbers | calculation of triple integral 1 | high numbers | handwritten notes
- If the order is not paid within 30 minutes, it will be automatically cancelled
- 【Scratch画图100例】图46-scratch绘制花朵 少儿编程 scratch编程画图案例教程 考级比赛画图集训案例
- Vrrp+mstp configuration details [Huawei ENSP experiment]
- 模块化开发
- Microservice architecture vs single service architecture [what can Huawei cloud service do in the microservice mode]
- 视觉slam学习|基础篇01
猜你喜欢

If the order is not paid within 30 minutes, it will be automatically cancelled

【isprint函数判断字符是否可输出】

TypeScript基础

手机测试相关基础知识

Tropomi (sentinel 5p) data introduction and download method

221. Largest square ● &1277. Square submatrix with statistics all 1 ● ●

Stm32c8t6 driven lidar (I)

网络学习型红外模块,8路发射独立控制

05_ue4进阶_材质UV缩放

Edge cloud | 1. overview
随机推荐
221. Largest square ● &1277. Square submatrix with statistics all 1 ● ●
Day 12: continued day 11 (BGP related knowledge)
Green Tao theorem (3): anti uniform functions and their generated sigma Algebras
Connect with Hunan Ca and use U_ Key login
High numbers | calculation of double integral 4 | high numbers | handwritten notes
[wechat applet] do you know about applet development?
Microservice architecture vs single service architecture [what can Huawei cloud service do in the microservice mode]
Comment présenter votre expérience de projet lors d'une entrevue
KubeVela离线安装
OpenCV图像处理——拉普拉斯金字塔
Minimum spanning tree: prim
第3章业务功能开发(创建线索)
2022.7.11 MySQL job
HDU - 2586 How far away ? (multiply LCA)
模块化开发
How to get the worker's hat? Where is the worker's helmet?
Protocol buffers 的问题和滥用
如何在面试中介绍自己的项目经验
TypeScript基础
最小生成树:Prim