本人小白,刚学会简单的编程,望大神给点指点下
本帖最后由 qianyuguilai 于 2021-3-15 21:58 编辑//帝国时代2高清版
//帝国时代2高清版 HWND jubing = FindWindow(NULL, L"Age of Empires II: HD Edition");
DWORD pid;
GetWindowThreadProcessId(jubing, &pid);
HANDLE hpro = 0;
hpro = OpenProcess(PROCESS_ALL_ACCESS, false, pid);
int nSize = 0;
DWORD resourcesPtr1 = 0;
ReadProcessMemory(hpro, (void*)0x929254, &resourcesPtr1, sizeof(resourcesPtr1), NULL);
//cout << "读取一级指针偏移" << (void*)resourcesPtr1 << endl;
resourcesPtr1 = resourcesPtr1 + 0x10C;
DWORD resourcesPtr2 = 0;
ReadProcessMemory(hpro, (void*)resourcesPtr1, &resourcesPtr2, sizeof(resourcesPtr1), NULL);
//cout << "读取二级指针偏移" << (void*)resourcesPtr2 << endl;
resourcesPtr2 = resourcesPtr2 + 0x0A8;
DWORD resourcesPtr3 = 0;
ReadProcessMemory(hpro, (void*)resourcesPtr2, &resourcesPtr3, sizeof(resourcesPtr3), NULL);
//cout << "读取三级指针偏移" << (void*)resourcesPtr3 << endl;
resourcesPtr3 = resourcesPtr3 + 0x4;
/*DWORD resourcesPtr4 = 0;
ReadProcessMemory(hpro, (void*)resourcesPtr3, &resourcesPtr4, sizeof(resourcesPtr4), NULL);*/
cout << "读取4级指针偏移" << (void*)resourcesPtr3 << endl;//
//读出来是4FA0000 浮点转换十六进制才是500 需要怎么改才能达到黑窗口显示500呢? system("pause");
return 0;
你是vc驿站的吧。。 我是小白前来学习 DWORD a = 0x43FA0000;
printf("%f\n", *(float*)&a);
进制转换,试试可以不。
刚看到,来晚了。。。 n0noper 发表于 2021-7-27 18:48
DWORD a = 0x43FA0000;
printf("%f\n", *(float*)&a);
谢谢大佬指点已经解决了
dwAddress = dwReadedContent + 0xC;float resrlt3;ReadProcessMemory(hpro, (void*)dwAddress, &resrlt3, 4, NULL);//读取黄金cout << "读取黄金" << resrlt3 << endl;
精神可嘉。
页:
[1]