Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <detours.h>
- #include <stdio.h>
- #ifdef _DEBUG
- # define Debug(fmtstr, ...) printf(fmtstr, ##__VA_ARGS__)
- #else
- # define Debug(fmtstr, ...)
- #endif
- #pragma warning(disable : 4996)
- typedef int* ( __cdecl* tCbuf_AddText )(int a1, int a2, int a3, int a4, char* a5, char* a6);
- tCbuf_AddText Cbuf_AddText_ = ( tCbuf_AddText )0xCB10D0; //latest: CB10D0 oldones: CB10B0
- tCbuf_AddText origCbuf;
- int* hkCbuf(int a1, int a2, int a3, int a4, char* a5, char* a6){
- //MessageBox(NULL, "Test", "Func. Detoured", MB_OK);
- printf("test: %d %d %d %d %d %d \n", a1, a2, a3, a4, a5, a6);
- return origCbuf(a1,a2,a3,a4,a5,a6);
- }
- bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD Reason, LPVOID lpReserved)
- {
- AllocConsole();
- freopen("CONIN$", "r", stdin);
- freopen("CONOUT$", "w", stdout);
- freopen("CONOUT$", "w", stderr);
- if(Reason == 1)
- {
- origCbuf=(tCbuf_AddText) DetourFunction((PBYTE)0xCB10D0,(PBYTE)hkCbuf); //latest: CB10D0 oldones: CB10B0
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement