IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Réseau C Discussion :

Modification d'un hostname cryptage sur unrealircd


Sujet :

Réseau C

  1. #1
    Futur Membre du Club
    Inscrit en
    Décembre 2008
    Messages
    12
    Détails du profil
    Informations forums :
    Inscription : Décembre 2008
    Messages : 12
    Points : 7
    Points
    7
    Par défaut Modification d'un hostname cryptage sur unrealircd
    bonsoir,

    je suis debutant dans la programmation en C, j'aimerai savoir comment faire pour modifier le crytage des hostname dans unrealircd de façon à faire comme celà:

    crytage.wanadoo.fr pour les ips résolues

    crytage.ip pour les ips non résolues

    merci d'avance de votre aide.

    voiçi le codage.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
     
    /*
     *   IRC - Internet Relay Chat, src/modules/cloak.c
     *   (C) 2004 The UnrealIRCd Team
     *
     *   See file AUTHORS in IRC package for additional names of
     *   the programmers.
     *
     *   This program is free software; you can redistribute it and/or modify
     *   it under the terms of the GNU General Public License as published by
     *   the Free Software Foundation; either version 1, or (at your option)
     *   any later version.
     *
     *   This program is distributed in the hope that it will be useful,
     *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *   GNU General Public License for more details.
     *
     *   You should have received a copy of the GNU General Public License
     *   along with this program; if not, write to the Free Software
     *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     */
     
    #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
     
    static char *cloak_key1 = NULL, *cloak_key2 = NULL, *cloak_key3 = NULL;
    static char cloak_checksum[64];
    static int nokeys = 1;
     
    #undef KEY1
    #undef KEY2
    #undef KEY3
    #define KEY1 cloak_key1
    #define KEY2 cloak_key2
    #define KEY3 cloak_key3
     
    DLLFUNC char *hidehost(char *host);
    DLLFUNC char *cloakcsum();
    DLLFUNC int cloak_config_test(ConfigFile *, ConfigEntry *, int, int *);
    DLLFUNC int cloak_config_run(ConfigFile *, ConfigEntry *, int);
    DLLFUNC int cloak_config_posttest(int *);
     
    static char *hidehost_ipv4(char *host);
    static char *hidehost_ipv6(char *host);
    static char *hidehost_normalhost(char *host);
    static inline unsigned int downsample(char *i);
     
    Callback *cloak = NULL, *cloak_csum = NULL;
     
    ModuleHeader MOD_HEADER(cloak)
      = {
      "cloak",
      "$Id: cloak.c,v 1.1.2.3 2005/02/04 00:26:37 syzop Exp $",
      "Official cloaking module (md5)",
      "3.2-b8-1",
      NULL
      };
     
    DLLFUNC int MOD_TEST(cloak)(ModuleInfo *modinfo)
    {
    	cloak = CallbackAddPCharEx(modinfo->handle, CALLBACKTYPE_CLOAK, hidehost);
    	if (!cloak)
    	{
    		config_error("cloak: Error while trying to install cloaking callback!");
    		return MOD_FAILED;
    	}
    	cloak_csum = CallbackAddPCharEx(modinfo->handle, CALLBACKTYPE_CLOAKKEYCSUM, cloakcsum);
    	if (!cloak_csum)
    	{
    		config_error("cloak: Error while trying to install cloaking checksum callback!");
    		return MOD_FAILED;
    	}
    	HookAddEx(modinfo->handle, HOOKTYPE_CONFIGTEST, cloak_config_test);
    	HookAddEx(modinfo->handle, HOOKTYPE_CONFIGPOSTTEST, cloak_config_posttest);
    	return MOD_SUCCESS;
    }
     
    DLLFUNC int MOD_INIT(cloak)(ModuleInfo *modinfo)
    {
    	MARK_AS_OFFICIAL_MODULE(modinfo);
    	HookAddEx(modinfo->handle, HOOKTYPE_CONFIGRUN, cloak_config_run);
    	return MOD_SUCCESS;
    }
     
    DLLFUNC int MOD_LOAD(cloak)(int module_load)
    {
    	return MOD_SUCCESS;
    }
     
    DLLFUNC int MOD_UNLOAD(cloak)(int module_unload)
    {
    	if (cloak_key1)
    	{
    		MyFree(cloak_key1);
    		MyFree(cloak_key2);
    		MyFree(cloak_key3);
    	}
    	return MOD_SUCCESS;
    }
     
    static int check_badrandomness(char *key)
    {
    char gotlowcase=0, gotupcase=0, gotdigit=0;
    char *p;
    	for (p=key; *p; p++)
    		if (islower(*p))
    			gotlowcase = 1;
    		else if (isupper(*p))
    			gotupcase = 1;
    		else if (isdigit(*p))
    			gotdigit = 1;
     
    	if (gotlowcase && gotupcase && gotdigit)
    		return 0;
    	return 1;
    }
     
     
    DLLFUNC int cloak_config_test(ConfigFile *cf, ConfigEntry *ce, int type, int *errs)
    {
    ConfigEntry *cep;
    int keycnt = 0, errors = 0;
    char *keys[3];
     
    	if (type != CONFIG_CLOAKKEYS)
    		return 0;
     
    	nokeys = 0;
    	for (cep = ce->ce_entries; cep; cep = cep->ce_next)
    	{
    		keycnt++;
    		/* TODO: check randomness */
    		if (check_badrandomness(cep->ce_varname))
    		{
    			config_error("%s:%i: set::cloak-keys: (key %d) Keys should be mixed a-zA-Z0-9, "
    			             "like \"a2JO6fh3Q6w4oN3s7\"", cep->ce_fileptr->cf_filename, cep->ce_varlinenum, keycnt);
    			errors++;
    		}
    		if (strlen(cep->ce_varname) < 5)
    		{
    			config_error("%s:%i: set::cloak-keys: (key %d) Each key should be at least 5 characters",
    				cep->ce_fileptr->cf_filename, cep->ce_varlinenum, keycnt);
    			errors++;
    		}
    		if (strlen(cep->ce_varname) > 100)
    		{
    			config_error("%s:%i: set::cloak-keys: (key %d) Each key should be less than 100 characters",
    				cep->ce_fileptr->cf_filename, cep->ce_varlinenum, keycnt);
    			errors++;
    		}
    		if (keycnt < 4)
    			keys[keycnt-1] = cep->ce_varname;
    	}
    	if (keycnt != 3)
    	{
    		config_error("%s:%i: set::cloak-keys: we want 3 values, not %i!",
    			ce->ce_fileptr->cf_filename, ce->ce_varlinenum, keycnt);
    		errors++;
    	}
    	if ((keycnt == 3) && (!strcmp(keys[0], keys[1]) || !strcmp(keys[1], keys[2])))
    	{
    		config_error("%s:%i: set::cloak-keys: All your 3 keys should be RANDOM, they should not be equal",
    			ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
    		errors++;
    	}
    	*errs = errors;
    	return errors ? -1 : 1;
    }
     
    DLLFUNC int cloak_config_posttest(int *errs)
    {
    int errors = 0;
     
    	if (nokeys)
    	{
    		config_error("set::cloak-keys missing!");
    		errors++;
    	}
     
    	*errs = errors;
    	return errors ? -1 : 1;
    }
     
    DLLFUNC int cloak_config_run(ConfigFile *cf, ConfigEntry *ce, int type)
    {
    ConfigEntry *cep;
    char buf[512], result[16];
     
    	if (type != CONFIG_CLOAKKEYS)
    		return 0;
     
    	/* config test should ensure this goes fine... */
    	cep = ce->ce_entries;
    	cloak_key1 = strdup(cep->ce_varname);
    	cep = cep->ce_next;
    	cloak_key2 = strdup(cep->ce_varname);
    	cep = cep->ce_next;
    	cloak_key3 = strdup(cep->ce_varname);
     
    	/* Calculate checksum */
    	sprintf(buf, "%s:%s:%s", KEY1, KEY2, KEY3);
    	DoMD5(result, buf, strlen(buf));
    	ircsprintf(cloak_checksum, "MD5:%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x",
    		(u_int)(result[0] & 0xf), (u_int)(result[0] >> 4),
    		(u_int)(result[1] & 0xf), (u_int)(result[1] >> 4),
    		(u_int)(result[2] & 0xf), (u_int)(result[2] >> 4),
    		(u_int)(result[3] & 0xf), (u_int)(result[3] >> 4),
    		(u_int)(result[4] & 0xf), (u_int)(result[4] >> 4),
    		(u_int)(result[5] & 0xf), (u_int)(result[5] >> 4),
    		(u_int)(result[6] & 0xf), (u_int)(result[6] >> 4),
    		(u_int)(result[7] & 0xf), (u_int)(result[7] >> 4),
    		(u_int)(result[8] & 0xf), (u_int)(result[8] >> 4),
    		(u_int)(result[9] & 0xf), (u_int)(result[9] >> 4),
    		(u_int)(result[10] & 0xf), (u_int)(result[10] >> 4),
    		(u_int)(result[11] & 0xf), (u_int)(result[11] >> 4),
    		(u_int)(result[12] & 0xf), (u_int)(result[12] >> 4),
    		(u_int)(result[13] & 0xf), (u_int)(result[13] >> 4),
    		(u_int)(result[14] & 0xf), (u_int)(result[14] >> 4),
    		(u_int)(result[15] & 0xf), (u_int)(result[15] >> 4));
    	return 1;
    }
     
    DLLFUNC char *hidehost(char *host)
    {
    char *p;
     
    	/* IPv6 ? */	
    	if (strchr(host, ':'))
    		return hidehost_ipv6(host);
     
    	/* Is this a IPv4 IP? */
    	for (p = host; *p; p++)
    		if (!isdigit(*p) && !(*p == '.'))
    			break;
    	if (!(*p))
    		return hidehost_ipv4(host);
     
    	/* Normal host */
    	return hidehost_normalhost(host);
    }
     
    DLLFUNC char *cloakcsum()
    {
    	return cloak_checksum;
    }
     
    /** Downsamples a 128bit result to 32bits (md5 -> unsigned int) */
    static inline unsigned int downsample(char *i)
    {
    char r[4];
     
    	r[0] = i[0] ^ i[1] ^ i[2] ^ i[3];
    	r[1] = i[4] ^ i[5] ^ i[6] ^ i[7];
    	r[2] = i[8] ^ i[9] ^ i[10] ^ i[11];
    	r[3] = i[12] ^ i[13] ^ i[14] ^ i[15];
     
    	return ( ((unsigned int)r[0] << 24) +
    	         ((unsigned int)r[1] << 16) +
    	         ((unsigned int)r[2] << 8) +
    	         (unsigned int)r[3]);
    }
     
    static char *hidehost_ipv4(char *host)
    {
    unsigned int a, b, c, d;
    static char buf[512], res[512], res2[512], result[128];
    unsigned long n;
    unsigned int alpha, beta, gamma;
     
    	/* 
    	 * Output: ALPHA.BETA.GAMMA.IP
    	 * ALPHA is unique for a.b.c.d
    	 * BETA  is unique for a.b.c.*
    	 * GAMMA is unique for a.b.*
    	 * We cloak like this:
    	 * ALPHA = downsample(md5(md5("KEY2:A.B.C.D:KEY3")+"KEY1"));
    	 * BETA  = downsample(md5(md5("KEY3:A.B.C:KEY1")+"KEY2"));
    	 * GAMMA = downsample(md5(md5("KEY1:A.B:KEY2")+"KEY3"));
    	 */
    	sscanf(host, "%u.%u.%u.%u", &a, &b, &c, &d);
     
    	/* ALPHA... */
    	ircsprintf(buf, "%s:%s:%s", KEY2, host, KEY3);
    	DoMD5(res, buf, strlen(buf));
    	strcpy(res+16, KEY1); /* first 16 bytes are filled, append our key.. */
    	n = strlen(res+16) + 16;
    	DoMD5(res2, res, n);
    	alpha = downsample(res2);
     
    	/* BETA... */
    	ircsprintf(buf, "%s:%d.%d.%d:%s", KEY3, a, b, c, KEY1);
    	DoMD5(res, buf, strlen(buf));
    	strcpy(res+16, KEY2); /* first 16 bytes are filled, append our key.. */
    	n = strlen(res+16) + 16;
    	DoMD5(res2, res, n);
    	beta = downsample(res2);
     
    	/* GAMMA... */
    	ircsprintf(buf, "%s:%d.%d:%s", KEY1, a, b, KEY2);
    	DoMD5(res, buf, strlen(buf));
    	strcpy(res+16, KEY3); /* first 16 bytes are filled, append our key.. */
    	n = strlen(res+16) + 16;
    	DoMD5(res2, res, n);
    	gamma = downsample(res2);
     
    	ircsprintf(result, "%X.%X.%X.IP", alpha, beta, gamma);
    	return result;
    }
     
    static char *hidehost_ipv6(char *host)
    {
    unsigned int a, b, c, d, e, f, g, h;
    static char buf[512], res[512], res2[512], result[128];
    unsigned long n;
    unsigned int alpha, beta, gamma;
     
    	/* 
    	 * Output: ALPHA:BETA:GAMMA:IP
    	 * ALPHA is unique for a:b:c:d:e:f:g:h
    	 * BETA  is unique for a:b:c:d:e:f:g
    	 * GAMMA is unique for a:b:c:d
    	 * We cloak like this:
    	 * ALPHA = downsample(md5(md5("KEY2:a:b:c:d:e:f:g:h:KEY3")+"KEY1"));
    	 * BETA  = downsample(md5(md5("KEY3:a:b:c:d:e:f:g:KEY1")+"KEY2"));
    	 * GAMMA = downsample(md5(md5("KEY1:a:b:c:d:KEY2")+"KEY3"));
    	 */
    	sscanf(host, "%x:%x:%x:%x:%x:%x:%x:%x",
    		&a, &b, &c, &d, &e, &f, &g, &h);
     
    	/* ALPHA... */
    	ircsprintf(buf, "%s:%s:%s", KEY2, host, KEY3);
    	DoMD5(res, buf, strlen(buf));
    	strcpy(res+16, KEY1); /* first 16 bytes are filled, append our key.. */
    	n = strlen(res+16) + 16;
    	DoMD5(res2, res, n);
    	alpha = downsample(res2);
     
    	/* BETA... */
    	ircsprintf(buf, "%s:%x:%x:%x:%x:%x:%x:%x:%s", KEY3, a, b, c, d, e, f, g, KEY1);
    	DoMD5(res, buf, strlen(buf));
    	strcpy(res+16, KEY2); /* first 16 bytes are filled, append our key.. */
    	n = strlen(res+16) + 16;
    	DoMD5(res2, res, n);
    	beta = downsample(res2);
     
    	/* GAMMA... */
    	ircsprintf(buf, "%s:%x:%x:%x:%x:%s", KEY1, a, b, c, d, KEY2);
    	DoMD5(res, buf, strlen(buf));
    	strcpy(res+16, KEY3); /* first 16 bytes are filled, append our key.. */
    	n = strlen(res+16) + 16;
    	DoMD5(res2, res, n);
    	gamma = downsample(res2);
     
    	ircsprintf(result, "%X:%X:%X:IP", alpha, beta, gamma);
    	return result;
    }
     
    static char *hidehost_normalhost(char *host)
    {
    char *p;
    static char buf[512], res[512], res2[512], result[HOSTLEN+1];
    unsigned int alpha, n;
     
    	ircsprintf(buf, "%s:%s:%s", KEY1, host, KEY2);
    	DoMD5(res, buf, strlen(buf));
    	strcpy(res+16, KEY3); /* first 16 bytes are filled, append our key.. */
    	n = strlen(res+16) + 16;
    	DoMD5(res2, res, n);
    	alpha = downsample(res2);
     
    	for (p = host; *p; p++)
    		if (*p == '.')
    			if (isalpha(*(p + 1)))
    				break;
     
    	if (*p)
    	{
    		unsigned int len;
    		p++;
    		ircsprintf(result, "%s-%X.", hidden_host, alpha);
    		len = strlen(result) + strlen(p);
    		if (len <= HOSTLEN)
    			strcat(result, p);
    		else
    			strcat(result, p + (len - HOSTLEN));
    	} else
    		ircsprintf(result,  "%s-%X", hidden_host, alpha);
     
    	return result;
    }
    Fichiers attachés Fichiers attachés
    • Type de fichier : c cloak.c (10,8 Ko, 132 affichages)

  2. #2
    Expert éminent sénior
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 67
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Points : 20 985
    Points
    20 985
    Par défaut
    Citation Envoyé par FloR3nT Voir le message
    je suis debutant dans la programmation en C, j'aimerai savoir comment faire pour modifier le crytage des hostname dans unrealircd de façon à faire comme celà:
    Si tu es débutant, ça me parait difficile. Ton code est incomplet :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
     
     
    -------------- Build: Debug in hello ---------------
     
    Compiling: main.c
    Linking console executable: bin\Debug\hello.exe
    C:\dev\hello\main.c:24:20: config.h: No such file or directory
    C:\dev\hello\main.c:25:20: struct.h: No such file or directory
    C:\dev\hello\main.c:26:20: common.h: No such file or directory
    C:\dev\hello\main.c:27:17: sys.h: No such file or directory
    C:\dev\hello\main.c:28:21: numeric.h: No such file or directory
    C:\dev\hello\main.c:29:17: msg.h: No such file or directory
    C:\dev\hello\main.c:30:21: channel.h: No such file or directory
    C:\dev\hello\main.c:40:15: h.h: No such file or directory
    C:\dev\hello\main.c:42:21: version.h: No such file or directory
    C:\dev\hello\main.c:56: error: syntax error before "char"
    C:\dev\hello\main.c:57: error: syntax error before "char"
    C:\dev\hello\main.c:57: warning: function declaration isn't a prototype
    C:\dev\hello\main.c:58: error: syntax error before "int"
    C:\dev\hello\main.c:58: error: syntax error before '*' token
    C:\dev\hello\main.c:58: warning: function declaration isn't a prototype
    C:\dev\hello\main.c:59: error: syntax error before "int"
    C:\dev\hello\main.c:59: error: syntax error before '*' token
    C:\dev\hello\main.c:59: warning: function declaration isn't a prototype
    C:\dev\hello\main.c:60: error: syntax error before "int"
    C:\dev\hello\main.c:65: error: syntax error before "unsigned"
    C:\dev\hello\main.c:67: error: syntax error before '*' token
    C:\dev\hello\main.c:67: warning: type defaults to `int' in declaration of `cloak'
    C:\dev\hello\main.c:67: warning: type defaults to `int' in declaration of `cloak_csum'
    C:\dev\hello\main.c:67: error: ISO C forbids data definition with no type or storage class
    C:\dev\hello\main.c:69: error: syntax error before "MOD_HEADER"
    C:\dev\hello\main.c:70: warning: type defaults to `int' in declaration of `MOD_HEADER'
    C:\dev\hello\main.c:70: warning: parameter names (without types) in function declaration
    C:\dev\hello\main.c:70: error: function `MOD_HEADER' is initialized like a variable
    C:\dev\hello\main.c:71: error: invalid initializer
    C:\dev\hello\main.c:71: error: (near initialization for `MOD_HEADER')
    C:\dev\hello\main.c:72: warning: excess elements in scalar initializer
    C:\dev\hello\main.c:72: warning: (near initialization for `MOD_HEADER')
    C:\dev\hello\main.c:73: warning: excess elements in scalar initializer
    C:\dev\hello\main.c:73: warning: (near initialization for `MOD_HEADER')
    C:\dev\hello\main.c:74: warning: excess elements in scalar initializer
    C:\dev\hello\main.c:74: warning: (near initialization for `MOD_HEADER')
    C:\dev\hello\main.c:76: warning: excess elements in scalar initializer
    C:\dev\hello\main.c:76: warning: (near initialization for `MOD_HEADER')
    C:\dev\hello\main.c:76: error: ISO C forbids data definition with no type or storage class
    C:\dev\hello\main.c:78: error: syntax error before "int"
    C:\dev\hello\main.c:78: error: syntax error before '*' token
    C:\dev\hello\main.c:79: warning: function declaration isn't a prototype
    C:\dev\hello\main.c:79: error: `MOD_TEST' declared as function returning a function
    C:\dev\hello\main.c:79: warning: function declaration isn't a prototype
    C:\dev\hello\main.c: In function `MOD_TEST':
    C:\dev\hello\main.c:79: warning: type of "cloak" defaults to "int"
    C:\dev\hello\main.c:80: warning: implicit declaration of function `CallbackAddPCharEx'
    C:\dev\hello\main.c:80: error: `modinfo' undeclared (first use in this function)
    C:\dev\hello\main.c:80: error: (Each undeclared identifier is reported only once
    C:\dev\hello\main.c:80: error: for each function it appears in.)
    C:\dev\hello\main.c:80: error: `CALLBACKTYPE_CLOAK' undeclared (first use in this function)
    C:\dev\hello\main.c:83: warning: implicit declaration of function `config_error'
    C:\dev\hello\main.c:84: error: `MOD_FAILED' undeclared (first use in this function)
    C:\dev\hello\main.c:86: error: `CALLBACKTYPE_CLOAKKEYCSUM' undeclared (first use in this function)
    C:\dev\hello\main.c:86: warning: assignment makes pointer from integer without a cast
    C:\dev\hello\main.c:92: warning: implicit declaration of function `HookAddEx'
    C:\dev\hello\main.c:92: error: `HOOKTYPE_CONFIGTEST' undeclared (first use in this function)
    C:\dev\hello\main.c:93: error: `HOOKTYPE_CONFIGPOSTTEST' undeclared (first use in this function)
    C:\dev\hello\main.c:94: error: `MOD_SUCCESS' undeclared (first use in this function)
    C:\dev\hello\main.c: At top level:
    C:\dev\hello\main.c:97: error: syntax error before "int"
    C:\dev\hello\main.c:97: error: syntax error before '*' token
    C:\dev\hello\main.c:98: warning: function declaration isn't a prototype
    C:\dev\hello\main.c:98: error: `MOD_INIT' declared as function returning a function
    C:\dev\hello\main.c:98: warning: function declaration isn't a prototype
    C:\dev\hello\main.c: In function `MOD_INIT':
    C:\dev\hello\main.c:98: warning: type of "cloak" defaults to "int"
    C:\dev\hello\main.c:99: warning: implicit declaration of function `MARK_AS_OFFICIAL_MODULE'
    C:\dev\hello\main.c:99: error: `modinfo' undeclared (first use in this function)
    C:\dev\hello\main.c:100: error: `HOOKTYPE_CONFIGRUN' undeclared (first use in this function)
    C:\dev\hello\main.c:101: error: `MOD_SUCCESS' undeclared (first use in this function)
    C:\dev\hello\main.c: At top level:
    C:\dev\hello\main.c:98: warning: unused parameter 'cloak'
    C:\dev\hello\main.c:104: error: syntax error before "int"
    C:\dev\hello\main.c:105: error: `MOD_LOAD' declared as function returning a function
    C:\dev\hello\main.c:105: warning: function declaration isn't a prototype
    C:\dev\hello\main.c: In function `MOD_LOAD':
    C:\dev\hello\main.c:105: warning: type of "cloak" defaults to "int"
    C:\dev\hello\main.c:106: error: `MOD_SUCCESS' undeclared (first use in this function)
    C:\dev\hello\main.c: At top level:
    C:\dev\hello\main.c:105: warning: unused parameter 'cloak'
    C:\dev\hello\main.c:109: error: syntax error before "int"
    C:\dev\hello\main.c:110: error: `MOD_UNLOAD' declared as function returning a function
    C:\dev\hello\main.c:110: warning: function declaration isn't a prototype
    C:\dev\hello\main.c: In function `MOD_UNLOAD':
    C:\dev\hello\main.c:110: warning: type of "cloak" defaults to "int"
    C:\dev\hello\main.c:113: warning: implicit declaration of function `MyFree'
    C:\dev\hello\main.c:117: error: `MOD_SUCCESS' undeclared (first use in this function)
    C:\dev\hello\main.c: At top level:
    C:\dev\hello\main.c:110: warning: unused parameter 'cloak'
    C:\dev\hello\main.c: In function `check_badrandomness':
    C:\dev\hello\main.c:125: warning: implicit declaration of function `islower'
    C:\dev\hello\main.c:127: warning: implicit declaration of function `isupper'
    C:\dev\hello\main.c:129: warning: implicit declaration of function `isdigit'
    C:\dev\hello\main.c: At top level:
    C:\dev\hello\main.c:138: error: syntax error before "int"
    C:\dev\hello\main.c:138: error: syntax error before '*' token
    Process terminated with status 1 (0 minutes, 1 seconds)
    50 errors, 37 warnings

  3. #3
    Futur Membre du Club
    Inscrit en
    Décembre 2008
    Messages
    12
    Détails du profil
    Informations forums :
    Inscription : Décembre 2008
    Messages : 12
    Points : 7
    Points
    7
    Par défaut
    Citation Envoyé par Emmanuel Delahaye Voir le message
    Si tu es débutant, ça me parait difficile. Ton code est incomplet :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
     
     
    -------------- Build: Debug in hello ---------------
     
    Compiling: main.c
    Linking console executable: bin\Debug\hello.exe
    C:\dev\hello\main.c:24:20: config.h: No such file or directory
    C:\dev\hello\main.c:25:20: struct.h: No such file or directory
    C:\dev\hello\main.c:26:20: common.h: No such file or directory
    C:\dev\hello\main.c:27:17: sys.h: No such file or directory
    C:\dev\hello\main.c:28:21: numeric.h: No such file or directory
    C:\dev\hello\main.c:29:17: msg.h: No such file or directory
    C:\dev\hello\main.c:30:21: channel.h: No such file or directory
    C:\dev\hello\main.c:40:15: h.h: No such file or directory
    C:\dev\hello\main.c:42:21: version.h: No such file or directory
    C:\dev\hello\main.c:56: error: syntax error before "char"
    C:\dev\hello\main.c:57: error: syntax error before "char"
    C:\dev\hello\main.c:57: warning: function declaration isn't a prototype
    C:\dev\hello\main.c:58: error: syntax error before "int"
    C:\dev\hello\main.c:58: error: syntax error before '*' token
    C:\dev\hello\main.c:58: warning: function declaration isn't a prototype
    C:\dev\hello\main.c:59: error: syntax error before "int"
    C:\dev\hello\main.c:59: error: syntax error before '*' token
    C:\dev\hello\main.c:59: warning: function declaration isn't a prototype
    C:\dev\hello\main.c:60: error: syntax error before "int"
    C:\dev\hello\main.c:65: error: syntax error before "unsigned"
    C:\dev\hello\main.c:67: error: syntax error before '*' token
    C:\dev\hello\main.c:67: warning: type defaults to `int' in declaration of `cloak'
    C:\dev\hello\main.c:67: warning: type defaults to `int' in declaration of `cloak_csum'
    C:\dev\hello\main.c:67: error: ISO C forbids data definition with no type or storage class
    C:\dev\hello\main.c:69: error: syntax error before "MOD_HEADER"
    C:\dev\hello\main.c:70: warning: type defaults to `int' in declaration of `MOD_HEADER'
    C:\dev\hello\main.c:70: warning: parameter names (without types) in function declaration
    C:\dev\hello\main.c:70: error: function `MOD_HEADER' is initialized like a variable
    C:\dev\hello\main.c:71: error: invalid initializer
    C:\dev\hello\main.c:71: error: (near initialization for `MOD_HEADER')
    C:\dev\hello\main.c:72: warning: excess elements in scalar initializer
    C:\dev\hello\main.c:72: warning: (near initialization for `MOD_HEADER')
    C:\dev\hello\main.c:73: warning: excess elements in scalar initializer
    C:\dev\hello\main.c:73: warning: (near initialization for `MOD_HEADER')
    C:\dev\hello\main.c:74: warning: excess elements in scalar initializer
    C:\dev\hello\main.c:74: warning: (near initialization for `MOD_HEADER')
    C:\dev\hello\main.c:76: warning: excess elements in scalar initializer
    C:\dev\hello\main.c:76: warning: (near initialization for `MOD_HEADER')
    C:\dev\hello\main.c:76: error: ISO C forbids data definition with no type or storage class
    C:\dev\hello\main.c:78: error: syntax error before "int"
    C:\dev\hello\main.c:78: error: syntax error before '*' token
    C:\dev\hello\main.c:79: warning: function declaration isn't a prototype
    C:\dev\hello\main.c:79: error: `MOD_TEST' declared as function returning a function
    C:\dev\hello\main.c:79: warning: function declaration isn't a prototype
    C:\dev\hello\main.c: In function `MOD_TEST':
    C:\dev\hello\main.c:79: warning: type of "cloak" defaults to "int"
    C:\dev\hello\main.c:80: warning: implicit declaration of function `CallbackAddPCharEx'
    C:\dev\hello\main.c:80: error: `modinfo' undeclared (first use in this function)
    C:\dev\hello\main.c:80: error: (Each undeclared identifier is reported only once
    C:\dev\hello\main.c:80: error: for each function it appears in.)
    C:\dev\hello\main.c:80: error: `CALLBACKTYPE_CLOAK' undeclared (first use in this function)
    C:\dev\hello\main.c:83: warning: implicit declaration of function `config_error'
    C:\dev\hello\main.c:84: error: `MOD_FAILED' undeclared (first use in this function)
    C:\dev\hello\main.c:86: error: `CALLBACKTYPE_CLOAKKEYCSUM' undeclared (first use in this function)
    C:\dev\hello\main.c:86: warning: assignment makes pointer from integer without a cast
    C:\dev\hello\main.c:92: warning: implicit declaration of function `HookAddEx'
    C:\dev\hello\main.c:92: error: `HOOKTYPE_CONFIGTEST' undeclared (first use in this function)
    C:\dev\hello\main.c:93: error: `HOOKTYPE_CONFIGPOSTTEST' undeclared (first use in this function)
    C:\dev\hello\main.c:94: error: `MOD_SUCCESS' undeclared (first use in this function)
    C:\dev\hello\main.c: At top level:
    C:\dev\hello\main.c:97: error: syntax error before "int"
    C:\dev\hello\main.c:97: error: syntax error before '*' token
    C:\dev\hello\main.c:98: warning: function declaration isn't a prototype
    C:\dev\hello\main.c:98: error: `MOD_INIT' declared as function returning a function
    C:\dev\hello\main.c:98: warning: function declaration isn't a prototype
    C:\dev\hello\main.c: In function `MOD_INIT':
    C:\dev\hello\main.c:98: warning: type of "cloak" defaults to "int"
    C:\dev\hello\main.c:99: warning: implicit declaration of function `MARK_AS_OFFICIAL_MODULE'
    C:\dev\hello\main.c:99: error: `modinfo' undeclared (first use in this function)
    C:\dev\hello\main.c:100: error: `HOOKTYPE_CONFIGRUN' undeclared (first use in this function)
    C:\dev\hello\main.c:101: error: `MOD_SUCCESS' undeclared (first use in this function)
    C:\dev\hello\main.c: At top level:
    C:\dev\hello\main.c:98: warning: unused parameter 'cloak'
    C:\dev\hello\main.c:104: error: syntax error before "int"
    C:\dev\hello\main.c:105: error: `MOD_LOAD' declared as function returning a function
    C:\dev\hello\main.c:105: warning: function declaration isn't a prototype
    C:\dev\hello\main.c: In function `MOD_LOAD':
    C:\dev\hello\main.c:105: warning: type of "cloak" defaults to "int"
    C:\dev\hello\main.c:106: error: `MOD_SUCCESS' undeclared (first use in this function)
    C:\dev\hello\main.c: At top level:
    C:\dev\hello\main.c:105: warning: unused parameter 'cloak'
    C:\dev\hello\main.c:109: error: syntax error before "int"
    C:\dev\hello\main.c:110: error: `MOD_UNLOAD' declared as function returning a function
    C:\dev\hello\main.c:110: warning: function declaration isn't a prototype
    C:\dev\hello\main.c: In function `MOD_UNLOAD':
    C:\dev\hello\main.c:110: warning: type of "cloak" defaults to "int"
    C:\dev\hello\main.c:113: warning: implicit declaration of function `MyFree'
    C:\dev\hello\main.c:117: error: `MOD_SUCCESS' undeclared (first use in this function)
    C:\dev\hello\main.c: At top level:
    C:\dev\hello\main.c:110: warning: unused parameter 'cloak'
    C:\dev\hello\main.c: In function `check_badrandomness':
    C:\dev\hello\main.c:125: warning: implicit declaration of function `islower'
    C:\dev\hello\main.c:127: warning: implicit declaration of function `isupper'
    C:\dev\hello\main.c:129: warning: implicit declaration of function `isdigit'
    C:\dev\hello\main.c: At top level:
    C:\dev\hello\main.c:138: error: syntax error before "int"
    C:\dev\hello\main.c:138: error: syntax error before '*' token
    Process terminated with status 1 (0 minutes, 1 seconds)
    50 errors, 37 warnings
    Normal que tu obtiens ce genre d'erreur vu que c'est un codage pour un serveur ircd, je voudrai juste arrive à le modifier en sorte que sa change les cryptage mais je ne sais pas comment faire, ce codage fonctionne avec un module md5, mais le souci c'est pas le codage vu que c'est l'original...
    Moi je voudrai le modifier en sorte de le rendre plus jolie... si tu vois ce que je veux dire

    Merci

    Cordialement Florent

Discussions similaires

  1. Réponses: 1
    Dernier message: 01/07/2009, 16h12
  2. les modifications ne sont pas appliquées sur la table
    Par tomy_libre dans le forum Bases de données
    Réponses: 1
    Dernier message: 17/06/2009, 10h07
  3. [POO] Modif value champ suite clic sur un autre
    Par hari37 dans le forum Général JavaScript
    Réponses: 8
    Dernier message: 05/11/2008, 10h11
  4. modification en ligne du texte sur un site
    Par jofox59 dans le forum Langage
    Réponses: 2
    Dernier message: 31/07/2006, 10h45

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo