Sign in to follow this  
Followers 0
nullschritt

Variable Resetting Itself

15 posts in this topic

#1 ·  Posted (edited)

Hello, I am working on a code, based on an idea I saw around the forum before, that allows you to lock your pc session with a removable disk as the key.

However there seems to be some error in either autoit or some error in my code that I'm not seeing.

In the code below you can see the variable $matches is not reset to 0 before it's read, YET, if any disk is selected except the first one, it will always say it counted 0 devices.

(I think it's more likley a code error than autoit error, but I can't seem to find anything wrong in my syntax)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <array.au3>
#include <crypt.au3>
Opt("TrayAutoPause", 0)
Opt("WinTitleMatchMode", 4)
$hwnd = WinGetHandle("classname=Progman")
$user32 = DllOpen("user32.dll")
Global Const $lciWM_SYSCommand = 274
Global Const $lciSC_MonitorPower = 61808
Global Const $lciPower_Off = 2
Global Const $lciPower_On = -1
Global $keydrives, $allrequired = false,$lockedlist,$unlocklist,$keyhashes
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("MyKey", 565, 395, 192, 124)
$Group1 = GUICtrlCreateGroup("Available Drives", 8, 8, 185, 377)
$List1 = GUICtrlCreateList("", 16, 32, 161, 331)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Add ->", 208, 96, 131, 33)
GUICtrlSetFont(-1, 16, 800, 0, "Impact")
$Button2 = GUICtrlCreateButton("<- Remove", 208, 244, 131, 33)
GUICtrlSetFont(-1, 16, 800, 0, "Impact")
$Group2 = GUICtrlCreateGroup("MyKey Drives", 360, 8, 193, 377)
$List2 = GUICtrlCreateList("", 377, 32, 161, 305)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Checkbox1 = GUICtrlCreateCheckbox("Require All Keys", 408, 352, 97, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_updatedrives()
$timer = TimerInit()
while 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $index1 = _GUICtrlListBox_GetCurSel($list1)
            if $index1 <> -1 Then
                $drivestring = _GUICtrlListBox_GetText($list1, $index1)
                $drive = StringLeft($drivestring, 3)
                $cdrivekey = _driveinfo($drive)
                $keydrives &= "|"&$drive
                $keydrives = StringReplace($keydrives, "||", "|")
                $keyhashes &= "|"&$cdrivekey
                $keyhashes = StringReplace($keyhashes, "||", "|")
                _updatedrives()
            Else
            MsgBox(16, "Error", "Error: You didn't select a drive to add.")
            EndIf

        Case $Button2

        $index2 = _GUICtrlListBox_GetCurSel($list2)
            if $index2 <> -1 Then
                $drivestring = _GUICtrlListBox_GetText($list2, $index2)
                $drive = StringLeft($drivestring, 3)
                $cdrivekey = _driveinfo($drive)
                $keydrives = StringReplace($keydrives, $drive, "")
                $keydrives = StringReplace($keydrives, "||", "|")
                $keyhashes = StringReplace($keyhashes, $cdrivekey, "")
                $keyhashes = StringReplace($keyhashes, "||", "|")
                _updatedrives()
            Else
            MsgBox(16, "Error", "Error: You didn't select a drive to remove.")
            EndIf

    EndSwitch
    if TimerDiff($timer) > 500 Then
        $hashes = StringSplit($keyhashes, "|")
        for $i=1 to $hashes[0]
            if $hashes[$i] <> "" Then
                $keydrivestemp = ""
                $alldrives2 = DriveGetDrive("REMOVABLE")
                if IsArray($alldrives2) Then
                    for $i2=1 to $alldrives2[0]
                    if $hashes[$i] =  _Crypt_HashData(_driveinfo($alldrives2[$i2]), $CALG_MD5) Then
                        $keydrivestemp &= "|"&$alldrives2[$i2]
                    EndIf
                    Next
                EndIf

                if $keydrivestemp <> "" Then
                    $keydrives = StringReplace($keydrivestemp, "||", "|")
                EndIf
            EndIf
            Next
        _updatedrives()
Global $matches = 0
Global $drives = DriveGetDrive("REMOVABLE")
if IsArray($drives) then
For $i = 1 To $drives[0]
    if IsDeclared("keydrives") Then
        $keydrivesx = StringSplit($keydrives, "|")
            if $allrequired = true Then
                $requiredmatches = $keydrivesx[0]-1
            Else
                $requiredmatches = 0
            EndIf
        if $keydrivesx[0] > 0 Then
$lockcheck = 0
For $i2 = 1 to $keydrivesx[0]
    if $keydrivesx[$i2] <> "" Then
        $lockcheck += 1
    if _Crypt_HashData(_driveinfo($drives[$i]), $CALG_MD5) = _Crypt_HashData(_driveinfo($keydrivesx[$i2]), $CALG_MD5) Then
        $matches += 1
        ConsoleWrite($drives[$i]&_Crypt_HashData(_driveinfo($drives[$i]), $CALG_MD5)&" = "&$keydrivesx[$i2]&_Crypt_HashData(_driveinfo($keydrivesx[$i2]), $CALG_MD5)&@CRLF)
    Else
        ConsoleWrite($drives[$i]&_Crypt_HashData(_driveinfo($drives[$i]), $CALG_MD5)&" != "&$keydrivesx[$i2]&_Crypt_HashData(_driveinfo($keydrivesx[$i2]), $CALG_MD5)&@CRLF)
    EndIf
    EndIf
Next

if $lockcheck > 0 Then
if $matches > $requiredmatches Then
    DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", $lciWM_SYSCommand, "int", $lciSC_MonitorPower, "int", $lciPower_On)
    BlockInput(0)
Else
;~  DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", $lciWM_SYSCommand, "int", $lciSC_MonitorPower, "int", $lciPower_Off)
;~          BlockInput(1)
ConsoleWrite($matches&"/"&$lockcheck&@CRLF)
        EndIf
        EndIf


    EndIf

    EndIf
Next

Else
    $keydrivesx2 = StringSplit($keydrives, "|")
    $lockcheck2 = 0
    For $i2 = 1 to $keydrivesx2[0]
    if $keydrivesx2[$i2] <> "" Then
        $lockcheck2 += 1
    EndIf
    next
    if $lockcheck2 > 0 Then
            DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", $lciWM_SYSCommand, "int", $lciSC_MonitorPower, "int", $lciPower_Off)
            BlockInput(1)
        EndIf

EndIf
$timer = TimerInit()
EndIf
sleep(50)
WEnd

func _updatedrives()
$lockdrives = StringSplit($keydrives, "|")

if $lockdrives[0] > 0 Then
    $newlockedlist = ""
    for $i=1 to $lockdrives[0]
        if $lockdrives[$i] <> "" Then
        $newlockedlist &= "|"&$lockdrives[$i]&" - "&_Crypt_HashData(_driveinfo($lockdrives[$i]), $CALG_MD5)
        $newlockedlist = StringReplace($newlockedlist, "||", "|")
        EndIf
    Next
    if $newlockedlist <> $lockedlist Then
        $updatelock = StringSplit($newlockedlist, "|")
        _GUICtrlListBox_BeginUpdate($List2)
        _GUICtrlListBox_ResetContent($List2)
    for $i=1 to $updatelock[0]
        if $updatelock[$i] <> "" Then
        _GUICtrlListBox_AddString($List2, $updatelock[$i])
        EndIf
    Next
    _GUICtrlListBox_EndUpdate($List2)
    $lockedlist = $newlockedlist
    EndIf

EndIf

$newunlocklist = ""
$alldrives = DriveGetDrive("REMOVABLE")
if IsArray($alldrives) Then
    for $i=1 to $alldrives[0]
        if $alldrives[$i] <> "" Then
                if not StringInStr($keydrives, $alldrives[$i]&"\") Then
        $newunlocklist &= "|"&$alldrives[$i]&" - "&_Crypt_HashData(_driveinfo($alldrives[$i]), $CALG_MD5)
        $newunlocklist = StringReplace($newunlocklist, "||", "|")
        EndIf
        EndIf
    Next

if $newunlocklist <> $unlocklist Then
        _GUICtrlListBox_BeginUpdate($List1)
        _GUICtrlListBox_ResetContent($List1)
for $i=1 to $alldrives[0]
    if not StringInStr($keydrives, $alldrives[$i]&"\") Then
        _GUICtrlListBox_AddString($List1, $alldrives[$i]&"\ "&" - "&_Crypt_HashData(_driveinfo($alldrives[$i]), $CALG_MD5))
    EndIf
Next
    _GUICtrlListBox_EndUpdate($List1)
    $unlocklist = $newunlocklist
EndIf
EndIf
EndFunc

Func _DriveInfo($drv)
    Return DriveGetFileSystem($drv) & DriveGetLabel($drv) & DriveGetSerial($drv) & DriveGetType($drv) & DriveSpaceTotal($drv) & DriveStatus($drv)
EndFunc   ;==>_DriveInfo
Edited by nullschritt

Share this post


Link to post
Share on other sites



In the code below you can see the variable $count is not reset to 0 before it's read, YET, if any disk is selected except the first one, it will always say it counted 0 devices.

 

I don't see a variable $count in there anywhere.

Share this post


Link to post
Share on other sites

I don't see a variable $count in there anywhere.

Sorry I meant $matches, I'm a little sleep deprived.

Share this post


Link to post
Share on other sites

If you're on about $matches, then it's being set to 0 (and re-declared) in a while loop.

Yes I know, but it's not being reset before I check for it. It's supposed to reset itself before it restarts the counting process, but it seems to be resetting itself in the middle of the counting process, if you see the error could you please care to elaborate on it?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Nothing is resetting it.

But there are at least 5 conditions which need to be true before it is incremented, I guess the problem lies within one of them.

No, I've checked the code using consolewrite()

 

Any attempt to access $matches after the condition where it is incremented, returns 0, however, if you attempt to access the variable inside the condtional statement, it will return the correct number(which means it is incrementing properly), see below:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <array.au3>
#include <crypt.au3>
Opt("TrayAutoPause", 0)
Opt("WinTitleMatchMode", 4)
$hwnd = WinGetHandle("classname=Progman")
$user32 = DllOpen("user32.dll")
Global Const $lciWM_SYSCommand = 274
Global Const $lciSC_MonitorPower = 61808
Global Const $lciPower_Off = 2
Global Const $lciPower_On = -1
Global $keydrives, $allrequired = false,$lockedlist,$unlocklist,$keyhashes
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("MyKey", 565, 395, 192, 124)
$Group1 = GUICtrlCreateGroup("Available Drives", 8, 8, 185, 377)
$List1 = GUICtrlCreateList("", 16, 32, 161, 331)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Add ->", 208, 96, 131, 33)
GUICtrlSetFont(-1, 16, 800, 0, "Impact")
$Button2 = GUICtrlCreateButton("<- Remove", 208, 244, 131, 33)
GUICtrlSetFont(-1, 16, 800, 0, "Impact")
$Group2 = GUICtrlCreateGroup("MyKey Drives", 360, 8, 193, 377)
$List2 = GUICtrlCreateList("", 377, 32, 161, 305)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Checkbox1 = GUICtrlCreateCheckbox("Require All Keys", 408, 352, 97, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_updatedrives()
$timer = TimerInit()
while 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $index1 = _GUICtrlListBox_GetCurSel($list1)
            if $index1 <> -1 Then
                $drivestring = _GUICtrlListBox_GetText($list1, $index1)
                $drive = StringLeft($drivestring, 3)
                $cdrivekey = _driveinfo($drive)
                $keydrives &= "|"&$drive
                $keydrives = StringReplace($keydrives, "||", "|")
                $keyhashes &= "|"&$cdrivekey
                $keyhashes = StringReplace($keyhashes, "||", "|")
                _updatedrives()
            Else
            MsgBox(16, "Error", "Error: You didn't select a drive to add.")
            EndIf

        Case $Button2

        $index2 = _GUICtrlListBox_GetCurSel($list2)
            if $index2 <> -1 Then
                $drivestring = _GUICtrlListBox_GetText($list2, $index2)
                $drive = StringLeft($drivestring, 3)
                $cdrivekey = _driveinfo($drive)
                $keydrives = StringReplace($keydrives, $drive, "")
                $keydrives = StringReplace($keydrives, "||", "|")
                $keyhashes = StringReplace($keyhashes, $cdrivekey, "")
                $keyhashes = StringReplace($keyhashes, "||", "|")
                _updatedrives()
            Else
            MsgBox(16, "Error", "Error: You didn't select a drive to remove.")
            EndIf

    EndSwitch
    if TimerDiff($timer) > 500 Then
        $hashes = StringSplit($keyhashes, "|")
        for $i=1 to $hashes[0]
            if $hashes[$i] <> "" Then
                $keydrivestemp = ""
                $alldrives2 = DriveGetDrive("ALL")
                if IsArray($alldrives2) Then
                    for $i2=1 to $alldrives2[0]
                    if $hashes[$i] =  _Crypt_HashData(_driveinfo($alldrives2[$i2]), $CALG_MD5) Then
                        $keydrivestemp &= "|"&$alldrives2[$i2]
                    EndIf
                    Next
                EndIf

                if $keydrivestemp <> "" Then
                    $keydrives = StringReplace($keydrivestemp, "||", "|")
                EndIf
            EndIf
            Next
        _updatedrives()
Global $matches = 0
Global $drives = DriveGetDrive("ALL")
if IsArray($drives) then
For $i = 1 To $drives[0]
    if IsDeclared("keydrives") Then
        $keydrivesx = StringSplit($keydrives, "|")
            if $allrequired = true Then
                $requiredmatches = $keydrivesx[0]-1
            Else
                $requiredmatches = 0
            EndIf
        if $keydrivesx[0] > 0 Then
$lockcheck = 0
For $i2 = 1 to $keydrivesx[0]
    if $keydrivesx[$i2] <> "" Then
        $lockcheck += 1
    if _Crypt_HashData(_driveinfo($drives[$i]), $CALG_MD5) = _Crypt_HashData(_driveinfo($keydrivesx[$i2]), $CALG_MD5) Then
        $matches += 1
        ConsoleWrite($drives[$i]&_Crypt_HashData(_driveinfo($drives[$i]), $CALG_MD5)&" = "&$keydrivesx[$i2]&_Crypt_HashData(_driveinfo($keydrivesx[$i2]), $CALG_MD5)&@CRLF)
ConsoleWrite($matches&"/"&$lockcheck&@CRLF)
    Else
        ConsoleWrite($drives[$i]&_Crypt_HashData(_driveinfo($drives[$i]), $CALG_MD5)&" != "&$keydrivesx[$i2]&_Crypt_HashData(_driveinfo($keydrivesx[$i2]), $CALG_MD5)&@CRLF)
    EndIf
    EndIf
Next

if $lockcheck > 0 Then
if $matches > $requiredmatches Then
    DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", $lciWM_SYSCommand, "int", $lciSC_MonitorPower, "int", $lciPower_On)
    BlockInput(0)
Else
;~  DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", $lciWM_SYSCommand, "int", $lciSC_MonitorPower, "int", $lciPower_Off)
;~          BlockInput(1)
ConsoleWrite($matches&"/"&$lockcheck&@CRLF)
        EndIf
        EndIf


    EndIf

    EndIf
Next

Else
    $keydrivesx2 = StringSplit($keydrives, "|")
    $lockcheck2 = 0
    For $i2 = 1 to $keydrivesx2[0]
    if $keydrivesx2[$i2] <> "" Then
        $lockcheck2 += 1
    EndIf
    next
    if $lockcheck2 > 0 Then
            DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", $lciWM_SYSCommand, "int", $lciSC_MonitorPower, "int", $lciPower_Off)
            BlockInput(1)
        EndIf

EndIf
$timer = TimerInit()
EndIf
sleep(50)
WEnd

func _updatedrives()
$lockdrives = StringSplit($keydrives, "|")

if $lockdrives[0] > 0 Then
    $newlockedlist = ""
    for $i=1 to $lockdrives[0]
        if $lockdrives[$i] <> "" Then
        $newlockedlist &= "|"&$lockdrives[$i]&" - "&_Crypt_HashData(_driveinfo($lockdrives[$i]), $CALG_MD5)
        $newlockedlist = StringReplace($newlockedlist, "||", "|")
        EndIf
    Next
    if $newlockedlist <> $lockedlist Then
        $updatelock = StringSplit($newlockedlist, "|")
        _GUICtrlListBox_BeginUpdate($List2)
        _GUICtrlListBox_ResetContent($List2)
    for $i=1 to $updatelock[0]
        if $updatelock[$i] <> "" Then
        _GUICtrlListBox_AddString($List2, $updatelock[$i])
        EndIf
    Next
    _GUICtrlListBox_EndUpdate($List2)
    $lockedlist = $newlockedlist
    EndIf

EndIf

$newunlocklist = ""
$alldrives = DriveGetDrive("ALL")
if IsArray($alldrives) Then
    for $i=1 to $alldrives[0]
        if $alldrives[$i] <> "" Then
                if not StringInStr($keydrives, $alldrives[$i]&"\") Then
        $newunlocklist &= "|"&$alldrives[$i]&" - "&_Crypt_HashData(_driveinfo($alldrives[$i]), $CALG_MD5)
        $newunlocklist = StringReplace($newunlocklist, "||", "|")
        EndIf
        EndIf
    Next

if $newunlocklist <> $unlocklist Then
        _GUICtrlListBox_BeginUpdate($List1)
        _GUICtrlListBox_ResetContent($List1)
for $i=1 to $alldrives[0]
    if not StringInStr($keydrives, $alldrives[$i]&"\") Then
        _GUICtrlListBox_AddString($List1, $alldrives[$i]&"\ "&" - "&_Crypt_HashData(_driveinfo($alldrives[$i]), $CALG_MD5))
    EndIf
Next
    _GUICtrlListBox_EndUpdate($List1)
    $unlocklist = $newunlocklist
EndIf
EndIf
EndFunc

Func _DriveInfo($drv)
    Return DriveGetFileSystem($drv) & DriveGetLabel($drv) & DriveGetSerial($drv) & DriveGetType($drv) & DriveSpaceTotal($drv) & DriveStatus($drv)
EndFunc   ;==>_DriveInfo
(I've changed the drive type from REMOVABLE to ALL, in case you don't have more than 1 flash drive, to see what I am talking about, add any drive to the list, except for the first one.) Edited by nullschritt

Share this post


Link to post
Share on other sites

I've not ran you're code, I don't even know what it's supposed to do.

Declare your Global variables out of the loop.

If you're so absolutely positively certain that all those conditions are met before every iteration of loop, than why are they even there?


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I've not ran you're code, I don't even know what it's supposed to do.

Declare your Global variables out of the loop.

If you're so absolutely positively certain that all those conditions are met before every iteration of loop, than why are they even there?

I didn't say they are always met, I said they are met when they should be...

$Matches should only be incremented under the condition, that there is a list of devices which much be connected to the pc in order to unlock the ability to control the pc/see the screen, AND if an attached device is required to unlock the pc. And by looking at my own debugging with consolewrite, I can absolutely see that the $matches is being properly set, and incremented, but three lines down, the variable always returns 0, even with my global variable set at the top of my script.

If you're not going to take the time to run it, to see the error, why are you responding to the topic?

You can't understand the problem if you don't understand the code, and if you don't understand the problem you have zero hope at helping...

Not trying to be rude, just saying.

Edited by nullschritt

Share this post


Link to post
Share on other sites

One does not need to know what the code is doing to see what is not wrong.

We're agreed that $matches is never decremented.
I sincerely hope we agree that (despite topic title) variables do not "reset themselves".

What does that leave you with? That the only time $matches is getting reset is when you set it to 0 half way down your while loop.
It's logic, not code understanding or expertise.

I'd bet my remaining ball, that if you add this.

Global $matches = 0
ConsoleWrite("Myserious reset" & @LF)

That you will see what I'm on about.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

One does not need to know what the code is doing to see what is not wrong.

We're agreed that $matches is never decremented.

I sincerely hope we agree that (despite topic title) variables do not "reset themselves".

What does that leave you with? That the only time $matches is getting reset is when you set it to 0 half way down your while loop.

It's logic, not code understanding or expertise.

 

I'd bet my remaining ball, that if you add this.

Global $matches = 0
ConsoleWrite("Myserious reset" & @LF)
That you will see what I'm on about.

Quite right, if you add that line of code, and run the script, you will see, that, despite the fact the the variable is only being reset AFTER the area of the script where I'm retrieving the value is located, it still returns 0.

What are you not understanding about the problem...

It's reset to 0 on line 90

then it has values added to it at line 107

then it attempts to retrieve the value at line 118

And it's not reset until the script reaches wend, and goes back to line 90

Yet at line 118, it returns 0.

However if I try to retrieve the variable before line 114 it is returned properly

and there is NOTHING resetting it at line 115

So can you see the problem now? Logically, there's no reason for the variable to be "0" AFTER line 114 but not BEFORE it.

Hence why I'm asking for help, is it possible that this is an autoit bug?

Share this post


Link to post
Share on other sites

What is the console out from this.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <array.au3>
#include <crypt.au3>
Opt("TrayAutoPause", 0)
Opt("WinTitleMatchMode", 4)
$hwnd = WinGetHandle("classname=Progman")
$user32 = DllOpen("user32.dll")
Global $iterationcount = 1
Global Const $lciWM_SYSCommand = 274
Global Const $lciSC_MonitorPower = 61808
Global Const $lciPower_Off = 2
Global Const $lciPower_On = -1
Global $keydrives, $allrequired = false, $lockedlist, $unlocklist, $keyhashes
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("MyKey", 565, 395, 192, 124)
$Group1 = GUICtrlCreateGroup("Available Drives", 8, 8, 185, 377)
$List1 = GUICtrlCreateList("", 16, 32, 161, 331)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Add ->", 208, 96, 131, 33)
GUICtrlSetFont(-1, 16, 800, 0, "Impact")
$Button2 = GUICtrlCreateButton("<- Remove", 208, 244, 131, 33)
GUICtrlSetFont(-1, 16, 800, 0, "Impact")
$Group2 = GUICtrlCreateGroup("MyKey Drives", 360, 8, 193, 377)
$List2 = GUICtrlCreateList("", 377, 32, 161, 305)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Checkbox1 = GUICtrlCreateCheckbox("Require All Keys", 408, 352, 97, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_updatedrives()
$timer = TimerInit()
while 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $index1 = _GUICtrlListBox_GetCurSel($List1)
            if $index1 <> -1 Then
                $drivestring = _GUICtrlListBox_GetText($List1, $index1)
                $drive = StringLeft($drivestring, 3)
                $cdrivekey = _DriveInfo($drive)
                $keydrives &= "|" & $drive
                $keydrives = StringReplace($keydrives, "||", "|")
                $keyhashes &= "|" & $cdrivekey
                $keyhashes = StringReplace($keyhashes, "||", "|")
                _updatedrives()
            Else
                MsgBox(16, "Error", "Error: You didn't select a drive to add.")
            EndIf

        Case $Button2

            $index2 = _GUICtrlListBox_GetCurSel($List2)
            if $index2 <> -1 Then
                $drivestring = _GUICtrlListBox_GetText($List2, $index2)
                $drive = StringLeft($drivestring, 3)
                $cdrivekey = _DriveInfo($drive)
                $keydrives = StringReplace($keydrives, $drive, "")
                $keydrives = StringReplace($keydrives, "||", "|")
                $keyhashes = StringReplace($keyhashes, $cdrivekey, "")
                $keyhashes = StringReplace($keyhashes, "||", "|")
                _updatedrives()
            Else
                MsgBox(16, "Error", "Error: You didn't select a drive to remove.")
            EndIf

    EndSwitch
    if TimerDiff($timer) > 500 Then
        $hashes = StringSplit($keyhashes, "|")
        for $i = 1 to $hashes[0]
            if $hashes[$i] <> "" Then
                $keydrivestemp = ""
                $alldrives2 = DriveGetDrive("ALL")
                if IsArray($alldrives2) Then
                    for $i2 = 1 to $alldrives2[0]
                        if $hashes[$i] = _Crypt_HashData(_DriveInfo($alldrives2[$i2]), $CALG_MD5) Then
                            $keydrivestemp &= "|" & $alldrives2[$i2]
                        EndIf
                    Next
                EndIf

                if $keydrivestemp <> "" Then
                    $keydrives = StringReplace($keydrivestemp, "||", "|")
                EndIf
            EndIf
        Next
        _updatedrives()
        $iterationcount += 1
        Global $matches = 0
        ConsoleWrite($iterationcount & " Reset" & @LF)
        Global $drives = DriveGetDrive("ALL")
        if IsArray($drives) then
            ConsoleWrite($iterationcount & " First Condition" & @LF)
            For $i = 1 To $drives[0]
                if IsDeclared("keydrives") Then
                    ConsoleWrite($iterationcount & " Second Condition" & @LF)
                    $keydrivesx = StringSplit($keydrives, "|")
                    if $allrequired = true Then
                        $requiredmatches = $keydrivesx[0] - 1
                    Else
                        $requiredmatches = 0
                    EndIf
                    if $keydrivesx[0] > 0 Then
                        ConsoleWrite($iterationcount & " Third Condition" & @LF)
                        $lockcheck = 0
                        For $i2 = 1 to $keydrivesx[0]
                            if $keydrivesx[$i2] <> "" Then
                                ConsoleWrite($iterationcount & " Fourth Condition" & @LF)
                                $lockcheck += 1
                                if _Crypt_HashData(_DriveInfo($drives[$i]), $CALG_MD5) = _Crypt_HashData(_DriveInfo($keydrivesx[$i2]), $CALG_MD5) Then
                                    ConsoleWrite($iterationcount & " Fifth Condition" & @LF)
                                    $matches += 1
                                    ConsoleWrite($drives[$i] & _Crypt_HashData(_DriveInfo($drives[$i]), $CALG_MD5) & " = " & $keydrivesx[$i2] & _Crypt_HashData(_DriveInfo($keydrivesx[$i2]), $CALG_MD5) & @CRLF)
                                    ConsoleWrite($matches & "/" & $lockcheck & @CRLF)
                                Else
                                    ConsoleWrite($drives[$i] & _Crypt_HashData(_DriveInfo($drives[$i]), $CALG_MD5) & " != " & $keydrivesx[$i2] & _Crypt_HashData(_DriveInfo($keydrivesx[$i2]), $CALG_MD5) & @CRLF)
                                EndIf
                            EndIf
                        Next

                        if $lockcheck > 0 Then
                            if $matches > $requiredmatches Then
                                DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", $lciWM_SYSCommand, "int", $lciSC_MonitorPower, "int", $lciPower_On)
                                BlockInput(0)
                            Else
;~  DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", $lciWM_SYSCommand, "int", $lciSC_MonitorPower, "int", $lciPower_Off)
;~          BlockInput(1)
                                ConsoleWrite($matches & "/" & $lockcheck & @CRLF)
                            EndIf
                        EndIf


                    EndIf

                EndIf
            Next

        Else
            $keydrivesx2 = StringSplit($keydrives, "|")
            $lockcheck2 = 0
            For $i2 = 1 to $keydrivesx2[0]
                if $keydrivesx2[$i2] <> "" Then
                    $lockcheck2 += 1
                EndIf
            next
            if $lockcheck2 > 0 Then
                DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", $lciWM_SYSCommand, "int", $lciSC_MonitorPower, "int", $lciPower_Off)
                BlockInput(1)
            EndIf

        EndIf
        $timer = TimerInit()
    EndIf
    Sleep(50)
WEnd

func _updatedrives()
    $lockdrives = StringSplit($keydrives, "|")

    if $lockdrives[0] > 0 Then
        $newlockedlist = ""
        for $i = 1 to $lockdrives[0]
            if $lockdrives[$i] <> "" Then
                $newlockedlist &= "|" & $lockdrives[$i] & " - " & _Crypt_HashData(_DriveInfo($lockdrives[$i]), $CALG_MD5)
                $newlockedlist = StringReplace($newlockedlist, "||", "|")
            EndIf
        Next
        if $newlockedlist <> $lockedlist Then
            $updatelock = StringSplit($newlockedlist, "|")
            _GUICtrlListBox_BeginUpdate($List2)
            _GUICtrlListBox_ResetContent($List2)
            for $i = 1 to $updatelock[0]
                if $updatelock[$i] <> "" Then
                    _GUICtrlListBox_AddString($List2, $updatelock[$i])
                EndIf
            Next
            _GUICtrlListBox_EndUpdate($List2)
            $lockedlist = $newlockedlist
        EndIf

    EndIf

    $newunlocklist = ""
    $alldrives = DriveGetDrive("ALL")
    if IsArray($alldrives) Then
        for $i = 1 to $alldrives[0]
            if $alldrives[$i] <> "" Then
                if not StringInStr($keydrives, $alldrives[$i] & "\") Then
                    $newunlocklist &= "|" & $alldrives[$i] & " - " & _Crypt_HashData(_DriveInfo($alldrives[$i]), $CALG_MD5)
                    $newunlocklist = StringReplace($newunlocklist, "||", "|")
                EndIf
            EndIf
        Next

        if $newunlocklist <> $unlocklist Then
            _GUICtrlListBox_BeginUpdate($List1)
            _GUICtrlListBox_ResetContent($List1)
            for $i = 1 to $alldrives[0]
                if not StringInStr($keydrives, $alldrives[$i] & "\") Then
                    _GUICtrlListBox_AddString($List1, $alldrives[$i] & "\ " & " - " & _Crypt_HashData(_DriveInfo($alldrives[$i]), $CALG_MD5))
                EndIf
            Next
            _GUICtrlListBox_EndUpdate($List1)
            $unlocklist = $newunlocklist
        EndIf
    EndIf
EndFunc   ;==>_updatedrives

Func _DriveInfo($drv)
    Return DriveGetFileSystem($drv) & DriveGetLabel($drv) & DriveGetSerial($drv) & DriveGetType($drv) & DriveSpaceTotal($drv) & DriveStatus($drv)
EndFunc   ;==>_DriveInfo

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

 

What is the console out from this.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <array.au3>
#include <crypt.au3>
Opt("TrayAutoPause", 0)
Opt("WinTitleMatchMode", 4)
$hwnd = WinGetHandle("classname=Progman")
$user32 = DllOpen("user32.dll")
Global $iterationcount = 1
Global Const $lciWM_SYSCommand = 274
Global Const $lciSC_MonitorPower = 61808
Global Const $lciPower_Off = 2
Global Const $lciPower_On = -1
Global $keydrives, $allrequired = false, $lockedlist, $unlocklist, $keyhashes
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("MyKey", 565, 395, 192, 124)
$Group1 = GUICtrlCreateGroup("Available Drives", 8, 8, 185, 377)
$List1 = GUICtrlCreateList("", 16, 32, 161, 331)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Add ->", 208, 96, 131, 33)
GUICtrlSetFont(-1, 16, 800, 0, "Impact")
$Button2 = GUICtrlCreateButton("<- Remove", 208, 244, 131, 33)
GUICtrlSetFont(-1, 16, 800, 0, "Impact")
$Group2 = GUICtrlCreateGroup("MyKey Drives", 360, 8, 193, 377)
$List2 = GUICtrlCreateList("", 377, 32, 161, 305)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Checkbox1 = GUICtrlCreateCheckbox("Require All Keys", 408, 352, 97, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_updatedrives()
$timer = TimerInit()
while 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $index1 = _GUICtrlListBox_GetCurSel($List1)
            if $index1 <> -1 Then
                $drivestring = _GUICtrlListBox_GetText($List1, $index1)
                $drive = StringLeft($drivestring, 3)
                $cdrivekey = _DriveInfo($drive)
                $keydrives &= "|" & $drive
                $keydrives = StringReplace($keydrives, "||", "|")
                $keyhashes &= "|" & $cdrivekey
                $keyhashes = StringReplace($keyhashes, "||", "|")
                _updatedrives()
            Else
                MsgBox(16, "Error", "Error: You didn't select a drive to add.")
            EndIf

        Case $Button2

            $index2 = _GUICtrlListBox_GetCurSel($List2)
            if $index2 <> -1 Then
                $drivestring = _GUICtrlListBox_GetText($List2, $index2)
                $drive = StringLeft($drivestring, 3)
                $cdrivekey = _DriveInfo($drive)
                $keydrives = StringReplace($keydrives, $drive, "")
                $keydrives = StringReplace($keydrives, "||", "|")
                $keyhashes = StringReplace($keyhashes, $cdrivekey, "")
                $keyhashes = StringReplace($keyhashes, "||", "|")
                _updatedrives()
            Else
                MsgBox(16, "Error", "Error: You didn't select a drive to remove.")
            EndIf

    EndSwitch
    if TimerDiff($timer) > 500 Then
        $hashes = StringSplit($keyhashes, "|")
        for $i = 1 to $hashes[0]
            if $hashes[$i] <> "" Then
                $keydrivestemp = ""
                $alldrives2 = DriveGetDrive("ALL")
                if IsArray($alldrives2) Then
                    for $i2 = 1 to $alldrives2[0]
                        if $hashes[$i] = _Crypt_HashData(_DriveInfo($alldrives2[$i2]), $CALG_MD5) Then
                            $keydrivestemp &= "|" & $alldrives2[$i2]
                        EndIf
                    Next
                EndIf

                if $keydrivestemp <> "" Then
                    $keydrives = StringReplace($keydrivestemp, "||", "|")
                EndIf
            EndIf
        Next
        _updatedrives()
        $iterationcount += 1
        Global $matches = 0
        ConsoleWrite($iterationcount & " Reset" & @LF)
        Global $drives = DriveGetDrive("ALL")
        if IsArray($drives) then
            ConsoleWrite($iterationcount & " First Condition" & @LF)
            For $i = 1 To $drives[0]
                if IsDeclared("keydrives") Then
                    ConsoleWrite($iterationcount & " Second Condition" & @LF)
                    $keydrivesx = StringSplit($keydrives, "|")
                    if $allrequired = true Then
                        $requiredmatches = $keydrivesx[0] - 1
                    Else
                        $requiredmatches = 0
                    EndIf
                    if $keydrivesx[0] > 0 Then
                        ConsoleWrite($iterationcount & " Third Condition" & @LF)
                        $lockcheck = 0
                        For $i2 = 1 to $keydrivesx[0]
                            if $keydrivesx[$i2] <> "" Then
                                ConsoleWrite($iterationcount & " Fourth Condition" & @LF)
                                $lockcheck += 1
                                if _Crypt_HashData(_DriveInfo($drives[$i]), $CALG_MD5) = _Crypt_HashData(_DriveInfo($keydrivesx[$i2]), $CALG_MD5) Then
                                    ConsoleWrite($iterationcount & " Fifth Condition" & @LF)
                                    $matches += 1
                                    ConsoleWrite($drives[$i] & _Crypt_HashData(_DriveInfo($drives[$i]), $CALG_MD5) & " = " & $keydrivesx[$i2] & _Crypt_HashData(_DriveInfo($keydrivesx[$i2]), $CALG_MD5) & @CRLF)
                                    ConsoleWrite($matches & "/" & $lockcheck & @CRLF)
                                Else
                                    ConsoleWrite($drives[$i] & _Crypt_HashData(_DriveInfo($drives[$i]), $CALG_MD5) & " != " & $keydrivesx[$i2] & _Crypt_HashData(_DriveInfo($keydrivesx[$i2]), $CALG_MD5) & @CRLF)
                                EndIf
                            EndIf
                        Next

                        if $lockcheck > 0 Then
                            if $matches > $requiredmatches Then
                                DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", $lciWM_SYSCommand, "int", $lciSC_MonitorPower, "int", $lciPower_On)
                                BlockInput(0)
                            Else
;~  DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", $lciWM_SYSCommand, "int", $lciSC_MonitorPower, "int", $lciPower_Off)
;~          BlockInput(1)
                                ConsoleWrite($matches & "/" & $lockcheck & @CRLF)
                            EndIf
                        EndIf


                    EndIf

                EndIf
            Next

        Else
            $keydrivesx2 = StringSplit($keydrives, "|")
            $lockcheck2 = 0
            For $i2 = 1 to $keydrivesx2[0]
                if $keydrivesx2[$i2] <> "" Then
                    $lockcheck2 += 1
                EndIf
            next
            if $lockcheck2 > 0 Then
                DllCall($user32, "int", "SendMessage", "hwnd", $hwnd, "int", $lciWM_SYSCommand, "int", $lciSC_MonitorPower, "int", $lciPower_Off)
                BlockInput(1)
            EndIf

        EndIf
        $timer = TimerInit()
    EndIf
    Sleep(50)
WEnd

func _updatedrives()
    $lockdrives = StringSplit($keydrives, "|")

    if $lockdrives[0] > 0 Then
        $newlockedlist = ""
        for $i = 1 to $lockdrives[0]
            if $lockdrives[$i] <> "" Then
                $newlockedlist &= "|" & $lockdrives[$i] & " - " & _Crypt_HashData(_DriveInfo($lockdrives[$i]), $CALG_MD5)
                $newlockedlist = StringReplace($newlockedlist, "||", "|")
            EndIf
        Next
        if $newlockedlist <> $lockedlist Then
            $updatelock = StringSplit($newlockedlist, "|")
            _GUICtrlListBox_BeginUpdate($List2)
            _GUICtrlListBox_ResetContent($List2)
            for $i = 1 to $updatelock[0]
                if $updatelock[$i] <> "" Then
                    _GUICtrlListBox_AddString($List2, $updatelock[$i])
                EndIf
            Next
            _GUICtrlListBox_EndUpdate($List2)
            $lockedlist = $newlockedlist
        EndIf

    EndIf

    $newunlocklist = ""
    $alldrives = DriveGetDrive("ALL")
    if IsArray($alldrives) Then
        for $i = 1 to $alldrives[0]
            if $alldrives[$i] <> "" Then
                if not StringInStr($keydrives, $alldrives[$i] & "\") Then
                    $newunlocklist &= "|" & $alldrives[$i] & " - " & _Crypt_HashData(_DriveInfo($alldrives[$i]), $CALG_MD5)
                    $newunlocklist = StringReplace($newunlocklist, "||", "|")
                EndIf
            EndIf
        Next

        if $newunlocklist <> $unlocklist Then
            _GUICtrlListBox_BeginUpdate($List1)
            _GUICtrlListBox_ResetContent($List1)
            for $i = 1 to $alldrives[0]
                if not StringInStr($keydrives, $alldrives[$i] & "\") Then
                    _GUICtrlListBox_AddString($List1, $alldrives[$i] & "\ " & " - " & _Crypt_HashData(_DriveInfo($alldrives[$i]), $CALG_MD5))
                EndIf
            Next
            _GUICtrlListBox_EndUpdate($List1)
            $unlocklist = $newunlocklist
        EndIf
    EndIf
EndFunc   ;==>_updatedrives

Func _DriveInfo($drv)
    Return DriveGetFileSystem($drv) & DriveGetLabel($drv) & DriveGetSerial($drv) & DriveGetType($drv) & DriveSpaceTotal($drv) & DriveStatus($drv)
EndFunc   ;==>_DriveInfo
2 Reset
2 First Condition
2 Second Condition
2 Third Condition
2 Second Condition
2 Third Condition
2 Second Condition
2 Third Condition
2 Second Condition
2 Third Condition
2 Second Condition
2 Third Condition
2 Second Condition
2 Third Condition
2 Second Condition
2 Third Condition
2 Second Condition
2 Third Condition
3 Reset
3 First Condition
3 Second Condition
3 Third Condition
3 Second Condition
3 Third Condition
3 Second Condition
3 Third Condition
3 Second Condition
3 Third Condition
3 Second Condition
3 Third Condition
3 Second Condition
3 Third Condition
3 Second Condition
3 Third Condition
3 Second Condition
3 Third Condition
4 Reset
4 First Condition
4 Second Condition
4 Third Condition
4 Second Condition
4 Third Condition
4 Second Condition
4 Third Condition
4 Second Condition
4 Third Condition
4 Second Condition
4 Third Condition
4 Second Condition
4 Third Condition
4 Second Condition
4 Third Condition
4 Second Condition
4 Third Condition
5 Reset
5 First Condition
5 Second Condition
5 Third Condition
5 Second Condition
5 Third Condition
5 Second Condition
5 Third Condition
5 Second Condition
5 Third Condition
5 Second Condition
5 Third Condition
5 Second Condition
5 Third Condition
5 Second Condition
5 Third Condition
5 Second Condition
5 Third Condition
6 Reset
6 First Condition
6 Second Condition
6 Third Condition
6 Second Condition
6 Third Condition
6 Second Condition
6 Third Condition
6 Second Condition
6 Third Condition
6 Second Condition
6 Third Condition
6 Second Condition
6 Third Condition
6 Second Condition
6 Third Condition
6 Second Condition
6 Third Condition
7 Reset
7 First Condition
7 Second Condition
7 Third Condition
7 Second Condition
7 Third Condition
7 Second Condition
7 Third Condition
7 Second Condition
7 Third Condition
7 Second Condition
7 Third Condition
7 Second Condition
7 Third Condition
7 Second Condition
7 Third Condition
7 Second Condition
7 Third Condition
8 Reset
8 First Condition
8 Second Condition
8 Third Condition
8 Second Condition
8 Third Condition
8 Second Condition
8 Third Condition
8 Second Condition
8 Third Condition
8 Second Condition
8 Third Condition
8 Second Condition
8 Third Condition
8 Second Condition
8 Third Condition
8 Second Condition
8 Third Condition
9 Reset
9 First Condition
9 Second Condition
9 Third Condition
9 Second Condition
9 Third Condition
9 Second Condition
9 Third Condition
9 Second Condition
9 Third Condition
9 Second Condition
9 Third Condition
9 Second Condition
9 Third Condition
9 Second Condition
9 Third Condition
9 Second Condition
9 Third Condition
10 Reset
10 First Condition
10 Second Condition
10 Third Condition
10 Second Condition
10 Third Condition
10 Second Condition
10 Third Condition
10 Second Condition
10 Third Condition
10 Second Condition
10 Third Condition
10 Second Condition
10 Third Condition
10 Second Condition
10 Third Condition
10 Second Condition
10 Third Condition
11 Reset
11 First Condition
11 Second Condition
11 Third Condition
11 Second Condition
11 Third Condition
11 Second Condition
11 Third Condition
11 Second Condition
11 Third Condition
11 Second Condition
11 Third Condition
11 Second Condition
11 Third Condition
11 Second Condition
11 Third Condition
11 Second Condition
11 Third Condition
12 Reset
12 First Condition
12 Second Condition
12 Third Condition
12 Second Condition
12 Third Condition
12 Second Condition
12 Third Condition
12 Second Condition
12 Third Condition
12 Second Condition
12 Third Condition
12 Second Condition
12 Third Condition
12 Second Condition
12 Third Condition
12 Second Condition
12 Third Condition
13 Reset
13 First Condition
13 Second Condition
13 Third Condition
13 Second Condition
13 Third Condition
13 Second Condition
13 Third Condition
13 Second Condition
13 Third Condition
13 Second Condition
13 Third Condition
13 Second Condition
13 Third Condition
13 Second Condition
13 Third Condition
13 Second Condition
13 Third Condition
14 Reset
14 First Condition
14 Second Condition
14 Third Condition
14 Second Condition
14 Third Condition
14 Second Condition
14 Third Condition
14 Second Condition
14 Third Condition
14 Second Condition
14 Third Condition
14 Second Condition
14 Third Condition
14 Second Condition
14 Third Condition
14 Second Condition
14 Third Condition
15 Reset
15 First Condition
15 Second Condition
15 Third Condition
15 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
15 Second Condition
15 Third Condition
15 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
15 Second Condition
15 Third Condition
15 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
15 Second Condition
15 Third Condition
15 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
15 Second Condition
15 Third Condition
15 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
15 Second Condition
15 Third Condition
15 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
15 Second Condition
15 Third Condition
15 Fourth Condition
15 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
15 Second Condition
15 Third Condition
15 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
16 Reset
16 First Condition
16 Second Condition
16 Third Condition
16 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
16 Second Condition
16 Third Condition
16 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
16 Second Condition
16 Third Condition
16 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
16 Second Condition
16 Third Condition
16 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
16 Second Condition
16 Third Condition
16 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
16 Second Condition
16 Third Condition
16 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
16 Second Condition
16 Third Condition
16 Fourth Condition
16 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
16 Second Condition
16 Third Condition
16 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
17 Reset
17 First Condition
17 Second Condition
17 Third Condition
17 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
17 Second Condition
17 Third Condition
17 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
17 Second Condition
17 Third Condition
17 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
17 Second Condition
17 Third Condition
17 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
17 Second Condition
17 Third Condition
17 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
17 Second Condition
17 Third Condition
17 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
17 Second Condition
17 Third Condition
17 Fourth Condition
17 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
17 Second Condition
17 Third Condition
17 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
18 Reset
18 First Condition
18 Second Condition
18 Third Condition
18 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
18 Second Condition
18 Third Condition
18 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
18 Second Condition
18 Third Condition
18 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
18 Second Condition
18 Third Condition
18 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
18 Second Condition
18 Third Condition
18 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
18 Second Condition
18 Third Condition
18 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
18 Second Condition
18 Third Condition
18 Fourth Condition
18 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
18 Second Condition
18 Third Condition
18 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
19 Reset
19 First Condition
19 Second Condition
19 Third Condition
19 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
19 Second Condition
19 Third Condition
19 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
19 Second Condition
19 Third Condition
19 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
19 Second Condition
19 Third Condition
19 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
19 Second Condition
19 Third Condition
19 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
19 Second Condition
19 Third Condition
19 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
19 Second Condition
19 Third Condition
19 Fourth Condition
19 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
19 Second Condition
19 Third Condition
19 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
20 Reset
20 First Condition
20 Second Condition
20 Third Condition
20 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
20 Second Condition
20 Third Condition
20 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
20 Second Condition
20 Third Condition
20 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
20 Second Condition
20 Third Condition
20 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
20 Second Condition
20 Third Condition
20 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
20 Second Condition
20 Third Condition
20 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
20 Second Condition
20 Third Condition
20 Fourth Condition
20 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
20 Second Condition
20 Third Condition
20 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
21 Reset
21 First Condition
21 Second Condition
21 Third Condition
21 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
21 Second Condition
21 Third Condition
21 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
21 Second Condition
21 Third Condition
21 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
21 Second Condition
21 Third Condition
21 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
21 Second Condition
21 Third Condition
21 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
21 Second Condition
21 Third Condition
21 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
21 Second Condition
21 Third Condition
21 Fourth Condition
21 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
21 Second Condition
21 Third Condition
21 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
22 Reset
22 First Condition
22 Second Condition
22 Third Condition
22 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
22 Second Condition
22 Third Condition
22 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
22 Second Condition
22 Third Condition
22 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
22 Second Condition
22 Third Condition
22 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
22 Second Condition
22 Third Condition
22 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
22 Second Condition
22 Third Condition
22 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
22 Second Condition
22 Third Condition
22 Fourth Condition
22 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
22 Second Condition
22 Third Condition
22 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
23 Reset
23 First Condition
23 Second Condition
23 Third Condition
23 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
23 Second Condition
23 Third Condition
23 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
23 Second Condition
23 Third Condition
23 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
23 Second Condition
23 Third Condition
23 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
23 Second Condition
23 Third Condition
23 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
23 Second Condition
23 Third Condition
23 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
23 Second Condition
23 Third Condition
23 Fourth Condition
23 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
23 Second Condition
23 Third Condition
23 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
24 Reset
24 First Condition
24 Second Condition
24 Third Condition
24 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
24 Second Condition
24 Third Condition
24 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
24 Second Condition
24 Third Condition
24 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
24 Second Condition
24 Third Condition
24 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
24 Second Condition
24 Third Condition
24 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
24 Second Condition
24 Third Condition
24 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
24 Second Condition
24 Third Condition
24 Fourth Condition
24 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
24 Second Condition
24 Third Condition
24 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
25 Reset
25 First Condition
25 Second Condition
25 Third Condition
25 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
25 Second Condition
25 Third Condition
25 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
25 Second Condition
25 Third Condition
25 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
25 Second Condition
25 Third Condition
25 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
25 Second Condition
25 Third Condition
25 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
25 Second Condition
25 Third Condition
25 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
25 Second Condition
25 Third Condition
25 Fourth Condition
25 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
25 Second Condition
25 Third Condition
25 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
26 Reset
26 First Condition
26 Second Condition
26 Third Condition
26 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
26 Second Condition
26 Third Condition
26 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
26 Second Condition
26 Third Condition
26 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
26 Second Condition
26 Third Condition
26 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
26 Second Condition
26 Third Condition
26 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
26 Second Condition
26 Third Condition
26 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
26 Second Condition
26 Third Condition
26 Fourth Condition
26 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
26 Second Condition
26 Third Condition
26 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
27 Reset
27 First Condition
27 Second Condition
27 Third Condition
27 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
27 Second Condition
27 Third Condition
27 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
27 Second Condition
27 Third Condition
27 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
27 Second Condition
27 Third Condition
27 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
27 Second Condition
27 Third Condition
27 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
27 Second Condition
27 Third Condition
27 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
27 Second Condition
27 Third Condition
27 Fourth Condition
27 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
27 Second Condition
27 Third Condition
27 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
28 Reset
28 First Condition
28 Second Condition
28 Third Condition
28 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
28 Second Condition
28 Third Condition
28 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
28 Second Condition
28 Third Condition
28 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
28 Second Condition
28 Third Condition
28 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
28 Second Condition
28 Third Condition
28 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
28 Second Condition
28 Third Condition
28 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
28 Second Condition
28 Third Condition
28 Fourth Condition
28 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
28 Second Condition
28 Third Condition
28 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
29 Reset
29 First Condition
29 Second Condition
29 Third Condition
29 Fourth Condition
c:0xED8ECD649F6FD5148CBB0784BDA41CF6 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
29 Second Condition
29 Third Condition
29 Fourth Condition
d:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
29 Second Condition
29 Third Condition
29 Fourth Condition
e:0x1EC053BFA089DB1F75CDBD09990C6BD4 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
29 Second Condition
29 Third Condition
29 Fourth Condition
f:0xA011221A8650324919C799F049F5094D != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
29 Second Condition
29 Third Condition
29 Fourth Condition
h:0x2AAE7C63725586C842E31239C86A9BCC != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
29 Second Condition
29 Third Condition
29 Fourth Condition
i:0x293457CB2FD994A9D8452AB123EDB285 != y:\0x400F9D9FD710DAF01756B54F2477EE7B
0/1
29 Second Condition
29 Third Condition
29 Fourth Condition
29 Fifth Condition
y:0x400F9D9FD710DAF01756B54F2477EE7B = y:\0x400F9D9FD710DAF01756B54F2477EE7B
1/1
29 Second Condition
29 Third Condition
29 Fourth Condition
z:0x07AABD5B6F67ED2CB84C82E790305D93 != y:\0x400F9D9FD710DAF01756B54F2477EE7B

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I ran your code, and could not reproduce the "reset" you refer to.

I inserted the following before line 114, after line 114, and before line 118.

ConsoleWrite("line " & @ScriptLineNumber & " - $matches = " & $matches & @CRLF)

Every time a value of 0 showed before line 118, there was also a 0 before and after line 114.  No mysterious reset.

You might also think about not constantly looping through all of this, since the drives should change infrequently.  Try adding a re-scan button to re-scan available drives, and then only update when a button is pressed.  You are wasting alot of processing time here.

--- edit ---

Just to note, adding these lines change the later line numbers, so you will be looking at 114, 116, and 120 line numbers in the console log.  Line 120 will never show a 0 unless the preceding 114 and 116 also show 0.  Lines 114 and 116 always have the same value.

Here is a sampling from my log

line 114 - $matches = 0
line 116 - $matches = 0
line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 0
line 116 - $matches = 0
0/1
line 114 - $matches = 0
d:0xA011221A8650324919C799F049F5094D = d:\0xA011221A8650324919C799F049F5094D
1/1
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
f:0x055AAD46844CBE2101D104E76EE23802 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
g:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
i:0x016A23A8319778A4570B7BAB279E5B50 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 0
line 116 - $matches = 0
0/1
line 114 - $matches = 0
d:0xA011221A8650324919C799F049F5094D = d:\0xA011221A8650324919C799F049F5094D
1/1
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
f:0x055AAD46844CBE2101D104E76EE23802 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
g:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
i:0x016A23A8319778A4570B7BAB279E5B50 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 0
line 116 - $matches = 0
0/1
line 114 - $matches = 0
d:0xA011221A8650324919C799F049F5094D = d:\0xA011221A8650324919C799F049F5094D
1/1
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
f:0x055AAD46844CBE2101D104E76EE23802 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
g:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
i:0x016A23A8319778A4570B7BAB279E5B50 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 0
line 116 - $matches = 0
0/1
line 114 - $matches = 0
d:0xA011221A8650324919C799F049F5094D = d:\0xA011221A8650324919C799F049F5094D
1/1
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
f:0x055AAD46844CBE2101D104E76EE23802 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
g:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
i:0x016A23A8319778A4570B7BAB279E5B50 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 0
line 116 - $matches = 0
0/1
line 114 - $matches = 0
d:0xA011221A8650324919C799F049F5094D = d:\0xA011221A8650324919C799F049F5094D
1/1
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
f:0x055AAD46844CBE2101D104E76EE23802 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
g:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
i:0x016A23A8319778A4570B7BAB279E5B50 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 0
line 116 - $matches = 0
0/1
line 114 - $matches = 0
d:0xA011221A8650324919C799F049F5094D = d:\0xA011221A8650324919C799F049F5094D
1/1
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
f:0x055AAD46844CBE2101D104E76EE23802 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
g:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
i:0x016A23A8319778A4570B7BAB279E5B50 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 0
line 116 - $matches = 0
0/1
line 114 - $matches = 0
d:0xA011221A8650324919C799F049F5094D = d:\0xA011221A8650324919C799F049F5094D
1/1
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
f:0x055AAD46844CBE2101D104E76EE23802 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
g:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
i:0x016A23A8319778A4570B7BAB279E5B50 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 0
line 116 - $matches = 0
0/2
line 114 - $matches = 0
d:0xA011221A8650324919C799F049F5094D = d:\0xA011221A8650324919C799F049F5094D
1/1
line 114 - $matches = 1
d:0xA011221A8650324919C799F049F5094D != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A = g:\0xEA207E1D70CC67F84F9640AE0ABD518A
2/2
line 114 - $matches = 2
line 116 - $matches = 2
line 120 - $matches = 2line 114 - $matches = 2
f:0x055AAD46844CBE2101D104E76EE23802 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 2
f:0x055AAD46844CBE2101D104E76EE23802 != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 2
line 116 - $matches = 2
line 120 - $matches = 2line 114 - $matches = 2
g:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 2
g:0xEA207E1D70CC67F84F9640AE0ABD518A = g:\0xEA207E1D70CC67F84F9640AE0ABD518A
3/2
line 114 - $matches = 3
line 116 - $matches = 3
line 120 - $matches = 3line 114 - $matches = 3
i:0x016A23A8319778A4570B7BAB279E5B50 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 3
i:0x016A23A8319778A4570B7BAB279E5B50 != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 3
line 116 - $matches = 3
line 120 - $matches = 3line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 0
line 116 - $matches = 0
0/2
line 114 - $matches = 0
d:0xA011221A8650324919C799F049F5094D = d:\0xA011221A8650324919C799F049F5094D
1/1
line 114 - $matches = 1
d:0xA011221A8650324919C799F049F5094D != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A = g:\0xEA207E1D70CC67F84F9640AE0ABD518A
2/2
line 114 - $matches = 2
line 116 - $matches = 2
line 120 - $matches = 2line 114 - $matches = 2
f:0x055AAD46844CBE2101D104E76EE23802 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 2
f:0x055AAD46844CBE2101D104E76EE23802 != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 2
line 116 - $matches = 2
line 120 - $matches = 2line 114 - $matches = 2
g:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 2
g:0xEA207E1D70CC67F84F9640AE0ABD518A = g:\0xEA207E1D70CC67F84F9640AE0ABD518A
3/2
line 114 - $matches = 3
line 116 - $matches = 3
line 120 - $matches = 3line 114 - $matches = 3
i:0x016A23A8319778A4570B7BAB279E5B50 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 3
i:0x016A23A8319778A4570B7BAB279E5B50 != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 3
line 116 - $matches = 3
line 120 - $matches = 3line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 0
line 116 - $matches = 0
0/2
line 114 - $matches = 0
d:0xA011221A8650324919C799F049F5094D = d:\0xA011221A8650324919C799F049F5094D
1/1
line 114 - $matches = 1
d:0xA011221A8650324919C799F049F5094D != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A = g:\0xEA207E1D70CC67F84F9640AE0ABD518A
2/2
line 114 - $matches = 2
line 116 - $matches = 2
line 120 - $matches = 2line 114 - $matches = 2
f:0x055AAD46844CBE2101D104E76EE23802 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 2
f:0x055AAD46844CBE2101D104E76EE23802 != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 2
line 116 - $matches = 2
line 120 - $matches = 2line 114 - $matches = 2
g:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 2
g:0xEA207E1D70CC67F84F9640AE0ABD518A = g:\0xEA207E1D70CC67F84F9640AE0ABD518A
3/2
line 114 - $matches = 3
line 116 - $matches = 3
line 120 - $matches = 3line 114 - $matches = 3
i:0x016A23A8319778A4570B7BAB279E5B50 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 3
i:0x016A23A8319778A4570B7BAB279E5B50 != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 3
line 116 - $matches = 3
line 120 - $matches = 3line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 0
line 116 - $matches = 0
0/2
line 114 - $matches = 0
d:0xA011221A8650324919C799F049F5094D = d:\0xA011221A8650324919C799F049F5094D
1/1
line 114 - $matches = 1
d:0xA011221A8650324919C799F049F5094D != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A = g:\0xEA207E1D70CC67F84F9640AE0ABD518A
2/2
line 114 - $matches = 2
line 116 - $matches = 2
line 120 - $matches = 2line 114 - $matches = 2
f:0x055AAD46844CBE2101D104E76EE23802 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 2
f:0x055AAD46844CBE2101D104E76EE23802 != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 2
line 116 - $matches = 2
line 120 - $matches = 2line 114 - $matches = 2
g:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 2
g:0xEA207E1D70CC67F84F9640AE0ABD518A = g:\0xEA207E1D70CC67F84F9640AE0ABD518A
3/2
line 114 - $matches = 3
line 116 - $matches = 3
line 120 - $matches = 3line 114 - $matches = 3
i:0x016A23A8319778A4570B7BAB279E5B50 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 3
i:0x016A23A8319778A4570B7BAB279E5B50 != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 3
line 116 - $matches = 3
line 120 - $matches = 3line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 0
c:0xEF568757EEE107270998762FB07DA2CC != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 0
line 116 - $matches = 0
0/2
line 114 - $matches = 0
d:0xA011221A8650324919C799F049F5094D = d:\0xA011221A8650324919C799F049F5094D
1/1
line 114 - $matches = 1
d:0xA011221A8650324919C799F049F5094D != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 1
line 116 - $matches = 1
line 120 - $matches = 1line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 1
e:0xEA207E1D70CC67F84F9640AE0ABD518A = g:\0xEA207E1D70CC67F84F9640AE0ABD518A
2/2
line 114 - $matches = 2
line 116 - $matches = 2
line 120 - $matches = 2line 114 - $matches = 2
f:0x055AAD46844CBE2101D104E76EE23802 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 2
f:0x055AAD46844CBE2101D104E76EE23802 != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 2
line 116 - $matches = 2
line 120 - $matches = 2line 114 - $matches = 2
g:0xEA207E1D70CC67F84F9640AE0ABD518A != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 2
g:0xEA207E1D70CC67F84F9640AE0ABD518A = g:\0xEA207E1D70CC67F84F9640AE0ABD518A
3/2
line 114 - $matches = 3
line 116 - $matches = 3
line 120 - $matches = 3line 114 - $matches = 3
i:0x016A23A8319778A4570B7BAB279E5B50 != d:\0xA011221A8650324919C799F049F5094D
line 114 - $matches = 3
i:0x016A23A8319778A4570B7BAB279E5B50 != g:\0xEA207E1D70CC67F84F9640AE0ABD518A
line 114 - $matches = 3
line 116 - $matches = 3
line 120 - $matches = 3
Edited by willichan

Share this post


Link to post
Share on other sites

Flow of code looks normal to me, whenever $matches is 1 it is not reset until a new iteration of Main While loop.

Are you not breaking out of a loop when you might need to?

if _Crypt_HashData(_DriveInfo($drives[$i]), $CALG_MD5) = _Crypt_HashData(_DriveInfo($keydrivesx[$i2]), $CALG_MD5) Then
    ConsoleWrite($iterationcount & " Fifth Condition" & @LF)
    $matches += 1 
    ConsoleWrite($drives[$i] & _Crypt_HashData(_DriveInfo($drives[$i]), $CALG_MD5) & " = " & $keydrivesx[$i2] & _Crypt_HashData(_DriveInfo($keydrivesx[$i2]), $CALG_MD5) & @CRLF)
    ConsoleWrite($matches & "/" & $lockcheck & @CRLF)
        ExitLoop
Else
    ConsoleWrite($drives[$i] & _Crypt_HashData(_DriveInfo($drives[$i]), $CALG_MD5) & " != " & $keydrivesx[$i2] & _Crypt_HashData(_DriveInfo($keydrivesx[$i2]), $CALG_MD5) & @CRLF)
EndIf

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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