Guest User

Untitled

a guest
May 23rd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. // dllmain.cpp : Defines the entry point for the DLL application.
  2. #include "stdafx.h"
  3. #include "Logger.h"
  4.  
  5.  
  6. #include <Winsock2.h>
  7. #include <Windows.h>
  8. #include <fstream>
  9. #include <stdio.h>
  10.  
  11. #pragma comment(lib, "ws2_32.lib")
  12. #pragma comment(lib, "detours.lib")
  13. #include "detours.h"
  14.  
  15.  
  16. LogGer SendLog("C:\Send.txt");
  17.  
  18.  
  19. typedef int (__stdcall *real_SendTo)(SOCKET sock, char buf, int len, int flags, DWORD pTo, int toLen);
  20. void __stdcall TOMPA_Send(SOCKET sock, char buf, int len, int flags, DWORD pTo, int toLen);
  21.  
  22.  
  23. real_SendTo FuncToDetour = (real_SendTo)(0x009C8900);
  24.  
  25.  
  26. void __stdcall TOMPA_Send(SOCKET sock, char buf, int len, int flags, DWORD pTo, int toLen)
  27. {
  28. SendLog.Open();
  29. SendLog.Print("Sock : ", sock, " buf : ", (const char*)buf, " flags : ", flags, " pTo : ", pTo, " toLen : ", toLen );
  30. SendLog.Close();
  31.  
  32. FuncToDetour(sock, buf, len, flags, pTo, toLen);
  33. }
  34.  
  35.  
  36. BOOL APIENTRY DllMain( HMODULE hModule,
  37. DWORD ul_reason_for_call,
  38. LPVOID lpReserved
  39. )
  40. {
  41. switch (ul_reason_for_call)
  42. {
  43. case DLL_PROCESS_ATTACH:
  44.  
  45.  
  46. MessageBoxA(0,"Inject OK","TOMPA",64);
  47.  
  48. CreateThread(0,0,(LPTHREAD_START_ROUTINE)&TOMPA_Send ,0,0,0);
  49.  
  50.  
  51.  
  52.  
  53.  
  54. case DLL_THREAD_ATTACH:
  55. case DLL_THREAD_DETACH:
  56. case DLL_PROCESS_DETACH:
  57. break;
  58. }
  59. return TRUE;
  60. }
Add Comment
Please, Sign In to add comment