Sign in to follow this  
Followers 0
ashley

New Process

8 posts in this topic

I need to check the process list and then check them against my file.

My file is like this:

wow.exe ; Trusted

something.exe ; No action

something1.exe ; Untrusted

ect...

I need to check the processes and if its in my list as untrusted, then exit process.

If its in not in my file then i have some code to add them to files.

How would i do this?

Thanks in advance

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@ashley

ProcessList , FileWrite , FileRead

Edit : Example

Write processlist in a file,

wait some sec and do another processlist then check for all line if the process is in.. :)

Cheers, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I need to check the process list and then check them against my file.

My file is like this:

wow.exe ; Trusted

something.exe ; No action

something1.exe ; Untrusted

ect...

I need to check the processes and if its in my list as untrusted, then exit process.

If its in not in my file then i have some code to add them to files.

How would i do this?

Thanks in advance

Quick and Dirty:

#include <Array.au3>
#include <file.au3>
$strComputer = "."
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2")
$colProcessList = $objWMIService.ExecQuery("Select * from Win32_Process")
$file = fileopen("C:\process.txt",0)
If $file = -1 Then
    MsgBox(0, "Error", "Unable To Open File.")
    Exit
EndIf
Dim $procarray[1][2]
$icount = 1
$i = 0
While 1
    $line = FileReadLine($file)
    If @Error = -1 Then ExitLoop
    $tempArray = StringSplit($line,";") 
    $procArray[$i][0] = $tempArray[1]
    $procArray[$i][1] = $tempArray[2]
    $icount = $icount + 1
    $i = $i + 1
    ReDim $procArray[$iCount][2]
WEnd
FileCLose($file)

;_ArrayDisplay($procArray)
For $objProcess In $colProcessList
    ConsoleWrite($objProcess.Name)
    For $iSearch = 0 To UBound($procArray)-1
        If $objProcess.Name = $procArray[$iSearch][0] Then
            ConsoleWrite(@TAB & "<---" & $procArray[$iSearch][1])
        EndIf
    Next
    ConsoleWrite(@CRLF)
Next

C:\process.txt

explorer.exe;No Action
csrss.exe;No Action
Edited by azure

Share this post


Link to post
Share on other sites

I would probably store the list as an ini, then use InireadSection to grab the process names and corresponding actions with the ini being something like...

[processes]

explorer.exe=No Action

some process.exe=Untrusted

WOW.exe=Trusted


_________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell

Share this post


Link to post
Share on other sites

I would probably store the list as an ini, then use InireadSection to grab the process names and corresponding actions with the ini being something like...

[processes]

explorer.exe=No Action

some process.exe=Untrusted

WOW.exe=Trusted

would this be eaiser?

Share this post


Link to post
Share on other sites

Ashley, my patience with you is gone ....

You know better than to be impatient on these forums.

You either start doing the scripting yourself and ask questions about the stuff you have tried to solve yourself first or please just ga away.

*click*


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0