Hi.
So faar ive using ASM code cave for all my LUA calls. But its just so ugly and clumpsy so I decided to go with DLL injection instead.
However.. I fail so horrible at writing the DLL. Been sitting all day and cant figure out what im doing wrong.
Im using VC++
Code:
#include "stdafx.h"
#include <windows.h>
#include "Injector.h"
#include <stdio.h>
#include <stdlib.h>
BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
MessageBox (NULL, L"DLL Injected!\n", L"DLL Injected!\n", MB_ICONINFORMATION);
break;
}
return TRUE;
}
When I inject this i get get some funny debug error
Debug Error!
Program C:\etc\etc
R6033
-Attempt to use MSIL code from this assembly during native code initialization
This indicates a bug in your application. It´s most likley the result of calling an MSIL-Compiled (/clr) function from a native constructor or from DllMain.
Anyone who have seen this before and mind translating this to english?