Advertisement
Guest User

BanList By Brian Turner

a guest
Oct 28th, 2011
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 19.64 KB | None | 0 0
  1. // BANLIST BY BRIAN TURNER VERSION 1
  2. // Licence Creative Commons
  3.  
  4. #include <a_samp>
  5. #include <a_http>
  6. #include <utils.inc>
  7.  
  8. #define LOGIN "yourlogin" // FOR CREATE ACCOUNT GO: cmva.mtxserv.fr
  9. #define PASS "yourpass"
  10.  
  11. #define MAX_PLAYER_IP 15 // NOT TOUCH
  12. #define BANLIST "cmva.mtxserv.fr/banlist.php" // NOT TOUCH
  13.  
  14. forward ConnectBanList(login[], password[]);
  15. forward FonctionBanList(index, response_code, data[]);
  16. forward IsPlayerBan(playerid);
  17.  
  18. new Key[128];
  19. new comm = 0;
  20.  
  21. public IsPlayerBan(playerid)
  22. {
  23.     new IP[MAX_PLAYER_IP]; new Name[MAX_PLAYER_NAME];
  24.     GetPlayerIp(playerid, IP, MAX_PLAYER_IP);
  25.     GetPlayerName(playerid, Name, sizeof(Name));
  26.     new string[128];
  27.     format(string, sizeof(string),"action=isban&key=%s&name=%s&ip=%s",Key,Name,IP);
  28.     HTTP(playerid, HTTP_POST, BANLIST, string, "FonctionBanList");
  29. }
  30.  
  31. public ConnectBanList(login[], password[])
  32. {
  33.     new string[128];
  34.     format(string, sizeof(string), "action=connectbl&login=%s&pass=%s",login,MD5_Hash(password));
  35.     if(HTTP(1, HTTP_POST, BANLIST, string, "FonctionBanList"))
  36.     {
  37.         printf("BANLIST: CONNECTION AT %s",login);
  38.     }
  39. }
  40.  
  41. public FonctionBanList(index, response_code, data[])
  42. {
  43.     if(response_code == 200)
  44.     {
  45.         if(comm == 0)
  46.         {
  47.             print("BANLIST: COMMUNICATION OK");
  48.         }
  49.         if(strcmp(data,"c0nn3ct3d",true) == 0)
  50.         {
  51.             comm = 1;
  52.             print("BANLIST: CONNECTED, SEARCH KEY...");
  53.             HTTP(1, HTTP_POST, BANLIST, "action=connectbl&login="#LOGIN"&et=key", "FonctionBanList");
  54.             return 1;
  55.         }
  56.         if(strfind(data, "BLBT", true) == 0)
  57.         {
  58.             format(Key, sizeof(Key), "%s", data);
  59.             printf("BANLIST: KEY FIND: %s",data);
  60.             return 1;
  61.         }
  62.         if(strfind(data, "ERROR ID", true) == 0)
  63.         {
  64.             printf("BANLIST: %s",data);
  65.         }
  66.         if(strcmp(data,"NOTBANN3D",true) == 0)
  67.         {
  68.             return 1;
  69.         }
  70.         if(strfind(data, "ERROR ID", true) == 0)
  71.         {
  72.             printf("BANLIST: %s",data);
  73.             return 1;
  74.         }
  75.         if(strcmp(data, "BANNED", true) == 0)
  76.         {
  77.             printf("BANLIST: Player %d kick: black listed", index);
  78.             SendClientMessage(index, 0xAA3333AA, "You are in the black list of banned SAMP SERVER.");
  79.             SendClientMessage(index, 0xAA3333AA, "Vous êtes dans la black list des bannis des serveurs SAMP.");
  80.             Kick(index);
  81.             return 1;
  82.         }
  83.         if(strcmp(data,"",true) == 0)
  84.         {
  85.             printf("BANLIST: %s",data);
  86.             return 1;
  87.         }
  88.     }
  89.     else
  90.     {
  91.         printf("BANLIST: ERROR COMMUNICATION %d", response_code);
  92.     }
  93.     return 1;
  94. }
  95. public OnFilterScriptInit()
  96. {
  97.     print("\n--------------------------------------");
  98.     print(" BanList By Brian Turner");
  99.     print("--------------------------------------\n");
  100.     ConnectBanList(LOGIN, PASS);
  101.     return 1;
  102. }
  103.  
  104. public OnFilterScriptExit()
  105. {
  106.     return 1;
  107. }
  108.  
  109.  
  110. public OnPlayerConnect(playerid)
  111. {
  112.     IsPlayerBan(playerid);
  113.     return 1;
  114. }
  115.  
  116. public OnPlayerCommandText(playerid, cmdtext[])
  117. {
  118.     new cmd[256];
  119.     new tmp[256];
  120.     new idx;
  121.     cmd = strtok(cmdtext, idx);
  122.     if(strcmp(cmd, "/blban", true) == 0)
  123.     {
  124.         if(IsPlayerConnected(playerid))
  125.         {
  126.             if(IsPlayerAdmin(playerid))
  127.             {
  128.                 tmp = strtok(cmdtext, idx);
  129.                 if(!strlen(tmp))
  130.                 {
  131.                     SendClientMessage(playerid, 0xAA3333AA, "CMD: /blban [playerid/pseudo]");
  132.                     return 1;
  133.                 }
  134.                 new giveplayerid = ReturnUser(tmp);
  135.                 new IP[MAX_PLAYER_IP]; new Name[MAX_PLAYER_NAME];
  136.                 GetPlayerIp(giveplayerid, IP, MAX_PLAYER_IP);
  137.                 GetPlayerName(giveplayerid, Name, sizeof(Name));
  138.                 new string[256];
  139.                 format(string, sizeof(string),"action=ban&key=%s&name=%s&ip=%s",Key,Name,IP);
  140.                 HTTP(giveplayerid, HTTP_POST, BANLIST, string, "FonctionBanList");
  141.                 format(string, sizeof(string), "BANLIST: You banned ID %s (%d) - IP: %s. And add his name and IP to the ban list(black list).", Name, giveplayerid, IP);
  142.                 SendClientMessage(playerid, 0xAA3333AA, string);
  143.                 format(string, sizeof(string), "BANLIST: Vous avez banni ID %s (%d) - IP: %s. Et vous l'avez ajouté a la ban list(black list).", Name, giveplayerid, IP);
  144.                 SendClientMessage(playerid, 0xAA3333AA, string);
  145.                 Kick(giveplayerid);
  146.             }
  147.             else
  148.             {
  149.                 SendClientMessage(playerid, 0xAA3333AA, "BANLIST: You are not admin");
  150.                 SendClientMessage(playerid, 0xAA3333AA, "BANLIST: Vous n'êtes pas admin");
  151.             }
  152.         }
  153.         return 1;
  154.     }
  155.     if(strcmp(cmd, "/blunban", true) == 0)
  156.     {
  157.         if(IsPlayerConnected(playerid))
  158.         {
  159.             if(IsPlayerAdmin(playerid))
  160.             {
  161.                 tmp = strtok(cmdtext, idx);
  162.                 if(!strlen(tmp))
  163.                 {
  164.                     SendClientMessage(playerid, 0xAA3333AA, "CMD: /unblban [IP]");
  165.                     return 1;
  166.                 }
  167.                 new string[256];
  168.                 format(string, sizeof(string),"action=unban&key=%s&ip=%s",Key,tmp);
  169.                 HTTP(1, HTTP_POST, BANLIST, string, "FonctionBanList");
  170.                 format(string, sizeof(string), "BANLIST: You unbanned IP %s. And remove his name and IP to the ban list(black list).", tmp);
  171.                 SendClientMessage(playerid, 0xAA3333AA, string);
  172.                 format(string, sizeof(string), "BANLIST: Vous avez debanni l'IP %s. Et vous l'avez supprimé de la ban list(black list).", tmp);
  173.                 SendClientMessage(playerid, 0xAA3333AA, string);
  174.             }
  175.             else
  176.             {
  177.                 SendClientMessage(playerid, 0xAA3333AA, "BANLIST: You are not admin");
  178.                 SendClientMessage(playerid, 0xAA3333AA, "BANLIST: Vous n'êtes pas admin");
  179.             }
  180.         }
  181.         return 1;
  182.     }
  183.     return 0;
  184. }
  185.  
  186. strtok(const string[], &index)
  187. {
  188.     new length = strlen(string);
  189.     while ((index < length) && (string[index] <= ' '))
  190.     {
  191.         index++;
  192.     }
  193.     new offset = index;
  194.     new result[20];
  195.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  196.     {
  197.         result[index - offset] = string[index];
  198.         index++;
  199.     }
  200.     result[index - offset] = EOS;
  201.     return result;
  202. }
  203. /*----------------------------------------------------------------------------*-
  204.                     ===========================
  205.                     Y Sever Includes - MD5 Core
  206.                     ===========================
  207. Description:
  208.     Provides an implementation of the MD5 hashing algorithmfor PAWN, either for
  209.     efficient and progressive hashing of chunks of data or just a straight hash
  210.     of a single string.
  211. Legal:
  212.     The algorithm is due to Ron Rivest.  This code was
  213.     written by Colin Plumb in 1993, no copyright is claimed.
  214.     This code is in the public domain; do with it what you wish.
  215.  
  216.     Equivalent code is available from RSA Data Security, Inc.
  217.     This code has been tested against that, and is equivalent,
  218.     except that you don't need to include two pages of legalese
  219.     with every copy.
  220.  
  221.     Converted to PAWN by Alex "Y_Less" Cole.
  222. Version:
  223.     0.1
  224. Changelog:
  225.     26/12/07:
  226.         First version.
  227. Functions:
  228.     Public:
  229.         -
  230.     Core:
  231.         -
  232.     Stock:
  233.         MD5_Hash - Takes a string and returns a 16 cell hash.
  234.         MD5_Init - Initialises a hash structure.
  235.         MD5_Update - Appends data to the hash in progress.
  236.         MD5_Copy - Custom pack function.
  237.         MD5_Final - Finalises a hash.
  238.         MD5_File - Hashes a file incrementally.
  239.         MD5_Data - Hashes binary data, not just strings.
  240.     Static:
  241.         MD5_Transform - Does the data mixing.
  242.     Inline:
  243.         MD5_Step - Does a single hash step.
  244.     API:
  245.         -
  246. Callbacks:
  247.     -
  248. Definitions:
  249.     -
  250. Enums:
  251.     E_MD5_CONTEXT - Data structure for an in progress hashing.
  252. Macros:
  253.     MD5_F1 - First hash part.
  254.     MD5_F2 - Second hash part.
  255.     MD5_F3 - Third hash part.
  256.     MD5_F4 - Fourth hash part.
  257. Tags:
  258.     -
  259. Variables:
  260.     Global:
  261.         -
  262.     Static:
  263.         -
  264. Commands:
  265.     -
  266. Compile options:
  267.     -
  268. -*----------------------------------------------------------------------------*/
  269.  
  270. enum E_MD5_CONTEXT
  271. {
  272.     E_MD5_CONTEXT_BUF[4],
  273.     E_MD5_CONTEXT_BITS[2],
  274.     E_MD5_CONTEXT_IN[64 char]
  275. }
  276.  
  277. #define MD5_F1(%1,%2,%3) (%3 ^ (%1 & (%2 ^ %3)))
  278. #define MD5_F2(%1,%2,%3) MD5_F1(%3, %1, %2)
  279. #define MD5_F3(%1,%2,%3) (%1 ^ %2 ^ %3)
  280. #define MD5_F4(%1,%2,%3) (%2 ^ (%1 | ~%3))
  281.  
  282. /*----------------------------------------------------------------------------*-
  283. Function:
  284.     MD5_Hash
  285. Params:
  286.     str[] - String to hash.
  287. Return:
  288.     String representation of the hash.
  289. Notes:
  290.     The simplest way to hash a string, simply pass a string and get a 4 cell
  291.     hash returned.
  292. -*----------------------------------------------------------------------------*/
  293.  
  294. stock MD5_Hash(str[])
  295. {
  296.     new
  297.         md5Data[E_MD5_CONTEXT],
  298.         done,
  299.         digest[34],
  300.         len = strlen(str);
  301.     MD5_Init(md5Data);
  302.     len -= 64;
  303.     while (done < len)
  304.     {
  305.         MD5_Update(md5Data, str[done], 64);
  306.         done += 64;
  307.     }
  308.     len = (len + 64) - done;
  309.     if (len)
  310.     {
  311.         MD5_Update(md5Data, str[done], len);
  312.     }
  313.     digest = MD5_Final(md5Data, true);
  314.     return digest;
  315. }
  316.  
  317. /*----------------------------------------------------------------------------*-
  318. Function:
  319.     MD5_Data
  320. Params:
  321.     data[] - Binary data to hash.
  322.     len - Length of data to hash.
  323. Return:
  324.     String representation of the hash.
  325. Notes:
  326.     Hashes binary data, not just strings.
  327. -*----------------------------------------------------------------------------*/
  328.  
  329. stock MD5_Data(data[], len)
  330. {
  331.     new
  332.         md5Data[E_MD5_CONTEXT],
  333.         done,
  334.         digest[33];
  335.     MD5_Init(md5Data);
  336.     len -= 64;
  337.     while (done < len)
  338.     {
  339.         MD5_Update(md5Data, data[done], 64);
  340.         done += 64;
  341.     }
  342.     len = (len + 64) - done;
  343.     if (len)
  344.     {
  345.         MD5_Update(md5Data, data[done], len);
  346.     }
  347.     digest = MD5_Final(md5Data, true);
  348.     return digest;
  349. }
  350.  
  351. /*----------------------------------------------------------------------------*-
  352. Function:
  353.     MD5_File
  354. Params:
  355.     filename[] - File to hash.
  356. Return:
  357.     -
  358. Notes:
  359.     Hashes the file incrementally, not in one huge chunk.
  360. -*----------------------------------------------------------------------------*/
  361.  
  362. stock MD5_File(filename[])
  363. {
  364.  
  365.     new
  366.         digest[33],
  367.         File:fHnd = fopen(filename, io_read);
  368.     if (fHnd)
  369.     {
  370.         new
  371.             md5Data[E_MD5_CONTEXT],
  372.             data[64],
  373.             len;
  374.         MD5_Init(md5Data);
  375.         MD5_File_loop:
  376.         len = fblockread(fHnd, data);
  377.         if (len)
  378.         {
  379.             MD5_Update(md5Data, data, len);
  380.             goto MD5_File_loop;
  381.         }
  382.         digest = MD5_Final(md5Data, true);
  383.         fclose(fHnd);
  384.     }
  385.     return digest;
  386. }
  387.  
  388. /*----------------------------------------------------------------------------*-
  389. Function:
  390.     MD5_Init
  391. Params:
  392.     ctx[E_MD5_CONTEXT] - Hash data.
  393. Return:
  394.     -
  395. Notes:
  396.     Sets up the data for hashing.
  397. -*----------------------------------------------------------------------------*/
  398.  
  399. stock MD5_Init(ctx[E_MD5_CONTEXT])
  400. {
  401.     ctx[E_MD5_CONTEXT_BUF][0] = 0x67452301;
  402.     ctx[E_MD5_CONTEXT_BUF][1] = 0xEFCDAB89;
  403.     ctx[E_MD5_CONTEXT_BUF][2] = 0x98BADCFE;
  404.     ctx[E_MD5_CONTEXT_BUF][3] = 0x10325476;
  405.     ctx[E_MD5_CONTEXT_BITS][0] = 0;
  406.     ctx[E_MD5_CONTEXT_BITS][1] = 0;
  407. }
  408.  
  409. /*----------------------------------------------------------------------------*-
  410. Function:
  411.     MD5_Update
  412. Params:
  413.     ctx[E_MD5_CONTEXT] - Hash data.
  414.     data[] - String to append.
  415.     len - Length of string to append.
  416. Return:
  417.     -
  418. Notes:
  419.     Adds data to the current hash.
  420. -*----------------------------------------------------------------------------*/
  421.  
  422. stock MD5_Update(ctx[E_MD5_CONTEXT], data[], len)
  423. {
  424.     new
  425.         t = ctx[E_MD5_CONTEXT_BITS][0],
  426.         s,
  427.         buf = 0;
  428.     if ((ctx[E_MD5_CONTEXT_BITS][0] = t + (len << 3)) < t)
  429.     {
  430.         ctx[E_MD5_CONTEXT_BITS][1]++;
  431.     }
  432.     ctx[E_MD5_CONTEXT_BITS][1] += len >>> 29;
  433.     t = (t >>> 3) & 0x3F;
  434.     if (t)
  435.     {
  436.         s = 64 - t;
  437.         if (len < s)
  438.         {
  439.             MD5_Copy(ctx[E_MD5_CONTEXT_IN], data, t, len);
  440.             return;
  441.         }
  442.         MD5_Copy(ctx[E_MD5_CONTEXT_IN], data, t, s);
  443.         MD5_Transform(ctx[E_MD5_CONTEXT_BUF], ctx[E_MD5_CONTEXT_IN]);
  444.         buf += s;
  445.         len -= s;
  446.     }
  447.     while (len >= 64)
  448.     {
  449.         MD5_Copy(ctx[E_MD5_CONTEXT_IN], data[buf], 0, 64);
  450.         MD5_Transform(ctx[E_MD5_CONTEXT_BUF], ctx[E_MD5_CONTEXT_IN]);
  451.         buf += 64;
  452.         len -= 64;
  453.     }
  454.     MD5_Copy(ctx[E_MD5_CONTEXT_IN], data[buf], 0, len);
  455. }
  456.  
  457. /*----------------------------------------------------------------------------*-
  458. Function:
  459.     MD5_Copy
  460. Params:
  461.     dest[] - Packed destination array.
  462.     src[] - Unpacked source array.
  463.     start - Start BYTE in the dest array.
  464.     len - Length of data to copy.
  465. Return:
  466.     -
  467. Notes:
  468.     Custom strpack implementation allowing offset starts.
  469. -*----------------------------------------------------------------------------*/
  470.  
  471. stock MD5_Copy(dest[], src[], start, len)
  472. {
  473.     new
  474.         i = start >>> 2,
  475.         j = 0,
  476.         ch;
  477.     while (j < len)
  478.     {
  479.         ch = src[j++] & 0xFF;
  480.         switch (start++ & 0x03)
  481.         {
  482.             case 0:
  483.             {
  484.                 dest[i] = ch;
  485.             }
  486.             case 1:
  487.             {
  488.                 dest[i] |= ch << 8;
  489.             }
  490.             case 2:
  491.             {
  492.                 dest[i] |= ch << 16;
  493.             }
  494.             case 3:
  495.             {
  496.                 dest[i++] |= ch << 24;
  497.             }
  498.         }
  499.     }
  500. }
  501.  
  502. /*----------------------------------------------------------------------------*-
  503. Function:
  504.     MD5_Final
  505. Params:
  506.     ctx[E_MD5_CONTEXT] - Hash data.
  507.     string - Wehter or not to create a string version of the hash.
  508. Return:
  509.     -
  510. Notes:
  511.     Terminates the pending data, appends the length and finishes hashing.
  512. -*----------------------------------------------------------------------------*/
  513.  
  514. stock MD5_Final(ctx[E_MD5_CONTEXT], string = false)
  515. {
  516.     new
  517.         count,
  518.         index,
  519.         digest[33];
  520.     count = (ctx[E_MD5_CONTEXT_BITS][0] >>> 3) & 0x3F;
  521.     if (!(count & 0x03))
  522.     {
  523.         ctx[E_MD5_CONTEXT_IN][count / 4] = 0;
  524.     }
  525.     ctx[E_MD5_CONTEXT_IN][count / 4] |= (0x80 << (8 * (count & 0x03)));
  526.     index = (count / 4) + 1;
  527.     count = 64 - 1 - count;
  528.     if (count < 8)
  529.     {
  530.         while (index < 64 char)
  531.         {
  532.             ctx[E_MD5_CONTEXT_IN][index++] = 0;
  533.         }
  534.         MD5_Transform(ctx[E_MD5_CONTEXT_BUF], ctx[E_MD5_CONTEXT_IN]);
  535.         index = 0;
  536.         while (index < 56 char)
  537.         {
  538.             ctx[E_MD5_CONTEXT_IN][index++] = 0;
  539.         }
  540.     }
  541.     else
  542.     {
  543.         while (index < 56 char)
  544.         {
  545.             ctx[E_MD5_CONTEXT_IN][index++] = 0;
  546.         }
  547.     }
  548.     ctx[E_MD5_CONTEXT_IN][14] = ctx[E_MD5_CONTEXT_BITS][0];
  549.     ctx[E_MD5_CONTEXT_IN][15] = ctx[E_MD5_CONTEXT_BITS][1];
  550.     MD5_Transform(ctx[E_MD5_CONTEXT_BUF], ctx[E_MD5_CONTEXT_IN]);
  551.     if (string)
  552.     {
  553.         index = 0;
  554.         do
  555.         {
  556.             format(digest, sizeof (digest), "%s%02x", digest, (ctx[E_MD5_CONTEXT_BUF][index / 4] >> ((index & 0x03) * 8)) & 0xFF);
  557.         }
  558.         while (++index < 16);
  559.     }
  560.     return digest;
  561. }
  562.  
  563. /*----------------------------------------------------------------------------*-
  564. Function:
  565.     MD5_Step
  566. Params:
  567.     func - Hash function to use.
  568.     a - Data cell 1.
  569.     b - Data cell 2.
  570.     c - Data cell 3.
  571.     d - Data cell 4.
  572.     data - New input.
  573.     s - Seed.
  574. Return:
  575.     -
  576. Notes:
  577.     Does a single hash step.
  578. -*----------------------------------------------------------------------------*/
  579.  
  580. #define MD5_Step(%1,%2,%3,%4,%5,%6,%7) \
  581.     %2 += %1(%3, %4, %5) + %6, %2 = %2 << %7 | %2 >>> (32 - %7), %2 += %3
  582.  
  583. /*----------------------------------------------------------------------------*-
  584. Function:
  585.     MD5_Transform
  586. Params:
  587.     buf[] - Current hash.
  588.     in[] - New data.
  589. Return:
  590.     -
  591. Notes:
  592.     Does the hashing steps on the current data.
  593. -*----------------------------------------------------------------------------*/
  594.  
  595. static stock MD5_Transform(buf[], in[])
  596. {
  597.     new
  598.         a = buf[0],
  599.         b = buf[1],
  600.         c = buf[2],
  601.         d = buf[3];
  602.     #pragma tabsize 4
  603.     MD5_Step(MD5_F1, a, b, c, d, in[0]  + 0xD76AA478, 7);
  604.     MD5_Step(MD5_F1, d, a, b, c, in[1]  + 0xE8C7B756, 12);
  605.     MD5_Step(MD5_F1, c, d, a, b, in[2]  + 0x242070DB, 17);
  606.     MD5_Step(MD5_F1, b, c, d, a, in[3]  + 0xC1BDCEEE, 22);
  607.     MD5_Step(MD5_F1, a, b, c, d, in[4]  + 0xF57C0FAF, 7);
  608.     MD5_Step(MD5_F1, d, a, b, c, in[5]  + 0x4787C62A, 12);
  609.     MD5_Step(MD5_F1, c, d, a, b, in[6]  + 0xA8304613, 17);
  610.     MD5_Step(MD5_F1, b, c, d, a, in[7]  + 0xFD469501, 22);
  611.     MD5_Step(MD5_F1, a, b, c, d, in[8]  + 0x698098D8, 7);
  612.     MD5_Step(MD5_F1, d, a, b, c, in[9]  + 0x8B44F7AF, 12);
  613.     MD5_Step(MD5_F1, c, d, a, b, in[10] + 0xFFFF5BB1, 17);
  614.     MD5_Step(MD5_F1, b, c, d, a, in[11] + 0x895CD7BE, 22);
  615.     MD5_Step(MD5_F1, a, b, c, d, in[12] + 0x6B901122, 7);
  616.     MD5_Step(MD5_F1, d, a, b, c, in[13] + 0xFD987193, 12);
  617.     MD5_Step(MD5_F1, c, d, a, b, in[14] + 0xA679438E, 17);
  618.     MD5_Step(MD5_F1, b, c, d, a, in[15] + 0x49B40821, 22);
  619.     MD5_Step(MD5_F2, a, b, c, d, in[1]  + 0xF61E2562, 5);
  620.     MD5_Step(MD5_F2, d, a, b, c, in[6]  + 0xC040B340, 9);
  621.     MD5_Step(MD5_F2, c, d, a, b, in[11] + 0x265E5A51, 14);
  622.     MD5_Step(MD5_F2, b, c, d, a, in[0]  + 0xE9B6C7AA, 20);
  623.     MD5_Step(MD5_F2, a, b, c, d, in[5]  + 0xD62F105D, 5);
  624.     MD5_Step(MD5_F2, d, a, b, c, in[10] + 0x02441453, 9);
  625.     MD5_Step(MD5_F2, c, d, a, b, in[15] + 0xD8A1E681, 14);
  626.     MD5_Step(MD5_F2, b, c, d, a, in[4]  + 0xE7D3FBC8, 20);
  627.     MD5_Step(MD5_F2, a, b, c, d, in[9]  + 0x21E1CDE6, 5);
  628.     MD5_Step(MD5_F2, d, a, b, c, in[14] + 0xC33707D6, 9);
  629.     MD5_Step(MD5_F2, c, d, a, b, in[3]  + 0xF4D50D87, 14);
  630.     MD5_Step(MD5_F2, b, c, d, a, in[8]  + 0x455A14ED, 20);
  631.     MD5_Step(MD5_F2, a, b, c, d, in[13] + 0xA9E3E905, 5);
  632.     MD5_Step(MD5_F2, d, a, b, c, in[2]  + 0xFCEFA3F8, 9);
  633.     MD5_Step(MD5_F2, c, d, a, b, in[7]  + 0x676F02D9, 14);
  634.     MD5_Step(MD5_F2, b, c, d, a, in[12] + 0x8D2A4C8A, 20);
  635.     MD5_Step(MD5_F3, a, b, c, d, in[5]  + 0xFFFA3942, 4);
  636.     MD5_Step(MD5_F3, d, a, b, c, in[8]  + 0x8771F681, 11);
  637.     MD5_Step(MD5_F3, c, d, a, b, in[11] + 0x6D9D6122, 16);
  638.     MD5_Step(MD5_F3, b, c, d, a, in[14] + 0xFDE5380C, 23);
  639.     MD5_Step(MD5_F3, a, b, c, d, in[1]  + 0xA4BEEA44, 4);
  640.     MD5_Step(MD5_F3, d, a, b, c, in[4]  + 0x4BDECFA9, 11);
  641.     MD5_Step(MD5_F3, c, d, a, b, in[7]  + 0xF6BB4B60, 16);
  642.     MD5_Step(MD5_F3, b, c, d, a, in[10] + 0xBEBFBC70, 23);
  643.     MD5_Step(MD5_F3, a, b, c, d, in[13] + 0x289B7EC6, 4);
  644.     MD5_Step(MD5_F3, d, a, b, c, in[0]  + 0xEAA127FA, 11);
  645.     MD5_Step(MD5_F3, c, d, a, b, in[3]  + 0xD4EF3085, 16);
  646.     MD5_Step(MD5_F3, b, c, d, a, in[6]  + 0x04881D05, 23);
  647.     MD5_Step(MD5_F3, a, b, c, d, in[9]  + 0xD9D4D039, 4);
  648.     MD5_Step(MD5_F3, d, a, b, c, in[12] + 0xE6DB99E5, 11);
  649.     MD5_Step(MD5_F3, c, d, a, b, in[15] + 0x1FA27CF8, 16);
  650.     MD5_Step(MD5_F3, b, c, d, a, in[2]  + 0xC4AC5665, 23);
  651.     MD5_Step(MD5_F4, a, b, c, d, in[0]  + 0xF4292244, 6);
  652.     MD5_Step(MD5_F4, d, a, b, c, in[7]  + 0x432AFF97, 10);
  653.     MD5_Step(MD5_F4, c, d, a, b, in[14] + 0xAB9423A7, 15);
  654.     MD5_Step(MD5_F4, b, c, d, a, in[5]  + 0xFC93A039, 21);
  655.     MD5_Step(MD5_F4, a, b, c, d, in[12] + 0x655B59C3, 6);
  656.     MD5_Step(MD5_F4, d, a, b, c, in[3]  + 0x8F0CCC92, 10);
  657.     MD5_Step(MD5_F4, c, d, a, b, in[10] + 0xFFEFF47D, 15);
  658.     MD5_Step(MD5_F4, b, c, d, a, in[1]  + 0x85845DD1, 21);
  659.     MD5_Step(MD5_F4, a, b, c, d, in[8]  + 0x6FA87E4F, 6);
  660.     MD5_Step(MD5_F4, d, a, b, c, in[15] + 0xFE2CE6E0, 10);
  661.     MD5_Step(MD5_F4, c, d, a, b, in[6]  + 0xA3014314, 15);
  662.     MD5_Step(MD5_F4, b, c, d, a, in[13] + 0x4E0811A1, 21);
  663.     MD5_Step(MD5_F4, a, b, c, d, in[4]  + 0xF7537E82, 6);
  664.     MD5_Step(MD5_F4, d, a, b, c, in[11] + 0xBD3AF235, 10);
  665.     MD5_Step(MD5_F4, c, d, a, b, in[2]  + 0x2AD7D2BB, 15);
  666.     MD5_Step(MD5_F4, b, c, d, a, in[9]  + 0xEB86D391, 21);
  667.     #pragma tabsize 4
  668.     buf[0] += a;
  669.     buf[1] += b;
  670.     buf[2] += c;
  671.     buf[3] += d;
  672. }
  673.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement