当前位置:网站首页>[Android reverse] function interception (use cache_flush system function to refresh CPU cache | refresh CPU cache disadvantages | recommended time for function interception)
[Android reverse] function interception (use cache_flush system function to refresh CPU cache | refresh CPU cache disadvantages | recommended time for function interception)
2022-07-04 07:09:00 【Programmer community】
List of articles
- One 、 Use cache_flush System function refresh CPU Cache
- Two 、 Use cache_flush System function refresh CPU The disadvantages of cache
- 3、 ... and 、 Function intercept recommended timing
One 、 Use cache_flush System function refresh CPU Cache
Use " Add jump code to the actually called function to realize function interception " programme Function interception , Due to the existence CPU Cache mechanism , No guarantee 100% success ;
Here you need to refresh CPU The cache of , call cache_flush
System function , Will be CPU All data related to the process in the cache are cleared , Then reload the cache information from memory , At this point, you can put After modification Added jump function Intercepted function , Reload into memory , here CPU You can execute The modified Intercepted function ; Interception effective ;
Two 、 Use cache_flush System function refresh CPU The disadvantages of cache
Use cache_flush System function refresh CPU The disadvantages of cache :
① Performance loss : CPU Rebuild cache , Resulting in reduced execution efficiency , Could cause Caton , Flashback, etc ;
② Affect other processes : Multicore CPU If you refresh Cache , May cause other processes Cache Also refreshed , Affect the execution of other processes ;
③ Affect multithreaded code logic : Multiple threads compete CPU Executive authority , It's empty CPU In cache ,
Multithreaded execution logic Reference resources 【Java Concurrent programming 】 Thread Introduction ( Concurrency type | Thread state | CPU Data caching ) Blog , Java Threads Runtime , Every Java Threads are equipped with a The working memory , Then the working memory starts from Main memory Get data in , Main memory is shared by all working memory ;
- The working memory Namely Thread Local memory , Which is stored in the main memory Copies of variables , Before using variables in main memory , First copy the variable to the working memory ;
- When in a thread Modified the data in working memory , At the same time Synchronize the changes of variables to main memory ;
there The worker thread / Local thread amount to CPU Medium L1 / L2 cache , Main memory amount to CPU Medium L3 cache ;
If the cache is cleared , There must be problems with multithreading execution ;
3、 ... and 、 Function intercept recommended timing
Whereas Function interception need Empty CPU Cache There are the above disadvantages , Therefore, it is suggested that Function interception during program initialization , Do not do this while the program is running Function interception ;
If you have to intercept after the program starts , Can only risk Empty CPU Cache , However, it is recommended to intercept all functions at one time , Don't do it frequently Function interception + Empty CPU Cache operation , The more times , The more likely it is to go wrong ;
边栏推荐
- Master-slave replication principle of MySQL database
- 2022年,或許是未來10年經濟最好的一年,2022年你畢業了嗎?畢業後是怎麼計劃的?
- 【网络数据传输】基于FPGA的百兆网/兆网千UDP数据包收发系统开发,PC到FPGA
- 【GF(q)+LDPC】基于二值图GF(q)域的规则LDPC编译码设计与matlab仿真
- What is industrial computer encryption and how to do it
- 关于IDEA如何设置快捷键集
- A new understanding of how to encrypt industrial computers: host reinforcement application
- Industrial computer anti-virus
- leetcode825. Age appropriate friends
- Electronic Association C language level 1 35, bank interest
猜你喜欢
Shopping malls, storerooms, flat display, user-defined maps can also be played like this!
Selenium ide plug-in download, installation and use tutorial
About how idea sets up shortcut key sets
What is the use of cloud redis? How to use cloud redis?
leetcode825. 适龄的朋友
[network data transmission] FPGA based development of 100M / Gigabit UDP packet sending and receiving system, PC to FPGA
关于IDEA如何设置快捷键集
【GF(q)+LDPC】基于二值图GF(q)域的规则LDPC编译码设计与matlab仿真
uniapp小程序分包
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
随机推荐
Tar source code analysis Part 7
BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
电子协会 C语言 1级 34 、分段函数
【森城市】GIS数据漫谈(一)
The crackdown on Huawei prompted made in China to join forces to fight back, and another enterprise announced to invest 100 billion in R & D
【网络数据传输】基于FPGA的百兆网/兆网千UDP数据包收发系统开发,PC到FPGA
Node connection MySQL access denied for user 'root' @ 'localhost' (using password: yes
Introduction to spark core components
[network data transmission] FPGA based development of 100M / Gigabit UDP packet sending and receiving system, PC to FPGA
Set JTAG fuc invalid to normal IO port
移动适配:vw/vh
Deep profile data leakage prevention scheme
[GF (q) + LDPC] regular LDPC coding and decoding design and MATLAB simulation based on the GF (q) field of binary graph
Lottery system test report
Boast about Devops
MySQL 45 lecture learning notes (12) MySQL will "shake" for a while
大厂技术专家:架构设计中常用的思维模型
2022年,或许是未来10年经济最好的一年,2022年你毕业了吗?毕业后是怎么计划的?
校园网络问题
Crawler (III) crawling house prices in Tianjin