我正在使用CodeBlocks
并试图在里面制作一个钩子dll
DllMain
#include "main.h"
#include "Asm.h"
#include <stdio.h>
using namespace std;
static HINSTANCE WINAPI Mysnprintf(char* str, int len, const char* format, ...);
static void InitDll(){
Originalsnprintf = (snprintfFn)GetProcAddress(GetModuleHandleA("msvcr90.dll"), "_snprintf");
Asm code;
code.JMP((int)Mysnprintf); // where JMP = Asm& JMP(int address){...}
}
我不知道出了什么问题,因为如果我对它做同样的Microsoft Visual C++
事情,它将不会出错!!!