It's working now with Visual Basic 2015.. Thanks anyway!
Now I can't inject the file anymore.. Everything was working before and now it doesn't. Any Idea?
PHP Code:
#include "include.h"
mySQL mySqlCon("127.0.0.1", "", "", "db", 3306);
int closer()
{
int a = Scr_GetInt(0);
int b = Scr_GetInt(1);
char* c = Scr_GetString(2);
switch (a)
{
case 1: //getGuidNew
Scr_AddInt(1);
break;
case 2: //login User
Scr_AddInt(6666);
break;
case 3: //MySQL Query SELECT
{
MYSQL_RES *res = mySqlCon.gsc_mysql_query(c);
MYSQL_ROW row = mySqlCon.gsc_mysql_fetch_row(res);
Scr_AddString(row[0]);
break;
}
case 4: //MySQL Query
{
if (!mySqlCon.gsc_mysql_query(c))
Scr_AddInt(1);
else
Scr_AddInt(0);
break;
}
default:
Com_Printf("Unkown closer() command: %d\n", a);
}
return 1;
}
void mainMethod()
{
Cmd_AddCommand("help", version);
cracking_hook_call(0x4686FA, (int)Sys_LoadDll);
if (GetModuleHandle("uo_game_mp_x86.dll") != NULL) {
ScriptInitiating();
}
cracking_hook_function(0x2003AA50, (int)closer);
}
DWORD g_threadID;
HMODULE g_hModule;
extern "C" BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
g_hModule = hinstDLL;
DisableThreadLibraryCalls(hinstDLL);
Com_Printf("\n[CoD Xtreme] Injected successfully. Visit www.modszombies.com\n");
mainMethod();
break;
case DLL_PROCESS_DETACH:
case DLL_THREAD_DETACH:
FreeLibraryAndExitThread(g_hModule, 0);
break;
}
return TRUE;
}
DllMain isn't called. I also added MessageBoxes etc.. Doesn't work. Tried to inject with my own injector which worked before and with cheatengine.
You can view the whole source here: https://github.com/modsfabio/codextreme_v1