Advertisement
Guest User

Untitled

a guest
Jul 6th, 2013
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.24 KB | None | 0 0
  1. #define WINDOWS_LEAN_AND_MEAN
  2. #include <windows.h>
  3.  
  4. #include <stdio.h>
  5. #include "Include/SDK/amx/amx.h"
  6. #include "Include/SDK/plugincommon.h"
  7.  
  8.  
  9. typedef void (*logprintf_t)(char* format, ...);
  10. logprintf_t logprintf;
  11.  
  12. PLUGIN_EXPORT unsigned int PLUGIN_CALL Supports()
  13. {
  14.     return SUPPORTS_VERSION | SUPPORTS_AMX_NATIVES;
  15. }
  16.  
  17. PLUGIN_EXPORT bool PLUGIN_CALL Load( void **ppData )
  18. {
  19.  
  20.     /*
  21.         0045739E     EB 23          JMP SHORT samp-ser.004573C3
  22.         0045739E     EB 23          JMP SHORT samp-ser.004573C3
  23.     */
  24.     logprintf = (logprintf_t) ppData[PLUGIN_DATA_LOGPRINTF];
  25.  
  26.     BYTE pNewJMP[] = {0xEB ,0x23 ,0x7C ,0xFF ,0xFF ,0x90 ,0x90};
  27.     DWORD patchPlace;
  28.     patchPlace = (DWORD)GetModuleHandle( "samp-server.exe" ) + 0x5739e;
  29.    
  30.     DWORD orginalProt;
  31.     VirtualProtect((PVOID)patchPlace,sizeof(pNewJMP),PAGE_EXECUTE_READWRITE,&orginalProt);
  32.  
  33.     memcpy((PVOID)patchPlace,pNewJMP,sizeof(pNewJMP));
  34.  
  35.     logprintf(" - [SA:MP 0.3x R1-2 - Incomming Connection Remover by MyU (https://forum.sa-mp.de/index.php?page=User&userID=11194) ] -");
  36.  
  37.  
  38.  
  39.     return true;
  40. }
  41.  
  42. PLUGIN_EXPORT int PLUGIN_CALL AmxLoad( AMX *amx )
  43. {
  44.     return 1;
  45. }
  46.  
  47. PLUGIN_EXPORT int PLUGIN_CALL AmxUnload( AMX *amx )
  48. {
  49.     return 0;
  50. }
  51.  
  52. PLUGIN_EXPORT void PLUGIN_CALL Unload( )
  53. {
  54.    
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement