Ive managed to create a dll in c++ with a function for the asm code.
it looks like this :
Code:
// GM Detect.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include <windows.h>
#define JMP(frm,to) (((int)to - (int)frm)-5)
DWORD Adress = 0x00553A83;
DWORD RetAdress = (Adress + 7); // cause 2 nops
__declspec(naked) void myCodeCave ()
{
__asm
{
cmp [eax+0x70], 0x5D4D475B //[GM]
je [00000000]
mov [esi+0x0c],0x00000000
jmp RetAdress
}
}
void GMDetect ()
{
*(BYTE*)Adress = 0xe9; // defining jump opcode
*(DWORD*)(Adress+1) = JMP(Adress,myCodeCave);
*(WORD*)Adress = 0x9090;
}
but then if i would call upon that function with dllcall() it doenst run ..
i use this code in ahk :
Code:
DllCall("LoadLibrary","Str","GMDetect.dll")
hModule:=DllCall("GetModuleHandle")
DllCall("GetProcAddress","UInt",hModule,"Str","GMDetect")