Code:
push 0 .text:1007C50F push offset unk_100CD8F5 .text:1007C514 push offset aOk ; "OK" .text:1007C519 push offset aBb9999F1Bbbbbb ; "{BB9999}F1\t{BBBBBB}Display this help di"... .text:1007C51E push offset aSaMpKeys ; "SA-MP Keys:" .text:1007C523 push 0 .text:1007C525 push 1 .text:1007C527 call sub_100806F0
Allerdings stimmt die Adresse 100806F0 nicht, da sich diese Funktion in einer geladenen Library befindet.
Wie kann ich nun die richtige Adresse berechnen?
So habe ich es versucht:
Code:
#include <windows.h> void function(char* x1, char* x2, char* x3, char* x4) { DWORD dwBase = (DWORD) GetModuleHandleA("samp.dll"); DWORD* dwAddress = (DWORD*) (dwBase + 0x806F0); __asm { push 0 push x1 push x2 push x3 push x4 push 0 push 1 call dwAddress } } DWORD APIENTRY MainThread(LPVOID lpArgs) { MessageBoxA(0, "Test - 1", "Debug", 0); while (true) { if (GetAsyncKeyState(VK_NUMPAD0) & 1) { MessageBoxA(0, "Test - 2", "Debug", 0); function("", "OK", "Test", "Title"); } } return FALSE; } BOOL APIENTRY DllMain(HMODULE hDLL, DWORD dwReason, LPVOID lpReserved) { if (dwReason == DLL_PROCESS_ATTACH) CreateThread(NULL, NULL, &MainThread, NULL, NULL, NULL); return TRUE; }