begin process at 2008 07 06 12:55:43
1 205 544 membres
121 nouveaux aujourd'hui
14 119 membres club

Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum.
Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

[WIN32][C][DEV-C++] WSEARCH GOOGLE HACK


Information sur la source

Catégorie :Application Classé sous : google, hack, recherche, search Niveau : Débutant Date de création : 13/04/2008 Date de mise à jour : 16/04/2008 12:53:51 Vu / téléchargé: 3 809 / 192

Note :
Aucune note

Commentaire sur cette source (9)
Ajouter un commentaire et/ou une note


Description

Google Hack ce fameux outil de recherche sur internet est depuis peu détecté comme un virus, (car correspondant à un outil potentiel de hack) j'ai recoder (très simplement) l'outil en y ajoutant des liens que j'affectionne et des extensions supplémentaires.
La taille de l'exécutable passe aussi de 2mo (original) a 20ko ...

Pour utiliser l'exécutable, renommer WSearch_V0.1.ex en WSearch_V0.1.exe

toutes vos remarques sont les bienvenues.

Source

  • //------------------------------------------------------------------------------
  • // Projet WSearch : Recherhche via google
  • // Auteur : Hanteville Nicolas
  • // Fichier : main.c
  • // Version : 0.2
  • // Date de modification : 16/04/2008
  • // Description : module de recherche automatique sur internet
  • // Environnement : compatiblité DEVCPP / VISUAL C++ / BORLAND C++ 5.x
  • //------------------------------------------------------------------------------
  • #define _WIN32_WINNT 0x0500
  • #define _WIN32_IE 0x0500
  • #include <windows.h>
  • #include <commctrl.h>
  • //------------------------------------------------------------------------------
  • #define NOM_APPLI "WSearch_V0.2_Hanteville_Nicolas" //titre de la fenêtr + classe
  • #define A 100 //id de l'icone interne
  • #define MSB_BOUTON 1000 //msg duy bouton
  • #define TAILLE_MAX_URL 1024 //taille maximum de l'url (url total = TAILLE_MAX_URL*2 + saisies)
  • #define TAILLE_MAX_TITRE 256
  • #define TAILLE_MAX_CMD 3*TAILLE_MAX_URL+2
  • #define NB_MAX_URLS 128 //nombre maximum d'urls enregistrés
  • //------------------------------------------------------------------------------
  • #define SP_SEPARATEUR "---------------------------------"
  • #define CONF "CONFIGURATION"
  • /*
  • Information:
  • Il suffit d'ajouter maintenant directement dans le fichier ini les url
  • la partie début présente l'url avant la chaine de recherche
  • la partie fin représente l'url après la chaine de recherche
  • si la partie début a pour texte '-' il n peut pas être traité
  • (après vous mettez le titre que vous voulez c'est que pour l'affichage)
  • */
  • //------------------------------------------------------------------------------
  • typedef struct
  • {
  • char DebutUrl[TAILLE_MAX_URL+1];
  • char FinUrl[TAILLE_MAX_URL+1];
  • }url;
  • //------------------------------------------------------------------------------
  • url MesUrls[NB_MAX_URLS];
  • HWND Hbouton;
  • HWND HComboBox;
  • HWND HText;
  • HINSTANCE Hinst;
  • //------------------------------------------------------------------------------
  • //******************************************************************************
  • //titre d'un item
  • char* TitreItem(unsigned short id, char *titre,int size)
  • {
  • titre[0]=0;
  • COMBOBOXEXITEM item;
  • item.mask = CBEIF_TEXT;
  • item.iItem = id;
  • item.pszText = titre;
  • item.cchTextMax = size;
  • item.iImage = 0;
  • item.iSelectedImage=0;
  • item.iOverlay=0;
  • item.iIndent=0;
  • item.lParam=id;
  • SendMessage(HComboBox, CBEM_GETITEM,0, (LPARAM)&item);
  • return titre;
  • }
  • //******************************************************************************
  • //ajout d'items
  • void AjouterItem(unsigned short id,char* debut, char*fin, char *titre)
  • {
  • if (id<NB_MAX_URLS)
  • {
  • strncpy(MesUrls[id].DebutUrl,debut,TAILLE_MAX_URL);
  • strncpy(MesUrls[id].FinUrl,fin,TAILLE_MAX_URL);
  • COMBOBOXEXITEM item;
  • item.mask = CBEIF_TEXT;
  • item.iItem = id;
  • item.pszText = titre;
  • item.cchTextMax = strlen(titre);
  • item.iImage = 0;
  • item.iSelectedImage=0;
  • item.iOverlay=0;
  • item.iIndent=0;
  • item.lParam=id;
  • //ajout a la comboboxEx
  • SendMessage(HComboBox, CBEM_INSERTITEM,0, (LPARAM)&item);
  • }
  • }
  • //******************************************************************************
  • //fct de chargement des urls
  • DWORD WINAPI Chargement(LPVOID lParam)
  • {
  • char tmpTitre1[TAILLE_MAX_TITRE+1],tmpTitre2[TAILLE_MAX_TITRE+1],tmpTitre3[TAILLE_MAX_TITRE+1];
  • char tmp_bloc1[TAILLE_MAX_URL+1],tmp_bloc2[TAILLE_MAX_URL+1],tmp_bloc3[TAILLE_MAX_TITRE+1];
  • char tmpcout[256];
  • //répertoire courant
  • char Emplacement[MAX_PATH];
  • GetCurrentDirectory(MAX_PATH - 1, Emplacement);
  • strcat(Emplacement,"\\conf.ini\0");
  • //nombre d'éléments
  • tmpcout[0]=0;
  • GetPrivateProfileString(CONF,"COUNT","0",tmpcout,255,Emplacement);
  • int i,count = atoi(tmpcout);
  • if(count>0)
  • {
  • for (i=0;i<=count;i++)
  • {
  • sprintf(tmpTitre1,"URL_DEBUT%02d",i);
  • sprintf(tmpTitre2,"URL_FIN%02d",i);
  • sprintf(tmpTitre3,"TITRE%02d",i);
  • GetPrivateProfileString(CONF,tmpTitre1,"",tmp_bloc1,TAILLE_MAX_URL,Emplacement);
  • GetPrivateProfileString(CONF,tmpTitre2,"",tmp_bloc2,TAILLE_MAX_URL,Emplacement);
  • GetPrivateProfileString(CONF,tmpTitre3,"",tmp_bloc3,TAILLE_MAX_TITRE,Emplacement);
  • //ajout d'items
  • AjouterItem(i,tmp_bloc1,tmp_bloc2,tmp_bloc3);
  • }
  • //sélection du premier choix
  • SendMessage(HComboBox,CB_SETCURSEL,(WPARAM )0,(LPARAM )0);
  • }else
  • {
  • //si aucun choix on ajoute les choix par défaut
  • //remplissage des urls + structure
  • AjouterItem(count++,"http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.mp3%7C.wma%7C.ogg%29+%22","%22","Musiques: mp3,wma,ogg");
  • AjouterItem(count++,"http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.txt%7C.pps%7C.ppt%7C.zip%7C.cbz%7C.cbr%7C.odt%7C.doc%7C.rtf%7C.rar%7C.pdf%7C.chm%7C.hlp%29+%22","%22","Livres: pps,ppt,odt,doc,rtf,rar,zip,cbz,cbr,pdf,chm,hlp");
  • AjouterItem(count++,"http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.mpg%7C.avi%7C.flv%7C.wmv%7C.mpeg%7C.nsc%7C.mov%7C.rm%7C.rmvb%7C.mkv%29+%22","%22","Videos: avi,flv,wmv,mpg,mpeg,nsc,mov,rm,rmvb,mkv");
  • AjouterItem(count++,"http://images.google.com/images?q=","\0","Images");
  • AjouterItem(count++,"http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.ico%7C.cur%29+%22","%22","Curseurs: ico,cur");
  • AjouterItem(count++,"http://www.google.com/search?q=","+site%3Ahttp%3A%2F%2Fwww.searchfreefonts.com%2Ffont+OR+site%3Awww.dafont.com+OR+site%3Ahttp%3A%2F%2Fwww.searchfreefonts.com%2F+++-comments+-categories.php+-comment.php","Font: police de caractère");
  • AjouterItem(count++,"http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.srt%7C.sub%29+%22","%22","Sous-titres: sub,srt");
  • AjouterItem(count++,"http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.exe%7C.rar%7C.zip%7C.msi%29+%22","%22","Applications: exe,zip,rar,msi");
  • AjouterItem(count++,"http://www.google.com/search?q=","&btnG=Search&q=%28&q=bigupload.com%2Fd+%7C&q=filefactory.com%2Ffile+%7C&q=dl-1.free.fr+%7C&q=gigasize.com%2Fget.php+%7C&q=d01.megashares.com%2F%3Fd01+%7C&q=megaupload.com%2F%3Fd+%7C&q=rapidshare.com%2Ffiles+%7C&q=rapidshare.de%2Ffiles+%7C&q=rapidupload.com%2Fd.php+%7C&q=sendspace.com%2Ffile+%7C&q=sexuploader.com%2F%3Fd+%7C&q=uploading.com%2F%3Fget+%7C&q=uploadport.com%2Frequest%2F%3Ffid+%7C&q=zupload.com%2Fdownload.php+%7C&q=%29","Direct download");
  • AjouterItem(count++,"-","\0",SP_SEPARATEUR);
  • AjouterItem(count++,"http://www.google.com/search?q=","&btnG=Search&q=filetype%3Atorrent","Peer to Peer: torrent (google)");
  • AjouterItem(count++,"http://thepiratebay.org/search/","/0/99/0","Peer to Peer: torrent (thepiratebay)");
  • AjouterItem(count++,"http://www.mininova.org/search/?search=","\0","Peer to Peer: torrent (mininova)");
  • AjouterItem(count++,"-","\0",SP_SEPARATEUR);
  • AjouterItem(count++,"http://www.google.com/search?q=link%3A","\0","Outils: lien (url)");
  • AjouterItem(count++,"http://www.google.com/addurl?q=","&dqq=","Outils: ajout de lien (url)");
  • AjouterItem(count++,"http://www.google.com/search?q=related%3","\0","Outils: lien raconté (url)");
  • AjouterItem(count++,"http://www.google.com/search?q=site%3","\0","Outils: index lien (url)");
  • AjouterItem(count++,"-","\0",SP_SEPARATEUR);
  • AjouterItem(count++,"http://www.google.com/search?q=intitle%3A%22Index+of%22+passwords+modified+site%3A","\0","Hack mdp: intitle");
  • AjouterItem(count++,"http://www.google.com/search?q=allinurl%3Aauth_user_file.txt+site%3A","\0","Hack mdp: allinurl,auth_user_file.txt");
  • AjouterItem(count++,"http://www.google.com/search?q=inurl%3Apasslist.txt&btnG=Search+site%3A","\0","Hack mdp: inurl,passlist.txt");
  • AjouterItem(count++,"http://www.google.com/search?q=%22%23+-FrontPage-%22+inurl%3Aservice.pwd+site%3A","\0","Hack mdp: FrontPage,inurl,service.pwd");
  • AjouterItem(count++,"http://www.google.com/search?q=intitle%3A%22Index+of%22+config.php+site%3A","\0","Hack mdp: intitle,Index of,config.php");
  • AjouterItem(count++,"http://www.google.com/search?q=%22http%3A%2F%2F*%3A*%40%22","\0","Hack mdp: http");
  • AjouterItem(count++,"-","\0",SP_SEPARATEUR);
  • AjouterItem(count++,"http://www.google.com/translate?langpair=fr|en&u=","\0","Proxy: traduction");
  • AjouterItem(count++,"http://www.google.com/gwt/n?u=http%3A%2F%2F","%2F","Proxy: cache");
  • AjouterItem(count++,"http://web.archive.org/web/*/","\0","Proxy: cache (url)");
  • AjouterItem(count++,"-","\0",SP_SEPARATEUR);
  • AjouterItem(count++,"http://groups.google.fr/groups/search?hl=fr&q=","&qt_s=Rechercher+des+groupes","News groupe");
  • AjouterItem(count++,"http://blogsearch.google.fr/blogsearch?q=","&um=1&hl=fr&imgsz=icon&ie=UTF-8&sa=N&tab=gb","Blog");
  • AjouterItem(count++,"http://maps.google.fr/maps?f=q&hl=fr&q=","&btnG=Recherche+Google+Maps","Google Map");
  • AjouterItem(count++,"http://www.google.fr/search?q=recette+","\0","Recette de cuisine");
  • AjouterItem(count++,"http://fr.wikipedia.org/wiki/","","Encyclopédie: Wikipedia");
  • AjouterItem(count++,"-","\0",SP_SEPARATEUR);
  • AjouterItem(count++,"http://www.cdiscount.com/search/","/sa-10.html","Achat: Cdiscount");
  • AjouterItem(count++,"http://www.grosbill.com/catv2.cgi?recherche=","&x=0&y=0&mode=recherche","Achat: Grosbill");
  • AjouterItem(count++,"http://www.priceminister.com/?action=se&kw=","&category=sa&submitbtn=","Achat: Priceminister");
  • AjouterItem(count++,"http://www.surcouf.com/Recherche/ResultatRecherche.aspx?search=","\0","Achat: Surcouf");
  • AjouterItem(count++,"http://www.ldlc.com/navigation/recherche2.html?motcle=","\0","Achat: Ldlc");
  • AjouterItem(count++,"http://search.rueducommerce.fr/shared/recherche/index.cfm?recherche=","&prix=&trix=1&typetrix=DESC&bound=20&schcid=","Achat: RueDuCommerce");
  • AjouterItem(count++,"http://www3.fnac.com/search/quick.do?Origin=FnacAff&text=","&category=all&x=0&y=0","Achat: FNAC");
  • AjouterItem(count++,"http://search.ebay.fr/search/search.dll?query=","&MfcISAPICommand=GetResult&ht=1&ebaytag1=ebayreg&srchdesc=n&maxRecordsReturned=30000&maxRecordsPerPage=500&SortProperty=MetaEndSort","Achat: Ebay");
  • AjouterItem(count++,"http://www.amazon.fr/s/url=search-alias%3Daps&field-keywords=","&Go.x=13&Go.y=10&Go=Go","Achat: Amazone");
  • AjouterItem(count++,"http://www.alapage.com/-/MultiRecherche?choix=fulltext&ap=1&pos=2&cat=&default=Recherche&fulltext=","&type=0","Achat: Alapage");
  • AjouterItem(count++,"http://www.google.com/search?q=","&btnG=Search&q=%28&q=cdiscount.com+%7C&q=grosbill.com+%7C&q=priceminister.com+%7C&q=surcouf.com+%7C&q=ldlc.com+%7C&q=rueducommerce.fr+%7C&q=fnac.com+%7C&q=ebay.fr+%7C&q=amazon.fr+%7C&q=alapage.com+%7C&q=%29","Achat: Tous");
  • AjouterItem(count++,"-","\0",SP_SEPARATEUR);
  • AjouterItem(count++,"http://www.google.com/translate_dict?q=","&hl=fr&langpair=en%7Cfr","Traduction: Anglais->Français");
  • AjouterItem(count++,"http://www.google.com/translate_dict?q=","&hl=fr&langpair=fr%7Cen","Traduction: Français->Anglais");
  • AjouterItem(count++,"http://www.google.com/translate?u=http%3A%2F%2F","&langpair=en%7Cfr&hl=fr&ie=UTF8","Traduction: Anglais->Français (URL)");
  • AjouterItem(count++,"-","\0",SP_SEPARATEUR);
  • AjouterItem(count++,"http://search.msdn.microsoft.com/Default.aspx?locale=en-US&Query=","&Brand=msdn","Programmation: MSDN");
  • AjouterItem(count++,"http://www.cppfrance.com/recherche.aspx?r=","\0","Programmation: CPPfrance");
  • AjouterItem(count++,"http://www.google.com/custom?hl=fr&cof=S%3Ahttp%3A%2F%2Fwww.developpez.com%3BL%3Ahttp%3A%2F%2Fwww.developpez.com%2Ftemplate%2Flogo.gif%3B&domains=developpez.com%3Bdeveloppez.net&q=","&btnG=Rechercher&sitesearch=developpez.com","Programmation: Développez");
  • AjouterItem(count++,"http://www.codeproject.com/info/search.aspx?artkw=","\0","Programmation: Codeproject");
  • AjouterItem(count++,"-","\0",SP_SEPARATEUR);
  • AjouterItem(count++,"http://www.animenfo.com/search.php?query=","&queryin=anime_titles&action=Go&option=keywords","Anime/Manga: animenfo");
  • AjouterItem(count++,"http://www.bedetheque.com/index.php?R=1&RechTexte=","&btRecherche=OK&RechSerie=&RechAuteur=&RechEditeur=&RechCollection=&RechStyle=&RechDL=&RechISBN=","Bds: bedetheque");
  • //sélection du premier choix
  • SendMessage(HComboBox,CB_SETCURSEL,(WPARAM )0,(LPARAM )0);
  • //enregistrement dans le fichier ini
  • tmpcout[0]=0;
  • count--;
  • WritePrivateProfileString(CONF,"COUNT",itoa(count,tmpcout,10),Emplacement);
  • while(count>-1)
  • {
  • sprintf(tmpTitre1,"URL_DEBUT%02d",count);
  • sprintf(tmpTitre2,"URL_FIN%02d",count);
  • sprintf(tmpTitre3,"TITRE%02d",count);
  • WritePrivateProfileString(CONF,tmpTitre1,MesUrls[count].DebutUrl,Emplacement);
  • WritePrivateProfileString(CONF,tmpTitre2,MesUrls[count].FinUrl,Emplacement);
  • WritePrivateProfileString(CONF,tmpTitre3,TitreItem(count,tmp_bloc3,TAILLE_MAX_TITRE+1),Emplacement);
  • count--;
  • }
  • }
  • return 0;
  • }
  • //******************************************************************************
  • //fct de traitement
  • DWORD WINAPI Exec(LPVOID lParam)
  • {
  • unsigned int id = (unsigned int)lParam;
  • char tmpcommande[TAILLE_MAX_CMD];
  • char tmp[TAILLE_MAX_URL+1];
  • EnableWindow(Hbouton,0);
  • //récupération de la recherche
  • tmp[0]=0;
  • GetWindowText(HText,tmp,TAILLE_MAX_URL);
  • if(MesUrls[id].DebutUrl[0]!='-')//le caractère --- spécifie un titre
  • {
  • //si un espace on converti par un +
  • char *t = tmp;
  • while(*t)
  • {
  • if (*t==' ')*t='+';
  • *t++;
  • }
  • //création de la requête
  • snprintf(tmpcommande,TAILLE_MAX_CMD,"%s%s%s",MesUrls[id].DebutUrl,tmp,MesUrls[id].FinUrl);
  • //exécution
  • ShellExecute(NULL,"Open",tmpcommande, NULL, NULL, SW_SHOWNORMAL);
  • }
  • EnableWindow(Hbouton,1);
  • return 0;
  • }
  • //******************************************************************************
  • //gestion des messages
  • LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
  • {
  • if (message == WM_COMMAND && (LOWORD(wParam) == MSB_BOUTON || LOWORD(wParam) == IDOK) || message==WM_KEYDOWN && wParam == VK_RETURN)
  • {
  • CreateThread(0,0,Exec,(LPVOID)SendMessage(HComboBox,CB_GETCURSEL,(WPARAM )0,(LPARAM )0),0,0);
  • }
  • else if (message == WM_DESTROY)PostQuitMessage (0);
  • else return DefWindowProc (hwnd, message, wParam, lParam);
  • return 0;
  • }
  • //******************************************************************************
  • //création de la fenêtre principale
  • int WINAPI WinMain (HINSTANCE hThisInstance,HINSTANCE hPrevInstance,LPSTR lpszArgument,int nFunsterStil)
  • {
  • MSG messages;
  • WNDCLASS wincl;
  • HWND hwnd;
  • INITCOMMONCONTROLSEX icex;
  • icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
  • icex.dwICC = ICC_USEREX_CLASSES;
  • InitCommonControlsEx(&icex);
  • wincl.style = CS_HREDRAW | CS_VREDRAW;
  • wincl.lpfnWndProc = WindowProcedure;
  • wincl.cbClsExtra = 0;
  • wincl.cbWndExtra = 0;
  • wincl.hInstance = Hinst = hThisInstance;
  • wincl.lpszMenuName = "";
  • wincl.lpszClassName = NOM_APPLI;
  • wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
  • //chargement des icones (via les ressources)
  • wincl.hIcon = (HICON)LoadIcon(hThisInstance, MAKEINTRESOURCE(A));
  • wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
  • //on crée la classe (on l'enregistre)
  • if(!RegisterClass(&wincl)) return FALSE;
  • //création de la fenêtre
  • hwnd = CreateWindow(NOM_APPLI,NOM_APPLI,WS_OVERLAPPED| WS_SYSMENU,CW_USEDEFAULT, CW_USEDEFAULT, 400, 100,0, 0, hThisInstance, 0);
  • if (!hwnd) return FALSE;
  • //création des éléments
  • Hbouton = CreateWindow("BUTTON","Rechercher",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON ,290,45,90 ,23 , hwnd, (HMENU )MSB_BOUTON, hThisInstance, NULL);
  • HText = CreateWindow("EDIT", "",WS_BORDER |WS_CHILD |WS_VISIBLE|ES_LEFT ,10,9, 370, 23, hwnd, NULL, hThisInstance, NULL);
  • HComboBox= CreateWindow(WC_COMBOBOXEX,"",CBS_DROPDOWN | CBS_DROPDOWNLIST | CBS_SIMPLE | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE,10,45, 260, 200, hwnd, NULL, hThisInstance, NULL);
  • CreateThread(0,0,Chargement,0,0,0);
  • //afficher la fenêtre
  • ShowWindow (hwnd, nFunsterStil);
  • UpdateWindow(hwnd);
  • //appliquer le focus par défaut sur l'item
  • SetFocus(HText);
  • while (GetMessage (&messages, NULL, 0, 0))
  • {
  • if (!IsDialogMessage(hwnd, &messages))
  • {
  • TranslateMessage(&messages);
  • DispatchMessage(&messages);
  • }
  • }
  • return messages.wParam;
  • }
//------------------------------------------------------------------------------
// Projet WSearch       : Recherhche via google
// Auteur               : Hanteville Nicolas
// Fichier              : main.c
// Version              : 0.2
// Date de modification : 16/04/2008
// Description          : module de recherche automatique sur internet
// Environnement        : compatiblité DEVCPP / VISUAL C++ / BORLAND C++ 5.x
//------------------------------------------------------------------------------
#define _WIN32_WINNT 0x0500
#define _WIN32_IE 0x0500 
#include <windows.h>
#include <commctrl.h> 
//------------------------------------------------------------------------------
#define NOM_APPLI      "WSearch_V0.2_Hanteville_Nicolas" //titre de la fenêtr + classe
#define A              100      //id de l'icone interne
#define MSB_BOUTON     1000      //msg duy bouton 
#define TAILLE_MAX_URL 1024      //taille maximum de l'url (url total = TAILLE_MAX_URL*2 + saisies)
#define TAILLE_MAX_TITRE 256
#define TAILLE_MAX_CMD 3*TAILLE_MAX_URL+2
#define NB_MAX_URLS    128       //nombre maximum d'urls enregistrés
//------------------------------------------------------------------------------
#define SP_SEPARATEUR  "---------------------------------"
#define CONF "CONFIGURATION"

