当前位置:网站首页>12、 Process address space (PMAP; vdso; MMAP)
12、 Process address space (PMAP; vdso; MMAP)
2022-06-10 13:07:00 【[T]】
One 、 Process address space
char* p You can talk to intptr_t Interconversion
1、 Can point to any address
2、 Legal address ( Readable or writable )
(1) Code (main, %rip From here, the instructions to be executed ), read-only
(2) data (static,int x), Reading and writing
(3) Stack (int y), Reading and writing
(4) Run time memory allocation , Reading and writing
(5) Dynamic link library
3、 Illegal address
(1)NULL, Lead to segmentation fault
Two 、 View the process address space
pmap(1) report memory of a precess
How to view the address space of a process

1、 The smallest Hello world ( static state / Dynamic links )
(1) Address space of the process : Several consecutive “ paragraph ”
(2)“ paragraph ” Of memory can be accessed
(3) Not in segment / A memory access violation triggers SIGSEGV
gdb You can access... Beyond your authority , But you can't access addresses that don't exist
3、 ... and 、 The operating system provides a mechanism to view the process address space
RTFM:/proc/[pid]/maps (man 5 proc)
1、 Each segment in the process address space
(1) Address ( Range ) And authority (rwxsp)
(2) Corresponding file :offset,dev,inode,pathname
2、 and readelf The information in the verifies each other
Four 、 Address space of the process
Address space of the process = There are several consecutive in memory “ paragraph ”
1、 Each segment is accessible ( read / Write / perform ) Of memory
(1) May map to a file and / Or shared between processes
System call to manage the process address space
// mapping
void *mmap(void* addr, size_t length, int port, int flag, int fd, off_t offset);
// Unmap
void munmap(void,* addr, size_t length);
// Modify mapping permissions
int mprotect(void,* addr, size_t length, int port);2、RTFM: The state increases / Delete / Modify an accessible memory
5、 ... and 、 Address space isolation
Every *ptr Only this process can be accessed ( State machine ) Of memory
1、 Unless mmap According to specified 、 Map shared file or shared memory multithreading
2、 It realizes the most important functions of the operating system : Isolation between processes
6、 ... and 、 Modifier
1、 Modifier
(1) adopt open ”/proc/pid/mem“
Facilitate a value in memory , According to the modified value , You can lock the address space ; By modifying the value of the address , Implement modification .
Such as : The modifier locks the address by value , Realize the game gold coin value modification
2、 Variable speed gear
(1)“ cheating ” Process clock
The source of the : alarm clock 、 sleep 、gettimeofday
Intercepting them requires sophisticated technology
Call at time ( system call ) It's about , Add a jump instruction , Jump to custom time handler , Time tooth transformation can be realized
3、 Game security
control / Data flow integrity
(1) Protect the integrity of the process
Independent process / The driver performs integrity verification
(2) Protect private data from being read or written by other processes
Block the ReadProcessMemory and WriteProcessMemory, Refuse to execute immediately after discovery
边栏推荐
- TIDB 初級課程體驗 8 (集群的管理維護, 添加一個TIKV節點)
- Asynchronous export of Excel
- 今天,一对情侣拿下香港最大电商IPO
- Give root password for maintenace (or press Control-D to continue): solution
- 'getWidth()' is deprecated,'getHeight()' is deprecated
- Program, calculate 2/1+3/2+5/3+8/5 Value of. It is required to calculate the sum of the first n items and keep 2 decimal places (starting from the second item of the sequence, the numerator of each it
- 'getcolor (int) 'is deprecated, getcolor is obsolete
- 一些编码Tips
- Stereo vision based semantic 3D object and ego motion tracking for automotive driving
- JS global timer case
猜你喜欢

Wei Lai: "pinches" the data and "pinches" the future

The ability to register user names and passwords with the database

change system time

统计100以内的各位数之和为7的自然数的个数及平均值

【移动机器人】轮式里程计原理

Recommended learning materials for Altium Designer

Stereo vision based semantic 3D object and ego motion tracking for automotive driving

Start with interpreting the code automatically generated by BDC, and explain the program components of sapgui

Leetcode 96. Différents arbres de recherche binaires
![[spark] (task8) pipeline channel establishment in sparkml](/img/9c/69c6d0cb27906eb895cfc7e4f45f96.png)
[spark] (task8) pipeline channel establishment in sparkml
随机推荐
启牛能开户吗,在启牛开户安全么
Can qiniu open an account? Is it safe to open an account in qiniu
Vdo-slam source code reading notes [2] local optimization and global optimization
Tidb elementary course experience 8 (cluster management and maintenance, adding a tikv node)
從解讀 BDC 自動生成的代碼談起,講解 SAPGUI 的程序組成部分
list. Remove (index) returns false, removal failed
Leetcode 96. 不同的二叉搜索樹
出海企业遇瓶颈 茄子科技(SHAREit Group)有话说
蔚来:“拿捏”了数据,“扭捏”着未来
MySQL master database operation large table DDL, slave database crash and system parameter error setting
Performance test plan (plan) template
Comparison of two BigDecimal data types, addition, subtraction, multiplication and division, and formatting
Tidb Primary course experience 8 (Management Maintenance of Clusters, add a tikv Node)
用GNN做CV三大任务的新骨干,同计算成本性能不输CNN、ViT与MLP|中科院&华为诺亚开源...
WTO MC12 restart agenda focuses on global economic recovery
拷贝和删除文件
Altium Allegro PADS到底该选哪个EDA设计软件
深度神经网络每秒分类近20亿张图像,新型类脑光学分类器芯片登上Nature
统计100以内的各位数之和为7的自然数的个数及平均值
Colmap source code reading notes [1] threading cc