Skip to main content
Bumped by Community user
update result image
Source Link

Why the module address is different in Cheat Engine than in x32dbg?

enter image description here

I'm trying to read this:

enter image description here

My c++ attempt:

#include "pch.h"
#include "Functions.h"
#include "offsets.h"
#include <iostream>

using namespace std;

DWORD WINAPI HackThread(HMODULE hModule)
{
    //Create Console
    AllocConsole();
    FILE* f;
    freopen_s(&f, "CONOUT$", "w", stdout);

    cout << "We're injected!\n";

    uintptr_t module = (uintptr_t)GetModuleHandle(NULL);        
    int addr = module + 0x04939F0;

    while (true)
    {
        if (GetAsyncKeyState(VK_END) & 1)
        {
            cout << "Reading: " << hex << addr << endl;
            cout << *(int*)addr << endl;
        }

        Sleep(5);
    }

    fclose(f);
    FreeConsole();
    FreeLibraryAndExitThread(hModule, 0);
    return 0;
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)HackThread, hModule, 0, nullptr));
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

From c++ I can find this module address:

enter image description hereenter image description here

I'm not sure if I was reading the correct address my code will work...

Why the module address is different in Cheat Engine than in x32dbg?

enter image description here

I'm trying to read this:

enter image description here

My c++ attempt:

#include "pch.h"
#include "Functions.h"
#include "offsets.h"
#include <iostream>

using namespace std;

DWORD WINAPI HackThread(HMODULE hModule)
{
    //Create Console
    AllocConsole();
    FILE* f;
    freopen_s(&f, "CONOUT$", "w", stdout);

    cout << "We're injected!\n";

    uintptr_t module = (uintptr_t)GetModuleHandle(NULL);        
    int addr = module + 0x04939F0;

    while (true)
    {
        if (GetAsyncKeyState(VK_END) & 1)
        {
            cout << "Reading: " << hex << addr << endl;
            cout << *(int*)addr << endl;
        }

        Sleep(5);
    }

    fclose(f);
    FreeConsole();
    FreeLibraryAndExitThread(hModule, 0);
    return 0;
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)HackThread, hModule, 0, nullptr));
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

From c++ I can find this module address:

enter image description here

I'm not sure if I was reading the correct address my code will work...

Why the module address is different in Cheat Engine than in x32dbg?

enter image description here

I'm trying to read this:

enter image description here

My c++ attempt:

#include "pch.h"
#include "Functions.h"
#include "offsets.h"
#include <iostream>

using namespace std;

DWORD WINAPI HackThread(HMODULE hModule)
{
    //Create Console
    AllocConsole();
    FILE* f;
    freopen_s(&f, "CONOUT$", "w", stdout);

    cout << "We're injected!\n";

    uintptr_t module = (uintptr_t)GetModuleHandle(NULL);        
    int addr = module + 0x04939F0;

    while (true)
    {
        if (GetAsyncKeyState(VK_END) & 1)
        {
            cout << "Reading: " << hex << addr << endl;
            cout << *(int*)addr << endl;
        }

        Sleep(5);
    }

    fclose(f);
    FreeConsole();
    FreeLibraryAndExitThread(hModule, 0);
    return 0;
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)HackThread, hModule, 0, nullptr));
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

From c++ I can find this module address:

enter image description here

I'm not sure if I was reading the correct address my code will work...

added 133 characters in body
Source Link

Why the module address is different in Cheat Engine than in x32dbg?

enter image description here

I'm trying to read this:

enter image description here

My c++ attempt:

#include "pch.h"
#include "Functions.h"
#include "offsets.h"
#include <iostream>

using namespace std;

DWORD WINAPI HackThread(HMODULE hModule)
{
    //Create Console
    AllocConsole();
    FILE* f;
    freopen_s(&f, "CONOUT$", "w", stdout);

    cout << "We're injected!\n";

    uintptr_t module = (uintptr_t)GetModuleHandle(NULL);        
    int addr = module + 0x04939F0;

    while (true)
    {
        if (GetAsyncKeyState(VK_END) & 1)
        {
            cout << "Reading: " << hex << addr << endl;
            cout << *(int*)addr << endl;
        }

        Sleep(5);
    }

    fclose(f);
    FreeConsole();
    FreeLibraryAndExitThread(hModule, 0);
    return 0;
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)HackThread, hModule, 0, nullptr));
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

From c++ I can find this module address:

enter image description here

I'm not sure if I was reading the correct address my code will work...

Why the module address is different in Cheat Engine than in x32dbg?

enter image description here

I'm trying to read this:

enter image description here

My c++ attempt:

#include "pch.h"
#include "Functions.h"
#include "offsets.h"
#include <iostream>

using namespace std;

DWORD WINAPI HackThread(HMODULE hModule)
{
    //Create Console
    AllocConsole();
    FILE* f;
    freopen_s(&f, "CONOUT$", "w", stdout);

    cout << "We're injected!\n";

    uintptr_t module = (uintptr_t)GetModuleHandle(NULL);        
    int addr = module + 0x04939F0;

    while (true)
    {
        if (GetAsyncKeyState(VK_END) & 1)
        {
            cout << "Reading: " << hex << addr << endl;
            cout << *(int*)addr << endl;
        }

        Sleep(5);
    }

    fclose(f);
    FreeConsole();
    FreeLibraryAndExitThread(hModule, 0);
    return 0;
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)HackThread, hModule, 0, nullptr));
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

I'm not sure if I was reading the correct address my code will work...

Why the module address is different in Cheat Engine than in x32dbg?

enter image description here

I'm trying to read this:

enter image description here

My c++ attempt:

#include "pch.h"
#include "Functions.h"
#include "offsets.h"
#include <iostream>

using namespace std;

DWORD WINAPI HackThread(HMODULE hModule)
{
    //Create Console
    AllocConsole();
    FILE* f;
    freopen_s(&f, "CONOUT$", "w", stdout);

    cout << "We're injected!\n";

    uintptr_t module = (uintptr_t)GetModuleHandle(NULL);        
    int addr = module + 0x04939F0;

    while (true)
    {
        if (GetAsyncKeyState(VK_END) & 1)
        {
            cout << "Reading: " << hex << addr << endl;
            cout << *(int*)addr << endl;
        }

        Sleep(5);
    }

    fclose(f);
    FreeConsole();
    FreeLibraryAndExitThread(hModule, 0);
    return 0;
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)HackThread, hModule, 0, nullptr));
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

From c++ I can find this module address:

enter image description here

I'm not sure if I was reading the correct address my code will work...

Source Link

Why module address is different in Cheat Engine than in x32dbg?

Why the module address is different in Cheat Engine than in x32dbg?

enter image description here

I'm trying to read this:

enter image description here

My c++ attempt:

#include "pch.h"
#include "Functions.h"
#include "offsets.h"
#include <iostream>

using namespace std;

DWORD WINAPI HackThread(HMODULE hModule)
{
    //Create Console
    AllocConsole();
    FILE* f;
    freopen_s(&f, "CONOUT$", "w", stdout);

    cout << "We're injected!\n";

    uintptr_t module = (uintptr_t)GetModuleHandle(NULL);        
    int addr = module + 0x04939F0;

    while (true)
    {
        if (GetAsyncKeyState(VK_END) & 1)
        {
            cout << "Reading: " << hex << addr << endl;
            cout << *(int*)addr << endl;
        }

        Sleep(5);
    }

    fclose(f);
    FreeConsole();
    FreeLibraryAndExitThread(hModule, 0);
    return 0;
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)HackThread, hModule, 0, nullptr));
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

I'm not sure if I was reading the correct address my code will work...