/*
Information:
            Il suffit d'ajouter maintenant directement dans le fichier ini les url
            la partie début présente l'url avant la chaine de recherche
            la partie fin représente l'url après la chaine de recherche
            
            si la partie début a pour texte '-' il n peut pas être traité
            (après vous mettez le titre que vous voulez c'est que pour l'affichage)     
*/

//------------------------------------------------------------------------------
typedef struct
{
  char DebutUrl[TAILLE_MAX_URL+1];
  char FinUrl[TAILLE_MAX_URL+1];
}url;
//------------------------------------------------------------------------------
url MesUrls[NB_MAX_URLS];
HWND Hbouton;
HWND HComboBox;
HWND HText;
HINSTANCE Hinst;
//------------------------------------------------------------------------------
//******************************************************************************
//titre d'un item
char* TitreItem(unsigned short id, char *titre,int size)
{
  titre[0]=0;
  
  COMBOBOXEXITEM item;
  item.mask = CBEIF_TEXT;
  item.iItem = id;
  item.pszText = titre;
  item.cchTextMax = size;
  item.iImage = 0;
  item.iSelectedImage=0;
  item.iOverlay=0;
  item.iIndent=0;
  item.lParam=id;

  SendMessage(HComboBox, CBEM_GETITEM,0, (LPARAM)&item);    
  
  return titre;
}
//******************************************************************************
//ajout d'items
void AjouterItem(unsigned short id,char* debut, char*fin, char *titre)
{
  if (id<NB_MAX_URLS)
  {
    strncpy(MesUrls[id].DebutUrl,debut,TAILLE_MAX_URL);
    strncpy(MesUrls[id].FinUrl,fin,TAILLE_MAX_URL);
    
    COMBOBOXEXITEM item;
    
    item.mask = CBEIF_TEXT;
    item.iItem = id;
    item.pszText = titre;
    item.cchTextMax = strlen(titre);
    item.iImage = 0;
    item.iSelectedImage=0;
    item.iOverlay=0;
    item.iIndent=0;
    item.lParam=id;

    //ajout a la comboboxEx
    SendMessage(HComboBox, CBEM_INSERTITEM,0, (LPARAM)&item);    
  }
}
//******************************************************************************
//fct de chargement des urls

