Advertisement
Guest User

BanList V1.1 By Brian Turner

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