当前位置:网站首页>[Android reverse] function interception (CPU cache mechanism | CPU cache mechanism causes function interception failure)
[Android reverse] function interception (CPU cache mechanism | CPU cache mechanism causes function interception failure)
2022-07-04 06:21:00 【Programmer community】
List of articles
- One 、CPU Cache mechanism
- Two 、CPU Cache mechanism Lead to Function interception failed
One 、CPU Cache mechanism
CPU In the architecture model , Instructions At the beginning , Store in memory , Such as : /proc/pid/maps Each of the .so Dynamic libraries have an address in memory , Instructions are stored in the dynamic library ;
CPU And The access rate between memories is relatively low , The low here is with CPU Access register comparison , CPU The speed at which registers are accessed > CPU Speed of accessing memory > CPU The speed at which the disk is accessed ;
In order to improve CPU visit Memory The speed of , stay CPU A piece is prepared inside Cache , Instructions in memory are not put directly into CPU , Instead, put it in the cache first , Then read from the cache to the register for instruction operation ;
If CPU The instruction to be accessed is just in the cache , Then you can execute at high speed Code instructions , At the same time of execution , The subsequent instructions are continuously loaded into the cache , So that's a guarantee CPU Efficient execution of instructions ;
Two 、CPU Cache mechanism Lead to Function interception failed
In the last blog 【Android reverse 】 Function interception principle ( By modifying the GOT Global offset table interception function | Function interception is realized by adding jump code to the actually called function ) Reliable function interception scheme in , Recommended " Add jump code to the actually called function to realize function interception " The scheme implements function interception ;
The above scheme needs to be implemented in The function actually called in , Write a jump instruction , The function of the write instruction is stored in memory , It can only be written in memory , CPU The cache of is entirely composed of CPU Internal hardware call , External code cannot access the cache ;
Here is a question , stay Insert jump code into the intercepted function , If the function has been loaded into CPU In the cache of , that Modify memory , Can't make CPU Execute the modified code instruction ;
CPU Medium The cache is Sort by command rate , The more frequently used functions , The higher the priority , The less likely it is to be removed ;
If the function to be intercepted , Call frequency is very high , Maybe the modified function will always reside in CPU In cache , Just The function has been unable to be intercepted ;
And that leads to this Function interception , unable 100% success ;
边栏推荐
- Webrtc quickly set up video call and video conference
- High performance parallel programming and optimization | lesson 02 homework at home
- STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
- SQL injection SQL lab 11~22
- 746. Climb stairs with minimum cost
- STM32 单片机ADC 电压计算
- 云原生——上云必读之SSH篇(常用于远程登录云服务器)
- Functions in C language (detailed explanation)
- [March 3, 2019] MAC starts redis
- AWT common components, FileDialog file selection box
猜你喜欢
MySQL learning notes 3 - JDBC
C实现贪吃蛇小游戏
JS execution mechanism
Learning multi-level structural information for small organ segmentation
每周小结(*63):关于正能量
Webrtc quickly set up video call and video conference
The end of the Internet is rural revitalization
How to expand all collapse panels
How to realize multi account login of video platform members
测试岗的中年危机该如何选择?是坚守还是另寻出路?且看下文
随机推荐
2022.7.2-----leetcode.871
雲原生——上雲必讀之SSH篇(常用於遠程登錄雲服務器)
C實現貪吃蛇小遊戲
Yiwen unlocks Huawei's new cloud skills - the whole process of aiot development [device access - ESP end-to-side data collection [mqtt]- real time data analysis] (step-by-step screenshot is more detai
C realize Snake games
Internet of things protocol ZigBee ZigBee module uses the concept of protocol stack
【无标题】
SQL join, left join, right join usage
QT qtablewidget table column top requirements ideas and codes
JSON web token -- comparison between JWT and traditional session login authentication
JSON Web Token----JWT和傳統session登錄認證對比
C语言练习题(递归)
复合非线性反馈控制(二)
R统计绘图-随机森林分类分析及物种丰度差异检验组合图
Design and implementation of redis 7.0 multi part AOF
Experience weekly report no. 102 (July 4, 2022)
198. House raiding
Which water in the environment needs water quality monitoring
Invalid bound statement (not found): com. example. mapper. TblUserRecordMapper. login
FRP intranet penetration, reverse proxy