DWORD WINAPI Chargement(LPVOID lParam)
{
  char tmpTitre1[TAILLE_MAX_TITRE+1],tmpTitre2[TAILLE_MAX_TITRE+1],tmpTitre3[TAILLE_MAX_TITRE+1];
  char tmp_bloc1[TAILLE_MAX_URL+1],tmp_bloc2[TAILLE_MAX_URL+1],tmp_bloc3[TAILLE_MAX_TITRE+1];
  
  char tmpcout[256];

  //répertoire courant
  char Emplacement[MAX_PATH];
  GetCurrentDirectory(MAX_PATH - 1, Emplacement);
  strcat(Emplacement,"\\conf.ini\0");

  //nombre d'éléments
  tmpcout[0]=0;
  GetPrivateProfileString(CONF,"COUNT","0",tmpcout,255,Emplacement);
  
  int i,count = atoi(tmpcout);
  
  if(count>0)
  {
    for (i=0;i<=count;i++)
    {
      sprintf(tmpTitre1,"URL_DEBUT%02d",i);
      sprintf(tmpTitre2,"URL_FIN%02d",i);
      sprintf(tmpTitre3,"TITRE%02d",i);
      GetPrivateProfileString(CONF,tmpTitre1,"",tmp_bloc1,TAILLE_MAX_URL,Emplacement); 
      GetPrivateProfileString(CONF,tmpTitre2,"",tmp_bloc2,TAILLE_MAX_URL,Emplacement); 
      GetPrivateProfileString(CONF,tmpTitre3,"",tmp_bloc3,TAILLE_MAX_TITRE,Emplacement); 
      
      //ajout d'items
      AjouterItem(i,tmp_bloc1,tmp_bloc2,tmp_bloc3);
    }
    //sélection du premier choix
    SendMessage(HComboBox,CB_SETCURSEL,(WPARAM )0,(LPARAM )0);
  }else
  {
    //si aucun choix on ajoute les choix par défaut
    //remplissage des urls + structure
    AjouterItem(count++,"http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.mp3%7C.wma%7C.ogg%29+%22","%22","Musiques: mp3,wma,ogg");
    AjouterItem(count++,"http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.txt%7C.pps%7C.ppt%7C.zip%7C.cbz%7C.cbr%7C.odt%7C.doc%7C.rtf%7C.rar%7C.pdf%7C.chm%7C.hlp%29+%22","%22","Livres: pps,ppt,odt,doc,rtf,rar,zip,cbz,cbr,pdf,chm,hlp");
    AjouterItem(count++,"http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.mpg%7C.avi%7C.flv%7C.wmv%7C.mpeg%7C.nsc%7C.mov%7C.rm%7C.rmvb%7C.mkv%29+%22","%22","Videos: avi,flv,wmv,mpg,mpeg,nsc,mov,rm,rmvb,mkv");
    AjouterItem(count++,"http://images.google.com/images?q=","\0","Images");
    AjouterItem(count++,"http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.ico%7C.cur%29+%22","%22","Curseurs: ico,cur");
    AjouterItem(count++,"http://www.google.com/search?q=","+site%3Ahttp%3A%2F%2Fwww.searchfreefonts.com%2Ffont+OR+site%3Awww.dafont.com+OR+site%3Ahttp%3A%2F%2Fwww.searchfreefonts.com%2F+++-comments+-categories.php+-comment.php","Font: police de caractère");
    AjouterItem(count++,"http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.srt%7C.sub%29+%22","%22","Sous-titres: sub,srt");
    AjouterItem(count++,"http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.exe%7C.rar%7C.zip%7C.msi%29+%22","%22","Applications: exe,zip,rar,msi");
    AjouterItem(count++,"http://www.google.com/search?q=","&btnG=Search&q=%28&q=bigupload.com%2Fd+%7C&q=filefactory.com%2Ffile+%7C&q=dl-1.free.fr+%7C&q=gigasize.com%2Fget.php+%7C&q=d01.megashares.com%2F%3Fd01+%7C&q=megaupload.com%2F%3Fd+%7C&q=rapidshare.com%2Ffiles+%7C&q=rapidshare.de%2Ffiles+%7C&q=rapidupload.com%2Fd.php+%7C&q=sendspace.com%2Ffile+%7C&q=sexuploader.com%2F%3Fd+%7C&q=uploading.com%2F%3Fget+%7C&q=uploadport.com%2Frequest%2F%3Ffid+%7C&q=zupload.com%2Fdownload.php+%7C&q=%29","Direct download");
    AjouterItem(count++,"-","\0",SP_SEPARATEUR);
    AjouterItem(count++,"http://www.google.com/search?q=","&btnG=Search&q=filetype%3Atorrent","Peer to Peer: torrent (google)");
    AjouterItem(count++,"http://thepiratebay.org/search/","/0/99/0","Peer to Peer: torrent (thepiratebay)");
    AjouterItem(count++,"http://www.mininova.org/search/?search=","\0","Peer to Peer: torrent (mininova)");
    AjouterItem(count++,"-","\0",SP_SEPARATEUR);
    AjouterItem(count++,"http://www.google.com/search?q=link%3A","\0","Outils: lien (url)");
    AjouterItem(count++,"http://www.google.com/addurl?q=","&dqq=","Outils: ajout de lien (url)");
    AjouterItem(count++,"http://www.google.com/search?q=related%3","\0","Outils: lien raconté (url)");
    AjouterItem(count++,"http://www.google.com/search?q=site%3","\0","Outils: index lien (url)");
    AjouterItem(count++,"-","\0",SP_SEPARATEUR);
    AjouterItem(count++,"http://www.google.com/search?q=intitle%3A%22Index+of%22+passwords+modified+site%3A","\0","Hack mdp: intitle");
    AjouterItem(count++,"http://www.google.com/search?q=allinurl%3Aauth_user_file.txt+site%3A","\0","Hack mdp: allinurl,auth_user_file.txt");
    AjouterItem(count++,"http://www.google.com/search?q=inurl%3Apasslist.txt&btnG=Search+site%3A","\0","Hack mdp: inurl,passlist.txt");
    AjouterItem(count++,"http://www.google.com/search?q=%22%23+-FrontPage-%22+inurl%3Aservice.pwd+site%3A","\0","Hack mdp: FrontPage,inurl,service.pwd");
    AjouterItem(count++,"http://www.google.com/search?q=intitle%3A%22Index+of%22+config.php+site%3A","\0","Hack mdp: intitle,Index of,config.php");
    AjouterItem(count++,"http://www.google.com/search?q=%22http%3A%2F%2F*%3A*%40%22","\0","Hack mdp: http");
    AjouterItem(count++,"-","\0",SP_SEPARATEUR);
    AjouterItem(count++,"http://www.google.com/translate?langpair=fr|en&u=","\0","Proxy: traduction");
    AjouterItem(count++,"http://www.google.com/gwt/n?u=http%3A%2F%2F","%2F","Proxy: cache");
    AjouterItem(count++,"http://web.archive.org/web/*/","\0","Proxy: cache (url)");
    AjouterItem(count++,"-","\0",SP_SEPARATEUR);
    AjouterItem(count++,"http://groups.google.fr/groups/search?hl=fr&q=","&qt_s=Rechercher+des+groupes","News groupe");
    AjouterItem(count++,"http://blogsearch.google.fr/blogsearch?q=","&um=1&hl=fr&imgsz=icon&ie=UTF-8&sa=N&tab=gb","Blog");
    AjouterItem(count++,"http://maps.google.fr/maps?f=q&hl=fr&q=","&btnG=Recherche+Google+Maps","Google Map");
    AjouterItem(count++,"http://www.google.fr/search?q=recette+","\0","Recette de cuisine");
    AjouterItem(count++,"http://fr.wikipedia.org/wiki/","","Encyclopédie: Wikipedia");
    AjouterItem(count++,"-","\0",SP_SEPARATEUR);
    AjouterItem(count++,"http://www.cdiscount.com/search/","/sa-10.html","Achat: Cdiscount");
    AjouterItem(count++,"http://www.grosbill.com/catv2.cgi?recherche=","&x=0&y=0&mode=recherche","Achat: Grosbill");
    AjouterItem(count++,"http://www.priceminister.com/?action=se&kw=","&category=sa&submitbtn=","Achat: Priceminister");
    AjouterItem(count++,"http://www.surcouf.com/Recherche/ResultatRecherche.aspx?search=","\0","Achat: Surcouf");
    AjouterItem(count++,"http://www.ldlc.com/navigation/recherche2.html?motcle=","\0","Achat: Ldlc");
    AjouterItem(count++,"http://search.rueducommerce.fr/shared/recherche/index.cfm?recherche=","&prix=&trix=1&typetrix=DESC&bound=20&schcid=","Achat: RueDuCommerce");
    AjouterItem(count++,"http://www3.fnac.com/search/quick.do?Origin=FnacAff&text=","&category=all&x=0&y=0","Achat: FNAC");
    AjouterItem(count++,"http://search.ebay.fr/search/search.dll?query=","&MfcISAPICommand=GetResult&ht=1&ebaytag1=ebayreg&srchdesc=n&maxRecordsReturned=30000&maxRecordsPerPage=500&SortProperty=MetaEndSort","Achat: Ebay"); 
    AjouterItem(count++,"http://www.amazon.fr/s/url=search-alias%3Daps&field-keywords=","&Go.x=13&Go.y=10&Go=Go","Achat: Amazone");
    AjouterItem(count++,"http://www.alapage.com/-/MultiRecherche?choix=fulltext&ap=1&pos=2&cat=&default=Recherche&fulltext=","&type=0","Achat: Alapage"); 
    AjouterItem(count++,"http://www.google.com/search?q=","&btnG=Search&q=%28&q=cdiscount.com+%7C&q=grosbill.com+%7C&q=priceminister.com+%7C&q=surcouf.com+%7C&q=ldlc.com+%7C&q=rueducommerce.fr+%7C&q=fnac.com+%7C&q=ebay.fr+%7C&q=amazon.fr+%7C&q=alapage.com+%7C&q=%29","Achat: Tous");
    AjouterItem(count++,"-","\0",SP_SEPARATEUR);
    AjouterItem(count++,"http://www.google.com/translate_dict?q=","&hl=fr&langpair=en%7Cfr","Traduction: Anglais->Français");
    AjouterItem(count++,"http://www.google.com/translate_dict?q=","&hl=fr&langpair=fr%7Cen","Traduction: Français->Anglais");
    AjouterItem(count++,"http://www.google.com/translate?u=http%3A%2F%2F","&langpair=en%7Cfr&hl=fr&ie=UTF8","Traduction: Anglais->Français (URL)");
    AjouterItem(count++,"-","\0",SP_SEPARATEUR);
    AjouterItem(count++,"http://search.msdn.microsoft.com/Default.aspx?locale=en-US&Query=","&Brand=msdn","Programmation: MSDN");
    AjouterItem(count++,"http://www.cppfrance.com/recherche.aspx?r=","\0","Programmation: CPPfrance");
    AjouterItem(count++,"http://www.google.com/custom?hl=fr&cof=S%3Ahttp%3A%2F%2Fwww.developpez.com%3BL%3Ahttp%3A%2F%2Fwww.developpez.com%2Ftemplate%2Flogo.gif%3B&domains=developpez.com%3Bdeveloppez.net&q=","&btnG=Rechercher&sitesearch=developpez.com","Programmation: Développez");
    AjouterItem(count++,"http://www.codeproject.com/info/search.aspx?artkw=","\0","Programmation: Codeproject");
    AjouterItem(count++,"-","\0",SP_SEPARATEUR);
    AjouterItem(count++,"http://www.animenfo.com/search.php?query=","&queryin=anime_titles&action=Go&option=keywords","Anime/Manga: animenfo");
    AjouterItem(count++,"http://www.bedetheque.com/index.php?R=1&RechTexte=","&btRecherche=OK&RechSerie=&RechAuteur=&RechEditeur=&RechCollection=&RechStyle=&RechDL=&RechISBN=","Bds: bedetheque");
  
    //sélection du premier choix
    SendMessage(HComboBox,CB_SETCURSEL,(WPARAM )0,(LPARAM )0);  
    
    //enregistrement dans le fichier ini
    tmpcout[0]=0;
    count--;
    WritePrivateProfileString(CONF,"COUNT",itoa(count,tmpcout,10),Emplacement);
    while(count>-1)
    {
      sprintf(tmpTitre1,"URL_DEBUT%02d",count);
      sprintf(tmpTitre2,"URL_FIN%02d",count);
      sprintf(tmpTitre3,"TITRE%02d",count);

      WritePrivateProfileString(CONF,tmpTitre1,MesUrls[count].DebutUrl,Emplacement); 
      WritePrivateProfileString(CONF,tmpTitre2,MesUrls[count].FinUrl,Emplacement); 
      WritePrivateProfileString(CONF,tmpTitre3,TitreItem(count,tmp_bloc3,TAILLE_MAX_TITRE+1),Emplacement); 
      count--;
    }
  } 

  return 0;
}
//******************************************************************************
//fct de traitement
DWORD  WINAPI Exec(LPVOID lParam)
{
  unsigned int id = (unsigned int)lParam;
  char tmpcommande[TAILLE_MAX_CMD];
  char tmp[TAILLE_MAX_URL+1];  
  
  EnableWindow(Hbouton,0);
   
   //récupération de la recherche
   tmp[0]=0;
   GetWindowText(HText,tmp,TAILLE_MAX_URL);  
   
   if(MesUrls[id].DebutUrl[0]!='-')//le caractère --- spécifie un titre
   {
     //si un espace on converti par un +
     char *t = tmp;
     while(*t)
     {
       if (*t==' ')*t='+';
       *t++;
     }
  
     //création de la requête
     snprintf(tmpcommande,TAILLE_MAX_CMD,"%s%s%s",MesUrls[id].DebutUrl,tmp,MesUrls[id].FinUrl);

     //exécution
     ShellExecute(NULL,"Open",tmpcommande, NULL, NULL, SW_SHOWNORMAL); 
   }
   EnableWindow(Hbouton,1);
   
   return 0;
}

