k, heres the code...
Addy Logger.cpp-
Code:
#include "stdafx.h"
#include "Classes and Functions.h"
void thethread()
{
//my sig's here
}
BOOL APIENTRY DllMain( HMODULE hMod, DWORD dwReason, PVOID pvReserved )
{
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)thethread, 0, 0, 0);
GetModuleFileName(hMod, dlldir, 512);
for(int i = strlen(dlldir); i > 0; i--) { if(dlldir[i] == '\\') { dlldir[i+1] = 0; break;}}
ofile.open(GetDirectoryFile("WooWMyLog.txt"), ios::app);
return true;
}
classes and functions.h-
Code:
#include <windows.h>
#include <fstream>
using namespace std; //need for the logging func
ofstream ofile; //need for the logging func
char *GetDirectoryFile(char *filename); //getdirfile for the logging func
void thethread(); //the main function
void __cdecl add_log (const char * fmt, ...); //the logging func
char dlldir[320];
char *GetDirectoryFile(char *filename)//get the directory of the dll
{
static char path[320];
strcpy(path, dlldir);
strcat(path, filename);
return path;
}
void __cdecl add_log (const char *fmt, ...)//the add log func
{
if(ofile != NULL)
{
if(!fmt) { return; }
va_list va_alist;
char logbuf[256] = {0};
va_start (va_alist, fmt);
_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), fmt, va_alist);
va_end (va_alist);
ofile << logbuf << endl;
}
}
bool Match(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
for(;*szMask;++szMask,++pData,++bMask)
if(*szMask=='x' && *pData!=*bMask )
return false;
return (*szMask) == NULL;
}
DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
{
for(DWORD i=0; i < dwLen; i++)
if( Match( (BYTE*)( dwAddress+i ),bMask,szMask) )
return (DWORD)(dwAddress+i);
return 0;
}
it has no hooking function might that be the problem?
or detours?