Sign in to follow this  
Followers 0
=sinister=

Help with the "For" loop

1 post in this topic

#1 ·  Posted (edited)

So I have a very long function:

Func CheckKey($Key)
    Local $PID = ProcessList($PathCheck)
    If ProcessExists($PathCheck) Then
        Local $DllInformation = _MemoryOpen($PID[1][1])
    Else
        Return -1
    EndIf
    Local $Read
    Local $Number = 0
    $GetKey = StringSplit($Key, ",")
    $Read = _MemoryRead($Bar11, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar1|1"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar12, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar1|2"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar13, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar1|3"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar14, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar1|4"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar15, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar1|5"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar16, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar1|6"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar17, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar1|7"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar18, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar1|8"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar19, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar1|9"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar10, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar1|0"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar1m, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar1|-"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar1e, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar1|="
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar21, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar2|1"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar22, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar2|2"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar23, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar2|3"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar24, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar2|4"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar25, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar2|5"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar26, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar2|6"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar27, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar2|7"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar28, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar2|8"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar29, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar2|9"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar20, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar2|0"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar2m, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar2|-"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar2e, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar2|="
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar31, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar3|1"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar32, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar3|2"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar33, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar3|3"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar34, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar3|4"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar35, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar3|5"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar36, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar3|6"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar37, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar3|7"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar38, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar3|8"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar39, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar3|9"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar30, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar3|0"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar3m, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar3|-"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar3e, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar3|="
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar41, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar4|1"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar42, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar4|2"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar43, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar4|3"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar44, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar4|4"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar45, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar4|5"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar46, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar4|6"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar47, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar4|7"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar48, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar4|8"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar49, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar4|9"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar40, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar4|0"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar4m, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar4|-"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar4e, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar4|="
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar51, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar5|1"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar52, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar5|2"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar53, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar5|3"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar54, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar5|4"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar55, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar5|5"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar56, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar5|6"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar57, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar5|7"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar58, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar5|8"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar59, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar5|9"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar50, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar5|0"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar5m, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar5|-"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar5e, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar5|="
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar61, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar6|1"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar62, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar6|2"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar63, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar6|3"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar64, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar6|4"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar65, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar6|5"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar66, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar6|6"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar67, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar6|7"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar68, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar6|8"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar69, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar6|9"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar60, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar6|0"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar6m, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar6|-"
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    $Read = _MemoryRead($Bar6e, $DllInformation, 'dword')
    If @error Then
        Return -1
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = "Bar6|="
                Return 1
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
    _MemoryClose($DllInformation)
EndFunc;==>CheckKey

So I wanted to cut that piece of code down, so I put the addresses that my code reads from in a xml format:

<?xml version="1.0"?>
<Addresses>
  <Address Address="0x00CB4AA0" Bar="Bar11" />
  <Address Address="0x00CB4AA4" Bar="Bar12" />
  <Address Address="0x00CB4AA8" Bar="Bar13" />
  <Address Address="0x00CB4AAC" Bar="Bar14" />
  <Address Address="0x00CB4AB0" Bar="Bar15" />
  <Address Address="0x00CB4AB4" Bar="Bar16" />
  <Address Address="0x00CB4AB8" Bar="Bar17" />
  <Address Address="0x00CB4ABC" Bar="Bar18" />
  <Address Address="0x00CB4AC0" Bar="Bar19" />
  <Address Address="0x00CB4AC4" Bar="Bar10" />
  <Address Address="0x00CB4AC8" Bar="Bar1-" />
  <Address Address="0x00CB4ACC" Bar="Bar1=" />
  
  <Address Address="0x00CB49B0" Bar="Bar21" />
  <Address Address="0x00CB49B4" Bar="Bar22" />
  <Address Address="0x00CB49B8" Bar="Bar23" />
  <Address Address="0x00CB49BC" Bar="Bar24" />
  <Address Address="0x00CB49C0" Bar="Bar25" />
  <Address Address="0x00CB49C4" Bar="Bar26" />
  <Address Address="0x00CB49C8" Bar="Bar27" />
  <Address Address="0x00CB49CC" Bar="Bar28" />
  <Address Address="0x00CB49D0" Bar="Bar29" />
  <Address Address="0x00CB49D4" Bar="Bar20" />
  <Address Address="0x00CB49D8" Bar="Bar2-" />
  <Address Address="0x00CB49DC" Bar="Bar2=" />
  
  <Address Address="0x00CB49E0" Bar="Bar31" />
  <Address Address="0x00CB49E4" Bar="Bar32" />
  <Address Address="0x00CB49E8" Bar="Bar33" />
  <Address Address="0x00CB49EC" Bar="Bar34" />
  <Address Address="0x00CB49F0" Bar="Bar35" />
  <Address Address="0x00CB49F4" Bar="Bar36" />
  <Address Address="0x00CB49F8" Bar="Bar37" />
  <Address Address="0x00CB49FC" Bar="Bar38" />
  <Address Address="0x00CB4A00" Bar="Bar39" />
  <Address Address="0x00CB4A04" Bar="Bar30" />
  <Address Address="0x00CB4A08" Bar="Bar3-" />
  <Address Address="0x00CB4A0C" Bar="Bar3=" />
  
  <Address Address="0x00CB4A10" Bar="Bar41" />
  <Address Address="0x00CB4A14" Bar="Bar42" />
  <Address Address="0x00CB4A18" Bar="Bar43" />
  <Address Address="0x00CB4A1C" Bar="Bar44" />
  <Address Address="0x00CB4A20" Bar="Bar45" />
  <Address Address="0x00CB4A24" Bar="Bar46" />
  <Address Address="0x00CB4A28" Bar="Bar47" />
  <Address Address="0x00CB4A2C" Bar="Bar48" />
  <Address Address="0x00CB4A30" Bar="Bar49" />
  <Address Address="0x00CB4A34" Bar="Bar40" />
  <Address Address="0x00CB4A38" Bar="Bar4-" />
  <Address Address="0x00CB4A3C" Bar="Bar4=" />
  
  <Address Address="0x00CB4A40" Bar="Bar51" />
  <Address Address="0x00CB4A44" Bar="Bar52" />
  <Address Address="0x00CB4A48" Bar="Bar53" />
  <Address Address="0x00CB4A4C" Bar="Bar54" />
  <Address Address="0x00CB4A50" Bar="Bar55" />
  <Address Address="0x00CB4A54" Bar="Bar56" />
  <Address Address="0x00CB4A58" Bar="Bar57" />
  <Address Address="0x00CB4A5C" Bar="Bar58" />
  <Address Address="0x00CB4A60" Bar="Bar59" />
  <Address Address="0x00CB4A64" Bar="Bar50" />
  <Address Address="0x00CB4A68" Bar="Bar5-" />
  <Address Address="0x00CB4A6C" Bar="Bar5=" />
  
  <Address Address="0x00CB4A70" Bar="Bar61" />
  <Address Address="0x00CB4A74" Bar="Bar62" />
  <Address Address="0x00CB4A78" Bar="Bar63" />
  <Address Address="0x00CB4A7C" Bar="Bar64" />
  <Address Address="0x00CB4A80" Bar="Bar65" />
  <Address Address="0x00CB4A84" Bar="Bar66" />
  <Address Address="0x00CB4A88" Bar="Bar67" />
  <Address Address="0x00CB4A8C" Bar="Bar68" />
  <Address Address="0x00CB4A90" Bar="Bar69" />
  <Address Address="0x00CB4A94" Bar="Bar60" />
  <Address Address="0x00CB4A98" Bar="Bar6-" />
  <Address Address="0x00CB4A9C" Bar="Bar6=" />
</Addresses>

and I use this code to read from the xml database:

Func CheckKey($Key)
    Local $PID = ProcessList($PathCheck)
    If ProcessExists($PathCheck) Then
        Local $DllInformation = _MemoryOpen($PID[1][1])
    Else
        Return -1
    EndIf
    Local $Read
    Local $Number = 0
    $GetKey = StringSplit($Key, ",")
    

$sXMLFile1 = "./Addresses.xml"

$result1 = _XMLFileOpen($sXMLFile1)
If $result1 = 0 Then Exit

$Path2 = "/Addresses"
$nodesArray2 = _XMLGetChildNodes($Path2)


For $X = 1 to $nodesArray2[0]
    
    $Read = _MemoryRead(_XMLGetAttrib($path2 & "/Address[" & $X & "]", "Address"), $DllInformation, 'dword')
    MsgBox(0, "Test", $Read)
    If @error Then
        Return -1
        MsgBox(0, "Test", "Return -1")
    ElseIf $GetKey[0] >= 1 Then
        Do
            $Number = $Number + 1
            If $Read = $GetKey[$Number] Then
                $Bar = _XMLGetAttrib($path2 & "/Address[" & $X & "]", "Bar")
                Return 1
                MsgBox(0, "Test", "Return 1")
            EndIf
        Until $Number = $GetKey[0]
        $Number = 0
    EndIf
Next
    _MemoryClose($DllInformation)
EndFunc;==>CheckKey

But it is 10x slower and it won't work!! I'm using the XMLDomWrapper.au3 with this and NomadMemory.au3 btw.

Edited by =sinister=

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