Tekil Mesaj gösterimi
Alt 07 Aralık 2021, 16:51   #1
Westyy
Kayıtlı Üye
Westyy - ait Kullanıcı Resmi (Avatar)

Standart Unrealircd4.2.4.1 proxy modulu hk.

arkadaşlar

Kod

#include "config.h" 
#include "struct.h" 
#include "common.h" 
#include "sys.h" 
#include "numeric.h" 
#include "msg.h" 
#include "channel.h" 
#include <time.h> 
#include <sys/stat.h> 
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#ifdef _WIN32 
#include <io.h> 
#endif 
#include <fcntl.h> 
#include "h.h" 
#ifdef _WIN32 
#include "version.h" 
#endif 

#define   BOYUT         1024
#define   PRE_CONNECT    HOOKTYPE_PRE_LOCAL_CONNECT
#define   ACIKLAMA       "Proxy Banned"

int kullanici_girisi(aClient *, aChannel *); 

#ifndef STATIC_LINKING 
static ModuleInfo   *MyModInfo; 
 #define MyMod      MyModInfo->handle 
 #define SAVE_MODINFO   MyModInfo = modinfo; 
#else 
 #define MyMod      NULL 
 #define SAVE_MODINFO 
#endif 

ModuleHeader MOD_HEADER(proxy) 
  = { 
   "proxyban.c", 
   ACIKLAMA,
   "by Entrance", 
   "3.2-b8-1", 
   NULL 
    }; 

DLLFUNC int MOD_TEST(proxy)(ModuleInfo *modinfo) 
{ 
   SAVE_MODINFO 
    return MOD_SUCCESS; 
} 

DLLFUNC int MOD_INIT(proxy)(ModuleInfo *modinfo) 
{ 

   MARK_AS_OFFICIAL_MODULE(modinfo); 
   HookAddEx(modinfo->handle, PRE_CONNECT, kullanici_girisi); 

   SAVE_MODINFO 

      return MOD_SUCCESS; 
} 

DLLFUNC int MOD_LOAD(proxy)(int module_load) 
{ 
      return MOD_SUCCESS; 
} 

DLLFUNC int MOD_UNLOAD(proxy)(int module_unload) 
{ 
      return MOD_SUCCESS; 
} 

int kullanici_girisi(aClient *sptr, aChannel *chptr) { 

FILE *p;
char str[BOYUT]; char *ip = GetIP(sptr);

if((p = fopen("proxy.txt","r")) != NULL){ 
 while(!(feof(p))) {
       fscanf(p, "%s", str);
if (strcmp(str, ip) == 0) {
 if (sptr->listener->port == 1985) {
   return 0;
 }
 if (sptr->listener->port == 7005) {
   return 0;
 }
 if (sptr->listener->port == 2018) {
   return 0;
 }
 return place_host_ban(sptr, BAN_ACT_GZLINE, "Proxy Banned4!", 8000);
 }
}
   fclose(p);
}
return 0;
 }
arkadaşlar enterance yapmış oldugu modulu unrealircd4.2.4.1 güncelleyecek birileri varmı