Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include"Packet.h"
- #include"Poverty.h"
- HWND IgnoreList;
- int IgnoreCount = 0;
- byte IgnorePacket[255][2048];
- int IgnoreSize[255];
- int IgnoreDec[255];
- bool AddIgnoreArray(TCHAR TEST[]){
- TCHAR Ress[2048];
- TCHAR HexArray[20]=TEXT("0123456789ABCDEF");
- int i,len,size;
- len=0;
- int counter=0,counter2=0;
- int endig;
- IgnoreDec[IgnoreCount]=0;
- for(i=0; TEST[i]!='\0' ; i++){
- // 0-9 || A-F || a-f
- if( (TEST[i] > 0x2F && TEST[i] < 0x3A) || (TEST[i] > 0x40 && TEST[i] < 0x47) || (TEST[i] > 0x60 && TEST[i] < 0x67) ){
- Ress[len]=TEST[i];
- len++;
- counter=0;
- counter2=0;
- //**
- }else if(TEST[i]==0x2A && counter==0){
- len--;
- break;
- //0-F
- Ress[len]=HexArray[rand()%16];
- //0-F
- Ress[len+1]=HexArray[rand()%16];
- counter=1;
- counter2=0;
- len+=2;
- }
- //Space
- else if(TEST[i]==0x20){
- counter=0; counter2=0;
- }
- else if(TEST[i]==0x3F && counter2==0){
- IgnoreDec[IgnoreCount]++;
- //0-F
- Ress[len]=HexArray[rand()%16];
- //0-F
- Ress[len+1]=HexArray[rand()%16];
- counter2=1;
- counter=0;
- len+=2;
- }
- }
- byte ToPacket[2048];
- for(i=0; i < (len+1) ;i++){
- _stscanf_s(&Ress[i*2], TEXT("%02x"), &ToPacket[i]);
- }
- size=i/2;
- //SendPacket(ToPacket, size);
- IgnoreSize[IgnoreCount]=size;
- for(i=0;i < size; i++) IgnorePacket[IgnoreCount][i]=ToPacket[i];
- return true;
- }
- bool AddIgnoreListItem(HWND hwnd){
- LVITEM item;
- item.mask = LVIF_TEXT;
- TCHAR _Packet[2048];
- GetDlgItemText(hwnd, Edit_SendIgnore, _Packet, 2048);
- if(_Packet[0]=='\0')return false;
- item.pszText = _Packet;
- item.iItem = IgnoreCount;
- item.iSubItem = 0;
- ListView_InsertItem(IgnoreList , &item);
- //Scroll to Bottom
- ListView_EnsureVisible(IgnoreList, IgnoreCount, true);
- AddIgnoreArray(_Packet);
- IgnoreCount++;
- return true;
- }
- void InitIgnoreList(){
- LVCOLUMN col;
- col.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
- col.fmt = LVCFMT_LEFT;
- col.cx = 500;
- col.pszText = TEXT("Ignore Packets");
- col.iSubItem = 0;
- ListView_InsertColumn(IgnoreList , 0, &col);
- }
- INT_PTR CALLBACK CreateToolDialog(HWND hwnd, UINT uMsg, WPARAM wParam,LPARAM lParam){
- switch(uMsg){
- case WM_INITDIALOG:
- IgnoreList = GetDlgItem(hwnd, List_SendIgnore);
- InitIgnoreList();
- return true;
- case WM_COMMAND:
- switch(LOWORD(wParam)){
- case Button_SendIgnore:
- AddIgnoreListItem(hwnd);
- return true;
- }
- return false;
- /*case WM_NOTIFY:
- SelectS=ListView_GetNextItem(PacketList, -1, LVNI_SELECTED);
- if(SelectS!=-1 && SelectS!=OldSelectS){
- GetPacket(hwnd);
- OldSelectS=SelectS;
- }
- return TRUE;*/
- case WM_CLOSE:
- EndDialog(hwnd, true);
- return true;
- }
- return FALSE;
- }
- void ToolDialog(){
- DialogBox(hDLL, MAKEINTRESOURCE(Dialog_SendTool), NULL, CreateToolDialog);
- }
Advertisement
Add Comment
Please, Sign In to add comment