begin process at 2010 02 09 18:34:28
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Api Windows

 > CACHER L'EXECUTION SOUS 9X/ME [MASM32]

CACHER L'EXECUTION SOUS 9X/ME [MASM32]


 Information sur la source

Note :
8,5 / 10 - par 2 personnes
8,50 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Api Windows Niveau :Expert Date de création :16/11/2002 Date de mise à jour :16/11/2002 15:33:20 Vu :4 035

Auteur : Cendra

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

 Description

tres pratique pour rendre invisible son programme :)
inutile de precisier dans quel but ...

Source

  • .386
  • .model flat,stdcall
  • option casemap:none
  • include \masm32\include\windows.inc
  • include \masm32\include\user32.inc
  • include \masm32\include\kernel32.inc
  • includelib \masm32\lib\user32.lib
  • includelib \masm32\lib\kernel32.lib
  • WinMain proto :DWORD,:DWORD,:DWORD,:DWORD
  • CacherProg proto
  • .data
  • ClassName db "SimpleWinClass",0
  • AppName db "Regarde les taches en cours ... ( marche juste avec win 9X/ME )",0
  • kernel_name DB "KERNEL32.DLL", 0
  • kernel_function DB "RegisterServiceProcess", 0
  • .data?
  • hInstance HINSTANCE ?
  • CommandLine LPSTR ?
  • .code
  • start:
  • invoke GetModuleHandle, NULL
  • mov hInstance,eax
  • invoke GetCommandLine
  • mov CommandLine,eax
  • invoke CacherProg
  • invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT
  • invoke ExitProcess,eax
  • WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD
  • LOCAL wc:WNDCLASSEX
  • LOCAL msg:MSG
  • LOCAL hwnd:HWND
  • mov wc.cbSize,SIZEOF WNDCLASSEX
  • mov wc.style, CS_HREDRAW or CS_VREDRAW
  • mov wc.lpfnWndProc, OFFSET WndProc
  • mov wc.cbClsExtra,NULL
  • mov wc.cbWndExtra,NULL
  • push hInstance
  • pop wc.hInstance
  • mov wc.hbrBackground,COLOR_WINDOW+1
  • mov wc.lpszMenuName,NULL
  • mov wc.lpszClassName,OFFSET ClassName
  • invoke LoadIcon,NULL,IDI_APPLICATION
  • mov wc.hIcon,eax
  • mov wc.hIconSm,eax
  • invoke LoadCursor,NULL,IDC_ARROW
  • mov wc.hCursor,eax
  • invoke RegisterClassEx, addr wc
  • INVOKE CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,\
  • WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,\
  • CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,\
  • hInst,NULL
  • mov hwnd,eax
  • invoke ShowWindow, hwnd,SW_SHOWNORMAL
  • invoke UpdateWindow, hwnd
  • .WHILE TRUE
  • invoke GetMessage, ADDR msg,NULL,0,0
  • .BREAK .IF (!eax)
  • invoke TranslateMessage, ADDR msg
  • invoke DispatchMessage, ADDR msg
  • .ENDW
  • mov eax,msg.wParam
  • ret
  • WinMain endp
  • WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
  • .IF uMsg==WM_DESTROY
  • invoke PostQuitMessage,NULL
  • .ELSE
  • invoke DefWindowProc,hWnd,uMsg,wParam,lParam
  • ret
  • .ENDIF
  • xor eax,eax
  • ret
  • WndProc endp
  • CacherProg PROC
  • LOCAL h_kernel:DWORD, addr_function:DWORD, return_val:DWORD
  • INVOKE GetModuleHandle, ADDR kernel_name
  • MOV h_kernel, EAX
  • INVOKE GetProcAddress, h_kernel, ADDR kernel_function
  • MOV addr_function, EAX
  • .IF EAX == NULL
  • MOV return_val, -1
  • .ELSE
  • PUSH 1
  • PUSH 0
  • CALL EAX
  • AND return_val, 0
  • .ENDIF
  • MOV EAX, return_val
  • RET
  • CacherProg ENDP
  • end start
.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

WinMain proto :DWORD,:DWORD,:DWORD,:DWORD
CacherProg proto

.data
ClassName db "SimpleWinClass",0
AppName  db "Regarde les taches en cours ... ( marche juste avec win 9X/ME )",0
kernel_name       DB "KERNEL32.DLL", 0
kernel_function   DB "RegisterServiceProcess", 0

.data?
hInstance HINSTANCE ?
CommandLine LPSTR ?
.code
start:
	invoke GetModuleHandle, NULL
	mov    hInstance,eax
	invoke GetCommandLine
	mov    CommandLine,eax
	invoke CacherProg
	invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT
	invoke ExitProcess,eax

WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD
	LOCAL wc:WNDCLASSEX
	LOCAL msg:MSG
	LOCAL hwnd:HWND
	mov   wc.cbSize,SIZEOF WNDCLASSEX
	mov   wc.style, CS_HREDRAW or CS_VREDRAW
	mov   wc.lpfnWndProc, OFFSET WndProc
	mov   wc.cbClsExtra,NULL
	mov   wc.cbWndExtra,NULL
	push  hInstance
	pop   wc.hInstance
	mov   wc.hbrBackground,COLOR_WINDOW+1
	mov   wc.lpszMenuName,NULL
	mov   wc.lpszClassName,OFFSET ClassName
	invoke LoadIcon,NULL,IDI_APPLICATION
	mov   wc.hIcon,eax
	mov   wc.hIconSm,eax
	invoke LoadCursor,NULL,IDC_ARROW
	mov   wc.hCursor,eax
	invoke RegisterClassEx, addr wc
	INVOKE CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,\
           WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,\
           CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,\
           hInst,NULL
	mov   hwnd,eax
	invoke ShowWindow, hwnd,SW_SHOWNORMAL
	invoke UpdateWindow, hwnd
	.WHILE TRUE
		invoke GetMessage, ADDR msg,NULL,0,0
		.BREAK .IF (!eax)
		invoke TranslateMessage, ADDR msg
		invoke DispatchMessage, ADDR msg
	.ENDW
	mov     eax,msg.wParam
	ret
WinMain endp

WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
	.IF uMsg==WM_DESTROY
		invoke PostQuitMessage,NULL
	.ELSE
		invoke DefWindowProc,hWnd,uMsg,wParam,lParam		
		ret
	.ENDIF
	xor eax,eax
	ret
WndProc endp

CacherProg     PROC
                LOCAL h_kernel:DWORD, addr_function:DWORD, return_val:DWORD
                INVOKE GetModuleHandle, ADDR kernel_name
                MOV h_kernel, EAX
                INVOKE GetProcAddress, h_kernel, ADDR kernel_function
                MOV addr_function, EAX
                .IF EAX == NULL
                      MOV return_val, -1
                .ELSE
                    PUSH 1
                    PUSH 0
                    CALL EAX

                    AND return_val, 0
               .ENDIF
                MOV EAX, return_val
                RET
CacherProg     ENDP

end start

 Conclusion

Cendra


 Sources du même auteur

Source avec Zip CALCUL DE LA FRÉQUENCE DU CPU [MASM32]
ICONE SYSTRAY [MASM] (ICONE PERSONNALISABLE)

 Sources de la même categorie

Source avec Zip OBTENIR LA VERSION DU SYSTEME,SON ENVIRONNEMENT,LE SERVICE P... par ToutEnMasm
Source avec Zip TÉLÉCHARGER UN FICHIER DEPUIS UNE URL ET/OU ORGANISER DES CL... par ToutEnMasm
SCREENSHOT CAPTURE D'ECRAN par VBFRANCE
Source avec Zip Source avec une capture PROGRAMME DE VISUALISATION ET D'ANALYSE SPECTRALE DE FICHIER... par Nasman
Source avec Zip CRÉATION DE GRAPHIQUES AVEC LES API WINDOWS par Nasman

Commentaires et avis

Commentaire de Stormy le 17/11/2002 22:07:14

Etrangement, je travail sur le même projet depuis peu. A croire que nous avons décortiqué une source identique sur Iczelion (Remote) Je me trompe? Néanmoins, cette méthode trompe seulement l'habituel Ctrl-Alt-Sup. D'autres applications plus "maligne" utilisent les allocations mémoires pour référencer. C'est cool tout de même!

Commentaire de gg00xiv le 17/11/2002 22:46:22

les instruction if, then else, etc ... je me demande si c vraiment de l'assembleur tout ca, ou c simplement pour se donner un genre que ya kelkeu mov de temps en temps

Commentaire de Stormy le 18/11/2002 22:09:56

Ne sois pas si négatif gg00xiv. Le principe et le geste sont pertinent. C'est vrai qu'il ya 80% de code en trop mais bon...c cool @+

Commentaire de TheLudo2013 le 05/09/2003 09:29:27

Ah, il m'a bien fallu 5 min pour comprendre ce que faisait la source :s. Enfin bref je tiens a dire que j'utilise exactement la meme méthode en c et que ca tiens en 3 lignes...
@++

Commentaire de Cendra le 05/09/2003 19:17:47

oui on peu le réduire à ca :

kernel_name      DB "KERNEL32.DLL", 0
kernel_function  DB "RegisterServiceProcess", 0

                INVOKE GetModuleHandle, ADDR kernel_name
                INVOKE GetProcAddress, EAX, ADDR kernel_function
                MOV addr_function, EAX

Commentaire de Soda le 19/12/2007 11:18:32

Merci pour la source, mais comment faire le même chose sous XP ou Vista?

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Février 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728

Consulter la suite du CalendriCode

 
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 : 0,655 sec (4)

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