Hook running programm..

Wohl das A & O in der Windows-Programmierung

Moderatoren: crack, Krüsty, Marwin

Beitragvon Ignat » Samstag 6. Dezember 2003, 23:14

Hi, everybody!
I need help!
How to make such system-hook: when you start some programm you make something operations..
I mean I want to hook event, when programm starts, and, for example, try to forbid running this programm.
Hm.. May be you know another way to forbid running some applications. The application may not have registry settings - just .EXE. I want to forbid running some EXE-files from my own programm..
Can you help me?
If the ship don't know where to go - it has no fair wind...
Ignat
Alter Hase
 
Beiträge: 80
Registriert: Samstag 2. August 2003, 11:13

Beitragvon CDW » Sonntag 7. Dezember 2003, 17:49

hm, here is some code to take a snapshot of all runnig progs:
Code: Alles auswählen
invoke   CreateToolhelp32Snapshot, TH32CS_SNAPPROCESS, 0   
 mov hSnapshot,eax
 .if eax!=-1
    mov uProcess.dwSize, sizeof uProcess
    
    invoke   Process32First, eax, ADDR uProcess
   
    .while eax
   lea edi,[uProcess.szExeFile]
   invoke SendDlgItemMessage,hWin,ID_PROGRAM_LIST,LB_ADDSTRING,0,edi
   invoke SendDlgItemMessage,hWin,ID_PROGRAM_LIST,LB_SETITEMDATA,eax,uProcess.th32ProcessID
   invoke   Process32Next, [hSnapshot], ADDR uProcess    
    .endw   

i think you can search for names too (at the moment i dont have any WINAPI-References)
see msdn specially CreateToolhelp32Snapshot
PS: you can make a timer-procedure or thread so you check all 0.5-1 seconds for the "false" program
CDW
Alter Hase
 
Beiträge: 62
Registriert: Donnerstag 2. Oktober 2003, 17:17


Zurück zu Windows-API


Social Bookmarking
Bookmark bei: Mr. Wong Bookmark bei: Del.icio.us Bookmark bei: Webnews Bookmark bei: Icio Bookmark bei: Oneview Bookmark bei: Linkarena Bookmark bei: Newskick Bookmark bei: Folkd Bookmark bei: Yigg Bookmark bei: Digg Bookmark bei: Reddit Bookmark bei: Simpy Bookmark bei: StumbleUpon Bookmark bei: Slashdot Bookmark bei: Netscape Bookmark bei: Furl Bookmark bei: Yahoo Bookmark bei: Spurl Bookmark bei: Google Bookmark bei: Blinklist Bookmark bei: Blogmarks Bookmark bei: Diigo Bookmark bei: Technorati Bookmark bei: Newsvine Bookmark bei: Blinkbits Bookmark bei: Ma.Gnolia Bookmark bei: Smarking Bookmark bei: Netvouz

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder

cron