patch-src_airbase-ng_c 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- aircrack-ng-1.0-rc3.orig/src/airbase-ng.c 2009-03-26 22:01:02.000000000 +0100
  3. +++ aircrack-ng-1.0-rc3/src/airbase-ng.c 2009-05-01 15:54:30.000000000 +0200
  4. @@ -627,7 +627,7 @@ int addFrag(unsigned char* packet, unsig
  5. if(rFragment == NULL)
  6. return -1;
  7. - bzero(frame, 4096);
  8. + memset(frame, 0, 4096);
  9. memcpy(frame, packet, len);
  10. z = ( ( frame[1] & 3 ) != 3 ) ? 24 : 30;
  11. @@ -1683,7 +1683,7 @@ int intercept(uchar* packet, int length)
  12. uchar K[128];
  13. int z=0;
  14. - bzero(buf, 4096);
  15. + memset(buf, 0, 4096);
  16. z = ( ( packet[1] & 3 ) != 3 ) ? 24 : 30;
  17. @@ -1784,7 +1784,7 @@ int packet_xmit(uchar* packet, int lengt
  18. if((opt.external & EXT_OUT))
  19. {
  20. - bzero(buf, 4096);
  21. + memset(buf, 0, 4096);
  22. memcpy(buf+14, h80211, length2);
  23. //mark it as outgoing packet
  24. buf[12] = 0xFF;
  25. @@ -1823,7 +1823,7 @@ int packet_xmit_external(uchar* packet,
  26. if(length < 40 || length > 3000)
  27. return 1;
  28. - bzero(buf, 4096);
  29. + memset(buf, 0, 4096);
  30. if(memcmp(packet, buf, 11) != 0)
  31. {
  32. // printf("wrong header...\n");
  33. @@ -2099,13 +2099,13 @@ int addCF(uchar* packet, int length)
  34. if(opt.cf_count >= 100)
  35. return 1;
  36. - bzero(clear, 4096);
  37. - bzero(final, 4096);
  38. - bzero(flip, 4096);
  39. - bzero(frag1, 128);
  40. - bzero(frag2, 128);
  41. - bzero(frag3, 128);
  42. - bzero(keystream, 128);
  43. + memset(clear, 0, 4096);
  44. + memset(final, 0, 4096);
  45. + memset(flip, 0, 4096);
  46. + memset(frag1, 0, 128);
  47. + memset(frag2, 0, 128);
  48. + memset(frag3, 0, 128);
  49. + memset(keystream, 0, 128);
  50. switch( packet[1] & 3 )
  51. {
  52. @@ -2364,7 +2364,7 @@ int addarp(uchar* packet, int length)
  53. if(opt.nb_arp >= opt.ringbuffer)
  54. return -1;
  55. - bzero(flip, 4096);
  56. + memset(flip, 0, 4096);
  57. flip[49-z-4] ^= ((rand() % 255)+1); //flip random bits in last byte of sender MAC
  58. flip[53-z-4] ^= ((rand() % 255)+1); //flip random bits in last byte of sender IP
  59. @@ -2519,7 +2519,7 @@ int packet_recv(uchar* packet, int lengt
  60. struct ST_info *st_prv = NULL;
  61. reasso = 0; fixed = 0;
  62. - bzero(essid, 256);
  63. + memset(essid, 0, 256);
  64. pthread_mutex_lock( &mx_cap );
  65. if(opt.record_data)
  66. @@ -2643,7 +2643,7 @@ int packet_recv(uchar* packet, int lengt
  67. st_cur->ssid_length[i] = 0;
  68. }
  69. - bzero(st_cur->essid, 256);
  70. + memset(st_cur->essid, 0, 256);
  71. st_cur->essid_length = 0;
  72. st_cur->wpatype = 0;
  73. @@ -2769,7 +2769,7 @@ int packet_recv(uchar* packet, int lengt
  74. len += 8;
  75. //eapol
  76. - bzero(h80211+len, 99);
  77. + memset(h80211+len, 0, 99);
  78. h80211[len] = 0x01;//version
  79. h80211[len+1] = 0x03;//type
  80. h80211[len+2] = 0x00;
  81. @@ -2818,7 +2818,7 @@ int packet_recv(uchar* packet, int lengt
  82. h80211[len+7] = 0x00;
  83. h80211[len+8] = 0x20; //keylen
  84. - bzero(h80211+len+9, 90);
  85. + memset(h80211+len+9, 0, 90);
  86. memcpy(h80211+len+17, st_cur->wpa.anonce, 32);
  87. len+=99;
  88. @@ -2944,7 +2944,7 @@ int packet_recv(uchar* packet, int lengt
  89. if(length < 60)
  90. {
  91. trailer = 60 - length;
  92. - bzero(h80211 + length, trailer);
  93. + memset(h80211 + length, 0, trailer);
  94. length += trailer;
  95. }
  96. @@ -2961,7 +2961,7 @@ int packet_recv(uchar* packet, int lengt
  97. {
  98. if( opt.promiscuous || !opt.f_essid || gotESSID((char*)tag, len) == 1)
  99. {
  100. - bzero(essid, 256);
  101. + memset(essid, 0, 256);
  102. memcpy(essid, tag, len);
  103. /* store probes */
  104. @@ -3355,11 +3355,11 @@ skip_probe:
  105. printf("\n");
  106. }
  107. - bzero(st_cur->essid, 256);
  108. + memset(st_cur->essid, 0, 256);
  109. memcpy(st_cur->essid, essid, 255);
  110. st_cur->essid_length = strlen(essid);
  111. - bzero(essid, 256);
  112. + memset(essid, 0, 256);
  113. /* either specified or determined */
  114. if( (opt.sendeapol && ( opt.wpa1type || opt.wpa2type ) ) || (st_cur->wpatype && st_cur->wpahash) )
  115. @@ -3391,7 +3391,7 @@ skip_probe:
  116. len += 8;
  117. //eapol
  118. - bzero(h80211+len, 99);
  119. + memset(h80211+len, 0, 99);
  120. h80211[len] = 0x01;//version
  121. h80211[len+1] = 0x03;//type
  122. h80211[len+2] = 0x00;
  123. @@ -3440,7 +3440,7 @@ skip_probe:
  124. h80211[len+7] = 0x00;
  125. h80211[len+8] = 0x20; //keylen
  126. - bzero(h80211+len+9, 90);
  127. + memset(h80211+len+9, 0, 90);
  128. memcpy(h80211+len+17, st_cur->wpa.anonce, 32);
  129. len+=99;
  130. @@ -3729,7 +3729,7 @@ int cfrag_fuzz(unsigned char *packet, in
  131. else
  132. smac = packet + 24;
  133. - bzero(overlay, 4096);
  134. + memset(overlay, 0, 4096);
  135. smac[4] ^= rnd[0];
  136. smac[5] ^= rnd[1];
  137. @@ -3902,19 +3902,19 @@ int main( int argc, char *argv[] )
  138. memset( &apc, 0, sizeof( struct AP_conf ));
  139. rESSID = (pESSID_t) malloc(sizeof(struct ESSID_list));
  140. - bzero(rESSID, sizeof(struct ESSID_list));
  141. + memset(rESSID, 0, sizeof(struct ESSID_list));
  142. rFragment = (pFrag_t) malloc(sizeof(struct Fragment_list));
  143. - bzero(rFragment, sizeof(struct Fragment_list));
  144. + memset(rFragment, 0, sizeof(struct Fragment_list));
  145. rClient = (pMAC_t) malloc(sizeof(struct MAC_list));
  146. - bzero(rClient, sizeof(struct MAC_list));
  147. + memset(rClient, 0, sizeof(struct MAC_list));
  148. rBSSID = (pMAC_t) malloc(sizeof(struct MAC_list));
  149. - bzero(rBSSID, sizeof(struct MAC_list));
  150. + memset(rBSSID, 0, sizeof(struct MAC_list));
  151. rCF = (pCF_t) malloc(sizeof(struct CF_packet));
  152. - bzero(rCF, sizeof(struct CF_packet));
  153. + memset(rCF, 0, sizeof(struct CF_packet));
  154. pthread_mutex_init( &mx_cf, NULL );
  155. pthread_mutex_init( &mx_cap, NULL );