Code:
static class NativeMethods
{
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string dllToLoad);
[DllImport("kernel32.dll")]
public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName);
[DllImport("kernel32.dll")]
publicstaticexternbool FreeLibrary(IntPtr hModule);
}
and my Method:
public void LoadLibs()
{
NativeMethods.LoadLibrary(Pathconst + "Filename.dll"); // ofc checked if Pathconst is correct etc etc,everything right here
}
this works like i said,for some dlls, but not for others
EDIT:
ok i did it another way now(using the games GetProcAddress method instead of loading the dlls in my bot and gettings offsets from there etc etc) which works too,but still i'd like to know why it wasn't working with loading the dll directly