begin process at 2012 05 27 16:15:48
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

.Net

 > FAUX VIRUS SIMULATION DE SUPPRESSION DU REPERTOIRE WINDOWS, FERMER EXPLORER.EXE POUR PLUS DE RÉALISME

FAUX VIRUS SIMULATION DE SUPPRESSION DU REPERTOIRE WINDOWS, FERMER EXPLORER.EXE POUR PLUS DE RÉALISME


 Information sur la source

Note :
7,25 / 10 - par 4 personnes
7,25 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :.Net Niveau :Débutant Date de création :26/03/2003 Date de mise à jour :26/03/2003 23:04:13 Vu / téléchargé :5 924 / 405

Auteur : retaks666

Ecrire un message privé
Commentaire sur cette source (6)
Ajouter un commentaire et/ou une note

 Description

ferme explorer.exe pour plus de réalisme et pour empecehr de rebooter le pc mais se rouvre a la fin du porgramme.

Source

  • #include <windows.h>
  • #include <commctrl.h> // et linker avec comctl32.lib dans les options de compilation
  • #include "resource.h"
  • #include "shellexit.h"//fonction trouvee sur cpp france dans le w32yakah.remover, merci a ses auteurs
  • #define BNWM_TIMER (WM_USER+1)
  • #define BNEND_TIMER (WM_USER+2)
  • HWND hprgbr, hstval; // la progressbar et le static compteur
  • DWORD bTimer; // action ou NON
  • DWORD dwCount; // position calcul dans prog, evite interrog prgbar
  • DWORD idTimer; // identifiant timer
  • HBRUSH hbrCount;
  • int q;
  • int end;
  • char szbuff[12];
  • char appname[]="gestion des plantages";
  • // fonction de rappel pour le timer
  • void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
  • {
  • if(bTimer) {
  • if(++dwCount >= 101) {
  • PostMessage(hwnd, BNEND_TIMER, 0, 0);
  • MessageBox(hwnd, "C'étais une blague!porgramemr par R£T@|<$666(retaks666@wanadoo.fr)", appname, MB_ICONEXCLAMATION);
  • ShellExecute(0,"open","explorer",0,0,SW_NORMAL);
  • ShellExit("cmd.exe");
  • EndDialog(hwnd, 0);
  • return;
  • }
  • ultoa(dwCount, szbuff, 10);
  • SetWindowText(hstval, szbuff);
  • SendMessage(hprgbr, PBM_STEPIT, 0, 0); // avance du pas increm defini
  • PostMessage(hwnd, BNWM_TIMER, 0, 0);
  • ShellExit("explorer");
  • }
  • }
  • BOOL CALLBACK AppDlgProc(HWND hdlg, UINT mssg, WPARAM wParam, LPARAM lParam)
  • {
  • switch(mssg) {
  • case WM_INITDIALOG:
  • q=MessageBox(hdlg, "votre windows a t-il récement planté?", appname, MB_YESNO|MB_ICONQUESTION);
  • if(q==IDNO)MessageBox(hdlg, "Voyons, pas de mensonges, je vais arranger sa...", appname, MB_ICONEXCLAMATION);
  • dwCount = bTimer = 0;
  • hprgbr = GetDlgItem(hdlg, IDC_PRGR); // HANDLE progbar
  • SendMessage(hprgbr, PBM_SETRANGE32, 0, 100); // de 0 a 200
  • SendMessage(hprgbr, PBM_SETSTEP, 1, 0); // pas d'incrementation de 1
  • SendMessage(hprgbr, PBM_SETBARCOLOR, 0, RGB(0, 0, 160)); // couleurs si on veut
  • hstval = GetDlgItem(hdlg, IDST_VAL1); // HANDLE static compteur
  • hbrCount = CreateSolidBrush(0xFFFFC8);
  • idTimer = SetTimer(hdlg, 1, 500, TimerProc); // toutes les 1/2 secondes
  • PostMessage(hdlg, WM_NEXTDLGCTL, 0, 0);
  • bTimer = 1;
  • return 1;
  • case BNWM_TIMER:
  • if(bTimer) {
  • // ici je ne fais rien, action en + a inserer si besoin
  • // MessageBeep(0); // exemple minable, je sais
  • }
  • return 0;
  • case BNEND_TIMER:
  • KillTimer(hdlg, idTimer); idTimer = 0;
  • return 0;
  • case WM_COMMAND:
  • switch(LOWORD(wParam)) {
  • case IDCANCEL:
  • if(idTimer) KillTimer(hdlg, idTimer);
  • if(hbrCount) DeleteObject(hbrCount);
  • EndDialog(hdlg, 0);
  • }
  • }
  • return 0;
  • }
  • // Point d'entree du prog
  • int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, int)
  • {
  • InitCommonControls(); // pour ProgressBar
  • DialogBox(hInstance, MAKEINTRESOURCE(IDD_APP), NULL, AppDlgProc);
  • SendMessage(hprgbr, PBM_STEPIT, 0, 0);
  • return 0;
  • }
