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

总把平生入醉乡
边栏推荐
- 2022.7.11 MySQL job
- 1062 Talent and Virtue
- (Note)优化器Adam的学习率设置
- 1062 Talent and Virtue
- Failed to introspect Class FeignClientFactoryBean 异常排查
- Now I don't know how to synchronize at all
- [shader realizes roundwave circular ripple effect _shader effect Chapter 6]
- One of QT desktop whiteboard tools (to solve the problem of unsmooth curve -- Bezier curve)
- flink原理及开发总结(详细)
- [kernel] platform bus model for driving development and learning
猜你喜欢
![[kernel] platform bus model for driving development and learning](/img/69/f600e4e6173491955ab90e92577450.png)
[kernel] platform bus model for driving development and learning

High numbers | calculation of triple integral 2 | high numbers | handwritten notes

Stm32c8t6 driving lidar actual combat (II)

2022.7.11 MySQL job

【持续更新】树莓派启动与故障系列集锦

TCP半连接队列和全连接队列(史上最全)

Day 12: continued day 11 (BGP related knowledge)

BroadCast(广播)

The common interfaces of Alipay are uniformly encapsulated and can be used directly for payment parameters (applicable to H5, PC, APP)

Leetcode hot topic hot52-100
随机推荐
Scala programming (elementary)
Detailed explanation of MSTP protocol for layer 3 switch configuration [Huawei ENSP experiment]
【持续更新】树莓派启动与故障系列集锦
做一个有职业操守的软件匠人
高数下|三重积分的计算1|高数叔|手写笔记
高数下|二重积分的计算3|高数叔|手写笔记
比较关注证券公司究竟哪个佣金最低?请问网上开户安全么?
【Scratch画图100例】图46-scratch绘制花朵 少儿编程 scratch编程画图案例教程 考级比赛画图集训案例
Jetson nano烧录踩坑记(一定可以解决你的问题)
ssm+mysql实现零食商城系统(电商购物)
Read the five flow indicators of R & D efficiency insight
Minimum spanning tree: Kruskal
STM32C8t6 驱动激光雷达实战(二)
一道golang中关于for range常见坑的面试题
【复数 重载运算符】
Understanding of signals
Vrrp+mstp configuration details [Huawei ENSP experiment]
(Note)优化器Adam的学习率设置
Typescript Basics
How to get the worker's hat? Where is the worker's helmet?