当前位置:网站首页>[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 ;
边栏推荐
- centos8安装mysql.7 无法开机启动
- Since DMS is upgraded to a new version, my previous SQL is in the old version of DMS. In this case, how can I retrieve my previous SQL?
- Selection (022) - what is the output of the following code?
- Design of test cases
- 响应式——媒体查询
- 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 tutorial case 7] design and implementation of counter based on Verilog
- Responsive mobile web test questions
- Google Chrome Portable Google Chrome browser portable version official website download method
- tars源码分析之1
猜你喜欢
关于IDEA如何设置快捷键集
Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
Responsive mobile web test questions
Bottom problem of figure
Su Weijie, a member of Qingyuan Association and an assistant professor at the University of Pennsylvania, won the first Siam Youth Award for data science, focusing on privacy data protection, etc
The most effective futures trend strategy: futures reverse merchandising
com. alibaba. nacos. api. exception. NacosException
Chain ide -- the infrastructure of the metauniverse
MySQL 45 lecture learning notes (VII) line lock
用于压缩视频感知增强的多目标网络自适应时空融合
随机推荐
Tar source code analysis 6
win10微软拼音输入法输入文字时候下方不出现中文提示
Tar source code analysis 4
Pangu open source: multi support and promotion, the wave of chip industry
tars源码分析之2
电子协会 C语言 1级 35 、银行利息
Latex中的单引号,双引号如何输入?
Mysql 45讲学习笔记(十二)MySQL会“抖”一下
【FPGA教程案例7】基于verilog的计数器设计与实现
"Sword finger offer" 2nd Edition - force button brush question
Node connection MySQL access denied for user 'root' @ 'localhost' (using password: yes
Shopping malls, storerooms, flat display, user-defined maps can also be played like this!
抽奖系统测试报告
MySQL 45 learning notes (XI) how to index string fields
Splicing plain text into JSON strings - easy language method
[FPGA tutorial case 7] design and implementation of counter based on Verilog
【GF(q)+LDPC】基于二值图GF(q)域的规则LDPC编译码设计与matlab仿真
2022年,或许是未来10年经济最好的一年,2022年你毕业了吗?毕业后是怎么计划的?
JS common time processing functions
NLP-文献阅读总结