【问题标题】:How would I go about modifying an AOB from Cheat Engine to C++?我将如何将 AOB 从 Cheat Engine 修改为 C++?
【发布时间】:2020-08-14 00:31:57
【问题描述】:

我一直在尝试修改我在 C++ 的作弊引擎中找到的字节数组,但是当我尝试从中读取或写入时遇到了访问冲突崩溃。

    // Writes pillarbox removal into memory ("33 83 4C 02" to "33 83 4C 00").
    *(BYTE*)(*((intptr_t*)((intptr_t)baseModule + 0x1E14850)) + 0x3) = 00;

我想知道我做错了什么,因为在我取消保护主模块句柄后,我修改的浮点值使用了类似的东西。

【问题讨论】:

  • 您使用什么工具来编译/运行这个 C++?对于我们这些不熟悉作弊引擎的人。
  • 我假设baseModule + 0x1e14850 持有0x33834c02 数据的地址,不应该持有数据本身?
  • @JohnFileau 我正在使用 Visual Studio 2019 和 ASI Loader。
  • 我假设 AOB CE 扫描返回给您BaseModule+0x1E14850 地址。如果你想写00来处理内存,为什么不使用WriteProcessMemory?
  • @user 根据作弊引擎的地址属性,AOB所在的地址本身是游戏进程+ 1E14850,这是我从那里得到的。

标签: c++ arrays byte reverse-engineering cheat-engine


【解决方案1】:

试试这个:

void WriteToMemory(uintptr_t addressToWrite, char* valueToWrite, int byteNum)
{
    //used to change our file access type, stores the old
    //access type and restores it after memory is written
    unsigned long OldProtection;
    //give that address read and write permissions and store the old permissions at oldProtection
    VirtualProtect((LPVOID)(addressToWrite), byteNum, PAGE_EXECUTE_READWRITE, &OldProtection);

    //write the memory into the program and overwrite previous value
    memcpy((LPVOID)addressToWrite, valueToWrite, byteNum);

    //reset the permissions of the address back to oldProtection after writting memory
    VirtualProtect((LPVOID)(addressToWrite), byteNum, OldProtection, NULL);
}

并这样称呼它:

MODULEINFO mInfo = GetModuleInfo("name.exe");

//Assign our base and module size
DWORD baseModule = (DWORD)mInfo.lpBaseOfDll;
uintptr_t addressToWrite = (uintptr_t)baseModule + 0x1E14850;
char writeThis[] = "\x33\x83\x4c\x00";
WriteToMemory(addressToWrite, writeThis, 4);

如果成功了请告诉我

【讨论】:

  • 看起来好像一个错误说“类型为“HMODULE”的值不能用于初始化类型为“uintptr_t”的实体”围绕该函数调用的baseModule变量。
  • 通过将引发该错误的内容替换为“ uintptr_t addressToWrite = ((intptr_t)baseModule + 0x1E14850);”,它可以完美运行。谢谢!
  • 太好了,很高兴我们最终能做到
  • @KingKrouch 只是为了它guidedhacking.com/threads/… 显示了非常相似的代码,其中包括 dll 内的(非常糟糕的优化 - 但有点工作)模式扫描字节,这将避免你不得不使用每次启动游戏时,CE 都会进行 AOB 扫描。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-02-18
  • 2018-02-03
  • 1970-01-01
  • 1970-01-01
  • 2020-12-28
  • 1970-01-01
相关资源
最近更新 更多