


1.写⼀段汇编代码,获取进程 ID
2.写⼀段汇编代码,获取线程 ID
3.写⼀段汇编代码,获取 PEB 地址
#include
#include
#include
using namespace std;
int main()
{
int pid, tid, ebpAddr;
__asm
{
mov eax, fs : [0x20]
mov ebx, fs : [0x24]
mov ecx, fs : [0x30]
mov pid, eax
mov tid, ebx
mov ebpAddr, ecx
}
cout << "pic is " << pid << endl;
cout << "tid is " << tid << endl;
cout << "ebp address is " << ebpAddr << endl;
_PEB* ptr = reinterpret_cast(ebpAddr);
cout << "debugged is " <BeingDebugged << endl;
system("pause");
}
















![[分享]为什么调试游戏的时候不能搜索感兴趣的变量的地址-学技术网](https://picabstract-preview-ftn.weiyun.com/ftn_pic_abs_v3/c60cfd32245a39314712e7a5cfa2573b92c7a3a6193be1a2fb5866a1e805f0392b5208f997eeef189881ff2a56f39fb4?pictype=scale&from=30013&version=3.3.3.3&fname=Snipaste_2025-01-04_09-37-57.jpg&size=750)
![[分享]为什么调试游戏的时候不能搜索感兴趣的变量的地址-学技术网](https://picabstract-preview-ftn.weiyun.com/ftn_pic_abs_v3/b5362f00abc68ee539928f18cf308c657812df346123a84cc7634c4b1b9cebc6b188973ef5e5a5c648bcb891de2c214a?pictype=scale&from=30013&version=3.3.3.3&fname=Snipaste_2025-01-04_09-38-09.jpg&size=750)














