Sign in to follow this  
Followers 0
shiftdel15589

How to know program make from Autoit

11 posts in this topic

Hi all man !

;)

I want make 1 script that it will scan all program in Task Mangager and if some program make from AutoIT, this program is alert !

Pls help me !

:whistle:

Share this post


Link to post
Share on other sites



Um? You want to make a program with autoit that checks if autoit is a program and alerts you?

Or you want it to alert you when xxxx exists? (which you could change)

This may be difficult if your new to programming, or pretty easy if your good at it :whistle: (im not..lol)

Share this post


Link to post
Share on other sites

Hi ! I want make a program with Autoit.

When it run, it will scan all in process, and if other program also make from Autoit, it will notice me.

Are you ok ?

Share this post


Link to post
Share on other sites

#Include <GUIConstants.au3> ;Includes the information that allows you to create windows and controls

$Window = GUICreate("Process Inspector", 128, 258+25) ;The main window
$List = GUICtrlCreateList("",2,2,124,222) ;Creates a large white box which lists strings in it
$ButtonRefresh = GUICtrlCreateButton("Refresh", 1,216,62,20)
$ButtonTrack = GUICtrlCreateButton("Track", 64,216,62,20)
$Input = GUICtrlCreateInput("",2,238,124,18)
$Close = GUICtrlCreateButton("Close Process",2,256,124,26)
GUISetState() ;Enables your window so its visible

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
    If $msg = $ButtonRefresh Then
        GUICtrlDelete($List)                        ;Recreates the list to 
        $List = GUICtrlCreateList("",2,2,124,222)   ;quickly clear the data
        $Processes = ProcessList()
        For $i = 1 To $Processes[0][0] 
            GUICtrlSetData($List,$Processes[$i][0])
        Next
    EndIf
    If $msg = $List then GUICtrlSetData($input, GUICtrlRead($list))
    If $msg = $buttontrack Then Track(GUICtrlRead($Input))
    If $msg = $Close Then 
        $i = Msgbox(1,"Closing","Are you sure you want to close this process?" & @LF & "WARNING: THIS COULD CAUSE SYSTEM INSTABILITY")
        If $i = 1 Then 
            ProcessClose(GUICtrlRead($input))
            If @Error Then
            msgbox(64,"Error","Could not terminate process")
            Else
            msgbox(64,"Success","Process has been terminated")
            EndIf
        EndIf
    EndIf
WEnd

Func Track($Track)
    GUISetState(@SW_MINIMIZE, $window)
    Do
        If ProcessExists($Track) Then 
            Msgbox(0,"",$Track & " exists")
            Exitloop
        EndIf
    Until ProcessExists($Track) OR $track = ""
    GUISetState(@SW_RESTORE, $window)
EndFunc

How this works, you press refresh to generate a list of processes... then you select the evil one (or type it into the input box), then close it, and then click Track. When it exists again it will notify you...

You could make it auto close as well, but I have to go

Good luck

Share this post


Link to post
Share on other sites

Oh ! Thanks Rad.

But above code only list all program are running.

But my suggestion is :

When it run, it will scan all in process, and if other program also make from Autoit, it will notice me.

Pls help me !

Share this post


Link to post
Share on other sites

The language barrier here is quite bad.

If you only want 1 instance of your application to be running, then look at _SingleTon() in the help file.

If you want to know if other AutoIt scripts/exe's are running other than yours, then you'll need to track your PID and then do something like:

;At the top of your script:
Global $MyAutoItPID = @AutoItPID

AdlibEnable('_FindOthers', 1000)

While 1
    Sleep(10000)
WEnd

Func _FindOthers()
    Local $aPL = ProcessList()
    Local $aWL = WinList(), $sHold
    For $iCC = 1 To UBound($aWL) - 1
        For $xCC = 1 To UBound($aPL) - 1
            If WinGetProcess($aWL[$iCC][1]) == $MyAutoItPID Then ContinueLoop
            If StringInStr($aWL[$iCC][0], 'AutoIt v3') And _
                WinGetProcess($aWL[$iCC][1]) = $aPL[$xCC][1] Then
                $sHold &= $aPL[$xCC][0] & @CRLF
            EndIf
        Next
    Next
    If $sHold Then MsgBox(64, 'Info', 'Other AutoIt Scripts/Exes running: ' & @CR & @CR & $sHold)
EndFunc
Might work.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Hi ! This is cool !

I was settle something out of court this problem.

Thanks all ! :whistle:

Share this post


Link to post
Share on other sites

Hi shiftdel15589

What you as is quite complex and contains some bits and pieces normaly not found in AutoIt. People has allready given you a clue about the ProcessList function.

Now what you have to figure ot is to find the executing image from the information you get returned from ProcessList. Then you have to read information from the executing image (like when you rightclick on it and select properties).

That is how I would have done it. I'm niut sure you will find all the bits and pieces here (althought I think so).

I'm affraide You will have to learn be an expert searcher before you have a working sample of your program.

Happy hunting :whistle:

Share this post


Link to post
Share on other sites

Hi shiftdel15589

What you as is quite complex and contains some bits and pieces normaly not found in AutoIt. People has allready given you a clue about the ProcessList function.

Now what you have to figure ot is to find the executing image from the information you get returned from ProcessList. Then you have to read information from the executing image (like when you rightclick on it and select properties).

That is how I would have done it. I'm niut sure you will find all the bits and pieces here (althought I think so).

I'm affraide You will have to learn be an expert searcher before you have a working sample of your program.

Happy hunting :whistle:

You'll find the one I posted, will find 99% of the autoit scripts and exe's that are running on your computer.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I know this prbly won't help , but to see if a executable was compiled with autoit you can check the exe resource versioninfo.. Even if the exe was compiled by scite and the version is changed using the reshack tab in compile the orig version information is not overwritten in the exe. Instead the exe gets a new version info resource added. So the original version info is still there. (orig = versioninfo 2057 , new = versioninfo 0)

Hard way to check it by this manner , and it doesn't mean a user couldn't remove the old version info manually after adding new version info. I use reshacker to extract the versioninfo 2057 , this way I can see if a exe is an auto it exe. But to do this with every running process could really be not feasable.

cheers

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0