Click to See Complete Forum and Search --> : hi i have problems with detours and glDrawElements please respond thnx is advice


nah1337
October 22nd, 2006, 06:16 AM
in main.cpp i have :
#include <windows.h>
#include <stdio.h>
#include "main.h"
#include "opengl.h"
#include "detours.h"
#pragma warning(disable:4100)
#pragma comment(lib,"detours.lib")

void WINAPI glDrawElements_Detour(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
void WINAPI glDrawElements_Trampoline(GLenum, GLsizei, GLenum, const GLvoid *indices);



bool WINAPI DllMain(HMODULE hDll, DWORD dwReason, PVOID pvReserved)
{
if(dwReason == DLL_PROCESS_ATTACH)
{
DetourFunctionWithTrampoline((PBYTE)glDrawElements_Trampoline,(PBYTE)glDrawElements_Detour);
hTtnDll = hDll;
DisableThreadLibraryCalls(hDll);
sycoreReDirectFunction("kernel32.dll", "GetProcAddress", (DWORD)&pGetProcAddress);
return TRUE;
}
return FALSE;
}




////////////// in opengel.cpp i have

#include <windows.h>
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glaux.h>
#include <math.h>
#include "CRC.h"
#include "ASM_GL_CALLS.h"
#include "opengl.h"
#include "main.h"
//#pragma warning(disable: 4244)
#include "detours.h"
#pragma warning(disable:4100)
#pragma comment(lib,"detours.lib")


DETOUR_TRAMPOLINE(void WINAPI glDrawElements_Trampoline(GLenum, GLsizei, GLenum, const GLvoid *indices), glDrawElements);

void WINAPI glDrawElements_Detour(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{


if (MODELS_1)
{

show_****_modelz();
}

if (MODELS_2)
{

show_****_modelz();
}

if (MODELS_3)
{

show_****_modelz();
}

if (MODELS_4)
{

show_****_modelz();
}



glDrawElements_Trampoline(mode, count, type, indices);
}



and in opengel.h i have this void APIENTRY omfg_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);



and i get this error and i dont know what do to :::


Linking...
main.obj : error LNK2001: unresolved external symbol "void __stdcall omfg_glDrawElements(unsigned int,int,unsigned int,void const *)" (?omfg_glDrawElements@@YGXIHIPBX@Z)
Release/BASE_GL_HOOK.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

BASE_GL_HOOK.dll - 2 error(s), 0 warning(s)

nah1337
October 22nd, 2006, 12:41 PM
i dont know but i think in the hook i have detours 1.5 and in microsoft visual basic include folder there might be detours 2.1 arent they conflicting themselfes ?