I have an address that is located in a dll loaded by my target process. I would like to call this address using dll injection.
For now my dll looks like this:
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
MessageBox(NULL, L"Injection Successful", L"TEST:", MB_OK);
//Here I'd like to call the address
break;
}
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
From what I've learned online, there are some problems:
- I can't use the address that is shown in the debugger (x64dbg) because of some offset stuff I don't understand.
- The address is a different one every time I start the program.
I'm using Cheat Engine to inject the dll and x64dbg as a debugger. Since I'm a beginner, a bit of code would be very much appreciated.