当前位置:网站首页>寻找消失的类名
寻找消失的类名
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能想的办法都想了。只能比谁藏的更深,找的更快了。

总把平生入醉乡
边栏推荐
- Green-Tao 定理 (3): 反一致函数及其生成的 Sigma-代数
- [Yunxiang book club No. 13] Chapter IV packaging format and coding format of audio files
- Minimum spanning tree: prim
- 【isprint函数判断字符是否可输出】
- [continuous update] collection of raspberry pie startup and failure series
- Failed to introspect class feignclientfactorybean exception troubleshooting
- WinDbg实践--入门篇
- [attack and defense world web] difficulty four-star 12 point advanced question: flatscience
- Ssm+mysql to realize snack mall system (e-commerce shopping)
- Protocol buffers 的问题和滥用
猜你喜欢

Protocol buffers 的问题和滥用

TCP half connection queue and full connection queue (the most complete in History)

手机测试相关基础知识
Now I don't know how to synchronize at all
![[attack and defense world web] difficulty four-star 12 point advanced question: confusion1](/img/ee/3ce5cc3004f9113bbf70e0c52ff4d9.png)
[attack and defense world web] difficulty four-star 12 point advanced question: confusion1

2022-7-23 12点 程序爱生活 小时线顶背离出现,保持下跌趋势,等待反弹信号出现。

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

Car rental vehicle management system based on jsp+ssm+mysql car rental

【Scratch画图100例】图46-scratch绘制花朵 少儿编程 scratch编程画图案例教程 考级比赛画图集训案例

Ssm+mysql to realize snack mall system (e-commerce shopping)
随机推荐
prime_series_level-1
Green-Tao 定理的证明 (1): 准备, 记号和 Gowers 范数
(note) learning rate setting of optimizer Adam
LU_ Asr01 voice module usage
【复数 重载运算符】
Unity solves that animation is not available: the animationclip 'xxx' used by the animation component 'xxx' must be marked as legacy
对接湖南CA使用U_KEY登录
[attack and defense world web] difficulty four-star 12 point advanced question: confusion1
Major optimization of openim - Message loading on demand, consistent cache, uniapp Publishing
第3章业务功能开发(创建线索)
Opencv image processing Laplace pyramid
OpenCV图像处理——拉普拉斯金字塔
Jetson nano烧录踩坑记(一定可以解决你的问题)
【创建 Birthday Card 应用】
Vrrp+mstp configuration details [Huawei ENSP experiment]
scala编程(中级进阶实验应用)
1063 Set Similarity
Major upgrade of openim - group chat reading diffusion model release group management function upgrade
One of QT desktop whiteboard tools (to solve the problem of unsmooth curve -- Bezier curve)
High numbers | calculation of triple integral 1 | high numbers | handwritten notes