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

总把平生入醉乡
边栏推荐
- STM32C8t6 驱动激光雷达实战(二)
- Unity解决动画不可用:The AnimationClip ‘XXX‘ used by the Animation component ‘XXX‘ must be marked as Legacy.
- 网络学习型红外模块,8路发射独立控制
- 手机测试相关基础知识
- Proof of green Tao theorem (1): preparation, notation and Gowers norm
- 大三实习生,字节跳动面经分享,已拿Offer
- ES6特性:Promise(自定义封装)
- 1061 Dating
- 【攻防世界WEB】难度四星12分进阶题:Confusion1
- UnauthorizedAccessException:Access to the path “/xx/xx.xx“ is denied
猜你喜欢

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

BroadCast(广播)

Chapter 2 Regression

1309_ Add GPIO flip on STM32F103 and schedule test with FreeRTOS

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

【创建 Birthday Card 应用】

Typescript Basics

Vite3 learning records

【着色器实现RoundWave圆形波纹效果_Shader效果第六篇】

LeetCode_376_摆动序列
随机推荐
【持续更新】树莓派启动与故障系列集锦
剑指 Offer II 115. 重建序列 : 拓扑排序构造题
Network learning infrared module, 8-way emission independent control
Chapter 2 Regression
1062 Talent and Virtue
Identify some positions in the parenthesis sequence
[wechat applet] do you know about applet development?
Chapter 3 business function development (creating clues)
TCP半连接队列和全连接队列(史上最全)
Qt桌面白板工具其一(解决曲线不平滑的问题——贝塞尔曲线)
Unity解决动画不可用:The AnimationClip ‘XXX‘ used by the Animation component ‘XXX‘ must be marked as Legacy.
[cloud co creation] what magical features have you encountered when writing SQL every day?
OOM机制
Comment présenter votre expérience de projet lors d'une entrevue
OpenCV图像处理——拉普拉斯金字塔
High numbers | calculation of triple integral 2 | high numbers | handwritten notes
Unity solves that animation is not available: the animationclip 'xxx' used by the animation component 'xxx' must be marked as legacy
[continuous update] collection of raspberry pie startup and failure series
比较关注证券公司究竟哪个佣金最低?请问网上开户安全么?
1309_STM32F103上增加GPIO的翻转并用FreeRTOS调度测试