Riremito

Untitled

Nov 17th, 2014
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.83 KB | None | 0 0
  1. #include"Packet.h"
  2. #include"Poverty.h"
  3.  
  4. HWND IgnoreList;
  5. int IgnoreCount = 0;
  6.  
  7. byte IgnorePacket[255][2048];
  8. int IgnoreSize[255];
  9. int IgnoreDec[255];
  10. bool AddIgnoreArray(TCHAR TEST[]){
  11.     TCHAR Ress[2048];
  12.     TCHAR HexArray[20]=TEXT("0123456789ABCDEF");
  13.     int i,len,size;
  14.     len=0;
  15.     int counter=0,counter2=0;
  16.     int endig;
  17.     IgnoreDec[IgnoreCount]=0;
  18.     for(i=0; TEST[i]!='\0' ; i++){
  19.         // 0-9 || A-F || a-f
  20.         if( (TEST[i] > 0x2F && TEST[i] < 0x3A) || (TEST[i] > 0x40 && TEST[i] < 0x47) || (TEST[i] > 0x60 && TEST[i] < 0x67) ){
  21.  
  22.                 Ress[len]=TEST[i];
  23.                 len++;
  24.                 counter=0;
  25.                 counter2=0;
  26.                 //**
  27.         }else if(TEST[i]==0x2A && counter==0){
  28.             len--;
  29.             break;
  30.             //0-F
  31.             Ress[len]=HexArray[rand()%16];
  32.             //0-F
  33.             Ress[len+1]=HexArray[rand()%16];
  34.             counter=1;
  35.             counter2=0;
  36.             len+=2;
  37.         }
  38.         //Space
  39.         else if(TEST[i]==0x20){
  40.                 counter=0; counter2=0;
  41.         }
  42.         else if(TEST[i]==0x3F && counter2==0){
  43.                 IgnoreDec[IgnoreCount]++;
  44.             //0-F
  45.             Ress[len]=HexArray[rand()%16];
  46.             //0-F
  47.             Ress[len+1]=HexArray[rand()%16];
  48.             counter2=1;
  49.             counter=0;
  50.             len+=2;
  51.         }
  52.  
  53.  
  54.     }
  55.  
  56.     byte ToPacket[2048];
  57.  
  58.     for(i=0; i < (len+1) ;i++){
  59.         _stscanf_s(&Ress[i*2], TEXT("%02x"), &ToPacket[i]);
  60.     }
  61.  
  62.     size=i/2;
  63.     //SendPacket(ToPacket, size);
  64.     IgnoreSize[IgnoreCount]=size;
  65.     for(i=0;i < size; i++) IgnorePacket[IgnoreCount][i]=ToPacket[i];
  66.     return true;
  67. }
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76. bool AddIgnoreListItem(HWND hwnd){
  77.     LVITEM item;
  78.     item.mask = LVIF_TEXT;
  79.     TCHAR _Packet[2048];
  80.     GetDlgItemText(hwnd, Edit_SendIgnore, _Packet, 2048);
  81.     if(_Packet[0]=='\0')return false;
  82.     item.pszText = _Packet;
  83.     item.iItem = IgnoreCount;
  84.     item.iSubItem = 0;
  85.     ListView_InsertItem(IgnoreList , &item);
  86.  
  87.     //Scroll to Bottom
  88.     ListView_EnsureVisible(IgnoreList, IgnoreCount, true);
  89.     AddIgnoreArray(_Packet);
  90.     IgnoreCount++;
  91.     return true;
  92. }
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99. void InitIgnoreList(){ 
  100.     LVCOLUMN col;
  101.     col.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
  102.     col.fmt = LVCFMT_LEFT;
  103.  
  104.     col.cx = 500;
  105.     col.pszText = TEXT("Ignore Packets");
  106.     col.iSubItem = 0;
  107.     ListView_InsertColumn(IgnoreList , 0, &col);
  108. }
  109.  
  110.  
  111.  
  112. INT_PTR CALLBACK CreateToolDialog(HWND hwnd, UINT uMsg, WPARAM wParam,LPARAM lParam){
  113.     switch(uMsg){
  114.         case WM_INITDIALOG:
  115.             IgnoreList = GetDlgItem(hwnd, List_SendIgnore);
  116.             InitIgnoreList();
  117.             return true;
  118.        
  119.  
  120.         case WM_COMMAND:
  121.             switch(LOWORD(wParam)){
  122.                     case Button_SendIgnore:
  123.                             AddIgnoreListItem(hwnd);
  124.                         return true;
  125.                 }
  126.             return false;
  127.        
  128.     /*case WM_NOTIFY:
  129.         SelectS=ListView_GetNextItem(PacketList, -1, LVNI_SELECTED);
  130.         if(SelectS!=-1 && SelectS!=OldSelectS){
  131.         GetPacket(hwnd);
  132.         OldSelectS=SelectS;
  133.         }
  134.         return TRUE;*/
  135.  
  136.  
  137.         case WM_CLOSE:
  138.             EndDialog(hwnd, true);
  139.             return true;
  140.     }
  141.     return FALSE;
  142. }
  143.  
  144. void ToolDialog(){
  145.     DialogBox(hDLL, MAKEINTRESOURCE(Dialog_SendTool), NULL, CreateToolDialog);
  146. }
Advertisement
Add Comment
Please, Sign In to add comment