当前位置:网站首页>[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 ;
边栏推荐
- 4G wireless all network solar hydrological equipment power monitoring system bms110
- Detectron:训练自己的数据集——将自己的数据格式转换成COCO格式
- C language exercises (recursion)
- 27-31. Dependency transitivity, principle
- C语言练习题(递归)
- Nexus 6p downgraded from 8.0 to 6.0+root
- Recommended system 1 --- framework
- Invalid revision: 3.18.1-g262b901-dirty
- How to avoid JVM memory leakage?
- Notes and notes
猜你喜欢

HMS v1.0 appointment. PHP editid parameter SQL injection vulnerability (cve-2022-25491)

雲原生——上雲必讀之SSH篇(常用於遠程登錄雲服務器)

Practical gadget instructions

27-31. Dependency transitivity, principle

配置交叉编译工具链和环境变量

MySQL installation and configuration

A little understanding of GSLB (global server load balance) technology

The solution of win11 taskbar right click without Task Manager - add win11 taskbar right click function

Webrtc quickly set up video call and video conference

The end of the Internet is rural revitalization
随机推荐
[microservice] Nacos cluster building and loading file configuration
Tf/pytorch/cafe-cv/nlp/ audio - practical demonstration of full ecosystem CPU deployment - Intel openvino tool suite course summary (Part 2)
2022.7.3-----leetcode.556
Invalid bound statement (not found): com. example. mapper. TblUserRecordMapper. login
Grounding relay dd-1/60
Leakage detection relay jy82-2p
Weekly summary (*63): about positive energy
[openvino+paddle] paddle detection / OCR / SEG export based on paddle2onnx
746. Climb stairs with minimum cost
2022.7.2-----leetcode.871
gslb(global server load balance)技术的一点理解
Configure cross compilation tool chain and environment variables
[March 3, 2019] MAC starts redis
Vant --- detailed explanation and use of list component in vant
27-31. Dependency transitivity, principle
Impact relay jc-7/11/dc110v
雲原生——上雲必讀之SSH篇(常用於遠程登錄雲服務器)
剑指 Offer II 038. 每日温度
webrtc 快速搭建 视频通话 视频会议
Overview of convolutional neural network structure optimization