-
Posts
211 -
Joined
-
Last visited
Everything posted by logmein
-
@Malkey and @kylomas Wow, thanks for your scripts! It's nice and simple! :thumbsup: @spudw2k Uhm, I understood. Thanks!
-
Mod, please close this thread.
-
No one cares?
-
Thank you! It's nice!
-
Hi there! I have been learning linear algebra in my university for months. The subject was rather hard, I did't understand it much so I sent a email to my teacher to ask him. But I realized that typing a matrix by text was extremely hard. I don't want to make a LaTex function, save to a file, attach it to the mail, bla bla bla!!! It's complicated! So I spent 2 hours yesterday to make this tool. Just type the number of lines and columns and matrix values, it will generate a quite nice matrix in ASCII characters Enjoy! Notes: It will rearrage your numbers to straight columns. 1x1 will cause error. ConsoleWrite (@CRLF & '------------------------------------MATRIX TEST-----------------------------------------' &@CRLF) Dim $c = 6;column Dim $l = 4;line Dim $n = '1,6,2,4,b,a,7,6,6,0,44,4,6,3,6,2,6,8,9,6,6,1,2,logmein' $split = StringSplit ($n,',') If $c * $l <> $split[0] Then ConsoleWrite ('! Matrix values number do not match the columns and lines !' & @CRLF) Exit EndIf Dim $char[$l][$c], $len[$l][$c], $maxlen[$c][3] For $i = 0 To $l-1 For $u = 0 To $c -1 $v = $i*($c) + $u +1 $char[$i][$u] = $split[$v] $len[$i][$u] = StringLen ($split[$v]) If $len[$i][$u] > $maxlen[$u][0] Then $maxlen[$u][0] = $len[$i][$u] $maxlen[$u][1] = $i $maxlen[$u][2] = $u EndIf Next Next Local $finallen For $u = 0 To $c - 1 $finallen += $maxlen[$u][0] Next ConsoleWrite (' _' & _Repeat(' ',$finallen + $c) & '_' & @CRLF) For $i = 0 To $l-1;write lines For $u = 0 To $c-1;write columns $v = $i*($c) + $u +1 $char[$i][$u] = $split[$v] Switch $u Case 0; the first column If StringLen ($char[$i][$u])<$maxlen[$u][0] Then ConsoleWrite ('| ' & $char[$i][$u] & _Repeat(' ', $maxlen[$u][0]-StringLen ($char[$i][$u])+1)) Else ConsoleWrite ('| ' & $char[$i][$u] & ' ') EndIf Case 1 To $c-2 ;middle columns If $i > 0 Then If StringLen ($char[$i][$u]) < $maxlen[$u][0] Then ConsoleWrite ($char[$i][$u] & _Repeat(' ', $maxlen[$u][0]-StringLen ($char[$i][$u])+1)) Else ConsoleWrite ($char[$i][$u] & ' ' ) EndIf Else If StringLen ($char[$i][$u]) < $maxlen[$u][0] Then ConsoleWrite ($char[$i][$u] & _Repeat(' ', $maxlen[$u][0]-StringLen ($char[$i][$u])+1)) Else ConsoleWrite ($char[$i][$u] & ' ' ) EndIf EndIf Case Else ; the last column If StringLen ($char[$i][$u])<$maxlen[$u][0] Then ConsoleWrite ($char[$i][$u] & _Repeat(' ', $maxlen[$u][0]-StringLen ($char[$i][$u])+1) & ' |' & @CRLF) Else ConsoleWrite ($char[$i][$u] & ' |' & @CRLF) EndIf EndSwitch Next Next ConsoleWrite ('|_' & _Repeat(' ',$finallen + $c ) & '_|' & @CRLF) Func _Repeat($chars, $times);repeat a character in a specified time Local $rChar For $a = 1 To $times $rChar &= $chars Next Return $rChar EndFunc ;==>_Repeat
-
Okay, Aha, 91 posts to go
-
This program is not a joke, I use it to lock my computer when I want to study because I often lose focus on my homework. Lock it, can not play game, chat on Facebook anymore, just study!
-
Hi there! I created this stuff for anyone who wants to lock down their computer for a period of time. Very useful for parents to lock their son's computer It is very hard to terminate the program by Task Manager because it blocks your input every second and even shutting down Windows is useless because it starts on WIndows startup. Enjoỳ̀̀̀̀̀̀̀̀̀̀̀̀̀̀ <snip> To use it, please compile. Hey, my member's title is "Polymath", what does it mean?
-
A small stuff to hide your screen immediately:D
logmein replied to logmein's topic in AutoIt Example Scripts
^^ I often use Alt+F4 to close YouTube browser windows but it often gives a message prompt and I was caught by my teacher -
Just to hide your current desktop screen from being seen by someone. Just press Alt+Space and you're reading the NY Times or editing a Excel Spreadsheet! Code here: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=D:Hider.exe #AutoIt3Wrapper_Outfile_x64=D:Hider64.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Compile_Both=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Opt('TrayMenuMode',3) $about = TrayCreateItem ('&About') $exit = TrayCreateItem ('&Exit') HotKeySet ('!{Space}','_go') HotKeySet ('{esc}','_quit') While 1 Sleep (100) $msg = TrayGetMsg () Switch $msg Case $exit Exit Case $about MsgBox (64,'Screen Hider 1.0',StringFormat('SCREEN HIDER 1.0rnAuthor: Minh Thanh Huynh from autoitscript.com/forumrnEmail: minhthanh.autoit@gmail.comrnrnTo immediately change your screen, press Alt+Space and press Esc to quit. Watch your back! :D')) EndSwitch WEnd Func _go() $img = Random (1,5,1) SplashImageOn ('',$img & '.bmp',@DesktopWidth,@DesktopHeight,0,0,1) EndFunc Func _quit () SplashOff () EndFunc And here are some neccessary images: http://www.mediafire.com/?kssbhzyrq1l3d7s Have fun!^^ P/S: Hmm... My x64 executable file have been detected as a virus by AVG!
-
Thank you! It's very nice of you to help me! I'm learning SQLite now. I want my program is a simple stuff to search for fake process name. It's enough because to analyze a process deeply need tons of hard-working and a good knowledge in programming and antivirus.
-
Thanks about your help, dany:) My 'database' is created on some fake processes. Example: there is a Windows' process named csrss.exe but many virus create a fake process: csrse.exe. I think the tool's name should be... Fake Process Scanner:) It's better and much more helpful:) Uhm... You're right. I'll change the 'database' completely. But it's rather hard because of lack of time. I'm a student in University, I have to do a lot of social works in my spare time. Haha:D my stupid mistake! Sorry for my bad English! This is right because it's dangerous to shutdown a process. And this tool is not tested much yet! Finally, thanks you dany!
-
And if you found any "false positives" case, please post it here! Thanks!
-
This is not a real program, it's just a small tool, I make it as simple as possible for newbies to learn and understand. Moreover, this is a open-source tool, so it's unnecessary to encrypt the database:)
-
Malware Scanner Features: - Can detect over 500 malware's known fake processes. - Very small and easy to use. Note: 1. Some processes can be found as false positives. 2. Terminating a process may cause undesired results such as system's malfunction or shutdown. Please be careful! 3. This program is ONLY for advanced users! 4. Only tested on Windows 7 Home Premium, I need your testing result on other OS and machines! 5. This is only a tool just to check for fake processes by their name. Source Code: ;Malware Scanner ;1.0.0 ;3 Sep 2012 ;8:36 ;logmein ;AutoIT 3.3.8.1 #NoTrayIcon #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <ListViewConstants.au3> #include <GuiListView.au3> Global $TITLE = 'Malware Scanner', $VERSION = '1.0.0' #Region ### START Koda GUI section ### Form=C:Program Files (x86)AutoIt3SciTEKodaFormsForm1.kxf $formMain = GUICreate($TITLE & ' ' & $VERSION, 762, 376, Default, Default) GUISetFont(10, 400, 0, "Arial") $Label1 = GUICtrlCreateLabel("Scan your system for malware's processes:", 8, 8, 257, 20) $btnScan = GUICtrlCreateButton("&Scan", 8, 32, 83, 25) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $btnAbout = GUICtrlCreateButton("&About", 96, 32, 75, 25) $Group1 = GUICtrlCreateGroup("Result", 8, 64, 745, 305, -1, $WS_EX_TRANSPARENT) $tabMain = GUICtrlCreateTab(16, 88, 729, 273) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $tabProcess = GUICtrlCreateTabItem("&Process") $listProcess = GUICtrlCreateListView("Name|PID|Path", 24, 120, 714, 206) $hdlListProcess = GUICtrlGetHandle(-1) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 200) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 400) GUICtrlSetFont(-1, 10, 400, 0, "Arial") ;$btnKill = GUICtrlCreateButton("&Kill", 584, 328, 75, 25) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $btnKill = GUICtrlCreateButton("&Kill", 664, 328, 75, 25) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlCreateTabItem("") GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btnScan _Scan() Case $btnKill _EndProcess () Case $btnAbout MsgBox (64,'About',StringUpper($TITLE) & @CRLF & 'Version: ' & $VERSION & @CRLF & 'Author: logmein (AutoITScript.com)' & @crLf & 'Special Thanks to: PsaltyDS' & @CRLF &@CRLF &'To report any suspicious process or false positives, please contact me at: minhthanh.autoit@gmail.com. I appreciate your help!','',$formMain) EndSwitch WEnd Func _scan () _GUICtrlListView_DeleteAllItems ($hdlListProcess) If Not FileExists ('database.3db') Then MsgBox (32,$TITLE,'Database not found!','',$formMain) Return EndIf ProgressOn ($TITLE,'Scanning for suspicious processes...','',Default,Default,18) $processlist = _ProcessListProperties() $read = FileRead ('database.3db') $split = StringSplit ($read,@CRLF) If $processlist[0][0] <> 0 Then For $i = 1 To $processlist[0][0] ProgressSet (Int($i*100/$processlist[0][0]),$processlist[$i][0]) For $u =1 To $split[0] if $processlist[$i][0] = $split[$u] Then $index = _GUICtrlListView_AddItem($hdlListProcess, $processlist[$i][0]);name _GUICtrlListView_AddSubItem($hdlListProcess, $index, $processlist[$i][1], 1);pid _GUICtrlListView_AddSubItem($hdlListProcess, $index, $processlist[$i][5], 2);path EndIf Next Next ProgressOff () Else MsgBox(32, $TITLE, 'Can''t build process list!') EndIf EndFunc Func _EndProcess() $select = _GUICtrlListView_GetSelectedIndices($hdlListProcess, 'True');Retrieve indices of selected item (position) If $select[0] <> 0 Then $Msg = MsgBox(16 + 4, $TITLE, 'Are you sure to end this process? Ending a process will cause undesired result!', '', $formMain) If $Msg = 6 Then $GetItem = _GUICtrlListView_GetItem($hdlListProcess, $select[1], 1);retrieve process ID to be closed MsgBox (64,$GetItem[3],'') ProcessClose($GetItem[3]) If Not @error Then _GUICtrlListView_DeleteItem($hdlListProcess, $select[1]) MsgBox(64, $TITLE, 'Process ended!', '', $formMain) ;_log($GetItem[3], 5) Else MsgBox(16, $TITLE, 'Can not end this process!', '', $formMain) EndIf EndIf EndIf EndFunc ;==>_EndProcess ;=============================================================================== ; Function Name: _ProcessListProperties() ; Description: Get various properties of a process, or all processes ; Call With: _ProcessListProperties( [$Process [, $sComputer]] ) ; Parameter(s): (optional) $Process - PID or name of a process, default is "" (all) ; (optional) $sComputer - remote computer to Get list from, default is local ; Requirement(s): AutoIt v3.2.4.9+ ; Return Value(s): On Success - Returns a 2D array of processes, as in ProcessList() ; with additional columns added: ; [0][0] - Number of processes listed (can be 0 If no matches found) ; [1][0] - 1st process name ; [1][1] - 1st process PID ; [1][2] - 1st process Parent PID ; [1][3] - 1st process owner ; [1][4] - 1st process priority (0 = low, 31 = high) ; [1][5] - 1st process executable path ; [1][6] - 1st process CPU usage ; [1][7] - 1st process memory usage ; [1][8] - 1st process creation date/time = "MM/DD/YYY hh:mm:ss" (hh = 00 to 23) ; [1][9] - 1st process command line string ; ... ; [n][0] thru [n][9] - last process properties ; On Failure: Returns array with [0][0] = 0 and sets @Error to non-zero (see code below) ; Author(s): PsaltyDS at http://www.autoitscript.com/forum ; Date/Version: 12/01/2009 -- v2.0.4 ; Notes: If an integer PID or string process name is provided and no match is found, ; Then [0][0] = 0 and @error = 0 (not treated as an error, same as ProcessList) ; This function requires admin permissions to the target computer. ; All properties come from the Win32_Process class in WMI. ; To Get time-base properties (CPU and Memory usage), a 100ms SWbemRefresher is used. ;=============================================================================== Func _ProcessListProperties($Process = "", $sComputer = ".") Local $sUserName, $sMsg, $sUserDomain, $avProcs, $dtmDate Local $avProcs[1][2] = [[0, ""]], $n = 1 ; Convert PID If passed as string If StringIsInt($Process) Then $Process = Int($Process) ; Connect to WMI and Get process objects $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy, (Debug)}!" & $sComputer & "rootcimv2") If IsObj($oWMI) Then ; Get collection processes from Win32_Process If $Process == "" Then ; Get all $colProcs = $oWMI.ExecQuery("select * from win32_Process") ElseIf IsInt($Process) Then ; Get by PID $colProcs = $oWMI.ExecQuery("select * from win32_Process where ProcessId = " & $Process) Else ; Get by Name $colProcs = $oWMI.ExecQuery("select * from win32_Process where Name = '" & $Process & "'") EndIf If IsObj($colProcs) Then ; Return for no matches If $colProcs.count = 0 Then Return $avProcs ; Size the array ReDim $avProcs[$colProcs.count + 1][10] $avProcs[0][0] = UBound($avProcs) - 1 ; For each process... For $oProc In $colProcs ; [n][0] = process name $avProcs[$n][0] = $oProc.name ; [n][1] = process PID $avProcs[$n][1] = $oProc.ProcessId ; [n][2] = Parent PID $avProcs[$n][2] = $oProc.ParentProcessId ; [n][3] = owner ;If $oProc.GetOwner($sUserName, $sUserDomain) = 0 Then $avProcs[$n][3] = $sUserDomain & "" & $sUserName ; [n][4] = Priority $avProcs[$n][4] = $oProc.Priority ; [n][5] = Executable path $avProcs[$n][5] = $oProc.ExecutablePath ; [n][8] = Creation date/time $dtmDate = $oProc.CreationDate If $dtmDate <> "" Then ; Back referencing RegExp pattern from weaponx Local $sRegExpPatt = "A(d{4})(d{2})(d{2})(d{2})(d{2})(d{2})(?:.*)" $dtmDate = StringRegExpReplace($dtmDate, $sRegExpPatt, "$2/$3/$1 $4:$5:$6") EndIf $avProcs[$n][8] = $dtmDate ; [n][9] = Command line string $avProcs[$n][9] = $oProc.CommandLine ; increment index $n += 1 Next Else SetError(2); Error getting process collection from WMI EndIf ; release the collection object $colProcs = 0 ; Get collection of all processes from Win32_PerfFormattedData_PerfProc_Process ; Have to use an SWbemRefresher to pull the collection, or all Perf data will be zeros Local $oRefresher = ObjCreate("WbemScripting.SWbemRefresher") $colProcs = $oRefresher.AddEnum($oWMI, "Win32_PerfFormattedData_PerfProc_Process").objectSet $oRefresher.Refresh ; Time delay before calling refresher Local $iTime = TimerInit() Do Sleep(20) Until TimerDiff($iTime) >= 100 $oRefresher.Refresh ; Get PerfProc data For $oProc In $colProcs ; Find it in the array For $n = 1 To $avProcs[0][0] If $avProcs[$n][1] = $oProc.IDProcess Then ; [n][6] = CPU usage $avProcs[$n][6] = $oProc.PercentProcessorTime ; [n][7] = memory usage $avProcs[$n][7] = $oProc.WorkingSet ExitLoop EndIf Next Next Else SetError(1); Error connecting to WMI EndIf ; Return array Return $avProcs EndFunc ;==>_ProcessListProperties And the most important part: Database, see attached file. Download, extract and put it into your @ScriptDir. Thanks PsaltyDS for your useful script:) database.zip
-
Wow! It is really magical!
-
Help about Devcon to safely eject a USB!
logmein replied to logmein's topic in AutoIt General Help and Support
I searched a lot on the internet but there were some small and useless topics about devcon. I know this tool is not belong to Autoit but some experienced programmers can help me? I have spent days for it, I appreciate your help! Because I don't know which my USB's code is, I try to remove them all:) Sorry for my bad English! -
No no! I am just a newbie, I don't understand much about AutoIT. Teach me but please don't criticize me:(( Here is my code (taken from your first post): Note : "RemoveUSB.au3" is your UDF in the first post. I'm using Win 7. #include "RemoveUSB.au3" #NoTrayIcon #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ;;;EXAMPLE Global $drive = InputBox("Eject Drive", "Enter drive (letter only):", "", " M1", 200, 130) If @error Then Exit $drive = StringUpper(StringLeft($drive, 1)) If Not FileExists($drive & ":\") Then MsgBox(0 + 16, "Error", "Drive not found.") Exit EndIf Global $driveInfo[9] = ["Device Number", "Drive Type", "DOS Device Name", "Device Path", "Device ID", "Device Instance", "Device Instance Parent", _ "Parent Device ID", "IsRemovable"] Global $driveArray = _QueryDrive($drive) For $i = 0 To UBound($driveArray) - 1 ConsoleWrite("-" & $driveInfo[$i] & ": " & $driveArray[$i] & @CRLF) Next ConsoleWrite("-Is USBHDD: " & _IsUSBHDD($driveArray) & @CRLF) If (6 = MsgBox(4 + 32, "Eject?", "Eject this drive?")) Then ConsoleWrite("Ejecting drive <" & $drive & ":> - " & _QueryDrive($drive, True) & @CRLF)
-
Hi, I'm trying to develope a program to safely eject an USB device. I have tried a lot of way but there was no satisfactory result. I used to consult wraithdu's script here : but that script wasn't work on my Win7 machine, then I heard someone talk about Devcon, then I started to explore it, I have scripted, tested for days and get nothing but errors. I used this command : devcon remove @usb\* to remove all removable devices but here the result goes : All failed? I have just plugged on two USB Kingmax and Transcend! I need some professional guys to solve the problem:D Thanks!
-
Hi there, It doesn't work, I'm using Win 7 Home and Kingmax USB 2.0:) >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "D:AutoITUSB SecurityRemover.au3" /UserParams +>11:47:57 Starting AutoIt3Wrapper v.2.1.0.33 Environment(Language:0409 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64) >Running AU3Check (1.54.22.0) params:-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 from:C:Program Files (x86)AutoIt3 +>11:47:57 AU3Check ended.rc:0 >Running:(3.3.8.1):C:Program Files (x86)AutoIt3autoit3.exe "D:AutoITUSB SecurityRemover.au3" --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop -Device Number: 2 -Drive Type: 2 -DOS Device Name: DeviceHarddiskVolume13 -Device Path: ?usbstor#disk&ven_kingmax&prod_usb2.0_flashdisk&rev_1100#a120000000001424&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b} -Device ID: 2368 -Device Instance: USBSTORDISK&VEN_KINGMAX&PROD_USB2.0_FLASHDISK&REV_1100A120000000001424&0 -Device Instance Parent: 2524 -Parent Device ID: USBVID_1687&PID_3254A120000000001424 -IsRemovable: True -Is USBHDD: False D:AutoITUSB SecurityRemoveUSB.au3 (268) : ==> Subscript used with non-Array variable.: If $res[0] = $CR_ACCESS_DENIED Then If $res^ ERROR ->11:48:17 AutoIT3.exe ended.rc:1 >Exit code: 1 Time: 21.815
-
Stuck in serious Registry serious problem! x64 vs x86
logmein replied to logmein's topic in AutoIt General Help and Support
Oh, I solved the problem, firstly, I changed the keys like yours and then add #RequireAdmin at the top of the script:) Thanks Danyfirex:)