Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // dllmain.cpp : Defines the entry point for the DLL application.
- #include "stdafx.h"
- #include "Logger.h"
- #include <Winsock2.h>
- #include <Windows.h>
- #include <fstream>
- #include <stdio.h>
- #pragma comment(lib, "ws2_32.lib")
- #pragma comment(lib, "detours.lib")
- #include "detours.h"
- LogGer SendLog("C:\Send.txt");
- typedef int (__stdcall *real_SendTo)(SOCKET sock, char buf, int len, int flags, DWORD pTo, int toLen);
- void __stdcall TOMPA_Send(SOCKET sock, char buf, int len, int flags, DWORD pTo, int toLen);
- real_SendTo FuncToDetour = (real_SendTo)(0x009C8900);
- void __stdcall TOMPA_Send(SOCKET sock, char buf, int len, int flags, DWORD pTo, int toLen)
- {
- SendLog.Open();
- SendLog.Print("Sock : ", sock, " buf : ", (const char*)buf, " flags : ", flags, " pTo : ", pTo, " toLen : ", toLen );
- SendLog.Close();
- FuncToDetour(sock, buf, len, flags, pTo, toLen);
- }
- BOOL APIENTRY DllMain( HMODULE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
- {
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- MessageBoxA(0,"Inject OK","TOMPA",64);
- CreateThread(0,0,(LPTHREAD_START_ROUTINE)&TOMPA_Send ,0,0,0);
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
- }
Add Comment
Please, Sign In to add comment