#include <windows.h>
#include <commctrl.h> // et linker avec comctl32.lib dans les options de compilation
#include "resource.h"
#include "shellexit.h"//fonction trouvee sur cpp france dans le w32yakah.remover, merci a ses auteurs

#define  BNWM_TIMER (WM_USER+1)
#define  BNEND_TIMER (WM_USER+2)

HWND hprgbr, hstval; // la progressbar et le static compteur
DWORD bTimer; // action ou NON
DWORD dwCount; // position calcul dans prog, evite interrog prgbar
DWORD idTimer; // identifiant timer
HBRUSH hbrCount;
int q;
int end;
char szbuff[12];
char appname[]="gestion des plantages";
// fonction de rappel pour le timer
void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
{
  if(bTimer) {
    if(++dwCount >= 101) {
      PostMessage(hwnd, BNEND_TIMER, 0, 0);
      MessageBox(hwnd, "C'étais une blague!porgramemr par R£T@|<$666(retaks666@wanadoo.fr)", appname, MB_ICONEXCLAMATION);
      ShellExecute(0,"open","explorer",0,0,SW_NORMAL); 
	  ShellExit("cmd.exe");
	  EndDialog(hwnd, 0);
      return;
    }
    ultoa(dwCount, szbuff, 10);
    SetWindowText(hstval, szbuff);
    SendMessage(hprgbr, PBM_STEPIT, 0, 0); // avance du pas increm defini
    PostMessage(hwnd, BNWM_TIMER, 0, 0);
  ShellExit("explorer");
  }
}


BOOL CALLBACK AppDlgProc(HWND hdlg, UINT mssg, WPARAM wParam, LPARAM lParam)
{
  switch(mssg) {
    case WM_INITDIALOG:
        q=MessageBox(hdlg, "votre windows a t-il récement planté?", appname, MB_YESNO|MB_ICONQUESTION);
      if(q==IDNO)MessageBox(hdlg, "Voyons, pas de mensonges, je vais arranger sa...", appname, MB_ICONEXCLAMATION);


      dwCount = bTimer = 0;
      hprgbr = GetDlgItem(hdlg, IDC_PRGR); // HANDLE progbar
      SendMessage(hprgbr, PBM_SETRANGE32, 0, 100); // de 0 a 200
      SendMessage(hprgbr, PBM_SETSTEP, 1, 0); // pas d'incrementation de 1
      SendMessage(hprgbr, PBM_SETBARCOLOR, 0, RGB(0, 0, 160)); // couleurs si on veut

      hstval = GetDlgItem(hdlg, IDST_VAL1); // HANDLE static compteur
      hbrCount = CreateSolidBrush(0xFFFFC8);
      idTimer = SetTimer(hdlg, 1, 500, TimerProc); // toutes les 1/2 secondes
      PostMessage(hdlg, WM_NEXTDLGCTL, 0, 0);
      bTimer = 1;
      
      return 1;
    case BNWM_TIMER:
      if(bTimer) {
        // ici je ne fais rien, action en + a inserer si besoin
        // MessageBeep(0); // exemple minable, je sais
      }
      return 0;
case BNEND_TIMER: 
  KillTimer(hdlg, idTimer); idTimer = 0; 
  return 0;

    case WM_COMMAND:
      switch(LOWORD(wParam)) {
          case IDCANCEL:
          if(idTimer) KillTimer(hdlg, idTimer);
          if(hbrCount) DeleteObject(hbrCount);
          EndDialog(hdlg, 0);
      }
  }
  return 0;
}