//******************************************************************************
//gestion des messages
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   if (message == WM_COMMAND && (LOWORD(wParam) == MSB_BOUTON || LOWORD(wParam) == IDOK) || message==WM_KEYDOWN && wParam == VK_RETURN)
   {
     
     CreateThread(0,0,Exec,(LPVOID)SendMessage(HComboBox,CB_GETCURSEL,(WPARAM )0,(LPARAM )0),0,0);
   }
   else if (message == WM_DESTROY)PostQuitMessage (0);
   else return DefWindowProc (hwnd, message, wParam, lParam);
   
   return 0;
}

//******************************************************************************
//création de la fenêtre principale
int WINAPI WinMain (HINSTANCE hThisInstance,HINSTANCE hPrevInstance,LPSTR lpszArgument,int nFunsterStil)
{       
    MSG messages;   
    WNDCLASS wincl;
    HWND hwnd;
    
    INITCOMMONCONTROLSEX icex;
    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
    icex.dwICC = ICC_USEREX_CLASSES;
    InitCommonControlsEx(&icex);

    wincl.style                     = CS_HREDRAW | CS_VREDRAW; 
    wincl.lpfnWndProc               = WindowProcedure;
    wincl.cbClsExtra                = 0;              
    wincl.cbWndExtra                = 0;      
    wincl.hInstance                 = Hinst = hThisInstance;
    wincl.lpszMenuName              = "";
    wincl.lpszClassName             = NOM_APPLI;
    wincl.hbrBackground             = (HBRUSH) COLOR_BACKGROUND;

    //chargement des icones (via les ressources)
    wincl.hIcon                     = (HICON)LoadIcon(hThisInstance, MAKEINTRESOURCE(A));
    wincl.hCursor                   = LoadCursor (NULL, IDC_ARROW);

    //on crée la classe (on l'enregistre)
    if(!RegisterClass(&wincl)) return FALSE;

    //création de la fenêtre              
    hwnd = CreateWindow(NOM_APPLI,NOM_APPLI,WS_OVERLAPPED| WS_SYSMENU,CW_USEDEFAULT, CW_USEDEFAULT, 400, 100,0, 0, hThisInstance, 0);
                        
    if (!hwnd) return FALSE;

    //création des éléments
    Hbouton = CreateWindow("BUTTON","Rechercher",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON	,290,45,90 ,23 , hwnd, (HMENU )MSB_BOUTON, hThisInstance, NULL);
    HText = CreateWindow("EDIT", "",WS_BORDER	|WS_CHILD |WS_VISIBLE|ES_LEFT ,10,9, 370, 23, hwnd, NULL, hThisInstance, NULL);
    HComboBox= CreateWindow(WC_COMBOBOXEX,"",CBS_DROPDOWN | CBS_DROPDOWNLIST | CBS_SIMPLE | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE,10,45, 260, 200, hwnd, NULL, hThisInstance, NULL);

    CreateThread(0,0,Chargement,0,0,0);

    //afficher la fenêtre
    ShowWindow (hwnd, nFunsterStil);
    UpdateWindow(hwnd);
    
    //appliquer le focus par défaut sur l'item
    SetFocus(HText);

    while (GetMessage (&messages, NULL, 0, 0))
    {
       if (!IsDialogMessage(hwnd, &messages))
       {
          TranslateMessage(&messages);
          DispatchMessage(&messages);
       }
    }

    return messages.wParam;
}
Pour les "Membres Club", vous pouvez télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip

13 avril 2008 15:09:02 :
- correction
16 avril 2008 12:50:37 :
- sauvegarde dans fichier ini+ news urls
16 avril 2008 12:53:51 :
- ajout du zip
  • signaler à un administrateur
    Commentaire de istamkenitra le 14/04/2008 10:22:38

    Merci pour ce prog ;)
    Fatigué de taper tout ça à la main à chaque fois que je veux chercher un truc :))
    Bravo

  • signaler à un administrateur
    Commentaire de omnia le 14/04/2008 12:09:11

    merci pour le commentaire :)

  • signaler à un administrateur
    Commentaire de f_l_a_s_h_b_a_c_k le 14/04/2008 18:22:27

    super!
    merci pour la source

    je recompile et je r'ajoute
    "to parent directory /"     .mp3 .nfo xvid etc...

  • signaler à un administrateur
    Commentaire de Akiramo le 22/04/2008 20:32:29

    Merci très beau prog

  • signaler à un administrateur
    Commentaire de omnia le 23/04/2008 12:33:35

    si vous avez des modification ou idées n'hésitez pas.

  • signaler à un administrateur
    Commentaire de Akiramo le 24/04/2008 19:33:33

    ben l'idée c'est de commercialiser ton produit.. il est vraiment utile

  • signaler à un administrateur
    Commentaire de omnia le 24/04/2008 21:56:06

    lol

    l'idée première n'est pas de moi et ce genre de projet n'en vaut pas le coup:p

    mdr :p

  • signaler à un administrateur
    Commentaire de hackeurdofus le 30/06/2008 14:38:35

    enfaites désolé mais je suis nul encore donc simple question à quoi sert ce programme!?!

  • signaler à un administrateur
    Commentaire de omnia le 30/06/2008 18:06:09

    LOL

    avant de poster merci de lire la description.


    simplement: ce programme permet d'effectuer des recherches avancés sur google, en plus j'y ai ajouter quelques autres sites pour effectuer des recherche.

    mdr :p

Ajouter un commentaire

Pub



Appels d'offres

Plugin Dialer outlook
Budget : 2 000€
Travail graphique- ill...
Budget : 1 000€
creation de marque et ...
Budget : 1 000€

CalendriCode

Juillet 2008
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

VS Express FR Gratuit !

VS Express en français et 100% gratuit !

Téléchargements

Boutique

Boutique de goodies CodeS-SourceS