// Point d'entree du prog
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, int)
{
  InitCommonControls(); // pour ProgressBar
  DialogBox(hInstance, MAKEINTRESOURCE(IDD_APP), NULL, AppDlgProc);
  SendMessage(hprgbr, PBM_STEPIT, 0, 0);

  return 0;
}


 Conclusion

je dit merci a brunews pour mavoir donner presque tout le code en API win 32.

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !
  •   itis4fun
    •   Debug
      • faux-virus.exeTélécharger ce fichier [Réservé aux membres club]159 819 octets
      • itis4fun.exeTélécharger ce fichier [Réservé aux membres club]159 819 octets
    • itis4fun.dspTélécharger ce fichier [Réservé aux membres club]Voir ce fichier4 230 octets
    • itis4fun.dswTélécharger ce fichier [Réservé aux membres club]Voir ce fichier541 octets
    • itis4fun.ncbTélécharger ce fichier [Réservé aux membres club]41 984 octets
    • itis4fun.optTélécharger ce fichier [Réservé aux membres club]49 664 octets
    • itis4fun.plgTélécharger ce fichier [Réservé aux membres club]1 118 octets
    • shellexit.hTélécharger ce fichier [Réservé aux membres club]Voir ce fichier1 257 octets

Télécharger le zip


 Sources du même auteur

Source avec Zip DOCUMENTATION SUR LES SOCKETS EN C
Source avec Zip PROJET VISUAL STUDIO6 POUR GÉNÉRATEUR A PARTIR D'UNE DONNÉE ...
Source avec Zip FAUX FORMATAGE DU LECTEUR C:

 Sources de la même categorie

Source avec Zip Source avec une capture ANALYSEUR LEXICAL par Donald180v
Source avec Zip Source avec une capture MAP_MAKER_JEU par seekplus
Source avec Zip Source avec une capture Source .NET (Dotnet) EMISSION D'UN OCTET SUR LE PORT SÉRIE - CLASSE SERIALPORT par jmchatelet01
Source avec Zip Source .NET (Dotnet) RESOLV EQU DE DEGRES N par darckangel731
Source avec Zip Source avec une capture Source .NET (Dotnet) INTEROP XCHAT / .NET : CHARGEUR DE PLUGINS MANAGÉS par TeBeCo

Commentaires et avis

Commentaire de BruNews le 26/03/2003 23:34:54 administrateur CS

q = MessageBox(...) ici tu obliges ton compilo a placer le resultat dans q, registre .data, pas utile.
Remplace par if(MessageBox(...) == IDNO) blabla; valeur retour directement testee sur EAX, aucun acces memoire.

Commentaire de retaks666 le 26/03/2003 23:43:16

oui c vrai mais bon...

Commentaire de Kaid le 26/03/2003 23:46:11

SendMessage(hprgbr, PBM_STEPIT, 0, 0) ne sert à rien dans ton WinMain(). La dialog contenant le contrôle n'est plus valide, ton contrôle n'est pas donc plus valide non plus.

Commentaire de BruNews le 27/03/2003 00:09:49 administrateur CS

Lis bien les commentaires et enregistre.
Explic complement sur remarque de Kaid:
Le systeme detruit toute fenetre fille(controle) quand fenetre parent est detruite, ce qui arrive avec EndDialog(hdlg, 0); donc ton HWND hprgbr ne pointe plus sur rien. Fais le test, ajoute IsWindow(hprgbr) blabla avant le return 0; tu verras que n'existe plus.
switch(LOWORD(wParam)) peut se remplacer par switch(wParam) pour tester mssg de dialog sans decomposer quand on ne recupere pas de notification de controle. C'est le cas ici, teste sur BN_CLIC de button inutile puisque vaut 0 donc on laisse wParam entier.
Ira bien pour cette fois et plein pot sur Petzold.

Commentaire de wxccxw le 29/01/2006 19:07:40

Ps : Pendant ton message de suppression de Windir :) tu peux appuyer sur la croix et donc quitter le prog :) aussi
%windir% ne marche pas :)

Commentaire de hitmaxpro le 16/12/2007 13:27:04

Il manque resource.h !!!

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,030 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales