diff --git a/Installer/VistumblerInstaller.exe b/Installer/VistumblerInstaller.exe deleted file mode 100644 index d5021dad..00000000 Binary files a/Installer/VistumblerInstaller.exe and /dev/null differ diff --git a/Installer/Vistumbler_v10.6.5.exe b/Installer/Vistumbler_v10.6.5.exe new file mode 100644 index 00000000..38f65f60 Binary files /dev/null and b/Installer/Vistumbler_v10.6.5.exe differ diff --git a/Installer/nsis-3.04-setup.exe b/Installer/nsis-3.04-setup.exe new file mode 100644 index 00000000..6dd482e1 Binary files /dev/null and b/Installer/nsis-3.04-setup.exe differ diff --git a/Installer/UDFs/Zip.au3 b/Installer/old/UDFs/Zip.au3 similarity index 97% rename from Installer/UDFs/Zip.au3 rename to Installer/old/UDFs/Zip.au3 index 8f13a636..092a6829 100644 --- a/Installer/UDFs/Zip.au3 +++ b/Installer/old/UDFs/Zip.au3 @@ -1,890 +1,890 @@ -#include-once -#Tidy_Parameters=/sf -; =============================================================================================================== -; -; Description: ZIP Functions -; Author: wraithdu -; Date: 2010-08-27 -; Credits: PsaltyDS for the original idea on which this UDF is based. -; torels for the basic framework on which this UDF is based. -; -; NOTES: -; This UDF attempts to register a COM error handler if one does not exist. This is done to prevent -; any fatal COM errors. If you have implemented your own COM error handler, this WILL NOT replace it. -; -; The Shell object does not have a delete method, so some workarounds have been implemented. The -; options are either an interactive method (as in right-click -> Delete) or a slower method (slow for -; large files). The interactive method is the main function, while the slow method is in the internal -; function section near the bottom. -; -; When adding a file item to a ZIP archive, if the file exists and the overwrite flag is set, the slower -; internal delete method is used. This is the only way to make this step non-interactive. It will be -; slow for large files. -; -; The zipfldr library does not allow overwriting or merging of folders in a ZIP archive. That means -; if you try to add a folder and a folder with that name already exists, it will simply fail. Period. -; As such, I've disabled that functionality. -; -; I've also removed the AddFolderContents function. There are too many pitfalls with that scenario, not -; the least of which being the above restriction. -; -; =============================================================================================================== - -;;; Start COM error Handler -;===== -; if a COM error handler does not already exist, assign one -If Not ObjEvent("AutoIt.Error") Then - ; MUST assign this to a variable - Global Const $_Zip_COMErrorHandler = ObjEvent("AutoIt.Error", "_Zip_COMErrorFunc") -EndIf - - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_AddItem -; Description....: Add a file or folder to a ZIP archive -; Syntax.........: _Zip_AddItem($sZipFile, $sFileName[, $sDestDir = ""[, $iFlag = 21]]) -; Parameters.....: $sZipFile - Full path to ZIP file -; $sFileName - Full path to item to add -; $sDestDir - [Optional] Destination subdirectory in which to place the item -; + Directory must be formatted similarly: "some\sub\dir" -; $iFlag - [Optional] File copy flags (Default = 1+4+16) -; | 1 - Overwrite destination file if it exists -; | 4 - No progress box -; | 8 - Rename the file if a file of the same name already exists -; | 16 - Respond "Yes to All" for any dialog that is displayed -; | 64 - Preserve undo information, if possible -; | 256 - Display a progress dialog box but do not show the file names -; | 512 - Do not confirm the creation of a new directory if the operation requires one to be created -; |1024 - Do not display a user interface if an error occurs -; |2048 - Version 4.71. Do not copy the security attributes of the file -; |4096 - Only operate in the local directory, don't operate recursively into subdirectories -; |8192 - Version 5.0. Do not copy connected files as a group, only copy the specified files -; -; Return values..: Success - 1 -; Failure - 0 and sets @error -; | 1 - zipfldr.dll does not exist -; | 2 - Library not installed -; | 3 - Destination ZIP file not a full path -; | 4 - Item to add not a full path -; | 5 - Item to add does not exist -; | 6 - Destination subdirectory cannot be a full path -; | 7 - Destination ZIP file does not exist -; | 8 - Destination item exists and is a folder (see Remarks) -; | 9 - Destination item exists and overwrite flag not set -; |10 - Destination item exists and failed to overwrite -; |11 - Failed to create internal directory structure -; -; Author.........: wraithdu -; Modified.......: -; Remarks........: Destination folders CANNOT be overwritten or merged. They must be manually deleted first. -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_AddItem($sZipFile, $sFileName, $sDestDir = "", $iFlag = 21) - If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) - If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) - If Not _IsFullPath($sFileName) Then Return SetError(4, 0, 0) - If Not FileExists($sFileName) Then Return SetError(5, 0, 0) - If _IsFullPath($sDestDir) Then Return SetError(6, 0, 0) - ; clean paths - $sFileName = _Zip_PathStripSlash($sFileName) - $sDestDir = _Zip_PathStripSlash($sDestDir) - Local $sNameOnly = _Zip_PathNameOnly($sFileName) - ; process overwrite flag - Local $iOverwrite = 0 - If BitAND($iFlag, 1) Then - $iOverwrite = 1 - $iFlag -= 1 - EndIf - ; check for overwrite, if target exists... - Local $sTest = $sZipFile - If $sDestDir <> "" Then $sTest = $sZipFile & "\" & $sDestDir - Local $itemExists = _Zip_ItemExists($sTest, $sNameOnly) - If @error Then Return SetError(7, 0, 0) - If $itemExists Then - If @extended Then - ; get out, cannot overwrite folders... AT ALL - Return SetError(8, 0, 0) - Else - If $iOverwrite Then - _Zip_InternalDelete($sTest, $sNameOnly) - If @error Then Return SetError(10, 0, 0) - Else - Return SetError(9, 0, 0) - EndIf - EndIf - EndIf - Local $sTempFile = "" - If $sDestDir <> "" Then - $sTempFile = _Zip_AddPath($sZipFile, $sDestDir) - If @error Then Return SetError(11, 0, 0) - $sZipFile &= "\" & $sDestDir - EndIf - Local $oApp = ObjCreate("Shell.Application") - Local $oNS = $oApp.NameSpace($sZipFile) - ; copy the file - $oNS.CopyHere($sFileName, $iFlag) - Do - Sleep(250) - $oItem = $oNS.ParseName($sNameOnly) - Until IsObj($oItem) - If $sTempFile <> "" Then _Zip_InternalDelete($sZipFile, $sTempFile) - Return 1 -EndFunc ;==>_Zip_AddItem - -Func _Zip_COMErrorFunc() -EndFunc ;==>_Zip_COMErrorFunc - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_Count -; Description....: Count items in the root of a ZIP archive (not recursive) -; Syntax.........: _Zip_Count($sZipFile) -; Parameters.....: $sZipFile - Full path to ZIP file -; -; Return values..: Success - Item count -; Failure - 0 and sets @error -; | 1 - zipfldr.dll does not exist -; | 2 - Library not installed -; | 3 - Not a full path -; | 4 - ZIP file does not exist -; Author.........: wraithdu, torels -; Modified.......: -; Remarks........: -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_Count($sZipFile) - If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) - If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) - Local $oApp = ObjCreate("Shell.Application") - Local $oNS = $oApp.NameSpace($sZipFile) - If Not IsObj($oNS) Then Return SetError(4, 0, 0) - Return $oNS.Items.Count -EndFunc ;==>_Zip_Count - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_CountAll -; Description....: Recursively count items contained in a ZIP archive -; Syntax.........: _Zip_CountAll($sZipFile) -; Parameters.....: $sZipFile - Full path to ZIP file -; $iFileCount - [Internal] -; $iFolderCount - [Internal] -; -; Return values..: Success - Array with file and folder count -; [0] - File count -; [1] - Folder count -; Failure - 0 and sets @error -; | 1 - zipfldr.dll does not exist -; | 2 - Library not installed -; | 3 - Not a full path -; | 4 - ZIP file does not exist -; Author.........: wraithdu -; Modified.......: -; Remarks........: -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_CountAll($sZipFile, $iFileCount = 0, $iFolderCount = 0) - If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) - If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) - Local $oApp = ObjCreate("Shell.Application") - Local $oNS = $oApp.NameSpace($sZipFile) - If Not IsObj($oNS) Then Return SetError(4, 0, 0) - Local $oItems = $oNS.Items, $aCount - For $oItem In $oItems - If $oItem.IsFolder Then - ; folder, recurse - $iFolderCount += 1 - $aCount = _Zip_CountAll($sZipFile & "\" & $oItem.Name, $iFileCount, $iFolderCount) - $iFileCount = $aCount[0] - $iFolderCount = $aCount[1] - Else - $iFileCount += 1 - EndIf - Next - Dim $aCount[2] = [$iFileCount, $iFolderCount] - Return $aCount -EndFunc ;==>_Zip_CountAll - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_Create -; Description....: Create empty ZIP archive -; Syntax.........: _Zip_Create($sFileName[, $iOverwrite = 0]) -; Parameters.....: $sFileName - Name of new ZIP file -; $iOverwrite - [Optional] Overwrite flag (Default = 0) -; | 0 - Do not overwrite the file if it exists -; | 1 - Overwrite the file if it exists -; -; Return values..: Success - Name of the new file -; Failure - 0 and sets @error -; | 1 - A file with that name already exists and $iOverwrite flag is not set -; | 2 - Failed to create new file -; Author.........: wraithdu, torels -; Modified.......: -; Remarks........: -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_Create($sFileName, $iOverwrite = 0) - If FileExists($sFileName) And Not $iOverwrite Then Return SetError(1, 0, 0) - Local $hFp = FileOpen($sFileName, 2 + 8 + 16) - If $hFp = -1 Then Return SetError(2, 0, 0) - FileWrite($hFp, Binary("0x504B0506000000000000000000000000000000000000")) - FileClose($hFp) - Return $sFileName -EndFunc ;==>_Zip_Create - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_DeleteItem -; Description....: Delete a file or folder from a ZIP archive -; Syntax.........: _Zip_DeleteItem($sZipFile, $sFileName) -; Parameters.....: $sZipFile - Full path to the ZIP file -; $sFileName - Name of the item in the ZIP file -; -; Return values..: Success - 1 -; Failure - 0 and sets @error -; | 1 - zipfldr.dll does not exist -; | 2 - Library not installed -; | 3 - Not a full path -; | 4 - ZIP file does not exist -; | 5 - Item not found in ZIP file -; | 6 - Failed to get list of verbs -; | 7 - Failed to delete item -; Author.........: wraithdu -; Modified.......: -; Remarks........: $sFileName may be a path to an item from the root of the ZIP archive. -; For example, some ZIP file 'test.zip' has a subpath 'some\dir\file.ext'. Do not include a leading or trailing '\'. -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_DeleteItem($sZipFile, $sFileName) - If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) - If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) - ; parse filename - $sFileName = _Zip_PathStripSlash($sFileName) - If StringInStr($sFileName, "\") Then - ; subdirectory, parse out path and filename - $sZipFile &= "\" & _Zip_PathPathOnly($sFileName) - $sFileName = _Zip_PathNameOnly($sFileName) - EndIf - Local $oApp = ObjCreate("Shell.Application") - Local $oNS = $oApp.NameSpace($sZipFile) - If Not IsObj($oNS) Then Return SetError(4, 0, 0) - Local $oFolderItem = $oNS.ParseName($sFileName) - If Not IsObj($oFolderItem) Then Return SetError(5, 0, 0) - Local $oVerbs = $oFolderItem.Verbs - If Not IsObj($oVerbs) Then Return SetError(6, 0, 0) - For $oVerb In $oVerbs - If StringReplace($oVerb.Name, "&", "") = "delete" Then - $oVerb.DoIt - Return 1 - EndIf - Next - Return SetError(7, 0, 0) -EndFunc ;==>_Zip_DeleteItem - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_ItemExists -; Description....: Determines if an item exists in a ZIP file -; Syntax.........: _Zip_ItemExists($sZipFile, $sItem) -; Parameters.....: $sZipFile - Full path to ZIP file -; $sItem - Name of item -; -; Return values..: Success - 1 -; @extended is set to 1 if the item is a folder, 0 if a file -; Failure - 0 and sets @error -; | 1 - zipfldr.dll does not exist -; | 2 - Library not installed -; | 3 - Not a full path -; | 4 - ZIP file does not exist -; Author.........: wraithdu -; Modified.......: -; Remarks........: $sItem may be a path to an item from the root of the ZIP archive. -; For example, some ZIP file 'test.zip' has a subpath 'some\dir\file.ext'. Do not include a leading or trailing '\'. -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_ItemExists($sZipFile, $sItem) - If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) - If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) - $sItem = _Zip_PathStripSlash($sItem) - If StringInStr($sItem, "\") Then - ; subfolder - $sZipFile &= "\" & _Zip_PathPathOnly($sItem) - $sItem = _Zip_PathNameOnly($sItem) - EndIf - Local $oApp = ObjCreate("Shell.Application") - Local $oNS = $oApp.NameSpace($sZipFile) - If Not IsObj($oNS) Then Return SetError(4, 0, 0) - Local $oItem = $oNS.ParseName($sItem) - ; @extended holds whether item is a file (0) or folder (1) - If IsObj($oItem) Then Return SetExtended(Number($oItem.IsFolder), 1) - Return 0 -EndFunc ;==>_Zip_ItemExists - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_List -; Description....: List items in the root of a ZIP archive (not recursive) -; Syntax.........: _Zip_List($sZipFile) -; Parameters.....: $sZipFile - Full path to ZIP file -; -; Return values..: Success - Array of items -; Failure - 0 and sets @error -; | 1 - zipfldr.dll does not exist -; | 2 - Library not installed -; | 3 - Not a full path -; | 4 - ZIP file does not exist -; Author.........: wraithdu, torels -; Modified.......: -; Remarks........: Item count is returned in array[0]. -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_List($sZipFile) - If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) - If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) - Local $oApp = ObjCreate("Shell.Application") - Local $oNS = $oApp.NameSpace($sZipFile) - If Not IsObj($oNS) Then Return SetError(4, 0, 0) - Local $aArray[1] = [0] - Local $oList = $oNS.Items - For $oItem In $oList - $aArray[0] += 1 - ReDim $aArray[$aArray[0] + 1] - $aArray[$aArray[0]] = $oItem.Name - Next - Return $aArray -EndFunc ;==>_Zip_List - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_ListAll -; Description....: List all files inside a ZIP archive -; Syntax.........: _Zip_ListAll($sZipFile[, $iFullPath = 1]) -; Parameters.....: $sZipFile - Full path to ZIP file -; $iFullPath - [Optional] Path flag (Default = 1) -; | 0 - Return file names only -; | 1 - Return full paths of files from the archive root -; -; Return values..: Success - Array of file names / paths -; Failure - 0 and sets @error -; | 1 - zipfldr.dll does not exist -; | 2 - Library not installed -; | 3 - Not a full path -; | 4 - ZIP file or subfolder does not exist -; Author.........: wraithdu -; Modified.......: -; Remarks........: File count is returned in array[0], does not list folders. -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_ListAll($sZipFile, $iFullPath = 1) - If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) - If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) - Local $aArray[1] = [0] - _Zip_ListAll_Internal($sZipFile, $aArray, $iFullPath) - If @error Then - Return SetError(@error, 0, 0) - Else - Return $aArray - EndIf -EndFunc ;==>_Zip_ListAll - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_Search -; Description....: Search for files in a ZIP archive -; Syntax.........: _Zip_Search($sZipFile, $sSearchString) -; Parameters.....: $sZipFile - Full path to ZIP file -; $sSearchString - Substring to search -; -; Return values..: Success - Array of matching file paths from the root of the archive -; Failure - 0 and sets @error -; | 1 - zipfldr.dll does not exist -; | 2 - Library not installed -; | 3 - Not a full path -; | 4 - ZIP file or subfolder does not exist -; | 5 - No matching files found -; Author.........: wraithdu -; Modified.......: -; Remarks........: Found file count is returned in array[0]. -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_Search($sZipFile, $sSearchString) - Local $aList = _Zip_ListAll($sZipFile) - If @error Then Return SetError(@error, 0, 0) - Local $aArray[1] = [0], $sName - For $i = 1 To $aList[0] - $sName = $aList[$i] - If StringInStr($sName, "\") Then - ; subdirectory, isolate file name - $sName = _Zip_PathNameOnly($sName) - EndIf - If StringInStr($sName, $sSearchString) Then - $aArray[0] += 1 - ReDim $aArray[$aArray[0] + 1] - $aArray[$aArray[0]] = $aList[$i] - EndIf - Next - If $aArray[0] = 0 Then - ; no files found - Return SetError(5, 0, 0) - Else - Return $aArray - EndIf -EndFunc ;==>_Zip_Search - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_SearchInFile -; Description....: Search file contents of files in a ZIP archive -; Syntax.........: _Zip_SearchInFile($sZipFile, $sSearchString) -; Parameters.....: $sZipFile - Full path to ZIP file -; $sSearchString - Substring to search -; -; Return values..: Success - Array of matching file paths from the root of the archive -; Failure - 0 and sets @error -; | 1 - zipfldr.dll does not exist -; | 2 - Library not installed -; | 3 - Not a full path -; | 4 - ZIP file or subfolder does not exist -; | 5 - Failed to create temporary directory -; | 6 - Failed to extract ZIP file to temporary directory -; | 7 - No matching files found -; Author.........: wraithdu -; Modified.......: -; Remarks........: Found file count is returned in array[0]. -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_SearchInFile($sZipFile, $sSearchString) - Local $aList = _Zip_ListAll($sZipFile) - If @error Then Return SetError(@error, 0, 0) - Local $sTempDir = _Zip_CreateTempDir() - If @error Then Return SetError(5, 0, 0) - _Zip_UnzipAll($sZipFile, $sTempDir) ; flag = 20 -> no dialog, yes to all - If @error Then - DirRemove($sTempDir, 1) - Return SetError(6, 0, 0) - EndIf - Local $aArray[1] = [0], $sData - For $i = 1 To $aList[0] - $sData = FileRead($sTempDir & "\" & $aList[$i]) - If StringInStr($sData, $sSearchString) Then - $aArray[0] += 1 - ReDim $aArray[$aArray[0] + 1] - $aArray[$aArray[0]] = $aList[$i] - EndIf - Next - DirRemove($sTempDir, 1) - If $aArray[0] = 0 Then - ; no files found - Return SetError(7, 0, 0) - Else - Return $aArray - EndIf -EndFunc ;==>_Zip_SearchInFile - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_Unzip -; Description....: Extract a single item from a ZIP archive -; Syntax.........: _Zip_Unzip($sZipFile, $sFileName, $sDestPath[, $iFlag = 21]) -; Parameters.....: $sZipFile - Full path to ZIP file -; $sFileName - Name of the item in the ZIP file -; $sDestPath - Full path to the destination -; $iFlag - [Optional] File copy flags (Default = 1+4+16) -; | 1 - Overwrite destination file if it exists -; | 4 - No progress box -; | 8 - Rename the file if a file of the same name already exists -; | 16 - Respond "Yes to All" for any dialog that is displayed -; | 64 - Preserve undo information, if possible -; | 256 - Display a progress dialog box but do not show the file names -; | 512 - Do not confirm the creation of a new directory if the operation requires one to be created -; |1024 - Do not display a user interface if an error occurs -; |2048 - Version 4.71. Do not copy the security attributes of the file -; |4096 - Only operate in the local directory, don't operate recursively into subdirectories -; |8192 - Version 5.0. Do not copy connected files as a group, only copy the specified files -; -; Return values..: Success - 1 -; Failure - 0 and sets @error -; | 1 - zipfldr.dll does not exist -; | 2 - Library not installed -; | 3 - Not a full path -; | 4 - ZIP file / item path does not exist -; | 5 - Item not found in ZIP file -; | 6 - Failed to create destination (if necessary) -; | 7 - Failed to open destination -; | 8 - Failed to delete destination file / folder for overwriting -; | 9 - Destination exists and overwrite flag not set -; |10 - Failed to extract file -; Author.........: wraithdu, torels -; Modified.......: -; Remarks........: $sFileName may be a path to an item from the root of the ZIP archive. -; For example, some ZIP file 'test.zip' has a subpath 'some\dir\file.ext'. Do not include a leading or trailing '\'. -; If the overwrite flag is not set and the destination file / folder exists, overwriting is controlled -; by the remaining file copy flags ($iFlag) and/or user interaction. -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_Unzip($sZipFile, $sFileName, $sDestPath, $iFlag = 21) - If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) - If Not _IsFullPath($sZipFile) Or Not _IsFullPath($sDestPath) Then Return SetError(3, 0, 0) - Local $sTempDir = _Zip_TempDirName($sZipFile) - ; parse filename - $sFileName = _Zip_PathStripSlash($sFileName) - If StringInStr($sFileName, "\") Then - ; subdirectory, parse out path and filename - $sZipFile &= "\" & _Zip_PathPathOnly($sFileName) - $sFileName = _Zip_PathNameOnly($sFileName) - EndIf - Local $oApp = ObjCreate("Shell.Application") - Local $oNS = $oApp.NameSpace($sZipFile) - If Not IsObj($oNS) Then Return SetError(4, 0, 0) - Local $oFolderItem = $oNS.ParseName($sFileName) - If Not IsObj($oFolderItem) Then Return SetError(5, 0, 0) - $sDestPath = _Zip_PathStripSlash($sDestPath) - If Not FileExists($sDestPath) Then - DirCreate($sDestPath) - If @error Then Return SetError(6, 0, 0) - EndIf - Local $oNS2 = $oApp.NameSpace($sDestPath) - If Not IsObj($oNS2) Then Return SetError(7, 0, 0) - ; process overwrite flag - Local $iOverwrite = 0 - If BitAND($iFlag, 1) Then - $iOverwrite = 1 - $iFlag -= 1 - EndIf - Local $sDestFullPath = $sDestPath & "\" & $sFileName - If FileExists($sDestFullPath) Then - ; destination file exists - If $iOverwrite Then - If StringInStr(FileGetAttrib($sDestFullPath), "D") Then - ; folder - If Not DirRemove($sDestFullPath, 1) Then Return SetError(8, 0, 0) - Else - If Not FileDelete($sDestFullPath) Then Return SetError(8, 0, 0) - EndIf - Else - Return SetError(9, 0, 0) - EndIf - EndIf - $oNS2.CopyHere($oFolderItem, $iFlag) - DirRemove($sTempDir, 1) - If FileExists($sDestFullPath) Then - ; success - Return 1 - Else - ; failure - Return SetError(10, 0, 0) - EndIf -EndFunc ;==>_Zip_Unzip - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_UnzipAll -; Description....: Extract all files contained in a ZIP archive -; Syntax.........: _Zip_UnzipAll($sZipFile, $sDestPath[, $iFlag = 20]) -; Parameters.....: $sZipFile - Full path to ZIP file -; $sDestPath - Full path to the destination -; $iFlag - [Optional] File copy flags (Default = 4+16) -; | 4 - No progress box -; | 8 - Rename the file if a file of the same name already exists -; | 16 - Respond "Yes to All" for any dialog that is displayed -; | 64 - Preserve undo information, if possible -; | 256 - Display a progress dialog box but do not show the file names -; | 512 - Do not confirm the creation of a new directory if the operation requires one to be created -; |1024 - Do not display a user interface if an error occurs -; |2048 - Version 4.71. Do not copy the security attributes of the file -; |4096 - Only operate in the local directory, don't operate recursively into subdirectories -; |8192 - Version 5.0. Do not copy connected files as a group, only copy the specified files -; -; Return values..: Success - 1 -; Failure - 0 and sets @error -; | 1 - zipfldr.dll does not exist -; | 2 - Library not installed -; | 3 - Not a full path -; | 4 - ZIP file does not exist -; | 5 - Failed to create destination (if necessary) -; | 6 - Failed to open destination -; | 7 - Failed to extract file(s) -; Author.........: wraithdu, torels -; Modified.......: -; Remarks........: Overwriting of destination files is controlled solely by the file copy flags (ie $iFlag = 1 is NOT valid). -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_UnzipAll($sZipFile, $sDestPath, $iFlag = 20) - If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) - If Not _IsFullPath($sZipFile) Or Not _IsFullPath($sDestPath) Then Return SetError(3, 0, 0) - Local $sTempDir = _Zip_TempDirName($sZipFile) - Local $oApp = ObjCreate("Shell.Application") - Local $oNS = $oApp.NameSpace($sZipFile) - If Not IsObj($oNS) Then Return SetError(4, 0, 0) - $sDestPath = _Zip_PathStripSlash($sDestPath) - If Not FileExists($sDestPath) Then - DirCreate($sDestPath) - If @error Then Return SetError(5, 0, 0) - EndIf - Local $oNS2 = $oApp.NameSpace($sDestPath) - If Not IsObj($oNS2) Then Return SetError(6, 0, 0) - $oNS2.CopyHere($oNS.Items, $iFlag) - DirRemove($sTempDir, 1) - - ;Workaround because windows did not always return file extension for .Name - Andrew Calcutt 10/23/2010 - $testfilesourcepath = $oNS.Items.Item($oNS.Items.Count - 1).path - $testfiledestpath = $sDestPath & "\" & StringTrimLeft($testfilesourcepath, StringInStr($testfilesourcepath, "\" , 0 , -1)) - ;end workaround - If FileExists($testfiledestpath) Then - ; success... most likely - ; checks for existence of last item from source in destination - Return 1 - Else - ; failure - Return SetError(7, 0, 0) - EndIf -EndFunc ;==>_Zip_UnzipAll - -#Region INTERNAL FUNCTIONS -; #FUNCTION# ==================================================================================================== -; Name...........: _IsFullPath -; Description....: Determines if a given path is a fully qualified path (well, roughly...) -; Syntax.........: _IsFullPath($sPath) -; Parameters.....: $sPath - Path to check -; -; Return values..: Success - True -; Failure - False -; Author.........: torels -; Modified.......: -; Remarks........: -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _IsFullPath($sPath) - If StringInStr($sPath, ":\") Then - Return True - Else - Return False - EndIf -EndFunc ;==>_IsFullPath - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_AddPath -; Description....: INTERNAL FUNCTION -; Author.........: wraithdu -; =============================================================================================================== -Func _Zip_AddPath($sZipFile, $sPath) - If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) - If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) - Local $oApp = ObjCreate("Shell.Application") - Local $oNS = $oApp.NameSpace($sZipFile) - If Not IsObj($oNS) Then Return SetError(4, 0, 0) - ; check and create directory structure - $sPath = _Zip_PathStripSlash($sPath) - Local $sFileName = "", $sNewPath = "" - If $sPath <> "" Then - ; create temp dir - Local $sTempDir = _Zip_CreateTempDir() - If @error Then Return SetError(5, 0, 0) - Local $oTemp = $oApp.NameSpace($sTempDir) - Local $aDir = StringSplit($sPath, "\"), $oNS2 - For $i = 1 To $aDir[0] - $oNS2 = $oApp.NameSpace($sZipFile & "\" & $aDir[$i]) - If Not IsObj($oNS2) Then - ; create the directory structure - For $i = $i To $aDir[0] - $sNewPath &= "\" & $aDir[$i] - Next - DirCreate($sTempDir & $sNewPath) - $sFileName = _Zip_CreateTempName() - FileClose(FileOpen($sTempDir & $sNewPath & "\" & $sFileName, 2)) - $oNS.CopyHere($oTemp.Items) - ; wait for dir structure - Do - Sleep(250) - $oNS = $oApp.NameSpace($sZipFile & $sNewPath) - Until IsObj($oNS) - ; wait for file - Do - Sleep(250) - $oItem = $oNS.ParseName($sFileName) - Until IsObj($oItem) - DirRemove($sTempDir, 1) - ExitLoop - EndIf - $sZipFile &= "\" & $aDir[$i] - $oNS = $oApp.NameSpace($sZipFile) - Next - EndIf - Return $sFileName -EndFunc ;==>_Zip_AddPath - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_CreateTempDir -; Description....: INTERNAL FUNCTION -; Author.........: wraithdu -; =============================================================================================================== -Func _Zip_CreateTempDir() - Local $s_TempName - Do - $s_TempName = "" - While StringLen($s_TempName) < 7 - $s_TempName &= Chr(Random(97, 122, 1)) - WEnd - $s_TempName = @TempDir & "\~" & $s_TempName & ".tmp" - Until Not FileExists($s_TempName) - If Not DirCreate($s_TempName) Then Return SetError(1, 0, 0) - Return $s_TempName -EndFunc ;==>_Zip_CreateTempDir - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_CreateTempName -; Description....: INTERNAL FUNCTION -; Author.........: wraithdu -; =============================================================================================================== -Func _Zip_CreateTempName() - Local $GUID = DllStructCreate("dword Data1;word Data2;word Data3;byte Data4[8]") - DllCall("ole32.dll", "int", "CoCreateGuid", "ptr", DllStructGetPtr($GUID)) - Local $ret = DllCall("ole32.dll", "int", "StringFromGUID2", "ptr", DllStructGetPtr($GUID), "wstr", "", "int", 40) - If @error Then Return SetError(1, 0, "") - Return $ret[2] -EndFunc ;==>_Zip_CreateTempName - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_DllChk -; Description....: Checks if the zipfldr library is installed -; Syntax.........: _Zip_DllChk() -; Parameters.....: None. -; Return values..: Success - 1 -; Failure - 0 and sets @error -; | 1 - zipfldr.dll not found -; | 2 - Library not installed -; Author.........: wraithdu, torels -; Modified.......: -; Remarks........: -; Related........: -; Link...........: -; Example........: -; =============================================================================================================== -Func _Zip_DllChk() - If Not FileExists(@SystemDir & "\zipfldr.dll") Then Return SetError(1, 0, 0) - If Not RegRead("HKEY_CLASSES_ROOT\CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}", "") Then Return SetError(2, 0, 0) - Return 1 -EndFunc ;==>_Zip_DllChk - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_InternalDelete -; Description....: INTERNAL FUNCTION -; Author.........: wraithdu -; =============================================================================================================== -Func _Zip_InternalDelete($sZipFile, $sFileName) - If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) - If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) - ; parse filename - $sFileName = _Zip_PathStripSlash($sFileName) - If StringInStr($sFileName, "\") Then - ; subdirectory, parse out path and filename - $sZipFile &= "\" & _Zip_PathPathOnly($sFileName) - $sFileName = _Zip_PathNameOnly($sFileName) - EndIf - Local $oApp = ObjCreate("Shell.Application") - Local $oNS = $oApp.NameSpace($sZipFile) - If Not IsObj($oNS) Then Return SetError(4, 0, 0) - Local $oFolderItem = $oNS.ParseName($sFileName) - If Not IsObj($oFolderItem) Then Return SetError(5, 0, 0) - ; ## Ugh, this was ultimately a bad solution - ; move file to a temp directory and remove the directory - Local $sTempDir = _Zip_CreateTempDir() - If @error Then Return SetError(6, 0, 0) - $oApp.NameSpace($sTempDir).MoveHere($oFolderItem, 20) - DirRemove($sTempDir, 1) - $oFolderItem = $oNS.ParseName($sFileName) - If IsObj($oFolderItem) Then - ; failure - Return SetError(7, 0, 0) - Else - Return 1 - EndIf -EndFunc ;==>_Zip_InternalDelete - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_ListAll_Internal -; Description....: INTERNAL FUNCTION -; Author.........: wraithdu -; =============================================================================================================== -Func _Zip_ListAll_Internal($sZipFile, ByRef $aArray, $iFullPath, $sPrefix = "") - Local $oApp = ObjCreate("Shell.Application") - Local $oNS = $oApp.NameSpace($sZipFile) - If Not IsObj($oNS) Then Return SetError(4, 0, 0) - Local $oList = $oNS.Items - For $oItem In $oList - If $oItem.IsFolder Then - ; folder, recurse - If $iFullPath Then - ; build path from root of zip - _Zip_ListAll_Internal($sZipFile & "\" & $oItem.Name, $aArray, $iFullPath, $sPrefix & $oItem.Name & "\") - If @error Then Return SetError(4) - Else - ; just filenames - _Zip_ListAll_Internal($sZipFile & "\" & $oItem.Name, $aArray, $iFullPath, "") - If @error Then Return SetError(4) - EndIf - Else - $aArray[0] += 1 - ReDim $aArray[$aArray[0] + 1] - $aArray[$aArray[0]] = $sPrefix & $oItem.Name - EndIf - Next -EndFunc ;==>_Zip_ListAll_Internal - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_PathNameOnly -; Description....: INTERNAL FUNCTION -; Author.........: wraithdu -; =============================================================================================================== -Func _Zip_PathNameOnly($sPath) - Return StringRegExpReplace($sPath, ".*\\", "") -EndFunc ;==>_Zip_PathNameOnly - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_PathPathOnly -; Description....: INTERNAL FUNCTION -; Author.........: wraithdu -; =============================================================================================================== -Func _Zip_PathPathOnly($sPath) - Return StringRegExpReplace($sPath, "^(.*)\\.*?$", "${1}") -EndFunc ;==>_Zip_PathPathOnly - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_PathStripSlash -; Description....: INTERNAL FUNCTION -; Author.........: wraithdu -; =============================================================================================================== -Func _Zip_PathStripSlash($sString) - Return StringRegExpReplace($sString, "(^\\+|\\+$)", "") -EndFunc ;==>_Zip_PathStripSlash - -; #FUNCTION# ==================================================================================================== -; Name...........: _Zip_TempDirName -; Description....: INTERNAL FUNCTION -; Author.........: wraithdu, trancexxx -; =============================================================================================================== -Func _Zip_TempDirName($sZipFile) - Local $i = 0, $sTemp, $sName = _Zip_PathNameOnly($sZipFile) - Do - $i += 1 - $sTemp = @TempDir & "\Temporary Directory " & $i & " for " & $sName - Until Not FileExists($sTemp) ; this folder will be created during extraction - Return $sTemp -EndFunc ;==>_Zip_TempDirName -#EndRegion INTERNAL FUNCTIONS +#include-once +#Tidy_Parameters=/sf +; =============================================================================================================== +; +; Description: ZIP Functions +; Author: wraithdu +; Date: 2010-08-27 +; Credits: PsaltyDS for the original idea on which this UDF is based. +; torels for the basic framework on which this UDF is based. +; +; NOTES: +; This UDF attempts to register a COM error handler if one does not exist. This is done to prevent +; any fatal COM errors. If you have implemented your own COM error handler, this WILL NOT replace it. +; +; The Shell object does not have a delete method, so some workarounds have been implemented. The +; options are either an interactive method (as in right-click -> Delete) or a slower method (slow for +; large files). The interactive method is the main function, while the slow method is in the internal +; function section near the bottom. +; +; When adding a file item to a ZIP archive, if the file exists and the overwrite flag is set, the slower +; internal delete method is used. This is the only way to make this step non-interactive. It will be +; slow for large files. +; +; The zipfldr library does not allow overwriting or merging of folders in a ZIP archive. That means +; if you try to add a folder and a folder with that name already exists, it will simply fail. Period. +; As such, I've disabled that functionality. +; +; I've also removed the AddFolderContents function. There are too many pitfalls with that scenario, not +; the least of which being the above restriction. +; +; =============================================================================================================== + +;;; Start COM error Handler +;===== +; if a COM error handler does not already exist, assign one +If Not ObjEvent("AutoIt.Error") Then + ; MUST assign this to a variable + Global Const $_Zip_COMErrorHandler = ObjEvent("AutoIt.Error", "_Zip_COMErrorFunc") +EndIf + + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_AddItem +; Description....: Add a file or folder to a ZIP archive +; Syntax.........: _Zip_AddItem($sZipFile, $sFileName[, $sDestDir = ""[, $iFlag = 21]]) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sFileName - Full path to item to add +; $sDestDir - [Optional] Destination subdirectory in which to place the item +; + Directory must be formatted similarly: "some\sub\dir" +; $iFlag - [Optional] File copy flags (Default = 1+4+16) +; | 1 - Overwrite destination file if it exists +; | 4 - No progress box +; | 8 - Rename the file if a file of the same name already exists +; | 16 - Respond "Yes to All" for any dialog that is displayed +; | 64 - Preserve undo information, if possible +; | 256 - Display a progress dialog box but do not show the file names +; | 512 - Do not confirm the creation of a new directory if the operation requires one to be created +; |1024 - Do not display a user interface if an error occurs +; |2048 - Version 4.71. Do not copy the security attributes of the file +; |4096 - Only operate in the local directory, don't operate recursively into subdirectories +; |8192 - Version 5.0. Do not copy connected files as a group, only copy the specified files +; +; Return values..: Success - 1 +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Destination ZIP file not a full path +; | 4 - Item to add not a full path +; | 5 - Item to add does not exist +; | 6 - Destination subdirectory cannot be a full path +; | 7 - Destination ZIP file does not exist +; | 8 - Destination item exists and is a folder (see Remarks) +; | 9 - Destination item exists and overwrite flag not set +; |10 - Destination item exists and failed to overwrite +; |11 - Failed to create internal directory structure +; +; Author.........: wraithdu +; Modified.......: +; Remarks........: Destination folders CANNOT be overwritten or merged. They must be manually deleted first. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_AddItem($sZipFile, $sFileName, $sDestDir = "", $iFlag = 21) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + If Not _IsFullPath($sFileName) Then Return SetError(4, 0, 0) + If Not FileExists($sFileName) Then Return SetError(5, 0, 0) + If _IsFullPath($sDestDir) Then Return SetError(6, 0, 0) + ; clean paths + $sFileName = _Zip_PathStripSlash($sFileName) + $sDestDir = _Zip_PathStripSlash($sDestDir) + Local $sNameOnly = _Zip_PathNameOnly($sFileName) + ; process overwrite flag + Local $iOverwrite = 0 + If BitAND($iFlag, 1) Then + $iOverwrite = 1 + $iFlag -= 1 + EndIf + ; check for overwrite, if target exists... + Local $sTest = $sZipFile + If $sDestDir <> "" Then $sTest = $sZipFile & "\" & $sDestDir + Local $itemExists = _Zip_ItemExists($sTest, $sNameOnly) + If @error Then Return SetError(7, 0, 0) + If $itemExists Then + If @extended Then + ; get out, cannot overwrite folders... AT ALL + Return SetError(8, 0, 0) + Else + If $iOverwrite Then + _Zip_InternalDelete($sTest, $sNameOnly) + If @error Then Return SetError(10, 0, 0) + Else + Return SetError(9, 0, 0) + EndIf + EndIf + EndIf + Local $sTempFile = "" + If $sDestDir <> "" Then + $sTempFile = _Zip_AddPath($sZipFile, $sDestDir) + If @error Then Return SetError(11, 0, 0) + $sZipFile &= "\" & $sDestDir + EndIf + Local $oApp = ObjCreate("Shell.Application") + Local $oNS = $oApp.NameSpace($sZipFile) + ; copy the file + $oNS.CopyHere($sFileName, $iFlag) + Do + Sleep(250) + $oItem = $oNS.ParseName($sNameOnly) + Until IsObj($oItem) + If $sTempFile <> "" Then _Zip_InternalDelete($sZipFile, $sTempFile) + Return 1 +EndFunc ;==>_Zip_AddItem + +Func _Zip_COMErrorFunc() +EndFunc ;==>_Zip_COMErrorFunc + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_Count +; Description....: Count items in the root of a ZIP archive (not recursive) +; Syntax.........: _Zip_Count($sZipFile) +; Parameters.....: $sZipFile - Full path to ZIP file +; +; Return values..: Success - Item count +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file does not exist +; Author.........: wraithdu, torels +; Modified.......: +; Remarks........: +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_Count($sZipFile) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + Local $oApp = ObjCreate("Shell.Application") + Local $oNS = $oApp.NameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Return $oNS.Items.Count +EndFunc ;==>_Zip_Count + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_CountAll +; Description....: Recursively count items contained in a ZIP archive +; Syntax.........: _Zip_CountAll($sZipFile) +; Parameters.....: $sZipFile - Full path to ZIP file +; $iFileCount - [Internal] +; $iFolderCount - [Internal] +; +; Return values..: Success - Array with file and folder count +; [0] - File count +; [1] - Folder count +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file does not exist +; Author.........: wraithdu +; Modified.......: +; Remarks........: +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_CountAll($sZipFile, $iFileCount = 0, $iFolderCount = 0) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + Local $oApp = ObjCreate("Shell.Application") + Local $oNS = $oApp.NameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $oItems = $oNS.Items, $aCount + For $oItem In $oItems + If $oItem.IsFolder Then + ; folder, recurse + $iFolderCount += 1 + $aCount = _Zip_CountAll($sZipFile & "\" & $oItem.Name, $iFileCount, $iFolderCount) + $iFileCount = $aCount[0] + $iFolderCount = $aCount[1] + Else + $iFileCount += 1 + EndIf + Next + Dim $aCount[2] = [$iFileCount, $iFolderCount] + Return $aCount +EndFunc ;==>_Zip_CountAll + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_Create +; Description....: Create empty ZIP archive +; Syntax.........: _Zip_Create($sFileName[, $iOverwrite = 0]) +; Parameters.....: $sFileName - Name of new ZIP file +; $iOverwrite - [Optional] Overwrite flag (Default = 0) +; | 0 - Do not overwrite the file if it exists +; | 1 - Overwrite the file if it exists +; +; Return values..: Success - Name of the new file +; Failure - 0 and sets @error +; | 1 - A file with that name already exists and $iOverwrite flag is not set +; | 2 - Failed to create new file +; Author.........: wraithdu, torels +; Modified.......: +; Remarks........: +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_Create($sFileName, $iOverwrite = 0) + If FileExists($sFileName) And Not $iOverwrite Then Return SetError(1, 0, 0) + Local $hFp = FileOpen($sFileName, 2 + 8 + 16) + If $hFp = -1 Then Return SetError(2, 0, 0) + FileWrite($hFp, Binary("0x504B0506000000000000000000000000000000000000")) + FileClose($hFp) + Return $sFileName +EndFunc ;==>_Zip_Create + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_DeleteItem +; Description....: Delete a file or folder from a ZIP archive +; Syntax.........: _Zip_DeleteItem($sZipFile, $sFileName) +; Parameters.....: $sZipFile - Full path to the ZIP file +; $sFileName - Name of the item in the ZIP file +; +; Return values..: Success - 1 +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file does not exist +; | 5 - Item not found in ZIP file +; | 6 - Failed to get list of verbs +; | 7 - Failed to delete item +; Author.........: wraithdu +; Modified.......: +; Remarks........: $sFileName may be a path to an item from the root of the ZIP archive. +; For example, some ZIP file 'test.zip' has a subpath 'some\dir\file.ext'. Do not include a leading or trailing '\'. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_DeleteItem($sZipFile, $sFileName) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + ; parse filename + $sFileName = _Zip_PathStripSlash($sFileName) + If StringInStr($sFileName, "\") Then + ; subdirectory, parse out path and filename + $sZipFile &= "\" & _Zip_PathPathOnly($sFileName) + $sFileName = _Zip_PathNameOnly($sFileName) + EndIf + Local $oApp = ObjCreate("Shell.Application") + Local $oNS = $oApp.NameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $oFolderItem = $oNS.ParseName($sFileName) + If Not IsObj($oFolderItem) Then Return SetError(5, 0, 0) + Local $oVerbs = $oFolderItem.Verbs + If Not IsObj($oVerbs) Then Return SetError(6, 0, 0) + For $oVerb In $oVerbs + If StringReplace($oVerb.Name, "&", "") = "delete" Then + $oVerb.DoIt + Return 1 + EndIf + Next + Return SetError(7, 0, 0) +EndFunc ;==>_Zip_DeleteItem + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_ItemExists +; Description....: Determines if an item exists in a ZIP file +; Syntax.........: _Zip_ItemExists($sZipFile, $sItem) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sItem - Name of item +; +; Return values..: Success - 1 +; @extended is set to 1 if the item is a folder, 0 if a file +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file does not exist +; Author.........: wraithdu +; Modified.......: +; Remarks........: $sItem may be a path to an item from the root of the ZIP archive. +; For example, some ZIP file 'test.zip' has a subpath 'some\dir\file.ext'. Do not include a leading or trailing '\'. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_ItemExists($sZipFile, $sItem) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + $sItem = _Zip_PathStripSlash($sItem) + If StringInStr($sItem, "\") Then + ; subfolder + $sZipFile &= "\" & _Zip_PathPathOnly($sItem) + $sItem = _Zip_PathNameOnly($sItem) + EndIf + Local $oApp = ObjCreate("Shell.Application") + Local $oNS = $oApp.NameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $oItem = $oNS.ParseName($sItem) + ; @extended holds whether item is a file (0) or folder (1) + If IsObj($oItem) Then Return SetExtended(Number($oItem.IsFolder), 1) + Return 0 +EndFunc ;==>_Zip_ItemExists + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_List +; Description....: List items in the root of a ZIP archive (not recursive) +; Syntax.........: _Zip_List($sZipFile) +; Parameters.....: $sZipFile - Full path to ZIP file +; +; Return values..: Success - Array of items +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file does not exist +; Author.........: wraithdu, torels +; Modified.......: +; Remarks........: Item count is returned in array[0]. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_List($sZipFile) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + Local $oApp = ObjCreate("Shell.Application") + Local $oNS = $oApp.NameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $aArray[1] = [0] + Local $oList = $oNS.Items + For $oItem In $oList + $aArray[0] += 1 + ReDim $aArray[$aArray[0] + 1] + $aArray[$aArray[0]] = $oItem.Name + Next + Return $aArray +EndFunc ;==>_Zip_List + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_ListAll +; Description....: List all files inside a ZIP archive +; Syntax.........: _Zip_ListAll($sZipFile[, $iFullPath = 1]) +; Parameters.....: $sZipFile - Full path to ZIP file +; $iFullPath - [Optional] Path flag (Default = 1) +; | 0 - Return file names only +; | 1 - Return full paths of files from the archive root +; +; Return values..: Success - Array of file names / paths +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file or subfolder does not exist +; Author.........: wraithdu +; Modified.......: +; Remarks........: File count is returned in array[0], does not list folders. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_ListAll($sZipFile, $iFullPath = 1) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + Local $aArray[1] = [0] + _Zip_ListAll_Internal($sZipFile, $aArray, $iFullPath) + If @error Then + Return SetError(@error, 0, 0) + Else + Return $aArray + EndIf +EndFunc ;==>_Zip_ListAll + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_Search +; Description....: Search for files in a ZIP archive +; Syntax.........: _Zip_Search($sZipFile, $sSearchString) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sSearchString - Substring to search +; +; Return values..: Success - Array of matching file paths from the root of the archive +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file or subfolder does not exist +; | 5 - No matching files found +; Author.........: wraithdu +; Modified.......: +; Remarks........: Found file count is returned in array[0]. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_Search($sZipFile, $sSearchString) + Local $aList = _Zip_ListAll($sZipFile) + If @error Then Return SetError(@error, 0, 0) + Local $aArray[1] = [0], $sName + For $i = 1 To $aList[0] + $sName = $aList[$i] + If StringInStr($sName, "\") Then + ; subdirectory, isolate file name + $sName = _Zip_PathNameOnly($sName) + EndIf + If StringInStr($sName, $sSearchString) Then + $aArray[0] += 1 + ReDim $aArray[$aArray[0] + 1] + $aArray[$aArray[0]] = $aList[$i] + EndIf + Next + If $aArray[0] = 0 Then + ; no files found + Return SetError(5, 0, 0) + Else + Return $aArray + EndIf +EndFunc ;==>_Zip_Search + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_SearchInFile +; Description....: Search file contents of files in a ZIP archive +; Syntax.........: _Zip_SearchInFile($sZipFile, $sSearchString) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sSearchString - Substring to search +; +; Return values..: Success - Array of matching file paths from the root of the archive +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file or subfolder does not exist +; | 5 - Failed to create temporary directory +; | 6 - Failed to extract ZIP file to temporary directory +; | 7 - No matching files found +; Author.........: wraithdu +; Modified.......: +; Remarks........: Found file count is returned in array[0]. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_SearchInFile($sZipFile, $sSearchString) + Local $aList = _Zip_ListAll($sZipFile) + If @error Then Return SetError(@error, 0, 0) + Local $sTempDir = _Zip_CreateTempDir() + If @error Then Return SetError(5, 0, 0) + _Zip_UnzipAll($sZipFile, $sTempDir) ; flag = 20 -> no dialog, yes to all + If @error Then + DirRemove($sTempDir, 1) + Return SetError(6, 0, 0) + EndIf + Local $aArray[1] = [0], $sData + For $i = 1 To $aList[0] + $sData = FileRead($sTempDir & "\" & $aList[$i]) + If StringInStr($sData, $sSearchString) Then + $aArray[0] += 1 + ReDim $aArray[$aArray[0] + 1] + $aArray[$aArray[0]] = $aList[$i] + EndIf + Next + DirRemove($sTempDir, 1) + If $aArray[0] = 0 Then + ; no files found + Return SetError(7, 0, 0) + Else + Return $aArray + EndIf +EndFunc ;==>_Zip_SearchInFile + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_Unzip +; Description....: Extract a single item from a ZIP archive +; Syntax.........: _Zip_Unzip($sZipFile, $sFileName, $sDestPath[, $iFlag = 21]) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sFileName - Name of the item in the ZIP file +; $sDestPath - Full path to the destination +; $iFlag - [Optional] File copy flags (Default = 1+4+16) +; | 1 - Overwrite destination file if it exists +; | 4 - No progress box +; | 8 - Rename the file if a file of the same name already exists +; | 16 - Respond "Yes to All" for any dialog that is displayed +; | 64 - Preserve undo information, if possible +; | 256 - Display a progress dialog box but do not show the file names +; | 512 - Do not confirm the creation of a new directory if the operation requires one to be created +; |1024 - Do not display a user interface if an error occurs +; |2048 - Version 4.71. Do not copy the security attributes of the file +; |4096 - Only operate in the local directory, don't operate recursively into subdirectories +; |8192 - Version 5.0. Do not copy connected files as a group, only copy the specified files +; +; Return values..: Success - 1 +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file / item path does not exist +; | 5 - Item not found in ZIP file +; | 6 - Failed to create destination (if necessary) +; | 7 - Failed to open destination +; | 8 - Failed to delete destination file / folder for overwriting +; | 9 - Destination exists and overwrite flag not set +; |10 - Failed to extract file +; Author.........: wraithdu, torels +; Modified.......: +; Remarks........: $sFileName may be a path to an item from the root of the ZIP archive. +; For example, some ZIP file 'test.zip' has a subpath 'some\dir\file.ext'. Do not include a leading or trailing '\'. +; If the overwrite flag is not set and the destination file / folder exists, overwriting is controlled +; by the remaining file copy flags ($iFlag) and/or user interaction. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_Unzip($sZipFile, $sFileName, $sDestPath, $iFlag = 21) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Or Not _IsFullPath($sDestPath) Then Return SetError(3, 0, 0) + Local $sTempDir = _Zip_TempDirName($sZipFile) + ; parse filename + $sFileName = _Zip_PathStripSlash($sFileName) + If StringInStr($sFileName, "\") Then + ; subdirectory, parse out path and filename + $sZipFile &= "\" & _Zip_PathPathOnly($sFileName) + $sFileName = _Zip_PathNameOnly($sFileName) + EndIf + Local $oApp = ObjCreate("Shell.Application") + Local $oNS = $oApp.NameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $oFolderItem = $oNS.ParseName($sFileName) + If Not IsObj($oFolderItem) Then Return SetError(5, 0, 0) + $sDestPath = _Zip_PathStripSlash($sDestPath) + If Not FileExists($sDestPath) Then + DirCreate($sDestPath) + If @error Then Return SetError(6, 0, 0) + EndIf + Local $oNS2 = $oApp.NameSpace($sDestPath) + If Not IsObj($oNS2) Then Return SetError(7, 0, 0) + ; process overwrite flag + Local $iOverwrite = 0 + If BitAND($iFlag, 1) Then + $iOverwrite = 1 + $iFlag -= 1 + EndIf + Local $sDestFullPath = $sDestPath & "\" & $sFileName + If FileExists($sDestFullPath) Then + ; destination file exists + If $iOverwrite Then + If StringInStr(FileGetAttrib($sDestFullPath), "D") Then + ; folder + If Not DirRemove($sDestFullPath, 1) Then Return SetError(8, 0, 0) + Else + If Not FileDelete($sDestFullPath) Then Return SetError(8, 0, 0) + EndIf + Else + Return SetError(9, 0, 0) + EndIf + EndIf + $oNS2.CopyHere($oFolderItem, $iFlag) + DirRemove($sTempDir, 1) + If FileExists($sDestFullPath) Then + ; success + Return 1 + Else + ; failure + Return SetError(10, 0, 0) + EndIf +EndFunc ;==>_Zip_Unzip + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_UnzipAll +; Description....: Extract all files contained in a ZIP archive +; Syntax.........: _Zip_UnzipAll($sZipFile, $sDestPath[, $iFlag = 20]) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sDestPath - Full path to the destination +; $iFlag - [Optional] File copy flags (Default = 4+16) +; | 4 - No progress box +; | 8 - Rename the file if a file of the same name already exists +; | 16 - Respond "Yes to All" for any dialog that is displayed +; | 64 - Preserve undo information, if possible +; | 256 - Display a progress dialog box but do not show the file names +; | 512 - Do not confirm the creation of a new directory if the operation requires one to be created +; |1024 - Do not display a user interface if an error occurs +; |2048 - Version 4.71. Do not copy the security attributes of the file +; |4096 - Only operate in the local directory, don't operate recursively into subdirectories +; |8192 - Version 5.0. Do not copy connected files as a group, only copy the specified files +; +; Return values..: Success - 1 +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file does not exist +; | 5 - Failed to create destination (if necessary) +; | 6 - Failed to open destination +; | 7 - Failed to extract file(s) +; Author.........: wraithdu, torels +; Modified.......: +; Remarks........: Overwriting of destination files is controlled solely by the file copy flags (ie $iFlag = 1 is NOT valid). +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_UnzipAll($sZipFile, $sDestPath, $iFlag = 20) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Or Not _IsFullPath($sDestPath) Then Return SetError(3, 0, 0) + Local $sTempDir = _Zip_TempDirName($sZipFile) + Local $oApp = ObjCreate("Shell.Application") + Local $oNS = $oApp.NameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + $sDestPath = _Zip_PathStripSlash($sDestPath) + If Not FileExists($sDestPath) Then + DirCreate($sDestPath) + If @error Then Return SetError(5, 0, 0) + EndIf + Local $oNS2 = $oApp.NameSpace($sDestPath) + If Not IsObj($oNS2) Then Return SetError(6, 0, 0) + $oNS2.CopyHere($oNS.Items, $iFlag) + DirRemove($sTempDir, 1) + + ;Workaround because windows did not always return file extension for .Name - Andrew Calcutt 10/23/2010 + $testfilesourcepath = $oNS.Items.Item($oNS.Items.Count - 1).path + $testfiledestpath = $sDestPath & "\" & StringTrimLeft($testfilesourcepath, StringInStr($testfilesourcepath, "\" , 0 , -1)) + ;end workaround + If FileExists($testfiledestpath) Then + ; success... most likely + ; checks for existence of last item from source in destination + Return 1 + Else + ; failure + Return SetError(7, 0, 0) + EndIf +EndFunc ;==>_Zip_UnzipAll + +#Region INTERNAL FUNCTIONS +; #FUNCTION# ==================================================================================================== +; Name...........: _IsFullPath +; Description....: Determines if a given path is a fully qualified path (well, roughly...) +; Syntax.........: _IsFullPath($sPath) +; Parameters.....: $sPath - Path to check +; +; Return values..: Success - True +; Failure - False +; Author.........: torels +; Modified.......: +; Remarks........: +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _IsFullPath($sPath) + If StringInStr($sPath, ":\") Then + Return True + Else + Return False + EndIf +EndFunc ;==>_IsFullPath + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_AddPath +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_AddPath($sZipFile, $sPath) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + Local $oApp = ObjCreate("Shell.Application") + Local $oNS = $oApp.NameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + ; check and create directory structure + $sPath = _Zip_PathStripSlash($sPath) + Local $sFileName = "", $sNewPath = "" + If $sPath <> "" Then + ; create temp dir + Local $sTempDir = _Zip_CreateTempDir() + If @error Then Return SetError(5, 0, 0) + Local $oTemp = $oApp.NameSpace($sTempDir) + Local $aDir = StringSplit($sPath, "\"), $oNS2 + For $i = 1 To $aDir[0] + $oNS2 = $oApp.NameSpace($sZipFile & "\" & $aDir[$i]) + If Not IsObj($oNS2) Then + ; create the directory structure + For $i = $i To $aDir[0] + $sNewPath &= "\" & $aDir[$i] + Next + DirCreate($sTempDir & $sNewPath) + $sFileName = _Zip_CreateTempName() + FileClose(FileOpen($sTempDir & $sNewPath & "\" & $sFileName, 2)) + $oNS.CopyHere($oTemp.Items) + ; wait for dir structure + Do + Sleep(250) + $oNS = $oApp.NameSpace($sZipFile & $sNewPath) + Until IsObj($oNS) + ; wait for file + Do + Sleep(250) + $oItem = $oNS.ParseName($sFileName) + Until IsObj($oItem) + DirRemove($sTempDir, 1) + ExitLoop + EndIf + $sZipFile &= "\" & $aDir[$i] + $oNS = $oApp.NameSpace($sZipFile) + Next + EndIf + Return $sFileName +EndFunc ;==>_Zip_AddPath + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_CreateTempDir +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_CreateTempDir() + Local $s_TempName + Do + $s_TempName = "" + While StringLen($s_TempName) < 7 + $s_TempName &= Chr(Random(97, 122, 1)) + WEnd + $s_TempName = @TempDir & "\~" & $s_TempName & ".tmp" + Until Not FileExists($s_TempName) + If Not DirCreate($s_TempName) Then Return SetError(1, 0, 0) + Return $s_TempName +EndFunc ;==>_Zip_CreateTempDir + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_CreateTempName +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_CreateTempName() + Local $GUID = DllStructCreate("dword Data1;word Data2;word Data3;byte Data4[8]") + DllCall("ole32.dll", "int", "CoCreateGuid", "ptr", DllStructGetPtr($GUID)) + Local $ret = DllCall("ole32.dll", "int", "StringFromGUID2", "ptr", DllStructGetPtr($GUID), "wstr", "", "int", 40) + If @error Then Return SetError(1, 0, "") + Return $ret[2] +EndFunc ;==>_Zip_CreateTempName + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_DllChk +; Description....: Checks if the zipfldr library is installed +; Syntax.........: _Zip_DllChk() +; Parameters.....: None. +; Return values..: Success - 1 +; Failure - 0 and sets @error +; | 1 - zipfldr.dll not found +; | 2 - Library not installed +; Author.........: wraithdu, torels +; Modified.......: +; Remarks........: +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_DllChk() + If Not FileExists(@SystemDir & "\zipfldr.dll") Then Return SetError(1, 0, 0) + If Not RegRead("HKEY_CLASSES_ROOT\CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}", "") Then Return SetError(2, 0, 0) + Return 1 +EndFunc ;==>_Zip_DllChk + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_InternalDelete +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_InternalDelete($sZipFile, $sFileName) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + ; parse filename + $sFileName = _Zip_PathStripSlash($sFileName) + If StringInStr($sFileName, "\") Then + ; subdirectory, parse out path and filename + $sZipFile &= "\" & _Zip_PathPathOnly($sFileName) + $sFileName = _Zip_PathNameOnly($sFileName) + EndIf + Local $oApp = ObjCreate("Shell.Application") + Local $oNS = $oApp.NameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $oFolderItem = $oNS.ParseName($sFileName) + If Not IsObj($oFolderItem) Then Return SetError(5, 0, 0) + ; ## Ugh, this was ultimately a bad solution + ; move file to a temp directory and remove the directory + Local $sTempDir = _Zip_CreateTempDir() + If @error Then Return SetError(6, 0, 0) + $oApp.NameSpace($sTempDir).MoveHere($oFolderItem, 20) + DirRemove($sTempDir, 1) + $oFolderItem = $oNS.ParseName($sFileName) + If IsObj($oFolderItem) Then + ; failure + Return SetError(7, 0, 0) + Else + Return 1 + EndIf +EndFunc ;==>_Zip_InternalDelete + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_ListAll_Internal +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_ListAll_Internal($sZipFile, ByRef $aArray, $iFullPath, $sPrefix = "") + Local $oApp = ObjCreate("Shell.Application") + Local $oNS = $oApp.NameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $oList = $oNS.Items + For $oItem In $oList + If $oItem.IsFolder Then + ; folder, recurse + If $iFullPath Then + ; build path from root of zip + _Zip_ListAll_Internal($sZipFile & "\" & $oItem.Name, $aArray, $iFullPath, $sPrefix & $oItem.Name & "\") + If @error Then Return SetError(4) + Else + ; just filenames + _Zip_ListAll_Internal($sZipFile & "\" & $oItem.Name, $aArray, $iFullPath, "") + If @error Then Return SetError(4) + EndIf + Else + $aArray[0] += 1 + ReDim $aArray[$aArray[0] + 1] + $aArray[$aArray[0]] = $sPrefix & $oItem.Name + EndIf + Next +EndFunc ;==>_Zip_ListAll_Internal + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_PathNameOnly +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_PathNameOnly($sPath) + Return StringRegExpReplace($sPath, ".*\\", "") +EndFunc ;==>_Zip_PathNameOnly + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_PathPathOnly +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_PathPathOnly($sPath) + Return StringRegExpReplace($sPath, "^(.*)\\.*?$", "${1}") +EndFunc ;==>_Zip_PathPathOnly + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_PathStripSlash +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_PathStripSlash($sString) + Return StringRegExpReplace($sString, "(^\\+|\\+$)", "") +EndFunc ;==>_Zip_PathStripSlash + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_TempDirName +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu, trancexxx +; =============================================================================================================== +Func _Zip_TempDirName($sZipFile) + Local $i = 0, $sTemp, $sName = _Zip_PathNameOnly($sZipFile) + Do + $i += 1 + $sTemp = @TempDir & "\Temporary Directory " & $i & " for " & $sName + Until Not FileExists($sTemp) ; this folder will be created during extraction + Return $sTemp +EndFunc ;==>_Zip_TempDirName +#EndRegion INTERNAL FUNCTIONS diff --git a/Installer/Uninstall/Uninstall.au3 b/Installer/old/Uninstall/Uninstall.au3 similarity index 97% rename from Installer/Uninstall/Uninstall.au3 rename to Installer/old/Uninstall/Uninstall.au3 index ab6b08e4..426d60b0 100644 --- a/Installer/Uninstall/Uninstall.au3 +++ b/Installer/old/Uninstall/Uninstall.au3 @@ -1,12 +1,12 @@ -#RequireAdmin -#Region ;**** Directives created by AutoIt3Wrapper_GUI **** -#AutoIt3Wrapper_Icon=..\..\VistumblerMDB\Icons\icon.ico -#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator -#AutoIt3Wrapper_Run_Tidy=y -#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** - -$TempUninstallEXE = @TempDir & '\vi_uninstall.exe' -FileInstall("vi_uninstall.exe", $TempUninstallEXE, 1) -Run($TempUninstallEXE) -Exit - +#RequireAdmin +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Icon=..\..\VistumblerMDB\Icons\icon.ico +#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator +#AutoIt3Wrapper_Run_Tidy=y +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** + +$TempUninstallEXE = @TempDir & '\vi_uninstall.exe' +FileInstall("vi_uninstall.exe", $TempUninstallEXE, 1) +Run($TempUninstallEXE) +Exit + diff --git a/Installer/Uninstall/Uninstall.exe b/Installer/old/Uninstall/Uninstall.exe similarity index 100% rename from Installer/Uninstall/Uninstall.exe rename to Installer/old/Uninstall/Uninstall.exe diff --git a/Installer/Uninstall/vi_uninstall.au3 b/Installer/old/Uninstall/vi_uninstall.au3 similarity index 97% rename from Installer/Uninstall/vi_uninstall.au3 rename to Installer/old/Uninstall/vi_uninstall.au3 index 90d3d64a..f57da891 100644 --- a/Installer/Uninstall/vi_uninstall.au3 +++ b/Installer/old/Uninstall/vi_uninstall.au3 @@ -1,44 +1,44 @@ -#RequireAdmin -#Region ;**** Directives created by AutoIt3Wrapper_GUI **** -#AutoIt3Wrapper_Icon=..\icon.ico -#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator -#AutoIt3Wrapper_Run_Tidy=y -#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** - -Dim $InstallLocation = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "InstallLocation") -Dim $StartMenu_AllUsers = @ProgramsCommonDir & '\Vistumbler\' -Dim $StartMenu_CurrentUser = @ProgramsDir & '\Vistumbler\' -Dim $Desktop_AllUsers = @DesktopCommonDir & '\Vistumbler.lnk' -Dim $Desktop_CurrentUser = @DesktopDir & '\Vistumbler.lnk' - -;Delete Vistumbler files and folders -If FileExists($InstallLocation) Then DirRemove($InstallLocation, 1) -If FileExists($StartMenu_AllUsers) Then DirRemove($StartMenu_AllUsers, 1) -If FileExists($StartMenu_CurrentUser) Then DirRemove($StartMenu_CurrentUser, 1) -If FileExists($Desktop_AllUsers) Then FileDelete($Desktop_AllUsers) -If FileExists($Desktop_CurrentUser) Then FileDelete($Desktop_CurrentUser) - -;Delete File Associations -RegDelete("HKCR\.vsz") -RegDelete("HKCR\.vs1") -RegDelete("HKCR\Vistumbler") - -;Delete Uninstall Information -RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler") - -_SelfDelete() ;delete current exe -Exit - -Func _SelfDelete($iDelay = 0) - If StringInStr(@ScriptName, ".au3") = 0 Then - Local $sCmdFile - FileDelete(@TempDir & "\scratch.bat") - $sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF _ - & ':loop' & @CRLF _ - & 'del "' & @ScriptFullPath & '"' & @CRLF _ - & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _ - & 'del ' & @TempDir & '\scratch.bat' - FileWrite(@TempDir & "\scratch.bat", $sCmdFile) - Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE) - EndIf -EndFunc ;==>_SelfDelete +#RequireAdmin +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Icon=..\icon.ico +#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator +#AutoIt3Wrapper_Run_Tidy=y +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** + +Dim $InstallLocation = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "InstallLocation") +Dim $StartMenu_AllUsers = @ProgramsCommonDir & '\Vistumbler\' +Dim $StartMenu_CurrentUser = @ProgramsDir & '\Vistumbler\' +Dim $Desktop_AllUsers = @DesktopCommonDir & '\Vistumbler.lnk' +Dim $Desktop_CurrentUser = @DesktopDir & '\Vistumbler.lnk' + +;Delete Vistumbler files and folders +If FileExists($InstallLocation) Then DirRemove($InstallLocation, 1) +If FileExists($StartMenu_AllUsers) Then DirRemove($StartMenu_AllUsers, 1) +If FileExists($StartMenu_CurrentUser) Then DirRemove($StartMenu_CurrentUser, 1) +If FileExists($Desktop_AllUsers) Then FileDelete($Desktop_AllUsers) +If FileExists($Desktop_CurrentUser) Then FileDelete($Desktop_CurrentUser) + +;Delete File Associations +RegDelete("HKCR\.vsz") +RegDelete("HKCR\.vs1") +RegDelete("HKCR\Vistumbler") + +;Delete Uninstall Information +RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler") + +_SelfDelete() ;delete current exe +Exit + +Func _SelfDelete($iDelay = 0) + If StringInStr(@ScriptName, ".au3") = 0 Then + Local $sCmdFile + FileDelete(@TempDir & "\scratch.bat") + $sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF _ + & ':loop' & @CRLF _ + & 'del "' & @ScriptFullPath & '"' & @CRLF _ + & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _ + & 'del ' & @TempDir & '\scratch.bat' + FileWrite(@TempDir & "\scratch.bat", $sCmdFile) + Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE) + EndIf +EndFunc ;==>_SelfDelete diff --git a/Installer/Uninstall/vi_uninstall.exe b/Installer/old/Uninstall/vi_uninstall.exe similarity index 100% rename from Installer/Uninstall/vi_uninstall.exe rename to Installer/old/Uninstall/vi_uninstall.exe diff --git a/Installer/VistumblerInstaller.au3 b/Installer/old/VistumblerInstaller.au3 similarity index 97% rename from Installer/VistumblerInstaller.au3 rename to Installer/old/VistumblerInstaller.au3 index d325d107..af5f975d 100644 --- a/Installer/VistumblerInstaller.au3 +++ b/Installer/old/VistumblerInstaller.au3 @@ -1,214 +1,214 @@ -#RequireAdmin -#Region ;**** Directives created by AutoIt3Wrapper_GUI **** -#AutoIt3Wrapper_Icon=icon.ico -#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator -#AutoIt3Wrapper_Run_Tidy=y -#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** -;License Information------------------------------------ -;Copyright (C) 2019 Andrew Calcutt -;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; Version 2 of the License. -;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -;You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -;-------------------------------------------------------- -;AutoIt Version: v3.3.14.5 -$Script_Author = 'Andrew Calcutt' -$Script_Name = 'Vistumbler Installer' -$Script_Website = 'http://www.vistumbler.net' -$Script_Function = 'Zip file based installer for vistumbler.' -$version = 'v1.0' -$Script_Start_Date = '2010/10/18' -$last_modified = '2010/10/19' -;Includes------------------------------------------------ -#include -#include -#include -#include -#include "UDFs\Zip.au3" -;-------------------------------------------------------- -Dim $TempSourceFiles = @TempDir & '\vi_files.zip' -Dim $TempLicense = @TempDir & '\vi_license.txt' -Dim $TempSettings = @TempDir & '\vi_settings.ini' - -Dim $TmpDir = @TempDir & '\Vistumbler\' -Dim $Destination = @ProgramFilesDir & '\Vistumbler\' -Dim $StartMenu_AllUsers = @ProgramsCommonDir & '\Vistumbler\' -Dim $StartMenu_CurrentUser = @ProgramsDir & '\Vistumbler\' -Dim $Desktop_AllUsers = @DesktopCommonDir & '\' -Dim $Desktop_CurrentUser = @DesktopDir & '\' - -;Install needed files into exe -FileInstall("vi_files.zip", $TempSourceFiles, 1) -FileInstall("vi_license.txt", $TempLicense, 1) -FileInstall("vi_settings.ini", $TempSettings, 1) - -;Get settings -Dim $ProgramName = IniRead($TempSettings, 'Settings', 'ProgramName', 'Vistumbler') -Dim $ProgramVersion = IniRead($TempSettings, 'Settings', 'ProgramVersion', '') -Dim $ProgramAuthor = IniRead($TempSettings, 'Settings', 'ProgramAuthor', 'Andrew Calcutt') -Dim $title = $ProgramName & ' ' & $ProgramVersion & ' Installer' - -;Read in license file -$licensefile = FileOpen($TempLicense, 0) -$licensetxt = FileRead($licensefile) -FileClose($licensefile) - -;Start Install -_LicenseAgreementGui() - -;Clean up temp files and exit -_Exit() - - -Func _LicenseAgreementGui() - $LA_GUI = GUICreate($title & ' - License Agreement', 625, 443) - $Edit1 = GUICtrlCreateEdit('', 8, 16, 609, 369, BitOR($GUI_SS_DEFAULT_EDIT, $ES_READONLY, $ES_CENTER)) - GUICtrlSetData(-1, $licensetxt) - $LA_Agree = GUICtrlCreateButton("Agree", 184, 400, 105, 25, $WS_GROUP) - $LA_Exit = GUICtrlCreateButton("Exit", 304, 400, 105, 25, $WS_GROUP) - GUISetState(@SW_SHOW) - - While 1 - $nMsg = GUIGetMsg() - Switch $nMsg - Case $GUI_EVENT_CLOSE - GUIDelete($LA_GUI) - ExitLoop - Case $LA_Exit - GUIDelete($LA_GUI) - ExitLoop - Case $LA_Agree - GUIDelete($LA_GUI) - _InstallOptionsGui() - ExitLoop - EndSwitch - WEnd -EndFunc ;==>_LicenseAgreementGui - -Func _InstallOptionsGui() - $IO_GUI = GUICreate($title & ' - Install Options', 513, 259) - $IO_Dest = GUICtrlCreateInput($Destination, 16, 32, 385, 21) - $Browse = GUICtrlCreateButton("Browse", 408, 30, 89, 25, $WS_GROUP) - GUICtrlCreateLabel("Vistumbler Install Location", 16, 12, 126, 15) - GUICtrlCreateGroup("Options", 8, 64, 497, 145) - GUICtrlCreateGroup("Create start menu shortcuts", 16, 88, 230, 89) - $SMS_AllUsers = GUICtrlCreateRadio("All Users", 32, 144, 100, 17) - $SMS_CurrentUser = GUICtrlCreateRadio("Current User", 32, 128, 100, 17) - $SMS_None = GUICtrlCreateRadio("None", 32, 112, 100, 17) - GUICtrlSetState($SMS_AllUsers, $GUI_CHECKED) - GUICtrlCreateGroup("Create desktop shortcuts", 266, 88, 230, 89) - $DS_AllUsers = GUICtrlCreateRadio("All Users", 282, 144, 100, 17) - $DS_CurrentUser = GUICtrlCreateRadio("Current User", 282, 128, 100, 17) - $DS_None = GUICtrlCreateRadio("None", 282, 112, 100, 17) - GUICtrlSetState($DS_AllUsers, $GUI_CHECKED) - $RVD_Check = GUICtrlCreateCheckbox("Remove old vistumbler directories (make sure you have a backup of your scans)", 16, 184, 481, 17) - GUICtrlSetState($RVD_Check, $GUI_CHECKED) - $IO_Install = GUICtrlCreateButton("Install", 104, 220, 130, 25, $WS_GROUP) - $IO_Exit = GUICtrlCreateButton("Exit", 272, 220, 130, 25, $WS_GROUP) - GUISetState(@SW_SHOW) - - While 1 - $nMsg = GUIGetMsg() - Switch $nMsg - Case $GUI_EVENT_CLOSE - GUIDelete($IO_GUI) - ExitLoop - Case $IO_Exit - GUIDelete($IO_GUI) - ExitLoop - Case $Browse - $instaldir = FileSelectFolder("Choose a folder.", "", 1, GUICtrlRead($IO_Dest)) - If Not @error Then GUICtrlSetData($IO_Dest, $instaldir) - Case $IO_Install - Dim $SMS = 0, $DS = 0, $RVD = 0 - ;get install folder - $Destination = GUICtrlRead($IO_Dest) - ;Get start menu shortcut type - If GUICtrlRead($SMS_AllUsers) = 1 Then - $SMS = 2 - ElseIf GUICtrlRead($SMS_CurrentUser) = 1 Then - $SMS = 1 - EndIf - ;Get desktop shortcut type - If GUICtrlRead($DS_AllUsers) = 1 Then - $DS = 2 - ElseIf GUICtrlRead($DS_CurrentUser) = 1 Then - $DS = 1 - EndIf - ;Set remove directories flag - If GUICtrlRead($RVD_Check) = 1 Then $RVD = 1 - ;Close Install Options Window - GUIDelete($IO_GUI) - ;Install files from zip to selected dir - _Install($TempSourceFiles, $Destination, $RVD, $SMS, $DS) - ExitLoop - EndSwitch - WEnd -EndFunc ;==>_InstallOptionsGui - -Func _Install($source_zip, $dest_dir, $RemOldDir = 1, $StartShortcuts = 1, $DesktopShortcuts = 1) - ConsoleWrite('$StartShortcuts:' & $StartShortcuts & ' - ' & '$DesktopShortcuts:' & $DesktopShortcuts & @CRLF) - If $RemOldDir = 1 Then _RemoveOldFiles() - $Unzip = _Zip_UnzipAll($source_zip, $dest_dir, 272) - If $Unzip = 0 Then - If @error = 1 Then - $err = "zipfldr.dll does not exist." - ElseIf @error = 2 Then - $err = "Library not installed." - ElseIf @error = 3 Then - $err = "Not a full path." - ElseIf @error = 4 Then - $err = "ZIP file does not exist." - ElseIf @error = 5 Then - $err = "Failed to create destination (if necessary)." - ElseIf @error = 6 Then - $err = "Failed to open destination." - ElseIf @error = 7 Then - $err = "Failed to extract file(s)." - Else - $err = "Unknown Error" - EndIf - MsgBox(0, "Error", $err & " Make sure vistumbler is not running and try again") - Else - ;Create Start Menu Shortcuts - If $StartShortcuts = 2 Then - DirCreate($StartMenu_AllUsers) - FileCreateShortcut($dest_dir & 'Vistumbler.exe', $StartMenu_AllUsers & 'Vistumbler.lnk') - ElseIf $StartShortcuts = 1 Then - DirCreate($StartMenu_CurrentUser) - FileCreateShortcut($dest_dir & 'Vistumbler.exe', $StartMenu_CurrentUser & 'Vistumbler.lnk') - EndIf - ;Create Desktop Shortcuts - If $DesktopShortcuts = 2 Then - FileDelete($Desktop_AllUsers & 'Vistumbler.lnk') - FileCreateShortcut($dest_dir & 'Vistumbler.exe', $Desktop_AllUsers & 'Vistumbler.lnk') - ElseIf $DesktopShortcuts = 1 Then - FileDelete($Desktop_CurrentUser & 'Vistumbler.lnk') - FileCreateShortcut($dest_dir & 'Vistumbler.exe', $Desktop_CurrentUser & 'Vistumbler.lnk') - EndIf - ;Write uninstall information into the registry - RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler") - RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "InstallLocation", "REG_SZ", $Destination) - RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "UninstallString", "REG_SZ", $Destination & 'Uninstall.exe') - RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "DisplayIcon", "REG_SZ", $Destination & 'Uninstall.exe') - RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "DisplayName", "REG_SZ", $ProgramName) - RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "DisplayVersion", "REG_SZ", $ProgramVersion) - RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "Publisher", "REG_SZ", "Vistumbler.net") - MsgBox(0, "Done", "Install completed succesfully") - EndIf -EndFunc ;==>_Install - -Func _RemoveOldFiles() - DirRemove($TmpDir, 1) - DirRemove($Destination, 1) - DirRemove($StartMenu_AllUsers, 1) - DirRemove($StartMenu_CurrentUser, 1) - FileDelete($Desktop_CurrentUser & 'Vistumbler.lnk') - FileDelete($Desktop_AllUsers & 'Vistumbler.lnk') -EndFunc ;==>_RemoveOldFiles - -Func _Exit() - FileDelete($TempSourceFiles) - FileDelete($TempLicense) - FileDelete($TempSettings) - Exit -EndFunc ;==>_Exit +#RequireAdmin +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Icon=icon.ico +#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator +#AutoIt3Wrapper_Run_Tidy=y +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** +;License Information------------------------------------ +;Copyright (C) 2019 Andrew Calcutt +;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; Version 2 of the License. +;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +;You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +;-------------------------------------------------------- +;AutoIt Version: v3.3.14.5 +$Script_Author = 'Andrew Calcutt' +$Script_Name = 'Vistumbler Installer' +$Script_Website = 'http://www.vistumbler.net' +$Script_Function = 'Zip file based installer for vistumbler.' +$version = 'v1.0' +$Script_Start_Date = '2010/10/18' +$last_modified = '2010/10/19' +;Includes------------------------------------------------ +#include +#include +#include +#include +#include "UDFs\Zip.au3" +;-------------------------------------------------------- +Dim $TempSourceFiles = @TempDir & '\vi_files.zip' +Dim $TempLicense = @TempDir & '\vi_license.txt' +Dim $TempSettings = @TempDir & '\vi_settings.ini' + +Dim $TmpDir = @TempDir & '\Vistumbler\' +Dim $Destination = @ProgramFilesDir & '\Vistumbler\' +Dim $StartMenu_AllUsers = @ProgramsCommonDir & '\Vistumbler\' +Dim $StartMenu_CurrentUser = @ProgramsDir & '\Vistumbler\' +Dim $Desktop_AllUsers = @DesktopCommonDir & '\' +Dim $Desktop_CurrentUser = @DesktopDir & '\' + +;Install needed files into exe +FileInstall("vi_files.zip", $TempSourceFiles, 1) +FileInstall("vi_license.txt", $TempLicense, 1) +FileInstall("vi_settings.ini", $TempSettings, 1) + +;Get settings +Dim $ProgramName = IniRead($TempSettings, 'Settings', 'ProgramName', 'Vistumbler') +Dim $ProgramVersion = IniRead($TempSettings, 'Settings', 'ProgramVersion', '') +Dim $ProgramAuthor = IniRead($TempSettings, 'Settings', 'ProgramAuthor', 'Andrew Calcutt') +Dim $title = $ProgramName & ' ' & $ProgramVersion & ' Installer' + +;Read in license file +$licensefile = FileOpen($TempLicense, 0) +$licensetxt = FileRead($licensefile) +FileClose($licensefile) + +;Start Install +_LicenseAgreementGui() + +;Clean up temp files and exit +_Exit() + + +Func _LicenseAgreementGui() + $LA_GUI = GUICreate($title & ' - License Agreement', 625, 443) + $Edit1 = GUICtrlCreateEdit('', 8, 16, 609, 369, BitOR($GUI_SS_DEFAULT_EDIT, $ES_READONLY, $ES_CENTER)) + GUICtrlSetData(-1, $licensetxt) + $LA_Agree = GUICtrlCreateButton("Agree", 184, 400, 105, 25, $WS_GROUP) + $LA_Exit = GUICtrlCreateButton("Exit", 304, 400, 105, 25, $WS_GROUP) + GUISetState(@SW_SHOW) + + While 1 + $nMsg = GUIGetMsg() + Switch $nMsg + Case $GUI_EVENT_CLOSE + GUIDelete($LA_GUI) + ExitLoop + Case $LA_Exit + GUIDelete($LA_GUI) + ExitLoop + Case $LA_Agree + GUIDelete($LA_GUI) + _InstallOptionsGui() + ExitLoop + EndSwitch + WEnd +EndFunc ;==>_LicenseAgreementGui + +Func _InstallOptionsGui() + $IO_GUI = GUICreate($title & ' - Install Options', 513, 259) + $IO_Dest = GUICtrlCreateInput($Destination, 16, 32, 385, 21) + $Browse = GUICtrlCreateButton("Browse", 408, 30, 89, 25, $WS_GROUP) + GUICtrlCreateLabel("Vistumbler Install Location", 16, 12, 126, 15) + GUICtrlCreateGroup("Options", 8, 64, 497, 145) + GUICtrlCreateGroup("Create start menu shortcuts", 16, 88, 230, 89) + $SMS_AllUsers = GUICtrlCreateRadio("All Users", 32, 144, 100, 17) + $SMS_CurrentUser = GUICtrlCreateRadio("Current User", 32, 128, 100, 17) + $SMS_None = GUICtrlCreateRadio("None", 32, 112, 100, 17) + GUICtrlSetState($SMS_AllUsers, $GUI_CHECKED) + GUICtrlCreateGroup("Create desktop shortcuts", 266, 88, 230, 89) + $DS_AllUsers = GUICtrlCreateRadio("All Users", 282, 144, 100, 17) + $DS_CurrentUser = GUICtrlCreateRadio("Current User", 282, 128, 100, 17) + $DS_None = GUICtrlCreateRadio("None", 282, 112, 100, 17) + GUICtrlSetState($DS_AllUsers, $GUI_CHECKED) + $RVD_Check = GUICtrlCreateCheckbox("Remove old vistumbler directories (make sure you have a backup of your scans)", 16, 184, 481, 17) + GUICtrlSetState($RVD_Check, $GUI_CHECKED) + $IO_Install = GUICtrlCreateButton("Install", 104, 220, 130, 25, $WS_GROUP) + $IO_Exit = GUICtrlCreateButton("Exit", 272, 220, 130, 25, $WS_GROUP) + GUISetState(@SW_SHOW) + + While 1 + $nMsg = GUIGetMsg() + Switch $nMsg + Case $GUI_EVENT_CLOSE + GUIDelete($IO_GUI) + ExitLoop + Case $IO_Exit + GUIDelete($IO_GUI) + ExitLoop + Case $Browse + $instaldir = FileSelectFolder("Choose a folder.", "", 1, GUICtrlRead($IO_Dest)) + If Not @error Then GUICtrlSetData($IO_Dest, $instaldir) + Case $IO_Install + Dim $SMS = 0, $DS = 0, $RVD = 0 + ;get install folder + $Destination = GUICtrlRead($IO_Dest) + ;Get start menu shortcut type + If GUICtrlRead($SMS_AllUsers) = 1 Then + $SMS = 2 + ElseIf GUICtrlRead($SMS_CurrentUser) = 1 Then + $SMS = 1 + EndIf + ;Get desktop shortcut type + If GUICtrlRead($DS_AllUsers) = 1 Then + $DS = 2 + ElseIf GUICtrlRead($DS_CurrentUser) = 1 Then + $DS = 1 + EndIf + ;Set remove directories flag + If GUICtrlRead($RVD_Check) = 1 Then $RVD = 1 + ;Close Install Options Window + GUIDelete($IO_GUI) + ;Install files from zip to selected dir + _Install($TempSourceFiles, $Destination, $RVD, $SMS, $DS) + ExitLoop + EndSwitch + WEnd +EndFunc ;==>_InstallOptionsGui + +Func _Install($source_zip, $dest_dir, $RemOldDir = 1, $StartShortcuts = 1, $DesktopShortcuts = 1) + ConsoleWrite('$StartShortcuts:' & $StartShortcuts & ' - ' & '$DesktopShortcuts:' & $DesktopShortcuts & @CRLF) + If $RemOldDir = 1 Then _RemoveOldFiles() + $Unzip = _Zip_UnzipAll($source_zip, $dest_dir, 272) + If $Unzip = 0 Then + If @error = 1 Then + $err = "zipfldr.dll does not exist." + ElseIf @error = 2 Then + $err = "Library not installed." + ElseIf @error = 3 Then + $err = "Not a full path." + ElseIf @error = 4 Then + $err = "ZIP file does not exist." + ElseIf @error = 5 Then + $err = "Failed to create destination (if necessary)." + ElseIf @error = 6 Then + $err = "Failed to open destination." + ElseIf @error = 7 Then + $err = "Failed to extract file(s)." + Else + $err = "Unknown Error" + EndIf + MsgBox(0, "Error", $err & " Make sure vistumbler is not running and try again") + Else + ;Create Start Menu Shortcuts + If $StartShortcuts = 2 Then + DirCreate($StartMenu_AllUsers) + FileCreateShortcut($dest_dir & 'Vistumbler.exe', $StartMenu_AllUsers & 'Vistumbler.lnk') + ElseIf $StartShortcuts = 1 Then + DirCreate($StartMenu_CurrentUser) + FileCreateShortcut($dest_dir & 'Vistumbler.exe', $StartMenu_CurrentUser & 'Vistumbler.lnk') + EndIf + ;Create Desktop Shortcuts + If $DesktopShortcuts = 2 Then + FileDelete($Desktop_AllUsers & 'Vistumbler.lnk') + FileCreateShortcut($dest_dir & 'Vistumbler.exe', $Desktop_AllUsers & 'Vistumbler.lnk') + ElseIf $DesktopShortcuts = 1 Then + FileDelete($Desktop_CurrentUser & 'Vistumbler.lnk') + FileCreateShortcut($dest_dir & 'Vistumbler.exe', $Desktop_CurrentUser & 'Vistumbler.lnk') + EndIf + ;Write uninstall information into the registry + RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler") + RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "InstallLocation", "REG_SZ", $Destination) + RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "UninstallString", "REG_SZ", $Destination & 'Uninstall.exe') + RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "DisplayIcon", "REG_SZ", $Destination & 'Uninstall.exe') + RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "DisplayName", "REG_SZ", $ProgramName) + RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "DisplayVersion", "REG_SZ", $ProgramVersion) + RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "Publisher", "REG_SZ", "Vistumbler.net") + MsgBox(0, "Done", "Install completed succesfully") + EndIf +EndFunc ;==>_Install + +Func _RemoveOldFiles() + DirRemove($TmpDir, 1) + DirRemove($Destination, 1) + DirRemove($StartMenu_AllUsers, 1) + DirRemove($StartMenu_CurrentUser, 1) + FileDelete($Desktop_CurrentUser & 'Vistumbler.lnk') + FileDelete($Desktop_AllUsers & 'Vistumbler.lnk') +EndFunc ;==>_RemoveOldFiles + +Func _Exit() + FileDelete($TempSourceFiles) + FileDelete($TempLicense) + FileDelete($TempSettings) + Exit +EndFunc ;==>_Exit diff --git a/Installer/vi_license.txt b/Installer/old/vi_license.txt similarity index 98% rename from Installer/vi_license.txt rename to Installer/old/vi_license.txt index 528bc0d4..f29b4f0d 100644 --- a/Installer/vi_license.txt +++ b/Installer/old/vi_license.txt @@ -1,220 +1,220 @@ -GNU GENERAL PUBLIC LICENSE - -Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, -Cambridge, MA 02139, USA -Everyone is permitted to copy and distribute verbatim copies of this license -document, but changing it is not allowed. - -GNU GENERAL PUBLIC LICENSE -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License applies to any program or other work which contains a notice -placed by the copyright holder saying it may be distributed under the terms -of this General Public License. The "Program", below, refers to any such -program or work, and a "work based on the Program" means either the Program -or any derivative work under copyright law: that is to say, a work -containing the Program or a portion of it, either verbatim or with -modifications and/or translated into another language. (Hereinafter, -translation is included without limitation in the term "modification".) Each -licensee is addressed as "you". - -Activities other than copying, distribution and modification are not covered -by this License; they are outside its scope. The act of running the Program -is not restricted, and the output from the Program is covered only if its -contents constitute a work based on the Program (independent of having been -made by running the Program). Whether that is true depends on what the -Program does. - -1. You may copy and distribute verbatim copies of the Program's source code -as you receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice and -disclaimer of warranty; keep intact all the notices that refer to this -License and to the absence of any warranty; and give any other recipients of -the Program a copy of this License along with the Program. - -You may charge a fee for the physical act of transferring a copy, and you -may at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Program or any portion of it, -thus forming a work based on the Program, and copy and distribute such -modifications or work under the terms of Section 1above, provided that you -also meet all of these conditions: - -a) You must cause the modified files to carry prominent notices stating that -you changed the files and the date of any change. - -b) You must cause any work that you distribute or publish, that in whole or -in part contains or is derived from the Program or any part thereof, to be -licensed as a whole at no charge to all third parties under the terms of -this License. - -c) If the modified program normally reads commands interactively when run, -you must cause it, when started running for such interactive use in the most -ordinary way, to print or display an announcement including an appropriate -copyright notice and a notice that there is no warranty (or else, saying -that you provide a warranty) and that users may redistribute the program -under these conditions, and telling the user how to view a copy of this -License. (Exception: if the Program itself is interactive but does not -normally print such an announcement, your work based on the Program is not -required to print an announcement.) - -These requirements apply to the modified work as a whole. If identifiable -sections of that work are not derived from the Program, and can be -reasonably considered independent and separate works in themselves, then -this License, and its terms, do not apply to those sections when you -distribute them as separate works. But when you distribute the same sections -as part of a whole which is a work based on the Program, the distribution of -the whole must be on the terms of this License, whose permissions for other -licensees extend to the entire whole, and thus to each and every part -regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your -rights to work written entirely by you; rather, the intent is to exercise -the right to control the distribution of derivative or collective works -based on the Program. - -In addition, mere aggregation of another work not based on the Program with -the Program (or with a work based on the Program) on a volume of a storage -or distribution medium does not bring the other work under the scope of this -License. - -3. You may copy and distribute the Program (or a work based on it, under -Section 2) in object code or executable form under the terms of Sections 1 -and 2 above provided that you also do one of the following: - -a) Accompany it with the complete corresponding machine-readable source -code, which must be distributed under the terms of Sections1 and 2 above on -a medium customarily used for software interchange; or, - -b) Accompany it with a written offer, valid for at least three years, to -give any third party, for a charge no more than your cost of physically -performing source distribution, a complete machine-readable copy of the -corresponding source code, to be distributed under the terms of Sections 1 -and 2 above on a medium customarily used for software interchange; or, - -c) Accompany it with the information you received as to the offer to -distribute corresponding source code. (This alternative is allowed only for -noncommercial distribution and only if you received the program in object -code or executable form with such an offer, in accord with Subsection b -above.) - -The source code for a work means the preferred form of the work for making -modifications to it. For an executable work, complete source code means all -the source code for all modules it contains, plus any associated interface -definition files, plus the scripts used to control compilation and -installation of the executable. However, as special exception, the source -code distributed need not include anything that is normally distributed (in -either source or binary form) with the major components (compiler, kernel, -and so on) of the operating system on which the executable runs, unless that -component itself accompanies the executable. - -If distribution of executable or object code is made by offering access to -copy from a designated place, then offering equivalent access to copy the -source code from the same place counts as distribution of the source code, -even though third parties are notcompelled to copy the source along with the -object code. - -4. You may not copy, modify, sublicense, or distribute the Program except as -expressly provided under this License. Any attempt otherwise to copy, -modify, sublicense or distribute the Program is void, and will automatically -terminate your rights under this License. However, parties who have received -copies, or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - -5. You are not required to accept this License, since you have not signed -it. However, nothing else grants you permission to modify or distribute the -Program or its derivative works. These actions are prohibited by law if you -do not accept this License. Therefore, bymodifying or distributing the -Program (or any work based on the Program), you indicate your acceptance of -this License to do so, and all its terms and conditions for copying, -distributing or modifying the Program or works based on it. - -6. Each time you redistribute the Program (or any work based on theProgram), -the recipient automatically receives a license from the original licensor to -copy, distribute or modify the Program subject to these terms and -conditions. You may not impose any further restrictions on the recipients' -exercise of the rights granted herein. You are not responsible for enforcing -compliance by third parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot distribute so -as to satisfy simultaneously your obligations under thisLicense and any -other pertinent obligations, then as a consequence you may not distribute -the Program at all. For example, if a patent license would not permit -royalty-free redistribution of the Program by all those who receive copies -directly or indirectly through you, then the only way you could satisfy both -it and this License would be to refrain entirely from distribution of the -Program. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply and -the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents -or other property right claims or to contest validity of any such claims; -this section has the sole purpose of protecting the integrity of the free -software distribution system, which is implemented by public license -practices. Many people have made generous contributions to the wide range of -software distributed through that system in reliance on consistent -application of that system; it is up to the author/donor to decide if he or -she is willing to distribute software through any other system and a -licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a -consequence of the rest of this License. - -8. If the distribution and/or use of the Program is restricted in certain -countries either by patents or by copyrighted interfaces, the original -copyright holder who places the Program under this License may add an -explicit geographical distribution limitation excluding those countries, so -that distribution is permitted only in or among countries not thus excluded. -In such case, this License incorporates the limitation as if written in the -body of this License. - -9. The Free Software Foundation may publish revised and/or new versions of -the General Public License from time to time. Such new versions will be -similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - -10. If you wish to incorporate parts of the Program into other free programs -whose distribution conditions are different, write to the author to ask for -permission. For software which is copyrighted by the Free Software -Foundation, write to the Free Software Foundation; we sometimes make -exceptions for this. Our decision will be guided by the two goals of -preserving the free status of all derivatives of our free software and of -promoting the sharing and reuse of software generally. - -NO WARRANTY - -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR -THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO -THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM -PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR -CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO -LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR -THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. +GNU GENERAL PUBLIC LICENSE + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, +Cambridge, MA 02139, USA +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice +placed by the copyright holder saying it may be distributed under the terms +of this General Public License. The "Program", below, refers to any such +program or work, and a "work based on the Program" means either the Program +or any derivative work under copyright law: that is to say, a work +containing the Program or a portion of it, either verbatim or with +modifications and/or translated into another language. (Hereinafter, +translation is included without limitation in the term "modification".) Each +licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered +by this License; they are outside its scope. The act of running the Program +is not restricted, and the output from the Program is covered only if its +contents constitute a work based on the Program (independent of having been +made by running the Program). Whether that is true depends on what the +Program does. + +1. You may copy and distribute verbatim copies of the Program's source code +as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +License and to the absence of any warranty; and give any other recipients of +the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you +may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, +thus forming a work based on the Program, and copy and distribute such +modifications or work under the terms of Section 1above, provided that you +also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices stating that +you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in whole or +in part contains or is derived from the Program or any part thereof, to be +licensed as a whole at no charge to all third parties under the terms of +this License. + +c) If the modified program normally reads commands interactively when run, +you must cause it, when started running for such interactive use in the most +ordinary way, to print or display an announcement including an appropriate +copyright notice and a notice that there is no warranty (or else, saying +that you provide a warranty) and that users may redistribute the program +under these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but does not +normally print such an announcement, your work based on the Program is not +required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Program, and can be +reasonably considered independent and separate works in themselves, then +this License, and its terms, do not apply to those sections when you +distribute them as separate works. But when you distribute the same sections +as part of a whole which is a work based on the Program, the distribution of +the whole must be on the terms of this License, whose permissions for other +licensees extend to the entire whole, and thus to each and every part +regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise +the right to control the distribution of derivative or collective works +based on the Program. + +In addition, mere aggregation of another work not based on the Program with +the Program (or with a work based on the Program) on a volume of a storage +or distribution medium does not bring the other work under the scope of this +License. + +3. You may copy and distribute the Program (or a work based on it, under +Section 2) in object code or executable form under the terms of Sections 1 +and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable source +code, which must be distributed under the terms of Sections1 and 2 above on +a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three years, to +give any third party, for a charge no more than your cost of physically +performing source distribution, a complete machine-readable copy of the +corresponding source code, to be distributed under the terms of Sections 1 +and 2 above on a medium customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer to +distribute corresponding source code. (This alternative is allowed only for +noncommercial distribution and only if you received the program in object +code or executable form with such an offer, in accord with Subsection b +above.) + +The source code for a work means the preferred form of the work for making +modifications to it. For an executable work, complete source code means all +the source code for all modules it contains, plus any associated interface +definition files, plus the scripts used to control compilation and +installation of the executable. However, as special exception, the source +code distributed need not include anything that is normally distributed (in +either source or binary form) with the major components (compiler, kernel, +and so on) of the operating system on which the executable runs, unless that +component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to +copy from a designated place, then offering equivalent access to copy the +source code from the same place counts as distribution of the source code, +even though third parties are notcompelled to copy the source along with the +object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as +expressly provided under this License. Any attempt otherwise to copy, +modify, sublicense or distribute the Program is void, and will automatically +terminate your rights under this License. However, parties who have received +copies, or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed +it. However, nothing else grants you permission to modify or distribute the +Program or its derivative works. These actions are prohibited by law if you +do not accept this License. Therefore, bymodifying or distributing the +Program (or any work based on the Program), you indicate your acceptance of +this License to do so, and all its terms and conditions for copying, +distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on theProgram), +the recipient automatically receives a license from the original licensor to +copy, distribute or modify the Program subject to these terms and +conditions. You may not impose any further restrictions on the recipients' +exercise of the rights granted herein. You are not responsible for enforcing +compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot distribute so +as to satisfy simultaneously your obligations under thisLicense and any +other pertinent obligations, then as a consequence you may not distribute +the Program at all. For example, if a patent license would not permit +royalty-free redistribution of the Program by all those who receive copies +directly or indirectly through you, then the only way you could satisfy both +it and this License would be to refrain entirely from distribution of the +Program. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply and +the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents +or other property right claims or to contest validity of any such claims; +this section has the sole purpose of protecting the integrity of the free +software distribution system, which is implemented by public license +practices. Many people have made generous contributions to the wide range of +software distributed through that system in reliance on consistent +application of that system; it is up to the author/donor to decide if he or +she is willing to distribute software through any other system and a +licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Program under this License may add an +explicit geographical distribution limitation excluding those countries, so +that distribution is permitted only in or among countries not thus excluded. +In such case, this License incorporates the limitation as if written in the +body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of +the General Public License from time to time. Such new versions will be +similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free programs +whose distribution conditions are different, write to the author to ask for +permission. For software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we sometimes make +exceptions for this. Our decision will be guided by the two goals of +preserving the free status of all derivatives of our free software and of +promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO +THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM +PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO +LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR +THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. diff --git a/Installer/vi_settings.ini b/Installer/old/vi_settings.ini similarity index 96% rename from Installer/vi_settings.ini rename to Installer/old/vi_settings.ini index 314908fd..037ad5c8 100644 --- a/Installer/vi_settings.ini +++ b/Installer/old/vi_settings.ini @@ -1,4 +1,4 @@ -[Settings] -ProgramName=Vistumbler -ProgramVersion=v10 +[Settings] +ProgramName=Vistumbler +ProgramVersion=v10 ProgramAuthor=Andrew Calcutt \ No newline at end of file diff --git a/Installer/vi_files.zip b/Installer/vi_files.zip deleted file mode 100644 index 206e1090..00000000 Binary files a/Installer/vi_files.zip and /dev/null differ diff --git a/Installer/vi_files/Export.au3 b/Installer/vi_files/Export.au3 new file mode 100644 index 00000000..b9ce22b4 --- /dev/null +++ b/Installer/vi_files/Export.au3 @@ -0,0 +1,648 @@ +#NoTrayIcon +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Icon=Icons\icon.ico +#AutoIt3Wrapper_Run_Tidy=y +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** +;License Information------------------------------------ +;Copyright (C) 2019 Andrew Calcutt +;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; Version 2 of the License. +;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +;You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +;-------------------------------------------------------- +;AutoIt Version: v3.3.15.1 +$Script_Author = 'Andrew Calcutt' +$Script_Name = 'Vistumbler Exporter' +$Script_Website = 'http://www.Vistumbler.net' +$Script_Function = 'Reads the vistumbler DB and exports based on input options' +$version = 'v7.2' +$last_modified = '2016/03/06' +HttpSetUserAgent($Script_Name & ' ' & $version) +;-------------------------------------------------------- +#include "UDFs\AccessCom.au3" +#include "UDFs\ZIP.au3" +#include +#include +$oMyError = ObjEvent("AutoIt.Error", "_Error") + +Dim $Default_settings = @ScriptDir & '\Settings\vistumbler_settings.ini' +Dim $Profile_settings = @AppDataDir & '\Vistumbler\vistumbler_settings.ini' +Dim $PortableMode = IniRead($Default_settings, 'Vistumbler', 'PortableMode', 0) +If $PortableMode = 1 Then + $settings = $Default_settings + $TmpDir = @ScriptDir & '\temp\' +Else + $settings = $Profile_settings + If FileExists($Default_settings) And FileExists($settings) = 0 Then FileCopy($Default_settings, $settings, 1) + $TmpDir = @TempDir & '\Vistumbler\' +EndIf + +Dim $DB_OBJ +Dim $Debug = 0 +Dim $filetype = 'cd' ;Default file type (d=detailed VS1, cd=detailed CSV, cs=summary CSV, k=KML, w=WifiDB Upload) +Dim $filename = $TmpDir & 'Save.csv' +Dim $VistumblerDB = $TmpDir & 'Vistumbler.mdb' +Dim $ImageDir = @ScriptDir & '\Images\' + +;Set GUI text based on default language +Dim $LanguageDir = @ScriptDir & '\Languages\' +Dim $DefaultLanguageFile = IniRead($settings, 'Vistumbler', 'LanguageFile', 'English.ini') +Dim $DefaultLanguagePath = $LanguageDir & $DefaultLanguageFile +If FileExists($DefaultLanguagePath) = 0 Then + $DefaultLanguageFile = 'English.ini' + $DefaultLanguagePath = $LanguageDir & $DefaultLanguageFile +EndIf +Dim $Column_Names_Line = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Line', '#') +Dim $Column_Names_Active = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Active', 'Active') +Dim $Column_Names_SSID = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_SSID', 'SSID') +Dim $Column_Names_BSSID = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_BSSID', 'Mac Address') +Dim $Column_Names_MANUF = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Manufacturer', 'Manufacturer') +Dim $Column_Names_Signal = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Signal', 'Signal') +Dim $Column_Names_Authentication = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Authentication', 'Authentication') +Dim $Column_Names_Encryption = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Encryption', 'Encryption') +Dim $Column_Names_RadioType = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_RadioType', 'Radio Type') +Dim $Column_Names_Channel = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Channel', 'Channel') +Dim $Column_Names_Latitude = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Latitude', 'Latitude') +Dim $Column_Names_Longitude = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Longitude', 'Longitude') +Dim $Column_Names_LatitudeDMS = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_LatitudeDMS', 'Latitude (DDMMSS)') +Dim $Column_Names_LongitudeDMS = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_LongitudeDMS', 'Longitude (DDMMSS)') +Dim $Column_Names_LatitudeDMM = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_LatitudeDMM', 'Latitude (DDMMMM)') +Dim $Column_Names_LongitudeDMM = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_LongitudeDMM', 'Longitude (DDMMMM)') +Dim $Column_Names_BasicTransferRates = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_BasicTransferRates', 'Basic Transfer Rates') +Dim $Column_Names_OtherTransferRates = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_OtherTransferRates', 'Other Transfer Rates') +Dim $Column_Names_FirstActive = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_FirstActive', 'First Active') +Dim $Column_Names_LastActive = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_LastActive', 'Last Active') +Dim $Column_Names_NetworkType = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_NetworkType', 'Network Type') +Dim $Column_Names_Label = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Label', 'Label') + +Dim $MapActiveAPs = 0 +Dim $MapDeadAPs = 0 +Dim $MapAccessPoints = 0 +Dim $MapTrack = 0 +Dim $apiurl +Dim $WifiDb_User +Dim $WifiDb_ApiKey +Dim $WifiDb_SessionID + +For $loop = 1 To $CmdLine[0] + If StringInStr($CmdLine[$loop], '/f') Then + $filesplit = _StringExplode($CmdLine[$loop], "=", 1) + If IsArray($filesplit) Then $filename = $filesplit[1] + EndIf + If StringInStr($CmdLine[$loop], '/t') Then + $filesplit = _StringExplode($CmdLine[$loop], "=", 1) + If IsArray($filesplit) Then $filetype = $filesplit[1] + EndIf + If StringInStr($CmdLine[$loop], '/a') Then + $MapActiveAPs = 1 + $MapAccessPoints = 1 + EndIf + If StringInStr($CmdLine[$loop], '/p') Then + $MapTrack = 1 + EndIf + If StringInStr($CmdLine[$loop], '/db') Then + $filesplit = _StringExplode($CmdLine[$loop], "=", 1) + If IsArray($filesplit) Then $VistumblerDB = $filesplit[1] + EndIf + If StringInStr($CmdLine[$loop], '/d') And StringInStr($CmdLine[$loop], '/db') = 0 Then + $MapDeadAPs = 1 + $MapAccessPoints = 1 + EndIf + If StringInStr($CmdLine[$loop], '/u') Then + $urlsplit = _StringExplode($CmdLine[$loop], "=", 1) + If IsArray($urlsplit) Then $apiurl = $urlsplit[1] + EndIf + If StringInStr($CmdLine[$loop], '/wa') Then + $wasplit = _StringExplode($CmdLine[$loop], "=", 1) + If IsArray($wasplit) Then $WifiDb_User = $wasplit[1] + EndIf + If StringInStr($CmdLine[$loop], '/wk') Then + $wksplit = _StringExplode($CmdLine[$loop], "=", 1) + If IsArray($wksplit) Then $WifiDb_ApiKey = $wksplit[1] + EndIf + If StringInStr($CmdLine[$loop], '/wsid') Then + $wsidsplit = _StringExplode($CmdLine[$loop], "=", 1) + If IsArray($wsidsplit) Then $WifiDb_SessionID = $wsidsplit[1] + EndIf + If StringInStr($CmdLine[$loop], '/?') Then + MsgBox(0, '', 'to be filled in later. the old help was outdated an no longer relevant') + Exit + EndIf +Next + +If FileExists($VistumblerDB) Then + _AccessConnectConn($VistumblerDB, $DB_OBJ) + If $filetype = 'd' Then + _ExportVS1($filename) + ElseIf $filetype = 'z' Then + _ExportVSZ($filename) + ElseIf $filetype = 'cd' Then + _ExportToCSV($filename, 1) + ElseIf $filetype = 'cs' Then + _ExportToCSV($filename, 0) + ElseIf $filetype = 'k' Then + _AutoSaveKml($filename, $MapTrack, $MapAccessPoints, $MapActiveAPs, $MapDeadAPs) + ElseIf $filetype = 'w' Then + _UploadActiveApsToWifidb() + EndIf + _AccessCloseConn($DB_OBJ) +EndIf + +Exit + +;------------------------------------------------------------------------------------------------------------------------------- +; FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _ExportVS1($savefile) ;writes vistumbler detailed data to a txt file + $file = "# Vistumbler VS1 - Detailed Export Version 4.0" & @CRLF & _ + "# Created By: " & $Script_Name & ' ' & $version & @CRLF & _ + "# -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" & @CRLF & _ + "# GpsID|Latitude|Longitude|NumOfSatalites|HorizontalDilutionOfPrecision|Altitude(m)|HeightOfGeoidAboveWGS84Ellipsoid(m)|Speed(km/h)|Speed(MPH)|TrackAngle(Deg)|Date(UTC y-m-d)|Time(UTC h:m:s.ms)" & @CRLF & _ + "# -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" & @CRLF + ;Export GPS IDs + $query = "SELECT GpsID, Latitude, Longitude, NumOfSats, HorDilPitch, Alt, Geo, SpeedInMPH, SpeedInKmH, TrackAngle, Date1, Time1 FROM GPS ORDER BY Date1, Time1" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + For $exp = 1 To $FoundGpsMatch + $ExpGID = $GpsMatchArray[$exp][1] + $ExpLat = $GpsMatchArray[$exp][2] + $ExpLon = $GpsMatchArray[$exp][3] + $ExpSat = $GpsMatchArray[$exp][4] + $ExpHorDilPitch = $GpsMatchArray[$exp][5] + $ExpAlt = $GpsMatchArray[$exp][6] + $ExpGeo = $GpsMatchArray[$exp][7] + $ExpSpeedMPH = $GpsMatchArray[$exp][8] + $ExpSpeedKmh = $GpsMatchArray[$exp][9] + $ExpTrack = $GpsMatchArray[$exp][10] + $ExpDate = $GpsMatchArray[$exp][11] + $ExpTime = $GpsMatchArray[$exp][12] + $file &= $ExpGID & '|' & $ExpLat & '|' & $ExpLon & '|' & $ExpSat & '|' & $ExpHorDilPitch & '|' & $ExpAlt & '|' & $ExpGeo & '|' & $ExpSpeedKmh & '|' & $ExpSpeedMPH & '|' & $ExpTrack & '|' & $ExpDate & '|' & $ExpTime & @CRLF + Next + + ;Export AP Information + $file &= "# ---------------------------------------------------------------------------------------------------------------------------------------------------------" & @CRLF & _ + "# SSID|BSSID|MANUFACTURER|Authentication|Encryption|Security Type|Radio Type|Channel|Basic Transfer Rates|Other Transfer Rates|High Signal|High RSSI|Network Type|Label|GID,SIGNAL,RSSI" & @CRLF & _ + "# ---------------------------------------------------------------------------------------------------------------------------------------------------------" & @CRLF + + $query = "SELECT ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, HighSignal, HighRSSI, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID FROM AP" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch > 0 Then + For $exp = 1 To $FoundApMatch + $ExpApID = $ApMatchArray[$exp][1] + $ExpSSID = $ApMatchArray[$exp][2] + $ExpBSSID = $ApMatchArray[$exp][3] + $ExpNET = $ApMatchArray[$exp][4] + $ExpRAD = $ApMatchArray[$exp][5] + $ExpCHAN = $ApMatchArray[$exp][6] + $ExpAUTH = $ApMatchArray[$exp][7] + $ExpENCR = $ApMatchArray[$exp][8] + $ExpSECTYPE = $ApMatchArray[$exp][9] + $ExpBTX = $ApMatchArray[$exp][10] + $ExpOTX = $ApMatchArray[$exp][11] + $ExpHighSig = $ApMatchArray[$exp][12] + $ExpHighRSSI = $ApMatchArray[$exp][13] + $ExpMANU = $ApMatchArray[$exp][14] + $ExpLAB = $ApMatchArray[$exp][15] + $ExpHighGpsID = $ApMatchArray[$exp][16] + $ExpFirstID = $ApMatchArray[$exp][17] + $ExpLastID = $ApMatchArray[$exp][18] + + ;Create GID,SIG String + $ExpGidSid = '' + $query = "SELECT GpsID, Signal, RSSI FROM Hist WHERE ApID=" & $ExpApID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundHistMatch = UBound($HistMatchArray) - 1 + For $epgs = 1 To $FoundHistMatch + $ExpGID = $HistMatchArray[$epgs][1] + $ExpSig = $HistMatchArray[$epgs][2] + $ExpRSSI = $HistMatchArray[$epgs][3] + If $epgs = 1 Then + $ExpGidSid = $ExpGID & ',' & $ExpSig & ',' & $ExpRSSI + Else + $ExpGidSid &= '\' & $ExpGID & ',' & $ExpSig & ',' & $ExpRSSI + EndIf + Next + + $file &= $ExpSSID & '|' & $ExpBSSID & '|' & $ExpMANU & '|' & $ExpAUTH & '|' & $ExpENCR & '|' & $ExpSECTYPE & '|' & $ExpRAD & '|' & $ExpCHAN & '|' & $ExpBTX & '|' & $ExpOTX & '|' & $ExpHighSig & '|' & $ExpHighRSSI & '|' & $ExpNET & '|' & $ExpLAB & '|' & $ExpGidSid & @CRLF + Next + $savefile = FileOpen($savefile, 128 + 2) ;Open in UTF-8 write mode + FileWrite($savefile, $file) + FileClose($savefile) + Return (1) + Else + Return (0) + EndIf +EndFunc ;==>_ExportVS1 + +Func _ExportVSZ($savefile) + $vsz_temp_file = $TmpDir & 'data.zip' + $vsz_file = $savefile + $vs1_file = $TmpDir & 'data.vs1' + If FileExists($vsz_temp_file) Then FileDelete($vsz_temp_file) + If FileExists($vsz_file) Then FileDelete($vsz_file) + If FileExists($vs1_file) Then FileDelete($vs1_file) + _ExportVS1($vs1_file) + _Zip_Create($vsz_temp_file) + _Zip_AddItem($vsz_temp_file, $vs1_file) + FileMove($vsz_temp_file, $vsz_file) + FileDelete($vs1_file) +EndFunc ;==>_ExportVSZ + +Func _ExportToCSV($savefile, $Detailed = 0) ;writes vistumbler data to a csv file + If $Detailed = 0 Then + $file = "SSID,BSSID,MANUFACTURER,HIGHEST SIGNAL W/GPS,AUTHENTICATION,ENCRYPTION,RADIO TYPE,CHANNEL,LATITUDE,LONGITUDE,BTX,OTX,FIRST SEEN(UTC),LAST SEEN(UTC),NETWORK TYPE,LABEL" & @CRLF + ElseIf $Detailed = 1 Then + $file = "SSID,BSSID,MANUFACTURER,SIGNAL,AUTHENTICATION,ENCRYPTION,RADIO TYPE,CHANNEL,BTX,OTX,NETWORK TYPE,LABEL,LATITUDE,LONGITUDE,SATELLITES,HDOP,ALTITUDE,HEIGHT OF GEOID,SPEED(km/h),SPEED(MPH),TRACK ANGLE,DATE(UTC),TIME(UTC)" & @CRLF + EndIf + $query = "SELECT ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active FROM AP" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch > 0 Then + For $exp = 1 To $FoundApMatch + $ExpApID = $ApMatchArray[$exp][1] + $ExpSSID = $ApMatchArray[$exp][2] + $ExpBSSID = $ApMatchArray[$exp][3] + $ExpNET = $ApMatchArray[$exp][4] + $ExpRAD = $ApMatchArray[$exp][5] + $ExpCHAN = $ApMatchArray[$exp][6] + $ExpAUTH = $ApMatchArray[$exp][7] + $ExpENCR = $ApMatchArray[$exp][8] + $ExpBTX = $ApMatchArray[$exp][10] + $ExpOTX = $ApMatchArray[$exp][11] + $ExpMANU = $ApMatchArray[$exp][12] + $ExpLAB = $ApMatchArray[$exp][13] + $ExpHighGpsID = $ApMatchArray[$exp][14] + $ExpFirstID = $ApMatchArray[$exp][15] + $ExpLastID = $ApMatchArray[$exp][16] + + If $Detailed = 0 Then + ;Get High GPS Signal + If $ExpHighGpsID = 0 Then + $ExpHighGpsSig = 0 + $ExpHighGpsLat = 'N 0000.0000' + $ExpHighGpsLon = 'E 0000.0000' + Else + $query = "SELECT Signal, GpsID FROM Hist WHERE HistID=" & $ExpHighGpsID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpHighGpsSig = $HistMatchArray[1][1] + $ExpHighGpsID = $HistMatchArray[1][2] + $query = "SELECT Latitude, Longitude FROM GPS WHERE GpsID=" & $ExpHighGpsID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpHighGpsLat = $GpsMatchArray[1][1] + $ExpHighGpsLon = $GpsMatchArray[1][2] + EndIf + ;Get First Found Time From FirstHistID + $query = "SELECT GpsID FROM Hist WHERE HistID=" & $ExpFirstID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpFirstGpsId = $HistMatchArray[1][1] + $query = "SELECT Date1, Time1 FROM GPS WHERE GpsID=" & $ExpFirstGpsId + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FirstDateTime = $GpsMatchArray[1][1] & ' ' & $GpsMatchArray[1][2] + ;Get Last Found Time From LastHistID + $query = "SELECT GpsID FROM Hist WHERE HistID=" & $ExpLastID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLastGpsID = $HistMatchArray[1][1] + $query = "SELECT Date1, Time1 FROM GPS WHERE GpsID=" & $ExpLastGpsID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $LastDateTime = $GpsMatchArray[1][1] & ' ' & $GpsMatchArray[1][2] + ;Write summary csv line + $file &= StringReplace($ExpSSID, ',', '') & ',' & $ExpBSSID & ',' & StringReplace($ExpMANU, ',', '') & ',' & $ExpHighGpsSig & ',' & $ExpAUTH & ',' & $ExpENCR & ',' & $ExpRAD & ',' & $ExpCHAN & ',' & StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($ExpHighGpsLat), 'S', '-'), 'N', ''), ' ', '') & ',' & StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($ExpHighGpsLon), 'W', '-'), 'E', ''), ' ', '') & ',' & $ExpBTX & ',' & $ExpOTX & ',' & $FirstDateTime & ',' & $LastDateTime & ',' & $ExpNET & ',' & StringReplace($ExpLAB, ',', '') & @CRLF + ElseIf $Detailed = 1 Then + ;Get All Signals and GpsIDs for current ApID + $query = "SELECT GpsID, Signal FROM Hist WHERE ApID=" & $ExpApID & " And Signal<>0 ORDER BY Date1, Time1" + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundHistMatch = UBound($HistMatchArray) - 1 + For $exph = 1 To $FoundHistMatch + $ExpGID = $HistMatchArray[$exph][1] + $ExpSig = $HistMatchArray[$exph][2] + ;Get GPS Data Based on GpsID + $query = "SELECT Latitude, Longitude, NumOfSats, HorDilPitch, Alt, Geo, SpeedInMPH, SpeedInKmH, TrackAngle, Date1, Time1 FROM GPS WHERE GpsID=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLat = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][1]), 'S', '-'), 'N', ''), ' ', '') + $ExpLon = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][2]), 'W', '-'), 'E', ''), ' ', '') + $ExpSat = $GpsMatchArray[1][3] + $ExpHorDilPitch = $GpsMatchArray[1][4] + $ExpAlt = $GpsMatchArray[1][5] + $ExpGeo = $GpsMatchArray[1][6] + $ExpSpeedMPH = $GpsMatchArray[1][7] + $ExpSpeedKmh = $GpsMatchArray[1][8] + $ExpTrack = $GpsMatchArray[1][9] + $ExpDate = $GpsMatchArray[1][10] + $ExpTime = $GpsMatchArray[1][11] + ;Write detailed csv line + $file &= '"' & $ExpSSID & '",' & $ExpBSSID & ',"' & $ExpMANU & '",' & $ExpSig & ',' & $ExpAUTH & ',' & $ExpENCR & ',' & $ExpRAD & ',' & $ExpCHAN & ',' & $ExpBTX & ',' & $ExpOTX & ',' & $ExpNET & ',"' & $ExpLAB & '",' & $ExpLat & ',' & $ExpLon & ',' & $ExpSat & ',' & $ExpHorDilPitch & ',' & $ExpAlt & ',' & $ExpGeo & ',' & $ExpSpeedKmh & ',' & $ExpSpeedMPH & ',' & $ExpTrack & ',' & $ExpDate & ',' & $ExpTime & @CRLF + Next + EndIf + Next + $savefile = FileOpen($savefile, 128 + 2) ;Open in UTF-8 write mode + FileWrite($savefile, $file) + FileClose($savefile) + Return (1) + Else + Return (0) + EndIf +EndFunc ;==>_ExportToCSV + +Func _AutoSaveKml($kml, $MapGpsTrack = 1, $MapAPs = 1, $MapActive = 1, $MapDead = 1) + $file = '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF _ + & '' & 'Vistumbler AutoKML' & ' - By ' & 'Andrew Calcutt' & '' & @CRLF _ + & '' & 'Vistumbler AutoKML' & ' ' & 'V1.0' & '' & @CRLF + If $MapAPs = 1 Then + If $MapActive = 1 Then + $file &= '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF + + EndIf + If $MapDead = 1 Then + $file &= '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF + EndIf + EndIf + If $MapGpsTrack = 1 Then + $file &= '' & @CRLF + EndIf + If $MapAPs = 1 Then + ConsoleWrite('-->' & $MapActive & '-' & $MapDead & @CRLF) + If $MapActive = 1 Or $MapDead = 1 Then + If $MapActive = 1 And $MapDead = 1 Then + $query = "SELECT SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, BTX, OTX, MANU, LABEL, HighGpsHistID, Active, SecType FROM AP WHERE HighGpsHistId<>0" + ElseIf $MapActive = 1 Then + $query = "SELECT SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, BTX, OTX, MANU, LABEL, HighGpsHistID, Active, SecType FROM AP WHERE HighGpsHistId<>0 And Active=1" + ElseIf $MapDead = 1 Then + $query = "SELECT SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, BTX, OTX, MANU, LABEL, HighGpsHistID, Active, SecType FROM AP WHERE HighGpsHistId<>0 And Active=0" + EndIf + ConsoleWrite('-->' & $query & @CRLF) + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + ConsoleWrite('-->' & $FoundApMatch & @CRLF) + If $FoundApMatch <> 0 Then + $FoundApWithGps = 1 + $file_open = '' + $file_wep = '' + $file_sec = '' + For $exp = 1 To $FoundApMatch + $ExpSSID = $ApMatchArray[$exp][1] + $ExpBSSID = $ApMatchArray[$exp][2] + $ExpNET = $ApMatchArray[$exp][3] + $ExpRAD = $ApMatchArray[$exp][4] + $ExpCHAN = $ApMatchArray[$exp][5] + $ExpAUTH = $ApMatchArray[$exp][6] + $ExpENCR = $ApMatchArray[$exp][7] + $ExpBTX = $ApMatchArray[$exp][8] + $ExpOTX = $ApMatchArray[$exp][9] + $ExpMANU = $ApMatchArray[$exp][10] + $ExpLAB = $ApMatchArray[$exp][11] + $ExpHighGpsHistID = $ApMatchArray[$exp][12] - 0 + ;$ExpFirstID = $ApMatchArray[$exp][13] - 0 + ;$ExpLastID = $ApMatchArray[$exp][14] - 0 + $ExpActive = $ApMatchArray[$exp][13] + $ExpSECTYPE = $ApMatchArray[$exp][14] + ;Get Gps ID of HighGpsHistId + $query = "SELECT GpsID FROM Hist Where HistID=" & $ExpHighGpsHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundHistMatch = UBound($HistMatchArray) - 1 + If $FoundHistMatch <> 0 Then + $ExpGID = $HistMatchArray[1][1] + ;Get Latitude and Longitude + $query = "SELECT Latitude, Longitude FROM GPS WHERE GpsId=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch <> 0 Then + $ExpLat = _Format_GPS_DMM_to_DDD($GpsMatchArray[1][1]) + $ExpLon = _Format_GPS_DMM_to_DDD($GpsMatchArray[1][2]) + If $ExpSECTYPE = 1 Then + $file_open &= '' & @CRLF _ + & '' & @CRLF _ + & '' & $Column_Names_SSID & ': ' & $ExpSSID & '
' & $Column_Names_BSSID & ': ' & $ExpBSSID & '
' & $Column_Names_NetworkType & ': ' & $ExpNET & '
' & $Column_Names_RadioType & ': ' & $ExpRAD & '
' & $Column_Names_Channel & ': ' & $ExpCHAN & '
' & $Column_Names_Authentication & ': ' & $ExpAUTH & '
' & $Column_Names_Encryption & ': ' & $ExpENCR & '
' & $Column_Names_BasicTransferRates & ': ' & $ExpBTX & '
' & $Column_Names_OtherTransferRates & ': ' & $ExpOTX & '
' & $Column_Names_Latitude & ': ' & $ExpLat & '
' & $Column_Names_Longitude & ': ' & $ExpLon & '
' & $Column_Names_MANUF & ': ' & $ExpMANU & '
]]>
' & @CRLF + ;& '' & $Column_Names_SSID & ': ' & $ExpSSID & '
' & $Column_Names_BSSID & ': ' & $ExpBSSID & '
' & $Column_Names_NetworkType & ': ' & $ExpNET & '
' & $Column_Names_RadioType & ': ' & $ExpRAD & '
' & $Column_Names_Channel & ': ' & $ExpCHAN & '
' & $Column_Names_Authentication & ': ' & $ExpAUTH & '
' & $Column_Names_Encryption & ': ' & $ExpENCR & '
' & $Column_Names_BasicTransferRates & ': ' & $ExpBTX & '
' & $Column_Names_OtherTransferRates & ': ' & $ExpOTX & '
' & $Column_Names_FirstActive & ': ' & $ExpFirstDateTime & '
' & $Column_Names_LastActive & ': ' & $ExpLastDateTime & '
' & $Column_Names_Latitude & ': ' & $ExpLat & '
' & $Column_Names_Longitude & ': ' & $ExpLon & '
' & $Column_Names_MANUF & ': ' & $ExpMANU & '
]]>
' & @CRLF + If $ExpActive = 1 Then + $file_open &= '#openStyle' & @CRLF + ElseIf $ExpActive = 0 Then + $file_open &= '#openDeadStyle' & @CRLF + EndIf + $file_open &= '' & @CRLF _ + & '' & StringReplace(StringReplace(StringReplace($ExpLon, 'W', '-'), 'E', ''), ' ', '') & ',' & StringReplace(StringReplace(StringReplace($ExpLat, 'S', '-'), 'N', ''), ' ', '') & ',0' & @CRLF _ + & '' & @CRLF _ + & '
' & @CRLF + ElseIf $ExpSECTYPE = 2 Then + $file_wep &= '' & @CRLF _ + & '' & @CRLF _ + & '' & $Column_Names_SSID & ': ' & $ExpSSID & '
' & $Column_Names_BSSID & ': ' & $ExpBSSID & '
' & $Column_Names_NetworkType & ': ' & $ExpNET & '
' & $Column_Names_RadioType & ': ' & $ExpRAD & '
' & $Column_Names_Channel & ': ' & $ExpCHAN & '
' & $Column_Names_Authentication & ': ' & $ExpAUTH & '
' & $Column_Names_Encryption & ': ' & $ExpENCR & '
' & $Column_Names_BasicTransferRates & ': ' & $ExpBTX & '
' & $Column_Names_OtherTransferRates & ': ' & $ExpOTX & '
' & $Column_Names_Latitude & ': ' & $ExpLat & '
' & $Column_Names_Longitude & ': ' & $ExpLon & '
' & $Column_Names_MANUF & ': ' & $ExpMANU & '
]]>
' & @CRLF + ;& '' & $Column_Names_SSID & ': ' & $ExpSSID & '
' & $Column_Names_BSSID & ': ' & $ExpBSSID & '
' & $Column_Names_NetworkType & ': ' & $ExpNET & '
' & $Column_Names_RadioType & ': ' & $ExpRAD & '
' & $Column_Names_Channel & ': ' & $ExpCHAN & '
' & $Column_Names_Authentication & ': ' & $ExpAUTH & '
' & $Column_Names_Encryption & ': ' & $ExpENCR & '
' & $Column_Names_BasicTransferRates & ': ' & $ExpBTX & '
' & $Column_Names_OtherTransferRates & ': ' & $ExpOTX & '
' & $Column_Names_FirstActive & ': ' & $ExpFirstDateTime & '
' & $Column_Names_LastActive & ': ' & $ExpLastDateTime & '
' & $Column_Names_Latitude & ': ' & $ExpLat & '
' & $Column_Names_Longitude & ': ' & $ExpLon & '
' & $Column_Names_MANUF & ': ' & $ExpMANU & '
]]>
' & @CRLF + If $ExpActive = 1 Then + $file_wep &= '#wepStyle' & @CRLF + ElseIf $ExpActive = 0 Then + $file_wep &= '#wepDeadStyle' & @CRLF + EndIf + $file_wep &= '' & @CRLF _ + & '' & StringReplace(StringReplace(StringReplace($ExpLon, 'W', '-'), 'E', ''), ' ', '') & ',' & StringReplace(StringReplace(StringReplace($ExpLat, 'S', '-'), 'N', ''), ' ', '') & ',0' & @CRLF _ + & '' & @CRLF _ + & '
' & @CRLF + ElseIf $ExpSECTYPE = 3 Then + $file_sec &= '' & @CRLF _ + & '' & @CRLF _ + & '' & $Column_Names_SSID & ': ' & $ExpSSID & '
' & $Column_Names_BSSID & ': ' & $ExpBSSID & '
' & $Column_Names_NetworkType & ': ' & $ExpNET & '
' & $Column_Names_RadioType & ': ' & $ExpRAD & '
' & $Column_Names_Channel & ': ' & $ExpCHAN & '
' & $Column_Names_Authentication & ': ' & $ExpAUTH & '
' & $Column_Names_Encryption & ': ' & $ExpENCR & '
' & $Column_Names_BasicTransferRates & ': ' & $ExpBTX & '
' & $Column_Names_OtherTransferRates & ': ' & $ExpOTX & '
' & $Column_Names_Latitude & ': ' & $ExpLat & '
' & $Column_Names_Longitude & ': ' & $ExpLon & '
' & $Column_Names_MANUF & ': ' & $ExpMANU & '
]]>
' & @CRLF + ; & '' & $Column_Names_SSID & ': ' & $ExpSSID & '
' & $Column_Names_BSSID & ': ' & $ExpBSSID & '
' & $Column_Names_NetworkType & ': ' & $ExpNET & '
' & $Column_Names_RadioType & ': ' & $ExpRAD & '
' & $Column_Names_Channel & ': ' & $ExpCHAN & '
' & $Column_Names_Authentication & ': ' & $ExpAUTH & '
' & $Column_Names_Encryption & ': ' & $ExpENCR & '
' & $Column_Names_BasicTransferRates & ': ' & $ExpBTX & '
' & $Column_Names_OtherTransferRates & ': ' & $ExpOTX & '
' & $Column_Names_FirstActive & ': ' & $ExpFirstDateTime & '
' & $Column_Names_LastActive & ': ' & $ExpLastDateTime & '
' & $Column_Names_Latitude & ': ' & $ExpLat & '
' & $Column_Names_Longitude & ': ' & $ExpLon & '
' & $Column_Names_MANUF & ': ' & $ExpMANU & '
]]>
' & @CRLF + If $ExpActive = 1 Then + $file_sec &= '#secureStyle' & @CRLF + ElseIf $ExpActive = 0 Then + $file_sec &= '#secureDeadStyle' & @CRLF + EndIf + $file_sec &= '' & @CRLF _ + & '' & StringReplace(StringReplace(StringReplace($ExpLon, 'W', '-'), 'E', ''), ' ', '') & ',' & StringReplace(StringReplace(StringReplace($ExpLat, 'S', '-'), 'N', ''), ' ', '') & ',0' & @CRLF _ + & '' & @CRLF _ + & '
' & @CRLF + EndIf + EndIf + EndIf + Sleep(5) + Next + If $file_open <> '' Then + $file &= '' & @CRLF _ + & 'Open Access Points' & @CRLF _ + & $file_open & '' & @CRLF + EndIf + If $file_wep <> '' Then + $file &= '' & @CRLF _ + & 'Wep Access Points' & @CRLF _ + & $file_wep & '' & @CRLF + EndIf + If $file_sec <> '' Then + $file &= '' & @CRLF _ + & 'Secure Access Points' & @CRLF _ + & $file_sec & '' & @CRLF + EndIf + EndIf + EndIf + EndIf + If $MapGpsTrack = 1 Then + $query = "SELECT Latitude, Longitude FROM GPS WHERE Latitude <> 'N 0.0000' And Longitude <> 'E 0.0000' ORDER BY Date1, Time1" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch <> 0 Then + $file &= '' & @CRLF _ + & 'Vistumbler Gps Track' & @CRLF _ + & '' & @CRLF _ + & 'Location' & @CRLF _ + & '#Location' & @CRLF _ + & '' & @CRLF _ + & '1' & @CRLF _ + & '1' & @CRLF _ + & '' & @CRLF + For $exp = 1 To $FoundGpsMatch + $ExpLat = _Format_GPS_DMM_to_DDD($GpsMatchArray[$exp][1]) + $ExpLon = _Format_GPS_DMM_to_DDD($GpsMatchArray[$exp][2]) + If $ExpLat <> 'N 0.0000000' And $ExpLon <> 'E 0.0000000' Then + $FoundApWithGps = 1 + $file &= StringReplace(StringReplace(StringReplace($ExpLon, 'W', '-'), 'E', ''), ' ', '') & ',' & StringReplace(StringReplace(StringReplace($ExpLat, 'S', '-'), 'N', ''), ' ', '') & ',0' & @CRLF + EndIf + Next + $file &= '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF + EndIf + EndIf + $file &= '
' & @CRLF _ + & '
' + + FileDelete($kml) + $filewrite = FileWrite($kml, $file) +EndFunc ;==>_AutoSaveKml + +Func _UploadActiveApsToWifidb() + If $Debug = 1 Then FileWrite("templog.txt", 'UploadActiveApsToWifidb----------------------------------------------------------------------------------------------' & @CRLF) + $query = "SELECT ApID, BSSID, SSID, CHAN, AUTH, ENCR, SECTYPE, NETTYPE, RADTYPE, BTX, OTX, LastHistID, LABEL FROM AP WHERE Active=1" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $Debug = 1 Then FileWrite("templog.txt", $FoundApMatch & @CRLF) + For $exp = 1 To $FoundApMatch + $ExpApID = $ApMatchArray[$exp][1] + $ExpBSSID = StringReplace($ApMatchArray[$exp][2], ":", "") + $ExpSSID = $ApMatchArray[$exp][3] + $ExpCHAN = $ApMatchArray[$exp][4] + $ExpAUTH = $ApMatchArray[$exp][5] + $ExpENCR = $ApMatchArray[$exp][6] + $ExpSECTYPE = $ApMatchArray[$exp][7] + $ExpNET = $ApMatchArray[$exp][8] + $ExpRAD = $ApMatchArray[$exp][9] + $ExpBTX = $ApMatchArray[$exp][10] + $ExpOTX = $ApMatchArray[$exp][11] + $ExpLastID = $ApMatchArray[$exp][12] + $ExpLAB = $ApMatchArray[$exp][13] + + $query = "SELECT Signal, RSSI, GpsID FROM Hist WHERE HistID=" & $ExpLastID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundHistMatch = UBound($HistMatchArray) - 1 + If $FoundHistMatch = 1 Then + $ExpLastGpsSig = $HistMatchArray[1][1] + $ExpLastGpsRSSI = $HistMatchArray[1][2] + $ExpLastGpsID = $HistMatchArray[1][3] + If $ExpLastGpsSig <> 0 Then + $query = "SELECT Latitude, Longitude, NumOfSats, HorDilPitch, Alt, Geo, SpeedInMPH, SpeedInKmH, TrackAngle, Date1, Time1 FROM GPS WHERE GpsID=" & $ExpLastGpsID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch = 1 Then + $ExpLastGpsLat = StringReplace(StringReplace(StringReplace($GpsMatchArray[1][1], "N", ""), "S", "-"), " ", "") + $ExpLastGpsLon = StringReplace(StringReplace(StringReplace($GpsMatchArray[1][2], "E", ""), "W", "-"), " ", "") + $ExpLastGpsSat = $GpsMatchArray[1][3] + $ExpLastGpsHDP = $GpsMatchArray[1][4] + $ExpLastGpsAlt = $GpsMatchArray[1][5] + $ExpLastGpsGeo = $GpsMatchArray[1][6] + $ExpLastGpsMPH = $GpsMatchArray[1][7] + $ExpLastGpsKMH = $GpsMatchArray[1][8] + $ExpLastGpsTAngle = $GpsMatchArray[1][9] + $ExpLastGpsDate = $GpsMatchArray[1][10] + $ExpLastGpsTime = $GpsMatchArray[1][11] + + $url_root = $apiurl & 'live.php?' + $url_data = "SessionID=" & $WifiDb_SessionID & "&SSID=" & $ExpSSID & "&Mac=" & $ExpBSSID & "&Auth=" & $ExpAUTH & "&SecType=" & $ExpSECTYPE & "&Encry=" & $ExpENCR & "&Rad=" & $ExpRAD & "&Chn=" & $ExpCHAN & "&Lat=" & $ExpLastGpsLat & "&Long=" & $ExpLastGpsLon & "&BTx=" & $ExpBTX & "&OTx=" & $ExpOTX & "&Date=" & $ExpLastGpsDate & "&Time=" & $ExpLastGpsTime & "&NT=" & $ExpNET & "&Label=" & $ExpLAB & "&Sig=" & $ExpLastGpsSig & "&RSSI=" & $ExpLastGpsRSSI & "&Sats=" & $ExpLastGpsSat & "&HDP=" & $ExpLastGpsHDP & "&ALT=" & $ExpLastGpsAlt & "&GEO=" & $ExpLastGpsGeo & "&KMH=" & $ExpLastGpsKMH & "&MPH=" & $ExpLastGpsMPH & "&Track=" & $ExpLastGpsTAngle + If $WifiDb_User <> '' And $WifiDb_ApiKey <> '' Then $url_data &= "&username=" & $WifiDb_User & "&apikey=" & $WifiDb_ApiKey + If $Debug = 1 Then FileWrite("templog.txt", StringLen($url_root & $url_data) & ' - ' & $url_root & $url_data & @CRLF) + $webpagesource = _INetGetSource($url_root & $url_data) + If $Debug = 1 Then FileWrite("templog.txt", $webpagesource & @CRLF & '---------------------------------------------------------------------------------------------' & @CRLF) + EndIf + EndIf + EndIf + Next +EndFunc ;==>_UploadActiveApsToWifidb + +Func _Format_GPS_DMM_to_DDD($gps) ;converts gps position from ddmm.mmmm to dd.ddddddd + $return = '0.0000000' + $splitlatlon1 = StringSplit($gps, " ") ;Split N,S,E,W from data + If $splitlatlon1[0] = 2 Then + $splitlatlon2 = StringSplit($splitlatlon1[2], ".") ;Split dd from data + $latlonleft = StringTrimRight($splitlatlon2[1], 2) + $latlonright = (StringTrimLeft($splitlatlon2[1], StringLen($splitlatlon2[1]) - 2) & '.' & $splitlatlon2[2]) / 60 + $return = $splitlatlon1[1] & ' ' & StringFormat('%0.7f', $latlonleft + $latlonright) ;set return + EndIf + Return ($return) +EndFunc ;==>_Format_GPS_DMM_to_DDD + +Func _Error() + If $Debug = 1 Then + MsgBox(0, "Error", "We intercepted a COM Error !" & @CRLF & @CRLF & _ + "err.description is: " & @TAB & $oMyError.description & @CRLF & _ + "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ + "err.number is: " & @TAB & Hex($oMyError.number, 8) & @CRLF & _ + "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ + "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ + "err.source is: " & @TAB & $oMyError.source & @CRLF & _ + "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ + "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ + ) + EndIf + Exit +EndFunc ;==>_Error diff --git a/Installer/vi_files/Export.exe b/Installer/vi_files/Export.exe new file mode 100644 index 00000000..d4c580db Binary files /dev/null and b/Installer/vi_files/Export.exe differ diff --git a/Installer/vi_files/Icons/Signal/SignalIcons.psd b/Installer/vi_files/Icons/Signal/SignalIcons.psd new file mode 100644 index 00000000..8d34264e Binary files /dev/null and b/Installer/vi_files/Icons/Signal/SignalIcons.psd differ diff --git a/Installer/vi_files/Icons/Signal/open-green.ico b/Installer/vi_files/Icons/Signal/open-green.ico new file mode 100644 index 00000000..f073df12 Binary files /dev/null and b/Installer/vi_files/Icons/Signal/open-green.ico differ diff --git a/Installer/vi_files/Icons/Signal/open-grey.ico b/Installer/vi_files/Icons/Signal/open-grey.ico new file mode 100644 index 00000000..22fbfa38 Binary files /dev/null and b/Installer/vi_files/Icons/Signal/open-grey.ico differ diff --git a/Installer/vi_files/Icons/Signal/open-light-green.ico b/Installer/vi_files/Icons/Signal/open-light-green.ico new file mode 100644 index 00000000..b2eba274 Binary files /dev/null and b/Installer/vi_files/Icons/Signal/open-light-green.ico differ diff --git a/Installer/vi_files/Icons/Signal/open-orange.ico b/Installer/vi_files/Icons/Signal/open-orange.ico new file mode 100644 index 00000000..56d13d05 Binary files /dev/null and b/Installer/vi_files/Icons/Signal/open-orange.ico differ diff --git a/Installer/vi_files/Icons/Signal/open-red.ico b/Installer/vi_files/Icons/Signal/open-red.ico new file mode 100644 index 00000000..e20a4edd Binary files /dev/null and b/Installer/vi_files/Icons/Signal/open-red.ico differ diff --git a/Installer/vi_files/Icons/Signal/open-yellow.ico b/Installer/vi_files/Icons/Signal/open-yellow.ico new file mode 100644 index 00000000..3606c126 Binary files /dev/null and b/Installer/vi_files/Icons/Signal/open-yellow.ico differ diff --git a/Installer/vi_files/Icons/Signal/sec-green.ico b/Installer/vi_files/Icons/Signal/sec-green.ico new file mode 100644 index 00000000..e5b03002 Binary files /dev/null and b/Installer/vi_files/Icons/Signal/sec-green.ico differ diff --git a/Installer/vi_files/Icons/Signal/sec-grey.ico b/Installer/vi_files/Icons/Signal/sec-grey.ico new file mode 100644 index 00000000..4b1519e2 Binary files /dev/null and b/Installer/vi_files/Icons/Signal/sec-grey.ico differ diff --git a/Installer/vi_files/Icons/Signal/sec-light-green.ico b/Installer/vi_files/Icons/Signal/sec-light-green.ico new file mode 100644 index 00000000..12f11eb5 Binary files /dev/null and b/Installer/vi_files/Icons/Signal/sec-light-green.ico differ diff --git a/Installer/vi_files/Icons/Signal/sec-orange.ico b/Installer/vi_files/Icons/Signal/sec-orange.ico new file mode 100644 index 00000000..ce5e1e88 Binary files /dev/null and b/Installer/vi_files/Icons/Signal/sec-orange.ico differ diff --git a/Installer/vi_files/Icons/Signal/sec-red.ico b/Installer/vi_files/Icons/Signal/sec-red.ico new file mode 100644 index 00000000..ff061778 Binary files /dev/null and b/Installer/vi_files/Icons/Signal/sec-red.ico differ diff --git a/Installer/vi_files/Icons/Signal/sec-yellow.ico b/Installer/vi_files/Icons/Signal/sec-yellow.ico new file mode 100644 index 00000000..5b053349 Binary files /dev/null and b/Installer/vi_files/Icons/Signal/sec-yellow.ico differ diff --git a/Installer/icon.ico b/Installer/vi_files/Icons/icon.ico similarity index 100% rename from Installer/icon.ico rename to Installer/vi_files/Icons/icon.ico diff --git a/Installer/vi_files/Icons/vsfile_icon.ico b/Installer/vi_files/Icons/vsfile_icon.ico new file mode 100644 index 00000000..01288a62 Binary files /dev/null and b/Installer/vi_files/Icons/vsfile_icon.ico differ diff --git a/Installer/vi_files/Images/gpspos.png b/Installer/vi_files/Images/gpspos.png new file mode 100644 index 00000000..6380786c Binary files /dev/null and b/Installer/vi_files/Images/gpspos.png differ diff --git a/Installer/vi_files/Images/open.png b/Installer/vi_files/Images/open.png new file mode 100644 index 00000000..a24d6052 Binary files /dev/null and b/Installer/vi_files/Images/open.png differ diff --git a/Installer/vi_files/Images/open_dead.png b/Installer/vi_files/Images/open_dead.png new file mode 100644 index 00000000..bbe99b2a Binary files /dev/null and b/Installer/vi_files/Images/open_dead.png differ diff --git a/Installer/vi_files/Images/secure-wep.png b/Installer/vi_files/Images/secure-wep.png new file mode 100644 index 00000000..b574bc29 Binary files /dev/null and b/Installer/vi_files/Images/secure-wep.png differ diff --git a/Installer/vi_files/Images/secure-wep_dead.png b/Installer/vi_files/Images/secure-wep_dead.png new file mode 100644 index 00000000..cf9a560b Binary files /dev/null and b/Installer/vi_files/Images/secure-wep_dead.png differ diff --git a/Installer/vi_files/Images/secure.png b/Installer/vi_files/Images/secure.png new file mode 100644 index 00000000..744df795 Binary files /dev/null and b/Installer/vi_files/Images/secure.png differ diff --git a/Installer/vi_files/Images/secure_dead.png b/Installer/vi_files/Images/secure_dead.png new file mode 100644 index 00000000..291c8905 Binary files /dev/null and b/Installer/vi_files/Images/secure_dead.png differ diff --git a/Installer/vi_files/Languages/Brazilian_Portuguese.ini b/Installer/vi_files/Languages/Brazilian_Portuguese.ini new file mode 100644 index 00000000..acc8cd19 --- /dev/null +++ b/Installer/vi_files/Languages/Brazilian_Portuguese.ini @@ -0,0 +1,282 @@ +[Info] +Author=celsmk +Date=2009/01/03 +Description=Brazilian Poruguese Searchwords. Brazilian Portuguese Text. +WindowsLanguageCode=pt_BR + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Tipo de rede +Authentication=Autenticao +Encryption=Criptografia +Signal=Sinal +RadioType=Tipo de Radiofreqncia +Channel=Canal +BasicRates=Taxas Bsicas +OtherRates=Outras Taxas +Open=Abrir +None=Nenhum +WEP=WEP +Infrastructure=Infraestrutura +Adhoc=Adhoc + +[Column_Names] +Column_Line=# +Column_Active=Atividade +Column_SSID=SSID +Column_BSSID=Endereo MAC +Column_Manufacturer=Fabricante +Column_Signal=Sinal +Column_Authentication=Autenticao +Column_Encryption=Criptografia +Column_RadioType=Tipo de Rdio +Column_Channel=Canal +Column_Latitude=Latitude +Column_Longitude=Longitude +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) +Column_BasicTransferRates=Taxas Bsicas de Transferncia +Column_OtherTransferRates=Outras Taxas de Transferncia +Column_FirstActive=Primeira Atividade +Column_LastActive=ltima Atualizao +Column_NetworkType=Tipo de rede +Column_Label=Etiqueta + +[GuiText] +Ok=&Ok +Cancel=C&ancelar +Apply=&Aplicar +Browse=&Navegar +File=&Arquivo +SaveAsTXT=Salvar TXT +SaveAsVS1=Salvar como VS1 +SaveAsVSZ=Salvar como VSZ +ImportFromTXT=Importar TXT / VS1 +ImportFromVSZ=Importar VSZ +Exit=&Sair +Edit=&Editar +ClearAll=Limpar Tudo +Cut=Recortar +Copy=Copiar +Paste=Colar +Delete=Apagar +Select=Selecionar +SelectAll=Selecionar Tudo +Options=&Opes +AutoSort=Auto-ordenar +SortTree=Ordenar rvore (Demorado) +PlaySound=Soar a nova AP +AddAPsToTop=Acrescentar novas APs ao topo +Extra=Ex&tra +ScanAPs=&Scan +StopScanAps=&Parar +UseGPS=Usar &GPS +StopGPS=Stop &GPS +Settings=A&justes +GpsSettings=Ajustes de GPS +SetLanguage=Definir Localizao +SetSearchWords=Definir palavras de busca do Netsh +Export=Ex&portar +ExportToKML=Exportar para KML +ExportToTXT=Exportar para TXT +ExportToVS1=Exportar para VS1 +ExportToNS1=Exportar para NS1 +PhilsPHPgraph=Visualizar grfico (Phil's PHP version) +PhilsWDB=Phil's WiFiDB (Alpha) +RefreshLoopTime=Perodo Atualizao de Redes (ms) +ActualLoopTime=Interv. Loop atual +Longitude=Longitude +Latitude=Latitude +ActiveAPs=APs Ativas +Graph1=Grfico&1 +Graph2=Grfico&2 +NoGraph=&Nenhum Grfico +SetMacLabel=Definir Etiqueta pelo MAC +SetMacManu=Definir Fabricante pelo MAC +Active=Ativo +Dead=Inativo +AddNewLabel=Adicionar Nova Etiqueta +RemoveLabel=Remover Etiqueta Selecionada +EditLabel=Editar Etiqueta Selecionada +AddNewMan=Acrescentar Novo Fabricante +RemoveMan=Remover Fabricante Selecionado +EditMan=Editar Fabricante Selecionado +NewMac=Novo End. Mac +NewMan=Novo Fabricante +NewLabel=Nova Etiqueta +Save=Salvar? +SaveQuestion=Dados alterados. Gostaria de salvar? +GpsDetails=Detalhes do GPS +Quality=Qualidade +Time=Tempo +NumberOfSatalites=Nmero de Satelites +HorizontalDilutionPosition=Diluio Horizontal +Altitude=Altitude +HeightOfGeoid=Altura do Geoide +Status=Status +Date=Data +SpeedInKnots=Velocidade (ns) +SpeedInMPH=Velocidade (mph) +SpeedInKmh=Velocidade (km/h) +TrackAngle=Trilha +Close=Fechar +ConnectToWindowName=Conectar-se a uma rede +RefreshingNetworks=Atualizando redes +Start=Iniciar +Stop=Parar +ConnectToWindowTitle=Ttulo da janela "Conectar a uma rede": +RefreshTime=Periodo de Atualizao +SetColumnWidths=Definir larg.colunas +Enable=Habilita +Disable=Desabilita +Checked=Selecionada +UnChecked=De-selecionada +Unknown=Desconhecido + +Restart=Reiniciar +RestartMsg=Reiniciar Vistumbler p/ mudanca de idioma tenha efeito +NoSignalHistory=Histrico de sinal no encontrado, verifique se "netsh search words" esto corretas +NoApSelected=Voc no selecionou um AP +UseNetcomm=Usar Netcomm OCX (mais estvel) - x32 +UseCommMG=Usar CommMG (menos estvel) - x32 - x64 +SignalHistory=Histrico de Sinal +AutoSortEvery=Auto Sort a cada +Seconds=Segundos +Ascending=Crescente +Decending=Decrescente +AutoSave=Auto-Salvamento +AutoSaveEvery=Auto-Salvar a cada +DelAutoSaveOnExit=Apagar arquivo AutoSave ao sair +OpenSaveFolder=Abrir Local Salvam. +SortBy=Ordenar por +SortDirection=Direo de ordenao +Auto=Auto +Misc=Misc +GPS=GPS +Labels=Etiquetas +Manufacturers=Fabricantes +Columns=Colunas +Language=Localizao +SearchWords=SearchWords +VistumblerSettings=Ajustes Vistumbler +LanguageAuthor=Autor Localizao +LanguageDate=Data Localizao +LanguageDescription=Descrio da Localizao +Description=Descrio +Progress=Progresso +LinesMin=Linhas/Min +NewAPs=Novas APs +NewGIDs=Novos GIDs +Minutes=Minutos +LineTotal=Linha/Total +EstimatedTimeRemaining=Tempo Restante Estimado +Ready=Pronto +Done=Executado +VistumblerSaveDirectory=Diretrio Salv. Vistumbler +VistumblerAutoSaveDirectory=Diretrio Auto-Salv. Vistumbler +VistumblerKmlSaveDirectory=Diretrio Salv. Vistumbler KML +BackgroundColor=Cor de Fundo +ControlColor=Cor Controle +BgFontColor=Cor Fonte +ConFontColor=Cor Fonte Controle +NetshMsg=Esta seo permite alterar as palavras utilizadas pelo Vistumbler para pesquisar netsh.Altere para as palavras apropriadas para sua verso do Windows. Execute "netsh wlan show networks mode = bssid" para encontrar as palavras apropriadas. +PHPgraphing=Grficos PHP +ComInterface=Interface COM +ComSettings=Ajustes COM +Com=COM +Baud=Baud +GPSFormat=Formato GPS +HideOtherGpsColumns=Ocultar outras colunas GPS +ImportLanguageFile=Importar Arquivo Localizao +AutoKml=Auto KML +GoogleEarthEXE=Google Earth EXE +AutoSaveKmlEvery=Auto-SalvarKML a cada +SavedAs=Salvar como +Overwrite=Sobre-escrever +InstallNetcommOCX=Instalar Netcomm OCX +NoFileSaved=Nenhum arquivo foi salvo +NoApsWithGps=Nenhum Access Point com coordenadas GPS foi encontrado. +MacExistsOverwriteIt=Uma entrada com este endereo MAC j existe. Deseja sobre-escrev-la? +SavingLine=Saving Line +DisplayDebug=Debug - Exibir Funes +GpsCompass=Bssola GPS +OpenKmlNetLink=Abrir KML NetworkLink +GraphDeadTime=Tempo Grfico Inativo +ActiveRefreshTime=Perodo Atual.Ativo +DeadRefreshTime=Perodo Atual.Inativo +GpsRefrshTime=Perodo Atual.GPS +FlyToSettings=Ir para Ajustes + +FlyToCurrentGps=Ir para posio atual GPS +AltitudeMode=Modo Altitude +Range=Alcance +Heading=Proa +Tilt=Tilt +AutoOpenNetworkLink=Abrir KML Network Link Automticamente +SpeakSignal=Falar Nvel de Sinal +SpeakUseVisSounds=Usar arquivos de Som do Vistumbler +SpeakUseSapi=Usar API Microsoft Sound +SpeakSayPercent=Fale "Percent" aps sinal +GpsTrackTime=Perodo Atual.Trilha +SaveAllGpsData=Salvar dados de GPS quando nenhuma AP estiver ativa +None=Nenhum +Even=Par +Odd=Impar +Mark=Marca +Space=Espao +ExitSaveDb=Sair (Salvar DB) +StopBit=Stop Bit +Parity=Paridade +DataBit=Bits de Dados +Update=Atualizar +UpdateMsg=Atualizao encontrada. Deseja atualizar vistumbler? +Recover=Recuperar +RecoverMsg=DB antigo encontrado. Gostaria de recuper-lo? +SelectConnectedAP=Selecionar AP conectada +VistumblerHome=Home Vistumbler +VistumblerForum=Forum Vistumbler +VistumblerWiki=Wiki Vistumbler +CheckForUpdates=Procurar Atualizaes +SelectWhatToCopy=Selecionar o que deseja copiar +Default=Default +PlayMidiSounds=Tocar MIDI para todas APs ativas +Interface=Interface +LanguageCode=Cdigo de Localizao +AutoCheckUpdates=Procurar por atualizaes Automaticamente +CheckBetaUpdates=Procurar por atualizaes Beta +GuessSearchwords=Encontrar Netsh Searchwords +Help=Ajuda +ErrorScanningNetsh=Error scanning netsh +GpsErrorBufferEmpty=Erro GPS. Buffer vazio por mais do que 10 segundos. GPS est provavelmente desconectado. GPS est parado +GpsErrorStopped=Erro GPS. GPS foi parado +ShowSignalDB=Exibir dB do Sinal (Estimado) +SortingList=Lista de Ordenao +Loading=Carregando +MapOpenNetworks=Mapear Redes Abertas +MapWepNetworks=Mapear Redes WEP +MapSecureNetworks=Mapear Redes Seguras +DrawTrack=Draw Track +UseLocalImages=Utilizar Imagens Locais +MIDI=MIDI +MidiInstrumentNumber=# Intrumento MIDI +MidiPlayTime=Tempo Reproduo MIDI +SpeakRefreshTime=Perodo Atual.Fala +Information=Informao +AddedGuessedSearchwords=netsh searchwords encontradas. Searchwords para Open, None, WEP, Infrustructure, e Adhoc precisaro ser adicionadas manualmente +SortingTreeview=Ordenando Treeview +Recovering=Recuperando +VistumblerFile=Arquivo Vistumbler +NetstumblerTxtFile=Arquivo TXT Netstumbler +ErrorOpeningGpsPort=Erro ao abrir porta GPS +SecondsSinceGpsUpdate=Segundos desde atualizao GPS +SavingGID=Salvando GID +SavingHistID=Salvando HistID +UpdateFound=Atualizao encontrada. Gostaria de atualizar vistumbler? +NoUpdates=Nenhuma atualizao disponvel. +NoActiveApFound=Nenhuma AP ativa encontrada +VistumblerDonate=Doar +VistumblerStore=Loja +SupportVistumbler=*Apoie Vistumbler* \ No newline at end of file diff --git a/Installer/vi_files/Languages/Bulgarian.ini b/Installer/vi_files/Languages/Bulgarian.ini new file mode 100644 index 00000000..49d0a6d4 --- /dev/null +++ b/Installer/vi_files/Languages/Bulgarian.ini @@ -0,0 +1,343 @@ +[Info] +Author= +Date=2010/04/24 +Description= +WindowsLanguageCode=bg_BG + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Network type +Authentication=Authentication +Encryption=Encryption +Signal=Signal +RadioType=Radio Type +Channel=Channel +BasicRates=Basic rates (Mbps) +OtherRates=Other rates (Mbps) +Open= +None= +WEP=WEP +Infrastructure= +Adhoc=- +Cipher=Cipher + +[Column_Names] +Column_Line=# +Column_Active= +Column_SSID=SSID +Column_BSSID= +Column_Manufacturer= +Column_Signal= +Column_Authentication= +Column_Encryption= +Column_RadioType= +Column_Channel= +Column_Latitude= +Column_Longitude= +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) +Column_BasicTransferRates= +Column_OtherTransferRates= +Column_FirstActive= +Column_LastActive= +Column_NetworkType= +Column_Label= + +[GuiText] +Ok=& +Cancel=& +Apply=& +Browse=& +File=& +SaveAsTXT= TXT +SaveAsVS1= VS1 +SaveAsVSZ= VSZ +ImportFromTXT= TXT / VS1 +ImportFromVSZ= VSZ +Exit=& +ExitSaveDb=& ( ) +Edit=& +ClearAll= +Cut= +Copy= +Paste= +Delete= +Select= +SelectAll= +Options=& +AutoSort= +SortTree= () +PlaySound= +AddAPsToTop= - +Extra= +ScanAPs= +StopScanAps= +UseGPS=. GPS +StopGPS= GPS +Settings= +GpsSettings=GPS +SetLanguage= +SetSearchWords= Netsh +Export= +ExportToTXT= TXT +ExportToVS1= VS1 +ExportToCSV= CSV +ExportToKML= KML +ExportToGPX= GPX +ExportToNS1= NS1 +PhilsPHPgraph= +PhilsWDB=WiFiDB +RefreshLoopTime= () +ActualLoopTime= +Longitude=. +Latitude=. +ActiveAPs= +Graph1= 1 +Graph2= 2 +NoGraph= +SetMacLabel= Mac +SetMacManu= Mac +Active= +Dead= +AddNewLabel= +RemoveLabel= . +EditLabel= . +AddNewMan= +RemoveMan= . +EditMan= . +NewMac= +NewMan= +NewLabel= +Save=? +SaveQuestion= . ? +GpsDetails=GPS +GpsCompass=GPS +Quality= +Time= +NumberOfSatalites= +HorizontalDilutionPosition= +Altitude=. +HeightOfGeoid= +Status= +Date= +SpeedInKnots=(knots) +SpeedInMPH=(/) +SpeedInKmh=(/) +TrackAngle= +Close= +Start= +Stop= +RefreshingNetworks= +RefreshTime= +SetColumnWidths= +Enable= +Disable= +Checked= +UnChecked= +Unknown= +Restart= +RestartMsg= Vistumbler +NoSignalHistory= , netsh +NoApSelected= +UseNetcomm= Netcomm OCX (-) - x32 +UseCommMG= CommMG (-) - x32 - x64 +SignalHistory= +AutoSortEvery= +Seconds= +Ascending=- +Decending=- +AutoSave= +AutoSaveEvery= +DelAutoSaveOnExit= +OpenSaveFolder= +SortBy= +SortDirection= +Auto= +Misc= +GPS=GPS +Labels= +Manufacturers= +Columns= +Language= +SearchWords= +VistumblerSettings= Vistumbler +LanguageAuthor= +LanguageDate= +LanguageDescription= +Description= +Progress= +LinesMin=/. +NewAPs= +NewGIDs= GID +Minutes= +LineTotal=/ +EstimatedTimeRemaining= +Ready= +Done= +VistumblerSaveDirectory= +VistumblerAutoSaveDirectory= +VistumblerKmlSaveDirectory= KML +BackgroundColor= +ControlColor= +BgFontColor= +ConFontColor= +NetshMsg= Vistumbler netsh. Windows. "netsh wlan show networks mode = bssid", . +PHPgraphing=PHP +ComInterface=COM +ComSettings=COM +Com=COM +Baud=Baud +GPSFormat=GPS +HideOtherGpsColumns= GPS +ImportLanguageFile= +AutoKml= KML +GoogleEarthEXE=Google Earth EXE +AutoSaveKmlEvery= KML +SavedAs= +Overwrite= +InstallNetcommOCX= Netcomm OCX +NoFileSaved= +NoApsWithGps= . +MacExistsOverwriteIt= MAC . ? +SavingLine= +DisplayDebug= - +GraphDeadTime= +OpenKmlNetLink= KML NetworkLink +ActiveRefreshTime= +DeadRefreshTime= +GpsRefrshTime= GPS +FlyToSettings= +FlyToCurrentGps= +AltitudeMode=Altitude +Range= +Heading= +Tilt= +AutoOpenNetworkLink= KML Network Link +SpeakSignal= +SpeakUseVisSounds= Vistumbler +SpeakUseSapi= Microsoft Sound API +SpeakSayPercent= "Percent" +GpsTrackTime= +SaveAllGpsData= GPS , +None= +Even= +Odd= +Mark= +Space=Space +StopBit= +Parity= +DataBit= +Update= +UpdateMsg= . ? +Recover= +RecoverMsg= . ? +SelectConnectedAP= +VistumblerHome=Vistumbler +VistumblerForum=Vistumbler +VistumblerWiki=Vistumbler Wiki +CheckForUpdates= +SelectWhatToCopy= +Default= +PlayMidiSounds= MIDI +Interface= +LanguageCode= +AutoCheckUpdates= +CheckBetaUpdates= +GuessSearchwords= Netsh +Help= +ErrorScanningNetsh= netsh +GpsErrorBufferEmpty=GPS . 10 . GPS- . +GpsErrorStopped=GPS . GPS +ShowSignalDB= dB +SortingList= +Loading= +MapOpenNetworks= +MapWepNetworks= WEP +MapSecureNetworks= +DrawTrack= +UseLocalImages= +MIDI=MIDI +MidiInstrumentNumber=MIDI # +MidiPlayTime= MIDI +SpeakRefreshTime= +Information= +AddedGuessedSearchwords= netsh . Open, None, WEP, Infrustructure Adhoc +SortingTreeview= +Recovering= +VistumblerFile=Vistumbler +NetstumblerTxtFile=Netstumbler TXT +ErrorOpeningGpsPort= GPS +SecondsSinceGpsUpdate= . GPS +SavingGID= GID +SavingHistID= HistID +NoUpdates= +NoActiveApFound= +VistumblerDonate= +VistumblerStore= +SupportVistumbler=* Vistumbler* +UseNativeWifi= Wifi (No BSSID, CHAN, OTX, BTX, or RADTYPE) +FilterMsg= (*) wildcard. (,). (-) . +SetFilters= +Filters= +NoAdaptersFound= +RecoveringMDB= MDB +FixingGpsTableDates= GPS +FixingHistTableDates= HIST +VistumblerNeedsToRestart=Vistumbler . Vistumbler +AddingApsIntoList= +GoogleEarthDoesNotExist=Google Earth +AutoKmlIsNotStarted=AutoKML . ? +UseKernel32= Kernel32 - x32 - x64 +UnableToGuessSearchwords=Vistumbler +Filtered= +SelectedAP= +AllAPs= +FilteredAPs= +FixingGpsTableTimes= GPS +ImportFolder= +DeleteSelected= +RecoverSelected= +NewSession= +Size= +NoMdbSelected= MDB +LocateInWiFiDB= WiFiDB +AutoWiFiDbGpsLocate= WiFiDB GPS +AutoSelectConnectedAP= +Experimental= +UploadDataToWiFiDB= WiFiDB +Error= +Color= +PhilsWifiTools=Phil's WiFi Tools +Updating= +Downloaded= +Retry= +Ignore= +Yes= +No= +LoadingVersionsFile= +UsingLocalFile= +DownloadingBetaVerFile= +DownloadingVerFile= +VerFileDownloaded= +ErrDownloadVerFile= +NewFile= +UpdatedFile= +ErrCopyingFile= +ErrReplacaingOldFile= +ErrDownloadingNewFile= +NoChangeInFile= +DeletedFile= +ErrDeletingFile= +ErrWouldYouLikeToRetryUpdate= . ? +DoneWouldYouLikeToLoadVistumbler=. Vistumbler? +Import=& +View=& +AddRemFilters=/ +NoFilterSelected= +AddFilter= +EditFilter= +DeleteFilter= +TimeBeforeMarkedDead= diff --git a/Installer/vi_files/Languages/Chinese_Traditional.ini b/Installer/vi_files/Languages/Chinese_Traditional.ini new file mode 100644 index 00000000..84a06e58 --- /dev/null +++ b/Installer/vi_files/Languages/Chinese_Traditional.ini @@ -0,0 +1,369 @@ +[Info] +Author=nim311 +Date=2011/11/25 +Description=c餤y(Beta)C +WindowsLanguageCode=zh_TW + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Network type +Authentication= +Encryption=[K +Signal=Signal +RadioType=Radio Type +Channel=Channel +BasicRates=򥻳tv +OtherRates=Ltv +Open=Open +None=S +WEP=WEP +Infrastructure=Infrastructure +Adhoc=Adhoc +Cipher=Cipher + +[Column_Names] +Column_Line=# +Column_Active=Active +Column_SSID=SSID +Column_BSSID=Mac} +Column_Manufacturer=sy +Column_Signal=Signal +Column_Authentication= +Column_Encryption=[K +Column_RadioType=Radio Type +Column_Channel=Channel +Column_Latitude=n +Column_Longitude=g +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) +Column_BasicTransferRates=򥻶ǿtv +Column_OtherTransferRates=Lǿtv +Column_FirstActive=First Active +Column_LastActive=Last Updated +Column_NetworkType= +Column_Label=Label +Column_HighSignal=High Signal + +[GuiText] +Ok=&Tw +Cancel=& +Apply=&M +Browse=&s +File=&ɮ +SaveAsTXT=Save As TXT +SaveAsVS1=Save As VS1 +SaveAsVSZ=Save As VSZ +ImportFromTXT=Import From TXT / VS1 +ImportFromVSZ=Import From VSZ +Exit=E&xit +ExitSaveDb=Exit (Save DB) +Edit=&s +ClearAll=M +Cut=ŤU +Copy=ƻs +Paste=KW +Delete=Delete +Select= +SelectAll= +Options=&Options +AutoSort=Auto Sort +SortTree=Sort Treeview(Slow) +PlaySound=Play sound on new AP +AddAPsToTop=Add new APs to top +Extra=&Extra +ScanAPs=&Scan APs +StopScanAps=&Stop +UseGPS=&ϥGPS +StopGPS=&GPS +Settings=&]w +GpsSettings=GPS]w +SetLanguage=]wy +SetSearchWords=Set Netsh Search Words +Export=&ץX +ExportToTXT=ץXTXT +ExportToVS1=ץXVS1 +ExportToCSV=ץXCSV +ExportToKML=ץXKML +ExportToGPX=ץXGPX +ExportToNS1=ץXNS1 +ExportToVSZ=ץXVSZ +RefreshLoopTime=Refresh loop time(ms) +ActualLoopTime=Actual loop time +Longitude=g +Latitude=n +ActiveAPs=Active APs +Graph1=Graph&1 +Graph2=Graph&2 +NoGraph=&No Graph +SetMacLabel=Set Labels by Mac +SetMacManu=Set Manufactures by Mac +Active=Active +Dead=Dead +AddNewLabel=K[s +RemoveLabel=Rw +EditLabel=sw +AddNewMan=K[ssy +RemoveMan=Rwsy +EditMan=swsy +NewMac=sMAC} +NewMan=ssy +NewLabel=s +Save=xs? +SaveQuestion=ƾڤwܧCAQOs? +GpsDetails=GPS Details +GpsCompass=Gps Compass +Quality=Quality +Time=Time +NumberOfSatalites=Number of Satalites +HorizontalDilutionPosition=Horizontal Dilution +Altitude=Altitude +HeightOfGeoid=Height of Geoid +Status=A +Date=Date +SpeedInKnots=Speed(knots) +SpeedInMPH=Speed(MPH) +SpeedInKmh=Speed(km/h) +TrackAngle=Track Angle +Close= +Start=}l +Stop= +RefreshingNetworks=Auto Refresh Networks +RefreshTime=Refresh time +SetColumnWidths=Set Column Widths +Enable=ҥ +Disable= +Checked=ˬd +UnChecked=UnChecked +Unknown=Unknown +Restart=Restart +RestartMsg=ЭsҰVistumblerϷsyͮ +NoSignalHistory=No signal history found, check to make sure your netsh search words are correct +NoApSelected=You did not select an access point +UseNetcomm=ϥNetcomm OCX(íw)-x32 +UseCommMG=ϥCommMG(íw)-x32/x64 +SignalHistory=Signal History +AutoSortEvery=Auto Sort Every +Seconds= +Ascending=W +Decending= +AutoSave=۰xs +AutoSaveEvery=C۰xs +DelAutoSaveOnExit=bhXɧR۰xsɮ +OpenSaveFolder=}xsƧ +SortBy=Sort By +SortDirection=ƧǤV +Auto=Auto +Misc=Misc +GPS=GPS +Labels= +Manufacturers=sy +Columns=Columns +Language=y +SearchWords=SearchWords +VistumblerSettings=]w +LanguageAuthor=y@ +LanguageDate=y +LanguageDescription=yyz +Description=yz +Progress=Progress +LinesMin=Lines/Min +NewAPs=New APs +NewGIDs=New GIDs +Minutes=Minutes +LineTotal=Line/Total +EstimatedTimeRemaining=pѾlɶ +Ready=Ready +Done= +VistumblerSaveDirectory=Vistumblerxsؿ +VistumblerAutoSaveDirectory=Vistumbler۰xsؿ +VistumblerKmlSaveDirectory=Vistumbler KMLxsؿ +BackgroundColor=IC +ControlColor=Control Color +BgFontColor=rC +ConFontColor=Control Font Color +NetshMsg=This section allows you to change the words Vistumbler uses to search netsh. Change to the proper words for you version of windows. Run "netsh wlan show networks mode = bssid" to find the proper words. +PHPgraphing=PHP Graphing +ComInterface=Com Interface +ComSettings=Com]w +Com=Com +Baud=Baud +GPSFormat=GPS榡 +HideOtherGpsColumns=èLGPS Columns +ImportLanguageFile=פJy +AutoKml=Auto KML +GoogleEarthEXE=Google Earth EXE +AutoSaveKmlEvery=C۰xsKML +SavedAs=Saved As +Overwrite=л\ +InstallNetcommOCX=wNetcomm OCX +NoFileSaved=No file has been saved +NoApsWithGps=No access points found with gps coordinates. +MacExistsOverwriteIt=A entry for this mac address already exists. would you like to overwrite it? +SavingLine=Saving Line +Debug=Debug +DisplayDebug=ܥ\ +DisplayDebugCom=COM~ +GraphDeadTime=Graph Dead Time +OpenKmlNetLink=Open KML NetworkLink +ActiveRefreshTime=Active Refresh Time +DeadRefreshTime=Dead Refresh Time +GpsRefrshTime=GPSsɶ +FlyToSettings=Fly To Settings +FlyToCurrentGps=Fly to current gps position +AltitudeMode=Altitude Mode +Range=d +Heading=Heading +Tilt=Tilt +AutoOpenNetworkLink=۰ʶ}_KML챵 +SpeakSignal=Speak Signal +SpeakUseVisSounds=Use Vistumbler Sound Files +SpeakUseSapi=Use Microsoft Sound API +SpeakSayPercent=Say "Percent" after signal +GpsTrackTime=Track Refresh Time +SaveAllGpsData=Save GPS data when no APs are active +None=None +Even=Even +Odd=Odd +Mark=Mark +Space=Space +StopBit=Stop Bit +Parity=Parity +DataBit=Data Bit +Update=s +UpdateMsg=o{sCzQsVistumbler +Recover=Recover +RecoverMsg=Old DB found. Would you like to recover it? +SelectConnectedAP=Select Connected AP +VistumblerHome= +VistumblerForum=׾ +VistumblerWiki=Wiki +CheckForUpdates=ˬds +SelectWhatToCopy=Select what you want to copy +Default=w] +PlayMidiSounds=Play MIDI sounds for all active APs +Interface=Interface +LanguageCode=yNX +AutoCheckUpdates=۰ˬds +CheckBetaUpdates=ˬdժs +GuessSearchwords=Guess Netsh Searchwords +Help= +ErrorScanningNetsh=Error scanning netsh +GpsErrorBufferEmpty=GPS~CwİϪŶWL 10CGPS was probrably disconnected. w +GpsErrorStopped=GPS~CGPSw +ShowSignalDB=Show Signal dB (Estimated) +SortingList=ƧǦW +Loading=J +MapOpenNetworks=OPENa +MapWepNetworks=WEPa +MapSecureNetworks=wa +DrawTrack=Draw Track +UseLocalImages=ϥΥaϤ +MIDI=MIDI +MidiInstrumentNumber=MIDI Instrument # +MidiPlayTime=MIDI Play Time +SpeakRefreshTime=Speak Refresh Time +Information=Information +AddedGuessedSearchwords=Added guessed netsh searchwords. Searchwords for Open, None, WEP, Infrustructure, and Adhoc will still need to be done manually +SortingTreeview=ƧǾ𪬹 +Recovering=Recovering +ErrorOpeningGpsPort=Error opening GPS port +SecondsSinceGpsUpdate=Seconds Since GPS Update +SavingGID=Saving GID +SavingHistID=Saving HistID +NoUpdates=SsAvalible +NoActiveApFound=No Active AP found +VistumblerDonate= +VistumblerStore=ө +SupportVistumbler=Support +UseNativeWifi=ϥNative Wifi(S BSSID, CHAN, OTX, BTX, or RADTYPE) +FilterMsg=Use asterik(*)" as wildcard. Seperate multiple filters with a comma(,). Use a dash(-) for ranges. +SetFilters=]wzᄍ +Filters=zᄍ +NoAdaptersFound=No Adapters Found +RecoveringMDB=Recovering MDB +FixingGpsTableDates=Fixing GPS table date(s) +FixingHistTableDates=Fixing HIST table date(s) +VistumblerNeedsToRestart=VistumblerݭnsҰʡCVistumbler{bYN +AddingApsIntoList=Adding new APs into list +GoogleEarthDoesNotExist=Google earth file does not exist or is set wrong in the AutoKML settings +AutoKmlIsNotStarted=AutoKML|_ʡCAQ}_ܡH +UseKernel32=ϥKernel32-x32/x64 +UnableToGuessSearchwords=Vistumbler was unable to guess searchwords +Filtered=zᄍ +SelectedAP=Selected AP +AllAPs=All APs +FilteredAPs=Filtered APs +FixingGpsTableTimes=Fixing GPS table times(s) +ImportFolder=פJƧ +DeleteSelected=Delete Selected +RecoverSelected=Recover Selected +NewSession=New Session +Size=Size +NoMdbSelected=No MDB Selected +LocateInWiFiDB=Locate Position in WiFiDB +AutoWiFiDbGpsLocate=Auto WiFiDB Gps Locate +AutoSelectConnectedAP=Auto Select Connected AP +Experimental= +UploadDataToWiFiDB=ƾڤWǦWiFiDB +Error=~ +Updating=s +Downloaded=U +Retry= +Ignore= +Yes=O +No=_ +LoadingVersionsFile=Jɮת +UsingLocalFile=ϥΥa +DownloadingBetaVerFile=Uժɮ +DownloadingVerFile=Downloading versions file +VerFileDownloaded=Versions file downloaded +ErrDownloadVerFile=Error downloading versions file +NewFile=New file +UpdatedFile=Updated File +ErrCopyingFile=Error copying file +ErrReplacaingOldFile=Error replacing old file (Possibly in use) +ErrDownloadingNewFile=Error downloading new file +NoChangeInFile=No change in file +DeletedFile=Deleted file +ErrDeletingFile=Error deleting file +ErrWouldYouLikeToRetryUpdate=Error. Would you like to retry the update? +DoneWouldYouLikeToLoadVistumbler=CAQJVistumblerܡH +Color=Color +AddRemFilters=Add/Remove Filters +NoFilterSelected=No filter selected. +Import=&פJ +View=&View +AddFilter=Add Filter +EditFilter=Edit Filter +DeleteFilter=Delete Filter +TimeBeforeMarkedDead=Time to wait before marking AP dead (s) +FilterNameRequired=Filter Name is required +UpdateManufacturers=Update Manufacturers +FixHistSignals=Fixing Missing Hist Table Signal(s) +VistumblerFile=Vistumbler file +DetailedFile=Detailed Comma Delimited file +NetstumblerTxtFile=Netstumbler wi-scan file +WardriveDb3File=Wardrive-android file +AutoScanApsOnLaunch=Auto Scan APs on launch +RefreshInterfaces=Refresh Interfaces +NoAps=No access points. +AutoSelectHighSigAP=Auto Select Highest Signal AP +Sound=Sound +OncePerLoop=Once per loop +OncePerAP=Once per ap +OncePerAPwSound=Once per ap with volume based on signal +PhilsPHPgraph=Graph Selected AP Signal to Image +PhilsWDB=WiFiDB URL +PhilsWdbLocate=WifiDB Locate URL +PhilsWifiTools=Phil's WiFi Tools +AutoWiFiDbUploadAps=Auto WiFiDB Upload Active AP +WifiDB=WifiDB +Warning=Warning +WifiDBLocateWarning=This feature sends active access point information to the WifiDB API URL specified in the Vistumbler WifiDB Settings. If you do not want to send data to the wifidb, do not enable this feature. Do you want to continue to enable this feature? +WifiDBAutoUploadWarning=This feature sends active access point information to the WifiDB API URL specified in the Vistumbler WifiDB Settings. If you do not want to send data to the wifidb, do not enable this feature. Do you want to continue to enable this feature? +WifiDBOpenLiveAPWebpage=Open WifiDB Live AP Webpage +WifiDBOpenMainWebpage=Open WifiDB Main Webpage +FilePath=File Path diff --git a/Installer/vi_files/Languages/Czech.ini b/Installer/vi_files/Languages/Czech.ini new file mode 100644 index 00000000..c661d46e --- /dev/null +++ b/Installer/vi_files/Languages/Czech.ini @@ -0,0 +1,318 @@ +[Info] +Author=PS72 +Date=2010/01/31 +Description=esk SearchWords. esk Text. esk jazyk. aktualizace 2010/01/31 +WindowsLanguageCode=cs_CZ + + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Typ st +Authentication=Ovovn +Encryption=ifrovn +Signal=Signl +RadioType=Typ zazen +Channel=Kanl +BasicRates=Zkladn rychlosti +OtherRates=Jin rychlosti +Open=Oteven +None=dn +WEP=WEP +Infrastructure=Infrastructure +Adhoc=Adhoc +Cipher=Cipher + +[Column_Names] +Column_Line=# +Column_Active=Aktivita +Column_SSID=SSID +Column_BSSID=Mac Adresa +Column_Manufacturer=Vrobce +Column_Signal=Signl +Column_Authentication=Ovovn +Column_Encryption=ifrovn +Column_RadioType=Typ Zazen +Column_Channel=Kanl +Column_Latitude=Zempis. ka +Column_Longitude=Zempis. dlka +Column_BasicTransferRates=Zkladn rychlosti +Column_OtherTransferRates=Jin rychlosti +Column_FirstActive=Prvn aktivita +Column_LastActive=Posledn aktivita +Column_NetworkType=Typ st +Column_Label=Popis +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) + +[GuiText] +Ok=&Ok +Cancel=K&onec +File=&Soubor +SaveAsTXT=Uloit jako &TXT +ImportFromTXT=Importovat z &TXT +Exit=K&onec +Edit=E&ditovat +Cut=Vyjmout +Copy=Koprovat +Paste=Vloit +Delete=Smazat +Select=Vybrat +SelectAll=Vybrat ve +Options=&Volby +AutoSort=Automaticky tdit +SortTree=Tdit seznam - (pomal pi velkm seznamu) +AddAPsToTop=Pidat nov AP na zatek +ScanAPs=&Hledat AP +StopScanAps=&Stop +UseGPS=Pout &GPS +StopGPS=Stop &GPS +Settings=N&astaven +GpsSettings=GPS nastaven +SetLanguage=Nastavit jazyk +SetSearchWords=Nastavit Netsh SearchWords (hledn vraz) +RefreshLoopTime=Obnovovac as(ms): +ActualLoopTime=Aktuln opakovac as: +Longitude=Zempis. ka: +Latitude=Zempis. dlka: +ActiveAPs=Aktivn AP: +PlaySound=Pehrt zvuk pi novm AP +Graph1=Graf&1 +Graph2=Graf&2 +NoGraph=&Bez grafu +Export=Ex&port +ExportToKML=Export do KML +ExportToTXT=Export do TXT +Extra=Ex&tra +PhilsPHPgraph=Zobrazit graf (Phil's PHP version, vyaduje pipojen k internetu) +SetMacLabel=Nastavit nzvy podle Mac +SetMacManu=Nastavit vrobce podle Mac +Active=Aktivn +Dead=Neaktivn +AddNewLabel=Pidat nov nzev do seznamu +RemoveLabel=odebrat vybran nzev ze seznamu +EditLabel=Editovat vybran nzev +AddNewMan=Pidat novho Vrobce do seznamu +RemoveMan=Odebrat vybranho Vrobce ze seznamu +EditMan=Edit vybranho Vrobce +NewMac=Nov Mac Adresa: +NewMan=Nov Vrobce: +NewLabel=Nov Nzev: +Save=Uloit? +SaveQuestion=Data byla zmnna. Chce je uloit? +PhilsMultiPHPgraph=Graf vech AP (Phil's PHP version, vyaduje pipojen k internetu) +GpsDetails=GPS Detaily +Quality=Qualita +Time=as +NumberOfSatalites=slo satelitu +HorizontalDilutionPosition=Horizontln zeslaben +Altitude=Nadmosk vka +HeightOfGeoid=Vka nad planetou +Status=Stav +Date=Datum +SpeedInKnots=Rychlost(knots) +SpeedInMPH=Rychlost(MPH) +SpeedInKmh=Rychlost(km/h) +TrackAngle=hel drhy letu +Close=zavt +ConnectToWindowName=Pipojit k sti +RefreshingNetworks=Obnovovn st +Start=Start +Stop=Stop +ConnectToWindowTitle="Pipojit k" oknu s nzvem: +RefreshTime=Obnovovac as +Enable=Zapnout +Disable=Vypnout +Checked=Zakrtnuto +UnChecked=Odkrtnuto +Restart=Restart +RestartMsg=Prosm restartujte Vistumbler pro zmnu jazyka +NoSignalHistory=dn historie signlu nenalezena, Jste si jist, e Vae netsh searchwords jsou sprvn +NoApSelected=Nevybral jsi access point +UseNetcomm=Pouit Netcomm OCX (stabilnj) - x32 +UseCommMG=Pouit CommMG (mn stabiln) - x32 - x64 +SetColumnWidths=Nastavit ku sloupc +GraphDeadTime=Graf neaktivity +Apply=&Aplikovat +Browse=&Prochzet +SaveAsVS1=Uloit jako VS1 +SaveAsVSZ=Uloit jako VSZ +ImportFromVSZ=Import z VSZ +ExitSaveDb=Konec (Uloit DB) +ClearAll=Vyistit ve +ExportToGPX=Export do GPX +ExportToNS1=Export do NS1 +ExportToVS1=Export do VS1 +ExportToCSV=Export do CSV +PhilsWDB=Phils WiFiDB (Alpha) +UploadDataToWiFiDB=Odeslat Data na WiFiDB +GpsCompass=Gps Kompas +Unknown=Neznm +Error=Chyba +SignalHistory=Historie Signlu +AutoSortEvery=Tdit automaticky Vdy +Seconds=Sekundy +Ascending=Vzestupn +Decending=Sestupn +AutoSave=Automatick uloen +AutoSaveEvery=Automatick uloen Vdy +DelAutoSaveOnExit=Smazat automaticky uloen soubor pi ukonen +OpenSaveFolder=Otevt sloku ukldn +SortBy=Tdit podle +SortDirection=Nastavit tdn +Auto=Automat +Misc=Rzn +GPS=GPS +Labels=Popisky +Manufacturers=Vrobci +Columns=Sloupce +Language=Jazyk +SearchWords=SearchWords +VistumblerSettings=Vistumbler nastaven +LanguageAuthor=Autor jazyka +LanguageDate=Datum jazyka +LanguageDescription=Jazykov popis +Description=Popis +Progress=Progress +LinesMin=Lines/Min +NewAPs=Nov AP +NewGIDs=Nov GIDs +Minutes=Minuty +LineTotal=Line/Total +EstimatedTimeRemaining=Oekvan zbvajc as +Ready=Pipraven +Done=Hotovo +VistumblerSaveDirectory=Vistumbler Adres ukldn +VistumblerAutoSaveDirectory=Vistumbler Automatick Adres ukldn +VistumblerKmlSaveDirectory=Vistumbler KML Adres ukldn +BackgroundColor=Barva pozad +ControlColor=Barva tabulky +BgFontColor=Barva Fontu +ConFontColor=Barva Fontu tabulky +TimeBeforeMarkedDead=as ped oznaenm NEAKTIVN +NetshMsg=Tato sekce povoluje zmnit vrazy, kter Vistumbler pouv na hledn netsh. Zmnte vrazy sprvn podle verze windows. Spuste "netsh wlan show networks mode = bssid" pro nalezen sprvnch vraz. +PHPgraphing=PHP Graphing +ComInterface=Com Rozhran +ComSettings=Com Nastaven +Com=Com +Baud=Baud +GPSFormat=GPS Formt +HideOtherGpsColumns=Skrt ostatn GPS sloupce +ImportLanguageFile=Importovat Jazykov soubor +AutoKml=Auto KML +GoogleEarthEXE=Google Earth EXE +AutoSaveKmlEvery=Automaticky ukldat KML vdy +SavedAs=Uloit Jako +Overwrite=Pepsat +InstallNetcommOCX=Instalovat Netcomm OCX +NoFileSaved=dn soubor nebyl uloen +NoApsWithGps=Nenalezen Access Point s GPS koordinty. +MacExistsOverwriteIt=Poloka pro tuto Mac adresu ji existuje. Chcete ji pepsat? +SavingLine=Saving Line +DisplayDebug=Debug - Zobrazit funkce +OpenKmlNetLink=Open KML NetworkLink +ActiveRefreshTime=Aktivn obnovovac as +DeadRefreshTime=Dead obnovovac as +GpsRefrshTime=Gps obnoven +FlyToSettings=Nastaven letu +FlyToCurrentGps=Lett na souasnou gps pozici +AltitudeMode=Vkov reim +Range=Rozsah +Heading=Smrov vka +Tilt=Nklon +AutoOpenNetworkLink=Automaticky Otevt KML Network Link +SpeakSignal=Vyslov Signal +SpeakUseVisSounds=Pout Vistumbler Zvuky +SpeakUseSapi=Pout Microsoft Sound API +SpeakSayPercent=Vyslovit "Percent" po signlu (anglicky) +GpsTrackTime=Pekreslen stopy +SaveAllGpsData=Uloit GPS data kdy nejsou AP aktivn +None=dn +Even=Sud +Odd=Lich +Mark=Znaka +Space=Mezera +StopBit=Stop Bit +Parity=Parity +DataBit=Data Bit +Update=Aktualizace +UpdateMsg=Aktualizace nalezena. Chcete aktualizovat vistumbler? +Recover=Obnoven +RecoverMsg=Star DB nalezena. Chcete ji obnovit? +SelectConnectedAP=Vyber pipojen AP +VistumblerHome=Vistumbler Home +VistumblerForum=Vistumbler Forum +VistumblerWiki=Vistumbler Wiki +CheckForUpdates=Zkontrolovat aktualizace +SelectWhatToCopy=Vyber co chce koprovat +Default=Default +PlayMidiSounds=Pehrvat MIDI zvuky pro vechny AP +Interface=Rozhran +LanguageCode=Kd jazyka +AutoCheckUpdates=Automaticky kontrolovat aktualizace +CheckBetaUpdates=Kontrolovat Beta Aktualizace +GuessSearchwords=Odhad Netsh Searchwords +Help=Npovda +ErrorScanningNetsh=Chyba skenovn netsh +GpsErrorBufferEmpty=GPS chyba. Vyrovnvac pam je przdn vce ne 10 sekund. GPS byl pravdpodobn odpojen. GPS bude zastaven +GpsErrorStopped=GPS chyba. GPS bude zastaven +ShowSignalDB=zobrazit Signal dB (Odhadnut) +SortingList=Tdc List +Loading=Nahrvn +MapOpenNetworks=Mapa otevench st +MapWepNetworks=Mapa WEP st +MapSecureNetworks=Mapa zabezpeench st +DrawTrack=Kreslit stopu +UseLocalImages=Pout lokln obrzky +MIDI=MIDI +MidiInstrumentNumber=MIDI Instrument # +MidiPlayTime=MIDI Play Time +SpeakRefreshTime=Vyslov obnovovac as +Information=Informace +AddedGuessedSearchwords=Pidn odhadnut netsh searchwords. Searchwords pro Open, None, WEP, Infrustructure, a Adhoc stle jet mus bt dokoneny manuln +SortingTreeview=Tdn Treeview +Recovering=Obnovovn +VistumblerFile=Vistumbler soubor +NetstumblerTxtFile=Netstumbler TXT soubor +ErrorOpeningGpsPort=Chyba otevrn GPS portu +SecondsSinceGpsUpdate=Sekundy od GPS Aktualizace +SavingGID=Ukldn GID +SavingHistID=Ukldn HistID +NoUpdates=Aktualizace nejsou dostupn +NoActiveApFound=Neaktivn AP nalezen +VistumblerDonate=Darovn +VistumblerStore=Obchod +SupportVistumbler=*Podpora Vistumbleru* +UseNativeWifi=Pout Nativn Wifi (No BSSID, CHAN, OTX, BTX, or RADTYPE) +FilterMsg=Pout hvzdiku(*)" jako zstupn znak. Oddlit vcensobn filtry s rkou(,). Pout pomlku(-) pro rozsah. +SetFilters=Nastavit filtry +Filtered=Filtry +Filters=Filtry +NoAdaptersFound=dn adaptr nebyl nalezen +RecoveringMDB=Obnovovn MDB +FixingGpsTableDates=Fixing GPS table date(s) +FixingGpsTableTimes=Fixing GPS table time(s) +FixingHistTableDates=Fixing HIST table date(s) +VistumblerNeedsToRestart=Vistumbler mus bt restartovn. Vistumbler bude nyn zaven +AddingApsIntoList=Pidn novch AP do seznamu +GoogleEarthDoesNotExist=Google earth soubor neexistuje nebo je patn nastaven v AutoKML nastaven +AutoKmlIsNotStarted=AutoKML nen prv sputn. Chcete ho spustit nyn? +UseKernel32=Pout Kernel32 - x32 - x64 +UnableToGuessSearchwords=Vistumbler nebyl schopen odhadnout searchwords +SelectedAP=Vybran AP +AllAPs=Vechny AP +FilteredAPs=Filtovan AP +ImportFolder=Import sloky +DeleteSelected=Sma vbr +RecoverSelected=Obnov vbr +NewSession=Nov relace +Size=Velikost +NoMdbSelected=dn MDB nen vybrna +LocateInWiFiDB=Lokalizovat Pozic v WiFiDB +AutoWiFiDbGpsLocate=Auto WiFiDB Gps Lokalizace +AutoSelectConnectedAP=Automaticky vybrat pipojen AP +Experimental=Experimentaln +Color=Barva +PhilsWifiTools=Phil's WiFi nstroj diff --git a/Installer/vi_files/Languages/Danish.ini b/Installer/vi_files/Languages/Danish.ini new file mode 100644 index 00000000..2153978c --- /dev/null +++ b/Installer/vi_files/Languages/Danish.ini @@ -0,0 +1,127 @@ +[Info] +Author=Anders Christensen, Modified by 64Power +Date=2008/10/01 +Description=Danske sge ord. Dansk Text. Standardsprog. + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Netvrkstype +Authentication=Godkendelse +Encryption=Kryptering +Signal=Signal +RadioType=Radiotype +Channel=Kanal +BasicRates=Grundlggende hastigheder (Mbps) +OtherRates=Andre hastigheder (Mbps) +Open=ben +None=Ingen + +[Column_Names] +Column_Line=# +Column_Active=Aktiv +Column_SSID=SSID +Column_BSSID=Mac Address +Column_Manufacturer=Fabrikant +Column_Signal=Signal +Column_Authentication=Godkendelse +Column_Encryption=Kryptering +Column_RadioType=Radio Type +Column_Channel=Kanal +Column_Latitude=Bredegrad +Column_Longitude=Lngdegrad +Column_BasicTransferRates=Grundlggende hastigheder +Column_OtherTransferRates=Andre hastigheder +Column_FirstActive=Set frste gang +Column_LastActive=Set sidst +Column_NetworkType=Netvrkstype +Column_Label=Mrke + +[GuiText] +Ok=&Ok +Cancel=Annuler + +File=Fil +SaveAsTXT=Gem som &TXT +ImportFromTXT=Importer fra &TXT +Exit=Afslut +Edit=Rediger +Cut=Klip ud +Copy=Kopier +Paste=St ind +Delete=Slet +Select=Marker +SelectAll=Marker alt +Options=Funktioner +AutoSort=Auto Sorter +SortTree=Sorter Tr - (Langsomt i store lister) +AddAPsToTop=Placer nye AP verst +ScanAPs=Sg APs +StopScanAps=&Stop +UseGPS=Start &GPS +StopGPS=Stop &GPS +Settings=Instillinger +GpsSettings=GPS Instillinger +SetLanguage=Vlg sprog +SetSearchWords=Vlg Netsh sgeord +RefreshLoopTime=Opdater loop tid(ms): +ActualLoopTime=Aktuel loop tid: +Longitude=Lngdegrad: +Latitude=Bredegrad: +ActiveAPs=Aktive APs: +PlaySound=Afspil lyd nr nyt AP findes +Graph1=Graf&1 +Graph2=Graf&2 +NoGraph=&Ingen Graf +Export=Ex&porter +ExportToKML=Exporter til KML +ExportToTXT=Exporter til TXT +Extra=Ex&tra +PhilsPHPgraph=Se Graf (Phil's PHP version) +SetMacLabel=Rediger label ud fra MAC +SetMacManu=Rediger fabrikant ud fra MAC +Active=Aktiv +Dead=Ddt +AddNewLabel=Tilfj ny label +RemoveLabel=Slet en label +EditLabel=Rediger valgt label +AddNewMan=Tilfj ny fabrikant +RemoveMan=Slet en fabrikant +EditMan=Rediger valgt fabrikant +NewMac=Ny Mac Adresse: +NewMan=Ny fabrikant: +NewLabel=Ny label: +Save=Gem? +SaveQuestion=Der er sket ndringer. Vil du gemme? +PhilsMultiPHPgraph=Vis alle APs i Graph (Phils PHP version) +GpsDetails=GPS Detaljer +Quality=Kvalitet +Time=Tid +NumberOfSatalites=Antal sateliter +HorizontalDilutionPosition=Horisontal vinkel +Altitude=Hjde +HeightOfGeoid=Hjde ovre havet +Status=Status +Date=Dato +SpeedInKnots=Hastighed(knob) +SpeedInMPH=Hastighed(MPH) +SpeedInKmh=Hastighed(KM/t) +TrackAngle=Sporings vinkel +Close=Luk +ConnectToWindowName=Forbind til netvrk +RefreshingNetworks=Opdater netvrk +Start=Start +Stop=Stop +ConnectToWindowTitle="Forbind" window title: +RefreshTime=Opdaterings tid +Enable=Sl til +Disable=Sl fra +Checked=Udfyldt +UnChecked=Ikke udfyldt +Restart=Genstart +RestartMsg=Genstart Vistumbler for at nyt sprog aktiveres. +NoSignalHistory=Intet signal fundet. Kontroller at dine NETSH sgeord er korrekte +NoApSelected=Du har ikke valgt et AP +UseNetcomm=Benyt Netcomm OCX (Mest stabilt) - x32 +UseCommMG=Benyt CommMG (Mindre stabilt) - x32 - x64 +SignalHistory=Signal historik \ No newline at end of file diff --git a/Installer/vi_files/Languages/Deutsch.ini b/Installer/vi_files/Languages/Deutsch.ini new file mode 100644 index 00000000..70bfdf4b --- /dev/null +++ b/Installer/vi_files/Languages/Deutsch.ini @@ -0,0 +1,400 @@ +[Info] +Author=gAlAX-e +Date=2012/11/13 +Description=Deutsche bersetzung fr v10.4b3 (Vorversion von FP (f.post@live.de) fr v9.0). +WindowsLanguageCode=de_DE + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Netzwerktyp +Authentication=Authentifizierung +Encryption=Verschl +Signal=Signal +RadioType=Funktyp +Channel=Kanal +BasicRates=Basisraten +OtherRates=Andere Raten +Open=Offen +None=Keine +WEP=WEP +Infrastructure=Infrastruktur +Adhoc=Adhoc +Cipher=Cipher +RSSI=RSSI + +[Column_Names] +Column_Line=# +Column_Active=Status +Column_SSID=SSID +Column_BSSID=MAC-Adresse +Column_Manufacturer=Hersteller +Column_Signal=Signal +Column_Authentication=Authentifizierung +Column_Encryption=Verschlsselung +Column_RadioType=WLAN Typ +Column_Channel=Kanal +Column_Latitude=Breitengrad +Column_Longitude=Lngengrad +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) +Column_BasicTransferRates=Basis Transfer Raten +Column_OtherTransferRates=Weitere Transfer Raten +Column_FirstActive=Erste Aktivitt +Column_LastActive=Zuletzt aktualisiert +Column_NetworkType=Netzwerk Typ +Column_Label=AP-Kennung +Column_HighSignal=Signal (max) +Column_RSSI=RSSI +Column_HighRSSI=RSSI (max) + +[GuiText] +Ok=&Ok +Cancel=&Abbrechen +Apply=&bernehmen +Browse=&Suchen +File=&Datei +SaveAsTXT=Speichern als TXT +SaveAsVS1=Speichern als VS1 +SaveAsVSZ=Speichern als VSZ +ImportFromTXT=Importieren aus TXT / VS1 +ImportFromVSZ=Importieren aus VSZ +Exit=Be&enden +ExitSaveDb=Beenden (DB speichern) +Edit=&Bearbeiten +ClearAll=Alles lschen +Cut=Ausschneiden +Copy=Kopieren +Paste=Einfgen +Delete=Lschen +Select=Markieren +SelectAll=Alles markieren +Options=&Optionen +AutoSort=Autosortierung +SortTree=Sortiere Baum - (langsam) +PlaySound=Sound spielen bei neuem AP +AddAPsToTop=Neue APs am Anfang der Liste hinzufgen +Extra=Sons&tiges +ScanAPs=&APs suchen +StopScanAps=&Stop Suche +UseGPS=Start &GPS +StopGPS=Stop GPS +Settings=&Einstellungen +GpsSettings=GPS +SetLanguage=Sprache auswhlen +SetSearchWords=Netsh Suchbegriffe definieren +Export=Ex&portieren +ExportToTXT=Exportieren nach TXT +ExportToVS1=Exportieren nach VS1 +ExportToCSV=Exportieren nach CSV +ExportToKML=Exportieren nach KML +ExportToGPX=Exportieren nach GPX +ExportToNS1=Exportieren nach NS1 +ExportToVSZ=Exportieren nach VSZ +RefreshLoopTime=Aktualisierungs Intervall (ms): +ActualLoopTime=Aktuelles Intervall +Longitude=Lngengrad +Latitude=Breitengrad +ActiveAPs=Aktive APs +Graph1=&Liniengraph +Graph2=&Balkengraph +NoGraph=&Graph aus +SetMacLabel=AP-Kennung via MAC-Adresse hinzufgen +SetMacManu=Hersteller via MAC-Adresse hinzufgen +Active=Aktiv +Dead= +AddNewLabel=Neue AP-Kennung hinzufgen +RemoveLabel=Ausgewhlte AP-Kennung entfernen +EditLabel=Ausgewhlte AP-Kennung bearbeiten +AddNewMan=Neuen Herstelller hinzufgen +RemoveMan=Ausgewhlten Hersteller entfernen +EditMan=Ausgewhlten Hersteller bearbeiten +NewMac=Neue MAC-Adresse +NewMan=Neuer Hersteller +NewLabel=Neue AP-Kennung +Save=Speichern? +SaveQuestion=Daten wurden verndert. Vor dem Beenden speichern? +GpsDetails=GPS Details +GpsCompass=GPS Kompass +Quality=Qualitt +Time=Zeit +NumberOfSatalites=Anzahl der Satelliten +HorizontalDilutionPosition=Horizontale Verringerung +Altitude=Hhe +HeightOfGeoid=Hhe des Geoid +Status=Status +Date=Datum +SpeedInKnots=Geschwindigkeit(Knoten) +SpeedInMPH=Geschwindigkeit(MPH) +SpeedInKmh=Geschwindigkeit(km/h) +TrackAngle=Track Angle +Close=Schliessen +Start=Start +Stop=Stop +RefreshingNetworks=Netzwerke aktualisieren +RefreshTime=Aktualisierung +SetColumnWidths=Spaltenbreite festlegen +Enable=Anzeigen +Disable=Verbergen +Checked=gewhlt +UnChecked=abgewhlt +Unknown=Unbekannt +Restart=Neustart +RestartMsg=Bitte starten Sie Vistumbler neu, um die Sprachdatei zu aktivieren +NoSignalHistory=Kein Signal-Verlauf gefunden. Bitte prfen Sie ob die netsh Suchbegriffe korrekt konfiguriert sind +NoApSelected=Sie haben keinen AP ausgewhlt +UseNetcomm=Netcomm OCX verwenden (stabiler) - x32 +UseCommMG=CommMG verwenden (weniger stabil) - x32 und x64 +SignalHistory=Signal-Verlauf +AutoSortEvery=Autosortierung alle +Seconds=Sekunden +Ascending=Aufsteigend +Decending=Absteigend +AutoSave=Autosicherung +AutoSaveEvery=Autosicherung alle +DelAutoSaveOnExit=Autosicherungs-Datei beim Beenden lschen +OpenSaveFolder=ffne Sicherungs-Verzeichnis +SortBy=Sortieren nach +SortDirection=Sortierrichtung +Auto=Auto +Misc=Allgemein +GPS=GPS +Labels=AP-Kennung +Manufacturers=Hersteller +Columns=Spalten +Language=Sprache +SearchWords=Suchbegriffe +VistumblerSettings=Optionen +LanguageAuthor=Author der Sprachdatei +LanguageDate=Datum der Sprachdatei +LanguageDescription=Sprach-Beschreibung +Description=Beschreibung +Progress=Fortschritt +LinesMin=Zeilen/Min. +NewAPs=Neue APs +NewGIDs=Neue GIDs +Minutes=Minuten +LineTotal=Zeile/Gesamt +EstimatedTimeRemaining=Verbleibende Zeit (geschtzt) +Ready=Bereit +Done=Fertig +VistumblerSaveDirectory=Vistumbler Sicherungs-Verzeichnis +VistumblerAutoSaveDirectory=Vistumbler Autosicherungs-Verzeichnis +VistumblerKmlSaveDirectory=Vistumbler KML Sicherungs-Verzeichnis +BackgroundColor=Hintergrundfarbe +ControlColor=Kontrollfarbe +BgFontColor=Schriftfarbe +ConFontColor=Kontroll-Schriftfarbe +NetshMsg=Dieser Abschnitt erlaubt Ihnen, die Schlsselworte zu ndern die Vistumbler verwendet um "netsh" zu durchsuchen. Tragen Sie die korrekten Begriffe fr Ihre Windows-Version ein. Fhren Sie "netsh wlan show networks mode = bssid" aus um die korrekten Begriffe zu finden. +PHPgraphing=PHP Graphen +ComInterface=Com Schnittstelle +ComSettings=Com Einstellungen +Com=Com +Baud=Baud +GPSFormat=GPS Format +HideOtherGpsColumns=Andere GPS-Spalten verstecken +ImportLanguageFile=Sprachdatei importieren +AutoKml=Auto KML +GoogleEarthEXE=Google Earth EXE-Datei +AutoSaveKmlEvery=Autospeichern KML alle +SavedAs=Speichern unter +Overwrite=berschreiben +InstallNetcommOCX=Installiere Netcomm OCX +NoFileSaved=Es wurde keine Datei gespeichert +NoApsWithGps=Keine Access Points mit GPS-Koordinaten gefunden. +MacExistsOverwriteIt=Ein Eintrag fr diese MAC-Adresse existiert bereits. Wollen Sie ihn berschreiben? +SavingLine=Speichere Zeile +Debug=Debug +DisplayDebug=Debug-Daten aufzeichnen +DisplayDebugCom=COM Fehler anzeigen +GraphDeadTime=Inaktiv-Zeiten anzeigen +OpenKmlNetLink=ffne KML Network Link +ActiveRefreshTime=Aktiv-Aktualisierung (s) +DeadRefreshTime=Inaktiv-Aktualisierung (s) +GpsRefrshTime=GPS-Aktualisierung (s) +FlyToSettings=Zur eingestellten Position fliegen +FlyToCurrentGps=Fliege zur aktuellen GPS Position +AltitudeMode=Hhen-Modus +Range=Entfernung +Heading=Kurs +Tilt=Neigung +AutoOpenNetworkLink=KML Network Link automatisch ffnen +SpeakSignal=Akustisches Signal +SpeakUseVisSounds=Benutze Vistumbler Sound Dateien +SpeakUseSapi=Benutze Microsoft Sound API +SpeakSayPercent=Sage "Prozent" nach Signal +GpsTrackTime=Track-Aktualisierung (s) +SaveAllGpsData=GPS Daten sichern, wenn keine APs aktiv +None=Kein +Even=Gerade +Odd=Ungerade +Mark=Mark +Space=Space +StopBit=Stop Bit +Parity=Parity Bit +DataBit=Daten Bit +Update=Update +UpdateMsg=Update gefunden. Mchten Sie Vistumbler aktualisieren? +Recover=Reparieren +RecoverMsg=Alte DB gefunden. Mchten Sie diese wiederherstellen? +SelectConnectedAP=Verbundenen AP auswhlen +VistumblerHome=Vistumbler Webseite +VistumblerForum=Vistumbler Forum +VistumblerWiki=Vistumbler Wiki +CheckForUpdates=Prfe auf Updates +SelectWhatToCopy=Bitte whlen Sie was Sie kopieren mchten +Default=Standard +PlayMidiSounds=MIDI Sound abspielen bei aktiven APs +Interface=Schnittstelle +LanguageCode=Systemgebietsschema +AutoCheckUpdates=Automatisch auf Updates prfen +CheckBetaUpdates=Auf Beta Updates prfen +GuessSearchwords=Netsh Suchbegriffe raten +Help=Hilfe +ErrorScanningNetsh=Fehler bei Abfrage von netsh +GpsErrorBufferEmpty=GPS Fehler. Puffer leer fr mehr als 10 Sekunden. GPS wurde vermutlich getrennt. GPS wurde angehalten +GpsErrorStopped=GPS Fehler. GPS wurde angehalten +ShowSignalDB=Signal dB anzeigen (geschtzt) +SortingList=Liste sortieren +Loading=Laden +MapOpenNetworks=Kartografiere offene Netzwerke +MapWepNetworks=Kartografiere WEP Netzwerke +MapSecureNetworks=Kartografiere gesicherte Netzwerke +DrawTrack=Zeichne Track +UseLocalImages=Lokale Bilder verwenden +MIDI=MIDI +MidiInstrumentNumber=MIDI Instrument # +MidiPlayTime=MIDI Abspieldauer +SpeakRefreshTime=Sprach-Aktualisierung +Information=Information +AddedGuessedSearchwords=Geratene "netsh" Suchbegriffe hinzugefgt. Suchbegriffe fr Open, None, WEP, Infrastructure, und Adhoc mssen noch manuell ergnzt werden +SortingTreeview=Sortiere Baumansicht +Recovering=Wiederherstellung +ErrorOpeningGpsPort=Fehler beim ffnen des GPS Ports +SecondsSinceGpsUpdate=Sekunden seit GPS Update +SavingGID=GID speichern +SavingHistID=HistID speichern +NoUpdates=Keine Updates verfgbar +NoActiveApFound=Kein aktiver AP gefunden +VistumblerDonate=Spenden +VistumblerStore=Online Shop +SupportVistumbler=*Vistumbler untersttzen* +FilterMsg=Benutzen Sie den Stern (*) fr alle. Trennen Sie mehrere Filter mit Kommas (,). Benutzen Sie den Bindestrich (-) fr Bereiche. Benutzen Sie das Prozentzeichen (%) in MAC-Adressen Feldern als Platzhalter. +SetFilters=Filter setzen +Filters=Filter +NoAdaptersFound=Keine Adapter gefunden +RecoveringMDB=MDB Wiederherstellung +FixingGpsTableDates=Repariere GPS Tabellendaten(s) +FixingHistTableDates=Repariere HIST Tabellendaten(s) +VistumblerNeedsToRestart=Vistumbler mu neugestartet werden. Vistumbler wird jetzt beendet +AddingApsIntoList=Neue APs werden der Liste hinzugefgt +GoogleEarthDoesNotExist=Google Earth Datei existiert nicht oder wurde in den AutoKML Einstellungen falsch konfiguriert +AutoKmlIsNotStarted=AutoKML wurde noch nicht gestartet. Mchten Sie es jetzt aktivieren? +UseKernel32=Benutze Kernel32 - x32 - x64 +UnableToGuessSearchwords=Vistumbler konnte die Suchworte nicht erraten +Filtered=Filter +SelectedAP=Ausgewhlter AP +AllAPs=Alle APs +FilteredAPs=Gefilterte APs +FixingGpsTableTimes=Repariere GPS Tabellenzeiten(s) +ImportFolder=Importiere Ordner +DeleteSelected=Auswahl lschen +RecoverSelected=Auswahl wiederherstellen +NewSession=Neue Sitzung +Size=Gre +NoMdbSelected=Keine MDB ausgewhlt +LocateInWiFiDB=Lokalisiere Position in WiFiDB +AutoWiFiDbGpsLocate=Auto WiFiDB Gps Lokalisierung +AutoSelectConnectedAP=Verbundenen AP automatisch auswhlen +Experimental=Experimentell +UploadDataToWiFiDB=Daten an WiFiDB senden +Error=Fehler +Updating=Aktualisiere +Downloaded=Heruntergeladen +Retry=Wiederholen +Ignore=Ignorieren +Yes=Ja +No=Nein +LoadingVersionsFile=Lade Versions Datei +UsingLocalFile=Verwende lokale Datei +DownloadingBetaVerFile=Lade beta Versionen Datei herunter +DownloadingVerFile=Lade Versionen Datei herunter +VerFileDownloaded=Versionen Datei heruntergeladen +ErrDownloadVerFile=Fehler beim herunterladen der Versionen Datei +NewFile=Neue Datei +UpdatedFile=Datei aktualisiert +ErrCopyingFile=Fehler beim kopieren der Datei +ErrReplacaingOldFile=Fehler beim ersetzen der alten Datei (Datei ist eventuell in Benutzung) +ErrDownloadingNewFile=Fehler beim herunterladen der neuen Datei +NoChangeInFile=Keine nderungen in der Datei +DeletedFile=Gelschte Datei +ErrDeletingFile=Fehler beim lschen der Datei +ErrWouldYouLikeToRetryUpdate=Fehler. Mchten Sie die Aktualisierung wiederholen? +DoneWouldYouLikeToLoadVistumbler=Fertig. Mchten Sie Vistumbler laden? +Color=Farbe +AddRemFilters=Filter hinzufgen/entfernen +NoFilterSelected=Keine Filter ausgewhlt. +Import=&Importieren +View=&Ansicht +AddFilter=Filter hinzufgen +EditFilter=Filter bearbeiten +DeleteFilter=Filter lschen +TimeBeforeMarkedDead=Zeit bevor AP als inaktiv markiert wird (s) +FilterNameRequired=Filter Name ist erforderlich +UpdateManufacturers=Hersteller aktualisieren +FixHistSignals=Repariere fehlendes Hist Tabellensignal(s) +VistumblerFile=Vistumbler Datei +DetailedFile=Detailierte Kommageteilte Datei +NetstumblerTxtFile=Netstumbler wi-scan Datei +WardriveDb3File=Wardrive-android Datei +AutoScanApsOnLaunch=Automatische AP Suche beim Start +RefreshInterfaces=Schnittstellen aktualisieren +NoAps=Keine access points +AutoSelectHighSigAP=AP mit strkstem Signal automatisch auswhlen +Sound=Sound +OncePerLoop=Einmal pro Durchgang +OncePerAP=Einmal pro AP +OncePerAPwSound=Einmal pro AP mit Lautstrke basierend auf Signalstrke +PhilsPHPgraph=Graph anzeigen (Phil's PHP version) +PhilsWDB=Phil's WiFiDB (Alpha) +PhilsWdbLocate=WifiDB Locate URL +PhilsWifiTools=Phil's WiFi Tools +AutoWiFiDbUploadAps=Automatisches Hochladen von aktiven APs zur WiFiDB +WifiDB=WifiDB +Warning=Warnung +WifiDBLocateWarning=Diese Funktion sendet Informationen ber aktive Access Points an die WifiDB API URL, welche in den Vistumbler WifiDB Einstellungen konfiguriert ist. Wenn Sie keine Daten an die WifiDB senden mchten, aktivieren Sie diese Funktion NICHT! Mchten Sie diese Funktion jetzt aktivieren? +WifiDBAutoUploadWarning=Diese Funktion sendet Informationen ber aktive Access Points an die WifiDB API URL, welche in den Vistumbler WifiDB Einstellungen konfiguriert ist. Wenn Sie keine Daten an die WifiDB senden mchten, aktivieren Sie diese Funktion NICHT! Mchten Sie diese Funktion jetzt aktivieren? +WifiDBOpenLiveAPWebpage=ffne WifiDB Live AP Webseite +WifiDBOpenMainWebpage=ffne WifiDB Webseite +FilePath=Datei Pfad +CameraName=Kamera Name +CameraURL=Kamera URL +Cameras=Kamera(s) +AddCamera=Kamera hinzufgen +RemoveCamera=Kamera entfernen +EditCamera=Kamera bearbeiten +UseNativeWifiMsg=Benutze Native Wifi +UseNativeWifiXpExtMsg=(kein BSSID, CHAN, OTX, BTX) +DownloadImages=Bilder herunterladen +EnableCamTriggerScript=Kamera trigger script aktivieren +SetCameras=Kameras +UpdateUpdaterMsg=Eine neue Version fr den Vistumbler Updater ist verfgbar. Mchten Sie jetzt eine Aktualisierung durchfhren? +UseRssiInGraphs=RSSI in Graphen benutzen +2400ChannelGraph=2.4Ghz Kanal Graph +5000ChannelGraph=5Ghz Kanal Graph +UpdateGeolocations=Aktualisiere Geolocations +Graph=Graph +ShowGpsPositionMap=Zeige GPS Positionskarte +ShowGpsSignalMap=Zeige GPS SignalKarte +UseRssiSignalValue=Benutze RSSI Signal Werte +UseCircleToShowSigStength=Kreis um Signalstrke anzuzeigen +ShowGpsRangeMap=Zeige GPS Bereichskarte +ShowGpsTack=Zeige GPS Track +FilterName=Filter Name +FilterDesc=Filter Beschreibung +FilterAddEdit=Filter bearbeiten +CameraTriggerScript=Kamera Trigger Skript +CameraTriggerScriptTypes=Kamera Trigger Skript (exe,bat) +Line=Zeile diff --git a/Installer/vi_files/Languages/Dutch.ini b/Installer/vi_files/Languages/Dutch.ini new file mode 100644 index 00000000..b91403a0 --- /dev/null +++ b/Installer/vi_files/Languages/Dutch.ini @@ -0,0 +1,424 @@ +[Info] +Author=Smithy +Date=2013/06/03 +Description=Aleen voor Nederlandstalige versies van Windows Vista/7/8 +WindowsLanguageCode=nl_NL + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Netwerktype +Authentication=Verificatie +Encryption=Versleuteling +Signal=Signaal +RadioType=RadioType +Channel=Kanaal +BasicRates=Basissnelheden +OtherRates=Overige snelheden +Open=Open +None=Geen +WEP=WEP +Infrastructure=Infrastructuur +Adhoc=Adhoc +Cipher=Cipher +RSSI-RSSI + +[Column_Names] +Column_Line=# +Column_Active=Actief +Column_SSID=SSID +Column_BSSID=MAC-adres +Column_Manufacturer=Fabrikant +Column_Signal=Signaal +Column_Authentication=Authenticatie +Column_Encryption=Encryptie +Column_RadioType=Radiotype +Column_Channel=Kanaal +Column_Latitude=Breedtegraad +Column_Longitude=Lengtegraad +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) +Column_BasicTransferRates=Basis overdrachtsnelheden +Column_OtherTransferRates=Andere overdrachtsnelheden +Column_FirstActive=Eerst actief +Column_LastActive=Laatst actief +Column_NetworkType=Netwerktype +Column_Label=Label +Column_HighSignal=Signaal-piek +Column_RSSI=RSSI +Column_HighRSSI=RSSI-piek + +[GuiText] +Ok=&OK +Cancel=&Afbreken +Apply=&Toepassen +Browse=&Bladeren +File=B&estand +SaveAsTXT=Opslaan als TXT +SaveAsVS1=Opslaan als VS1 +SaveAsVSZ=Opslaan als VSZ +ImportFromTXT=Importeren uit TXT / VS1 +ImportFromVSZ=Importeren van VSZ +Exit=&Afsluiten +ExitSaveDb=Afsluiten (Database opslaan) +Edit=&Bewerken +ClearAll=Wissen +Cut=Knippen +Copy=Kopieren +Paste=Plakken +Delete=Verwijderen +Select=Selecteren +SelectAll=Alles selecteren +Options=&Opties +AutoSort=Automatisch sorteren +SortTree=Boomstructuur sorteren (traag bij lange lijst) +PlaySound=Geluidsignaal bij nieuw AP +AddAPsToTop=Nieuwe AP's bovenaan +Extra=Ex&tra +ScanAPs=&Scan AP's +StopScanAps=&Stop Scan +UseGPS=&GPS +StopGPS=&StopGPS +Settings=&Instellingen +GpsSettings=GPS instellen +SetLanguage=&Taal kiezen +SetSearchWords=Netsh zoekwoorden instellen +Export=Ex&porteren +ExportToTXT=Exporteren naar TXT +ExportToVS1=Exporteren naar VS1 +ExportToCSV=Exporteren naar CSV +ExportToKML=Exporteren naar KML +ExportToGPX=Exporteren naar GPX +ExportToNS1=Exporteren naar NS1 +ExportToVSZ=Exporteren naar VSZ +RefreshLoopTime=Opnieuw scannen elke (ms) +ActualLoopTime=Scan interval +Longitude=Lengtegraad +Latitude=Breedtegraad +ActiveAPs=AccessPoints +Graph1=Grafiek &1 +Graph2=Grafiek &2 +NoGraph=Sluit grafiek +SetMacLabel=Labels per MAC-adres +SetMacManu=Fabrikanten per MAC-adres +Active=Ja +Dead=Nee +AddNewLabel=Label toevoegen +RemoveLabel=Label verwijderen +EditLabel=Label wijzigen +AddNewMan=Fabrikant toevoegen +RemoveMan=Fabrikant verwijderen +EditMan=Fabrikant wijzigen +NewMac=Nieuw MAC-adres: +NewMan=Nieuwe fabrikant: +NewLabel=Nieuw label: +Save=Opslaan ? +SaveQuestion=Scangegevens opslaan ? + + + +GpsDetails=GPS Details +GpsCompass=GPS Compas +Quality=Kwaliteit +Time=Tijd +NumberOfSatalites=Aantal Satellieten +HorizontalDilutionPosition=Horizontale Dilution +Altitude=Hoogte +HeightOfGeoid=Geoid hoogte +Status=Status +Date=Datum +SpeedInKnots=Snelheid (knopen) +SpeedInMPH=Snelheid (MPH) +SpeedInKmh=Snelheid (km/h) +TrackAngle=Hoek +Close=Sluiten +Start=Start +Stop=Stop +RefreshingNetworks=Ververs netwerken +RefreshTime=Verversen elke +SetColumnWidths=Kolombreedte instellen +Enable=Weergeven +Disable=Uit +Checked=aan +UnChecked=uit +Unknown=Onbekend +Restart=Herstarten +RestartMsg=Herstart Vistumbler om de wijziging uit te voeren +NoSignalHistory=Geen signaalhistorie gevonden, controleer of de netsh zoekwoorden juist zijn +NoApSelected=Geen access point geselecteerd +UseNetcomm=Netcomm OCX (stabieler) - x32 +UseCommMG=CommMG - x32 - x64 +SignalHistory=Signaal Historie +AutoSortEvery=Sorteren elke +Seconds=Seconden +Ascending=Oplopend +Decending=Aflopend +AutoSave=Automatisch opslaan +AutoSaveEvery=Opslaan elke +DelAutoSaveOnExit=Autosave bestand verwijderen bij afsluiten + +OpenSaveFolder=Open Save Folder +SortBy=Sorteren op +SortDirection=Sorteervolgorde +Auto=Auto +Misc=Algemeen +GPS=GPS +Labels=Labels +Manufacturers=Fabrikanten +Columns=Kolommen +Language=Taal +SearchWords=Zoekwoorden +VistumblerSettings=Vistumbler instellingen +LanguageAuthor=Auteur +LanguageDate=Datum bestand +LanguageDescription=Omschrijving bestand +Description=Omschrijving +Progress=Voortgang +LinesMin=Regels/Min +NewAPs=Nieuwe AP's +NewGIDs=Niewe GIDs +Minutes=Minuten +LineTotal=Regels/Totaal +EstimatedTimeRemaining=Geschatte resterende tijd +Ready=Klaar +Done=Voltooid +VistumblerSaveDirectory=Vistumbler Save Directory +VistumblerAutoSaveDirectory=Vistumbler AutoSave Directory +VistumblerKmlSaveDirectory=Vistumbler KML Save Directory +BackgroundColor=Achtergrondkleur +ControlColor=Control Kleur +BgFontColor=Tekstkleur +ConFontColor=Control Tekstkleur +NetshMsg=Vistumbler maakt gebruik van het Windows commando NETSH. Run "netsh wlan show networks mode = bssid" om de Nederlandse benamingen op te zoeken en indien nodig hier aan te passen. +PHPgraphing=PHP Graphing +ComInterface=Com Interface +ComSettings=Com Instellingen +Com=Com +Baud=Baud +GPSFormat=GPS Formaat +HideOtherGpsColumns=Verberg andere GPS kolommen +ImportLanguageFile=Importeer taalbestand +AutoKml=KML +GoogleEarthEXE=Google Earth EXE +AutoSaveKmlEvery=Auto Save KML elke +SavedAs=Opgeslagen als +Overwrite=Overschrijven +InstallNetcommOCX=Install Netcomm OCX +NoFileSaved=Geen bestanden opgeslagen +NoApsWithGps=Geen AP's gevonden met GPS coordinaten. +MacExistsOverwriteIt=A entry for this mac address already exists. would you like to overwrite it? +SavingLine=Saving Line +Debug=Debug +DisplayDebug=Debug - Functies weergeven +DisplayDebugCom=COM Errors weergeven +GraphDeadTime=Inactief tijd weergeven +OpenKmlNetLink=Open KML NetworkLink +ActiveRefreshTime=Actief verversen elke +DeadRefreshTime=Inactief ververs elke +GpsRefrshTime=GPS verversen elke + +FlyToSettings=Fly To Settings +FlyToCurrentGps=Fly to current GPS position +AltitudeMode=Altitude Mode +Range=Range +Heading=Heading +Tilt=Tilt +AutoOpenNetworkLink=Automatically Open KML Network Link +SpeakSignal= Voice signaalsterkte +SpeakUseVisSounds=Vistumbler Sound Files +SpeakUseSapi=Microsoft Sound API +SpeakSayPercent=Zeg "Percent" na getal +GpsTrackTime=Track verversen elke +SaveAllGpsData=GPS-data opslaan wanneer geen AP's actief +None=Geen +Even=Even +Odd=Oneven +Mark=Mark +Space=Space +StopBit=Stop Bit +Parity=Parity +DataBit=Data Bit +Update=Update +UpdateMsg=Update gevonden. Vistumbler updaten ? +Recover=Herstel +RecoverMsg=Oude DB gevonden. Herstellen ? +SelectConnectedAP=Selecteer verbonden AP +VistumblerHome=Vistumbler Home +VistumblerForum=Vistumbler Forum +VistumblerWiki=Vistumbler Wiki +CheckForUpdates=Controleren op Updates +SelectWhatToCopy=Selecteer wat je wilt kopiren +Default=Default +PlayMidiSounds=Afspelen voor alle actieve AP's +Interface=Interface +LanguageCode=TaalCode +AutoCheckUpdates=Automatisch controleren op Updates +CheckBetaUpdates=Controleren op Beta Updates +GuessSearchwords=Guess Netsh Searchwords +Help=Help +ErrorScanningNetsh=Error scanning netsh +GpsErrorBufferEmpty=GPS Error. Buffer Empty for more than 10 seconds. GPS was probrably disconnected. GPS has been stopped +GpsErrorStopped=GPS fout. GPS is gestopt +ShowSignalDB=Signaalsterkte in dB weergeven (indicatie) +SortingList=Sorteer Lijst +Loading=Laden +MapOpenNetworks=Map Open Networks +MapWepNetworks=Map WEP Networks +MapSecureNetworks=Map Secure Networks +DrawTrack=Draw Track +UseLocalImages=Use Local Images +MIDI=MIDI +MidiInstrumentNumber=MIDI Instrument # +MidiPlayTime=MIDI Play Time +SpeakRefreshTime=Verversen elke +Information=Informatie +AddedGuessedSearchwords=Added guessed netsh searchwords. Searchwords for Open, None, WEP, Infrustructure, and Adhoc will still need to be done manually +SortingTreeview=Sorteren Treeview +Recovering=Herstellen +ErrorOpeningGpsPort=Fout openen GPS poort +SecondsSinceGpsUpdate=Seconden Sinds GPS Update +SavingGID=GID opslaan +SavingHistID=HistID opslaan +NoUpdates=Geen Updates beschikbaar +NoActiveApFound=Geen actief AP gevonden +VistumblerDonate=Donatie + + +VistumblerStore=Store +SupportVistumbler=*Steun Vistumbler* +FilterMsg=Gebruik astriks(*)" als jokerteken. Filters scheiden met een komma(,). Gebruik streepje (-) voor bereik. +SetFilters=Filters instellen + +Filters=Filters +NoAdaptersFound=Geen Adapter gevonden +RecoveringMDB=Herstellen MDB +FixingGpsTableDates=Fixing GPS table date(s) +FixingHistTableDates=Fixing HIST table date(s) +VistumblerNeedsToRestart=Vistumbler moet opnieuw worden gestart. Vistumbler wordt afgesloten. +AddingApsIntoList=Nieuwe AP's toevoegen aan lijst +GoogleEarthDoesNotExist=Google Earth bestand niet gevonden of verkeerd insgesteld bij AutoKML +AutoKmlIsNotStarted=AutoKML is niet gestart. Nu starten? +UseKernel32=Gebruik Kernel32 - x32 - x64 +UnableToGuessSearchwords=Geen suggesties voor zoekwoorden +Filtered=Filters +SelectedAP=Geselecteerd AP +AllAPs=Alle AP's +FilteredAPs=Gefilterde AP's +FixingGpsTableTimes=Fixing GPS table times(s) +ImportFolder=Importeer Folder +DeleteSelected=Verwijder selectie +RecoverSelected=Herstel Selectie +NewSession=Nieuwe Sessie +Size=Formaat +NoMdbSelected=Geen MDB geselecteerd +LocateInWiFiDB=Locate Position in WiFiDB +AutoWiFiDbGpsLocate=Auto WiFiDB GPS Locate +AutoSelectConnectedAP=Verbonden AP automatisch selecteren +Experimental=Experimenteel +UploadDataToWiFiDB=Upload Data naar WiFiDB +Error=Fout +Updating=Updaten... +Downloaded=Gedownload +Retry=Opnieuw +Ignore=Negeren +Yes=Ja +No=Nee +LoadingVersionsFile=Versiebestand laden... +UsingLocalFile=Lokaal bestand wordt gebruikt +DownloadingBetaVerFile=Betaversiebestand downloaden... +DownloadingVerFile=Versiebestand downloaden... +VerFileDownloaded=Versiebestand gedownload +ErrDownloadVerFile=Fout bij versiebestand downloaden +NewFile=Nieuw bestand +UpdatedFile=Gepdatet bestand +ErrCopyingFile=Fout bij bestand kopiren +ErrReplacaingOldFile=Fout bij vervangen oud bestand(mogelijk in gebruik) +ErrDownloadingNewFile=Fout bij downloaden nieuw bestand +NoChangeInFile=Geen wijziging in bestand +DeletedFile=Gewist bestand +ErrDeletingFile=Fout bij wissen bestand +ErrWouldYouLikeToRetryUpdate=Fout. Update opnieuw uitvoeren ? +DoneWouldYouLikeToLoadVistumbler=Klaar. Vistumbler laden ? +Color=Kleur +AddRemFilters=Filters toevoegen/verwijderen +NoFilterSelected=Geen filter geselecteerd. +Import=&Importeren +View=&Weergave +AddFilter=Filter toevoegen +EditFilter=Filter wijzigen +DeleteFilter=Filter wissen +TimeBeforeMarkedDead=Wachttijd voordat AP als niet actief wordt aangemerkt (sec.) +FilterNameRequired=Filter Naam is verplicht +UpdateManufacturers=Update Fabrikanten +FixHistSignals=Fixing Missing Hist Table Signal(s) +VistumblerFile=Vistumbler bestand +DetailedFile=Gedetaileerd CSV bestand +NetstumblerTxtFile=Netstumbler wi-scan bestand +WardriveDb3File=Wardrive-android bestand +AutoScanApsOnLaunch=Auto Scan APs bij openen +RefreshInterfaces=Ververs Interfaces +NoAps=Geen AP's. +AutoSelectHighSigAP=Pieksignaal automatisch selecteren +Sound=Geluid +OncePerLoop=1x per loop +OncePerAP=1x per AP +OncePerAPwSound=1x per AP met volume gebaseerd op signaal +PhilsPHPgraph=Geselecteerd grafisch AP Signaal naar afbeelding +PhilsWDB=WiFiDB URL +PhilsWdbLocate=WifiDB Locate URL +PhilsWifiTools=Phil's WiFi Tools +AutoWiFiDbUploadAps=Auto WiFiDB Upload Actieve AP +WifiDB=WifiDB +Warning=Waarschuwing +WifiDBLocateWarning=Deze voorziening stuurt actieve AP informatie naar de WifiDB API URL, ingesteld bij Vistumbler WifiDB instellingen. Gebruik deze voorziening niet als U geen data wilt versturen. Wilt U deze voorziening inschakelen? +WifiDBAutoUploadWarning=Deze voorziening stuurt actieve AP informatie naar de WifiDB API URL, ingesteld bij Vistumbler WifiDB instellingen. Gebruik deze voorziening niet als U geen data wilt versturen.Wilt U deze voorziening inschakelen? +WifiDBOpenLiveAPWebpage=Open WifiDB Live AP Webpagina +WifiDBOpenMainWebpage=Open WifiDB Main Webpagina +FilePath=Pad naar bestand +CameraName=Camera Naam +CameraURL=Camera URL +Cameras=Camera(s) +AddCamera=Camera toevoegen +RemoveCamera=Camera verwsijderen +EditCamera=Camera wijzigen +UseNativeWifiMsg=Gebruik Native Wifi +UseNativeWifiXpExtMsg=(Geen BSSID, CHAN, OTX, BTX) +DownloadImages=Download afbeeldingen +EnableCamTriggerScript=Camera trigger script inschakelen +SetCameras=Cameras instellen +UpdateUpdaterMsg=Er is een nieuwe Vistumbler updater. Wilt U deze nu downloaden en installeren? +UseRssiInGraphs=Gebruik RSSI in grafieken +2400ChannelGraph=2.4Ghz kanaal Grafiek +5000ChannelGraph=5Ghz kanaal Grafiek +UpdateGeolocations=Update Geolocaties +Graph=Grafiek +ShowGpsPositionMap=GPS Positie Map weergeven +ShowGpsSignalMap=GPS Signaal Map wergeven +UseRssiSignalValue=Gebruik RSSI signaal waarden +UseCircleToShowSigStength=Signaalsterke aangeven met cirkel +ShowGpsRangeMap=GPS bereik Map weergeven +ShowGpsTack=GPS Track weergeven +FilterName=Filter Naam +FilterDesc=Filter Omschrijving +FilterAddEdit=Add/Filter aanpassen +CameraTriggerScript=Camera Trigger Script +CameraTriggerScriptTypes=Camera Trigger Script (exe,bat) +Line=Lijn +Total=Totaal +SummaryFile=Samenvatting CSV bestand +WifiDB_Upload_Discliamer=Deze voorziening stuurt AP's naar de WifiDB. Er wordt een bestand verstuurd naar de WifiDB API URL die staat ingesteld bij Vistumbler WifiDB instellingen. +UserInformation=Gebruikers Informatie +WifiDB_Username=WifiDB Gebruikersnaam +WifiDB_Api_Key=WifiDB Api Key +OtherUsers=Andere gebruikers +FileType=Bestandstype +VistumblerVSZ=Vistumbler VSZ +VistumblerVS1=Vistumbler VS1 +VistumblerCSV=Vistumbler CSV gedetailleerd +UploadInformation=Upload Informatie +Title=Titel +Notes=Opmerkingen +UploadApsToWifidb=Upload APs naar WifiDB +UploadingApsToWifidb=Uploading APs naar WifiDB diff --git a/Installer/vi_files/Languages/English.ini b/Installer/vi_files/Languages/English.ini new file mode 100644 index 00000000..adbee75c --- /dev/null +++ b/Installer/vi_files/Languages/English.ini @@ -0,0 +1,421 @@ +[Info] +Author=Andrew Calcutt +Date=2015/03/07 +Description=English SearchWords. English Text. Default Language. +WindowsLanguageCode=en_US + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Network type +Authentication=Authentication +Encryption=Encryption +Signal=Signal +RadioType=Radio Type +Channel=Channel +BasicRates=Basic Rates +OtherRates=Other Rates +Open=Open +None=None +WEP=WEP +Infrastructure=Infrastructure +Adhoc=Adhoc +Cipher=Cipher +RSSI=RSSI + +[Column_Names] +Column_Line=# +Column_Active=Active +Column_SSID=SSID +Column_BSSID=Mac Address +Column_Manufacturer=Manufacturer +Column_Signal=Signal +Column_Authentication=Authentication +Column_Encryption=Encryption +Column_RadioType=Radio Type +Column_Channel=Channel +Column_Latitude=Latitude +Column_Longitude=Longitude +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) +Column_BasicTransferRates=Basic Transfer Rates +Column_OtherTransferRates=Other Transfer Rates +Column_FirstActive=First Active +Column_LastActive=Last Updated +Column_NetworkType=Network Type +Column_Label=Label +Column_HighSignal=High Signal +Column_RSSI=RSSI +Column_HighRSSI=High RSSI + +[GuiText] +Ok=&Ok +Cancel=C&ancel +Apply=&Apply +Browse=&Browse +File=&File +Import=&Import +SaveAsTXT=Save As TXT +SaveAsVS1=Save As VS1 +SaveAsVSZ=Save As VSZ +ImportFromTXT=Import From TXT / VS1 +ImportFromVSZ=Import From VSZ +Exit=E&xit +ExitSaveDb=Exit (Save DB) +Edit=E&dit +ClearAll=Clear All +Cut=Cut +Copy=Copy +Paste=Paste +Delete=Delete +Select=Select +SelectAll=Select All +View=&View +Options=&Options +AutoSort=AutoSort +SortTree=Sort Tree - (slow on big lists) +PlaySound=Play sound on new AP +PlayGpsSound=Play sound on new GPS +AddAPsToTop=Add new APs to top +Extra=Ex&tra +ScanAPs=&Scan APs +StopScanAps=&Stop +UseGPS=Use &GPS +StopGPS=Stop &GPS +Settings=Settings +MiscSettings=Misc Settings +SaveSettings=Save Settings +GpsSettings=GPS Settings +SetLanguage=Set Language +SetSearchWords=Set Search Words +Export=Ex&port +ExportToKML=Export To KML +ExportToGPX=Export To GPX +ExportToTXT=Export To TXT +ExportToNS1=Export To NS1 +ExportToVS1=Export To VS1 +ExportToCSV=Export To CSV +ExportToVSZ=Export To VSZ +WifiDbPHPgraph=Graph Selected AP Signal to Image +WifiDbWDB=WiFiDB URL +WifiDbWdbLocate=WifiDB Locate URL +UploadDataToWiFiDB=Upload Data to WiFiDB +RefreshLoopTime=Refresh loop time(ms): +ActualLoopTime=Loop time +Longitude=Longitude +Latitude=Latitude +ActiveAPs=Active APs +Graph=Graph +Graph1=Graph1 +Graph2=Graph2 +NoGraph=No Graph +SetMacLabel=Set Labels by Mac +SetMacManu=Set Manufactures by Mac +Active=Active +Dead=Dead +AddNewLabel=Add New Label +RemoveLabel=Remove Selected Label +EditLabel=Edit Selected Label +AddNewMan=Add New Manufacturer +RemoveMan=Remove Selected Manufacturer +EditMan=Edit Selected Manufacturer +NewMac=New Mac Address: +NewMan=New Manufacturer: +NewLabel=New Label: +Save=Save +SaveQuestion=Data has changed. Would you like to save? +GpsDetails=GPS Details +GpsCompass=GPS Compass +Quality=Quality +Time=Time +NumberOfSatalites=Number of Satalites +HorizontalDilutionPosition=Horizontal Dilution +Altitude=Altitude +HeightOfGeoid=Height of Geoid +Status=Status +Date=Date +SpeedInKnots=Speed(knots) +SpeedInMPH=Speed(MPH) +SpeedInKmh=Speed(km/h) +TrackAngle=Track Angle +Close=Close +Start=Start +Stop=Stop +RefreshingNetworks=Auto Refresh Networks +RefreshTime=Refresh time +SetColumnWidths=Set Column Widths +Enable=Enable +Disable=Disable +Checked=Checked +UnChecked=UnChecked +Unknown=Unknown +Restart=Restart +RestartMsg=Please restart Vistumbler for the change to take effect +Error=Error +NoSignalHistory=No signal history found, check to make sure your netsh search words are correct +NoApSelected=You did not select an access point +UseNetcomm=Use Netcomm OCX (more stable) - x32 +UseCommMG=Use CommMG (less stable) - x32 - x64 +SignalHistory=Signal History +AutoSortEvery=Auto Sort Every +Seconds=Seconds +Ascending=Ascending +Decending=Decending +AutoRecoveryVS1=Auto Recovery VS1 +AutoSaveEvery=Auto Save Every +DelAutoSaveOnExit=Delete Auto Save file on exit +OpenSaveFolder=Open Save Folder +SortBy=Sort By +SortDirection=Sort Direction +Auto=Auto +Misc=Misc +GPS=GPS +Labels=Labels +Manufacturers=Manufacturers +Columns=Columns +Language=Language +SearchWords=SearchWords +VistumblerSettings=Vistumbler Settings +LanguageAuthor=Language Author +LanguageDate=Language Date +LanguageDescription=Language Description +Description=Description +Progress=Progress +LinesMin=Lines/Min +NewAPs=New APs +NewGIDs=New GIDs +Minutes=Minutes +LineTotal=Line/Total +EstimatedTimeRemaining=Estimated Time Remaining +Ready=Ready +Done=Done +VistumblerSaveDirectory=Vistumbler Save Directory +VistumblerAutoSaveDirectory=Vistumbler Auto Save Directory +VistumblerAutoRecoverySaveDirectory=Vistumbler Auto Recovery Save Directory +VistumblerKmlSaveDirectory=Vistumbler KML Save Directory +BackgroundColor=Background Color +ControlColor=Control Color +BgFontColor=Font Color +ConFontColor=Control Font Color +NetshMsg=This section allows you to change the words Vistumbler uses to search netsh. Change to the proper words for you version of windows. Run "netsh wlan show networks mode = bssid" to find the proper words. +PHPgraphing=PHP Graphing +ComInterface=Com Interface +ComSettings=Com Settings +Com=Com +Baud=Baud +GPSFormat=GPS Format +HideOtherGpsColumns=Hide Other GPS Columns +ImportLanguageFile=Import Language File +AutoKml=Auto KML +GoogleEarthEXE=Google Earth EXE +AutoSaveKmlEvery=Auto Save KML Every +SavedAs=Saved As +Overwrite=Overwrite +InstallNetcommOCX=Install Netcomm OCX +NoFileSaved=No file has been saved +NoApsWithGps=No access points found with gps coordinates. +NoAps=No access points. +MacExistsOverwriteIt=A entry for this mac address already exists. would you like to overwrite it? +SavingLine=Saving Line +Debug=Debug +DisplayDebug=Display Functions +DisplayDebugCom=Display COM Errors +GraphDeadTime=Graph Dead Time +OpenKmlNetLink=Open KML NetworkLink +ActiveRefreshTime=Active Refresh Time +DeadRefreshTime=Dead Refresh Time +GpsRefrshTime=Gps Refrsh Time +FlyToSettings=Fly To Settings +FlyToCurrentGps=Fly to current gps position +AltitudeMode=Altitude Mode +Range=Range +Heading=Heading +Tilt=Tilt +AutoOpenNetworkLink=Automatically Open KML Network Link +SpeakSignal=Speak Signal +SpeakUseVisSounds=Use Vistumbler Sound Files +SpeakUseSapi=Use Microsoft Sound API +SpeakSayPercent=Say "Percent" after signal +GpsTrackTime=Track Refresh Time +SaveAllGpsData=Save GPS data when no APs are active +None=None +Even=Even +Odd=Odd +Mark=Mark +Space=Space +StopBit=Stop Bit +Parity=Parity +DataBit=Data Bit +Update=Update +UpdateMsg=Update Found. Would you like to update vistumbler? +Recover=Recover +RecoverMsg=Old DB Found. Would you like to recover it? +SelectConnectedAP=Select Connected AP +VistumblerHome=Vistumbler Home +VistumblerForum=Vistumbler Forum +VistumblerWiki=Vistumbler Wiki +CheckForUpdates=Check For Updates +SelectWhatToCopy=Select what you want to copy +Default=Default +PlayMidiSounds=Play MIDI sounds for all active APs +Interface=Interface +LanguageCode=Language Code +AutoCheckUpdates=Automatically Check For Updates +CheckBetaUpdates=Check For Beta Updates +GuessSearchwords=Guess Netsh Searchwords +Help=Help +ErrorScanningNetsh=Error scanning netsh +GpsErrorBufferEmpty=GPS Error. Buffer Empty for more than 10 seconds. GPS was probrably disconnected. GPS has been stopped +GpsErrorStopped=GPS Error. GPS has been stopped +ShowSignalDB=Show Signal dB (Estimated) +SortingList=Sorting List +Loading=Loading +MapOpenNetworks=Map Open Networks +MapWepNetworks=Map WEP Networks +MapSecureNetworks=Map Secure Networks +DrawTrack=Draw Track +UseLocalImages=Use Local Images +MIDI=MIDI +MidiInstrumentNumber=MIDI Instrument # +MidiPlayTime=MIDI Play Time +SpeakRefreshTime=Speak Refresh Time +Information=Information +AddedGuessedSearchwords=Added guessed netsh searchwords. Searchwords for Open, None, WEP, Infrustructure, and Adhoc will still need to be done manually +SortingTreeview=Sorting Treeview +Recovering=Recovering +ErrorOpeningGpsPort=Error opening GPS port +SecondsSinceGpsUpdate=Seconds Since GPS Update +SavingGID=Saving GID +SavingHistID=Saving HistID +NoUpdates=No Updates Avalible +NoActiveApFound=No Active AP found +VistumblerDonate=Donate +VistumblerStore=Store +SupportVistumbler=*Support Vistumbler* +UseNativeWifiMsg=Use Native Wifi +UseNativeWifiXpExtMsg=(No BSSID, CHAN, OTX, BTX) +FilterMsg=Use asterik(*) for all. Seperate multiple filters with a comma(,). Use a dash(-) for ranges. Mac address field supports like with percent(%) as a wildcard. SSID field uses backslash(\) to escape control characters. +SetFilters=Set Filters +Filtered=Filtered +Filters=Filters +FilterName=Filter Name +FilterDesc=Filter Description +FilterAddEdit=Add/Edit Filter +NoAdaptersFound=No Adapters Found +RecoveringMDB=Recovering MDB +FixingGpsTableDates=Fixing GPS table date(s) +FixingGpsTableTimes=Fixing GPS table times(s) +FixingHistTableDates=Fixing HIST table date(s) +VistumblerNeedsToRestart=Vistumbler needs to be restarted. Vistumbler will now close +AddingApsIntoList=Adding new APs into list +GoogleEarthDoesNotExist=Google earth file does not exist or is set wrong in the AutoKML settings +AutoKmlIsNotStarted=AutoKML is not yet started. Would you like to turn it on now? +UseKernel32=Use Kernel32 - x32 - x64 +UnableToGuessSearchwords=Vistumbler was unable to guess searchwords +SelectedAP=Selected AP +AllAPs=All APs +FilteredAPs=Filtered APs +ImportFolder=Import Folder +DeleteSelected=Delete Selected +RecoverSelected=Recover Selected +NewSession=New Session +Size=Size +NoMdbSelected=No MDB Selected +LocateInWiFiDB=Locate Position in WiFiDB +AutoWiFiDbGpsLocate=Auto WiFiDB Gps Locate +AutoWiFiDbUploadAps=Auto WiFiDB Upload Active AP +AutoSelectConnectedAP=Auto Select Connected AP +AutoSelectHighSigAP=Auto Select Highest Signal AP +Experimental=Experimental +Color=Color +AddRemFilters=Add/Remove Filters +NoFilterSelected=No filter selected. +AddFilter=Add Filter +EditFilter=Edit Filter +DeleteFilter=Delete Filter +TimeBeforeMarkedDead=Time to wait before marking AP dead (s) +FilterNameRequired=Filter Name is required +UpdateManufacturers=Update Manufacturers +FixHistSignals=Fixing Missing Hist Table Signal(s) +VistumblerFile=Vistumbler file +DetailedFile=Detailed Comma Delimited file +SummaryFile=Summary Comma Delimited file +NetstumblerTxtFile=Netstumbler wi-scan file +WardriveDb3File=Wardrive-android file +AutoScanApsOnLaunch=Auto Scan APs on launch +RefreshInterfaces=Refresh Interfaces +Sound=Sound +OncePerLoop=Once per loop +OncePerAP=Once per ap +OncePerAPwSound=Once per ap with volume based on signal +WifiDB=WifiDB +Warning=Warning +WifiDBLocateWarning=This feature sends active access point information to the WifiDB API URL specified in the Vistumbler WifiDB Settings. If you do not want to send data to the wifidb, do not enable this feature. Do you want to continue to enable this feature? +WifiDBAutoUploadWarning=This feature sends active access point information to the WifiDB API URL specified in the Vistumbler WifiDB Settings. If you do not want to send data to the wifidb, do not enable this feature. Do you want to continue to enable this feature? +WifiDBOpenLiveAPWebpage=Open WifiDB Live AP Webpage +WifiDBOpenMainWebpage=Open WifiDB Main Webpage +FilePath=File Path +CameraName=Camera Name +CameraURL=Camera URL +Cameras=Camera(s) +AddCamera=Add Camera +RemoveCamera=Remove Camera +EditCamera=Edit Camera +DownloadImages=Download Images +EnableCamTriggerScript=Enable camera trigger script +PortableMode=Portable Mode +CameraTriggerScript=Camera Trigger Script +CameraTriggerScriptTypes=Camera Trigger Script (exe,bat) +SetCameras=Set Cameras +UpdateUpdaterMsg=There is an update to the vistumbler updater. Would you like to download and update it now? +UseRssiInGraphs=Use RSSI in graphs +2400ChannelGraph=2.4Ghz Channel Graph +5000ChannelGraph=5Ghz Channel Graph +UpdateGeolocations=Update Geolocations +ShowGpsPositionMap=Show GPS Position Map +ShowGpsSignalMap=Show GPS Signal Map +UseRssiSignalValue=Use RSSI signal values +UseCircleToShowSigStength=Use circle to show signal strength +ShowGpsRangeMap=Show GPS Range Map +ShowGpsTack=Show GPS Track +Line=Line +Total=Total +WifiDB_Upload_Discliamer=This feature uploads access points to the WifiDB. a file will be generated and uploaded to the WifiDB API URL specified in the Vistumbler WifiDB Settings. +UserInformation=User Information +WifiDB_Username=WifiDB Username +WifiDB_Api_Key=WifiDB Api Key +OtherUsers=Other users +FileType=File Type +VistumblerVSZ=Vistumbler VSZ +VistumblerVS1=Vistumbler VS1 +VistumblerCSV=Vistumbler Detailed CSV +UploadInformation=Upload Information +Title=Title +Notes=Notes +UploadApsToWifidb=Upload APs to WifiDB +UploadingApsToWifidb=Uploading APs to WifiDB +GeoNamesInfo=Geonames Info +FindApInWifidb=Find AP in WifiDB +GpsDisconnect=Disconnect GPS when no data is received in over 10 seconds +GpsReset=Reset GPS position when no GPGGA data is received in over 30 seconds +APs=APs +MaxSignal=Max Signal +DisassociationSignal=Disassociation Signal +SaveDirectories=Save Directories +AutoSaveAndClearAfterNumberofAPs=Auto Save And Clear After Number of APs +AutoSaveandClearAfterTime=Auto Save and Clear After Time +PlaySoundWhenSaving=Play Sound When Saving +MinimalGuiMode=Minimal GUI Mode +AutoScrollToBottom=Auto Scroll to Bottom of List +ListviewBatchInsertMode=Listview Batch Insert Mode +ExportVistumblerSettings=Export Vistumbler Settings +ImportVistumblerSettings=Import Vistumbler Settings +ErrorSavingFile=Error Saving File +ErrorImportingFile=Error Importing File +SettingsImportedSuccess=Settings Imported Successfully. Please restart Vistumbler to apply the new settings. +ButtonActiveColor=Button Active Color +ButtonInactiveColor=Button Inactive Color +Text=Text +GUITextSize=GUI Text Size diff --git a/Installer/vi_files/Languages/French.ini b/Installer/vi_files/Languages/French.ini new file mode 100644 index 00000000..33bb1e2e --- /dev/null +++ b/Installer/vi_files/Languages/French.ini @@ -0,0 +1,343 @@ +[Info] +Author=Lobotomise +Date=2010/05/02 +Description=Recherche en Franais. Slectionnez les mots de la recherche netsh. +WindowsLanguageCode=fr_FR + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Type de rseau +Authentication=Authentification +Encryption=Chiffrement +Signal=Signal +RadioType=Type de radio +Channel=Canal +BasicRates=Taux de base (Mbits/s) +OtherRates=Autres taux (Mbits/s) +Open=Ouvert +None=Aucun +WEP=WEP +Infrastructure=Infrastructure +Adhoc=Adhoc +Cipher=Chiffr + +[Column_Names] +Column_Line=# +Column_Active=Actif +Column_SSID=SSID +Column_BSSID=Adresse Mac +Column_Manufacturer=Fabricant +Column_Signal=Signal +Column_Authentication=Authentification +Column_Encryption=Chiffrement +Column_RadioType=Type de radio +Column_Channel=Canal +Column_Latitude=Latitude +Column_Longitude=Longitude +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Long (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Long (ddmm.mmmm) +Column_BasicTransferRates=Taux base (Mbits/s) +Column_OtherTransferRates=Autres taux (Mbits/s) +Column_FirstActive=Premire activit +Column_LastActive=Dernire actualisation +Column_NetworkType=Type de rseau +Column_Label=Etiquette + +[GuiText] +Ok=&Ok +Cancel=A&nnuler +Apply=&Appliquer +Browse=&Parcourir +File=&Fichier +SaveAsTXT=Enregistrer sous Txt +SaveAsVS1=Enregistrer sous VS1 +SaveAsVSZ=Enregistrer sous VSZ +ImportFromTXT=Importer TXT / VS1 +ImportFromVSZ=Importer VSZ +Exit=Q&uitter +ExitSaveDb=Quitter (Enregistrer Base de Donnes) +Edit=E&diter +ClearAll=Effacer tout +Cut=Couper +Copy=Copier +Paste=Coller +Delete=Supprimer +Select=Slectionner +SelectAll=Slectionner tout +Options=&Options +AutoSort=Auto Trier +SortTree=Trier arbre - ( Lent si longues listes ) +PlaySound=Jouer son sur dtection d'un nouveau Point d'Accs +AddAPsToTop=Ajouter nouveaux Points d'Accs en dbut de liste +Extra=Ex&tra +ScanAPs=Lancer &Scan +StopScanAps=&Arrter Scan +UseGPS=Utiliser &GPS +StopGPS=Arrter &GPS +Settings=P&aramtres +GpsSettings=Paramtres GPS +SetLanguage=Langage +SetSearchWords=Slectionner les mots de la recherche Netsh +Export=Ex&porter +ExportToTXT=Exporter vers Txt +ExportToVS1=Exporter vers VS1 +ExportToCSV=Exporter vers CSV +ExportToKML=Exporter vers KML +ExportToGPX=Exporter vers GSX +ExportToNS1=Exporter vers NS1 +PhilsPHPgraph=Visualiser graphique (version PHP Phils ) +PhilsWDB=Phils WiFiBD (Alpha) +PhilsWifiTools=Outils Phil's WiFi +RefreshLoopTime=Temps d'actualisation cycle (en ms) +ActualLoopTime=Temps d'actualisation +Longitude=Longitude +Latitude=Latitude +ActiveAPs=Points d'Accs actifs +Graph1=Graphique&1 +Graph2=Graphique&2 +NoGraph=&Sans Graph. +SetMacLabel=Dfinir Etiquette par Adresse Mac +SetMacManu=Dfinir Fabricant par Adresse Mac +Active=Actif +Dead=Inactif +AddNewLabel=Ajouter Nouvelle Etiquette +RemoveLabel=Supprimer Etiquette Slectionne +EditLabel=Editer Etiquette Slectionne +AddNewMan=Ajouter Nouveau Fabricant +RemoveMan=Supprimer Fabricant Slectionn +EditMan=Editer Fabricant Slectionn +NewMac=Nouvelle Adresse Mac +NewMan=Nouveau Fabricant +NewLabel=Nouvelle Etiquette +Save=Enregistrer ? +SaveQuestion=Les donnes ont t modifies. Voulez-vous les enregistrer ? +GpsDetails=Dtails GPS +GpsCompass=Boussole Gps +Quality=Qualit +Time=Temps +NumberOfSatalites=Nombre de Satellites +HorizontalDilutionPosition=Rduction position horizontale +Altitude=Altitude +HeightOfGeoid=Hauteur du Geoid +Status=Etat +Date=Date +SpeedInKnots=Vitesse(noeuds) +SpeedInMPH=Vitesse(MPH) +SpeedInKmh=Vitesse(km/h) +TrackAngle=Angle de Trace +Close=Fermer +Start=Dmarrer +Stop=Arrter +RefreshingNetworks=Actualiser les Rseaux +RefreshTime=Actualiser temps . +SetColumnWidths=Largeur des colonnes +Enable=Activer +Disable=Dsactiver +Checked=Coch +UnChecked=Dcoch +Unknown=Inconnu +Restart=Redmarrer +RestartMsg=Veuillez redmarrer Vistumbler afin que les changements soient pris en compte. +NoSignalHistory=Aucun historique de signal trouv, vrifiez que les mots de la recherche netsh soient correctes +NoApSelected=Vous n'avez pas slectionn de point d'accs +UseNetcomm=Utiliser Netcomm OCX (+ stable) - x32 +UseCommMG=Utiliser CommMG (- stable) - x32 - x64 +SignalHistory=Historique de Signal +AutoSortEvery=Tri auto chaque +Seconds=Secondes +Ascending=Ascendant +Decending=Descendant +AutoSave=Enregistrement Auto +AutoSaveEvery=Enregistrement Auto chaque +DelAutoSaveOnExit=Supprimer 'Enreg.Auto' en quittant +OpenSaveFolder=Ouvrir le Dossier d'Enregistrement +SortBy=Trier par +SortDirection=Sens du Tri +Auto=Auto +Misc=Divers +GPS=GPS +Labels=Etiquettes +Manufacturers=Fabricants +Columns=Colonnes +Language=Langage +SearchWords=Mots de la recherche Netsh +VistumblerSettings=Gnral +LanguageAuthor=Traducteur +LanguageDate=Date +LanguageDescription=Description +Description=Description +Progress=Progression +LinesMin=Lignes/Min +NewAPs=Nouveaux PA +NewGIDs=Nouveaux GIDs +Minutes=Minutes +LineTotal=Ligne/Total +EstimatedTimeRemaining=Temps Restant +Ready=Prt +Done=Termin +VistumblerSaveDirectory=Dossier d'Enregistrement +VistumblerAutoSaveDirectory=Dossier d'Enregistrement Auto +VistumblerKmlSaveDirectory=Dossier d'Enregistrement fichiers KML +BackgroundColor=Couleur du Fond +ControlColor=Couleur fentre contrle +BgFontColor=Couleur police +ConFontColor=Couleur de police contrle +NetshMsg=Cette section vous permet de dfinir les mots que Vistumbler utilisera lors de la recherche netsh. Adaptez les mots appropris votre version de Windows Vista. Tapez dans une fentre d'Invite de commandes "netsh wlan show networks mode=bssid" pour trouver les mots appropris. +PHPgraphing=Graphisme PHP +ComInterface=Interface Port Com +ComSettings=Paramtres du Port de communication +Com=Port Com : +Baud=Bits par seconde : +GPSFormat=Format GPS +HideOtherGpsColumns=Masquer autres colonnes GPS +ImportLanguageFile=Importer un fichier Langage +AutoKml=Auto KML +GoogleEarthEXE=Google Earth +AutoSaveKmlEvery=Enreg.Auto KML chaque +SavedAs=Enregistrer sous +Overwrite=Ecraser +InstallNetcommOCX=Installez Netcomm OCX ! +NoFileSaved=Aucun fichier n'a t enregistr ! +NoApsWithGps=Aucun Point d'Accs trouv avec coordonnes GPS. +MacExistsOverwriteIt=Une entre pour cette Adresse MAC existe dj. Voulez vous l'craser ? +SavingLine=Enregistrement de la Ligne... +DisplayDebug=Afficher Fonctions - Debug +GraphDeadTime=Graphique du temps d'inactivit +OpenKmlNetLink=Ouvrir lien rseau KML +ActiveRefreshTime=Temps d'actualisation actif +DeadRefreshTime=Temps d'actualisation inactif +GpsRefrshTime=Actualiser GPS +FlyToSettings=Paramtres de Survol +FlyToCurrentGps=Survoler la position GPS +AltitudeMode=Mode Altitude +Range=Gamme +Heading=Titre +Tilt=Inclinaison +AutoOpenNetworkLink=Ouvrir lien rseau KML Auto +SpeakSignal=Signal Acoustique +SpeakUseVisSounds=Utiliser Fichiers Son +SpeakUseSapi=Utiliser API Son Microsoft +SpeakSayPercent=Dire pour cent aprs le signal +GpsTrackTime=Temps d'actualisation Trace +SaveAllGpsData=Enregistrer les donnes GPS quand aucun Point d'Accs n'est actif +None=Aucune +Even=Paire +Odd=Impaire +Mark=Marque +Space=Espace +StopBit=Bits d'arrt : +Parity=Parit : +DataBit=Bits de donnes : +Update=Mise Jour +UpdateMsg=Mise jour trouve. Voulez-vous mettre jour Vistumbler ? +Recover=Rcuprer +RecoverMsg=Ancienne base de donnes trouve. Voulez-vous la rcuprer ? +SelectConnectedAP=Slectionner Point d'Accs connect +VistumblerHome=Page d'accueil Vistumbler +VistumblerForum=Forum Vistumbler +VistumblerWiki=Wiki Vistumbler +CheckForUpdates=Rechercher des mises jour... +SelectWhatToCopy=Slectionnez ce que vous voulez copier +Default=Par dfaut +PlayMidiSounds=Jouer son MIDI pour tous les nouveaux Points d'Accs actifs +Interface=Interface +LanguageCode=Code Langage +AutoCheckUpdates=Vrifier automatiquement les mises jour +CheckBetaUpdates=Vrifier les mises jour bta +GuessSearchwords=Deviner les mots de la recherche Netsh +Help=Aide +ErrorScanningNetsh=Erreur scan netsh +GpsErrorBufferEmpty=Erreur GPS. Vider la mmoire tampon pour 10 secondes de plus. Le GPS a t probablement dconnect. GPS a t arrt +GpsErrorStopped=Erreur GPS. Le GPS a t arrt +ShowSignalDB=Afficher Signal dB (Estim) +SortingList=Tri de Liste +Loading=Chargement +MapOpenNetworks=Carte des Rseaux Ouverts +MapWepNetworks=Carte des Rseaux WEP +MapSecureNetworks=Carte des Rseaux Scuriss +DrawTrack=Dessiner Trace +UseLocalImages=Utiliser Images Locales +MIDI=MIDI +MidiInstrumentNumber=Instrument MIDI # +MidiPlayTime=Temps de lecture MIDI +SpeakRefreshTime=Temps Actualisation de l'Acoustique +Information=Information +AddedGuessedSearchwords=Ajouter les mots de la recherche netsh devins. Les mots de la recherche netsh suivants; Ouvrir, Aucun, WEP, Infrastructure et Adhoc auront toujours besoin d'tre taps manuellement +SortingTreeview=Tri Arborescence +Recovering=Rcupration +VistumblerFile=Fichier Vistumbler +NetstumblerTxtFile=Fichier TXT Netstumbler +ErrorOpeningGpsPort=Erreur lors de l'ouverture du port GPS +SecondsSinceGpsUpdate=Secondes Depuis Mise jour GPS +SavingGID=Enregistrement GID +SavingHistID=Enregistrement HistID +NoUpdates=Aucunes Mises jour de disponible. +NoActiveApFound=Aucun Point d'Accs trouv +VistumblerDonate=Faire un don +VistumblerStore=Achat en ligne +SupportVistumbler=*Support Vistumbler* +UseNativeWifi=Utiliser WiFi Natif (Aucun BSSID, CHAN, OTX, BTX, ou RADTYPE) +FilterMsg=Utiliser astrisque (*) "comme caractre de remplacement. Filtres multiples spars par une virgule (,). Utiliser un tiret (-) pour les gammes. +SetFilters=Rgler Filtres +Filters=Filtres +NoAdaptersFound=Aucun(s) Adaptateur(s) Trouv(s) +RecoveringMDB=Restaurer MDB +FixingGpsTableDates=Fixation date de table GPS(s) +FixingHistTableDates=Fixation HIST date de table(s) +VistumblerNeedsToRestart=Vistumbler doit tre redmarr. Vistumbler va maintenant se fermer. +AddingApsIntoList=Ajout de nouveaux Points d'Accs dans la liste +GoogleEarthDoesNotExist=Le fichier Google Earth n'existe pas ou est mal rgl dans les paramtres AutoKML +AutoKmlIsNotStarted=AutoKML n'est pas encore dmarr. Voulez-vous l'activer maintenant? +UseKernel32=Utiliser Kernel32 - x32 - x64 +UnableToGuessSearchwords=Vistumbler a t incapable de deviner les mots de la recherche +Filtered=Filtr +SelectedAP=Point d'Accs slectionn +AllAPs=Tous les Point d'Accs +FilteredAPs=Point d'Accs filtr +FixingGpsTableTimes=Fixation temps de table GPS(s) +ImportFolder=Importer Dossier +DeleteSelected=Supprimer Slectionn +RecoverSelected=Restaurer Slectionn +NewSession=Nouvelle Session +Size=Taille +NoMdbSelected=Aucune MDB Slectionne +LocateInWiFiDB=Localiser position dans WiFiBD +AutoWiFiDbGpsLocate=Localiser Auto WiFiBD Gps +AutoSelectConnectedAP=Slection Auto des Points d'Accs connects +Experimental=Exprimental +UploadDataToWiFiDB=Transfert Donnes vers WiFiBD +Error=Erreur +Updating=Mise jour +Downloaded=Tlcharg +Retry=Ressayer +Ignore=Ignorer +Yes=Oui +No=Non +LoadingVersionsFile=Chargement versions de fichiers +UsingLocalFile=Utilisation de fichier local +DownloadingBetaVerFile=Tlchargement versions de fichiers beta +DownloadingVerFile=Tlchargement versions de fichiers +VerFileDownloaded=Versions des fichiers tlchargs +ErrDownloadVerFile=Erreur lors du tlchargement versions de fichiers +NewFile=Nouveau fichier +UpdatedFile=Fichier Mis jour +ErrCopyingFile=Erreur copie de fichier +ErrReplacaingOldFile=Erreur en remplaant l'ancien fichier (peut-tre en cours d'utilisation) +ErrDownloadingNewFile=Erreur lors du tlchargement nouveau fichier +NoChangeInFile=Aucun changement dans le fichier +DeletedFile=Fichier supprim +ErrDeletingFile=Erreur suppression de fichier +ErrWouldYouLikeToRetryUpdate=Erreur. Voulez-vous ressayer la mise jour ? +DoneWouldYouLikeToLoadVistumbler=Fait. Voulez-vous charger Vistumbler ? +Color=Couleur +AddRemFilters=Ajouter/Effacer Filtres +NoFilterSelected=Aucun filtre slectionn. +Import=&Importer +View=&Affichage +AddFilter=Ajouter Filtre +EditFilter=Editer Filtre +DeleteFilter=Supprimer Filtre +TimeBeforeMarkedDead=Temps d'attente avant de marquer PA inactif (s) diff --git a/Installer/vi_files/Languages/Greek.ini b/Installer/vi_files/Languages/Greek.ini new file mode 100644 index 00000000..3308c750 --- /dev/null +++ b/Installer/vi_files/Languages/Greek.ini @@ -0,0 +1,393 @@ +[Info] +Author=Seferidis Kostas +Date=2012/09/10 +Description= Vistumbler v10.3 Beta 19. Netsh . windows ( ) . (cmd) "netsh wlan show networks mode = bssid" Netsh " " " Netsh" . forum Vistumbler (https://forum.techidiots.net/forum/viewtopic.php?f=27&t=533). +WindowsLanguageCode=gr_GR + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType= +Authentication= +Encryption= +Signal= +RadioType= +Channel= +BasicRates= +OtherRates= +Open= +None= +WEP=WEP +Infrastructure= +Adhoc=Adhoc +Cipher= + +[Column_Names] +Column_Line=# +Column_Active= +Column_SSID=SSID +Column_BSSID= Mac +Column_Manufacturer= +Column_Signal= +Column_Authentication= +Column_Encryption= +Column_RadioType= +Column_Channel= +Column_Latitude= +Column_Longitude= +Column_LatitudeDMS= (dd mm ss) +Column_LongitudeDMS= (dd mm ss) +Column_LatitudeDMM= (ddmm.mmmm) +Column_LongitudeDMM= (ddmm.mmmm) +Column_BasicTransferRates= (Mbps) +Column_OtherTransferRates= (Mbps) +Column_FirstActive= +Column_LastActive= +Column_NetworkType= +Column_Label= +Column_HighSignal= +Column_RSSI=RSSI +Column_HighRSSI= RSSI + +[GuiText] +Ok=&OK +Cancel=& +Apply=& +Browse=& +File=& +SaveAsTXT= TXT +SaveAsVS1= VS1 +SaveAsVSZ= VSZ +ImportFromTXT= TXT / VS1 +ImportFromVSZ= VSZ +Exit=& +ExitSaveDb= ( DB) +Edit=E& +ClearAll= +Cut= +Copy= +Paste= +Delete= +Select= +SelectAll= +Options=& +AutoSort= +SortTree= () +PlaySound= AP +AddAPsToTop= +Extra=& +ScanAPs=& +StopScanAps=& +UseGPS= &GPS +StopGPS= &GPS +Settings=& +GpsSettings= GPS +SetLanguage= +SetSearchWords= Netsh +Export=& +ExportToTXT= TXT +ExportToVS1= VS1 +ExportToCSV= CSV +ExportToKML= KML +ExportToGPX= GPX +ExportToNS1= NS1 +ExportToVSZ= VSZ +RefreshLoopTime=(ms) +ActualLoopTime= +Longitude= +Latitude= +ActiveAPs= +Graph1=&1 +Graph2=&2 +NoGraph=& . +SetMacLabel= Mac +SetMacManu= Mac +Active= +Dead= +AddNewLabel= +RemoveLabel= +EditLabel= +AddNewMan= +RemoveMan= . . +EditMan= . . +NewMac= Mac +NewMan= +NewLabel= +Save=; +SaveQuestion= . ; +GpsDetails= GPS +GpsCompass= GPS +Quality= +Time= +NumberOfSatalites= +HorizontalDilutionPosition= +Altitude= +HeightOfGeoid= +Status= +Date= +SpeedInKnots=(knots) +SpeedInMPH=(MPH) +SpeedInKmh=(km/h) +TrackAngle= +Close= +Start= +Stop= +RefreshingNetworks= +RefreshTime= +SetColumnWidths= +Enable= +Disable= +Checked= +UnChecked= +Unknown= +Restart= +RestartMsg= Vistumbler +NoSignalHistory= , +NoApSelected= +UseNetcomm= Netcomm OCX ( ) - x32 +UseCommMG= CommMG ( ) - x32 - x64 +SignalHistory= +AutoSortEvery= +Seconds= +Ascending= +Decending= +AutoSave= +AutoSaveEvery= +DelAutoSaveOnExit= . +OpenSaveFolder= +SortBy= +SortDirection= +Auto= +Misc= +GPS=GPS +Labels= +Manufacturers= +Columns= +Language= +SearchWords= +VistumblerSettings= Vistumbler +LanguageAuthor= +LanguageDate= +LanguageDescription= +Description= +Progress= +LinesMin=/ +NewAPs= APs +NewGIDs= GIDs +Minutes= +LineTotal=/ +EstimatedTimeRemaining= +Ready= +Done= +VistumblerSaveDirectory= Vistumbler +VistumblerAutoSaveDirectory= Vistumbler +VistumblerKmlSaveDirectory= Vistumbler KML +BackgroundColor= +ControlColor= +BgFontColor= +ConFontColor= +NetshMsg= windows . (cmd) "netsh wlan show networks mode = bssid" " Netsh" . +PHPgraphing= PHP +ComInterface= Com +ComSettings= Com +Com=Com +Baud= +GPSFormat=GPS +HideOtherGpsColumns= GPS +ImportLanguageFile= +AutoKml= KML +GoogleEarthEXE=Google Earth EXE +AutoSaveKmlEvery= KML +SavedAs= +Overwrite= +InstallNetcommOCX= Netcomm OCX +NoFileSaved= +NoApsWithGps= Access Point GPS +MacExistsOverwriteIt= mac , ; +SavingLine= +Debug= +DisplayDebug= - +DisplayDebugCom= COM +GraphDeadTime= +OpenKmlNetLink= KML NetworkLink +ActiveRefreshTime= +DeadRefreshTime= +GpsRefrshTime= GPS +FlyToSettings= " " +FlyToCurrentGps=" " GPS +AltitudeMode= +Range= +Heading= +Tilt= +AutoOpenNetworkLink= KML Network Link +SpeakSignal= +SpeakUseVisSounds=. Vistumbler +SpeakUseSapi= Microsoft Sound API +SpeakSayPercent= "%" +GpsTrackTime= +SaveAllGpsData= GPS +None= +Even= +Odd= +Mark= +Space= +StopBit=Bit +Parity= +DataBit=Bit +Update= +UpdateMsg= . Vistumbler ; +Recover= +RecoverMsg= . ; +SelectConnectedAP= +VistumblerHome= Vistumbler +VistumblerForum=Vistumbler +VistumblerWiki=Vistumbler Wiki +CheckForUpdates= +SelectWhatToCopy= +Default= +PlayMidiSounds= MIDI +Interface= +LanguageCode= +AutoCheckUpdates= +CheckBetaUpdates= Beta +GuessSearchwords= Netsh +Help= +ErrorScanningNetsh= netsh +GpsErrorBufferEmpty= GPS. 10 . GPS . GPS +GpsErrorStopped= GPS. GPS +ShowSignalDB= dB () +SortingList= +Loading= +MapOpenNetworks= +MapWepNetworks=WEP +MapSecureNetworks=Map Secure Networks +DrawTrack= +UseLocalImages= +MIDI=MIDI +MidiInstrumentNumber=MIDI # +MidiPlayTime= MIDI +SpeakRefreshTime= +Information= +AddedGuessedSearchwords= netsh . "", "", "WEP", "" "Adhoc" . +SortingTreeview= +Recovering= +ErrorOpeningGpsPort= GPS +SecondsSinceGpsUpdate= GPS +SavingGID= GID +SavingHistID= HistID +NoUpdates= +NoActiveApFound= +VistumblerDonate= +VistumblerStore= +SupportVistumbler=* Vistumbler* +FilterMsg= (*)" . (,). (-) +SetFilters= +Filters= +NoAdaptersFound= +RecoveringMDB= MDB +FixingGpsTableDates= GPS +FixingHistTableDates= HIST +VistumblerNeedsToRestart= Vistumbler. Vistumbler +AddingApsIntoList= +GoogleEarthDoesNotExist= Google earth KML +AutoKmlIsNotStarted= KML . ; +UseKernel32= Kernel32 - x32 - x64 +UnableToGuessSearchwords= Vistumbler +Filtered= +SelectedAP= +AllAPs= +FilteredAPs= +FixingGpsTableTimes= GPS +ImportFolder= +DeleteSelected= +RecoverSelected= +NewSession= +Size= +NoMdbSelected= MDB +LocateInWiFiDB= WiFiDB +AutoWiFiDbGpsLocate= WiFiDB GPS +AutoSelectConnectedAP= +Experimental=Beta +UploadDataToWiFiDB= WiFiDB +Error= +Updating= +Downloaded= +Retry= +Ignore= +Yes= +No= +LoadingVersionsFile= +UsingLocalFile= +DownloadingBetaVerFile= beta +DownloadingVerFile= +VerFileDownloaded= +ErrDownloadVerFile= +NewFile= +UpdatedFile= +ErrCopyingFile= +ErrReplacaingOldFile= ( ) +ErrDownloadingNewFile= +NoChangeInFile= +DeletedFile= +ErrDeletingFile= +ErrWouldYouLikeToRetryUpdate=. ; +DoneWouldYouLikeToLoadVistumbler=. Vistumbler ; +Color= +AddRemFilters=/ +NoFilterSelected= . +Import=& +View=& +AddFilter= +EditFilter= +DeleteFilter= +TimeBeforeMarkedDead= () () +FilterNameRequired= +UpdateManufacturers= +FixHistSignals= +VistumblerFile= Vistumbler +DetailedFile= +NetstumblerTxtFile= Netstumbler +WardriveDb3File= android Wardrive +AutoScanApsOnLaunch= +RefreshInterfaces= +NoAps= . +AutoSelectHighSigAP= +Sound= +OncePerLoop= +OncePerAP= +OncePerAPwSound= . +PhilsPHPgraph=Graph URL +PhilsWDB=WiFiDB URL +PhilsWdbLocate=WifiDB Locate URL +PhilsWifiTools=Phil's WiFi Tools +AutoWiFiDbUploadAps= WiFiDB +WifiDB=WifiDB +Warning= +WifiDBLocateWarning= WifiDB API WifiDB Vistumbler. WifiDB, . ; +WifiDBAutoUploadWarning= WifiDB API WifiDB Vistumbler. WifiDB, . ; +WifiDBOpenLiveAPWebpage= WifiDB Live AP +WifiDBOpenMainWebpage= WifiDB +FilePath= +CameraName= +CameraURL=URL +Cameras=() +AddCamera= +RemoveCamera= +EditCamera= +UseNativeWifiMsg= Wi-Fi +UseNativeWifiXpExtMsg=( BSSID, CHAN, OTX, BTX) +DownloadImages= +EnableCamTriggerScript= +SetCameras= +UpdateUpdaterMsg= Vistumbler. ; +UseRssiInGraphs= RSSI +2400ChannelGraph= 2.4Ghz +5000ChannelGraph= 5Ghz +UpdateGeolocations= +Graph= +ShowGpsPositionMap= GPS +ShowGpsSignalMap= GPS +UseRssiSignalValue= RSSI +UseCircleToShowSigStength= +ShowGpsRangeMap= GPS +ShowGpsTack= GPS \ No newline at end of file diff --git a/Installer/vi_files/Languages/Italiano.ini b/Installer/vi_files/Languages/Italiano.ini new file mode 100644 index 00000000..040eb23e --- /dev/null +++ b/Installer/vi_files/Languages/Italiano.ini @@ -0,0 +1,429 @@ +[Info] +Author=Mimmo17 +Date=2014/06/27 +Description=Italian SearchWords. Italian Text. Updated for v10.5.1 Beta4 by Mimmo17 +WindowsLanguageCode=it_IT + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Tipo di rete +Authentication=Autenticazione +Encryption=Crittografia +Signal=Segnale +RadioType=Tipo Frequenza Radio +Channel=Canale +BasicRates=Velocit di base +OtherRates=Altre Velocit +Open=Aperto +None=Nessuno +WEP=WEP +Infrastructure=Infrastructure +Adhoc=Adhoc +Cipher=Cipher +RSSI=RSSI + +[Column_Names] +Column_Line=# +Column_Active=Stato +Column_SSID=SSID +Column_BSSID=Mac Address +Column_Manufacturer=Produttore +Column_Signal=Segnale +Column_Authentication=Autenticazione +Column_Encryption=Crittografia +Column_RadioType=IEEE 802.11 +Column_Channel=Canale +Column_Latitude=Latitudine +Column_Longitude=Longitudine +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) +Column_BasicTransferRates=Velocit di base +Column_OtherTransferRates=Altre Velocit +Column_FirstActive=Primo Rilevamento +Column_LastActive=Ultimo Rilevamento +Column_NetworkType=Rete +Column_Label=Etichetta +Column_HighSignal=Segnale Massimo +Column_RSSI=RSSI +Column_HighRSSI=RSSI Massimo + +[GuiText] +Ok=&Ok +Cancel=A&nnulla +File=&File +SaveAsTXT=Salva Come file .TXT +SaveAsVS1=Salva Come file .VS1 +SaveAsVSZ=Salva Come file .VSZ +ImportFromTXT=Importa Da file .TXT +ImportFromVSZ=Importa Da file .VSZ +Exit=E&sci +Edit=M&odifica +Cut=Taglia +Copy=Copia +Paste=Incolla +Delete=Elimina +Select=Seleziona +SelectAll=Seleziona Tutto +Options=&Preferenze +AutoSort=Ordina Automaticamente +SortTree=Riordina Risultati +AddAPsToTop=Mostra nuovi AP in cima alla lista +ScanAPs=&Avvia +StopScanAps=&Stop +UseGPS=Usa &GPS +StopGPS=Stop &GPS +Settings=I&mpostazioni +GpsSettings=Impostazioni GPS +SetLanguage=Cambia Lingua +SetSearchWords=Imposta le chiavi di ricerca "Netsh" +RefreshLoopTime=Aggiornamento Automatico (ms) +ActualLoopTime=Aggiornamento Attuale +Longitude=Longitudine +Latitude=Latitudine +ActiveAPs=AP Attivi +PlaySound=Riproduci un suono quando viene rilevato un nuovo AP +Graph1=Grafico &1 +Graph2=Grafico &2 +NoGraph=&Chiudi +Export=Es&porta +ExportToKML=Esporta file KML +ExportToTXT=Esporta file TXT +ExportToNS1=Esporta file NS1 +ExportToVS1=Esporta file VS1 +ExportToGPX=Esporta file GPX +ExportToCSV=Esporta file CSV +Extra=Ex&tra +PhilsPHPgraph=Visualizza Grafico (Phil's PHP) +PhilsWDB=Phils WiFiDB (Alpha) +SetMacLabel=Imposta Etichette da Mac Address +SetMacManu=Imposta Produttore da Mac Address +Active=Attivo +Dead=Inattivo +AddNewLabel=Nuova Etichetta +RemoveLabel=Rimuovi Etichetta Selezionata +EditLabel=Modifica Etichetta Selezionata +AddNewMan=Nuovo Produttore +RemoveMan=Rimuovi Selezione +EditMan=Modifica Selezione +NewMac=Mac Address: +NewMan=Produttore: +NewLabel=Etichetta: +Save=Salva Elenco +SaveQuestion=Desideri Salvare l'elenco delle reti trovate? +PhilsMultiPHPgraph=Crea Grafico degli AP (Phil's PHP) +GpsDetails=Dettagli GPS +Quality=Qualit +Time=Ora +NumberOfSatalites=Numero Satelliti +HorizontalDilutionPosition=Diluizione della Precisione Orizzontale +Altitude=Altitudine +HeightOfGeoid=Altezza del Geoide +Status=Stato +Date=Data +SpeedInKnots=Velocit (Nodi) +SpeedInMPH=Velocit (MPH) +SpeedInKmh=Velocit (Km/h) +TrackAngle=Angolo di Traiettoria +Close=Chiudi +ConnectToWindowName=Connessione a una rete +RefreshingNetworks=Aggiornamento Reti Automatico +Start=Avvia +Stop=Termina +ConnectToWindowTitle=Titolo finestra "Connessione a una rete": +RefreshTime=Tempo di Aggiornamento +Enable=Visualizza +Disable=Nascondi +Checked=Selez. +UnChecked=Deselez. +Restart=Riavvia +RestartMsg=Riavviare Vistumbler per apportare le modifiche alla lingua +NoSignalHistory=Impossibile trovare le informazioni, controllare che le search words di "netsh" siano corrette +NoApSelected=Non hai selezionato un Access Point +UseNetcomm=Usa Netcomm OCX (pi stabile) - x32 +UseCommMG=Usa CommMG - x32 - x64 +SignalHistory=Storia Segnale +SetColumnWidths=Larghezza Colonne +GraphDeadTime=Includi nei Grafici l'assenza di Segnale +AutoSortEvery=Ordina ogni: +Seconds=Secondi +Ascending=Ascendente +Decending=Discendente +AutoSave=Salvataggio Automatico +AutoSaveEvery=Salva Ogni: +DelAutoSaveOnExit=Cancella all'uscita +OpenSaveFolder=Apri Cartella Salvataggi +Unknown=Sconosciuto +Apply=&Applica +Browse=&Sfoglia +SortBy=Ordina per: +SortDirection=Mostra in ordine: +Auto=Salvataggi Automatici +Misc=Varie +GPS=GPS +Labels=Etichette +Manufacturers=Produttori +Columns=Colonne +Language=Lingua +SearchWords=SearchWords +VistumblerSettings=Impostazioni Vistumbler +LanguageAuthor=Autore +LanguageDate=Data +LanguageDescription=Descrizione +Description=Descrizione +Progress=Progresso +LinesMin=Linee/Min +NewAPs=Nuovi AP +NewGIDs=Nuovi GID +Minutes=Minuti +LineTotal=Linea/Totale +EstimatedTimeRemaining=Tempo Stimato +Ready=Pronto +Done=Fatto +VistumblerSaveDirectory=Percorso Salvataggi +VistumblerAutoSaveDirectory=Percorso Salvataggi Automatici +VistumblerKmlSaveDirectory=Percorso Salvataggi KML +BackgroundColor=Colore di Sfondo +ControlColor=Colore di Sfondo dei Grafici +BgFontColor=Colore Fonts +ConFontColor=Colore Fonts dei Grafici +NetshMsg=Questa sezione consente di cambiare le chiavi usate da Vistumbler per la ricerca netsh. Le chiavi cambiano a seconda della versione di Windows. Esegui "netsh wlan show networks mode = bssid" per visualizzarle. +PHPgraphing=Grafici PHP +ComInterface=Interfaccia Com +ComSettings=Impostazioni Com +Com=Com +Baud=Baud +GPSFormat=Formato GPS +HideOtherGpsColumns=Nascondi Altre Colonne GPS +ImportLanguageFile=Importa Lingua da File +AutoKml=KML Automatico (Google Earth) +GoogleEarthEXE=Percorso di installazione Google Earth +AutoSaveKmlEvery=Salva Automaticamente KML Ogni: +ImportFromNS=Importa da Netstumbler +ClearAll=Cancella Risultati +SavedAs=Salvato Come +Overwrite=Sovrascrivi +InstallNetcommOCX=Installa Netcomm OCX +NoFileSaved=Nessun file stato salvato +NoApsWithGps=Non sono stati trovati Access Point con coordinate GPS. +MacExistsOverwriteIt=Una voce per questo Mac Address gi esistente. Vuoi sovrascriverla? +SavingLine=Salvataggio Linea +DisplayDebug=Mostra Debug +AutoSaveKmlEvery=Salva KML Ogni: +GpsCompass=Bussola Gps +OpenKmlNetLink=Apri KML NetworkLink +GraphDeadTime=Includi nei Grafici l'assenza di Segnale +ActiveRefreshTime=T.Agg. AP Attivi +DeadRefreshTime=T.Agg. AP Inattivi +GpsRefrshTime=T.Agg. GPS +FlyToSettings=Impostazioni Visualizzazione +FlyToCurrentGps=Mostra la Posizione corrente del GPS +AltitudeMode=Modalit Altitudine +Range=Estensione +Heading=Direzione +Tilt=Inclinazione +AutoOpenNetworkLink=Apri Automaticamente KML Network Link +SpeakSignal=Sintesi Vocale +SpeakUseVisSounds=Usa i File Audio di Vistumbler +SpeakUseSapi=Usa i Suoni API Microsoft +SpeakSayPercent=Includi "Percento" dopo il segnale +GpsTrackTime=T.Agg. Traccia GPS +SaveAllGpsData=Salva i Dati GPS quando non ci sono AP attivi +None=Nessuno +Even=Even +Odd=Odd +Mark=Mark +Space=Space +ExitSaveDb=Salva e Chiudi +Update=Aggiornamento Online +UpdateMsg=Aggiornamento Disponibile. Desideri aggiornare Vistumbler? +Recover=Ripristina +RecoverMsg=E' stato trovato un vecchio DB. Desideri ripristinarlo? +SelectConnectedAP=Seleziona AP Attualmente Connesso +VistumblerHome=Sito ufficiale di Vistumbler +VistumblerForum=Forum Vistumbler +VistumblerWiki=Vistumbler Wiki +CheckForUpdates=Cerca Aggiornamenti +SelectWhatToCopy=Seleziona cosa vuoi copiare +Default=Predefinito +PlayMidiSounds=Esegui suoni MIDI per tutti gli AP attivi +Interface=Interfaccia +LanguageCode=Codice Lingua +AutoCheckUpdates=Aggiornamenti Automatici +CheckBetaUpdates=Cerca Aggiornamenti Beta +GuessSearchwords=Cerca Chiavi Netsh +Help=Aiuto +ErrorScanningNetsh=Errore durante la scansione netsh +GpsErrorBufferEmpty=Errore GPS. Buffer Vuoto per pi di 10 secondi. Possibile disconnessione con il GPS. La Registrazione GPS stata interrotta +GpsErrorStopped=Errore GPS. La Registrazione GPS stata interrotta +ShowSignalDB=Mostra dB Segnale (stimati) +SortingList=Riordino Lista +Loading=Caricamento in corso +MapOpenNetworks=Segnala Reti Aperte +MapWepNetworks=Segnala Reti con Protezione WEP +MapSecureNetworks=Segnala Reti Sicure +DrawTrack=Traccia Percorso +UseLocalImages=Utilizza Immagini Locali +MIDI=MIDI +MidiInstrumentNumber=Strumenti MIDI # +MidiPlayTime=Tempo Esecuzione MIDI +SpeakRefreshTime=Tempo Aggiornamento Voce +Information=Informazione +AddedGuessedSearchwords=Chiavi netsh aggiunte alla lista. Le Chiavi Open, None, WEP, Infrustructure, Adhoc devono essere inserite manualmente +SortingTreeview=Sorting Treeview +Recovering=Ripristino in corso +VistumblerFile=File di Vistumbler +NetstumblerTxtFile=File TXT di Netstumbler +ErrorOpeningGpsPort=Errore durante l'apertura della porta GPS +SecondsSinceGpsUpdate=Tempo Trascorso dall'ultimo Aggiornamento del GPS +SavingGID=Salvataggio GID +SavingHistID=Salvataggio HistID +UpdateFound=Aggiornamento Disponibile. Desideri aggiornare Vistumbler? +NoUpdates=Nessun Aggiornamento Disponibile +NoActiveApFound=Nessun AP Attivo +VistumblerDonate=Donazioni +VistumblerStore=Vistumbler Store +SupportVistumbler=*Supporta Vistumbler* +StopBit=Stop Bit +Parity=Parit +DataBit=Data Bit +ExportToGPX=Esporta file GPX +UseNativeWifi=Usa WiFi Nativo (No BSSID, CHAN, OTX, BTX, RADTYPE) +FilterMsg=Usa asterisco(*)" come wildcard. Separa pi filtri con una virgola (,). Usa (-) per i range. +SetFilters=Imposta Filtri +Filters=Filtri +NoAdaptersFound=Nessuna Periferica Rilevata +RecoveringMDB=Ripristino MDB +FixingGpsTableDates=Correzione tablella GPS +FixingHistTableDates=Correzione tabella HIST +VistumblerNeedsToRestart=Vistumbler deve essere riavviato. L'applicazione verr chiusa +AddingApsIntoList=Inserimento nuovi APs nella lista +GoogleEarthDoesNotExist=Il file Google earth non esiste o non stato configurato correttamente nelle impostazioni AutoKML +AutoKmlIsNotStarted=AutoKML non attivo. Vuoi attivarlo adesso? +UseKernel32=Usa Kernel32 - x32 - x64 +UnableToGuessSearchwords=Vistumbler non riuscito a trovare le searchwords, necessario inserirle manualmente +UploadDataToWiFiDB=Carica Dati su WiFiDB +Error=Errore +Filtered=Filtri +FixingGpsTableTimes=Correzione GPS table time(s) +SelectedAP=AP Selezionati +AllAPs=Tutti gli AP +FilteredAPs=AP Filtrati +ImportFolder=Importa Cartella +DeleteSelected=Elimina Selezione +RecoverSelected=Ripristina Selezione +NewSession=Nuova Sessione +Size=Dimensioni +NoMdbSelected=Nessun MDB Selezionato +LocateInWiFiDB=Trova Posizione su WiFiDB +AutoWiFiDbGpsLocate=Localizzazione GPS Automatica su WiFiDB +AutoSelectConnectedAP=Seleziona Automaticamente l'AP Attualmente Connesso +Experimental=Sperimentale +Color=Colore +Updating=Aggiornamento in corso +Downloaded=Scaricato +Retry=Riprova +Ignore=Ignora +Yes=Si +No=No +LoadingVersionsFile=Caricamento Versione Corrente +UsingLocalFile=File locali +DownloadingBetaVerFile=Download Versione Beta in corso +DownloadingVerFile=Download in corso +VerFileDownloaded=File Scaricato +ErrDownloadVerFile=Errore durante il Download del File +NewFile=Nuovo File +UpdatedFile=File Aggiornato +ErrCopyingFile=Errore durante la Copia dei Files +ErrReplacaingOldFile=Errore durante la sostituzione dei vecchi Files (Files in uso?) +ErrDownloadingNewFile=Errore durante il download dei nuovi Files +NoChangeInFile=Nessun cambiamento nel file +DeletedFile=File Eliminato +ErrDeletingFile=Errore durante l'eliminazione del file +ErrWouldYouLikeToRetryUpdate=Errore. Desideri riavviare l'aggiornamento? +DoneWouldYouLikeToLoadVistumbler=Fatto. Desideri avviare Vistumbler? +PhilsWifiTools=Phil's WiFi Tools +Color=Colore +AddRemFilters=Aggiungi/Rimuovi Filtri +NoFilterSelected=Nessun filtro selezionato. +Import=&Importa +View=&Visualizza +AddFilter=Aggiungi Filtro +EditFilter=Modifica Filtro +DeleteFilter=Elimina Filtro +TimeBeforeMarkedDead=Attendi prima di contrassegnare un AP come inattivo (s) +DetailedFile=File CSV Dettagliato +ExportToVSZ=Esporta file VSZ +FilterNameRequired=Filtro Nome richiesto +UpdateManufacturers=Aggiorna Produttori +FixHistSignals=Fixing Missing Hist Table Signal(s) +WardriveDb3File=File Wardrive-android +AutoScanApsOnLaunch=Scansione Automatica all'Avvio +RefreshInterfaces=Aggiorna Interfacce +NoAps=Nessun Access Point. +AutoSelectHighSigAP=Seleziona Automaticamente l'AP con il miglior segnale +Sound=Suoni +OncePerLoop=Uno per ciclo +OncePerAP=Uno per AP +OncePerAPwSound=Uno per AP con volume in base al segnale +PhilsPHPgraph=URL Grafico +PhilsWDB=URL WiFiDB +PhilsWdbLocate=WiFiDB Locate URL +PhilsWifiTools=Phil's WiFi Tools +Graph=Grafico +Debug=Debug +DisplayDebugCom=Mostra Errori COM +UseNativeWifiMsg=Usa WiFi Nativo +UseNativeWifiXpExtMsg=(No BSSID, CHAN, OTX, BTX) +FilterName=Nome Filtro +FilterDesc=Descrizione Filtro +FilterAddEdit=Aggiungi/Modifica Filtro +AutoWiFiDbUploadAps=Upload Automatico AP Attivi +SummaryFile=Summary Comma Delimited file +WifiDB=WiFiDB +Warning=Attenzione +WifiDBLocateWarning=Questa funzione invia le informazioni sugli AP attivi all'URL specificata nelle impostazioni WiFiDB. Se preferisci non inviare dati a WiFidb, non abilitare questa funzione. Desideri continuare? +WifiDBAutoUploadWarning=Questa funzione invia le informazioni sugli AP attivi all'URL specificata nelle impostazioni WiFiDB. Se preferisci non inviare dati a WiFidb, non abilitare questa funzione. Desideri continuare? +WifiDBOpenLiveAPWebpage=Apri Pagina Live AP +WifiDBOpenMainWebpage=Apri Pagina Principale di WiFiDB +FilePath=Percorso File +CameraName=Nome Network Camera +CameraURL=URL +Cameras=Network Camera +AddCamera=Aggiungi +RemoveCamera=Rimuovi +EditCamera=Modifica +DownloadImages=Scarica Immagini +EnableCamTriggerScript=Abilita script +CameraTriggerScript=Script Camera +CameraTriggerScriptTypes=Tipo Script (exe,bat) +SetCameras=Imposta Network Cameras +UpdateUpdaterMsg=E' disponibile una nuova versione di Vistumbler Updater. Desideri scaricarla adesso? +UseRssiInGraphs=Usa RSSI nei grafici +2400ChannelGraph=Grafico Canali 2.4Ghz +5000ChannelGraph=Grafico Canali 5Ghz +UpdateGeolocations=Aggiorna Geolocations +ShowGpsPositionMap=Mostra GPS Position Map +ShowGpsSignalMap=Mostra GPS Signal Map +UseRssiSignalValue=Usa valori segnale RSSI +UseCircleToShowSigStength=Mostra la potenza del segnale con un cerchio +ShowGpsRangeMap=Mostra GPS Range Map +ShowGpsTack=Visualizza Traccia GPS +Line=Linea +Total=Totale +WifiDB_Upload_Discliamer=Questa funzione carica i dati degli AP su WiFiDB. E' necessario specificare l'URL della API WiFiDB nelle impostazioni. +UserInformation=Informazioni Utente +WifiDB_Username=Username WiFiDB +WifiDB_Api_Key=WiFiDB Api Key +OtherUsers=Altri Utenti +FileType=Tipo di File +VistumblerVSZ=Vistumbler VSZ +VistumblerVS1=Vistumbler VS1 +VistumblerCSV=Vistumbler Detailed CSV +UploadInformation=Carica Informazioni +Title=Titolo +Notes=Note +UploadApsToWifidb=Carica i risultati su WiFiDB +UploadingApsToWifidb=Upload su WiFiDB in corso diff --git a/Installer/vi_files/Languages/Japanese.ini b/Installer/vi_files/Languages/Japanese.ini new file mode 100644 index 00000000..ddf9a217 --- /dev/null +++ b/Installer/vi_files/Languages/Japanese.ini @@ -0,0 +1,301 @@ +[Info] +Author=Takekatsu HIRAMURA (thira@plavox.info) +Date=2009/07/05 +Description={̌[hƓ{̃eLXgB +WindowsLanguageCode=ja_JP + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=lbg[N̎ +Authentication=F +Encryption=Í +Signal=VOi +RadioType=^Cv +Channel=`l +BasicRates={[g +OtherRates=̃[g +Open=J +None=Ȃ +WEP=WEP +Infrastructure=CtXgN` +Adhoc=AhzbN + +[Column_Names] +Column_Line=# +Column_Active= +Column_SSID=SSID +Column_BSSID=MAC AhX +Column_Manufacturer= +Column_Signal=VOi̋ +Column_Authentication=F +Column_Encryption=Í +Column_RadioType=lbg[N̎ +Column_Channel=`l +Column_Latitude=ܓx +Column_Longitude=ox +Column_LatitudeDMS=ܓx (DMS `) +Column_LongitudeDMS=ox (DMS `) +Column_LatitudeDMM=ܓx (DMM `) +Column_LongitudeDMM=ox (DMM `) +Column_BasicTransferRates={][g +Column_OtherTransferRates=̓][g +Column_FirstActive=ŏɃANeBuɂȂ +Column_LastActive=ŌɊmF +Column_NetworkType=lbg[N̎ +Column_Label=x + +[GuiText] +Ok=&OK +Cancel=LZ(&C) +Apply=Kp(&A) +Browse=Q(&B) +File=t@C(&F) +SaveAsTXT=eLXg t@CƂĕۑ +SaveAsVS1=VS1 t@CƂĕۑ +SaveAsVSZ=VSZ t@CƂĕۑ +ImportFromTXT=TXT / VS1 t@Cǂݍ +ImportFromVSZ=VSZ t@Cǂݍ +Exit=I +ExitSaveDb=DB ۑďI +Edit=ҏW(&D) +ClearAll=ׂď +Cut=؂ +Copy=Rs[ +Paste=\t +Delete=폜 +Select=I +SelectAll=ׂđI +Options=IvV(&O) +AutoSort=IɃ\[g +SortTree=c[ r[ (Ԃ܂) +PlaySound=V AP ‚特‚炷 +AddAPsToTop=V AP ͏ɒlj +Extra=ڍ(T) +ScanAPs=XL(&S) +StopScanAps=~(&S) +UseGPS=GPS(&G) +StopGPS=GPS ~ +Settings=ݒ(&E) +GpsSettings=GPS ̐ݒ +SetLanguage=̐ݒ +SetSearchWords=Netsh [h̐ݒ +Export=GNX|[g(&P) +ExportToKML=KML t@CփGNX|[g +ExportToGPX=GPX t@CփGNX|[g +ExportToTXT=TXT t@CփGNX|[g +ExportToVS1=VS1 t@CփGNX|[g +ExportToNS1=NS1 t@CփGNX|[g +PhilsPHPgraph=Ot\ (Phil's PHP version) +PhilsWDB=Phil WiFi f[^x[X (Alpha) +RefreshLoopTime=JԂԊu (~b) +ActualLoopTime=JԂԊu +Longitude=ox +Latitude=ܓx +ActiveAPs=ANeBu AP ̐ +Graph1=Ot&1 +Graph2=Ot&2 +NoGraph=߂(&N) +SetMacLabel=MAC AhXɃxt +SetMacManu=MAC AhX琻ݒ肷 +Active=ANeBu +Dead=r +AddNewLabel=Vx +RemoveLabel=Ix폜 +EditLabel=IxҏW +AddNewMan=lj +RemoveMan=I폜 +EditMan=IҏW +NewMac=V MAC AhX +NewMan=V +NewLabel=V x +Save=ۑ +SaveQuestion=f[^ύX܂Bۑ܂H +GpsDetails=GPS ̏ڍ +GpsCompass=GPS RpX +Quality=x +Time= +NumberOfSatalites=q̐ +HorizontalDilutionPosition={ +Altitude=x +HeightOfGeoid=GEOID ̍ +Status= +Date=t +SpeedInKnots=x (mbg) +SpeedInMPH=x (MPH) +SpeedInKmh=x (km/h) +TrackAngle=OՂ̊px +Close=‚ +Start=Jn : +Stop=~ : +RefreshingNetworks=lbg[NݒXV +RefreshTime=XVԊu +SetColumnWidths=ڂ̕ +Enable=L +Disable= +Checked=`FbN +UnChecked=`FbN +Unknown=s +Restart=ċN +RestartMsg=̐ݒ𔽉f邽߂ Vistumbler ċNĂ +NoSignalHistory=VOi̗‚܂BNetsh [hݒ肳Ă邩mFĂ +NoApSelected=AP IĂ܂ +UseNetcomm=Netcomm OCX g - 32bit +UseCommMG=CommMG g (s) - 32bit, 64bit +SignalHistory=VOi +AutoSortEvery=\[g̊Ԋu +Seconds=b +Ascending= +Decending= +AutoSave=ŕۑ +AutoSaveEvery=Ɏŕۑ +DelAutoSaveOnExit=ۑtH_폜ďI +OpenSaveFolder=ۑtH_J +SortBy=\[g +SortDirection=\[g +Auto= +Misc= +GPS=GPS +Labels=x +Manufacturers= +Columns= +Language= +SearchWords=[h +VistumblerSettings=ݒ +LanguageAuthor=t@C̍ +LanguageDate=t@C̓t +LanguageDescription=t@C̏ڍ +Description=ڍ +Progress=i +LinesMin=s/b +NewAPs=V AP +NewGIDs=V GID +Minutes= +LineTotal=s/v +EstimatedTimeRemaining=c莞 +Ready= +Done= +VistumblerSaveDirectory=Vistumbler ŕۑtH_ +VistumblerAutoSaveDirectory=Vistumbler ŎۑtH_ +VistumblerKmlSaveDirectory=Vistumbler KML t@CۑtH_ +BackgroundColor=wiF +ControlColor=pl̐F +BgFontColor=F +ConFontColor=pl̕F +NetshMsg=netsh R}ȟʂ Vistumbler ǂݍގɎgp̌[hύX邱Ƃł܂Bgpo[W Windows ̕ɍ킹ĕύXĂB"netsh wlan show networks mode = bssid" R}hs΁Ap̕\܂B +PHPgraphing=PHP ŃOt`悷ۂ̐ݒ +ComInterface=COM C^[tF[X +ComSettings=COM ݒ +Com=COM |[g +Baud=ʐMx +GPSFormat=GPS ̏ +HideOtherGpsColumns= GPS ̍ڂB +ImportLanguageFile=t@Cǂݍ +AutoKml=KML ̎XV +GoogleEarthEXE=Google Earth ̏ꏊ +AutoSaveKmlEvery= KML t@CIɕۑ +SavedAs=ۑ : +Overwrite=㏑ +InstallNetcommOCX=Netcomm OCX Kvł +NoFileSaved=t@C͕ۑ܂ł +NoApsWithGps=GPS Ŵ‚ AP ܂B +MacExistsOverwriteIt=͂ꂽ MAC AhX͂łɑ݂܂B㏑܂H +SavingLine=Saving Line +DisplayDebug=s̊֐\ (fobOp) +GraphDeadTime=rĂ鎞Ot`悷 +OpenKmlNetLink=KML NetworkLink J +ActiveRefreshTime=ANeBu AP ̍XVԊu +DeadRefreshTime=r AP ̍XVԊu +GpsRefrshTime=GPS ̍XVԊu +FlyToSettings=ԍۂ̐ݒ +FlyToCurrentGps=݂̏ꏊ֔ +AltitudeMode=W[h +Range=͈ +Heading=p (x) +Tilt=`g +AutoOpenNetworkLink=I KML NetworkLink J +SpeakSignal=VOi̋Œʒm +SpeakUseVisSounds=Vistumbler ̃TEht@Cgp +SpeakUseSapi=Microsoft ̃TEh API gp +SpeakSayPercent=p[ZǧɃVOiʒm +GpsTrackTime=OՂ̍XVԊu +SaveAllGpsData=AP ‚Ȃꍇ GPS f[^ۑ +None=Ȃ +Even= +Odd= +Mark= +Space=Xy[X +StopBit=Xgbv rbg +Parity=peB +DataBit=f[^ rbg +Update=XV +UpdateMsg=XV‚܂BVistumbler Abvf[g܂? +Recover=C +RecoverMsg= DB ‚܂BCs܂? +SelectConnectedAP=ڑĂ AP I +VistumblerHome=Vistumbler z[ +VistumblerForum=Vistumbler tH[ +VistumblerWiki=Vistumbler Wiki +CheckForUpdates=XVmF +SelectWhatToCopy=Rs[̂Ił +Default=ftHg +PlayMidiSounds=ANeBu AP MIDI Đ +Interface=C^[tF[X +LanguageCode=R[h +AutoCheckUpdates=IɍXVmF +CheckBetaUpdates=x[^ł̍XVmF +GuessSearchwords=Netsh [hŐ +Help=wv +ErrorScanningNetsh=Netsh ɃG[N܂B +GpsErrorBufferEmpty=GPS G[BGPS 10 bȏ㉞܂łBGPS ~܂B +GpsErrorStopped=GPS G[BGPS ~܂B +ShowSignalDB=VOi dB \(l) +SortingList=Xg\[g +Loading=ǂݍݒ +MapOpenNetworks=I[vȃlbg[N}bv +MapWepNetworks=WEP ̃lbg[N}bv +MapSecureNetworks=ZLAȃlbg[N}bv +DrawTrack=OՂ` +UseLocalImages=[J̉摜gp +MIDI=MIDI +MidiInstrumentNumber=MIDI @ԍ +MidiPlayTime=MIDI Đ鎞 +SpeakRefreshTime=ĐԊu +Information= +AddedGuessedSearchwords= netsh L[[hlj܂BOpen, None, WEP, Infrustructure, Adhoc ̍ڂ͎ƂŊĂB +SortingTreeview=c[r[\[gĂ܂ +Recovering=C +VistumblerFile=Vistumbler t@C +NetstumblerTxtFile=Netstumbler eLXgt@C +ErrorOpeningGpsPort=GPS |[gJ܂ł +SecondsSinceGpsUpdate=GPS XVĂ̌oߕb +SavingGID=GID ۑ +SavingHistID=HistID ۑ +UpdateFound=XV‚܂BVistumbler Abvf[g܂? +NoUpdates=XV͂܂ +NoActiveApFound=ANeBu AP ‚܂ +VistumblerDonate=t +VistumblerStore=Vistumbler XgA +SupportVistumbler=*Vistumblerx* +UseNativeWifi=lCeBu Wifi g (BSSID, CHAN, OTX, BTX, RADTYPE 擾Ȃ) +FilterMsg=AX^XN(*)" ChJ[hAR}(,)؂蕶AnCt(-) Ŕ͈͂w肵܂B +SetFilters=tB^ݒ +Filters=tB^ +NoAdaptersFound=A_v^‚܂ +RecoveringMDB=MDB C +FixingGpsTableDates=GPS e[uC +FixingHistTableDates=Hist e[u C +VistumblerNeedsToRestart=Vistumbler ċNKv܂B{^ƏI܂B +AddingApsIntoList=XgɐV AP lj +GoogleEarthDoesNotExist=Google earth t@CȂ AutoKML ̐ݒ肪ԈĂ܂ +AutoKmlIsNotStarted=AutoKML JnĂ܂BJn܂? +UseKernel32=Kernel32 g - 32bit, 64bit +UnableToGuessSearchwords=[h‚܂ł +Filtered=tB^ς +ExportKmlSignalMap=KML VOi}bvGNX|[g +SelectedAP=Iꂽ AP +AllAPs=ׂĂ AP +FilteredAPs=tB^ς݂ AP +ExportToCSV=CSV t@CփGNX|[g +FixingGpsTableTimes=GPS e[uC +ImportFolder=tH_C|[g diff --git a/Installer/vi_files/Languages/Norwegian.ini b/Installer/vi_files/Languages/Norwegian.ini new file mode 100644 index 00000000..8e62e972 --- /dev/null +++ b/Installer/vi_files/Languages/Norwegian.ini @@ -0,0 +1,281 @@ +[Info] +Author=Norwegian +Date=2008/01/10 +Description=Norske ske ord. Norsk Tekst. Standardsprog. + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Nettverkstype +Authentication=Godkjendelse +Encryption=Kryptering +Signal=Signal +RadioType=Radiotype +Channel=Kanal +BasicRates=Grundliggende hastigheter (Mbps) +OtherRates=Andre hastigheter (Mbps) +Open=pen +None=Ingen +WEP=WEP +Infrastructure=Infrastructure +Adhoc=Adhoc + +[Column_Names] +Column_Line=# +Column_Active=Aktiv +Column_SSID=SSID +Column_BSSID=Mac Addresse +Column_Manufacturer=Fabrikant +Column_Signal=Signal +Column_Authentication=Godkjendelse +Column_Encryption=Kryptering +Column_RadioType=Radio Type +Column_Channel=Kanal +Column_Latitude=Bredegrad +Column_Longitude=Lengdegrad +Column_BasicTransferRates=Grundleggende hastigheter +Column_OtherTransferRates=Andre hastigheter +Column_FirstActive=Sett frste gang +Column_LastActive=Sett sidst +Column_NetworkType=Nettverkstype +Column_Label=Merke +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) + +[GuiText] +Ok=&Ok +Cancel=Annuler + +File=Fil +SaveAsTXT=Lagre som &TXT +ImportFromTXT=Importer fra &TXT +Exit=Avslutt +Edit=Rediger +Cut=Klipp ut +Copy=Kopier +Paste=Sett inn +Delete=Slett +Select=Marker +SelectAll=Marker alt +Options=Funktioner +AutoSort=Auto Sorter +SortTree=Sorter Tre - (Langsomt i store lister) +AddAPsToTop=Plaser nye AP verst +ScanAPs=Sk APer +StopScanAps=&Stop +UseGPS=Start &GPS +StopGPS=Stop &GPS +Settings=Instillinger +GpsSettings=GPS Instillinger +SetLanguage=Velg sprk +SetSearchWords=Velg Netsh skeord +RefreshLoopTime=Oppdater loop tid(ms): +ActualLoopTime=Aktuell loop tid: +Longitude=Lengdegrad: +Latitude=Bredegrad: +ActiveAPs=Aktive APs: +PlaySound=Avspill lyd nr nytt AP finnes +Graph1=Graf&1 +Graph2=Graf&2 +NoGraph=&Ingen Graf +Export=Ex&porter +ExportToKML=Exporter til KML +ExportToTXT=Exporter til TXT +ExportToNS1=Exporter til NS1 +ExportToVS1=Exporter til VS1 +Extra=Ex&tra +PhilsPHPgraph=Se Graf (Phil's PHP version) +SetMacLabel=Rediger label ut fra MAC +SetMacManu=Rediger fabrikant ut fra MAC +Active=Aktiv +Dead=Ddt +AddNewLabel=Legg til ny label +RemoveLabel=Slett en label +EditLabel=Rediger valgt label +AddNewMan=Legg til ny fabrikant +RemoveMan=Slett en fabrikant +EditMan=Rediger valgt fabrikant +NewMac=Ny Mac Adresse: +NewMan=Ny fabrikant: +NewLabel=Ny label: +Save=Lagre? +SaveQuestion=Der er skjedd endringer. Vil du Lagre? +PhilsMultiPHPgraph=Vis alle APs i Graph (Phils PHP version) +GpsDetails=GPS Detaljer +Quality=Kvalitet +Time=Tid +NumberOfSatalites=Antall sateliter +HorizontalDilutionPosition=Horisontal vinkel +Altitude=Hyde +HeightOfGeoid=Hyde over havet +Status=Status +Date=Dato +SpeedInKnots=Hastighet(knop) +SpeedInMPH=Hastighet(MPH) +SpeedInKmh=Hastighet(KM/t) +TrackAngle=Sporings vinkel +Close=Steng +ConnectToWindowName=Koble til nettverk +RefreshingNetworks=Oppdater nettverk +Start=Start +Stop=Stop +ConnectToWindowTitle="Koble til" window title: +RefreshTime=Oppdaterings tid +Enable=Sl p +Disable=Sl av +Checked=Utfyldt +UnChecked=Ikke utfyldt +Restart=Omstart +RestartMsg=Vistumbler m startes p nytt for at sprk skal aktiveres. +NoSignalHistory=Intet signal funnet. Kontroller at dine NETSH skeord er korrekte +NoApSelected=Du har ikke valgt en AP +UseNetcomm=Benytt Netcomm OCX (Mest stabilt) - x32 +UseCommMG=Benytt CommMG (Mindre stabilt) - x32 - x64 +SignalHistory=Signal historikk +Apply=&Apply +Browse=&Browse +SaveAsVS1=Save As VS1 +SaveAsVSZ=Save As VSZ +ImportFromVSZ=Import From VSZ +ExitSaveDb=Exit (Save DB) +ClearAll=Clear All +PhilsWDB=Phils WiFiDB (Alpha) +GpsCompass=Gps Compass +SetColumnWidths=Set Column Widths +Unknown=Unknown +AutoSortEvery=Auto Sort Every +Seconds=Seconds +Ascending=Ascending +Decending=Decending +AutoSave=AutoSave +AutoSaveEvery=AutoSave Every +DelAutoSaveOnExit=Delete Autosave file on exit +OpenSaveFolder=Open Save Folder +SortBy=Sort By +SortDirection=Sort Direction +Auto=Auto +Misc=Misc +GPS=GPS +Labels=Labels +Manufacturers=Manufacturers +Columns=Columns +Language=Language +SearchWords=SearchWords +VistumblerSettings=Vistumbler Settings +LanguageAuthor=Language Author +LanguageDate=Language Date +LanguageDescription=Language Description +Description=Description +Progress=Progress +LinesMin=Lines/Min +NewAPs=New APs +NewGIDs=New GIDs +Minutes=Minutes +LineTotal=Line/Total +EstimatedTimeRemaining=Estimated Time Remaining +Ready=Ready +Done=Done +VistumblerSaveDirectory=Vistumbler Save Directory +VistumblerAutoSaveDirectory=Vistumbler Auto Save Directory +VistumblerKmlSaveDirectory=Vistumbler KML Save Directory +BackgroundColor=Background Color +ControlColor=Control Color +BgFontColor=Font Color +ConFontColor=Control Font Color +NetshMsg=This section allows you to change the words Vistumbler uses to search netsh. Change to the proper words for you version of windows. Run "netsh wlan show networks mode = bssid" to find the proper words. +PHPgraphing=PHP Graphing +ComInterface=Com Interface +ComSettings=Com Settings +Com=Com +Baud=Baud +GPSFormat=GPS Format +HideOtherGpsColumns=Hide Other GPS Columns +ImportLanguageFile=Import Language File +AutoKml=Auto KML +GoogleEarthEXE=Google Earth EXE +AutoSaveKmlEvery=Auto Save KML Every +SavedAs=Saved As +Overwrite=Overwrite +InstallNetcommOCX=Install Netcomm OCX +NoFileSaved=No file has been saved +NoApsWithGps=No Access Points found with GPS coordinates. +MacExistsOverwriteIt=A entry for this mac address already exists. would you like to overwrite it? +SavingLine=Saving Line +DisplayDebug=Debug - Display Functions +GraphDeadTime=Graph Dead Time +OpenKmlNetLink=Open KML NetworkLink +ActiveRefreshTime=Active Refresh Time +DeadRefreshTime=Dead Refresh Time +GpsRefrshTime=Gps Refrsh Time +FlyToSettings=Fly To Settings +FlyToCurrentGps=Fly to current gps position +AltitudeMode=Altitude Mode +Range=Range +Heading=Heading +Tilt=Tilt +AutoOpenNetworkLink=Automatically Open KML Network Link +SpeakSignal=Speak Signal +SpeakUseVisSounds=Use Vistumbler Sound Files +SpeakUseSapi=Use Microsoft Sound API +SpeakSayPercent=Say "Percent" after signal +GpsTrackTime=Track Refresh Time +SaveAllGpsData=Save GPS data when no APs are active +None=None +Even=Even +Odd=Odd +Mark=Mark +Space=Space +StopBit=Stop Bit +Parity=Parity +DataBit=Data Bit +Update=Update +UpdateMsg=Update Found. Would you like to update vistumbler? +Recover=Recover +RecoverMsg=Old DB Found. Would you like to recover it? +SelectConnectedAP=Select Connected AP +VistumblerHome=Vistumbler Home +VistumblerForum=Vistumbler Forum +VistumblerWiki=Vistumbler Wiki +CheckForUpdates=Check For Updates +SelectWhatToCopy=Select what you want to copy +Default=Default +PlayMidiSounds=Play MIDI sounds for all active APs +Interface=Interface +LanguageCode=Language Code +AutoCheckUpdates=Automatically Check For Updates +CheckBetaUpdates=Check For Beta Updates +GuessSearchwords=Guess Netsh Searchwords +Help=Help +ErrorScanningNetsh=Error scanning netsh +GpsErrorBufferEmpty=GPS Error. Buffer Empty for more than 10 seconds. GPS was probrably disconnected. GPS has been stopped +GpsErrorStopped=GPS Error. GPS has been stopped +ShowSignalDB=Show Signal dB (Estimated) +SortingList=Sorting List +Loading=Loading +MapOpenNetworks=Map Open Networks +MapWepNetworks=Map WEP Networks +MapSecureNetworks=Map Secure Networks +DrawTrack=Draw Track +UseLocalImages=Use Local Images +MIDI=MIDI +MidiInstrumentNumber=MIDI Instrument # +MidiPlayTime=MIDI Play Time +SpeakRefreshTime=Speak Refresh Time +Information=Information +AddedGuessedSearchwords=Added guessed netsh searchwords. Searchwords for Open, None, WEP, Infrustructure, and Adhoc will still need to be done manually +SortingTreeview=Sorting Treeview +Recovering=Recovering +VistumblerFile=Vistumbler File +NetstumblerTxtFile=Netstumbler TXT File +ErrorOpeningGpsPort=Error opening GPS port +SecondsSinceGpsUpdate=Seconds Since GPS Update +SavingGID=Saving GID +SavingHistID=Saving HistID +UpdateFound=Update Found. Would you like to update vistumbler? +NoUpdates=No Updates Avalible +NoActiveApFound=No Active AP found +VistumblerDonate=Donate +VistumblerStore=Store +SupportVistumbler=*Support Vistumbler* diff --git a/Installer/vi_files/Languages/Polish.ini b/Installer/vi_files/Languages/Polish.ini new file mode 100644 index 00000000..2cb13e72 --- /dev/null +++ b/Installer/vi_files/Languages/Polish.ini @@ -0,0 +1,201 @@ +[Info] +Author=Krzysztof Witkowski ps. Lordwader +Date=2008/09/23 +Description=Polish SearchWords. English Text. + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Typ sieci +Authentication=Uwierzytelnianie +Encryption=Szyfrowanie +Signal=Sygna +RadioType=Typ radia +Channel=Kana +BasicRates=Podstawowe szybkoci transmisji (Mb/s) +OtherRates=Inne szybkoci transmisji (Mb/s) +Open=Otwarte +None=Brak +WEP=WEP + +[Column_Names] +Column_Line=# +Column_Active=Active +Column_SSID=SSID +Column_BSSID=Mac Address +Column_Manufacturer=Manufacturer +Column_Signal=Signal +Column_Authentication=Authentication +Column_Encryption=Encryption +Column_RadioType=Radio Type +Column_Channel=Channel +Column_Latitude=Latitude +Column_Longitude=Longitude +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) +Column_BasicTransferRates=Basic Transfer Rates +Column_OtherTransferRates=Other Transfer Rates +Column_FirstActive=First Active +Column_LastActive=Last Updated +Column_NetworkType=Network Type +Column_Label=Label + +[GuiText] +Ok=&Ok +Cancel=C&ancel +Apply=&Apply +Browse=&Browse +File=&File +SaveAsTXT=Save As TXT +SaveAsVS1=Save As VS1 +ImportFromTXT=Import From TXT +Exit=E&xit +Edit=E&dit +ClearAll=Clear All +Cut=Cut +Copy=Copy +Paste=Paste +Delete=Delete +Select=Select +SelectAll=Select All +Options=&Options +AutoSort=Auto Sort +SortTree=Sort Treeview(Slow) +PlaySound=Play sound on new AP +AddAPsToTop=Add new APs to top +Extra=Ex&tra +ScanAPs=&Scan APs +StopScanAps=&Stop +UseGPS=Use &GPS +StopGPS=Stop &GPS +Settings=S&ettings +GpsSettings=GPS Settings +SetLanguage=Set Language +SetSearchWords=Set Netsh Search Words +Export=Ex&port +ExportToKML=Export to KML +ExportToTXT=Export to TXT +ExportToVS1=Export To VS1 +ExportToNS1=Export To NS1 +PhilsPHPgraph=View graph (Phil's PHP version) +PhilsWDB=Phils WiFiDB (Alpha) +RefreshLoopTime=Refresh loop time(ms) +ActualLoopTime=Actual loop time +Longitude=Longitude +Latitude=Latitude +ActiveAPs=Active APs +Graph1=Graph&1 +Graph2=Graph&2 +NoGraph=&No Graph +SetMacLabel=Set Labels by Mac +SetMacManu=Set Manufactures by Mac +Active=Active +Dead=Dead +AddNewLabel=Add New Label +RemoveLabel=Remove Selected Label +EditLabel=Edit Selected Label +AddNewMan=Add New Manufacturer +RemoveMan=Remove Selected Manufacturer +EditMan=Edit Selected Manufacturer +NewMac=New Mac Address +NewMan=New Manufacturer +NewLabel=New Label +Save=Save? +SaveQuestion=Data has changed. Would you like to save? +GpsDetails=GPS Details +Quality=Quality +Time=Time +NumberOfSatalites=Number of Satalites +HorizontalDilutionPosition=Horizontal Dilution +Altitude=Altitude +HeightOfGeoid=Height of Geoid +Status=Status +Date=Date +SpeedInKnots=Speed(knots) +SpeedInMPH=Speed(MPH) +SpeedInKmh=Speed(km/h) +TrackAngle=Track Angle +Close=Close +ConnectToWindowName=Connect to a network +RefreshingNetworks=Refreshing Networks +Start=Start +Stop=Stop +ConnectToWindowTitle="Connect to" window title: +RefreshTime=Refresh time +SetColumnWidths=Set Column Widths +Enable=Enable +Disable=Disable +Checked=Checked +UnChecked=UnChecked +Unknown=Unknown +Restart=Restart +RestartMsg=Please restart Vistumbler for language change to take effect +NoSignalHistory=No signal history found, check to make sure your netsh search words are correct +NoApSelected=You did not select an access point +UseNetcomm=Use Netcomm OCX (more stable) - x32 +UseCommMG=Use CommMG (less stable) - x32 - x64 +SignalHistory=Signal History +AutoSortEvery=Auto Sort Every +Seconds=Seconds +Ascending=Ascending +Decending=Decending +AutoSave=Auto Save +AutoSaveEvery=Auto Save Every +DelAutoSaveOnExit=Delete Auto Save file on exit +OpenSaveFolder=Open Save Folder +SortBy=Sort By +SortDirection=Sort Direction +Auto=Auto +Misc=Misc +GPS=GPS +Labels=Labels +Manufacturers=Manufacturers +Columns=Columns +Language=Language +SearchWords=SearchWords +VistumblerSettings=Vistumbler Settings +LanguageAuthor=Language Author +LanguageDate=Language Date +LanguageDescription=Language Description +Description=Description +Progress=Progress +LinesMin=Lines/Min +NewAPs=New APs +NewGIDs=New GIDs +Minutes=Minutes +LineTotal=Line/Total +EstimatedTimeRemaining=Estimated Time Remaining +Ready=Ready +Done=Done +VistumblerSaveDirectory=Vistumbler Save Directory +VistumblerAutoSaveDirectory=Vistumbler Auto Save Directory +VistumblerKmlSaveDirectory=Vistumbler KML Save Directory +BackgroundColor=Background Color +ControlColor=Control Color +BgFontColor=Font Color +ConFontColor=Control Font Color +NetshMsg=This section allows you to change the words Vistumbler uses to search netsh. Change to the proper words for you version of windows. Run "netsh wlan show networks mode = bssid" to find the proper words. +PHPgraphing=PHP Graphing +ComInterface=Com Interface +ComSettings=Com Settings +Com=Com +Baud=Baud +GPSFormat=GPS Format +HideOtherGpsColumns=Hide Other GPS Columns +ImportLanguageFile=Import Language File +AutoKml=Auto KML +GoogleEarthEXE=Google Earth EXE +AutoSaveKmlEvery=Auto Save KML Every +SavedAs=Saved As +Overwrite=Overwrite +InstallNetcommOCX=Install Netcomm OCX +NoFileSaved=No file has been saved +NoApsWithGps=No Access Points found with GPS coordinates. +MacExistsOverwriteIt=A entry for this mac address already exists. would you like to overwrite it? +SavingLine=Saving Line +DisplayDebug=Debug - Display Functions +GpsCompass=Gps Compass +OpenKmlNetLink=Open KML NetworkLink +GraphDeadTime=Graph Dead Time \ No newline at end of file diff --git a/Installer/vi_files/Languages/Russian.ini b/Installer/vi_files/Languages/Russian.ini new file mode 100644 index 00000000..440130b0 --- /dev/null +++ b/Installer/vi_files/Languages/Russian.ini @@ -0,0 +1,213 @@ +[Info] +Author=Vlad "Utter" StepanoFF +Date=2008/09/15 +Description= . - , , , . + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType= +Authentication= +Encryption= +Signal= +RadioType= +Channel= +BasicRates=Basic Rates +OtherRates=Other Rates +Open= +None= +WEP=WEP + +[Column_Names] +Column_Line=# +Column_Active= +Column_SSID=SSID +Column_BSSID=MAC- +Column_Manufacturer= +Column_Signal= +Column_Authentication= +Column_Encryption= +Column_RadioType= +Column_Channel= +Column_Latitude= +Column_Longitude= +Column_LatitudeDMS= ( ) +Column_LongitudeDMS= ( ) +Column_LatitudeDMM= (ddmm.mmmm) +Column_LongitudeDMM= (ddmm.mmmm) +Column_BasicTransferRates= (/) +Column_OtherTransferRates=Other Transfer Rates +Column_FirstActive= +Column_LastActive= +Column_NetworkType= +Column_Label= + +[GuiText] +Ok=& +Cancel=& +Apply=& +Browse=& +File=& +SaveAsTXT= TXT +SaveAsVS1= VS1 +SaveAsVSZ= VSZ +ImportFromVSZ= VSZ +ImportFromTXT= TXT +Exit=& +RefreshingNetworks= +Edit=& +ClearAll= +Cut= +Copy= +Paste= +Delete= +Select= +GraphDeadTime= "" +ActiveRefreshTime= +DeadRefreshTime= "" +GpsRefrshTime= GPS +FlyToSettings= +SelectAll= +Options=& +AutoSort= +SortTree= () +PlaySound= +AddAPsToTop= +Extra=& +ScanAPs=&. +StopScanAps=& +UseGPS=. &GPS +StopGPS= &GPS +Heading= +SpeakUseSapi= Microsoft Sound API +SpeakUseVisSounds= Vistumbler +SpeakSayPercent= "Percent" +Settings=& +GpsSettings= GPS +SetLanguage= +SetSearchWords= Netsh +Export=& +ExportToKML= KML +ExportToTXT= TXT +ExportToVS1= VS1 +ExportToNS1= NS1 +PhilsPHPgraph= (Phil's PHP version) +PhilsWDB=Phils WiFiDB (Alpha) +RefreshLoopTime=Refresh loop time(ms) +ActualLoopTime=Actual loop time +Longitude= +Latitude= +ActiveAPs= +Graph1=&1 +Graph2=&2 +NoGraph=& +SetMacLabel=Set Labels by Mac +SetMacManu=Set Manufactures by Mac +Active= +Dead= +AddNewLabel= +RemoveLabel= +EditLabel= +AddNewMan= +RemoveMan= +EditMan= +NewMac= MAC- +NewMan= +NewLabel= +Save=? +SaveQuestion= . ? +GpsDetails= GPS +Quality= +Time= +NumberOfSatalites=- +HorizontalDilutionPosition=Horizontal Dilution +Altitude=Altitude +HeightOfGeoid= Geoid +Status= +Date= +SpeedInKnots=() +SpeedInMPH=(/) +SpeedInKmh=(/) +TrackAngle=Track Angle +Close= +ConnectToWindowName= +RefreshingNetworks= +Start= +Stop= +ConnectToWindowTitle= " ": +RefreshTime= ( ) +SetColumnWidths= +Enable= +Disable= +Checked= +UnChecked= +Unknown= +Restart= +RestartMsg= Vistumbler +NoSignalHistory= , netsh +NoApSelected= +UseNetcomm= Netcomm OCX ( ) - x32 +UseCommMG= CommMG ( ) - x32 - x64 +SignalHistory= +AutoSortEvery=Auto Sort Every +Seconds= +Ascending=Ascending +Decending=Decending +AutoSave= +AutoSaveEvery=Auto Save Every +DelAutoSaveOnExit= +OpenSaveFolder= +SortBy= +SortDirection= +Auto= +Misc= +GPS=GPS +Labels= +Manufacturers= +Columns= +Language= +SearchWords= +VistumblerSettings= Vistumbler +LanguageAuthor= +LanguageDate= +LanguageDescription= +Description= +Progress= +LinesMin=/ +NewAPs= +NewGIDs= GID +Minutes= +LineTotal=/ +EstimatedTimeRemaining= () +Ready= +Done= +VistumblerSaveDirectory= Vistumbler +VistumblerAutoSaveDirectory= Vistumbler +VistumblerKmlSaveDirectory= KML Vistumbler +BackgroundColor= +ControlColor= +BgFontColor= +ConFontColor= +NetshMsg=This section allows you to change the words Vistumbler uses to search netsh. Change to the proper words for your version of Windows. Run "netsh wlan show networks mode = bssid" to find the proper words. +PHPgraphing=PHP Graphing +ComInterface= Com +ComSettings= Com +Com=Com +Baud=Baud +GPSFormat= GPS +HideOtherGpsColumns= GPS +ImportLanguageFile= +AutoKml= KML +GoogleEarthEXE=Google Earth +AutoSaveKmlEvery= KML Every +SavedAs= +Overwrite= +InstallNetcommOCX= Netcomm OCX +NoFileSaved= +NoApsWithGps= GPS. +MacExistsOverwriteIt= MAC- . ? +SavingLine= +DisplayDebug=Debug - Display Functions +GpsCompass=GPS +OpenKmlNetLink=O KML NetworkLink +GraphDeadTime=Graph Dead Time \ No newline at end of file diff --git a/Installer/vi_files/Languages/Spanish.ini b/Installer/vi_files/Languages/Spanish.ini new file mode 100644 index 00000000..3b03ef21 --- /dev/null +++ b/Installer/vi_files/Languages/Spanish.ini @@ -0,0 +1,137 @@ +[Info] +Author=Orgional:ACalcutt, Revised by:dupin +Date=2008/06/21 +Description=Spanish Searchwords. Spanish (es_AR) Text. +WindowsLanguageCode=es_AR + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Tipo de red +Authentication=Autenticacin +Encryption=Cifrado +Signal=Seal +RadioType=Tipo de radio +Channel=Canal +BasicRates=Velocidades bsicas +OtherRates=Otras velocidades +Open=Ninguna +None=Abierta + +[Column_Names] +Column_Line=# +Column_Active=Activo +Column_SSID=SSID +Column_BSSID=Direccin MAC +Column_Manufacturer=Fabricante +Column_Signal=Seal +Column_Authentication=Autenticacin +Column_Encryption=Cifrado +Column_RadioType=Tipo de radio +Column_Channel=Canal +Column_Latitude=Latitud +Column_Longitude=Longitud +Column_BasicTransferRates=Velocidades bsicas +Column_OtherTransferRates=Otras velocidades +Column_FirstActive=Visto primera vez +Column_LastActive=ltima actualizacin +Column_NetworkType=Tipo de red +Column_Label=Etiqueta + +[GuiText] +Ok=&Ok +Cancel=&Cancelar +File=&Archivo +SaveAsTXT=Guardar como TXT +ImportFromTXT=Importar desde TXT +Exit=&Salir +Edit=E&ditar +Cut=Cortar +Copy=Copiar +Paste=Pegar +Delete=Eliminar +Select=Seleccionar +SelectAll=Seleccionar Todo +Options=&Opciones +AutoSort=Ordenar Automticamente +SortTree=Ordenar rbol - (lento en listas grandes) +AddAPsToTop=Agregar nuevos APs arriba +ScanAPs=&Scan APs +StopScanAps=&Detener +UseGPS=Usar &GPS +StopGPS=Detener &GPS +Settings=&Configuracin +GpsSettings=Configuracin de GPS +SetLanguage=Seleccionar Idioma +SetSearchWords=Configurar cadenas buscadas en Netsh +RefreshLoopTime=Tiempo de actualizacin(ms) +ActualLoopTime=Tiempo actual del ciclo +Longitude=Longitud +Latitude=Latitud +ActiveAPs=APs Activos +PlaySound=Emitir sonido con nuevo AP +Graph1=Grfico&1 +Graph2=Grfico&2 +NoGraph=&Sin Grfico +Export=Ex&portar +ExportToKML=Exportar a KML +ExportToTXT=Exportar a TXT +ExportToNs1=Exportar a NS1 +Extra=Ex&tra +PhilsPHPgraph=Ver Grfico(Versin PHP de Phil) +SetMacLabel=Definir Etiqueta por MAC +SetMacManu=Definir Fabricante por MAC +Active=Activo +Dead=Inactivo +AddNewLabel=Aadir nueva etiqueta a la lista +RemoveLabel=Remover etiqueta seleccionada de la lista +EditLabel=Editar etiqueta seleccionada +AddNewMan=Aadir nuevo fabricante a la lista +RemoveMan=Quitar fabricante de la lista +EditMan=Editar fabricante seleccionado +NewMac=Nueva direccion MAC +NewMan=Nuevo Fabricante +NewLabel=Nueva Etiqueta +Save=Guardar? +SaveQuestion=Los datos han cambiado. Desea guardarlos? +PhilsMultiPHPgraph=Graficar todos los APs (Versin PHP de Phil) +GpsDetails=Detalles del GPS +Quality=Calidad +Time=Tiempo +NumberOfSatalites=Nmero de Satlites +HorizontalDilutionPosition=Dilucin de la Precisin Horizontal +Altitude=Altura +HeightOfGeoid=Altura del Geoide +Status=Estado +Date=Fecha +SpeedInKnots=Velocidad(nudos) +SpeedInMPH=Velocidad(MPH) +SpeedInKmh=Velocidad(km/h) +TrackAngle=ngulo de Trayectoria +Close=Cerrar +ConnectToWindowName=Conectarse a una red +RefreshingNetworks=Actualizando redes +Start=Comenzar +Stop=Detener +ConnectToWindowTitle=Titulo de la ventana "Conectar a": +RefreshTime=Tiempo de actualizacin +Enable=Habilitado +Disable=Desabilitado +Checked=Seleccionado +UnChecked=No Seleccionado +Restart=Reiniciar +RestartMsg=Por favor reinie Vistumbler para que haga efecto el cambio de idioma +NoSignalHistory=No se encontr historial de seales, verifique que las cadenas de bsqueda de netsh sean correctas +NoApSelected=No se ha seleccionado ningn access point +UseNetcomm=Usar Netcomm OCX (ms estable) - x32 +UseCommMG=Usar CommMG (poco estable) - x32 - x64 + +SetColumnWidths=Definir ancho de columnas +GraphDeadTime=Graficar tiempo muerto +AutoSortEvery=Ordenar Automticamente cada +Seconds=Segundos +Ascending=Ascendente +Decending=Descendente +AutoSave=Guardar Automticamente +AutoSaveEvery=Guardar Automticamente cada +DelAutoSaveOnExit=Eliminar archivo guardado automticamente al salir diff --git a/Installer/vi_files/Languages/Spanish2.ini b/Installer/vi_files/Languages/Spanish2.ini new file mode 100644 index 00000000..fc7566e0 --- /dev/null +++ b/Installer/vi_files/Languages/Spanish2.ini @@ -0,0 +1,362 @@ +[Info] +Author=Alberto Martin +Date=2011/09/11 +Description= Palabras de busqueda en Espaol. Texto en Espaol. Lenguaje Espaol. +WindowsLanguageCode=es_ES + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Tipo de Red +Authentication=Autentificacion +Encryption=Encriptacion +Signal=Seal +RadioType=Tipo de Radio +Channel=Canal +BasicRates=Ratios bsicos +OtherRates=Otros ratios +Open=Abierta +None=Ninguna +WEP=WEP +Infrastructure=Infraestructura +Adhoc=Adhoc +Cipher=Cipher + +[Column_Names] +Column_Line=# +Column_Active=Activa +Column_SSID=SSID +Column_BSSID=Direccin Mac +Column_Manufacturer=Manufactura +Column_Signal=Seal +Column_Authentication=Autentificacin +Column_Encryption=Encriptacin +Column_RadioType=Tipo de Radio +Column_Channel=Canal +Column_Latitude=Latitud +Column_Longitude=Longitud +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) +Column_BasicTransferRates=Ratios de transferencia bsicos +Column_OtherTransferRates=Otros ratios de transferencias +Column_FirstActive=Primer Activo +Column_LastActive=ltima Actualizacion +Column_NetworkType=tipo de red +Column_Label=Etiqueta +Column_HighSignal=Seal alta + +[GuiText] +Ok=&Ok +Cancel=C&ancelar +Apply=&Aplicar +Browse=&Explorar +File=&Archivo +SaveAsTXT=Guardar como TXT +SaveAsVS1=Guardar como VS1 +SaveAsVSZ=Guardar como VSZ +ImportFromTXT=Importar desde TXT / VS1 +ImportFromVSZ=Importar desde VSZ +Exit=S&alir +ExitSaveDb=Salir (Guardar DB) +Edit=E&ditar +ClearAll=Borrar Todo +Cut=Cortar +Copy=Copiar +Paste=Pegar +Delete=Eliminar +Select=Seleccionar +SelectAll=Seleccionar Todo +Options=&Opciones +AutoSort=Ordenacin Automatica +SortTree=Ordenar por Vista de Arbol(lento) +PlaySound=Reproducir sonido con nueva AP +AddAPsToTop=Aadir nuevas APs arriba +Extra=Ex&tra +ScanAPs=&Escanear APs +StopScanAps=&Parar +UseGPS=Usar &GPS +StopGPS=Parar &GPS +Settings=A&justes +GpsSettings=Ajustes del GPS +SetLanguage=Ajustes de lenguaje +SetSearchWords=Ajustar palabras de busqueda Netsh +Export=Ex&portar +ExportToTXT=Exportar a TXT +ExportToVS1=Exportar a VS1 +ExportToCSV=Exportar a CSV +ExportToKML=Exportar a KML +ExportToGPX=Exportar a GPX +ExportToNS1=Exportar a NS1 +ExportToVSZ=Exportar a VSZ +RefreshLoopTime=Refresco del tiempo de ciclo(ms) +ActualLoopTime=Tiempo de ciclo actual +Longitude=Longitud +Latitude=Latitud +ActiveAPs=APs Activas +Graph1=Grafico&1 +Graph2=Grafico&2 +NoGraph=&Sin Grfico +SetMacLabel=Ajustar Etiquetas para Mac +SetMacManu=Ajustes de fbrica para Mac +Active=Activo +Dead=Inactivo +AddNewLabel=Aadir Nueva Etiqueta +RemoveLabel=Eliminar Etiqueta Seleccionada +EditLabel=Editar Etiqueta Seleccionada +AddNewMan=Aadir Nuevo Fabricante +RemoveMan=Eliminar Fabricante Seleccionado +EditMan=Editar Fabricante Seleccionado +NewMac=Nueva Direccion MAC +NewMan=Nuevo Fabricante +NewLabel=Nueva Etiqueta +Save=Guardar? +SaveQuestion=La Informacin ha cambiado. Desea Guardar los Cambios? +GpsDetails=Detalles del GPS +GpsCompass=Brujula Gps +Quality=Calidad +Time=Hora +NumberOfSatalites=Nmero de Satelites +HorizontalDilutionPosition=Diluccin Horizontal +Altitude=Altitud +HeightOfGeoid=Altura del Geoide +Status=Estado +Date=Fecha +SpeedInKnots=Velocidad(Nudos) +SpeedInMPH=Velocidad(MPH) +SpeedInKmh=Velocidad(km/h) +TrackAngle=Angulo de la Trayectoria +Close=Cerrar +Start=Iniciar +Stop=Parar +RefreshingNetworks=Auto Refrescar Redes +RefreshTime=Tipo de Refresco +SetColumnWidths=Ajustar Ancho de Columna +Enable=Habilitar +Disable=Deshabilitar +Checked=Comprobado +UnChecked=Sin Comprobar +Unknown=Desconocido +Restart=Reiniciar +RestartMsg=Por favor reinicie Vistumbler para que el cambio de lenguaje tenga efecto +NoSignalHistory=No hay historial de seal encontrado, Asegrese de que los trminos de bsqueda netsh son correctos +NoApSelected=No ha seleccionado ningn Punto de Acceso +UseNetcomm=Usar Netcomm OCX (Ms Estable) - x32 +UseCommMG=Usar CommMG (Menos Estable) - x32 - x64 +SignalHistory=Historial de Seal +AutoSortEvery=Auto Ordenar Todo +Seconds=Segundos +Ascending=Ascendente +Decending=Descendente +AutoSave=Guardar Automaticamente +AutoSaveEvery=Guardar Automaticamente cada +DelAutoSaveOnExit=Eliminar Guardado Autoamtico de Archivos al Salir +OpenSaveFolder=Abrir Carpeta Guardada +SortBy=Ordenar por +SortDirection=Ordenar Direccin +Auto=Automatico +Misc=Miscelaneas +GPS=GPS +Labels=Etiquetas +Manufacturers=Fabricantes +Columns=Columnas +Language=Languaje +SearchWords=Palabras de Busqueda +VistumblerSettings=Ajustes de Vistumbler +LanguageAuthor=Autor del Languaje +LanguageDate=Fecha del Languaje +LanguageDescription=Descripcin del Languaje +Description=Descripcin +Progress=Progreso +LinesMin=Lineas/Min +NewAPs=Nuevas APs +NewGIDs=Nuevos GIDs +Minutes=Minutos +LineTotal=Linea/Total +EstimatedTimeRemaining=Tiempo Restante Estimado +Ready=Listo +Done=Hecho +VistumblerSaveDirectory=Carpeta Guardar de Vistumbler +VistumblerAutoSaveDirectory=Carpeta Guardar Automatica de Vistumbler +VistumblerKmlSaveDirectory=Carpeta Guardar KML de Vistumbler +BackgroundColor=Color de Fondo +ControlColor=Color de Control +BgFontColor=Color de Fuentes +ConFontColor=Color de Fuentes de Control +NetshMsg=Esta seccin le permite cambiar las palabras Vistumbler utilizas para buscar netsh. Cambie las palabras segn su versin de Windows. Ejecute "netsh wlan en el modo de red = "bssid"para encontrar las palabras adecuadas. +PHPgraphing=Grficos PHP +ComInterface=Interfaz Com +ComSettings=Ajustes Com +Com=Com +Baud=Baudios +GPSFormat=Formato GPS +HideOtherGpsColumns=Ocultar Otras Columnas del GPS +ImportLanguageFile=Importar archivo de Languaje +AutoKml=Auto KML +GoogleEarthEXE=Google Earth EXE +AutoSaveKmlEvery=Guardar Automaticamente KML cada +SavedAs=Guardar Como +Overwrite=Sobreescribir +InstallNetcommOCX=Instalar Netcomm OCX +NoFileSaved=Ningn Archivo ha sido Guardado +NoApsWithGps=Ningn Punto de Acceso encontrado con esas Coordenadas de GPS. +MacExistsOverwriteIt=Existe ya un registro con esa direccin MAC. Desea Sobreescribirla? +SavingLine=Guardando Linea +Debug=Depuracin +DisplayDebug=Mostrar Funciones +DisplayDebugCom=Mostrar Errores COM +GraphDeadTime=Grafico de Tiempo Inactivo +OpenKmlNetLink=Abrir Hipervinculo KML +ActiveRefreshTime=Activar Tiempo de Refresco +DeadRefreshTime=Desactivar Tiempo de Refresco +GpsRefrshTime=Tiempo de Refresco del Gps +FlyToSettings=Ir a Ajustes +FlyToCurrentGps=Ir a la actual posicin del GPS +AltitudeMode=Modo Altitud +Range=Rango +Heading=Grado +Tilt=Inclinacin +AutoOpenNetworkLink=Abrir Automaticamente Hipervinculo KML +SpeakSignal=Seal del Altavoz +SpeakUseVisSounds=Usar los Archivos de Sonido de Vistumbler +SpeakUseSapi=Usar Microsoft Sound API +SpeakSayPercent=Mostrar "Porcentaje" despues de la Seal +GpsTrackTime=Seguimiento de tiempo de refresco +SaveAllGpsData=Guardar toda la informacin del GPS cuando no haya ninguna APs activa +None=Ninguna +Even=Incluso +Odd=Extrao +Mark=Marca +Space=Espacio +StopBit=Parar Bit +Parity=Paridad +DataBit=Informacin de Bit +Update=Actualizar +UpdateMsg=Actualizacin Encontrada. Quiere Actualizar vistumbler? +Recover=Recuperar +RecoverMsg=Antigua DB encontrada. Quiere recuperarla? +SelectConnectedAP=Seleccionar AP Conectada +VistumblerHome=Web Oficial Vistumbler +VistumblerForum=Foro de Vistumbler +VistumblerWiki=Wiki de Vistumbler +CheckForUpdates=Comprobar Actualizaciones +SelectWhatToCopy=Seleccione que quiere copiar +Default=Por Defecto +PlayMidiSounds=Reproducir Sonidos MIDI para todas las APs activas +Interface=Interfaz +LanguageCode=Codigo de Lenguaje +AutoCheckUpdates=Comprobar Automaticamente Actualizaciones +CheckBetaUpdates=Comprobar Actualizaciones Beta +GuessSearchwords=Adivinar Palabras de Busqueda Netsh Searchwords +Help=Ayuda +ErrorScanningNetsh=Error escaneando netsh +GpsErrorBufferEmpty=Error GPS. Bufer vacio durante ms de 10 segundos. El GPS est probablemente desconectado. El GPS ha sido desconectado +GpsErrorStopped=Error GPS. El GPS ha sido parardo +ShowSignalDB=Mostrar Seal dB (Aproximada) +SortingList=Ordenando Lista +Loading=Abriendo +MapOpenNetworks=Mapa de Redes Abiertas +MapWepNetworks=Mapa de Redes WEP +MapSecureNetworks=Mapa de Redes Seguras +DrawTrack=Dibujar trazado +UseLocalImages=Usar Imagenes Locales +MIDI=MIDI +MidiInstrumentNumber=MIDI Instrumentos # +MidiPlayTime=Reproductor de tiempo MIDI +SpeakRefreshTime=Tiempo de Refresco del Altavoz +Information=Informacin +AddedGuessedSearchwords=Aadidas palabras de busqueda netsh adivinadas, palabras de busqueda para abrir, Ninguna, WEP, Infraestructura y Adhoc es necesario hacerlo manualmente +SortingTreeview=Ordenando Sorting por Vista de Arbol +Recovering=Recuperando +ErrorOpeningGpsPort=Error abriendo el puerto del GPS +SecondsSinceGpsUpdate=Segundos desde la actualizacion del GPS +SavingGID=Guardando GID +SavingHistID=Guardando HistID +NoUpdates=No hay Actualizaciones Disponibles +NoActiveApFound=No hay AP activas +VistumblerDonate=Donar +VistumblerStore=Tienda +SupportVistumbler=Soporte Vistumbler +UseNativeWifi=Usar Wifi nativo (No BSSID, CHAN, OTX, BTX, or RADTYPE) +FilterMsg=Usar asterisco(*)" como comodn. Separar multiples filtros con una coma(,). Usar un guin(-) para los rangos. +SetFilters=Ajustar Filtros +Filters=Filters +NoAdaptersFound=No Se Encuentran Adaptadores +RecoveringMDB=Recuperando MDB +FixingGpsTableDates=Arreglando tabla de fecha(s) del GPS +FixingHistTableDates=Arrelgando tabla de fecha(s) HIST +VistumblerNeedsToRestart=Vistumbler necesita ser reiniciado. Vistumbler se cerrar ahora +AddingApsIntoList=Aadiendo nuevas APs a la lista +GoogleEarthDoesNotExist=El archivo de Google earth no existe o la configuracin es erronea en los ajustes de AutoKML +AutoKmlIsNotStarted=AutoKML no ha iniciado todavia. Quiere activarlo ahora? +UseKernel32=Usar Kernel32 - x32 - x64 +UnableToGuessSearchwords=Vistumbler no pudo adivinar las Palabras de Busqueda +Filtered=Filtros +SelectedAP=AP Seleccionada +AllAPs=All APs +FilteredAPs=APs Filtradas +FixingGpsTableTimes=Arreglando tablas de hora(s) del GPS +ImportFolder=Importar Carpeta +DeleteSelected=Borrar Seleccionado +RecoverSelected=Recuperar Seleccionado +NewSession=Nueva Sesin +Size=Tamao +NoMdbSelected=Ninguna MDB Seleccionada +LocateInWiFiDB=Posicin local en WiFiDB +AutoWiFiDbGpsLocate=Localizacin Automatica WiFiDB Gps +AutoSelectConnectedAP=Seleccionar Automaticamente AP +Experimental=Experimental +UploadDataToWiFiDB=Subir informacin a WiFiDB +Error=Error +Updating=Actualizando +Downloaded=Descargando +Retry=Reintentar +Ignore=Ignorar +Yes=Si +No=No +LoadingVersionsFile=Abriendo Archivo de Versiones +UsingLocalFile=Usando Arcivo Local +DownloadingBetaVerFile=Descargando archivos de versiones beta +DownloadingVerFile=Descargando versiones de archivos +VerFileDownloaded=Versiones de Archivo descargados +ErrDownloadVerFile=Error descargando versiones de archivos +NewFile=Nuevo Archivo +UpdatedFile=Archivo Subido +ErrCopyingFile=Error Copiando Archivo +ErrReplacaingOldFile=Error al reemplazar arhivo antiguo (Posiblemente est en uso) +ErrDownloadingNewFile=Error descargando nuevo Archivo +NoChangeInFile=No ha habido cambios en el archivo +DeletedFile=Archivo Borrado +ErrDeletingFile=Error Borrando Archivo +ErrWouldYouLikeToRetryUpdate=Error. Quiere reintentar la descarga? +DoneWouldYouLikeToLoadVistumbler=Realizado. Quiere Abrir Vistumbler? +Color=Color +AddRemFilters=Aadir/Eliminar Filtros +NoFilterSelected=No Hay Filtros Seleccionados +Import=&Importar +View=&Vista +AddFilter=Aadir Filtro +EditFilter=Editar Filtro +DeleteFilter=Borrar Filtro +TimeBeforeMarkedDead=Tiempo de espera antes de marcas AP(s) como inactivo +FilterNameRequired=Nombre de filtro es requerido +UpdateManufacturers=Actualizar Fabricantes +FixHistSignals=Arreglando la Tabla de Seal(es) Hits perdida +VistumblerFile=Archivo Vistumbler +DetailedFile=Coma detallado archivo delimitado +NetstumblerTxtFile=Archivo de Netstumbler wi-scan +WardriveDb3File=Archivo Wardrive-android +AutoScanApsOnLaunch=Escanear Automaticamente APs al iniciar +RefreshInterfaces=Refrescar Interfaces +NoAps=No hay puntos de acceso. +AutoSelectHighSigAP=Seleccionar Automaticamente el AP con ms seal +Sound=Sonido +OncePerLoop=Una vez por ciclo +OncePerAP=Una vez por ap +OncePerAPwSound=Una vez por ap basado en el volumen o seal +PhilsPHPgraph=Grafico URL +PhilsWDB=WiFiDB URL +PhilsWdbLocate=Localizacion de la URL de WifiDB +PhilsWifiTools=Herramientas Wifi de Phil +AutoWiFiDbUploadAps=Subir Automaticamente WiFiDB AP Activas \ No newline at end of file diff --git a/Installer/vi_files/Languages/Swedish.ini b/Installer/vi_files/Languages/Swedish.ini new file mode 100644 index 00000000..9c3aa98a --- /dev/null +++ b/Installer/vi_files/Languages/Swedish.ini @@ -0,0 +1,416 @@ +[Info] +Author=ke Engelbrektson +Date=2014/01/02 +Description=Svenska skord. Svensk text. Standardsprk. +WindowsLanguageCode=sv_SE + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=Ntverkstyp +Authentication=Autentisering +Encryption=Kryptering +Signal=Signal +RadioType=Radiotyp +Channel=Kanal +BasicRates=Standardhastigheter +OtherRates=Andra hastigheter +Open=ppen +None=Ingen +WEP=WEP +Infrastructure=Infrastruktur +Adhoc=Adhoc +Cipher=Kryptering +RSSI=RSSI + +[Column_Names] +Column_Line=# +Column_Active=Aktiv +Column_SSID=SSID +Column_BSSID=Mac-adress +Column_Manufacturer=Tillverkare +Column_Signal=Signal +Column_Authentication=Autentisering +Column_Encryption=Kryptering +Column_RadioType=Radiotyp +Column_Channel=Kanal +Column_Latitude=Latitud +Column_Longitude=Longitud +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) +Column_BasicTransferRates=Standardhastigheter +Column_OtherTransferRates=Andra verfringshastigheter +Column_FirstActive=Frst upptckt +Column_LastActive=Senast uppdaterad +Column_NetworkType=Ntverkstyp +Column_Label=Etikett +Column_HighSignal=Hgsta signal +Column_RSSI=RSSI +Column_HighRSSI=Hgsta RSSI + +[GuiText] +Ok=&Ok +Cancel=Av&bryt +Apply=&Verkstll +Browse=&Blddra +File=&Arkiv +SaveAsTXT=Spara som &TXT +SaveAsVS1=Spara som VS1 +SaveAsVSZ=Spara som VSZ +ImportFromTXT=Importera frn TXT / VS1 +ImportFromVSZ=Importera frn VSZ +Exit=A&vsluta +ExitSaveDb=Avsluta (Spara DB) +Edit=&Redigera +ClearAll=Rensa alla +Cut=Klipp ut +Copy=Kopiera +Paste=Klistra in +Delete=Radera +Select=Markera +SelectAll=Markera alla +Options=A<ernativ +AutoSort=Sortera automatiskt +SortTree=Sortera trdvy - (Lngsam) +PlaySound=Ljudvarna vid ny AP +AddAPsToTop=Lgg till nya AP:er verst +Extra=E&xtra +ScanAPs=&Skanna AP:er +StopScanAps=&Stopp +UseGPS=Anvnd &GPS +StopGPS=Stoppa &GPS +Settings=&Instllningar +GpsSettings=GPS-instllningar +SetLanguage=Sprk +SetSearchWords=Netsh skord +Export=Ex&portera +ExportToTXT=Exportera till TXT +ExportToVS1=Exportera till VS1 +ExportToCSV=Exportera till CSV +ExportToKML=Exportera till KML +ExportToGPX=Exportera till GPX +ExportToNS1=Exportera till NS1 +ExportToVSZ=Exportera till VSZ +RefreshLoopTime=Uppdatera loop-tid(ms): +ActualLoopTime=Verklig loop-tid: +Longitude=Longitud: +Latitude=Latitud: +ActiveAPs=Aktiva AP:er +Graph1=Diagram&1 +Graph2=Diagram&2 +NoGraph=&Inget diagram +SetMacLabel=Etiketter +SetMacManu=Tillverkare +Active=Aktiv +Dead=Dd +AddNewLabel=lgg till ny etikett +RemoveLabel=Ta bort markerad etikett +EditLabel=Redigera markerad etikett +AddNewMan=Lgg till ny tillverkare +RemoveMan=Ta bort markerad tillverkare +EditMan=Redigera markerad tillverkare +NewMac=Ny Mac-adress: +NewMan=Ny tillverkare: +NewLabel=Ny etikett: +Save=Spara? +SaveQuestion=Data har ndrats. Vill du spara? +GpsDetails=GPS-detaljer +GpsCompass=GPS-kompass +Quality=Kvalitet +Time=Tid +NumberOfSatalites=Antal sateliter +HorizontalDilutionPosition=Horisontell vinkel +Altitude=Hjd +HeightOfGeoid=Hjd p Geoid +Status=Status +Date=Datum +SpeedInKnots=Hastighet(knop) +SpeedInMPH=Hastighet(MPH) +SpeedInKmh=Hastighet(km/h) +TrackAngle=Sprningsvinkel +Close=Stng +Start=Start +Stop=Stopp +RefreshingNetworks=Uppdatera ntverk automatiskt +RefreshTime=Uppdateringsintervall +SetColumnWidths=Kolumnbredd +Enable=Aktivera +Disable=Avaktivera +Checked=Markerad +UnChecked=Omarkerad +Unknown=Oknd +Restart=Starta om +RestartMsg=Starta om Vistumbler fr att byta sprk +NoSignalHistory=Ingen singnalhistorik hittades, kontrollera att dina netsh skord r korrekta +NoApSelected=Du har inte valt ngon tkomstpunkt +UseNetcomm=Anvnd Netcomm OCX (stabilare) - x32 +UseCommMG=Anvnd CommMG (mindre stabil) - x32 - x64 +SignalHistory=Signalhistorik +AutoSortEvery=Autosortera varje +Seconds=sekunder +Ascending=Stigande +Decending=Fallande +AutoSave=Spara automatiskt +AutoSaveEvery=Autospara varje +DelAutoSaveOnExit=Ta bort autosparad fil vid avslut +OpenSaveFolder=ppna mappen med autosparade filer +SortBy=Sortera efter +SortDirection=Sorteringsordning +Auto=Auto +Misc=Diverse +GPS=GPS +Labels=Etiketter +Manufacturers=Tillverkare +Columns=Kolumner +Language=Sprk +SearchWords=Skord +VistumblerSettings=Vistumbler-instllningar +LanguageAuthor=versttare +LanguageDate=Sprkdatum +LanguageDescription=Sprkbeskrivning +Description=Beskrivning +Progress=Frlopp +LinesMin=Rader/min +NewAPs=Nya AP:er +NewGIDs=Nya GID:er +Minutes=Minuter +LineTotal=Rad/Total +EstimatedTimeRemaining=Berknad terstende tid +Ready=Klar +Done=Slutfrt +VistumblerSaveDirectory=Vistumbler lagringsmapp +VistumblerAutoSaveDirectory=Vistumbler autolagringsmapp +VistumblerKmlSaveDirectory=Vistumbler KML lagringsmapp +BackgroundColor=Bakgrundsfrg +ControlColor=Kontrollfrg +BgFontColor=Teckenfrg +ConFontColor=Kontrollteckenfrg +NetshMsg=Den hr sektionen lter dig ndra vilka ord Vistumbler anvnder fr att genomska netsh. ndra till ord som stmmer verens med din Windows-version. Kr kommandot "netsh wlan show networks mode = bssid" fr att hitta de rtta orden. +PHPgraphing=PHP diagramritning +ComInterface=Com-grnssnitt +ComSettings=Com-instllningar +Com=Com +Baud=Baud +GPSFormat=GPS-format +HideOtherGpsColumns=Dlj andra GPS-kolumner +ImportLanguageFile=Importera sprkfil +AutoKml=Auto-KML +GoogleEarthEXE=Google Earth EXE +AutoSaveKmlEvery=Autospara KML varje +SavedAs=Sparad som +Overwrite=Skriv ver +InstallNetcommOCX=Installera Netcomm OCX +NoFileSaved=Ingen fil har sparats +NoApsWithGps=Ingen tkomstpunkt hittades med gps-koordinater. +MacExistsOverwriteIt=Det finns redan en post med den hr mac-adressen. Vill du skriva ver den? +SavingLine=Sparar rad +Debug=Felskning +DisplayDebug=Visa funktioner +DisplayDebugCom=Visa COM-fel +GraphDeadTime=Dd tid +OpenKmlNetLink=ppna KML-ntverkslnk +ActiveRefreshTime=Aktiv-uppdateringsintervall +DeadRefreshTime=Dd-uppdateringsintervall +GpsRefrshTime=GPS-uppdateringsintervall +FlyToSettings=Fly To-instllningar +FlyToCurrentGps="Fly To" aktuell GPS-position +AltitudeMode=Hjdlge +Range=Intervall +Heading=Riktning +Tilt=Lutning +AutoOpenNetworkLink=ppna KML-ntverkslnk automatiskt +SpeakSignal=Signal som talmeddelande +SpeakUseVisSounds=Anvnd Vistumblers ljudfiler +SpeakUseSapi=Anvnd Microsofts ljud-API +SpeakSayPercent=Sg "Percent" efter signal +GpsTrackTime=GPS-sprningsintervall +SaveAllGpsData=Spara GPS-data nr inga AP:er r aktiva +None=Inget +Even=Jmn +Odd=Udda +Mark=Markera +Space=Rymd +StopBit=Stopp-bit +Parity=Paritet +DataBit=Data-bit +Update=Uppdatera +UpdateMsg=Uppdatering hittades. Vill du uppdatera vistumbler? +Recover=terstll +RecoverMsg=ldre DB hittades. Vill du terstlla den? +SelectConnectedAP=Vlj ansluten AP +VistumblerHome=Vistumblers hemsida +VistumblerForum=Vistumbler Forum +VistumblerWiki=Vistumbler Wiki +CheckForUpdates=Sk efter uppdateringar +SelectWhatToCopy=Markera vad du vill kopiera +Default=Standard +PlayMidiSounds=Spela MIDI-ljud fr alla aktiva AP:er +Interface=Grnssnitt +LanguageCode=Sprkkod +AutoCheckUpdates=Sk automatiskt efter uppdateringar +CheckBetaUpdates=Sk efter beta-uppdateringar +GuessSearchwords=Gissa Netsh-skord +Help=Hjlp +ErrorScanningNetsh=Fel vid netsh-skanning +GpsErrorBufferEmpty=GPS-fel. Buffert tom mer n 10 sekunder. GPS blev troligen bortkopplad. GPS har stoppats +GpsErrorStopped=GPS-fel. GPS har stoppats +ShowSignalDB=Visa signal-dB (Berknad) +SortingList=Sorterar lista +Loading=Lser in +MapOpenNetworks=Kartlgg ppna ntverk +MapWepNetworks=Kartlgg WEP-ntverk +MapSecureNetworks=Kartlgg skra ntverk +DrawTrack=Rita spr +UseLocalImages=Anvnd lokala avbilder +MIDI=MIDI +MidiInstrumentNumber=MIDI-instrument # +MidiPlayTime=MIDI-speltid +SpeakRefreshTime=Tal-uppdateringsintervall +Information=Information +AddedGuessedSearchwords=Gissade netsh-skord har lagts till. Skord fr ppna, Ingen, WEP, Infrastruktur, och Adhoc mste fortfarande kontrolleras manuellt +SortingTreeview=Sorterar trdvy +Recovering=terstller +ErrorOpeningGpsPort=Kunde inte ppna GPS-port +SecondsSinceGpsUpdate=Sekunder sedan GPS-uppdatering +SavingGID=Sparar GID +SavingHistID=Sparar HistID +NoUpdates=Det finns inga tillgngliga uppdatreringar +NoActiveApFound=Ingen aktive AP hittades +VistumblerDonate=Donera +VistumblerStore=Butik +SupportVistumbler=*Std Vistumbler* +FilterMsg=Anvnd asterisk (*)" som jokertecken. Separera multipla filter med komma (,). Anvnd bindestreck(-) fr intervall. Mac-adressfltet stder procenttecknet(%) som jokertecken. +SetFilters=Filter +Filters=Filter +NoAdaptersFound=Inga ntverkskort hittades +RecoveringMDB=terstller MDB +FixingGpsTableDates=tgrdar GPS-tabelldatum +FixingHistTableDates=tgrdar HIST-tabelldatum +VistumblerNeedsToRestart=Vistumbler mste startas om. Vistumbler stngs nu +AddingApsIntoList=Lgger till nya AP:er i listan +GoogleEarthDoesNotExist=Google Earth-filen finns inte, eller r felkonfigurerad i AutoKML-instllningarna +AutoKmlIsNotStarted=AutoKML r inte startad. Vill du starta det nu? +UseKernel32=Anvnd Kernel32 - x32 - x64 +UnableToGuessSearchwords=Vistumbler kunde inte gissa skorden +Filtered=Filtrerad +SelectedAP=Markerad AP +AllAPs=Alla AP:er +FilteredAPs=Filtrerade AP:er +FixingGpsTableTimes=tgrdar GPS-tabelltid +ImportFolder=Importera mapp +DeleteSelected=Ta bort markerad +RecoverSelected=terstll markerad +NewSession=Ny session +Size=Storlek +NoMdbSelected=Ingen MDB markerad +LocateInWiFiDB=Lokalisera position i WiFiDB +AutoWiFiDbGpsLocate=Automatisk WiFiDB GPS-lokalisering +AutoSelectConnectedAP=Vlj ansluten AP automatiskt +Experimental=Experimentell +UploadDataToWiFiDB=Ladda upp data till WiFiDB +Error=Fel +Updating=Uppdaterar +Downloaded=Nedladdad +Retry=Frsk igen +Ignore=Hoppa ver +Yes=Ja +No=Nej +LoadingVersionsFile=Lser in versionsfil +UsingLocalFile=Anvnder lokal fil +DownloadingBetaVerFile=Laddar ner beta-versionsfil +DownloadingVerFile=Laddar ner ny versionsfil +VerFileDownloaded=Versionsfil nedladdad +ErrDownloadVerFile=Kunde inte ladda ner versionsfil +NewFile=Ny fil +UpdatedFile=Uppdaterad fil +ErrCopyingFile=Kunde inte kopiera fil +ErrReplacaingOldFile=Kunde inte erstta den befintliga filen (Den kanske anvnds) +ErrDownloadingNewFile=Kunde inte ladda ner ny fil +NoChangeInFile=Ingen filndring +DeletedFile=Borttagen fil +ErrDeletingFile=Kunde inte ta bort fil +ErrWouldYouLikeToRetryUpdate=Fel! Vill du frska uppdatera igen? +DoneWouldYouLikeToLoadVistumbler=Klart! Vill du starta Vistumbler? +Color=Frg +AddRemFilters=Lgg till/Ta bort filter +NoFilterSelected=Inga filter valda. +Import=&Importera +View=&Visa +AddFilter=Lgg till filter +EditFilter=Redigera filter +DeleteFilter=Ta bort filter +TimeBeforeMarkedDead=Vntetid innan AP markeras som dd +FilterNameRequired=Filternamn krvs +UpdateManufacturers=Uppdatera tillverkare +FixHistSignals=tgrdar saknad(e) Hist-tabellsignal(er) +VistumblerFile=Vistumbler-fil +DetailedFile=Detaljerad kommaseparerad fil +NetstumblerTxtFile=Netstumbler Wi-skanfil +WardriveDb3File=Wardrive-Androidfil +AutoScanApsOnLaunch=Skanna automatiskt AP:er vid uppstart +RefreshInterfaces=Uppdatera grnssnitt +NoAps=Inga tkomstpunkter. +AutoSelectHighSigAP=Vlj automatiskt AP med hgst signalstyrk +Sound=Ljud +OncePerLoop=En gng per loop +OncePerAP=En gng per AP +OncePerAPwSound=En gng per AP med signalbaserad volym +PhilsPHPgraph=Skapa diagrambild av markerad AP +PhilsWDB=WiFiDB URL +PhilsWdbLocate=WifiDB lokaliserings-URL +PhilsWifiTools=Phil's WiFi-verktyg +AutoWiFiDbUploadAps=Ladda automatiskt upp aktiv AP till WiFiDB +WifiDB=WifiDB +Warning=Varning! +WifiDBLocateWarning=Denna funktion snder information om aktiv tkomstpunkt till den WifiDB API-URL som specificeras i Vistumblers WifiDB-instllningar. Om du inte vill snda data till WiFiDB, skall du inte aktivera den hr funktionen. Vill du fortfarande aktivera den hr funktionen? +WifiDBAutoUploadWarning=Denna funktion snder information om aktiv tkomstpunkt till den WifiDB API-URL som specificeras i Vistumblers WifiDB-instllningar. Om du inte vill snda data till WiFiDB, skall du inte aktivera den hr funktionen. Vill du fortfarande aktivera den hr funktionen? +WifiDBOpenLiveAPWebpage=ppna WifiDB Live AP webbsida +WifiDBOpenMainWebpage=ppna WifiDB webbsida +FilePath=Filskvg +CameraName=Kameranamn +CameraURL=Kamera-URL +Cameras=Kameror +AddCamera=Lgg till kamera +RemoveCamera=Ta bort kamera +EditCamera=Redigera kamera +UseNativeWifiMsg=Anvnd inbyggd WiFi +UseNativeWifiXpExtMsg=(Ingen BSSID, CHAN, OTX, BTX) +DownloadImages=Ladda ner bilder +EnableCamTriggerScript=Aktivera kamerautlsarskript +SetCameras=Kameror +UpdateUpdaterMsg=Det finns en uppdatering till Vistumbler uppdaterare. Vill du ladda ner uppdateringen nu? +UseRssiInGraphs=Anvnd RSSI i diagram +2400ChannelGraph=2.4Ghz kanaldiagram +5000ChannelGraph=5Ghz kanaldiagram +UpdateGeolocations=Uppdatera geolokalisering +Graph=Diagram +ShowGpsPositionMap=Visa GPS positionskarta +ShowGpsSignalMap=Visa GPS signalkarta +UseRssiSignalValue=Anvnd RSSI signalvrden +UseCircleToShowSigStength=Anvnd cirkel fr att visa signalstyrka +ShowGpsRangeMap=Visa GPS omfngskarta +ShowGpsTack=Visa GPS sprning +FilterName=Filternamn +FilterDesc=Filterbeskrivning +FilterAddEdit=Lgg till/Redigera filter +CameraTriggerScript=Kamerautlsningsskript +CameraTriggerScriptTypes=Kamerautlsningsskript (exe,bat) +Line=Rad +Total=Total +SummaryFile=versiktlig kommaseparerad fil +WifiDB_Upload_Discliamer=Denna funktion snder information om tkomstpunkter till WifiDB. En fil kommer att skapas och laddas upp till den WifiDB API-URL som specificeras i Vistumblers WifiDB-instllningar. +UserInformation=Anvndarinformation +WifiDB_Username=WifiDB anvndarnamn +WifiDB_Api_Key=WifiDB Api-nyckel +OtherUsers=Andra anvndare +FileType=Filtyp +VistumblerVSZ=Vistumbler VSZ +VistumblerVS1=Vistumbler VS1 +VistumblerCSV=Vistumbler detaljerad CSV +UploadInformation=Ladda upp information +Title=Titel +Notes=Anteckningar +UploadApsToWifidb=Ladda upp AP:er till WifiDB +UploadingApsToWifidb=Laddar upp AP:er till WifiDB diff --git a/Installer/vi_files/Languages/Turkish.ini b/Installer/vi_files/Languages/Turkish.ini new file mode 100644 index 00000000..70788894 --- /dev/null +++ b/Installer/vi_files/Languages/Turkish.ini @@ -0,0 +1,415 @@ +[Info] +Author=BSODX +Date=2017/06/14 +Description=Turkish SearchWords. Turkish Text. +WindowsLanguageCode=tr_TR + +[SearchWords] +SSID=SSID +BSSID=BSSID +NetworkType=A tipi +Authentication=Dorulama +Encryption=ifreleme +Signal=Sinyal +RadioType=Radyo Tipi +Channel=Kanal +BasicRates=Temel hz +OtherRates=Dier hz +Open=Ak +None=Yok +WEP=WEP +Infrastructure=Yap +Adhoc=Adhoc +RSSI=RSSI +Cipher=Cipher + +[Column_Names] +Column_Line=# +Column_Active=Aktif +Column_SSID=SSID +Column_BSSID=Mac Adresi +Column_Manufacturer=retici +Column_Signal=Sinyal +Column_Authentication=Dorulama +Column_Encryption=ifreleme +Column_RadioType=Radyo tipi +Column_Channel=Kanal +Column_Latitude=Enlem +Column_Longitude=Boylam +Column_LatitudeDMS=Lat (dd mm ss) +Column_LongitudeDMS=Lon (dd mm ss) +Column_LatitudeDMM=Lat (ddmm.mmmm) +Column_LongitudeDMM=Lon (ddmm.mmmm) +Column_BasicTransferRates=Basit Transfer Hz +Column_OtherTransferRates=Dier Transfer Hz +Column_FirstActive=lk Aktif +Column_LastActive=Son gncelleme +Column_NetworkType=A tipi +Column_Label=Etiket +Column_HighSignal=High Signal +Column_RSSI=RSSI +Column_HighRSSI=High RSSI + +[GuiText] +Ok=&Tamam +Cancel=%ptal +Apply=&Uygula +Browse=&Gzat... +File=&Dosya +SaveAsTXT=TXT olarak kaydet... +SaveAsVS1=VS1 olarak kaydet... +SaveAsVSZ=VSZ olarak kaydet... +ImportFromTXT=TXT/VS1' den al... +ImportFromVSZ=VSZ'den al... +Exit=&k +Edit=D&zenle +ClearAll=Tmn temizle +Cut=Kes +Copy=Kopyala +Paste=Yaptr +Delete=Sil +Select=Se +SelectAll=Tmn se +Options=&Seenekler +AutoSort=Otomatik sralama +SortTree=Treeview srala(yava) +PlaySound=Yeni AP'de ses al +AddAPsToTop=Yeni AP'leri ste koy +Extra=Ek&stra +ScanAPs=&AP'leri tara +StopScanAps=&Dur +UseGPS=&GPS 'i kullan +StopGPS=&GPS'i durdur +Settings=A&yarlar +GpsSettings=GPS Ayarlar +SetLanguage=Dil se... +SetSearchWords=Netsh arama kelimelerini ayarla... +Export=D&a aktar... +ExportToKML=KML'ye aktar... +ExportToTXT=TXT'ye aktar... +ExportToVS1=VS1'e aktar... +ExportToNS1=NS1'e aktar... +PhilsPHPgraph=Grafii gster(Phil's PHP versiyonu) +PhilsWDB=Phils WiFiDB (Alpha) +RefreshLoopTime=Dng sresini yenile(ms) +ActualLoopTime=Tam dng zaman +Longitude=Boylam +Latitude=Enlem +ActiveAPs=Aktif AP'ler +Graph1=Grafik&1 +Graph2=Grafik&2 +NoGraph=&Grafik yok +SetMacLabel=Mac'e gre etiketle +SetMacManu=reticileri Mac'e gre dzenle +Active=Aktif +Dead=l +AddNewLabel=Yeni etiket ekle +RemoveLabel=Seili etiketi kaldr +EditLabel=Seili etiketi dzenle +AddNewMan=Yeni retici ekle +RemoveMan=Seili reticiyi kaldr +EditMan=Seili reticiyi dzenle +NewMac=Yeni Mac adresi +NewMan=Yeni retici +NewLabel=Yeni etiket +Save=Kaydet? +SaveQuestion=Data deiti. kaydedilsin mi? +GpsDetails=GPS Detaylar +Quality=Kalite +Time=Zaman +NumberOfSatalites=Uydu says +HorizontalDilutionPosition=Yatay seyrelme +Altitude=Ykseklik +HeightOfGeoid=Geoit ykseklii +Status=Durum +Date=Tarih +SpeedInKnots=hz(knots) +SpeedInMPH=Hz(MPH) +SpeedInKmh=Hz(km/h) +TrackAngle=Takip as +Close=Kapat +ConnectToWindowName=Bir aa balan +RefreshingNetworks=Alar yenileniyor... +Start=Bala +Stop=Dur +ConnectToWindowTitle="Connect to" pencere bal: +RefreshTime=Yenileme sresi (ms) +SetColumnWidths=Stun geniliini ayarla... +Enable=Aktive et +Disable=Deaktive et +Checked=Seili +UnChecked=Seimi kaldrld +Unknown=Bilinmeyen +Restart=Yeniden balat +RestartMsg=Dil deiikliinin etkili olmas iin VisTumbler' yeniden baaltn! +NoSignalHistory=Sinyal kayd bulunamad, netsh komutlarnz kontrol edin +NoApSelected=AP seili deil! +UseNetcomm=Netcomm OCX kullan (daha stabil) - x32 +UseCommMG=CommMG kullan(daha az stabil) - x32 - x64 +SignalHistory=Signal kayd +AutoSortEvery=Hepsini otomatik srala +Seconds=Saniye +Ascending=Ykseliyor +Decending=Azalyor +AutoSave=Otomatik kaydet +AutoSaveEvery=Hepsini otomatik kaydet +DelAutoSaveOnExit=kta otomatik kayt dosyasn sil +OpenSaveFolder=Kayt dosyasn a... +SortBy=una gre srala... +SortDirection=Sralama yn +Auto=Oto +Misc=Dier +GPS=GPS +Labels=Etiketler +Manufacturers=reticiler +Columns=Stunlar +Language=Dil +SearchWords=Arama kelimeleri +VistumblerSettings=Vistumbler Ayarlar +LanguageAuthor=Dil yazar +LanguageDate=Dil tarihi +LanguageDescription=Dil aklamas +Description=Aklama +Progress=lerleme +LinesMin=LSra/dk +NewAPs=Yeni AP'ler +NewGIDs=Yeni GID'ler +Minutes=Dakikalar +LineTotal=Sra/Toplam +EstimatedTimeRemaining=Yaklak kalan zaman +Ready=Hazr +Done=Bitti +VistumblerSaveDirectory=Vistumbler Kayt Yeri +VistumblerAutoSaveDirectory=Vistumbler Otomatik Kayt Yeri +VistumblerKmlSaveDirectory=Vistumbler KML Kayt Yeri +BackgroundColor=Arkaplan rengi +ControlColor=Kontrol rengi +BgFontColor=Font rengi +ConFontColor=Kontrol font rengi +NetshMsg=Bu ksm VisTumbler'n netsh iin kulland kelimeleri deitirmenizi salar. Cmd'de "netsh wlan show networks mode = bssid" komutuyla doru kelimeleri bulabilirsiniz. +PHPgraphing=PHP grafikleme +ComInterface=Com Arayz +ComSettings=Com Ayarlar +Com=Com +Baud=Baud +GPSFormat=GPS Format +HideOtherGpsColumns=Dier GPS stunlarn gizle +ImportLanguageFile=Dil dosyasn al... +AutoKml=Otomatik KML +GoogleEarthEXE=Google Earth EXE +AutoSaveKmlEvery=Tm KML'leri otomatik olarak kaydet +SavedAs=Olarak kaydedildi +Overwrite=zerine yaz +InstallNetcommOCX=Netcomm OCX'i kur +NoFileSaved=Herhangi bir dosya kaydedilmedi +NoApsWithGps=Koordinat zerinde AP bulunamad. +MacExistsOverwriteIt=Bu Mac iin bir girdi bulundu. zerine yazlsn m? +SavingLine=Sra kaydediliyor +DisplayDebug=Fonksiyonlar gster - hata aykla +GpsCompass=Gps Pusula +OpenKmlNetLink=Open KML NetworkLink +GraphDeadTime=Grafik Deaktivasyon zaman +ActiveRefreshTime=Aktif yenileme zaman +DeadRefreshTime=Deaktif yenileme zaman +GpsRefrshTime=Gps Yenileme zaman +FlyToSettings=Ayarlara git +FlyToCurrentGps=u andaki GPS konumuna git +AltitudeMode=Ykseklik modu +Range=Menzil +Heading=Balk +Tilt=Eim +AutoOpenNetworkLink=Otomatik olarak KML Network Link'i a +SpeakSignal=Konuma sinyali +SpeakUseVisSounds=Vistumbler seslerini kullan +SpeakUseSapi=Microsoft Ses API'sini kullan +SpeakSayPercent=Sinyalden sonra "yzde" de +GpsTrackTime=Takip yenileme zaman +SaveAllGpsData=AP yoksa GPS verisini kaydet +None=Yok +Even=ift +Odd=Tek +Mark=aret +Space=Boluk +ExitSaveDb=k (DB'yi kaydet) +Update=Gncelle +UpdateMsg=Gncelleme bulundu. Vistumbler' gncellemek ister misiniz? +Recover=Kurtar +RecoverMsg=Eski bir DB bulundu. Kurtarmak ister misiniz? +SelectConnectedAP=Balanlan AP'yi se +VistumblerHome=Vistumbler Ana sayfa +VistumblerForum=Vistumbler Forum +VistumblerWiki=Vistumbler Wiki +CheckForUpdates=Gncelleme iin kontrol et... +SelectWhatToCopy=Ne kopyalamak istediinizi sein... +Default=Varsaylan +Import=&Import +View=&View +PlayGpsSound=Play sound on new GPS +MiscSettings=Misc Settings +SaveSettings=Save Settings +ExportToGPX=Export To GPX +ExportToCSV=Export To CSV +ExportToVSZ=Export To VSZ +WifiDbPHPgraph=Graph Selected AP Signal to Image +WifiDbWDB=WiFiDB URL +WifiDbWdbLocate=WifiDB Locate URL +UploadDataToWiFiDB=Upload Data to WiFiDB +Graph=Graph +Error=Error +AutoRecoveryVS1=Auto Recovery VS1 +NoAps=No access points. +Debug=Debug +DisplayDebugCom=Display COM Errors +StopBit=Stop Bit +Parity=Parity +DataBit=Data Bit +PlayMidiSounds=Play MIDI sounds for all active APs +Interface=Interface +LanguageCode=Language Code +AutoCheckUpdates=Automatically Check For Updates +CheckBetaUpdates=Check For Beta Updates +GuessSearchwords=Guess Netsh Searchwords +Help=Help +ErrorScanningNetsh=Error scanning netsh +GpsErrorBufferEmpty=GPS Error. Buffer Empty for more than 10 seconds. GPS was probrably disconnected. GPS has been stopped +GpsErrorStopped=GPS Error. GPS has been stopped +ShowSignalDB=Show Signal dB (Estimated) +SortingList=Sorting List +Loading=Loading +MapOpenNetworks=Map Open Networks +MapWepNetworks=Map WEP Networks +MapSecureNetworks=Map Secure Networks +DrawTrack=Draw Track +UseLocalImages=Use Local Images +MIDI=MIDI +MidiInstrumentNumber=MIDI Instrument # +MidiPlayTime=MIDI Play Time +SpeakRefreshTime=Speak Refresh Time +Information=Information +AddedGuessedSearchwords=Added guessed netsh searchwords. Searchwords for Open, None, WEP, Infrustructure, and Adhoc will still need to be done manually +SortingTreeview=Sorting Treeview +Recovering=Recovering +ErrorOpeningGpsPort=Error opening GPS port +SecondsSinceGpsUpdate=Seconds Since GPS Update +SavingGID=Saving GID +SavingHistID=Saving HistID +NoUpdates=No Updates Avalible +NoActiveApFound=No Active AP found +VistumblerDonate=Donate +VistumblerStore=Store +SupportVistumbler=*Support Vistumbler* +UseNativeWifiMsg=Use Native Wifi +UseNativeWifiXpExtMsg=(No BSSID, CHAN, OTX, BTX) +FilterMsg=Use asterik(*)" as a wildcard. Seperate multiple filters with a comma(,). Use a dash(-) for ranges. +SetFilters=Set Filters +Filtered=Filtered +Filters=Filters +FilterName=Filter Name +FilterDesc=Filter Description +FilterAddEdit=Add/Edit Filter +NoAdaptersFound=No Adapters Found +RecoveringMDB=Recovering MDB +FixingGpsTableDates=Fixing GPS table date(s) +FixingGpsTableTimes=Fixing GPS table time(s) +FixingHistTableDates=Fixing HIST table date(s) +VistumblerNeedsToRestart=Vistumbler needs to be restarted. Vistumbler will now close +AddingApsIntoList=Adding new APs into list +GoogleEarthDoesNotExist=Google earth file does not exist or is set wrong in the AutoKML settings +AutoKmlIsNotStarted=AutoKML is not yet started. Would you like to turn it on now? +UseKernel32=Use Kernel32 - x32 - x64 +UnableToGuessSearchwords=Vistumbler was unable to guess searchwords +SelectedAP=Selected AP +AllAPs=All APs +FilteredAPs=Filtered APs +ImportFolder=Import Folder +DeleteSelected=Delete Selected +RecoverSelected=Recover Selected +NewSession=New Session +Size=Size +NoMdbSelected=No MDB Selected +LocateInWiFiDB=Locate Position in WiFiDB +AutoWiFiDbGpsLocate=Auto WiFiDB Gps Locate +AutoWiFiDbUploadAps=Auto WiFiDB Upload Active AP +AutoSelectConnectedAP=Auto Select Connected AP +AutoSelectHighSigAP=Auto Select Highest Signal AP +Experimental=Experimental +Color=Color +AddRemFilters=Add/Remove Filters +NoFilterSelected=No filter selected. +AddFilter=Add Filter +EditFilter=Edit Filter +DeleteFilter=Delete Filter +TimeBeforeMarkedDead=Time to wait before marking AP dead (s) +FilterNameRequired=Filter Name is required +UpdateManufacturers=Update Manufacturers +FixHistSignals=Fixing Missing Hist Table Signal(s) +VistumblerFile=Vistumbler file +DetailedFile=Detailed Comma Delimited file +SummaryFile=Summary Comma Delimited file +NetstumblerTxtFile=Netstumbler wi-scan file +WardriveDb3File=Wardrive-android file +AutoScanApsOnLaunch=Auto Scan APs on launch +RefreshInterfaces=Refresh Interfaces +Sound=Sound +OncePerLoop=Once per loop +OncePerAP=Once per ap +OncePerAPwSound=Once per ap with volume based on signal +WifiDB=WifiDB +Warning=Warning +WifiDBLocateWarning=This feature sends active access point information to the WifiDB API URL specified in the Vistumbler WifiDB Settings. If you do not want to send data to the wifidb, do not enable this feature. Do you want to continue to enable this feature? +WifiDBAutoUploadWarning=This feature sends active access point information to the WifiDB URL specified in the Vistumbler WifiDB Settings. If you do not want to send data to the wifidb, do not enable this feature. Do you want to continue to enable this feature? +WifiDBOpenLiveAPWebpage=Open WifiDB Live AP Webpage +WifiDBOpenMainWebpage=Open WifiDB Main Webpage +FilePath=File Path +CameraName=Camera Name +CameraURL=Camera URL +Cameras=Cameras +AddCamera=Add Camera +RemoveCamera=Remove Camera +EditCamera=Edit Camera +DownloadImages=Download Images +EnableCamTriggerScript=Enable camera trigger script +CameraTriggerScript=Camera Trigger Script +CameraTriggerScriptTypes=Camera Trigger Script (exe,bat) +SetCameras=Set Cameras +UpdateUpdaterMsg=There is an update to the vistumbler updater. Would you like to download and update it now? +UseRssiInGraphs=Use RSSI in graphs +2400ChannelGraph=2.4Ghz Channel Graph +5000ChannelGraph=5Ghz Channel Graph +UpdateGeolocations=Update Geolocations +ShowGpsPositionMap=Show GPS Position Map +ShowGpsSignalMap=Show GPS Signal Map +UseRssiSignalValue=Use RSSI signal values +UseCircleToShowSigStength=Use circle to show signal strength +ShowGpsRangeMap=Show GPS Range Map +ShowGpsTack=Show GPS Track +Line=Line +Total=Total +WifiDB_Upload_Discliamer=This feature uploads access points to the WifiDB. a file will be generated and uploaded to the WifiDB API URL specified in the Vistumbler WifiDB Settings. +UserInformation=User Information +WifiDB_Username=WifiDB Username +WifiDB_Api_Key=WifiDB Api Key +OtherUsers=Other users +FileType=File Type +VistumblerVSZ=Vistumbler VSZ +VistumblerVS1=Vistumbler VS1 +VistumblerCSV=Vistumbler Detailed CSV +UploadInformation=Upload Information +Title=Title +Notes=Notes +UploadApsToWifidb=Upload APs to WifiDB +UploadingApsToWifidb=Uploading APs to WifiDB +GeoNamesInfo=Geonames Info +FindApInWifidb=Find AP in WifiDB +GpsDisconnect=Disconnect GPS when no data is recieved in over 10 seconds +GpsReset=Reset GPS position when no GPGGA data is recived in over 30 seconds +APs=APs +MaxSignal=Max Signal +DisassociationSignal=Disassociation Signal +SaveDirectories=Save Directories +AutoSaveAndClearAfterNumberofAPs=Auto Save And Clear After Number of APs +AutoSaveandClearAfterTime=Auto Save and Clear After Time +PlaySoundWhenSaving=Play Sound When Saving +MinimalGuiMode=Minimal GUI Mode +AutoScrollToBottom=Auto Scroll to Bottom of List +ListviewBatchInsertMode=Listview Batch Insert Mode diff --git a/Installer/vi_files/License.txt b/Installer/vi_files/License.txt new file mode 100644 index 00000000..10865706 --- /dev/null +++ b/Installer/vi_files/License.txt @@ -0,0 +1,220 @@ + GNU GENERAL PUBLIC LICENSE + + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, +Cambridge, MA 02139, USA +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice +placed by the copyright holder saying it may be distributed under the terms +of this General Public License. The "Program", below, refers to any such +program or work, and a "work based on the Program" means either the Program +or any derivative work under copyright law: that is to say, a work +containing the Program or a portion of it, either verbatim or with +modifications and/or translated into another language. (Hereinafter, +translation is included without limitation in the term "modification".) Each +licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered +by this License; they are outside its scope. The act of running the Program +is not restricted, and the output from the Program is covered only if its +contents constitute a work based on the Program (independent of having been +made by running the Program). Whether that is true depends on what the +Program does. + +1. You may copy and distribute verbatim copies of the Program's source code +as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +License and to the absence of any warranty; and give any other recipients of +the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you +may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, +thus forming a work based on the Program, and copy and distribute such +modifications or work under the terms of Section 1above, provided that you +also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices stating that +you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in whole or +in part contains or is derived from the Program or any part thereof, to be +licensed as a whole at no charge to all third parties under the terms of +this License. + +c) If the modified program normally reads commands interactively when run, +you must cause it, when started running for such interactive use in the most +ordinary way, to print or display an announcement including an appropriate +copyright notice and a notice that there is no warranty (or else, saying +that you provide a warranty) and that users may redistribute the program +under these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but does not +normally print such an announcement, your work based on the Program is not +required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Program, and can be +reasonably considered independent and separate works in themselves, then +this License, and its terms, do not apply to those sections when you +distribute them as separate works. But when you distribute the same sections +as part of a whole which is a work based on the Program, the distribution of +the whole must be on the terms of this License, whose permissions for other +licensees extend to the entire whole, and thus to each and every part +regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise +the right to control the distribution of derivative or collective works +based on the Program. + +In addition, mere aggregation of another work not based on the Program with +the Program (or with a work based on the Program) on a volume of a storage +or distribution medium does not bring the other work under the scope of this +License. + +3. You may copy and distribute the Program (or a work based on it, under +Section 2) in object code or executable form under the terms of Sections 1 +and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable source +code, which must be distributed under the terms of Sections1 and 2 above on +a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three years, to +give any third party, for a charge no more than your cost of physically +performing source distribution, a complete machine-readable copy of the +corresponding source code, to be distributed under the terms of Sections 1 +and 2 above on a medium customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer to +distribute corresponding source code. (This alternative is allowed only for +noncommercial distribution and only if you received the program in object +code or executable form with such an offer, in accord with Subsection b +above.) + +The source code for a work means the preferred form of the work for making +modifications to it. For an executable work, complete source code means all +the source code for all modules it contains, plus any associated interface +definition files, plus the scripts used to control compilation and +installation of the executable. However, as special exception, the source +code distributed need not include anything that is normally distributed (in +either source or binary form) with the major components (compiler, kernel, +and so on) of the operating system on which the executable runs, unless that +component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to +copy from a designated place, then offering equivalent access to copy the +source code from the same place counts as distribution of the source code, +even though third parties are notcompelled to copy the source along with the +object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as +expressly provided under this License. Any attempt otherwise to copy, +modify, sublicense or distribute the Program is void, and will automatically +terminate your rights under this License. However, parties who have received +copies, or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed +it. However, nothing else grants you permission to modify or distribute the +Program or its derivative works. These actions are prohibited by law if you +do not accept this License. Therefore, bymodifying or distributing the +Program (or any work based on the Program), you indicate your acceptance of +this License to do so, and all its terms and conditions for copying, +distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on theProgram), +the recipient automatically receives a license from the original licensor to +copy, distribute or modify the Program subject to these terms and +conditions. You may not impose any further restrictions on the recipients' +exercise of the rights granted herein. You are not responsible for enforcing +compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot distribute so +as to satisfy simultaneously your obligations under thisLicense and any +other pertinent obligations, then as a consequence you may not distribute +the Program at all. For example, if a patent license would not permit +royalty-free redistribution of the Program by all those who receive copies +directly or indirectly through you, then the only way you could satisfy both +it and this License would be to refrain entirely from distribution of the +Program. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply and +the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents +or other property right claims or to contest validity of any such claims; +this section has the sole purpose of protecting the integrity of the free +software distribution system, which is implemented by public license +practices. Many people have made generous contributions to the wide range of +software distributed through that system in reliance on consistent +application of that system; it is up to the author/donor to decide if he or +she is willing to distribute software through any other system and a +licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Program under this License may add an +explicit geographical distribution limitation excluding those countries, so +that distribution is permitted only in or among countries not thus excluded. +In such case, this License incorporates the limitation as if written in the +body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of +the General Public License from time to time. Such new versions will be +similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free programs +whose distribution conditions are different, write to the author to ask for +permission. For software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we sometimes make +exceptions for this. Our decision will be guided by the two goals of +preserving the free status of all derivatives of our free software and of +promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO +THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM +PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO +LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR +THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. diff --git a/Installer/vi_files/Settings/Cameras.mdb b/Installer/vi_files/Settings/Cameras.mdb new file mode 100644 index 00000000..f4c97885 Binary files /dev/null and b/Installer/vi_files/Settings/Cameras.mdb differ diff --git a/Installer/vi_files/Settings/Filters.mdb b/Installer/vi_files/Settings/Filters.mdb new file mode 100644 index 00000000..758cebf7 Binary files /dev/null and b/Installer/vi_files/Settings/Filters.mdb differ diff --git a/Installer/vi_files/Settings/Instruments.mdb b/Installer/vi_files/Settings/Instruments.mdb new file mode 100644 index 00000000..e76749d4 Binary files /dev/null and b/Installer/vi_files/Settings/Instruments.mdb differ diff --git a/Installer/vi_files/Settings/Labels.mdb b/Installer/vi_files/Settings/Labels.mdb new file mode 100644 index 00000000..0d69899b Binary files /dev/null and b/Installer/vi_files/Settings/Labels.mdb differ diff --git a/Installer/vi_files/Settings/Manufacturers.mdb b/Installer/vi_files/Settings/Manufacturers.mdb new file mode 100644 index 00000000..7fc50710 Binary files /dev/null and b/Installer/vi_files/Settings/Manufacturers.mdb differ diff --git a/Installer/vi_files/Settings/vistumbler_settings.ini b/Installer/vi_files/Settings/vistumbler_settings.ini new file mode 100644 index 00000000..e392e53d --- /dev/null +++ b/Installer/vi_files/Settings/vistumbler_settings.ini @@ -0,0 +1,164 @@ +[Vistumbler] +PortableMode=0 +Netsh_exe=netsh.exe +UseNativeWifi=1 +AutoCheckForUpdates=1 +CheckForBetaUpdates=1 +DefaultApapter=Wireless Network Connection +TextColor=0x000000 +BackgroundColor=0x99B4A1 +ControlBackgroundColor=0xD7E4C2 +SplitPercent=0.2 +SplitHeightPercent=0.65 +Sleeptime=1000 +NewApPosistion=1 +Language=English +LanguageFile=English.ini +AutoRefreshNetworks=1 +AutoRefreshTime=1000 +Debug=0 +DebugCom=0 +GraphDeadTime=0 +SaveGpsWithNoAps=1 +TimeBeforeMarkedDead=5 +AutoSelect=0 +AutoSelectHS=0 +DefFiltID=-1 +AutoScan=0 +dBmMaxSignal=-30 +dBmDissociationSignal=-85 + +[WindowPositions] + +[DateFormat] + +[GpsSettings] +ComPort=4 +Baud=4800 +Parity=N +DataBit=8 +StopBit=1 +GpsType=2 +GPSformat=3 +GpsTimeout=30000 + +[AutoSort] +AutoSortTime=60 +AutoSort=0 +SortCombo=Sort by SSID +AscDecDefault=0 + +[AutoSave] +AutoSave=1 +AutoSaveDel=1 +AutoSaveTime=300 + +[Sound] +PlaySoundOnNewAP=1 +SoundPerAP=0 +NewSoundSigBased=0 +NewAP_Sound=new_ap.wav +Error_Sound=error.wav + +[MIDI] +SpeakSignal=0 +SpeakSigSayPecent=1 +SpeakSigTime=2000 +SpeakType=2 +Midi_Instument=56 +Midi_PlayTime=500 +Midi_PlayForActiveAps=0 + +[AutoKML] +AutoKML=0 +AutoKML_Alt=4000 +AutoKML_AltMode=clampToGround +AutoKML_Heading=0 +AutoKML_Range=4000 +AutoKML_Tilt=0 +AutoKmlActiveTime=1 +AutoKmlDeadTime=30 +AutoKmlGpsTime=1 +AutoKmlTrackTime=10 +KmlFlyTo=1 +OpenKmlNetLink=1 + +[KmlSettings] +MapPos=1 +MapSig=1 +MapSigType=0 +MapRange=1 +ShowTrack=1 +MapOpen=1 +MapWEP=1 +MapSec=1 +UseLocalKmlImagesOnExport=0 +SigMapTimeBeforeMarkedDead=2 +TrackColor=7F0000FF +CirSigMapColor=FF0055FF +CirRangeMapColor=FF00AA00 + +[PhilsWifiTools] +WifiDb_User= +WifiDb_ApiKey= +Graph_SURL=https://www.randomintervals.com/wifi/ +WiFiDB_SURL=https://live.wifidb.net/wifidb/ +API_SURL=https://api.wifidb.net/ +UseWiFiDbGpsLocate=0 +AutoUpApsToWifiDB=0 +AutoUpApsToWifiDBTime=60 +WiFiDbLocateRefreshTime=5000 + +[Columns] +Column_Line=0 +Column_Active=1 +Column_BSSID=2 +Column_SSID=3 +Column_Signal=4 +Column_HighSignal=5 +Column_RSSI=6 +Column_HighRSSI=7 +Column_Channel=8 +Column_Authentication=9 +Column_Encryption=10 +Column_NetworkType=11 +Column_Latitude=12 +Column_Longitude=13 +Column_Manufacturer=14 +Column_Label=15 +Column_RadioType=16 +Column_LatitudeDMS=17 +Column_LongitudeDMS=18 +Column_LatitudeDMM=19 +Column_LongitudeDMM=20 +Column_BasicTransferRates=21 +Column_OtherTransferRates=22 +Column_FirstActive=23 +Column_LastActive=24 + +[Column_Width] +Column_Line=60 +Column_Active=60 +Column_BSSID=110 +Column_SSID=150 +Column_Signal=75 +Column_HighSignal=75 +Column_RSSI=75 +Column_HighRSSI=75 +Column_Channel=70 +Column_Authentication=105 +Column_Encryption=105 +Column_NetworkType=100 +Column_Latitude=85 +Column_Longitude=85 +Column_Manufacturer=110 +Column_Label=110 +Column_RadioType=85 +Column_LatitudeDMS=115 +Column_LongitudeDMS=115 +Column_LatitudeDMM=140 +Column_LongitudeDMM=140 +Column_BasicTransferRates=130 +Column_OtherTransferRates=130 +Column_FirstActive=130 +Column_LastActive=130 diff --git a/Installer/vi_files/Sounds/autosave.wav b/Installer/vi_files/Sounds/autosave.wav new file mode 100644 index 00000000..b1e201cd Binary files /dev/null and b/Installer/vi_files/Sounds/autosave.wav differ diff --git a/Installer/vi_files/Sounds/eight.wav b/Installer/vi_files/Sounds/eight.wav new file mode 100644 index 00000000..730185e1 Binary files /dev/null and b/Installer/vi_files/Sounds/eight.wav differ diff --git a/Installer/vi_files/Sounds/eightteen.wav b/Installer/vi_files/Sounds/eightteen.wav new file mode 100644 index 00000000..950356d5 Binary files /dev/null and b/Installer/vi_files/Sounds/eightteen.wav differ diff --git a/Installer/vi_files/Sounds/eighty.wav b/Installer/vi_files/Sounds/eighty.wav new file mode 100644 index 00000000..09a119cf Binary files /dev/null and b/Installer/vi_files/Sounds/eighty.wav differ diff --git a/Installer/vi_files/Sounds/eleven.wav b/Installer/vi_files/Sounds/eleven.wav new file mode 100644 index 00000000..af804738 Binary files /dev/null and b/Installer/vi_files/Sounds/eleven.wav differ diff --git a/Installer/vi_files/Sounds/error.wav b/Installer/vi_files/Sounds/error.wav new file mode 100644 index 00000000..12c97350 Binary files /dev/null and b/Installer/vi_files/Sounds/error.wav differ diff --git a/Installer/vi_files/Sounds/fifteen.wav b/Installer/vi_files/Sounds/fifteen.wav new file mode 100644 index 00000000..5fed376d Binary files /dev/null and b/Installer/vi_files/Sounds/fifteen.wav differ diff --git a/Installer/vi_files/Sounds/fifty.wav b/Installer/vi_files/Sounds/fifty.wav new file mode 100644 index 00000000..ced7827d Binary files /dev/null and b/Installer/vi_files/Sounds/fifty.wav differ diff --git a/Installer/vi_files/Sounds/five.wav b/Installer/vi_files/Sounds/five.wav new file mode 100644 index 00000000..95b73e4e Binary files /dev/null and b/Installer/vi_files/Sounds/five.wav differ diff --git a/Installer/vi_files/Sounds/four.wav b/Installer/vi_files/Sounds/four.wav new file mode 100644 index 00000000..8401143e Binary files /dev/null and b/Installer/vi_files/Sounds/four.wav differ diff --git a/Installer/vi_files/Sounds/fourteen.wav b/Installer/vi_files/Sounds/fourteen.wav new file mode 100644 index 00000000..432237ca Binary files /dev/null and b/Installer/vi_files/Sounds/fourteen.wav differ diff --git a/Installer/vi_files/Sounds/fourty.wav b/Installer/vi_files/Sounds/fourty.wav new file mode 100644 index 00000000..b463617d Binary files /dev/null and b/Installer/vi_files/Sounds/fourty.wav differ diff --git a/Installer/vi_files/Sounds/hundred.wav b/Installer/vi_files/Sounds/hundred.wav new file mode 100644 index 00000000..9ebd29ae Binary files /dev/null and b/Installer/vi_files/Sounds/hundred.wav differ diff --git a/Installer/vi_files/Sounds/new_ap.wav b/Installer/vi_files/Sounds/new_ap.wav new file mode 100644 index 00000000..799b2ff2 Binary files /dev/null and b/Installer/vi_files/Sounds/new_ap.wav differ diff --git a/Installer/vi_files/Sounds/new_gps.wav b/Installer/vi_files/Sounds/new_gps.wav new file mode 100644 index 00000000..c05c5803 Binary files /dev/null and b/Installer/vi_files/Sounds/new_gps.wav differ diff --git a/Installer/vi_files/Sounds/nine.wav b/Installer/vi_files/Sounds/nine.wav new file mode 100644 index 00000000..ac49fae0 Binary files /dev/null and b/Installer/vi_files/Sounds/nine.wav differ diff --git a/Installer/vi_files/Sounds/nineteen.wav b/Installer/vi_files/Sounds/nineteen.wav new file mode 100644 index 00000000..e5d45594 Binary files /dev/null and b/Installer/vi_files/Sounds/nineteen.wav differ diff --git a/Installer/vi_files/Sounds/ninety.wav b/Installer/vi_files/Sounds/ninety.wav new file mode 100644 index 00000000..d15ef1b1 Binary files /dev/null and b/Installer/vi_files/Sounds/ninety.wav differ diff --git a/Installer/vi_files/Sounds/one.wav b/Installer/vi_files/Sounds/one.wav new file mode 100644 index 00000000..1b5b4e4b Binary files /dev/null and b/Installer/vi_files/Sounds/one.wav differ diff --git a/Installer/vi_files/Sounds/percent.wav b/Installer/vi_files/Sounds/percent.wav new file mode 100644 index 00000000..cb43eedd Binary files /dev/null and b/Installer/vi_files/Sounds/percent.wav differ diff --git a/Installer/vi_files/Sounds/seven.wav b/Installer/vi_files/Sounds/seven.wav new file mode 100644 index 00000000..7a017caa Binary files /dev/null and b/Installer/vi_files/Sounds/seven.wav differ diff --git a/Installer/vi_files/Sounds/seventeen.wav b/Installer/vi_files/Sounds/seventeen.wav new file mode 100644 index 00000000..e01da127 Binary files /dev/null and b/Installer/vi_files/Sounds/seventeen.wav differ diff --git a/Installer/vi_files/Sounds/seventy.wav b/Installer/vi_files/Sounds/seventy.wav new file mode 100644 index 00000000..34def8a9 Binary files /dev/null and b/Installer/vi_files/Sounds/seventy.wav differ diff --git a/Installer/vi_files/Sounds/six.wav b/Installer/vi_files/Sounds/six.wav new file mode 100644 index 00000000..0be82c64 Binary files /dev/null and b/Installer/vi_files/Sounds/six.wav differ diff --git a/Installer/vi_files/Sounds/sixteen.wav b/Installer/vi_files/Sounds/sixteen.wav new file mode 100644 index 00000000..0c9a0247 Binary files /dev/null and b/Installer/vi_files/Sounds/sixteen.wav differ diff --git a/Installer/vi_files/Sounds/sixty.wav b/Installer/vi_files/Sounds/sixty.wav new file mode 100644 index 00000000..41a8da1d Binary files /dev/null and b/Installer/vi_files/Sounds/sixty.wav differ diff --git a/Installer/vi_files/Sounds/ten.wav b/Installer/vi_files/Sounds/ten.wav new file mode 100644 index 00000000..cb37d352 Binary files /dev/null and b/Installer/vi_files/Sounds/ten.wav differ diff --git a/Installer/vi_files/Sounds/thirteen.wav b/Installer/vi_files/Sounds/thirteen.wav new file mode 100644 index 00000000..2fbf2762 Binary files /dev/null and b/Installer/vi_files/Sounds/thirteen.wav differ diff --git a/Installer/vi_files/Sounds/thirty.wav b/Installer/vi_files/Sounds/thirty.wav new file mode 100644 index 00000000..85668d31 Binary files /dev/null and b/Installer/vi_files/Sounds/thirty.wav differ diff --git a/Installer/vi_files/Sounds/three.wav b/Installer/vi_files/Sounds/three.wav new file mode 100644 index 00000000..5816e168 Binary files /dev/null and b/Installer/vi_files/Sounds/three.wav differ diff --git a/Installer/vi_files/Sounds/twelve.wav b/Installer/vi_files/Sounds/twelve.wav new file mode 100644 index 00000000..6729b60e Binary files /dev/null and b/Installer/vi_files/Sounds/twelve.wav differ diff --git a/Installer/vi_files/Sounds/twenty.wav b/Installer/vi_files/Sounds/twenty.wav new file mode 100644 index 00000000..5494f879 Binary files /dev/null and b/Installer/vi_files/Sounds/twenty.wav differ diff --git a/Installer/vi_files/Sounds/two.wav b/Installer/vi_files/Sounds/two.wav new file mode 100644 index 00000000..2f22c2b0 Binary files /dev/null and b/Installer/vi_files/Sounds/two.wav differ diff --git a/Installer/vi_files/Sounds/zero.wav b/Installer/vi_files/Sounds/zero.wav new file mode 100644 index 00000000..3135fcf3 Binary files /dev/null and b/Installer/vi_files/Sounds/zero.wav differ diff --git a/Installer/vi_files/UDFs/AccessCom.au3 b/Installer/vi_files/UDFs/AccessCom.au3 new file mode 100644 index 00000000..a0cf4eb5 --- /dev/null +++ b/Installer/vi_files/UDFs/AccessCom.au3 @@ -0,0 +1,399 @@ +;License Information------------------------------------ +;Copyright (C) 2008 Andrew Calcutt +;This file is based on work by randallc and stumpii of the AutoIt forum. (http://www.autoitscript.com/forum/index.php?showtopic=32144) +;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; Version 2 of the License. +;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +;You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +;-------------------------------------------------------- +#include-once + +Func _CreateDB($s_dbname, $USRName = "", $PWD = "") + $newMdb = ObjCreate("ADOX.Catalog"); + $newMdb.Create("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $s_dbname & ';') + $newMdb.ActiveConnection.Close +EndFunc ;==>_CreateDB + +Func _ExecuteMDB($s_dbname, $addConn, $sQuery, $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsObj($addConn) Then + _AccessConnectConn($s_dbname, $addConn, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + Return $addConn.Execute($sQuery) +EndFunc ;==>_ExecuteMDB + +Func _CopyTableToDB($s_dbname, $s_Tablename, $sNewDB, ByRef $addConn, ByRef $addConn2, $i_adoMDB = 1, $USRName = "", $PWD = "");(byref $sDB1, $sDbTable1, $sNewTable,$i_Execute=1) + If Not IsObj($addConn) Then + _AccessConnectConn($s_dbname, $addConn, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + If Not IsObj($addConn2) Then + _AccessConnectConn($sNewDB, $addConn2, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 2 + Else + $i_NeedToCloseInFunc = 3 + EndIf + If _TableExists($addConn2, $sNewDB, $s_Tablename) Then _DropTable($sNewDB, $s_Tablename, $addConn2) + _AccessCloseConn($addConn2) + ;COPY======================================================== + $queryCommand = "SELECT * INTO " & $s_Tablename & " IN '" & $sNewDB & "' FROM " & $s_Tablename;&" IN '" & $s_dbname &"'" + $addConn.Execute($queryCommand) + ;CRHANGE2======================================================== + _AccessConnectConn($sNewDB, $addConn2, 0) + If $i_NeedToCloseInFunc = 1 Then $addConn.Close + If $i_NeedToCloseInFunc = 2 Then $addConn2.Close +EndFunc ;==>_CopyTableToDB + +Func _CopyTableInDB($s_dbname, $s_Tablename, $sNewTable, ByRef $addConn, $i_adoMDB = 1, $USRName = "", $PWD = "");(byref $sDB1, $sDbTable1, $sNewTable,$i_Execute=1) + If Not IsObj($addConn) Then + _AccessConnectConn($s_dbname, $addConn, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + If _TableExists($addConn, $s_dbname, $sNewTable) Then _DropTable($s_dbname, $sNewTable, $addConn) + ;COPY======================================================== + $queryCommand = "SELECT * INTO " & $sNewTable & " IN '" & $s_dbname & "' FROM " & $s_Tablename;&" IN '" & $s_dbname &"'" + $addConn.Execute($queryCommand) + ;CRHANGE2======================================================== + If $i_NeedToCloseInFunc Then $addConn.Close +EndFunc ;==>_CopyTableInDB + +Func _FieldNames($s_dbname, $s_Tablename, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsObj($o_adoCon) Then + _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + $o_adoRs = ObjCreate("ADODB.Recordset") + $o_adoRs.Open("SELECT * FROM " & $s_Tablename, $o_adoCon) + $name = "" + For $i = 1 To $o_adoRs.Fields.Count + $name = $name & $o_adoRs.Fields($i - 1).Name & "|" + Next + $o_adoRs.Close + If $i_NeedToCloseInFunc Then $o_adoCon.Close + Return StringTrimRight($name, 1) +EndFunc ;==>_FieldNames + +Func _GetFieldNames($s_dbname, $s_Tablename, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsObj($o_adoCon) Then + _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + Dim $ret[1] + $o_adoRs = ObjCreate("ADODB.Recordset") + $o_adoRs.Open("SELECT * FROM " & $s_Tablename, $o_adoCon) + $name = "" + For $i = 1 To $o_adoRs.Fields.Count + ReDim $ret[UBound($ret, 1) + 1] + $ret[UBound($ret, 1) - 1] = $o_adoRs.Fields($i - 1).Name + Next + $o_adoRs.Close + If $i_NeedToCloseInFunc Then $o_adoCon.Close + Return $ret +EndFunc ;==>_GetFieldNames + +Func _TableExists(ByRef $connectionobj, $s_dbname, $s_Table, $i_adoMDB = 1, $USRName = "", $PWD = "") + Local $i_Exists + $ar_GetTables = _GetTableNames($connectionobj, $s_dbname, $i_adoMDB, $USRName, $PWD) + For $table In $ar_GetTables + If $table = $s_Table Then $i_Exists = 1 + Next + Return $i_Exists +EndFunc ;==>_TableExists + +Func _FieldExists(ByRef $connectionobj, $s_Tablename, $s_Fieldname, $i_adoMDB = 1, $USRName = "", $PWD = "") + Local $i_Exists + $ar_GetFields = _GetFieldNames($connectionobj, $s_Tablename, $i_adoMDB, $USRName, $PWD) + For $field In $ar_GetFields + If $field = $s_Fieldname Then $i_Exists = 1 + Next + Return $i_Exists +EndFunc ;==>_FieldExists + +Func _GetTableNames(ByRef $connectionobj, $s_dbname, $i_adoMDB = 1, $USRName = "", $PWD = "") + Dim $ret[1] + If IsObj($connectionobj) Then + $adoxConn = ObjCreate("ADOX.Catalog") + $adoxConn.activeConnection = $connectionobj + For $table In $adoxConn.tables + If $table.type = "TABLE" Then + ReDim $ret[UBound($ret, 1) + 1] + $ret[UBound($ret, 1) - 1] = $table.name + EndIf + Next + EndIf + Return $ret +EndFunc ;==>_GetTableNames + +Func _CreateTable($s_dbname, $s_Tablename, ByRef $addConn, $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsObj($addConn) Then + _AccessConnectConn($s_dbname, $addConn, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + $addConn.Execute("CREATE TABLE " & $s_Tablename) + If $i_NeedToCloseInFunc Then $addConn.Close +EndFunc ;==>_CreateTable + +Func _DropTable($s_dbname, $s_Tablename, ByRef $addConn, $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsObj($addConn) Then + _AccessConnectConn($s_dbname, $addConn, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + $addConn.Execute("DROP TABLE " & $s_Tablename) + If $i_NeedToCloseInFunc Then $addConn.Close +EndFunc ;==>_DropTable + +Func _CreatMultipleFields($s_dbname, $s_Tablename, ByRef $o_adoCon, $s_Fields, $i_adoMDB = 1, $USRName = "", $PWD = "") + $s_fields_array = StringSplit($s_Fields, '|') + For $fs = 1 To $s_fields_array[0] + $field_item_array = StringSplit($s_fields_array[$fs], ' ') + If $field_item_array[0] = 2 Then + $fieldname = $field_item_array[1] + $format = $field_item_array[2] + Else + $fieldname = $s_fields_array[$fs] + $format = "TEXT(255)" + EndIf + _CreateField($s_dbname, $s_Tablename, $fieldname, $format, $o_adoCon, $i_adoMDB, $USRName, $PWD) + Next +EndFunc ;==>_CreatMultipleFields + +Func _CreateField($s_dbname, $s_Tablename, $s_Fieldname, $format, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsObj($o_adoCon) Then + _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + $o_adoCon.Execute("ALTER TABLE " & $s_Tablename & " ADD " & $s_Fieldname & " " & $format) + If $i_NeedToCloseInFunc Then $o_adoCon.Close +EndFunc ;==>_CreateField + +Func _DropField($s_dbname, $s_Tablename, $s_Fieldname, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsObj($o_adoCon) Then + _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + $o_adoCon.Execute("ALTER TABLE " & $s_Tablename & " DROP " & $s_Fieldname) + If $i_NeedToCloseInFunc Then $o_adoCon.Close +EndFunc ;==>_CreateField + +Func _AccessAddData($s_dbname, $s_Tablename, $s_Fieldname, $s_i_value, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsObj($o_adoCon) Then + _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + $o_adoRs = ObjCreate("ADODB.Recordset") + $o_adoRs.CursorType = 1 + $o_adoRs.LockType = 3 + $o_adoRs.Open("SELECT * FROM " & $s_Tablename, $o_adoCon) + $o_adoRs.AddNew + $o_adoRs.Fields($s_Fieldname).Value = $s_i_value + $o_adoRs.Update + $o_adoRs.Close + If $i_NeedToCloseInFunc Then $o_adoCon.Close +EndFunc ;==>_AccessAddData + +Func _ReadOneField($q_sql, $s_dbname, $s_field, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "") + Local $_output + If Not IsObj($o_adoCon) Then + _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + $o_adoRs = ObjCreate("ADODB.Recordset") + $o_adoRs.CursorType = 1 + $o_adoRs.LockType = 3 + $o_adoRs.Open($q_sql, $o_adoCon) + With $o_adoRs + If .RecordCount Then + While Not .EOF + $_output = $_output & .Fields($s_field).Value & @CRLF + .MoveNext + WEnd + EndIf + EndWith + $o_adoRs.Close + If $i_NeedToCloseInFunc Then $o_adoCon.Close + Return $_output +EndFunc ;==>_ReadOneField + +Func _AddEntireRecord($s_dbname, $s_Tablename1, $ar_array, ByRef $o_adoCon, $ar_FieldFormatsF = "", $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsObj($o_adoCon) Then + _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + $o_adoRs = ObjCreate("ADODB.Recordset") + $o_adoRs.CursorType = 1 + $o_adoRs.LockType = 3 + $o_adoRs.Open("SELECT * FROM " & $s_Tablename1, $o_adoCon) + $records = $ar_array[0][0] + $records = UBound($ar_array) - 1 + For $i = 1 To $records + $o_adoRs.AddNew + For $x = 1 To UBound($ar_array, 2) - 1 + $o_adoRs.Fields($x - 1).Value = $ar_array[$i][$x] + Next + $o_adoRs.Update + Next + $o_adoRs.Close + If $i_NeedToCloseInFunc Then $o_adoCon.Close +EndFunc ;==>_AddEntireRecord + +Func _AddRecord($s_dbname, $s_Tablename1, ByRef $o_adoCon, $ar_array, $ar_FieldFormatsF = "", $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsArray($ar_array) And StringInStr($ar_array, "|") > 0 Then + $ar_arraylocal = StringSplit($ar_array, "|") + $ar_array = $ar_arraylocal + ElseIf Not IsArray($ar_array) Then + Local $ar_arraylocal[2] + $ar_arraylocal[1] = $ar_array + $ar_array = $ar_arraylocal + EndIf + If Not IsObj($o_adoCon) Then + _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + $o_adoRs = ObjCreate("ADODB.Recordset") + $o_adoRs.CursorType = 1 + $o_adoRs.LockType = 3 + $o_adoRs.Open("SELECT * FROM " & $s_Tablename1, $o_adoCon) + $o_adoRs.AddNew + For $x = 1 To UBound($ar_array) - 1 + $o_adoRs.Fields($x - 1).Value = $ar_array[$x] + Next + $o_adoRs.Update + $o_adoRs.Close + If $i_NeedToCloseInFunc Then $o_adoCon.Close +EndFunc ;==>_AddRecord + +Func _DeleteRecord($s_dbname, $s_Tablename1, $i_DeleteCount, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsObj($o_adoCon) Then + _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + $o_adoRs = ObjCreate("ADODB.Recordset") + $o_adoRs.CursorType = 1 + $o_adoRs.LockType = 3 + Local $a = 1 + $o_adoRs.Open("SELECT * FROM " & $s_Tablename1, $o_adoCon) + With $o_adoRs + If .RecordCount Then + .MoveFirst + While Not .EOF + If $a = $i_DeleteCount Then + .delete + ExitLoop + EndIf + .MoveNext + $a += 1 + WEnd + EndIf + EndWith + $o_adoRs.Update + $o_adoRs.Close + If $i_NeedToCloseInFunc Then $o_adoCon.Close +EndFunc ;==>_DeleteRecord + +Func _CountTables(ByRef $connectionobj, $s_dbname, $i_adoMDB = 1, $USRName = "", $PWD = "") + $ar_GetTables = _GetTableNames($connectionobj, $s_dbname, $i_adoMDB, $USRName, $PWD) + Return UBound($ar_GetTables) - 1 +EndFunc ;==>_CountTables + +Func _ArrayViewQueryTable($ar_Rows, $s_Table) + _2dArrayDisp($ar_Rows, $s_Table) +EndFunc ;==>_ArrayViewQueryTable + +Func _AccessConnectConn($s_dbname, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "") + $o_adoCon = ObjCreate("ADODB.Connection") + If Not $i_adoMDB Then $o_adoCon.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $s_dbname & ";User Id=" & $USRName & ";Password=" & $PWD & ";") + If $i_adoMDB Then $o_adoCon.Open("Driver={Microsoft Access Driver (*.mdb)};Dbq=" & $s_dbname & ';UID=' & $USRName & ';PWD=' & $PWD) + Return $o_adoCon +EndFunc ;==>_AccessConnectConn +Func _AccessCloseConn($o_adoCon) + $o_adoCon.Close +EndFunc ;==>_AccessCloseConn + +Func _RecordSearch($s_dbname, $_query, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsObj($o_adoCon) Then + _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + $o_adoRs = ObjCreate("ADODB.Recordset") + $o_adoRs.CursorType = 1 + $o_adoRs.LockType = 3 + $o_adoRs.Open($_query, $o_adoCon) + $r_count = $o_adoRs.RecordCount + $f_count = $o_adoRs.Fields.Count + + Dim $_output[$r_count + 1][$f_count + 1] + $_output[0][0] = $r_count + For $i = 1 To $f_count + $_output[0][$i] = $o_adoRs.Fields($i - 1).Name + Next + + If $r_count Then + $z = 0 + While Not $o_adoRs.EOF + $z = $z + 1 + For $x = 1 To $f_count + $_output[$z][$x] = $o_adoRs.Fields($x - 1).Value + Next + $o_adoRs.MoveNext + WEnd + EndIf + $o_adoRs.Close + If $i_NeedToCloseInFunc Then $o_adoCon.Close + Return $_output +EndFunc ;==>_RecordSearch + +Func _2dArrayDisp($ar_array, $s_Label = "Display") + $report = "Number of records matching = " & UBound($ar_array) - 1 & @CRLF + For $x = 1 To UBound($ar_array) - 1 + For $i = 1 To UBound($ar_array, 2) - 1 + $report = $report & $ar_array[$x][$i] & "|" + Next + $report = StringTrimRight($report, 1) & @CRLF + Next + MsgBox(0, $s_Label, $report) +EndFunc ;==>_2dArrayDisp + +Func _AccessUpdateData(ByRef $o_adoCon, $s_dbname, $s_query, $u_field, $u_newvalue, $i_adoMDB = 1, $USRName = "", $PWD = "") + If Not IsObj($o_adoCon) Then + _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD) + $i_NeedToCloseInFunc = 1 + Else + $i_NeedToCloseInFunc = 0 + EndIf + $o_adoRs = ObjCreate("ADODB.Recordset") + $o_adoRs.CursorType = 1 + $o_adoRs.LockType = 3 + $o_adoRs.Open($s_query) + $o_adoRs($u_field) = $u_newvalue + $o_adoRs.Update + If $i_NeedToCloseInFunc Then $o_adoCon.Close +EndFunc ;==>_AccessUpdateData \ No newline at end of file diff --git a/Installer/vi_files/UDFs/AutoItObject.au3 b/Installer/vi_files/UDFs/AutoItObject.au3 new file mode 100644 index 00000000..ec6eac53 --- /dev/null +++ b/Installer/vi_files/UDFs/AutoItObject.au3 @@ -0,0 +1,2053 @@ +; #INDEX# ======================================================================================================================= +; Title .........: AutoItObject v1.2.8.2 +; AutoIt Version : 3.3 +; Language ......: English (language independent) +; Description ...: Brings Objects to AutoIt. +; Author(s) .....: monoceres, trancexx, Kip, Prog@ndy +; Copyright .....: Copyright (C) The AutoItObject-Team. All rights reserved. +; License .......: Artistic License 2.0, see Artistic.txt +; +; This file is part of AutoItObject. +; +; AutoItObject is free software; you can redistribute it and/or modify +; it under the terms of the Artistic License as published by Larry Wall, +; either version 2.0, or (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +; See the Artistic License for more details. +; +; You should have received a copy of the Artistic License with this Kit, +; in the file named "Artistic.txt". If not, you can get a copy from +; OR +; +; +; ------------------------ AutoItObject CREDITS: ------------------------ +; Copyright (C) by: +; The AutoItObject-Team: +; Andreas Karlsson (monoceres) +; Dragana R. (trancexx) +; Dave Bakker (Kip) +; Andreas Bosch (progandy, Prog@ndy) +; +; =============================================================================================================================== +#include-once +#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 + + +; #CURRENT# ===================================================================================================================== +;_AutoItObject_AddDestructor +;_AutoItObject_AddEnum +;_AutoItObject_AddMethod +;_AutoItObject_AddProperty +;_AutoItObject_Class +;_AutoItObject_CLSIDFromString +;_AutoItObject_CoCreateInstance +;_AutoItObject_Create +;_AutoItObject_DllOpen +;_AutoItObject_DllStructCreate +;_AutoItObject_IDispatchToPtr +;_AutoItObject_IUnknownAddRef +;_AutoItObject_IUnknownRelease +;_AutoItObject_ObjCreate +;_AutoItObject_ObjCreateEx +;_AutoItObject_ObjectFromDtag +;_AutoItObject_PtrToIDispatch +;_AutoItObject_RegisterObject +;_AutoItObject_RemoveMember +;_AutoItObject_Shutdown +;_AutoItObject_Startup +;_AutoItObject_UnregisterObject +;_AutoItObject_VariantClear +;_AutoItObject_VariantCopy +;_AutoItObject_VariantFree +;_AutoItObject_VariantInit +;_AutoItObject_VariantRead +;_AutoItObject_VariantSet +;_AutoItObject_WrapperAddMethod +;_AutoItObject_WrapperCreate +; =============================================================================================================================== + +; #INTERNAL_NO_DOC# ============================================================================================================= +;__Au3Obj_OleUninitialize +;__Au3Obj_IUnknown_AddRef +;__Au3Obj_IUnknown_Release +;__Au3Obj_GetMethods +;__Au3Obj_SafeArrayCreate +;__Au3Obj_SafeArrayDestroy +;__Au3Obj_SafeArrayAccessData +;__Au3Obj_SafeArrayUnaccessData +;__Au3Obj_SafeArrayGetUBound +;__Au3Obj_SafeArrayGetLBound +;__Au3Obj_SafeArrayGetDim +;__Au3Obj_CreateSafeArrayVariant +;__Au3Obj_ReadSafeArrayVariant +;__Au3Obj_CoTaskMemAlloc +;__Au3Obj_CoTaskMemFree +;__Au3Obj_CoTaskMemRealloc +;__Au3Obj_GlobalAlloc +;__Au3Obj_GlobalFree +;__Au3Obj_SysAllocString +;__Au3Obj_SysCopyString +;__Au3Obj_SysReAllocString +;__Au3Obj_SysFreeString +;__Au3Obj_SysStringLen +;__Au3Obj_SysReadString +;__Au3Obj_PtrStringLen +;__Au3Obj_PtrStringRead +;__Au3Obj_FunctionProxy +;__Au3Obj_EnumFunctionProxy +;__Au3Obj_ObjStructGetElements +;__Au3Obj_ObjStructMethod +;__Au3Obj_ObjStructDestructor +;__Au3Obj_ObjStructPointer +;__Au3Obj_PointerCall +;__Au3Obj_Mem_DllOpen +;__Au3Obj_Mem_FixReloc +;__Au3Obj_Mem_FixImports +;__Au3Obj_Mem_LoadLibraryEx +;__Au3Obj_Mem_FreeLibrary +;__Au3Obj_Mem_GetAddress +;__Au3Obj_Mem_VirtualProtect +;__Au3Obj_Mem_Base64Decode +;__Au3Obj_Mem_BinDll +;__Au3Obj_Mem_BinDll_X64 +; =============================================================================================================================== + +; #DATATYPES# ===================================================================================================================== +; none - no value (only valid for return type, equivalent to void in C) +; byte - an unsigned 8 bit integer +; boolean - an unsigned 8 bit integer +; short - a 16 bit integer +; word, ushort - an unsigned 16 bit integer +; int, long - a 32 bit integer +; bool - a 32 bit integer +; dword, ulong, uint - an unsigned 32 bit integer +; hresult - an unsigned 32 bit integer +; int64 - a 64 bit integer +; uint64 - an unsigned 64 bit integer +; ptr - a general pointer (void *) +; hwnd - a window handle (pointer wide) +; handle - an handle (pointer wide) +; float - a single precision floating point number +; double - a double precision floating point number +; int_ptr, long_ptr, lresult, lparam - an integer big enough to hold a pointer when running on x86 or x64 versions of AutoIt +; uint_ptr, ulong_ptr, dword_ptr, wparam - an unsigned integer big enough to hold a pointer when running on x86 or x64 versions of AutoIt +; str - an ANSI string (a minimum of 65536 chars is allocated) +; wstr - a UNICODE wide character string (a minimum of 65536 chars is allocated) +; bstr - a composite data type that consists of a length prefix, a data string and a terminator +; variant - a tagged union that can be used to represent any other data type +; idispatch, object - a composite data type that represents object with IDispatch interface +; =============================================================================================================================== + +;-------------------------------------------------------------------------------------------------------------------------------------- +#Region Variable definitions + +Global Const $gh_AU3Obj_kernel32dll = DllOpen("kernel32.dll") +Global Const $gh_AU3Obj_oleautdll = DllOpen("oleaut32.dll") +Global Const $gh_AU3Obj_ole32dll = DllOpen("ole32.dll") + +Global Const $__Au3Obj_X64 = @AutoItX64 + +Global Const $__Au3Obj_VT_EMPTY = 0 +Global Const $__Au3Obj_VT_NULL = 1 +Global Const $__Au3Obj_VT_I2 = 2 +Global Const $__Au3Obj_VT_I4 = 3 +Global Const $__Au3Obj_VT_R4 = 4 +Global Const $__Au3Obj_VT_R8 = 5 +Global Const $__Au3Obj_VT_CY = 6 +Global Const $__Au3Obj_VT_DATE = 7 +Global Const $__Au3Obj_VT_BSTR = 8 +Global Const $__Au3Obj_VT_DISPATCH = 9 +Global Const $__Au3Obj_VT_ERROR = 10 +Global Const $__Au3Obj_VT_BOOL = 11 +Global Const $__Au3Obj_VT_VARIANT = 12 +Global Const $__Au3Obj_VT_UNKNOWN = 13 +Global Const $__Au3Obj_VT_DECIMAL = 14 +Global Const $__Au3Obj_VT_I1 = 16 +Global Const $__Au3Obj_VT_UI1 = 17 +Global Const $__Au3Obj_VT_UI2 = 18 +Global Const $__Au3Obj_VT_UI4 = 19 +Global Const $__Au3Obj_VT_I8 = 20 +Global Const $__Au3Obj_VT_UI8 = 21 +Global Const $__Au3Obj_VT_INT = 22 +Global Const $__Au3Obj_VT_UINT = 23 +Global Const $__Au3Obj_VT_VOID = 24 +Global Const $__Au3Obj_VT_HRESULT = 25 +Global Const $__Au3Obj_VT_PTR = 26 +Global Const $__Au3Obj_VT_SAFEARRAY = 27 +Global Const $__Au3Obj_VT_CARRAY = 28 +Global Const $__Au3Obj_VT_USERDEFINED = 29 +Global Const $__Au3Obj_VT_LPSTR = 30 +Global Const $__Au3Obj_VT_LPWSTR = 31 +Global Const $__Au3Obj_VT_RECORD = 36 +Global Const $__Au3Obj_VT_INT_PTR = 37 +Global Const $__Au3Obj_VT_UINT_PTR = 38 +Global Const $__Au3Obj_VT_FILETIME = 64 +Global Const $__Au3Obj_VT_BLOB = 65 +Global Const $__Au3Obj_VT_STREAM = 66 +Global Const $__Au3Obj_VT_STORAGE = 67 +Global Const $__Au3Obj_VT_STREAMED_OBJECT = 68 +Global Const $__Au3Obj_VT_STORED_OBJECT = 69 +Global Const $__Au3Obj_VT_BLOB_OBJECT = 70 +Global Const $__Au3Obj_VT_CF = 71 +Global Const $__Au3Obj_VT_CLSID = 72 +Global Const $__Au3Obj_VT_VERSIONED_STREAM = 73 +Global Const $__Au3Obj_VT_BSTR_BLOB = 0xfff +Global Const $__Au3Obj_VT_VECTOR = 0x1000 +Global Const $__Au3Obj_VT_ARRAY = 0x2000 +Global Const $__Au3Obj_VT_BYREF = 0x4000 +Global Const $__Au3Obj_VT_RESERVED = 0x8000 +Global Const $__Au3Obj_VT_ILLEGAL = 0xffff +Global Const $__Au3Obj_VT_ILLEGALMASKED = 0xfff +Global Const $__Au3Obj_VT_TYPEMASK = 0xfff + +Global Const $__Au3Obj_tagVARIANT = "word vt;word r1;word r2;word r3;ptr data; ptr" + +Global Const $__Au3Obj_VARIANT_SIZE = DllStructGetSize(DllStructCreate($__Au3Obj_tagVARIANT, 1)) +Global Const $__Au3Obj_PTR_SIZE = DllStructGetSize(DllStructCreate('ptr', 1)) +Global Const $__Au3Obj_tagSAFEARRAYBOUND = "ulong cElements; long lLbound;" + +Global $ghAutoItObjectDLL = -1, $giAutoItObjectDLLRef = 0 + +;=============================================================================== +#interface "IUnknown" +Global Const $sIID_IUnknown = "{00000000-0000-0000-C000-000000000046}" +; Definition +Global $dtagIUnknown = "QueryInterface hresult(ptr;ptr*);" & _ + "AddRef dword();" & _ + "Release dword();" +; List +Global $ltagIUnknown = "QueryInterface;" & _ + "AddRef;" & _ + "Release;" +;=============================================================================== +;=============================================================================== +#interface "IDispatch" +Global Const $sIID_IDispatch = "{00020400-0000-0000-C000-000000000046}" +; Definition +Global $dtagIDispatch = $dtagIUnknown & _ + "GetTypeInfoCount hresult(dword*);" & _ + "GetTypeInfo hresult(dword;dword;ptr*);" & _ + "GetIDsOfNames hresult(ptr;ptr;dword;dword;ptr);" & _ + "Invoke hresult(dword;ptr;dword;word;ptr;ptr;ptr;ptr);" +; List +Global $ltagIDispatch = $ltagIUnknown & _ + "GetTypeInfoCount;" & _ + "GetTypeInfo;" & _ + "GetIDsOfNames;" & _ + "Invoke;" +;=============================================================================== + +#EndRegion Variable definitions +;-------------------------------------------------------------------------------------------------------------------------------------- + + +;-------------------------------------------------------------------------------------------------------------------------------------- +#Region Misc + +DllCall($gh_AU3Obj_ole32dll, 'long', 'OleInitialize', 'ptr', 0) +OnAutoItExitRegister("__Au3Obj_OleUninitialize") +Func __Au3Obj_OleUninitialize() + ; Author: Prog@ndy + DllCall($gh_AU3Obj_ole32dll, 'long', 'OleUninitialize') + _AutoItObject_Shutdown(True) +EndFunc ;==>__Au3Obj_OleUninitialize + +Func __Au3Obj_IUnknown_AddRef($vObj) + Local $sType = "ptr" + If IsObj($vObj) Then $sType = "idispatch" + Local $tVARIANT = DllStructCreate($__Au3Obj_tagVARIANT) + ; Actual call + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "long", "DispCallFunc", _ + $sType, $vObj, _ + "dword", $__Au3Obj_PTR_SIZE, _ ; offset (4 for x86, 8 for x64) + "dword", 4, _ ; CC_STDCALL + "dword", $__Au3Obj_VT_UINT, _ + "dword", 0, _ ; number of function parameters + "ptr", 0, _ ; parameters related + "ptr", 0, _ ; parameters related + "ptr", DllStructGetPtr($tVARIANT)) + If @error Or $aCall[0] Then Return SetError(1, 0, 0) + ; Collect returned + Return DllStructGetData(DllStructCreate("dword", DllStructGetPtr($tVARIANT, "data")), 1) +EndFunc ;==>__Au3Obj_IUnknown_AddRef + +Func __Au3Obj_IUnknown_Release($vObj) + Local $sType = "ptr" + If IsObj($vObj) Then $sType = "idispatch" + Local $tVARIANT = DllStructCreate($__Au3Obj_tagVARIANT) + ; Actual call + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "long", "DispCallFunc", _ + $sType, $vObj, _ + "dword", 2 * $__Au3Obj_PTR_SIZE, _ ; offset (8 for x86, 16 for x64) + "dword", 4, _ ; CC_STDCALL + "dword", $__Au3Obj_VT_UINT, _ + "dword", 0, _ ; number of function parameters + "ptr", 0, _ ; parameters related + "ptr", 0, _ ; parameters related + "ptr", DllStructGetPtr($tVARIANT)) + If @error Or $aCall[0] Then Return SetError(1, 0, 0) + ; Collect returned + Return DllStructGetData(DllStructCreate("dword", DllStructGetPtr($tVARIANT, "data")), 1) +EndFunc ;==>__Au3Obj_IUnknown_Release + +Func __Au3Obj_GetMethods($tagInterface) + Local $sMethods = StringReplace(StringRegExpReplace($tagInterface, "\h*(\w+)\h*(\w+\*?)\h*(\((.*?)\))\h*(;|;*\z)", "$1\|$2;$4" & @LF), ";" & @LF, @LF) + If $sMethods = $tagInterface Then $sMethods = StringReplace(StringRegExpReplace($tagInterface, "\h*(\w+)\h*(;|;*\z)", "$1\|" & @LF), ";" & @LF, @LF) + Return StringTrimRight($sMethods, 1) +EndFunc ;==>__Au3Obj_GetMethods + +Func __Au3Obj_ObjStructGetElements($sTag, ByRef $sAlign) + Local $sAlignment = StringRegExpReplace($sTag, "\h*(align\h+\d+)\h*;.*", "$1") + If $sAlignment <> $sTag Then + $sAlign = $sAlignment + $sTag = StringRegExpReplace($sTag, "\h*(align\h+\d+)\h*;", "") + EndIf + ; Return StringRegExp($sTag, "\h*\w+\h*(\w+)\h*", 3) ; DO NOT REMOVE THIS LINE + Return StringTrimRight(StringRegExpReplace($sTag, "\h*\w+\h*(\w+)\h*(\[\d+\])*\h*(;|;*\z)\h*", "$1;"), 1) +EndFunc ;==>__Au3Obj_ObjStructGetElements + +#EndRegion Misc +;-------------------------------------------------------------------------------------------------------------------------------------- + + +;-------------------------------------------------------------------------------------------------------------------------------------- +#Region SafeArray +Func __Au3Obj_SafeArrayCreate($vType, $cDims, $rgsabound) + ; Author: Prog@ndy + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "ptr", "SafeArrayCreate", "dword", $vType, "uint", $cDims, 'ptr', $rgsabound) + If @error Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>__Au3Obj_SafeArrayCreate + +Func __Au3Obj_SafeArrayDestroy($pSafeArray) + ; Author: Prog@ndy + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "int", "SafeArrayDestroy", "ptr", $pSafeArray) + If @error Then Return SetError(1, 0, 1) + Return $aCall[0] +EndFunc ;==>__Au3Obj_SafeArrayDestroy + +Func __Au3Obj_SafeArrayAccessData($pSafeArray, ByRef $pArrayData) + ; Author: Prog@ndy + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "int", "SafeArrayAccessData", "ptr", $pSafeArray, 'ptr*', 0) + If @error Then Return SetError(1, 0, 1) + $pArrayData = $aCall[2] + Return $aCall[0] +EndFunc ;==>__Au3Obj_SafeArrayAccessData + +Func __Au3Obj_SafeArrayUnaccessData($pSafeArray) + ; Author: Prog@ndy + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "int", "SafeArrayUnaccessData", "ptr", $pSafeArray) + If @error Then Return SetError(1, 0, 1) + Return $aCall[0] +EndFunc ;==>__Au3Obj_SafeArrayUnaccessData + +Func __Au3Obj_SafeArrayGetUBound($pSafeArray, $iDim, ByRef $iBound) + ; Author: Prog@ndy + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "int", "SafeArrayGetUBound", "ptr", $pSafeArray, 'uint', $iDim, 'long*', 0) + If @error Then Return SetError(1, 0, 1) + $iBound = $aCall[3] + Return $aCall[0] +EndFunc ;==>__Au3Obj_SafeArrayGetUBound + +Func __Au3Obj_SafeArrayGetLBound($pSafeArray, $iDim, ByRef $iBound) + ; Author: Prog@ndy + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "int", "SafeArrayGetLBound", "ptr", $pSafeArray, 'uint', $iDim, 'long*', 0) + If @error Then Return SetError(1, 0, 1) + $iBound = $aCall[3] + Return $aCall[0] +EndFunc ;==>__Au3Obj_SafeArrayGetLBound + +Func __Au3Obj_SafeArrayGetDim($pSafeArray) + Local $aResult = DllCall($gh_AU3Obj_oleautdll, "uint", "SafeArrayGetDim", "ptr", $pSafeArray) + If @error Then Return SetError(1, 0, 0) + Return $aResult[0] +EndFunc ;==>__Au3Obj_SafeArrayGetDim + +Func __Au3Obj_CreateSafeArrayVariant(ByRef Const $aArray) + ; Author: Prog@ndy + Local $iDim = UBound($aArray, 0), $pData, $pSafeArray, $bound, $subBound, $tBound + Switch $iDim + Case 1 + $bound = UBound($aArray) - 1 + $tBound = DllStructCreate($__Au3Obj_tagSAFEARRAYBOUND) + DllStructSetData($tBound, 1, $bound + 1) + $pSafeArray = __Au3Obj_SafeArrayCreate($__Au3Obj_VT_VARIANT, 1, DllStructGetPtr($tBound)) + If 0 = __Au3Obj_SafeArrayAccessData($pSafeArray, $pData) Then + For $i = 0 To $bound + _AutoItObject_VariantInit($pData + $i * $__Au3Obj_VARIANT_SIZE) + _AutoItObject_VariantSet($pData + $i * $__Au3Obj_VARIANT_SIZE, $aArray[$i]) + Next + __Au3Obj_SafeArrayUnaccessData($pSafeArray) + EndIf + Return $pSafeArray + Case 2 + $bound = UBound($aArray, 1) - 1 + $subBound = UBound($aArray, 2) - 1 + $tBound = DllStructCreate($__Au3Obj_tagSAFEARRAYBOUND & $__Au3Obj_tagSAFEARRAYBOUND) + DllStructSetData($tBound, 3, $bound + 1) + DllStructSetData($tBound, 1, $subBound + 1) + $pSafeArray = __Au3Obj_SafeArrayCreate($__Au3Obj_VT_VARIANT, 2, DllStructGetPtr($tBound)) + If 0 = __Au3Obj_SafeArrayAccessData($pSafeArray, $pData) Then + For $i = 0 To $bound + For $j = 0 To $subBound + _AutoItObject_VariantInit($pData + ($j + $i * ($subBound + 1)) * $__Au3Obj_VARIANT_SIZE) + _AutoItObject_VariantSet($pData + ($j + $i * ($subBound + 1)) * $__Au3Obj_VARIANT_SIZE, $aArray[$i][$j]) + Next + Next + __Au3Obj_SafeArrayUnaccessData($pSafeArray) + EndIf + Return $pSafeArray + Case Else + Return 0 + EndSwitch +EndFunc ;==>__Au3Obj_CreateSafeArrayVariant + +Func __Au3Obj_ReadSafeArrayVariant($pSafeArray) + ; Author: Prog@ndy + Local $iDim = __Au3Obj_SafeArrayGetDim($pSafeArray), $pData, $lbound, $bound, $subBound + Switch $iDim + Case 1 + __Au3Obj_SafeArrayGetLBound($pSafeArray, 1, $lbound) + __Au3Obj_SafeArrayGetUBound($pSafeArray, 1, $bound) + $bound -= $lbound + Local $array[$bound + 1] + If 0 = __Au3Obj_SafeArrayAccessData($pSafeArray, $pData) Then + For $i = 0 To $bound + $array[$i] = _AutoItObject_VariantRead($pData + $i * $__Au3Obj_VARIANT_SIZE) + Next + __Au3Obj_SafeArrayUnaccessData($pSafeArray) + EndIf + Return $array + Case 2 + __Au3Obj_SafeArrayGetLBound($pSafeArray, 2, $lbound) + __Au3Obj_SafeArrayGetUBound($pSafeArray, 2, $bound) + $bound -= $lbound + __Au3Obj_SafeArrayGetLBound($pSafeArray, 1, $lbound) + __Au3Obj_SafeArrayGetUBound($pSafeArray, 1, $subBound) + $subBound -= $lbound + Local $array[$bound + 1][$subBound + 1] + If 0 = __Au3Obj_SafeArrayAccessData($pSafeArray, $pData) Then + For $i = 0 To $bound + For $j = 0 To $subBound + $array[$i][$j] = _AutoItObject_VariantRead($pData + ($j + $i * ($subBound + 1)) * $__Au3Obj_VARIANT_SIZE) + Next + Next + __Au3Obj_SafeArrayUnaccessData($pSafeArray) + EndIf + Return $array + Case Else + Return 0 + EndSwitch +EndFunc ;==>__Au3Obj_ReadSafeArrayVariant + +#EndRegion SafeArray +;-------------------------------------------------------------------------------------------------------------------------------------- + + +;-------------------------------------------------------------------------------------------------------------------------------------- +#Region Memory + +Func __Au3Obj_CoTaskMemAlloc($iSize) + ; Author: Prog@ndy + Local $aCall = DllCall($gh_AU3Obj_ole32dll, "ptr", "CoTaskMemAlloc", "uint_ptr", $iSize) + If @error Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>__Au3Obj_CoTaskMemAlloc + +Func __Au3Obj_CoTaskMemFree($pCoMem) + ; Author: Prog@ndy + DllCall($gh_AU3Obj_ole32dll, "none", "CoTaskMemFree", "ptr", $pCoMem) + If @error Then Return SetError(1, 0, 0) +EndFunc ;==>__Au3Obj_CoTaskMemFree + +Func __Au3Obj_CoTaskMemRealloc($pCoMem, $iSize) + ; Author: Prog@ndy + Local $aCall = DllCall($gh_AU3Obj_ole32dll, "ptr", "CoTaskMemRealloc", 'ptr', $pCoMem, "uint_ptr", $iSize) + If @error Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>__Au3Obj_CoTaskMemRealloc + +Func __Au3Obj_GlobalAlloc($iSize, $iFlag) + Local $aCall = DllCall($gh_AU3Obj_kernel32dll, "ptr", "GlobalAlloc", "dword", $iFlag, "dword_ptr", $iSize) + If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>__Au3Obj_GlobalAlloc + +Func __Au3Obj_GlobalFree($pPointer) + Local $aCall = DllCall($gh_AU3Obj_kernel32dll, "ptr", "GlobalFree", "ptr", $pPointer) + If @error Or $aCall[0] Then Return SetError(1, 0, 0) + Return 1 +EndFunc ;==>__Au3Obj_GlobalFree + +#EndRegion Memory +;-------------------------------------------------------------------------------------------------------------------------------------- + + +;-------------------------------------------------------------------------------------------------------------------------------------- +#Region SysString + +Func __Au3Obj_SysAllocString($str) + ; Author: monoceres + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "ptr", "SysAllocString", "wstr", $str) + If @error Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>__Au3Obj_SysAllocString +Func __Au3Obj_SysCopyString($pBSTR) + ; Author: Prog@ndy + If Not $pBSTR Then Return SetError(2, 0, 0) + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "ptr", "SysAllocStringLen", "ptr", $pBSTR, "uint", __Au3Obj_SysStringLen($pBSTR)) + If @error Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>__Au3Obj_SysCopyString + +Func __Au3Obj_SysReAllocString(ByRef $pBSTR, $str) + ; Author: Prog@ndy + If Not $pBSTR Then Return SetError(2, 0, 0) + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "int", "SysReAllocString", 'ptr*', $pBSTR, "wstr", $str) + If @error Then Return SetError(1, 0, 0) + $pBSTR = $aCall[1] + Return $aCall[0] +EndFunc ;==>__Au3Obj_SysReAllocString + +Func __Au3Obj_SysFreeString($pBSTR) + ; Author: Prog@ndy + If Not $pBSTR Then Return SetError(2, 0, 0) + DllCall($gh_AU3Obj_oleautdll, "none", "SysFreeString", "ptr", $pBSTR) + If @error Then Return SetError(1, 0, 0) +EndFunc ;==>__Au3Obj_SysFreeString + +Func __Au3Obj_SysStringLen($pBSTR) + ; Author: Prog@ndy + If Not $pBSTR Then Return SetError(2, 0, 0) + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "uint", "SysStringLen", "ptr", $pBSTR) + If @error Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>__Au3Obj_SysStringLen + +Func __Au3Obj_SysReadString($pBSTR, $iLen = -1) + ; Author: Prog@ndy + If Not $pBSTR Then Return SetError(2, 0, '') + If $iLen < 1 Then $iLen = __Au3Obj_SysStringLen($pBSTR) + If $iLen < 1 Then Return SetError(1, 0, '') + Return DllStructGetData(DllStructCreate("wchar[" & $iLen & "]", $pBSTR), 1) +EndFunc ;==>__Au3Obj_SysReadString + +Func __Au3Obj_PtrStringLen($pStr) + ; Author: Prog@ndy + Local $aResult = DllCall($gh_AU3Obj_kernel32dll, 'int', 'lstrlenW', 'ptr', $pStr) + If @error Then Return SetError(1, 0, 0) + Return $aResult[0] +EndFunc ;==>__Au3Obj_PtrStringLen + +Func __Au3Obj_PtrStringRead($pStr, $iLen = -1) + ; Author: Prog@ndy + If $iLen < 1 Then $iLen = __Au3Obj_PtrStringLen($pStr) + If $iLen < 1 Then Return SetError(1, 0, '') + Return DllStructGetData(DllStructCreate("wchar[" & $iLen & "]", $pStr), 1) +EndFunc ;==>__Au3Obj_PtrStringRead + +#EndRegion SysString +;-------------------------------------------------------------------------------------------------------------------------------------- + + +;-------------------------------------------------------------------------------------------------------------------------------------- +#Region Proxy Functions + +Func __Au3Obj_FunctionProxy($FuncName, $oSelf) ; allows binary code to call autoit functions + Local $arg = $oSelf.__params__ ; fetch params + If IsArray($arg) Then + Local $ret = Call($FuncName, $arg) ; Call + If @error = 0xDEAD And @extended = 0xBEEF Then Return 0 + $oSelf.__error__ = @error ; set error + $oSelf.__result__ = $ret ; set result + Return 1 + EndIf + ; return error when params-array could not be created +EndFunc ;==>__Au3Obj_FunctionProxy + +Func __Au3Obj_EnumFunctionProxy($iAction, $FuncName, $oSelf, $pVarCurrent, $pVarResult) + Local $Current, $ret + Switch $iAction + Case 0 ; Next + $Current = $oSelf.__bridge__(Number($pVarCurrent)) + $ret = Execute($FuncName & "($oSelf, $Current)") + If @error Then Return False + $oSelf.__bridge__(Number($pVarCurrent)) = $Current + $oSelf.__bridge__(Number($pVarResult)) = $ret + Return 1 + Case 1 ;Skip + Return False + Case 2 ; Reset + $Current = $oSelf.__bridge__(Number($pVarCurrent)) + $ret = Execute($FuncName & "($oSelf, $Current)") + If @error Or Not $ret Then Return False + $oSelf.__bridge__(Number($pVarCurrent)) = $Current + Return True + EndSwitch +EndFunc ;==>__Au3Obj_EnumFunctionProxy + +#EndRegion Proxy Functions +;-------------------------------------------------------------------------------------------------------------------------------------- + + +;-------------------------------------------------------------------------------------------------------------------------------------- +#Region Call Pointer + +Func __Au3Obj_PointerCall($sRetType, $pAddress, $sType1 = "", $vParam1 = 0, $sType2 = "", $vParam2 = 0, $sType3 = "", $vParam3 = 0, $sType4 = "", $vParam4 = 0, $sType5 = "", $vParam5 = 0, $sType6 = "", $vParam6 = 0, $sType7 = "", $vParam7 = 0, $sType8 = "", $vParam8 = 0, $sType9 = "", $vParam9 = 0, $sType10 = "", $vParam10 = 0, $sType11 = "", $vParam11 = 0, $sType12 = "", $vParam12 = 0, $sType13 = "", $vParam13 = 0, $sType14 = "", $vParam14 = 0, $sType15 = "", $vParam15 = 0, $sType16 = "", $vParam16 = 0, $sType17 = "", $vParam17 = 0, $sType18 = "", $vParam18 = 0, $sType19 = "", $vParam19 = 0, $sType20 = "", $vParam20 = 0) + ; Author: Ward, Prog@ndy, trancexx + Local Static $pHook, $hPseudo, $tPtr, $sFuncName = "MemoryCallEntry" + If $pAddress Then + If Not $pHook Then + Local $sDll = "AutoItObject.dll" + If $__Au3Obj_X64 Then $sDll = "AutoItObject_X64.dll" + $hPseudo = DllOpen($sDll) + If $hPseudo = -1 Then + $sDll = "kernel32.dll" + $sFuncName = "GlobalFix" + $hPseudo = DllOpen($sDll) + EndIf + Local $aCall = DllCall($gh_AU3Obj_kernel32dll, "ptr", "GetModuleHandleW", "wstr", $sDll) + If @error Or Not $aCall[0] Then Return SetError(7, @error, 0) ; Couldn't get dll handle + Local $hModuleHandle = $aCall[0] + $aCall = DllCall($gh_AU3Obj_kernel32dll, "ptr", "GetProcAddress", "ptr", $hModuleHandle, "str", $sFuncName) + If @error Then Return SetError(8, @error, 0) ; Wanted function not found + $pHook = $aCall[0] + $aCall = DllCall($gh_AU3Obj_kernel32dll, "bool", "VirtualProtect", "ptr", $pHook, "dword", 7 + 5 * $__Au3Obj_X64, "dword", 64, "dword*", 0) + If @error Or Not $aCall[0] Then Return SetError(9, @error, 0) ; Unable to set MEM_EXECUTE_READWRITE + If $__Au3Obj_X64 Then + DllStructSetData(DllStructCreate("word", $pHook), 1, 0xB848) + DllStructSetData(DllStructCreate("word", $pHook + 10), 1, 0xE0FF) + Else + DllStructSetData(DllStructCreate("byte", $pHook), 1, 0xB8) + DllStructSetData(DllStructCreate("word", $pHook + 5), 1, 0xE0FF) + EndIf + $tPtr = DllStructCreate("ptr", $pHook + 1 + $__Au3Obj_X64) + EndIf + DllStructSetData($tPtr, 1, $pAddress) + Local $aRet + Switch @NumParams + Case 2 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName) + Case 4 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1) + Case 6 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2) + Case 8 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3) + Case 10 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4) + Case 12 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5) + Case 14 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6) + Case 16 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7) + Case 18 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8) + Case 20 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8, $sType9, $vParam9) + Case 22 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8, $sType9, $vParam9, $sType10, $vParam10) + Case 24 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8, $sType9, $vParam9, $sType10, $vParam10, $sType11, $vParam11) + Case 26 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8, $sType9, $vParam9, $sType10, $vParam10, $sType11, $vParam11, $sType12, $vParam12) + Case 28 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8, $sType9, $vParam9, $sType10, $vParam10, $sType11, $vParam11, $sType12, $vParam12, $sType13, $vParam13) + Case 30 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8, $sType9, $vParam9, $sType10, $vParam10, $sType11, $vParam11, $sType12, $vParam12, $sType13, $vParam13, $sType14, $vParam14) + Case 32 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8, $sType9, $vParam9, $sType10, $vParam10, $sType11, $vParam11, $sType12, $vParam12, $sType13, $vParam13, $sType14, $vParam14, $sType15, $vParam15) + Case 34 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8, $sType9, $vParam9, $sType10, $vParam10, $sType11, $vParam11, $sType12, $vParam12, $sType13, $vParam13, $sType14, $vParam14, $sType15, $vParam15, $sType16, $vParam16) + Case 36 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8, $sType9, $vParam9, $sType10, $vParam10, $sType11, $vParam11, $sType12, $vParam12, $sType13, $vParam13, $sType14, $vParam14, $sType15, $vParam15, $sType16, $vParam16, $sType17, $vParam17) + Case 38 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8, $sType9, $vParam9, $sType10, $vParam10, $sType11, $vParam11, $sType12, $vParam12, $sType13, $vParam13, $sType14, $vParam14, $sType15, $vParam15, $sType16, $vParam16, $sType17, $vParam17, $sType18, $vParam18) + Case 40 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8, $sType9, $vParam9, $sType10, $vParam10, $sType11, $vParam11, $sType12, $vParam12, $sType13, $vParam13, $sType14, $vParam14, $sType15, $vParam15, $sType16, $vParam16, $sType17, $vParam17, $sType18, $vParam18, $sType19, $vParam19) + Case 42 + $aRet = DllCall($hPseudo, $sRetType, $sFuncName, $sType1, $vParam1, $sType2, $vParam2, $sType3, $vParam3, $sType4, $vParam4, $sType5, $vParam5, $sType6, $vParam6, $sType7, $vParam7, $sType8, $vParam8, $sType9, $vParam9, $sType10, $vParam10, $sType11, $vParam11, $sType12, $vParam12, $sType13, $vParam13, $sType14, $vParam14, $sType15, $vParam15, $sType16, $vParam16, $sType17, $vParam17, $sType18, $vParam18, $sType19, $vParam19, $sType20, $vParam20) + Case Else + If Mod(@NumParams, 2) Then Return SetError(4, 0, 0) ; Bad number of parameters + Return SetError(5, 0, 0) ; Max number of parameters exceeded + EndSwitch + Return SetError(@error, @extended, $aRet) ; All went well. Error description and return values like with DllCall() + EndIf + Return SetError(6, 0, 0) ; Null address specified +EndFunc ;==>__Au3Obj_PointerCall + +#EndRegion Call Pointer +;-------------------------------------------------------------------------------------------------------------------------------------- + + +;-------------------------------------------------------------------------------------------------------------------------------------- +#Region Embedded DLL + +Func __Au3Obj_Mem_DllOpen($bBinaryImage = 0, $sSubrogor = "cmd.exe") + If Not $bBinaryImage Then + If $__Au3Obj_X64 Then + $bBinaryImage = __Au3Obj_Mem_BinDll_X64() + Else + $bBinaryImage = __Au3Obj_Mem_BinDll() + EndIf + EndIf + ; Make structure out of binary data that was passed + Local $tBinary = DllStructCreate("byte[" & BinaryLen($bBinaryImage) & "]") + DllStructSetData($tBinary, 1, $bBinaryImage) ; fill the structure + ; Get pointer to it + Local $pPointer = DllStructGetPtr($tBinary) + ; Start processing passed binary data. 'Reading' PE format follows. + Local $tIMAGE_DOS_HEADER = DllStructCreate("char Magic[2];" & _ + "word BytesOnLastPage;" & _ + "word Pages;" & _ + "word Relocations;" & _ + "word SizeofHeader;" & _ + "word MinimumExtra;" & _ + "word MaximumExtra;" & _ + "word SS;" & _ + "word SP;" & _ + "word Checksum;" & _ + "word IP;" & _ + "word CS;" & _ + "word Relocation;" & _ + "word Overlay;" & _ + "char Reserved[8];" & _ + "word OEMIdentifier;" & _ + "word OEMInformation;" & _ + "char Reserved2[20];" & _ + "dword AddressOfNewExeHeader", _ + $pPointer) + ; Move pointer + $pPointer += DllStructGetData($tIMAGE_DOS_HEADER, "AddressOfNewExeHeader") ; move to PE file header + $pPointer += 4 ; size of skipped $tIMAGE_NT_SIGNATURE structure + ; In place of IMAGE_FILE_HEADER structure + Local $tIMAGE_FILE_HEADER = DllStructCreate("word Machine;" & _ + "word NumberOfSections;" & _ + "dword TimeDateStamp;" & _ + "dword PointerToSymbolTable;" & _ + "dword NumberOfSymbols;" & _ + "word SizeOfOptionalHeader;" & _ + "word Characteristics", _ + $pPointer) + ; Get number of sections + Local $iNumberOfSections = DllStructGetData($tIMAGE_FILE_HEADER, "NumberOfSections") + ; Move pointer + $pPointer += 20 ; size of $tIMAGE_FILE_HEADER structure + ; Determine the type + Local $tMagic = DllStructCreate("word Magic;", $pPointer) + Local $iMagic = DllStructGetData($tMagic, 1) + Local $tIMAGE_OPTIONAL_HEADER + If $iMagic = 267 Then ; x86 version + If $__Au3Obj_X64 Then Return SetError(1, 0, -1) ; incompatible versions + $tIMAGE_OPTIONAL_HEADER = DllStructCreate("word Magic;" & _ + "byte MajorLinkerVersion;" & _ + "byte MinorLinkerVersion;" & _ + "dword SizeOfCode;" & _ + "dword SizeOfInitializedData;" & _ + "dword SizeOfUninitializedData;" & _ + "dword AddressOfEntryPoint;" & _ + "dword BaseOfCode;" & _ + "dword BaseOfData;" & _ + "dword ImageBase;" & _ + "dword SectionAlignment;" & _ + "dword FileAlignment;" & _ + "word MajorOperatingSystemVersion;" & _ + "word MinorOperatingSystemVersion;" & _ + "word MajorImageVersion;" & _ + "word MinorImageVersion;" & _ + "word MajorSubsystemVersion;" & _ + "word MinorSubsystemVersion;" & _ + "dword Win32VersionValue;" & _ + "dword SizeOfImage;" & _ + "dword SizeOfHeaders;" & _ + "dword CheckSum;" & _ + "word Subsystem;" & _ + "word DllCharacteristics;" & _ + "dword SizeOfStackReserve;" & _ + "dword SizeOfStackCommit;" & _ + "dword SizeOfHeapReserve;" & _ + "dword SizeOfHeapCommit;" & _ + "dword LoaderFlags;" & _ + "dword NumberOfRvaAndSizes", _ + $pPointer) + ; Move pointer + $pPointer += 96 ; size of $tIMAGE_OPTIONAL_HEADER + ElseIf $iMagic = 523 Then ; x64 version + If Not $__Au3Obj_X64 Then Return SetError(1, 0, -1) ; incompatible versions + $tIMAGE_OPTIONAL_HEADER = DllStructCreate("word Magic;" & _ + "byte MajorLinkerVersion;" & _ + "byte MinorLinkerVersion;" & _ + "dword SizeOfCode;" & _ + "dword SizeOfInitializedData;" & _ + "dword SizeOfUninitializedData;" & _ + "dword AddressOfEntryPoint;" & _ + "dword BaseOfCode;" & _ + "uint64 ImageBase;" & _ + "dword SectionAlignment;" & _ + "dword FileAlignment;" & _ + "word MajorOperatingSystemVersion;" & _ + "word MinorOperatingSystemVersion;" & _ + "word MajorImageVersion;" & _ + "word MinorImageVersion;" & _ + "word MajorSubsystemVersion;" & _ + "word MinorSubsystemVersion;" & _ + "dword Win32VersionValue;" & _ + "dword SizeOfImage;" & _ + "dword SizeOfHeaders;" & _ + "dword CheckSum;" & _ + "word Subsystem;" & _ + "word DllCharacteristics;" & _ + "uint64 SizeOfStackReserve;" & _ + "uint64 SizeOfStackCommit;" & _ + "uint64 SizeOfHeapReserve;" & _ + "uint64 SizeOfHeapCommit;" & _ + "dword LoaderFlags;" & _ + "dword NumberOfRvaAndSizes", _ + $pPointer) + ; Move pointer + $pPointer += 112 ; size of $tIMAGE_OPTIONAL_HEADER + Else + Return SetError(1, 0, -1) ; incompatible versions + EndIf + ; Extract data + Local $iEntryPoint = DllStructGetData($tIMAGE_OPTIONAL_HEADER, "AddressOfEntryPoint") ; if loaded binary image would start executing at this address + Local $pOptionalHeaderImageBase = DllStructGetData($tIMAGE_OPTIONAL_HEADER, "ImageBase") ; address of the first byte of the image when it's loaded in memory + $pPointer += 8 ; skipping IMAGE_DIRECTORY_ENTRY_EXPORT + ; Import Directory + Local $tIMAGE_DIRECTORY_ENTRY_IMPORT = DllStructCreate("dword VirtualAddress; dword Size", $pPointer) + ; Collect data + Local $pAddressImport = DllStructGetData($tIMAGE_DIRECTORY_ENTRY_IMPORT, "VirtualAddress") +;~ Local $iSizeImport = DllStructGetData($tIMAGE_DIRECTORY_ENTRY_IMPORT, "Size") + $pPointer += 8 ; size of $tIMAGE_DIRECTORY_ENTRY_IMPORT + $pPointer += 24 ; skipping IMAGE_DIRECTORY_ENTRY_RESOURCE, IMAGE_DIRECTORY_ENTRY_EXCEPTION, IMAGE_DIRECTORY_ENTRY_SECURITY + ; Base Relocation Directory + Local $tIMAGE_DIRECTORY_ENTRY_BASERELOC = DllStructCreate("dword VirtualAddress; dword Size", $pPointer) + ; Collect data + Local $pAddressNewBaseReloc = DllStructGetData($tIMAGE_DIRECTORY_ENTRY_BASERELOC, "VirtualAddress") + Local $iSizeBaseReloc = DllStructGetData($tIMAGE_DIRECTORY_ENTRY_BASERELOC, "Size") + $pPointer += 8 ; size of IMAGE_DIRECTORY_ENTRY_BASERELOC + $pPointer += 40 ; skipping IMAGE_DIRECTORY_ENTRY_DEBUG, IMAGE_DIRECTORY_ENTRY_COPYRIGHT, IMAGE_DIRECTORY_ENTRY_GLOBALPTR, IMAGE_DIRECTORY_ENTRY_TLS, IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG + $pPointer += 40 ; five more generally unused data directories + ; Load the victim + Local $pBaseAddress = __Au3Obj_Mem_LoadLibraryEx($sSubrogor, 1) ; "lighter" loading, DONT_RESOLVE_DLL_REFERENCES + If @error Then Return SetError(2, 0, -1) ; Couldn't load subrogor + Local $pHeadersNew = DllStructGetPtr($tIMAGE_DOS_HEADER) ; starting address of binary image headers + Local $iOptionalHeaderSizeOfHeaders = DllStructGetData($tIMAGE_OPTIONAL_HEADER, "SizeOfHeaders") ; the size of the MS-DOS stub, the PE header, and the section headers + ; Set proper memory protection for writting headers (PAGE_READWRITE) + If Not __Au3Obj_Mem_VirtualProtect($pBaseAddress, $iOptionalHeaderSizeOfHeaders, 4) Then Return SetError(3, 0, -1) ; Couldn't set proper protection for headers + ; Write NEW headers + DllStructSetData(DllStructCreate("byte[" & $iOptionalHeaderSizeOfHeaders & "]", $pBaseAddress), 1, DllStructGetData(DllStructCreate("byte[" & $iOptionalHeaderSizeOfHeaders & "]", $pHeadersNew), 1)) + ; Dealing with sections. Will write them. + Local $tIMAGE_SECTION_HEADER + Local $iSizeOfRawData, $pPointerToRawData + Local $iVirtualSize, $iVirtualAddress + Local $pRelocRaw + For $i = 1 To $iNumberOfSections + $tIMAGE_SECTION_HEADER = DllStructCreate("char Name[8];" & _ + "dword UnionOfVirtualSizeAndPhysicalAddress;" & _ + "dword VirtualAddress;" & _ + "dword SizeOfRawData;" & _ + "dword PointerToRawData;" & _ + "dword PointerToRelocations;" & _ + "dword PointerToLinenumbers;" & _ + "word NumberOfRelocations;" & _ + "word NumberOfLinenumbers;" & _ + "dword Characteristics", _ + $pPointer) + ; Collect data + $iSizeOfRawData = DllStructGetData($tIMAGE_SECTION_HEADER, "SizeOfRawData") + $pPointerToRawData = $pHeadersNew + DllStructGetData($tIMAGE_SECTION_HEADER, "PointerToRawData") + $iVirtualAddress = DllStructGetData($tIMAGE_SECTION_HEADER, "VirtualAddress") + $iVirtualSize = DllStructGetData($tIMAGE_SECTION_HEADER, "UnionOfVirtualSizeAndPhysicalAddress") + If $iVirtualSize And $iVirtualSize < $iSizeOfRawData Then $iSizeOfRawData = $iVirtualSize + ; Set MEM_EXECUTE_READWRITE for sections (PAGE_EXECUTE_READWRITE for all for simplicity) + If Not __Au3Obj_Mem_VirtualProtect($pBaseAddress + $iVirtualAddress, $iVirtualSize, 64) Then + $pPointer += 40 ; size of $tIMAGE_SECTION_HEADER structure + ContinueLoop + EndIf + ; Clean the space + DllStructSetData(DllStructCreate("byte[" & $iVirtualSize & "]", $pBaseAddress + $iVirtualAddress), 1, DllStructGetData(DllStructCreate("byte[" & $iVirtualSize & "]"), 1)) + ; If there is data to write, write it + If $iSizeOfRawData Then DllStructSetData(DllStructCreate("byte[" & $iSizeOfRawData & "]", $pBaseAddress + $iVirtualAddress), 1, DllStructGetData(DllStructCreate("byte[" & $iSizeOfRawData & "]", $pPointerToRawData), 1)) + ; Relocations + If $iVirtualAddress <= $pAddressNewBaseReloc And $iVirtualAddress + $iSizeOfRawData > $pAddressNewBaseReloc Then $pRelocRaw = $pPointerToRawData + ($pAddressNewBaseReloc - $iVirtualAddress) + ; Imports + If $iVirtualAddress <= $pAddressImport And $iVirtualAddress + $iSizeOfRawData > $pAddressImport Then __Au3Obj_Mem_FixImports($pPointerToRawData + ($pAddressImport - $iVirtualAddress), $pBaseAddress) ; fix imports in place + ; Move pointer + $pPointer += 40 ; size of $tIMAGE_SECTION_HEADER structure + Next + ; Fix relocations + If $pAddressNewBaseReloc And $iSizeBaseReloc Then __Au3Obj_Mem_FixReloc($pRelocRaw, $iSizeBaseReloc, $pBaseAddress, $pOptionalHeaderImageBase, $iMagic = 523) + ; Entry point address + Local $pEntryFunc = $pBaseAddress + $iEntryPoint + ; DllMain simulation + __Au3Obj_PointerCall("bool", $pEntryFunc, "ptr", $pBaseAddress, "dword", 1, "ptr", 0) ; DLL_PROCESS_ATTACH + ; Get pseudo-handle + Local $hPseudo = DllOpen($sSubrogor) + __Au3Obj_Mem_FreeLibrary($pBaseAddress) ; decrement reference count + Return $hPseudo +EndFunc ;==>__Au3Obj_Mem_DllOpen + +Func __Au3Obj_Mem_FixReloc($pData, $iSize, $pAddressNew, $pAddressOld, $fImageX64) + Local $iDelta = $pAddressNew - $pAddressOld ; dislocation value + Local $tIMAGE_BASE_RELOCATION, $iRelativeMove + Local $iVirtualAddress, $iSizeofBlock, $iNumberOfEntries + Local $tEnries, $iData, $tAddress + Local $iFlag = 3 + 7 * $fImageX64 ; IMAGE_REL_BASED_HIGHLOW = 3 or IMAGE_REL_BASED_DIR64 = 10 + While $iRelativeMove < $iSize ; for all data available + $tIMAGE_BASE_RELOCATION = DllStructCreate("dword VirtualAddress; dword SizeOfBlock", $pData + $iRelativeMove) + $iVirtualAddress = DllStructGetData($tIMAGE_BASE_RELOCATION, "VirtualAddress") + $iSizeofBlock = DllStructGetData($tIMAGE_BASE_RELOCATION, "SizeOfBlock") + $iNumberOfEntries = ($iSizeofBlock - 8) / 2 + $tEnries = DllStructCreate("word[" & $iNumberOfEntries & "]", DllStructGetPtr($tIMAGE_BASE_RELOCATION) + 8) + ; Go through all entries + For $i = 1 To $iNumberOfEntries + $iData = DllStructGetData($tEnries, 1, $i) + If BitShift($iData, 12) = $iFlag Then ; check type + $tAddress = DllStructCreate("ptr", $pAddressNew + $iVirtualAddress + BitAND($iData, 0xFFF)) ; the rest of $iData is offset + DllStructSetData($tAddress, 1, DllStructGetData($tAddress, 1) + $iDelta) ; this is what's this all about + EndIf + Next + $iRelativeMove += $iSizeofBlock + WEnd + Return 1 ; all OK! +EndFunc ;==>__Au3Obj_Mem_FixReloc + +Func __Au3Obj_Mem_FixImports($pImportDirectory, $hInstance) + Local $hModule, $tFuncName, $sFuncName, $pFuncAddress + Local $tIMAGE_IMPORT_MODULE_DIRECTORY, $tModuleName + Local $tBufferOffset2, $iBufferOffset2 + Local $iInitialOffset, $iInitialOffset2, $iOffset + While 1 + $tIMAGE_IMPORT_MODULE_DIRECTORY = DllStructCreate("dword RVAOriginalFirstThunk;" & _ + "dword TimeDateStamp;" & _ + "dword ForwarderChain;" & _ + "dword RVAModuleName;" & _ + "dword RVAFirstThunk", _ + $pImportDirectory) + If Not DllStructGetData($tIMAGE_IMPORT_MODULE_DIRECTORY, "RVAFirstThunk") Then ExitLoop ; the end + $tModuleName = DllStructCreate("char Name[64]", $hInstance + DllStructGetData($tIMAGE_IMPORT_MODULE_DIRECTORY, "RVAModuleName")) + $hModule = __Au3Obj_Mem_LoadLibraryEx(DllStructGetData($tModuleName, "Name")) ; load the module, full load + $iInitialOffset = $hInstance + DllStructGetData($tIMAGE_IMPORT_MODULE_DIRECTORY, "RVAFirstThunk") + $iInitialOffset2 = $hInstance + DllStructGetData($tIMAGE_IMPORT_MODULE_DIRECTORY, "RVAOriginalFirstThunk") + If $iInitialOffset2 = $hInstance Then $iInitialOffset2 = $iInitialOffset + $iOffset = 0 ; back to 0 + While 1 + $tBufferOffset2 = DllStructCreate("ptr", $iInitialOffset2 + $iOffset) + $iBufferOffset2 = DllStructGetData($tBufferOffset2, 1) ; value at that address + If Not $iBufferOffset2 Then ExitLoop ; zero value is the end + If BitShift(BinaryMid($iBufferOffset2, $__Au3Obj_PTR_SIZE, 1), 7) Then ; MSB is set for imports by ordinal, otherwise not + $pFuncAddress = __Au3Obj_Mem_GetAddress($hModule, BitAND($iBufferOffset2, 0xFFFFFF)) ; the rest is ordinal value + Else + $tFuncName = DllStructCreate("word Ordinal; char Name[64]", $hInstance + $iBufferOffset2) + $sFuncName = DllStructGetData($tFuncName, "Name") + $pFuncAddress = __Au3Obj_Mem_GetAddress($hModule, $sFuncName) + EndIf + DllStructSetData(DllStructCreate("ptr", $iInitialOffset + $iOffset), 1, $pFuncAddress) ; and this is what's this all about + $iOffset += $__Au3Obj_PTR_SIZE ; size of $tBufferOffset2 + WEnd + $pImportDirectory += 20 ; size of $tIMAGE_IMPORT_MODULE_DIRECTORY + WEnd + Return 1 ; all OK! +EndFunc ;==>__Au3Obj_Mem_FixImports + +Func __Au3Obj_Mem_Base64Decode($sData) ; Ward + Local $bOpcode + If $__Au3Obj_X64 Then + $bOpcode = Binary("0x4156415541544D89CC555756534C89C34883EC20410FB64104418800418B3183FE010F84AB00000073434863D24D89C54889CE488D3C114839FE0F84A50100000FB62E4883C601E8B501000083ED2B4080FD5077E2480FBEED0FB6042884C00FBED078D3C1E20241885500EB7383FE020F841C01000031C083FE03740F4883C4205B5E5F5D415C415D415EC34863D24D89C54889CE488D3C114839FE0F84CA0000000FB62E4883C601E85301000083ED2B4080FD5077E2480FBEED0FB6042884C078D683E03F410845004983C501E964FFFFFF4863D24D89C54889CE488D3C114839FE0F84E00000000FB62E4883C601E80C01000083ED2B4080FD5077E2480FBEED0FB6042884C00FBED078D389D04D8D7501C1E20483E03041885501C1F804410845004839FE747B0FB62E4883C601E8CC00000083ED2B4080FD5077E6480FBEED0FB6042884C00FBED078D789D0C1E2064D8D6E0183E03C41885601C1F8024108064839FE0F8536FFFFFF41C7042403000000410FB6450041884424044489E84883C42029D85B5E5F5D415C415D415EC34863D24889CE4D89C6488D3C114839FE758541C7042402000000410FB60641884424044489F04883C42029D85B5E5F5D415C415D415EC341C7042401000000410FB6450041884424044489E829D8E998FEFFFF41C7042400000000410FB6450041884424044489E829D8E97CFEFFFFE8500000003EFFFFFF3F3435363738393A3B3C3DFFFFFFFEFFFFFF000102030405060708090A0B0C0D0E0F10111213141516171819FFFFFFFFFFFF1A1B1C1D1E1F202122232425262728292A2B2C2D2E2F3031323358C3") + Else + $bOpcode = Binary("0x5557565383EC1C8B6C243C8B5424388B5C24308B7424340FB6450488028B550083FA010F84A1000000733F8B5424388D34338954240C39F30F848B0100000FB63B83C301E8890100008D57D580FA5077E50FBED20FB6041084C00FBED078D78B44240CC1E2028810EB6B83FA020F841201000031C083FA03740A83C41C5B5E5F5DC210008B4C24388D3433894C240C39F30F84CD0000000FB63B83C301E8300100008D57D580FA5077E50FBED20FB6041084C078DA8B54240C83E03F080283C2018954240CE96CFFFFFF8B4424388D34338944240C39F30F84D00000000FB63B83C301E8EA0000008D57D580FA5077E50FBED20FB6141084D20FBEC278D78B4C240C89C283E230C1FA04C1E004081189CF83C70188410139F374750FB60383C3018844240CE8A80000000FB654240C83EA2B80FA5077E00FBED20FB6141084D20FBEC278D289C283E23CC1FA02C1E006081739F38D57018954240C8847010F8533FFFFFFC74500030000008B4C240C0FB60188450489C82B44243883C41C5B5E5F5DC210008D34338B7C243839F3758BC74500020000000FB60788450489F82B44243883C41C5B5E5F5DC210008B54240CC74500010000000FB60288450489D02B442438E9B1FEFFFFC7450000000000EB99E8500000003EFFFFFF3F3435363738393A3B3C3DFFFFFFFEFFFFFF000102030405060708090A0B0C0D0E0F10111213141516171819FFFFFFFFFFFF1A1B1C1D1E1F202122232425262728292A2B2C2D2E2F3031323358C3") + EndIf + Local $tCodeBuffer = DllStructCreate("byte[" & BinaryLen($bOpcode) & "]") + DllStructSetData($tCodeBuffer, 1, $bOpcode) + __Au3Obj_Mem_VirtualProtect(DllStructGetPtr($tCodeBuffer), DllStructGetSize($tCodeBuffer), 64) + If @error Then Return SetError(1, 0, "") + Local $iLen = StringLen($sData) + Local $tOut = DllStructCreate("byte[" & $iLen & "]") + Local $tState = DllStructCreate("byte[16]") + Local $Call = __Au3Obj_PointerCall("int", DllStructGetPtr($tCodeBuffer), "str", $sData, "dword", $iLen, "ptr", DllStructGetPtr($tOut), "ptr", DllStructGetPtr($tState)) + If @error Then Return SetError(2, 0, "") + Return BinaryMid(DllStructGetData($tOut, 1), 1, $Call[0]) +EndFunc ;==>__Au3Obj_Mem_Base64Decode + +Func __Au3Obj_Mem_LoadLibraryEx($sModule, $iFlag = 0) + Local $aCall = DllCall($gh_AU3Obj_kernel32dll, "handle", "LoadLibraryExW", "wstr", $sModule, "handle", 0, "dword", $iFlag) + If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>__Au3Obj_Mem_LoadLibraryEx + +Func __Au3Obj_Mem_FreeLibrary($hModule) + Local $aCall = DllCall($gh_AU3Obj_kernel32dll, "bool", "FreeLibrary", "handle", $hModule) + If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) + Return 1 +EndFunc ;==>__Au3Obj_Mem_FreeLibrary + +Func __Au3Obj_Mem_GetAddress($hModule, $vFuncName) + Local $sType = "str" + If IsNumber($vFuncName) Then $sType = "int" ; if ordinal value passed + Local $aCall = DllCall($gh_AU3Obj_kernel32dll, "ptr", "GetProcAddress", "handle", $hModule, $sType, $vFuncName) + If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>__Au3Obj_Mem_GetAddress + +Func __Au3Obj_Mem_VirtualProtect($pAddress, $iSize, $iProtection) + Local $aCall = DllCall($gh_AU3Obj_kernel32dll, "bool", "VirtualProtect", "ptr", $pAddress, "dword_ptr", $iSize, "dword", $iProtection, "dword*", 0) + If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) + Return 1 +EndFunc ;==>__Au3Obj_Mem_VirtualProtect + +Func __Au3Obj_Mem_BinDll() + Local $sData = "TVpAAAEAAAACAAAA//8AALgAAAAAAAAACgAAAAAAAAAOH7oOALQJzSG4AUzNIVdpbjMyIC5ETEwuDQokQAAAAFBFAABMAQMAmYvVTQAAAAAAAAAA4AACIwsBCgAAOgAAABgAAAAAAABbkwAAABAAAABQAAAAAAAQABAAAAACAAAFAAEAAAAAAAUAAQAAAAAAALAAAAACAAAAAAAAAgAABQAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAACQAABUAgAAVJIAAAgBAAAAoAAAcAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALiSAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALk1QUkVTUzEAgAAAABAAAAAqAAAAAgAAAAAAAAAAAAAAAAAA4AAA4C5NUFJFU1MyFgYAAACQAAAACAAAACwAAAAAAAAAAAAAAAAAAOAAAOAucnNyYwAAAHADAAAAoAAAAAQAAAA0AAAAAAAAAAAAAAAAAABAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdjIuMTcIAJopAABVAIvs/3UIagj/ABVYUAAQUP8VSlQM0DXMQgAsBgXIUoPsIIPk8NkAwNlUJBjffCQCEN9sJBCLFrAIQEQCUQhMx+MNkF4oneeRzUECsMhAEhgPAAAAABgY/P///zcIAg3ABBSD0gDraCw65DLYLqMNsI5EARH3wipRh5sNwUWCYRDJw1aLAPGDJgCDZhgAFI1GCBUAgBUAi8ZIXi6xaEAOB1DoQBPOkDVojGD1D1JBqANew4sBwwGNQQjDi0EYZxAAi0UIiUEYXcIFBACLQRwgxgESgBhgdbWY33iHIGA26ANAdyBIaiAIWP8AZokG/xVBiByQeATx5cVF" & _ + "gC4wGIwQ9V/BGw8DhFUBbAT/FQQ+ADCTrCYApHUvDvAAGXyfvYAcRYDO6P//zxOJBriTAABXEIRUAjBKDQacHIEJjUYYUMcGCDxRABAdMItGCECL9QBRCINmCABAXg1CVot1DFczAckzwGaJTfQGAECuRpDV2Ac/AyCdWAR/XGQPAAAADJBYpG92DFDkD2A0f3pcBABOQCAAcFxkDgoz6jDgDmBEtwGsCHACPiM9f0oHwLDYBJEYgCtwAAQAuA5xAsAh9gJAMAP85ZUszAB8EGMTjUgYUf9wDAj/cAxRE3kQi00AFIkBM8mFwA8BlMGLwV3CELNAImoAVkahFmA19wHYG8BAXcIIRA8AAaEmQKQEALgB4B8AVLMOgPDvRLAIYkRwAOCM/hgAYAJglR4zA3wZmDZhhkIAkBiT2BdEsFg0wJBoxLBYJAKBAA4UiUYU0xGlY2Fwo2TYFSLew3AVFPALQmXVKQBcFIAxFvMLAQpSB11RdQiLBlYi/1DMAJEI0xXRBd4Vww45AwODIAAzUcDjQFNlE0YYV2mzJIs9aRP/123jVfwN//+LHV8TTJGYBqEwvWjEoacMbh/QUewGNJFoxCEmIGKqKf0C6/tiMhQAIgZfMl5bhxBZAP82ajITAJyVaJBoRFAaAPhA8p9EsBhEsAhQhbADPYewmCCwSBCYSBDZIDEF2FoQP/N/bMAiBQAAkeMHYeexCDgfwIFbuE3nsEixjH5rCVMPMEc7AX4QcuKNXgwsICBCAACw2FNO0QhghAL1f91ohMSrIDgK0BWwB7gPu2iXAVJov2egMf8zDoO8B7BtUoUxIDDIjgEwtag8GB5gdQXxUCjMA/bCAg8ghbkQwvBAOCKAAADQw9cVUNe2SFDHMeiHgAMoB4AbAEYEM9uDOP0AD5TDM8CF2w8AlcCL+IsGwecABAPHD7cIg/kAFXQZg/kUdBQAg/kadBuD+RMAdBaD+QN0EekA6wUAAGoTagBUUL0DrL0TNnxCCQwQDE4wYAz1T1fgg5Ce" & _ + "YGAOeuYBGASAMIiHAPBACERrAoPAOItNHAH/MVDrbT15PKDxUFjYTEBkkUSChLO+/QUzRPAFEfBQuIQHA4sGLUAeLRA3ABgadCAtEDcAA3QWALgFAAKA6UoMpDfABu8VdSCnODPAl0DSs4cbXakEuKAOSBu40FjUOGAH8x9SgeoEhcB1OU0Ak1UJaBDHAmaJsQZZGZAmkBgUd8ChloAFYZYYFF3AkQiHAT1TgyekSDBojGJFs86YDxNigFAOAJVeZfARgUcSEtlgpI8BAYPAWOvhPXcwIeCy2Icw+AcTi4wwsFgHEqa3pXFHgnwA00OQ/tAUgc9fR8VUCIJBBlhk0QcCdEVGDVhqKGaJDAfo+PjlBJkDE/8AdiCLyP92HP8EdhhW6M4hA+sCDDPAiUd5R6Ays02wM/zA+GAvCIsAfhBHO8cPjQCAHOHHsMhzmNgXgGC2s/xQeIQHtL8jPhDyO8A9S/GMDrb+PUANCTleCA8ohMgmo20CSA+EQl/HAkgPhbMoUbfEUa4wiA8IgThgBELWDJDLAAIwp8AxYJaD8FCYoQVrEisVoJsR+PsCByKwRYGUvEWgNjCgMAO8JVKYHEaQ2ARyRmZGsINBtzDVQptTFATyQtZIdIMANSYgSiucQJD+pJA1MKC01Q5QWHoBDnIB0mgMAheAAnV/D1ALAIsR+YvHkRqD4ALEIWQwAG4wCAyRFS9QCPTfHjAAvEhkjABtpAA8BAQ0998b/wKD5/6DxwJVAokARfQD/o1F8FeG4QEg6RQI2QY5KymW7QT/NsEBK2UD9SX/jCIH8Iw+nSEhCSCJRmAkngDZLbCIhTBYBsAO0DgkkFiEDtBYhA6lFqDGAPFfgWkUEE0MUVAQiUX49WpThdt+EUaLw1UCx0X0OQMAAIld/Itd9IlMRboAMTDshVBRAACLA00YjUQI8IEBYAPYyTHYhgExOAwR8N/EX/f8X5cFANi1segFtliEfxxiBJYcAJBevhB46ZUXeCOZJVCC1EqRgtOHDhXVR+kC" + $sData &= "hqV1i/i4ga0VZjkHD4US0RdWd9GXANEXBn0GWfUCCASDOP91I5F8Zol1HpIUYeAADRCUqglh0EXDVid7AEwByQSxFiUJ1J4AFaGiGaFfIBh+TbeoYbDYkw9RFHRQFHONHXkGZDapAlkHi3YYAIl19IP+/3Un4J1xShNRGjHYBy9g9Rx9UaSUXtOi0BrQekBUYUlEEEBAp4DrUBwVkNMF8kB4ry/MACZNCMkh6YdeBNHezFCdQpGDH8Ofg6+An4Mvgp+DMZwFkIPGP2gGhgzaDwAEk3KiNmCWaITigmVFAViBIgklxhIxKNAHApDoBZZXQBfX0CDidFBZkv9OCBEBgZUm/f/9fwUD4QMY6wW4GCHMAMnCJOxSHGTvAN4OAeLtAGoSwYBrWDoChX4uo9YAvgTxQGjuIOCDyP9yHLN4HLNurzYhuBGPHtVSELCIPbj/7zeSACBwtciDWfjv/gDPoO4PcmXoMFONTgzofznGAyAaIToeVl4RC0ILGSBI8IUHdDNYZTaIA+BHV7J4xDC1iMMBKxTxAGBQO8EAuwWyvpAS0PjEgI5DppEI4SUhM9s2E3C1CNYTU2EnMYleBIleAwiJXgyJXiyghAEAKFCJXhiJXhwDiV4giV4k/hHlIlFBWBSgBoIuKG+NAAA7w3QLi8jon8qdLbYI8D9VHOBNA2pTAiDwDgJoWAIawAJVP70IV8IasJwj8OWaAZxmEhIVlRNPI8UA7gGQ8yUBYddXFoAeXxbDAFgWlFiEsD6Q2AWE0DXCv8iAmNi0hu8UIJUDULUhi0DgCiD/QGFLEECRuwEkGRJAEboSDxQtEo0WNTL/RfyNCQA7RxByg4tHGIDdAA7/dyCLzv8CdxxQ6HEDtULJkXE2UVH+HvdQaKkwEEQ94RkAdH0xDYNlQPyNA34QQE/HRVH4QgMAIJoBdE5T4hgBXI9UblGH0+iFMsVY+tNYhJ/UGLhllgg1wDxWebtPdbRb9XYZ1WJTtdGz8JUiUFWRAG4Scr1BtQEQ/zZocOIN" & _ + "Bt1q7iPBcQxgIwH/pcohgiGZAGiEhLpAKJZ2FrHODQeccB9gVxHrWb9wQAv3AVoUsS4KB2XIcB9ghBHrhXAADqdiDnBiTxHpeg/iC4Hmx8/3ARIVwUc1HHEsvhYQkDKIb5kBLUkCuAYeBAHGRwgtLWogi/noNJfvghSTqgafqmCvdhdQPVB/YYMSzpUnUTd5N1cMJMDPBFbxCtEqNiSVGgUkFAVPIBAFNNgXdcCnkAZTlBEEEwmbBjuYR8AAcBzAX8BQlwDuJBLCLOL/IU0Ii0EIf0BSGuCSIrImgQtOKSN8IpVGaEjo0DvNmTSQTiGx2kOCxfcBm3yIxqexNUqafLAuBwd8cB+QqQoXVXBACfcBmHCBowoHsHAfcAkXG3AA/AqnDXBiWZaiZAApFoEpgBEjDIP5nHUQ9gJFGAJ1ELh+DhIYRCGnAUUYAevuOioAWUVgxKC3EXQPg/lVm0IMAIEYf4hwBR5LLmkAOVjODpCc9yHRcbKOH3FQ46DJAcdGUgwBIJNexwwJAHVBZQg5UlnIYIkFO8NVBUaCVUVqaOhD7ZIBk9CZb9DSoNpBfOQvAAwVQACadWGLfRyLdwAIg/4CdAmD/ggDD4VIAREHi84AA8kz0maDfMgA8AiNTv4PlcKAPLBtNsiDjPAQUDm8MP1Q+MIJgBIa4D9Ql2CWgwSAQDegJpC1aB0QNSD9TweNzgBA+HozgUSw3jeYL5FZ5+TVEEgI7h5AGIRej5E/8HD4XZVBALEYPACcCSAMDxoiwI0mAXYEi1wIwugz/5RQJ7AIoL/oRHA19U9HIIyPzgqRL4ZZt/eSBOAwApIV4CkQi+4BkQBAlMkSTgRTUgGAxq0aX3HFfJexkgXlEV+HofIQdUq54B0AnTKJACN1Oh0CUYvWndIuBRKwjjSYb1l3VBbUbC4D1hOxzhMXgwMIOBHQsoiHcIVGXoaadGCOIusSrRLojM0M3YEozg/U5fxAagaSgYBQ3UJzEKFm01I2gqDyAwwACGpoxwapHeg76+AZ" & _ + "Px33A5o/sRg8iAQB8D+TnIiQiESQkohEAQzqP2JE4P6ThO4+IPFvx0Aj/3ZTCFSTRQ9BBBY3A8yThj6PoKpu6ENGBIo+aQAAyCEQWjOU45MLL7DYhQAwk2yWs/BAGAtaaTEcRbBT92A2CIAnAEA3cLReEJhhkAgR1EiwBAYAAHXhhcl0AUeSViNAOEgLjUHiPKCmJFASk+jTEuPREjE1B+WsAyUxhECgpVMCtXEk/OmEsOgkeAMIiUAIHDADPPNvliMRQGcDGk4MmQcBETt1Fr0HiRwBPADQSBQgsOiEkEhAoDAoTMADR40gBD+MgABQJ70+NmBZBBoVtBgEoUlkjkPFakEgBBYEQCA9ZGY8XEcyGHCQYwRDV6FqAwFG6SBgEBS1B1TCBLLeZM/DPHUe0FT3AF0SPbduTCgCIzAAdBAqBwGE0a1xEJAQEY/gYRCKPUih2IOIGj+VGEQTGxTIDjDo5xAzwFBQaCThWARAjQoOEaX2/28HxCo9EgxaD1HIFIozQPOfUoFQbpHcbNWHICwAhL0XjXRH/qpIoFJHoDMDfKWmiBToBkkz8SZNFAo0oKbiIRMTuP//xiURQGc9AE4EYDKUqPABEMfdEFUH60EbkRcPdBKLxx0HFzp0E0UHT0UnkisQUAIAAdBI89RoJICBBjYl3wQRLTPbWVRDHR0FWRMYgiMw6Ffir9IPUJdi8QH+CfEAKEb+DWGq1kOBsW4omxqukxoWlpATYAYAiwnC6cwX5g4zYx8tAMCQU4fg9/BPA3QbqGKUtVOHwFcXr94xOQUcRMFBGBxkxMEhg8QUcRXuCBIlFuVZIeYN8V+BLjEi+BGLVfxOF9VYxB9VkG0KBYRE60My1gVQxG9vAijrEVQC26+yg7xRAHyPfY/NXt0aShBQ9A8VFdXNoX4DQLjkU6BY9L+OYIkG6CpZAMnGRYM6/KaoBYY6BmbuGcD6DsC1rJ9BnBCE+hHIqJSNCkAJaJDdxZBdxIDL+gTMWfAJZQ0BFhF0KgOLwVeDfQze" + $sData &= "E5CDIMBSB6Hmsq41BTgALnUGaixfZokEOEKNBFGhKNpfwBpK5DUwjUgBO04IIHZGNlGgRtBIBKBsEUCGAKNZbsIC+N5HkANgRGDnsOiwyAAQmMhwCLRjRAAjJy+FRAkAWY1MAAoCiT6JLhzhoIMEiQQUgf9GBEJOFTXDAIxTBOG8FOpIc2yAx1amoCUAHk4g4QSJRjSsAjpwpd8BjdZJ4blCCIsEXQyDZQgSH4DxIGBbRDFYRoECOIAogDGVaMST2AXuNAACBuI7BfyJVRiNIgRT5kPCV+fQx5CIgNBINCXdAgjrZACD+Qp0BWaFyTB1WnkC4QoI6Mfk0M4IIzgS3uYMkFgEsY5AMFgGIYkhTRDoNSAVlhiDAmkoQoESOFYW1SrGKaGDEotFGAX/RRSNRGovwaCYBEBCDQE7VfwPhnPP+hTgLEIUABZM1SthwyI2InKrwWTy9QAaTLqVB2HBFCUznYoUMeinLwB2A6bHADQeCmLxXwEBJzhwICwE/z4VFLpY4ZRA6kugrSAuLHGHAbGuoW4CDi4Ci85RHSTg4JJOZizw5+CCxg4uQu7QQrAiyQEXHCI38V+31KDDgusnPQbwTijh0GLNNYIOLea11YoQcWPV51Jp9gL9GSpJ8R/tCp3eOKztAYoe4YkBACBSUvBdW/xLHdhJ/x/Y9L/CXdZYC/8f4PDfQP8MjAIAOEF/gY5CkFjF/92GnwF/EIWfAcqXAdRdhJ8BvzAyA2wbAzhdDBkOuQ34DU6yMZvgoM0QxS0QV4kwXjilDZIeAKJGgb4jFS7scdEcohYBFcPV7WdevmJ6Uq5fy7nh+vUBbg0B0fB/g4YRE6CbcREiI4LGLeMAGl6DoesUg348AAB0E4sHiUZA4xEdeToNC9z/N3UAjRqTKitVl+w+IuvE9ljkPgIA7EyD4gFWdQaE/iNBhxKY3wZRBzIrIIUTNgxhHRBAGIYCIFEFMA8wzlbSPJCDxVMHkLCzzAexgwRR0LdgtjOtUUIKAhwCku4AGlAMixSK" & _ + "gP0Ai0kIAwqJVQTYi9GB4gIiAJgI0ASdV6A0qOwPJ4QLjkKCG/9ACI0AQf+ZK8KL8Fck0f7iF7JorH4xddyH3gUj/v3/b8YEyhfDNqpgkwwmDGAPAAsm+KpgAAG2l2DCD/YAfoBgsFgHnVhE3ghi5O8zAsQUiX3UEYlF4DYw4TiQ0C8BAl5SIZFXgDSITOAP9EAYbucEi00A2Dk5dWKLdeCNtiJxMGBvkAF2JBHPBhj/dPCuDiR3FAeLRGDwlkegYgH8i/PB5gwEjTwGGhWQeTFQx0YeTiB6MNhKClA+UQQuQQeD1DQQjS8aFQEI6yvoZYEGi8iLDsYrReBcoicGBk/ADix+MIEA66aLCQPABo1EwfBQNQCiQ7EI0QS/CAh17I1ESEieFoCjQgkPhRe0xhfRpFcBwhYRYEEhi1UA8FlZaipZD7dIwGYScHWVBWCWqBDszkTFAU30DQBAKjkhRYAIBh4pgI8gQwVmAIN97ACJTfAPIIQEISPsZoP5EQB1N2oB6DPe/0n/vkoAkBUCQNfgBAKg/gRB2pSw/qAWoUYDYNUXkAahqJwETewEiAHpZiU2O5G/cFRn6gHo9t3wKHEA8FLE2+CQfi/iEgQL/Ifz8GvGBVDBDgJ1IgxqAui67BkO9dEhGA6AoyawbsIJEip1OZwgyfkC4YEREC1qEoFwZq5y0SWQmBhWNJEJQIA+hf8CXZkQFDdqE5kgAx0DBOhRK5wvoMkZD2oDmXDQlTCRcAyRABDo7tz0jgBQaJN20f/A3mWULsZlwikURmEQlEACFQ8rhLYkQxAOIssO4eBU1+EwBOFw2eEARewo2RjhUAXwgIBeVwn/Ah4e8FIAf93wctQNbx51YF0H5jRRqcGxrqKmQQesZSEAE4uBISBqAVaJdezqBTKwfnBcxI6iKgD+BXAQAIDuv21vEl0JViJhCgRWNiJQx24jUs1SHyh1U5XwISyVMAIA6GeYlRBdAIvw0KCREmFQFAh1SmEQBQEA6yWxVcAQVWBJMAW+MEEA" & _ + "wXygZyZFzI1FzGZlIagWAjyY6YQpPSAaGA+Eu6UMkRsldRWwWQQe5QBZVHUcahQi6y9sYVInxAYCx2yEBll0FclE3gnRdRKQGEWw3qRWEXwoay0V7I4r4gED6zEhEAkYD4V9vQDxBrXa/1//ViaQEAqinwJxOAkCVnEQZ+CTUg480RyQyJNpswQEiQSZ6YvZAWg0teIIOlYBkEr/wRNk1tIRIBxkjyC5Bmoe62dEgEYFVA06Vw0vwhRodpvtHWgcCvGhIAD2AeHnI5kFd6PhApjiJZBIgxkuUhGxBVURWlQRUnNfwYUOhQCY3m5CkNUIEAiQvkuCrHwQPgZSRC9REDxYdAcEagjrD24GYGgQsgVw8HBLEAzloTLQYE8AIFm5oiqyE/xAeM3q/ARm8oFAKP8UMREPhUDLujyCkNjEPogfsVCXIttAD7cH0gUQ3xdVLuE7QOIrgJDuVydgMIgfUYdC+wpqBYHICGsFdR6ID9Dv0e1li1gEiC/gBxDZiKYJB67lSgGA+QBZGulijKXIuLDBEndIoIkAVoP4Azx1fhk37fECNBAmgaBYUMSenneSAyHhCQTFEmnhrgHs6UtIMuGIFELsIXMEdQjbcPCrCicFMMMJIxVGRYCPQPFQmB9JUcSeyZgYVPBQ6FoVsgLQ3QWEnhGfUNFdhB4V5dwnYKgC6PiJEk1BZDtSHXyQFiRAtk9kN0G2TXtkUYWSH0OmpmSh2iIzQLbSzFdRNUExUkeCB+jI1vISUETQYMWwThEjL9C2QRO2ATFIgmmJAdBDM/8A/03gg33g/w8Qj/32fhNQhJ3YFwat3xhNAzk4dGb+GmDpFSEYU2UKasooYakBdUj0xltQRy5uFnX4UzHoUTUDKkSAewIobAFfDcIW4EsSeinCGqRsiQEF/0gIi8akQ2CeEUDUnmgyYL/IBY8/8HBLBA8/Fb3TCkDevCB4Bt42kpXlSAMcdUREXn/RWATOANBQX1MuG9AlcQPVDRZeoZUIvYAY/3XcxSA5IeuHORJ9" + $sData &= "0HQqAMBRYSoRgwR9HB50BxjxUTfh8HBr/QdF1GwhJxQgRbR6HpTjx0MHI7DoPLONHtIIsKNxXBcjZiWN8AMv8RIBwaIyIHwBi14Y6FICLQAQDC6w2Mfd2IRCG1UWc+WLA/914FJQPl+Ap7MSZcixAMSBTl9wpMaQ2Ees2lZdGOZ2Aa/aVkZN4JkoFDQAMLOd2AWe08Ut8eCo6rcEM/ZaLtAIQ2SgvBlyGEO/2AQe6QwASKk2FvFAyGwGAEo1KHKLjApRrDFFAwXlBwDqFmamygeEgficoBEDmQoifqHfBPgQDwyUwgvKbkOgUAZMDhAIigliIIDIZIGhkZ7hEj9hFwAdmhpBxGbggASiT1ApUAmab2CWWEDkgJH+gTgCqoQhiChmiwDr4UQg4UPnTgHxClykBifIORBCV04BDA+F440twOkAkFCEkdiE/cBzm1AflR7FBPEKHnVkYxEAYgVC5EAVi0AACFNTav9QU1MWiUXYypCjZeAAHh9oxzQtgCDMif0HxgmBPdU05UUGddBCiKVdBNBVEcfyJdMWMoj/oasHnaCeZQIIHOkNLAAAqQD+JmagWwINMx1BZIISuQpVJhiJ+QOLQE0LyRIcsclSFDVzkEewno0GdBU1I0UPgJRtYRPZXFUGuWMFaNaNFt1oyOVhmgRFuQHNw7CSPiadFcAIH4xf8E/HCMuzjIMgtxixtetoXCAvAWBF5jdAAiV1F2oDxB1JFWDpEi34YlJHR+C7Ae0W9hFworIVVRgnagkuC8BkEUqQhqJhCebZMrUQkjpQxC8cGSKhU/REzmLp4GECcJAJ0PSQgoSvkxFcNRAIWbkWpEUwANX2CYDR1fYa6zi3JhnBEQgTB/LvAgmkVDEydqFCALUM/zSIEX3uHQH2L+8ATihgDLFTxO3xwLilwhnGA6GsA4kd9yVFHD0ddCYxGBUxCAsBi0W8LJApIRmlCgRQDOm6L+Jxks417AIAfgFA7VGHVY7TKUMNHJkizJliHJmCmdC3mSIcdhNQKcFc" & _ + "KeGhQRUAYFaZABJDU4eQte6CmAfxUacRphXwXzfEGykXhLDeoDIg7RHmWn3iNSAxFf91dgFg7CdFE/CNfnZkUAfi6Ac2cuR10DHkJBEVtOM88AW2MrDFqlsDJCAA5EADSiOw/SzoKjQHi8jpqdo0MPMCPGxPBsVUaM0VVKAqA6BgwApGCIvIXelmt2TivXroDYoD0A6A/iTYjZCV5YBEekPSU1AV8W8jJv5UZJswsl9C+gI6YUFqXDjsQBZcpIaEztETpLACrz0QyBURZV4kYX8DVUCUsGLvTDkXlEFBGSkQvazxaRoUrGLqNiI5kAxL++JwIZIT4nDjBzfmRkNBArZGNE4CCkeRF2CFDqVsAY6oRWRVWAAxY68qGP8VQhjdFfg7/nWOrLAO9dMTYJYIkVPHUEcgsWNMRyKYBwFW19YO0R1BQQQSPCDRCD0SdFaFIRY2EApAYbQAi8aNSlo2yM4g7BNurcGgZgTzxQF5ECpUEidRAQElAQ7AsQVmR7IOPlhGDxCwiGDVWEUvFXXyLcwBYMCgWQTCVMAo6gABIiH33iJUAD1SRJ97cCwMNbHQMsDrNgKAC5ESs8gAkQFBT4X2Bj/g9VMIgX0Ircp1UAcTiNDH8O4LAidWagz1/xUkIiCRJtBYFIAApSaChkClbyJvIFSAARxeZGP/WuJeo+969pUwPEdC/RwMEBEmgJYEoHsTFSjWDoEu4OoqgPEMCAh0BWoKWIIWtTBjn1MDLe0HdkYetRM0tUgs4K10ESRGO3QiJy4yIV5dAsNmiwR1AESwDjRvDkSLBo1NCFEnaFCiYWD1LyESdnQQFhGwCP8fBbL+gUddQHg2gSd6kgAYFNIngobQBVBiAuNpGDldDA11EFe+5mKhWwulALDxtV6hTRE5JvRqESRzFun1ACoV0TlAEFPyQKhbGK5IhO/sQcdIQBjqlEIQ8uBosBhqBGiIYiSgo0bQhxA4KWEZlwkgCM6qE5FoU7eRbKHNOzFYCPAiTtBOYkgEAlLAANBYtYXf" & _ + "gsDvIhlcgRFx2FmGsDNfB12I0lgFbyDVWAUuJVgGeQC8AIt18DldEHVeyeESLm6w3pq2sLSscTQ1n1P6T9C0VJkUwG+kOVF1xr0A0BLQWERvlCEcagFT2RKNDCEzhWTIjgtgLgDoUDIaQp+1HtXZ76EcBfJAaAQHcVOCBRDekMaUfkUjJCZCg5YsYHU1sw0HFXsILQBhAT5201NE3VPhlgba9hfRTciqCRiRhL+RNJTxkfQGJoIhAAABAVbonokB3NYYYE4a/ToXULYg5ALoSoKtAVaL+OhCHKCGRGR3Ceg4JLAIrzYFYdcSLCwwSCw4A7aYEEcedqC6Bd4f8V/B5AgQITVIOiwzhPb/p0wmpDECREiABtoTcPVPZs0LFIBGTTPrKByNRdQNABLBEIdEuOGo9ifppDiCWuKRIL4ugVaETTyLdeixDuwFBO8AYCgAeACEB3JC4KgwkmYVkJWV04VA5+cIAohaflCAi6spCmoKMwjSWffxmpCQ2IURKMAAO8N2TL8D9QOCyRj/Nv8VPPYe0ceBUGeTN6NqEIFjdSFYaupDgOPqIKprgLFTJMEhdwwbCVPoQUMIFjaLPTAccf1/Ykfg1gld8KEBMSFKTwSRlS5aJYDThVGX1uBGEFoFAI8L6wkoIsRiWDD7D4T+AsaAZkefK6LoJvEADCjgwhXpIC82uQFN9FFoMIJJF03EUf/QsQThKjP2VRBCfgMikANCpptR8xKKEEHg2gloQFNQoCbgtZ5BZWzVEEDwpgRgP2juP2iM6mQB9I0b+I0L1FJTwWYFYRIAdTvzdGNNLBSNVRjlC1Feu1CXBODkRFfgRMexrkSjCRZwFH4VoCFGDFHGHKAiAv8VcKYPQvYCdP7GGKSUC20dOlVQ2xYPABLpL0E35iQwL1IFaC59AGEs8XkG9ipQLWGWBfjrQokMKpPH3T0sdRz45V0crWSQR0YS4Sz2DIJvpTA02FdSX2ClIMNmoIIBABRl1AtLRVJORUwAMzIuZGxsAGwBc3RyY3B5" + $sData &= "VyACwFbmdgVwVEYHACX3NhZERiYHUDY3B3CVRlYGMIQWJkf11lQHwEaXJpRHVwYAYCRXVsaUJiaXECaXB0BlVG+oRQDA9BZGxkdFeABXAEZsdXNoRgBpbGVCdWZmZUNyTQByaXRlQBELETBFR4YU5kYGAwBDb21wYXJlUwJ0cmluZ1cVkFcCAENsb3NlnEQFUCbXluYWRlcW3BnRGDHFVlYG1wIRUISXRjf0RgZmGENyZZiXJtL0RhZSx9YO4hTWVpYtQzEWRscmQlEAcnkQVHlwXIBUFgYXnCkBIkFsbG9jYVPEJQBMAQBAWa3wxoZUFkI09NYbCJCUREBkJPfWliIDMBTDNMUz/HCWRMQKAEluaXRpYWxpR3rVElVuaTjIWuwV9JYRUeVWN1dWB0SQVjZXhFcTIVUH5EYOZ09iamVjDnRUYWIJFMEieRJNAm9uaWtlcvxAJRA2t9ZU1lYjMgT0RjhJbnN0YW4EY2UAAERGAfDEhFAUVEUVIhRQEAAQcAsQMAoQoAsQEKALELAbEAAgCRBABRCAAAAQkAAQIAAQoAQAEJABEDABEADwABCgARAQAQAQgAEQcAEQwAAAEHAAENAHEABoNQsKAAEzAAESAAEBRwABPQABQIj4EBBgAxBQARZgEQgifTKFxHQVRAOV1AzSKkDVNEBnA0XTewGgiBCLeAQLAP9QdDWLUAiLADAD8Cvyi96LAkgQK8t0I6pdMAAgP+C/ArwivQAAzRosfgCNLgdgvwC9IE2HMACgnbKwcy9Hji5wuQMAgFWgWg0AgPARAGQQAMSAFTAAoABc99ZiKwoAAIA4TXVli3gAPAP4K8Bmi0cAFAP4g8c/6NbA1FC3BYAeyAMAILAATOeDPo8FVgJpcnR1YWwBBnTRsQQGbnBINyBQVHZRIIB3tYj9D40DEACwYIgHiEcoWBBQVFBU8D+NtQji32rTBXQ9A/hWgUUgi9isCsCw6kEA8V9nTwJ04TwgAnYETlbrCSEBrRhOxgbCJtAGsioDDMwI" & _ + "hFBnv36NfkZIBF+Bx+7yAwCbDqGK6+FlAKth6RSiujjg4jEaJTdG1QMlYDsUAPD/mgO1EQAQZwYmABCuEhpHwABgqAwwyACmDPAF8AUAQAZQBmAGECYAUAfABkDHA1+IkgHwBeBEBXcARSwAblzQph0gZCEGcCEHkEYMZ3RAOlwTBccPcgzQBjDHpUZlVCAH8MYAXVBfvCxQRgm1kA1QpAEHYDfWAWA8AWzq1gbSDDfUykhBzHBGIfUQeWwC4jHRK8PqAQAhBsgCBScAEFwfABoQ4RRqu1AgoNYBMHbdDgAQQzUhYTTg2AAAQBTUJkAG0EQDdABWaDUBZEwGVRdUJEFXXQrCNUQ1InRUUFcFot4qwVb1c1KU0MYGdt0cUAfR1hFQAgEQflIHJNhSbyATAgARwgCJVCTNNTosIMQAJiK+/TVw9SBlUwBXFQMwd7U0ClAPwLNj5SBj1QAZAAB47QP9E9ou/XNB/izw9QIAMUYOGGkAOszEciAAL6rNAnX9IkkUMNMugHdcBMIUZQBTJFB+0RrRAwLgVQcAQBHcMcUEvPUXdCTQNNE4URZBxBbEZk8BQ2xhc3PuFAPIBExvbC4gWW8AdSBmb3VuZCAAdGhlIGVhc3QAZXItZWdnLiB7DZrTUBDQaNubkdYr0JjRRkcFTodxV5wIEGREoFteQdZD5mcDNQNvBQZnu0yaRgRlFUQFQAktsH1shao8UQHdFFEBi9YPsOZWi8ISYSzC1pTEWOrNlT2WJIXWDUzWDVDHTQ0dUGYlIQ0THXI2AOvaL9ATRjN2NSJpFSGs8c82HXIAwV8A0TnXQdkY4U1SjDHXw1JpARA0KaZLAm/lKCzX1OHGI3m2bW1ulSAsA+D4DwAB3E8zQhXGU4K9ARA8pQBEgDwFOFL9d+C0AQDh2oIAsOJyTGzGEgD/74gQAbBAAAIAVBIEMEEgAwTAAEBBAVDhKQQFPOABgPdhmQVsRxA0MwGQME0AAEFgLAX4VYZjwABV3AwAzQDADEDLAFWoDMDJ" & _ + "AJAMQMgAVXwMwMYAYAwAxQBVRAxAwwAkDMDBAFUQDEDAAPzGZsDOAFXgDADNALwMwMoAVZwMgMgAdAwAxgBXUAzAwwAsDGAwMgD/n+EBEEThAOIwYMEDQOghA0QE4sEAMACFZQSpREICIKKqM6BmNgAKMIDDAeUhoQQK4IE0YEknJAYGoOKsxSElo2INwINCggKnoQcPSCNeMgUuDMROAAwD6HAcQBRmIEQ6AAA0oG4HBAREEvgFgpCqxAADAkYDFAM0agADIiAm4gOoRAAsSFZYWFZYAwCgOlIDVG46HggDfHp8COAIJwqAh18gykMhpwKgaAso7KxkIQmgh8WDhMTjIgQg42Cuq8SD5AGgxOOCRSQjzwEAxGFk5ISkwwEgzzHgx1HA5QvAwsHBIzZgJwsgNkCFxMiI4QtABcSDb6VCIQFgQ3FgIqwCCwng4eAgqYNBQgKA4kPmwmLiAQIAgkIyIGChggnCocICxAwmChwAJDYKNJJEMhAAXhYeDhYcQCICLLQ0JVYIADKQBctBcByDQzOIHPMP8AlScP/f2AD//4tF2Il90MdF4AQAAAA5OHRmi8joZRUAAIsYU2oI62r/dQyLdQj/dfSLzv915P91/P91+FPoURgAAP9OCLgngAKA6Q0wAAC+J4ACgP91DItNCP919P915P91/P91+FMAAAAAlYvVTQAAAAB4kAAAAQAAABQAAAAUAAAAKJAAAImQAAApkgAAqkAAAIBAAADCQAAAokMAACZFAABKQAAANEAAAB5AAAB1QQAA2kAAAABBAADBQgAA0UIAAGdAAACBQgAA2EEAAJhAAADhQgAAR0IAACxBAABBdXRvSXRPYmplY3QuZGxsANmQAADhkAAA65AAAPeQAAAQkQAAK5EAAD2RAABQkQAAaJEAAHyRAACQkQAAppEAALWRAADFkQAA0JEAAOCRAADvkQAA/JEAAAeSAAAYkgAAQWRkRW51bQBBZGRNZXRob2QAQWRkUHJvcGVydHkAQXV0b0l0T2Jq" + $sData &= "ZWN0Q3JlYXRlT2JqZWN0AEF1dG9JdE9iamVjdENyZWF0ZU9iamVjdEV4AENsb25lQXV0b0l0T2JqZWN0AENyZWF0ZUF1dG9JdE9iamVjdABDcmVhdGVBdXRvSXRPYmplY3RDbGFzcwBDcmVhdGVEbGxDYWxsT2JqZWN0AENyZWF0ZVdyYXBwZXJPYmplY3QAQ3JlYXRlV3JhcHBlck9iamVjdEV4AElVbmtub3duQWRkUmVmAElVbmtub3duUmVsZWFzZQBJbml0aWFsaXplAE1lbW9yeUNhbGxFbnRyeQBSZWdpc3Rlck9iamVjdABSZW1vdmVNZW1iZXIAUmV0dXJuVGhpcwBVblJlZ2lzdGVyT2JqZWN0AFdyYXBwZXJBZGRNZXRob2QAAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATAAAAALiSAAAAAAAAAAAAAAyTAAC4kgAAxJIAAAAAAAAAAAAAGZMAAMSSAADMkgAAAAAAAAAAAAAykwAAzJIAANSSAAAAAAAAAAAAAD+TAADUkgAAAAAAAAAAAAAAAAAAAAAAAAAAAADokgAA+5IAAAAAAAAjkwAAAAAAAAUBAIAAAAAAS5MAAAAAAAAAAAAAAAAAAAAAAAAAAEdldE1vZHVsZUhhbmRsZUEAAABHZXRQcm9jQWRkcmVzcwBLRVJORUwzMi5ETEwAb2xlMzIuZGxsAAAAQ29Jbml0aWFsaXplAE9MRUFVVDMyLmRsbABTSExXQVBJLmRsbAAAAFN0clRvSW50NjRFeFcAYOgAAAAAWAWfAgAAizAD8CvAi/5mrcHgDIvIUK0ryAPxi8hXUUmKRDkGiAQxdfaL1ovP6FwAAABeWivAiQQytBAr0CvJO8pzJovZrEEk/jzodfJDg8EErQvAeAY7wnPl6wYDw3jfA8Irw4lG/OvW6AAAAABfgceM////sOmquJsCAACr6AAAAABYBRwCAADpDAIAAFWL7IPsFIoCVjP2Rjl1CIlN" & _ + "8IgBiXX4xkX/AA+G4wEAAFNXgH3/AIoMMnQMikQyAcDpBMDgBArIRoNl9ACITf4PtkX/i30IK/g79w+DoAEAAITJD4kXAQAAgH3/AIscMnQDwesEgeP//w8ARoF9+IEIAACL+3Mg0e/2wwF0FIHn/wcAAAPwgceBAAAAgHX/AetLg+d/60WD4wPB7wKD6wB0N0t0J0t0FUt1MoHn//8DAI10MAGBx0FEAADrz4Hn/z8AAIHHQQQAAEbrEYHn/wMAAAPwg8dB67OD5z9HgH3/AHQJD7ccMsHrBOsMM9tmixwygeP/DwAAD7ZF/4B1/wED8IvDg+APg/gPdAWNWAPrOEaB+/8PAAB0CMHrBIPDEusngH3/AHQNiwQywegEJf//AADrBA+3BDJGjZgRAQAARoH7EAEBAHRfi0X4K8eF23RCi33wA8eJXeyLXfiKCP9F+ED/TeyIDB9174pN/uskgH3/AA+2HDJ0DQ+2RDIBwesEweAEC9iLffiLRfD/RfiIHDhG/0X00OGDffQIiE3+D4ya/v//60kzwDhF/3QTikQy/MZF/wAl/AAAAMHgBUbrDGaLRDL7JcAPAADR4IPhfwPIjUQJCIXAdBaLDDKLXfiLffCDRfgEg8YESIkMH3XqD7ZF/4tNCCvIO/EPgiH+//9fW4tF+F7JwgQA6Vm1//8Aev//YgEAAAAQAAAAgAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" & _ + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAQAAAAGAAAgAAAAAAAAAAAAAAAAAAAAQABAAAAMAAAgAAAAAAAAAAAAAAAAAAAAQAJBAAASAAAAFigAAAYAwAAAAAAAAAAAAAYAzQAAABWAFMAXwBWAEUAUgBTAEkATwBOAF8ASQBOAEYATwAAAAAAvQTv/gAAAQACAAEAAgAIAAIAAQACAAgAAAAAAAAAAAAEAAAAAgAAAAAAAAAAAAAAAAAAAHYCAAABAFMAdAByAGkAbgBnAEYAaQBsAGUASQBuAGYAbwAAAFICAAABADAANAAwADkAMAA0AEIAMAAAADAACAABAEYAaQBsAGUAVgBlAHIAcwBpAG8AbgAAAAAAMQAuADIALgA4AC4AMgAAADQACAABAFAAcgBvAGQAdQBjAHQAVgBlAHIAcwBpAG8AbgAAADEALgAyAC4AOAAuADIAAAB6ACkAAQBGAGkAbABlAEQAZQBzAGMAcgBpAHAAdABpAG8AbgAAAAAAUAByAG8AdgBpAGQAZQBzACAAbwBiAGoAZQBjAHQAIABmAHUAbgBjAHQAaQBvAG4AYQBsAGkAdAB5ACAAZgBvAHIAIABBAHUAdABvAEkAdAAAAAAAOgANAAEAUAByAG8AZAB1AGMAdABOAGEAbQBlAAAAAABBAHUAdABvAEkAdABPAGIA" + $sData &= "agBlAGMAdAAAAAAAWAAaAAEATABlAGcAYQBsAEMAbwBwAHkAcgBpAGcAaAB0AAAAKABDACkAIABUAGgAZQAgAEEAdQB0AG8ASQB0AE8AYgBqAGUAYwB0AC0AVABlAGEAbQAAAEoAEQABAE8AcgBpAGcAaQBuAGEAbABGAGkAbABlAG4AYQBtAGUAAABBAHUAdABvAEkAdABPAGIAagBlAGMAdAAuAGQAbABsAAAAAAB6ACMAAQBUAGgAZQAgAEEAdQB0AG8ASQB0AE8AYgBqAGUAYwB0AC0AVABlAGEAbQAAAAAAbQBvAG4AbwBjAGUAcgBlAHMALAAgAHQAcgBhAG4AYwBlAHgAeAAsACAASwBpAHAALAAgAFAAcgBvAGcAQQBuAGQAeQAAAAAARAAAAAEAVgBhAHIARgBpAGwAZQBJAG4AZgBvAAAAAAAkAAQAAABUAHIAYQBuAHMAbABhAHQAaQBvAG4AAAAAAAkEsAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + Return __Au3Obj_Mem_Base64Decode($sData) +EndFunc ;==>__Au3Obj_Mem_BinDll + +Func __Au3Obj_Mem_BinDll_X64() + Local $sData = "TVpAAAEAAAACAAAA//8AALgAAAAAAAAACgAAAAAAAAAOH7oOALQJzSG4AUzNIVdpbjY0IC5ETEwuDQokQAAAAFBFAABkhgMApIvVTQAAAAAAAAAA8AAiIgsCCgAASgAAACAAAAAAAACLwwAAABAAAAAAAIABAAAAABAAAAACAAAFAAIAAAAAAAUAAgAAAAAAAOAAAAACAAAAAAAAAgAAAQAAEAAAAAAAACAAAAAAAAAAABAAAAAAAAAQAAAAAAAAAAAAABAAAAAAwAAAWAIAAFjCAAA4AQAAANAAAHADAAAAkAAAuAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8wgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC5NUFJFU1MxALAAAAAQAAAAKgAAAAIAAAAAAAAAAAAAAAAAAOAAAOAuTVBSRVNTMpUOAAAAwAAAABAAAAAsAAAAAAAAAAAAAAAAAADgAADgLnJzcmMAAABwAwAAANAAAAAEAAAAPAAAAAAAAAAAAAAAAAAAQAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdjIuMTcLAOApAAAAAQAgFf9LwNUagdOS+vXucGtQtg9DS6IQmf+s8pSAof/lzpNbvs5vGDaqkwL0lyayt6KDCqSJQ4o1tatkkGwANofdA4t1w8Ib1+wlEQkEKJCbSipLHHBKr6/Y6mEy+GC/8kjnyRwAZHJdcZTrXuvURTMyEd7xL18vaaxPaKpIVxEN6R1ewTtehzTryXuW5aYS9U2CkNUeS5HPgAZi3C2Dw+FhvjaiZrlQ1oVO3mVxsRfsYRkDLQJHWOoCQDSFK0iJc+hkrvg9EKsx/Rh204M2EBtV4vIh2EB8j1HCY/e0lUmRXtqzblX1lAX+FLwRWycOh1iPPU/ST+jE" & _ + "4av+V/Bfw4egyu5QXFd/C0BzI0KuqclmBNs+gKC15g5R8Q4KN0a6VBjXCWzdY68PGquCwoDBdX1hKMk0t5rJOEcUsj4a3PfiXUrStDAev4XnYPX0cEIUm1x12xEZjyAt4S72+v5Hlgfu1CcYLPoXaKf2blru95fnkt5Q0aQPUohkA/Cih9g3rGU19LFzxem68pJtoJxTY72YWjGcOtbYSFHU/P02tTE8lK+BG+bMPfEppQr+CB122EJ496aVhNw/nVlQSuvpwlIamoIgF/KAmcVCstzT41+LCbwMqbLJJzi4IPuOkLmpiKRYHZfKn87JmUnuO5CSH2CKODE4t0RH6xY2KUnQlM9Iy2x+K0T0HVkqlFJAacrC2ebUelKXoL/OzMMsGkA3S1TWnDwCp3UqTpuvgOCmzJqbCHZ4IbqgrF7QBrCw94U9pOQBZIzbsHom0NpAhB+3SojF8YxewirrYDgQFLYXUwiRm+9qyilPcEFn1ptxME9WXBcxCkxqbvqSvt7Hpr+FCgrqNItPuTfZb0kWsVf3zxgkNxoJUt38BfR+v2GM9P7UuP1NRlg0MwGBhinv/atRz5sdVUK/iCj7SuwVDDPKRiTAqyURAE7ZLLtTPFvK7oj+Fp+vyBFjeDQVU7EuES37VB7C5vML5xxBDPQDxdyCX42LeUiqqk4qnmsI1/8ek6y166AtZlr+Ja94gjustQV/RpJh1nf/ZiJ+SwKrpktO+NgLvs/vAnqtnwBB/1rh/qrOdGTpAYTOq8t0gLw3gUZhtX4NAjk5d6TNK9baalO9o2dWBA8pxyeEarp7J78xk66o0j4FF0Z/93MEMrTBxX6D1UjInCpAAgAIOykfyZo+B9+RPFkbv9U9h81z7vYBISis/TtlcdPo7qU8O/F74iOaMOKzg0qBqj2k6V4RqJi9COy/3+rX+pgTnX/NUfnm0oBrOp/gdEgl2cr7YzC9aL6YEp0SchIEL8FF4Ld1lXBSPOSzihcwkrAQ3n/hqKAVfipWmYPrcBWqELh1" & _ + "8W4+zhf9FnLVQoPDpgLsC88CXh8ppr86W0gTlCtfiOldcvgItCG7YIygWmhALdYWVrytuVwk7KUn/H2550+q2P5GOJUPFJQa/M1Hr2NJ1VK2ybNmETnUE6mK762HprF9RkI9SuBoG4qwxTK/NanKYARLkKncCPORFBusAgkhuvkf5AvED/LIIGovVsrymjDmPDOUOUrL5UmQ2xP3fXh5rNGY5eCaCzTw3mNwbHyrrRZR4pLWWXE1BHUXzdVclaX8eVkYo3kdILj9Clhh4uBaK5XDXTeMroHOlJ0yeUNeQb7MOH68G0F5L6jtng+uYKO5gQIWpbbVjKTs9e/i8xL+QPgG9KwLvUGfHUmBcU9NKDddN4eJKQ7NGX3Ltv1oBZRSSWfwcPplgzNjDNtkmWsxx5niAddn8BY+iTku2pwZsmcY7V82whgLdj0gKZu/lrDYDKOOkb62/QJ5XiQYZxPdyO4tDeWWRsoEMht4QkJ8rAdzrxoRf8xyhit7/buTTP4sERpW1P0VNHstcmQ+1wFD7b1FC7WoFPXclfeSioefT2hWAO/Vouc+Q0hkY2gRkJSCRwLgOxdwQmBD8JaJ4mb3o/vsHyg/zvDyMyhLDHECO1MnBk8ltm3/AE+aNk/J0L7OCJOWTnTC8qOGEpDX0Vk1s6kqrdVai0pvF4GYiCUm5SBGTug8tryOqb9HmktJMvLWD2rOxDLeEU7WniBH2G/B2yE/gxmjbYUPI3cPAtV8GmG3KaRmErU8ScFbTqXlYOQfCLIQPKWvGbKOUSfm61WwyKzyHLWrCptIFOhud+YQKyBrZFDs0gA7H4YZuDwpT328DGNE5pBC8JgRG7+PNoUTOThbF/qeefqcb4uqpoMW2Egul8qfpCrywkTSqudrcvon4VuB7Lno1YP2Us08iAPGUxTi2+/dnWtK06V72GfTyLim3ANLUc0MquuRaSQsAYmZB9sMX7Yq5exJuy1IZIlgNjF99jpYHGqGDIEOZMllZnIMZQ0fDWSCSNwki/TyCgls" + $sData &= "VZu9oQarvrJ4CdrIUjoQNTMPhyAQd5RXyBOdbsnWGQYPQ9HQ/8WsNo7tmMV4Xk59whuiEKAzYoMjV/BpJ3rz0FWRxAZeU9fSGDCqoLqgMtbYH5WijE5OxcHBk20QpYkw3nniDJ0LB1ZDWUCkW/x50pkJCHflX3AaNCOL1x/dO8cDfvbrZOAs10Kggh+h8/hNvKCRcRMgPpZRQi8i+g//h2igsJ4QkR1PK5EciUrmWLhd7m240wiQdUkdpKydUW0IJvs5j3uuPul/ITq4pgNcg67Y2ILm2QrsgQC4STmZ9YjsV7D2RkFPds9kcsAa2bqyeRy5dQO00Nq7Z7fwWpG65Hg2acd4XKmXvQVhhayEbVaa+F82RoV7eLDMaLdpWctvgCgh5pp3fCrkGx9KFh8m3xat011VzIihSthdH1YMcGhbrkypaX15qMRbUUKG4a1ZvM9R374fJsl/zNGu/DTDiBLUFh0J1sqLTzJ7BPlNaYwwNzL9Z9MC05E0nIFkASIw3OTPphGPj89erNxCAg5xKHc+C2s9VRrG5TbjiZRh0mXhrIITdorKKl+3HmUky62oq5RUO7IqNWMEYfIfhZMIPrfK0oaB5MbSzQsUMMyy6D4uGZIinG8QQqkHxNXYsl2Xqs3jok5ikYomJIul0g41PYCm5n4znrkoHArlk4DDuwJHMsiWbAcwLT2dAnMUiFc4erQYxyGys785ox5ICE6XcVD37eDst2ZbrtxkWaN/lHZUwmQ50nx1SEor/l0sw/mEg7dnnbbNsop+xRjyriNDinKBtiqI5Z+UNp2T1T+1pATYWpYZdlG9Bh2eYt/KGtQazSAmcLcJ1upYHEE/fvflQFVKeqIwONpLGyorFVRMunw60QRBjRcH7+N/+1FKoG67l4ExFhpXT7zQSiymSL3TVr5j/JuCuRN5uB2BaJckm9rvlH2cHYxwd0QoEYa8rgsfOKIkLIaImaMv3lgP0ECjfl7qk676lOe9Gp2gYzDHdiweazDU97egGCU5hiVBnUuk" & _ + "3pPhFUW48xKuUD+KUW+4DYjqJEX31IUijM6kuN8jiMPGk1kQzHWgI3iWVU9Wc9OAON8+ZuC3pP7J1iJAm9hSAmpgPjbujpZw21Sm2nujNeYDe0ILNK3ily1Y7cU4IZe05L/w8NRpXoX7FulX4p1ODFBcNclzGBONPUGT2ybNM2iBG6BuOvG2QIHAZ8a8k2aUoxxw+3xFP658+HEVuBLZgaLKXAJ9YRWT/SKdwUmagrh5VGTxZuzQLSWajcq9UXuiYVpxUz9M1fU5mC++gZVf08iKzpR2P9LbCYpxTY2N0hpVe1apJS/9wNOSTA5uCzuMMyAMzhbHyyjkY3ThKcsW+Q7R2J0q37QN+WfV4/GTLhOgpLAzkDjHwr06DrkASqz5JyySia4HnrEYb+a63YCTJ2vnHr9l29sD/i3L2XH4ycVXumVsHF1T1fsg5zltrWR4NnHweNqt5t+M7XgYTquIc4qQdt63EPskkdzIW5n0/6Dsk0CCnJNVTCFfiNk3sd4o0TE5F1ImmaPVTtoCWRRKYDnJUVksQLKTgISTIOoZI7HS6Mt8eIEqY9EL6iZs63Gmb39sEulvc+HjECxMFysnIbqLvSuBFs2NciPAskvT6kVm7ZU+WdI8vBTWlZhWVHbmGddV9RaWvlIHrwmY13WJ5PlnFzqZU+0t0JpAtkr5oPqS1RDoUmRvQG1QlxD7PLmBWMPYsMyRlzWfRyWmf9bwRQjb7cyvi3n1P6groTeEQOb5MCdmQ/euG3QKt2ZW22RKLbhIg3+jh8XVK/96R94uhNDVba1EFPbnAuvRkSb57/8kWIegmytP+2eDH7/zRcNjvxt71L6L70hQt5qxw9x0i7B1rRTgNETksNi5jTnLjXvAn0YIy9+Oh3uXIdtmY8w+Ifmku1b5nGWidmhP7hRfTODWNUhSPC5UyfD9KesHgtuWcbYVyCNyp7J69xwhjmIakkK2QaoEApG/J9+7uMclP+bCC4K+98ma3czbuLfTqgK4SmQMe+GmnZ5QNcipe6Vd" & _ + "+qitKlCTzKt9Womv2fZ0+EhSOma9XV/O1HyS4xRDcjT8yXEUyY0RR4tEwYXfAmevJdMfHzD1lgLp4wSTI5MkeZr5blgMIlDVnUSchB4Pfp98w2DQT8XN4tmFrGBPFFKGROPudxFsJvXLQtEAc66EJcpO4GuI7txO+q9BORWZnn7uikYozG1bVe0ergtb/lN2BVbEmqOX51gmKSa8zjSTf/zK95U+OTdjw4G6GHlR5aScL9mqptjTEUHOjudRjAVOGAYhdmctDQMhPYeBYvwvcyEgG8wJDmcc/XielYoqhYaLOgYS8VSEUnr6F6dePTjlFRzuRe/NLFNMnSHGvqVog46LGu8BLS2n6lD70oVSZF4iaDKHDNFwKE9/eKAcGWzKfavGqMHBrArkVoSngm/ruFRzvixFbZL3LqNV4zwk1RM2DcPj/FO2vWItkRCdCt2JUG2DdA2djCMjlrSb+WDA7YoO6c31TqRMyOsAUomtNqCJLgCD26fXfB/1ZOkbs/UC6ahiQVws29AZhyhAFM7xNje3QgUIWOAiAgMTpXxsympXjPbQO0cv1x+XNdtHVXbsXJr56+alyF7quU4unpQWA8E1sw9CHTR7GUFezUsZz9LJM20NZEBqOzcUW0CgYrPUP12+2auqMzg9TjFY1xgjk4LaSj1QmoTSEy3+UcBeXa5aDY5095iuYSpIrFWB3QE1Kb6BtJm5RvKV+CDMBhX156cgOLmK4X7MnTfKw0eLWGOVBxBNJYUngL1GtqEc7sUQSL9Ifmj/HtTru0XdTZYNp3BEx7cnC9xlFs61ICgWxUa4ATqJnES8SyFYz6VfLXEWthIdm0It6rMjz8iXZuB2j9odsIMKMBGczm5fgU23mhCsTtLcA4NhUJGtZHp2ST5gAURfMAWRzLlaTTMWSv7D44rN/WimKS67MZQL9Sn/OF1BmhUZLcPmAr7rBF/rsqRI6qFhqxW5mAdWcRlQnQT4ug1XrKuzxbj/bZtS5KBhyOVQ2v0JJ2vB0c35wEweft6x" + $sData &= "IoiCVbFKKfuL/fhJCdavUNjEjrZTw1csjGqpmZpooI7CRRHG5FtjvyoZPGOSOTaVUBG6AJtumdArrjEHG75pQhydFOKkIgdMQFpEeCyrqP9eFMcXLmuLDsUzcReszulMWofMx7oGUmvJ1raFBIs3tV6sSyUnB6G9A2Kn7QbTQYySAWzyg8T64Nt9FWcucwZMogdEiNMMHv6Ymfj9TlDrgiDb99WNJU/a/XStZNI52CU5FpRqIc18r0fs9rcnB/OWy0e/KCLit6notvu6j1GEitlSBiHrMatqUWbyscgLLInks1I5EoWEl6UUsWtKzFRP6daWM+yTwjWbZEc+MK8tD3vwvsP3zIqxUm6m1xr9EdAnIUyNe6MMe/1/tTUgc6+qOQrNMU3Rn2eKCs2DrzJAWWhoshdcaS04FJyLb2gcfsx0hyfDVB2gCovqqIW5dd7nw3CeCA+0BUOQCdCsHOpKSyZ3KM7Z0EDy2MpdAZ24NYs5a4N3hBK2+iu6pzYgYQsaqeTgcqsBsZDbSAYYli3Zcn6lZtLifFf3Mr8OZVFwqMLCvMM1EU2CAWXRtjQRjl0woeE32jsfZEQWvWFYh+TsQWBulwDVeqr10N1f+2AP0vcgcE+bJCjE1NtIdSXx5eUbPyFItuiKj+RcvWLKo9t4AQFh0Yx661dyZ13aaznFS1xkB2oeaQwF4Y/FJDzu65ghvv0VgNPcxiZmkpnglJ0sNNuwsGWd/ULKhbe6OKUnQNR0CxqOXx1DFCcTRsin9ndXxt5DdetT5HwtNEVnyvbjcoOE2W5EU5t//AB9yXFtjGkHhEteam2mZF6JjFDqlnvcvCx3d1L0BiCv6hJHPBueA9fjRFvvWn2euU+5BEwu6j4wFDWvppIPcNvJPdjjkLeuXYn0HY78F3H2NQHMO5OmcHGroh2Qkf9SWmaZ1Qruqznysd+4Kg1t0Nue3OFSpsQlzOSzDCAdYf3JSmzFtwsZEs+L2fCjBRCjYfep+4yOLdqX8SBzmWMHLyt4QWfkcaOY" & _ + "7i8MgpIEcv7rqlPA4l5DG8v14aPE6G+MbctL1xbgVQoGOBvZWKG0KSFMFu6ScvNjeL9Hb1fJnSdJUNUbqY3vHPsVX2azEuWigsJTEzL2SnjlrkcmgR3RWv0QQiGCD5fjo9yJLcqU/NMtnn/kabSlPrmjmgVH8Rhgmkaa6gCM1trP6+zsehU1LArb2H6rb04XhOO0du3xFSb32KM2pestLIiT5i8Wekxv+6PmQT6OIFdi88RFBSYh4DPgM7SDJciEuABhkJ1tjB2hv36jZkbSVm7KeThPIcv3OeoULow7q+1qSR0v2GS1VbWIokl3x6x2xJIVKjXV2Fj6CO3VXP5tNuxbvrQ7PP9WST35LnXUlXx0ahQB2+zjci73gJkyOFhsFE3wPJomxRcwW2VA/blBMqAAsuf17ZXBrKBMBNG3gIVRlSTCPA3N3r8uJE+aFlvdYxFjhGqk0bkJ4zSqJrCd+sRxZWopdN5sjoeBAvIop021pasvOmwp07M0pYklrfLRg8ts10qX4FxGKgDMdppk2FdlibUHdQwToY7IPfViQ/CD48hIxhivolISsYNWI53Y0Vtd9TTnxWa2fdtUJikJ8H6Oaa5i+vkO614ICcpMU2ercCwFUTZzc5wCcfcv8bKptM/jflB6zS1g7iiFoX27Tnz01dSyhr4aqp6sdJ1wEb3AinNEzKYoBvxy80yXCD77e9J72/n2coEXUbLZVoJKVlMNB+rxOANzUCuK2M0efrFroILCITebdEGUZm7oViNvSqWyn96+Hs9TnzUbAy/kutLUqtkIUG3IEK75PMCxmYgnPMuTUQqdnLNS4zYOdGb+krWtPIGV4KoGIttbPk0ZZ7X8hET8lvdjSkKPrf+CLFw+hl0QGboIqBu8ReQYFTf2tLbYPtLqvAITe9nRZhijjVNL3cyPAccN93DNfPE4W3Whn5qYbddPSJhRdsHrdNzjqPnE76MtTXxaHGcPNnN1c8XlL6DxKGhPEOZjq5d0Bni0ZVAih8zFie0awRoaJ+0G" & _ + "7C0mLbG2iBKsd9Fsvn6z60TeZBDbgKEzfJR1938OXZvS5m+l2rOaLbQYVci8offDjVIS0EEWeUX9CFbNBoqKYkALSM0jGepwayKQDBmQ0iV3VijVNcvZa/2G1MpAbhyr/KbK6JLJZmUULRk8GwfYh53Xj1m+7Q5RvPQXEY7QshErUYPW69non3krtjohk4CnhajPSjVlcKYATVlLP1ft9AzxH+4nsep2zKwuXzmzRmq1Vdu3q2RZKAxT/k7vS66WLjmGBnq0+vvAKNC0hPvPus7SHUv9sfD+mWY5IUC3eYKIWFg0/iQNo0EUg6ISfyafZayYH56ZL2WvkOoUFFdmGYnSjuakCvEquvZWp927eh2F5Mir+qofEOpNmze07pAH5Ix/sIzYjLgbTl9VipdfCSJpK3B4b1wwux6mnIXpYHI7qmvmD7ZsuvFQeecD95L1INynJkbFJN6afu9WlfDxP23KGxEJf52eg9T3g0vUz3iRbLNN/MN3fNtwDhoP7IZ58UPBmrkYkcihaBpkNcwulnXVvPa9yYy8NgXQXcf8TD8bJUwSg6dFfdNZmfDssiiVXA5rnApB6awaTLYyyI5YrCH/i/ru6mE0T1VA69/VSclYLf7U1FKoZkpb0T3GNVEqNt0m6iG+mctKDeL0hjXtF9OgrLHH8asc8fb81dz46hfiSncQU3aT58Ih36n2KG4426gZ+w1WMluRNU2AoO4UwwDw7Avn71qmEDh+gvr5Wj+g6ix1ijtsd8uTwrt+fQ+8AZ+285HNfvZQwZcioG6LH5x9HkKqPcmYSHgm8ypaEY9w2POlh5yP2wevEpgJVhDpuNLIVVjkziS2ATbjZzer/aJCkGDdvGcx+Ft86SWeJeITxo06lHX2oAPFMSKp88y8/mVsUCWPODFIZst9N1Vxpw4k+E+RC+RJVHDveWvIT5HEPK5D4qmVM408On/tooDdjGJbbVACKYFHnONz4omnc5+S6uToRQTY6p3TnlI6hvDqhl+3g9Iqgo+6XmD3yXx8" + $sData &= "5JtBLMxxY0/qIh3v0/qcbUu2qAJaZ4vfc4tAp9nFq6VBvrZzm5OXw9pKywpgZeo2CpER6fF1D/tyVUJr5nl19OkURSnIuBiAfGJfJ7amMjq2sSLOkHEU5xjAzHyXr+aDWUTvnGt9RxMsVQsTzKhwEZkNuVovfq55FSBTkKCK2jCXDSnmMxJ4zKfHq4Q3z8zqNyldjbPgfBYzlaq/zpxsTLCd2huEZZSH+bLhD5TfKlL4k5hlLUmRnp/IUYaOVfTF12/ajWgE2nKICsyR5O+SPx451518U/kzSsevlh8Aj9xwa+PJjwZ8Ca3rECk30Xm8cIij8RDegArwuRcn4ZXhP6/3JtpaC9kjrE7H8C8a+8HFDdwf+0WbQu0RTMiKL7xroJf17giqsMCgiLjk2I12x93jGKg5HG6HO0HhCIn4IWI24zIfSk3VSDkHhv61NJU5Anxv+8YApS65UY22HQrUNvbSvglOxIPlFSCyubbGzkvGB9ArKKBYxhFep3qAo/Q5nAvtol158F53rBh8rwsAimiMWKMSU8EVLvEvCSW60C+2kgkU4qWIRo4uITTeLjffgixPxdPNEkcAbfoUyKAAzOIIOK3LbIIVVLp8hed0zez7GDJDf7lN7T4pY3jwoo/DIDl28bsAFnK2oLJR8myO2WRtAPvKDsz7uia1oVBOeUqLmIo3GdrLy39pzO5Vzwz+911nSFe0jP6oVkPcpEggIg7VATzW5lekq1+h/lv8bCYHn9rkV9aHnLqDRu1A6tzY3/PL/vnW/w8R1eImyQvIKGdoSY9X0vOt+9bYmy4nrT8iiYlhRV9sz4Aqa1N1SGJv10kXF5hhVgd2pH4g5da9qzEQ3irpy8uIGPshjTbPJDFSqnx81MQsEW8gokCaZmJ9oJtujleTqUyRO5rRiTdJs6W6Vbqe73pd6t6b3WIMVEDTGRWFo94ndzZL2U/o1Ihonc/KMIdXSbq5zoHpp1BENEo0T/G6+SQ4WhWsAVlCcX0iA2DomMgIoVTOKmiB/24i" & _ + "MPKAx0gNGe0b9haXcHHqRyq1lvRZGw91fF0PhAMUjLPqCcrkgPmY2G/qUwAkDOZHyqPUbcr6yvVXz1TxN8WDMhSZ09lnEaQ00ez0NfLhxNBWsv0rw//f2tiKWvDFML2y9nU0VGhYis5S4jBEfjXnj+MiPGfs5TzXp/W90MvAu7P3YfJ1qO3zXwoCRxp25YR10e7knUL775Q0E5MxN4k1Vu8rvD5A9eggX5YfefwA5Q44SYkgBASSQXLXt8gYoeCA8OK51c20j4Asy6+1ZSnntDZd272Wn+QTeVBDHRskA9ae6l+JlRwhrJM4I5KE2iu5jrQ6vRZaO6nYB2M0EXew8bRWfUvVihYrjIiWVR/RS8GgVQvffy+oM7XmNiq3dGM33G5UB93Mkd2x92+LUNbDalOlWafqI4ImtmIaNoqaM92yKmumzoyYQPz8wTnHuSUA0Oa1nHYTx9dHQogoRt/d/074zTIdoW4X6ZDAtY3DFeeew13xTw3keq0PRl0hS8ZIt83VRDZolZOYH/usijiEnqG+6M3XEsPpkaj+2K0coPs79BFVQOL1dlf16Nj3XrYFP3MstiAP6iFNGMRlySexee+GxM1Qa+cPcTFj2LmqO817qjKAyJR91pCxuc8SaoQG3dqYrRioVgKAHmTjGhLpTDu91b8b7fcCGiTxz5Dyk5mmVSoOsPCrPCE/QSTLxkMm1yNvfyJAXHlRL7dUaBxU23IRPvxKf2ZbR0Lho2GYTKdBmpsmMVmpUK7bmX8AtSDgGXGm4lHMvgdc3CKyBVozu1m9dQa01kFTR9Gl/fAx7ymH454WnmFPNYyuv2MaYDRLRUFbdIZw2cPvceUlbxuiBQ8mHlFe7s6icf8Ob9HSh6wxCFBZbzps5fCxTmrV4szNstr0eou24kWrpqcKFAZicMg0/bvfjqCgSrvUugc2xGYmfpuCDqlNWY9hBS6cvw8+0S3/TZGK/V1UmNxRoKgYj+ig2+8gufjcXazK7Jnh0gpD2pxLzchKDB3qaB/7Fblo" & _ + "5WsiAk/jhVZooezywP74czXJ8zc+md5wCJM/HahRW/Uem59n326GAyKDz3P8+swxrlfy8U7DM/hgYcq5pkPOe7vEVPDYUnPDbnUKGZdpKG32Q+s1uj0YSb5jYzM0O4FyZKSkAnwg0HVgUBwoZEqKa+TFYJOA9V7pKVWGN5jMcxcooz4DSi+1tgkY07WgyoJQEnqzbnh6+lPxllfagEzdyRUIghdSI2jHia/UCFrEF8KtsbcAzwI7Qo4MuegkYGZ+DGhjFCSqQpj3zwZ6lweA7BEUQMnw/SQl73oznO7foLoJfMrU76YnzFkJq2sl61qLE+GxYsNs8LheXLlkGc3dwSOY3gt8mFf9UEAvtHJ0FRFnETrXrpXaGj3JeMR3+lwzCM5SAMWTForoQeaAje55/fs1qqE5NVpur2CHxkg/qc+JYhRRprKyigOaJ/jA6Qv5ywoNVuy9fWVB2gdvkX5f5VI66D/M6S21x9vgCNtD7/GqGMcTXzfCUpKKuP2J5XXgV5bOrNg0Mod+q523puaVwX25vfDsKf/kV7fMNB1ShlzhxUGb8+SgD5XeBwhjohTwl5bGjC1+3CseGNSZQuw/WSTlbYDon4N8hZhJiBb5ISr61ueXPFek8b8AFPv6LsalRZgC6GnkVz2OYfp5qaO+p0e96BLw3OxNTezpQCmd2wFGEq/ABnDQoX5f1TyUuBfkaPv0hmQZm+EyINwTRNW5dLJnZAAnYnpYD7uqQRTDYpI4nQcQR6l1Hk6cYaMAX2pM+kLdt9fYyqqW297nd3Wd/AhWQ1u8DCeo1iQn/Ub1BnrVAXPjGpD+istceAWuCLyLlc9dbmM63XEZJuhIeXj/qcTPlMkOdGnURWl+XaPbYihZoXHfSbURuqpIcobGgQ6ID1sbpZU0mqidKDLJQhB0nT4El4W9wKDgy8AQUGeqUjA61dy3d2X91P5YCUk8a6f29emDTnOLJjzRuWuAbM0SrdbwgTUl+MDpVe4Q4iTMlDIFShgk0/D8PmdwTzWiPL3w" + $sData &= "ZHY3REBrXaQur7kdOD9scHWtN2Ew/Wh5DQ6qViGYNOlIy/Oa/odrB02BDzra8GsQom9epNMDH2/eYq3EIL8AXuFOf5yTlFyqNnuIv5ulAV1BefhycjAuV6WOUMnv28WFgXe+T6bNkgXiWZXoEjfyt7+2k6wrzcYnpqm7G0wjA7IKhYvX0c7D+nnc2KLsKdMezfT/kOfHJbEUaTdOFNlMFxll8fMrWKNHwBHm2rU3Swbt1iqM1KEvPfT4u0veGXCcEJwdulQhmcWWHPvq+biKzaw77Na4rCWkw7iobqA281fIZSsiKdk4c1B0scv33XGRwBx+/7f8eOpLYpnIGQJuKaZJknZnp7H65IpwfxUNNTh2GuW0mSEayO+wB39qfoZ71tuscGXnN+E+gQknKRER20t9v6MLMwhOI2J8wmcISim7xIXczhDn/CbmA1g5FT66ufLAswQ372Pkw+ubGuZCzxcteQ00aC/NcONgQpE05KblBlIbqWYBcjzeL/Ll4KjCrdsy+n3HIYUbpMSIbib0mS1EG39mqsM4FGfVM4QDwkEm//LTl/nz2MRCzzuKcM8Jv6icDDPrW1N6Ee0EMUFefPXCMo956GcVZeS4OQzPBRtddFzbpVHw1yN5Rwx08W64DOf//wSAiBUwiPI3igQV9jOlPnqQYVqjX/41Kv+VTEHwnZILopuoKaYTKqYHli+k24D9YCVLPTp1k/754GVK+6KmDlMgr0KQvTlgOnAdOy5f95i0pGh73HM0FYNBqXmgO/eGQBOKD7jkVlE9wFsEI2PlNByfDwEiaR45JNtJ9rsGmmLEmq8a/iSRL6v5MWzuFD5hbF1kSUXfD3bU8wgJ6vIfi5IuMoHv7s/JT5+hfeCpEGagNKm/4KUDxjiyGdcuLXAWiPWnpqu7Wy4O/u2m8QG6wXKBcBeJS4ev5ECtSC8ad6zl0q1S/mlj8gZfjcFqG0x/8/Dcy+iKDmmyT7VZ2JAnEHEnArl7DdgfL+ykHbcLhANckhNRY2LhYZx8YVDf" & _ + "Q1Tj3R9bLgbccGDQG555FmPK9oYAvzcrIqi1E10zx5mA+hS/jhbbzwKuYHc807w7Q29US3GpDfZiUffWY5+RR1o9THCBAdKvZnBhCDel3PLKtUitxSIP+p+wq+98ZTFq3e0lgqP4B/AQSncoGageTF3VSgp9dckG6b3NVOz2jLP/a8P5FBVoOZ0U7+/knxn8QyhLiKMi+GprPluQfUNelI6Dam2Uvzp4u4bVBoR7o79wmStEdy70zBhe4+iX7QtzK7DyrCKBd0UC7q+cePivkXrB9f5C+HTruO97z6aVga6QuYLzw4CRKT2iZHDzYta6owd8Kv4xA+v43qyfTZs+bfRtgC6uFNQnBE4Xn5bDnPUglBlPoIotQxqn17hE9IOmYGj2A+p49eYiUSJvbpKUH2oD8MKhGLnQOp8NCirFLAGBRzvLmdL0WFloFvrgtO9GeLJUHtqBGFq4jtOvj7JHBNXC1eD5ZTnZ5mpHzNhGRBLLAo0U4dOU5Q1EV3JgLj4rEQsPT9RsZ5faaK9YGafdM/A/iJPOGNuupSdhWrRUpEHGWCXwcCHBsSptxvUmibz8Lw6iQ1W7r7+0oOnzqOjbPR3WwIC8Vc0YZQq+u9MGDPUc51AuJvE/D1XX3mbGvJNAG9VSRs5sPGX8UBMvo89MP1+vgfMiEx/wruSZ9xbB+oZEAHM7L3uECTuKeKQsWb0N4ODqCCCpuik81WK0a7vKywlBTdhiNJDPAmuzfr1grMzj1fomSRCnYkNXYmgxiI+HagIKcWxcbqTWShwOlCYUv5BWjimv/lCHtPRyFh5THt+FvbG+FG8mQPxeU4vCfxPdjaZZ/l3E18dG+zuo1GUENxN3yXDfUOXlKYzZyK0OmT2XIHyy3nX4/yybAueET1obQxbsYt44RUV5PU0h2RehNU3ZDej1yR5RK+z8wKrh2Ur7OWSoqKilQ695z2F3qlK6oF1OdoU1FBHoi//JoYaK+F0fKJ0FECLVQ+EH8Q8DrySOVaUhpo9LLDaag9tewlYa" & _ + "9cAONZ9mGIgDnAqt6kFC5mMvB2gFsrJ+Qgoe7EINUj6L6ZQvHXunVFbnyVbdwV29ll2r8cyp8JpHdPNll3pDtc3mu+BhMTtJLB7pxacHhvzDq72LD5SN2rSQgZaH0g1GBM/e31jNlaQtEMVChZIqo5rXvsUoMCnB0Z8F0ovVqQfD0i6zOlCKfkmRbVblDH+83YDj6MtRbu19XPrGd+IXPvm+IV9iiBfRHAHyeRj+nKx2Ax0Mjg4Ve5G8s+Kv9USiOeqgyxIQPR5j58rNuoDOYdVDpJLIR5f2I042y9lW87TpYR10zxOFLdTppy/3baFMke+hn+8wl6Iy3rodhrTEyfqjnRc0GlGDSWExJOV/+BIJNf/q9emApvKJ8YLzFPkc1de6LEDIX4TZyol85d6ZDF8BAX4Of5e38EM1fQoP4sss571vyqTFUWLnhcd3a3di/oT74/YCWa6k9PCAxYdqsGDM+up87kxmNawjNOqM0r3j7cMdUPYauLthz2B8ZdyPlak2B0jCEJqFrp0Y9jsN8G42+KlP4C2fNtbZVeKzDn0s6q+6myWLXSW7oxKcJD7/oOrf+rS3yideGoS3EU5LTw+SGEoYthiBPkMho0HHRwnzvAa5OK1H7YSA8/ACZ78w2WroAUeAAAAAZjkE+Q+FTQwAAEiLTPkI/xVcUQAAiUUAAAAApIvVTQAAAAB4wAAAAQAAABQAAAAUAAAAKMAAAI3AAAAtwgAAXE8AAExPAABkTwAAeFMAAHBVAAAETwAA4E4AALxOAACQUAAAbE8AAKhPAABUUgAAXFIAADBPAAAAUgAAHFEAAFRPAABkUgAAvFEAAAhQAABBdXRvSXRPYmplY3RfWDY0LmRsbADdwAAA5cAAAO/AAAD7wAAAFMEAAC/BAABBwQAAVMEAAGzBAACAwQAAlMEAAKrBAAC5wQAAycEAANTBAADkwQAA88EAAADCAAALwgAAHMIAAEFkZEVudW0AQWRkTWV0aG9kAEFkZFByb3BlcnR5AEF1dG9J" + $sData &= "dE9iamVjdENyZWF0ZU9iamVjdABBdXRvSXRPYmplY3RDcmVhdGVPYmplY3RFeABDbG9uZUF1dG9JdE9iamVjdABDcmVhdGVBdXRvSXRPYmplY3QAQ3JlYXRlQXV0b0l0T2JqZWN0Q2xhc3MAQ3JlYXRlRGxsQ2FsbE9iamVjdABDcmVhdGVXcmFwcGVyT2JqZWN0AENyZWF0ZVdyYXBwZXJPYmplY3RFeABJVW5rbm93bkFkZFJlZgBJVW5rbm93blJlbGVhc2UASW5pdGlhbGl6ZQBNZW1vcnlDYWxsRW50cnkAUmVnaXN0ZXJPYmplY3QAUmVtb3ZlTWVtYmVyAFJldHVyblRoaXMAVW5SZWdpc3Rlck9iamVjdABXcmFwcGVyQWRkTWV0aG9kAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAAAAC8wgAAAAAAAAAAAABAwwAAvMIAANTCAAAAAAAAAAAAAEnDAADUwgAA5MIAAAAAAAAAAAAAYsMAAOTCAAD0wgAAAAAAAAAAAABvwwAA9MIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHMMAAAAAAAAvwwAAAAAAAAAAAAAAAAAAU8MAAAAAAAAAAAAAAAAAAAUBAAAAAACAAAAAAAAAAAB7wwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABHZXRNb2R1bGVIYW5kbGVBAAAAR2V0UHJvY0FkZHJlc3MAS0VSTkVMMzIAb2xlMzIuZGxsAAAAQ29Jbml0aWFsaXplAE9MRUFVVDMyLmRsbABTSExXQVBJLmRsbAAAAFN0clRvSW50NjRFeFcAV1ZTUVJBUEiNBd4KAABIizBIA/BIK8BIi/5mrcHgDEiLyFCtK8hIA/GLyFdEi8H/yYpEOQaIBDF19UFRVSvArIvIwekEUSQPUKyLyAIMJFBIx8UA/f//SNPlWVhIweAgSAPIWEiL3EiNpGyQ8f//UFFIK8lR" & _ + "UUiLzFFmixfB4gxSV0yNSQhJjUkIVlpIg+wg6MgAAABIi+NdQVleWoHqABAAACvJO8pzSovZrP/BPP91DYoGJP08FXXrrP/B6xc8jXUNigYkxzwFddqs/8HrBiT+POh1z1Fbg8EErQvAeAY7wnPB6wYDw3i7A8Irw4lG/OuySI09Bv///7DpqrjiCgAAq0iNBeIJAACLUAyLeAgL/3Q9SIswSAPwSCvySIveSItIFEgry3Qoi1AQSAPySAP+K8Ar0gvQrMHiB9DocvYL0AvSdAtIA9pIKQtIO/dy4UiNBZQJAADpigkAAEyJTCQgSIlUJBBTVVZXQVRBVUFWQVdIg+woM/ZMi/JIi8GNXgFMjWkMi0kIRIvTi9NMi/5B0+KLSAREit7T4kiLjCSgAAAARCvTK9OL7kSL44lUJAyLEEmJMYlUJAhIiTGLSAQDyroAAwAARIlUJBDT4omcJIAAAACJXCRwgcI2BwAAiVwkBHQNi8pJi/24AAQAAPNmq02Lzk0D8Iv+QYPI/4vOTTvOD4TKCAAAQQ+2AcHnCAPLC/hMA8uD+QV85Eg5tCSYAAAAD4aKCAAAi8VBi/e6CAAAAMHgBEEj8kG6AAAAAUhj2EhjxkgD2EU7wnMaTTvOD4Q/CAAAQQ+2AcHnCEHB4AgL+EmDwQFBD7dMXQBBi8DB6AsPr8E7+A+DtQEAAESLwLgACAAAQboBAAAAK8HB+AVmA8GLykEPttNmQYlEXQCLXCQIi0QkDEkjxyrLSNPqi8tI0+BIA9BIjQRSSMHgCYP9B0mNtAVsDgAAD4y7AAAAQYvESYvPSCvISIuEJJAAAAAPthwIA9tJY8JEi9tBgeMAAQAASWPTSAPQQYH4AAAAAXMaTTvOD4SIBwAAQQ+2AcHnCEHB4AgL+EmDwQEPt4xWAAIAAEGLwMHoCw+vwTv4cyhEi8C4AAgAAEUD0ivBwfgFZgPBZomEVgACAAAzwEQ72A+FmwAAAOsjRCvAK/gPt8FmwegFR41UEgFmK8gzwEQ7" & _ + "2GaJjFYAAgAAdHZBgfoAAQAAfXbpWv///0GB+AAAAAFJY9JzGk07zg+E9AYAAEEPtgHB5whBweAIC/hJg8EBD7cMVkGLwMHoCw+vwTv4cxlEi8C4AAgAACvBwfgFZgPBRQPSZokEVusYRCvAK/gPt8FmwegFR41UEgFmK8hmiQxWQYH6AAEAAHyPSIuEJJAAAABFitpGiBQ4SYPHAYP9BH0JM8CL6OljBgAAg/0KfQiD7QPpVgYAAIPtBulOBgAARCvAK/gPt8FmwegFSGPVZivIRTvCZkGJTF0AcyFNO84PhDwGAABBD7YBwecIQbsBAAAAC/hBweAITQPL6wZBuwEAAABBD7eMVYABAABBi8DB6AsPr8E7+HNRRIvAuAAIAAArwcH4BWYDwYP9B2ZBiYRVgAEAAItEJHBJjZVkBgAAiUQkBIuEJIAAAABEiaQkgAAAAIlEJHC4AwAAAI1Y/Q9Mw41rCOlOAgAARCvAK/gPt8FmwegFZivIRTvCZkGJjFWAAQAAcxlNO84PhJgFAABBD7YBwecIQcHgCAv4TQPLRQ+3lFWYAQAAQYvIwekLQQ+vyjv5D4PIAAAAuAAIAABEi8FBK8LB+AVmQQPCQboAAAABQTvKZkGJhFWYAQAAcxlNO84PhD4FAABBD7YBwecIQcHgCAv4TQPLQQ+3jF3gAQAAQYvAwegLD6/BO/hzVkSLwLgACAAAK8HB+AVmA8FmQYmEXeABAAAzwEw7+A+E9AQAAEiLlCSQAAAAuAsAAACD/QeNSP4PTMFJi8+L6EGLxEgryESKHApGiBw6SYPHAemnBAAARCvAK/gPt8FmwegFZivIZkGJjF3gAQAA6R4BAABBD7fCRCvBK/lmwegFZkQr0GZFiZRVmAEAAEG6AAAAAUU7wnMZTTvOD4R3BAAAQQ+2AcHnCEHB4AgL+E0Dy0EPt4xVsAEAAEGLwMHoCw+vwTv4cyVEi8C4AAgAACvBwfgFZgPBZkGJhFWwAQAAi4QkgAAAAOmaAAAARCvA" + $sData &= "K/gPt8FmwegFZivIRTvCZkGJjFWwAQAAcxlNO84PhAYEAABBD7YBwecIQcHgCAv4TQPLQQ+3jFXIAQAAQYvAwegLD6/BO/hzH0SLwLgACAAAK8HB+AVmA8FmQYmEVcgBAACLRCRw6yREK8Ar+A+3wWbB6AVmK8iLRCQEZkGJjFXIAQAAi0wkcIlMJASLjCSAAAAAiUwkcESJpCSAAAAARIvgg/0HuAsAAABJjZVoCgAAjWj9D0zFM9tFO8KJBCRzGU07zg+EXwMAAEEPtgHB5whBweAIC/hNA8sPtwpBi8DB6AsPr8E7+HMlRIvAuAAIAABEi9MrwcH4BWYDwWaJAovGweADSGPITI1cSgTraEQrwCv4D7fBZsHoBWYryEU7wmaJCnMZTTvOD4T6AgAAQQ+2AcHnCEHB4AgL+E0Dyw+3SgJBi8DB6AsPr8E7+HMuRIvAuAAIAABEi9UrwcH4BWYDwWaJQgKLxsHgA0hjyEyNnEoEAQAAuwMAAADrIkQrwCv4D7fBZsHoBUyNmgQCAABBuhAAAABmK8iL3WaJSgKL870BAAAAQYH4AAAAAUhj1XMaTTvOD4RmAgAAQQ+2AcHnCEHB4AgL+EmDwQFBD7cMU0GLwMHoCw+vwTv4cxlEi8C4AAgAACvBwfgFZgPBA+1mQYkEU+sYRCvAK/gPt8FmwegFjWwtAWYryGZBiQxTg+4BdZKNRgGLy9PgRCvQiwQkQQPqg/gED42gAQAAg8AHg/0EjV4GiQQkjUYDjVYBD0zFweAGSJhNjZxFYAMAAEGB+AAAAAFMY9JzGk07zg+EvQEAAEEPtgHB5whBweAIC/hJg8EBQw+3DFNBi8DB6AsPr8E7+HMZRIvAuAAIAAArwcH4BWYDwQPSZkOJBFPrGEQrwCv4D7fBZsHoBY1UEgFmK8hmQ4kMU4PrAXWSg+pAg/oERIviD4z7AAAAQYPkAUSL0kHR+kGDzAJBg+oBg/oOfRlBi8pIY8JB0+RBi8xIK8hJjZxNXgUAAOtQQYPq" & _ + "BEGB+AAAAAFzGk07zg+EDwEAAEEPtgHB5whBweAIC/hJg8EBQdHoRQPkQTv4cgdBK/hBg8wBQYPqAXXFSY2dRAYAAEHB5ARBugQAAAC+AQAAAIvWQYH4AAAAAUxj2nMaTTvOD4S5AAAAQQ+2AcHnCEHB4AgL+EmDwQFCD7cMW0GLwMHoCw+vwTv4cxlEi8C4AAgAACvBwfgFZgPBA9JmQokEW+sbRCvAK/gPt8FmwegFjVQSAWYryEQL5mZCiQxbA/ZBg+oBdYxBg8QBdGBBi8SDxQJJY8xJO8d3RkiLlCSQAAAASYvHSCvBSAPCRIoYSIPAAUaIHDpJg8cBg+0BdApMO7wkmAAAAHLiiywkTDu8JJgAAABzFkSLVCQQ6ZT3//+4AQAAAOs4QYvD6zNBgfgAAAABcwlNO8505kmDwQFIi4QkiAAAAEwrTCR4TIkISIuEJKAAAABMiTgzwOsCi8NIg8QoQV9BXkFdQVxfXl1bw+lCjv//iUH///////9DAAAAABAAAACwAAAAAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" & _ + "AAAAAAAAAAAAAAAAAAABABAAAAAYAACAAAAAAAAAAAAAAAAAAAABAAEAAAAwAACAAAAAAAAAAAAAAAAAAAABAAkEAABIAAAAWNAAABgDAAAAAAAAAAAAABgDNAAAAFYAUwBfAFYARQBSAFMASQBPAE4AXwBJAE4ARgBPAAAAAAC9BO/+AAABAAIAAQACAAgAAgABAAIACAAAAAAAAAAAAAQAAAACAAAAAAAAAAAAAAAAAAAAdgIAAAEAUwB0AHIAaQBuAGcARgBpAGwAZQBJAG4AZgBvAAAAUgIAAAEAMAA0ADAAOQAwADQAQgAwAAAAMAAIAAEARgBpAGwAZQBWAGUAcgBzAGkAbwBuAAAAAAAxAC4AMgAuADgALgAyAAAANAAIAAEAUAByAG8AZAB1AGMAdABWAGUAcgBzAGkAbwBuAAAAMQAuADIALgA4AC4AMgAAAHoAKQABAEYAaQBsAGUARABlAHMAYwByAGkAcAB0AGkAbwBuAAAAAABQAHIAbwB2AGkAZABlAHMAIABvAGIAagBlAGMAdAAgAGYAdQBuAGMAdABpAG8AbgBhAGwAaQB0AHkAIABmAG8AcgAgAEEAdQB0AG8ASQB0AAAAAAA6AA0AAQBQAHIAbwBkAHUAYwB0AE4AYQBtAGUAAAAAAEEAdQB0AG8ASQB0AE8AYgBqAGUAYwB0AAAAAABYABoAAQBMAGUAZwBhAGwAQwBvAHAAeQByAGkAZwBoAHQAAAAoAEMAKQAgAFQAaABlACAAQQB1AHQAbwBJAHQATwBiAGoAZQBjAHQALQBUAGUAYQBtAAAASgARAAEATwByAGkAZwBpAG4AYQBsAEYAaQBsAGUAbgBhAG0AZQAAAEEAdQB0AG8ASQB0AE8AYgBqAGUAYwB0AC4AZABsAGwAAAAAAHoAIwABAFQAaABlACAAQQB1AHQAbwBJAHQATwBiAGoAZQBjAHQALQBUAGUAYQBtAAAAAABtAG8AbgBvAGMAZQByAGUAcwAsACAAdAByAGEA" + $sData &= "bgBjAGUAeAB4ACwAIABLAGkAcAAsACAAUAByAG8AZwBBAG4AZAB5AAAAAABEAAAAAQBWAGEAcgBGAGkAbABlAEkAbgBmAG8AAAAAACQABAAAAFQAcgBhAG4AcwBsAGEAdABpAG8AbgAAAAAACQSwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==" + Return __Au3Obj_Mem_Base64Decode($sData) +EndFunc ;==>__Au3Obj_Mem_BinDll_X64 + +#EndRegion Embedded DLL +;-------------------------------------------------------------------------------------------------------------------------------------- + + +;-------------------------------------------------------------------------------------------------------------------------------------- +#Region DllStructCreate Wrapper + +Func __Au3Obj_ObjStructMethod(ByRef $oSelf, $vParam1 = 0, $vParam2 = 0) + Local $sMethod = $oSelf.__name__ + Local $tStructure = DllStructCreate($oSelf.__tag__, $oSelf.__pointer__) + Local $vOut + Switch @NumParams + Case 1 + $vOut = DllStructGetData($tStructure, $sMethod) + Case 2 + If $oSelf.__propcall__ Then + $vOut = DllStructSetData($tStructure, $sMethod, $vParam1) + Else + $vOut = DllStructGetData($tStructure, $sMethod, $vParam1) + EndIf + Case 3 + $vOut = DllStructSetData($tStructure, $sMethod, $vParam2, $vParam1) + EndSwitch + If IsPtr($vOut) Then Return Number($vOut) + Return $vOut +EndFunc ;==>__Au3Obj_ObjStructMethod + +Func __Au3Obj_ObjStructDestructor(ByRef $oSelf) + If $oSelf.__new__ Then __Au3Obj_GlobalFree($oSelf.__pointer__) +EndFunc ;==>__Au3Obj_ObjStructDestructor + +Func __Au3Obj_ObjStructPointer(ByRef $oSelf, $vParam = Default) + If $oSelf.__propcall__ Then Return SetError(1, 0, 0) + If @NumParams = 1 Or IsKeyword($vParam) Then Return $oSelf.__pointer__ + Return Number(DllStructGetPtr(DllStructCreate($oSelf.__tag__, $oSelf.__pointer__), $vParam)) +EndFunc ;==>__Au3Obj_ObjStructPointer + +#EndRegion DllStructCreate Wrapper +;-------------------------------------------------------------------------------------------------------------------------------------- + + +;-------------------------------------------------------------------------------------------------------------------------------------- +#Region Public UDFs + +Global Enum $ELTYPE_NOTHING, $ELTYPE_METHOD, $ELTYPE_PROPERTY +Global Enum $ELSCOPE_PUBLIC, $ELSCOPE_READONLY, $ELSCOPE_PRIVATE + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_AddDestructor +; Description ...: Adds a destructor to an AutoIt-object +; Syntax.........: _AutoItObject_AddDestructor(ByRef $oObject, $sAutoItFunc) +; Parameters ....: $oObject - the object to modify +; $sAutoItFunc - the AutoIt-function wich represents this destructor. +; Return values .: Success - True +; Failure - 0 +; Author ........: monoceres (Andreas Karlsson) +; Modified.......: +; Remarks .......: Adding a method that will be called on object destruction. Can be called multiple times. +; Related .......: _AutoItObject_AddProperty, _AutoItObject_AddEnum, _AutoItObject_RemoveMember, _AutoItObject_AddMethod +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_AddDestructor(ByRef $oObject, $sAutoItFunc) + Return _AutoItObject_AddMethod($oObject, "~", $sAutoItFunc, True) +EndFunc ;==>_AutoItObject_AddDestructor + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_AddEnum +; Description ...: Adds an Enum to an AutoIt-object +; Syntax.........: _AutoItObject_AddEnum(ByRef $oObject, $sNextFunc, $sResetFunc [, $sSkipFunc = '']) +; Parameters ....: $oObject - the object to modify +; $sNextFunc - The function to be called to get the next entry +; $sResetFunc - The function to be called to reset the enum +; $sSkipFunc - [optional] The function to be called to skip elements (not supported by AutoIt) +; Return values .: Success - True +; Failure - 0 +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_AddMethod, _AutoItObject_AddProperty, _AutoItObject_RemoveMember +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_AddEnum(ByRef $oObject, $sNextFunc, $sResetFunc, $sSkipFunc = '') + ; Author: Prog@ndy + If Not IsObj($oObject) Then Return SetError(2, 0, 0) + DllCall($ghAutoItObjectDLL, "none", "AddEnum", "idispatch", $oObject, "wstr", $sNextFunc, "wstr", $sResetFunc, "wstr", $sSkipFunc) + If @error Then Return SetError(1, @error, 0) + Return True +EndFunc ;==>_AutoItObject_AddEnum + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_AddMethod +; Description ...: Adds a method to an AutoIt-object +; Syntax.........: _AutoItObject_AddMethod(ByRef $oObject, $sName, $sAutoItFunc [, $fPrivate = False]) +; Parameters ....: $oObject - the object to modify +; $sName - the name of the method to add +; $sAutoItFunc - the AutoIt-function wich represents this method. +; $fPrivate - [optional] Specifies whether the function can only be called from within the object. (default: False) +; Return values .: Success - True +; Failure - 0 +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: The first parameter of the AutoIt-function is always a reference to the object. ($oSelf) +; This parameter will automatically be added and must not be given in the call. +; The function called '__default__' is accesible without a name using brackets ($return = $oObject()) +; Related .......: _AutoItObject_AddProperty, _AutoItObject_AddEnum, _AutoItObject_RemoveMember +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_AddMethod(ByRef $oObject, $sName, $sAutoItFunc, $fPrivate = False) + ; Author: Prog@ndy + If Not IsObj($oObject) Then Return SetError(2, 0, 0) + Local $iFlags = 0 + If $fPrivate Then $iFlags = $ELSCOPE_PRIVATE + DllCall($ghAutoItObjectDLL, "none", "AddMethod", "idispatch", $oObject, "wstr", $sName, "wstr", $sAutoItFunc, 'dword', $iFlags) + If @error Then Return SetError(1, @error, 0) + Return True +EndFunc ;==>_AutoItObject_AddMethod + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_AddProperty +; Description ...: Adds a property to an AutoIt-object +; Syntax.........: _AutoItObject_AddProperty(ByRef $oObject, $sName [, $iFlags = $ELSCOPE_PUBLIC [, $vData = ""]]) +; Parameters ....: $oObject - the object to modify +; $sName - the name of the property to add +; $iFlags - [optional] Specifies the access to the property +; $vData - [optional] Initial data for the property +; Return values .: Success - True +; Failure - 0 +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: The property called '__default__' is accesible without a name using brackets ($value = $oObject()) +; + $iFlags can be: +; |$ELSCOPE_PUBLIC - The Property has public access. +; |$ELSCOPE_READONLY - The property is read-only and can only be changed from within the object. +; |$ELSCOPE_PRIVATE - The property is private and can only be accessed from within the object. +; + +; + Initial default value for every new property is nothing (no value). +; Related .......: _AutoItObject_AddMethod, _AutoItObject_AddEnum, _AutoItObject_RemoveMember +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_AddProperty(ByRef $oObject, $sName, $iFlags = $ELSCOPE_PUBLIC, $vData = "") + ; Author: Prog@ndy + Local Static $tStruct = DllStructCreate($__Au3Obj_tagVARIANT) + If Not IsObj($oObject) Then Return SetError(2, 0, 0) + Local $pData = 0 + If @NumParams = 4 Then + $pData = DllStructGetPtr($tStruct) + _AutoItObject_VariantInit($pData) + $oObject.__bridge__(Number($pData)) = $vData + EndIf + DllCall($ghAutoItObjectDLL, "none", "AddProperty", "idispatch", $oObject, "wstr", $sName, 'dword', $iFlags, 'ptr', $pData) + Local $error = @error + If $pData Then _AutoItObject_VariantClear($pData) + If $error Then Return SetError(1, $error, 0) + Return True +EndFunc ;==>_AutoItObject_AddProperty + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_Class +; Description ...: AutoItObject COM wrapper function +; Syntax.........: _AutoItObject_Class() +; Parameters ....: +; Return values .: Success - object with defined: +; -methods: +; | Create([$oParent = 0]) - creates AutoItObject object +; | AddMethod($sName, $sAutoItFunc [, $fPrivate = False]) - adds new method +; | AddProperty($sName, $iFlags = $ELSCOPE_PUBLIC, $vData = 0) - adds new property +; | AddDestructor($sAutoItFunc) - adds destructor +; | AddEnum($sNextFunc, $sResetFunc [, $sSkipFunc = '']) - adds enum +; | RemoveMember($sMember) - removes member +; -properties: +; | Object - readonly property representing the last created AutoItObject object +; Author ........: trancexx +; Modified.......: +; Remarks .......: "Object" propery can be accessed only once for one object. After that new AutoItObject object is created. +; +Method "Create" will discharge previous AutoItObject object and create a new one. +; Related .......: _AutoItObject_Create +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_Class() + Local $aCall = DllCall($ghAutoItObjectDLL, "idispatch", "CreateAutoItObjectClass") + If @error Then Return SetError(1, @error, 0) + Return $aCall[0] +EndFunc ;==>_AutoItObject_Class + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_CLSIDFromString +; Description ...: Converts a string to a CLSID-Struct (GUID-Struct) +; Syntax.........: _AutoItObject_CLSIDFromString($sString) +; Parameters ....: $sString - The string to convert +; Return values .: Success - DLLStruct in format $tagGUID +; Failure - 0 +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_CoCreateInstance +; Link ..........: http://msdn.microsoft.com/en-us/library/ms680589(VS.85).aspx +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_CLSIDFromString($sString) + Local $tCLSID = DllStructCreate("dword;word;word;byte[8]") + Local $aResult = DllCall($gh_AU3Obj_ole32dll, 'long', 'CLSIDFromString', 'wstr', $sString, 'ptr', DllStructGetPtr($tCLSID)) + If @error Then Return SetError(1, @error, 0) + If $aResult[0] <> 0 Then Return SetError(2, $aResult[0], 0) + Return $tCLSID +EndFunc ;==>_AutoItObject_CLSIDFromString + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_CoCreateInstance +; Description ...: Creates a single uninitialized object of the class associated with a specified CLSID. +; Syntax.........: _AutoItObject_CoCreateInstance($rclsid, $pUnkOuter, $dwClsContext, $riid, ByRef $ppv) +; Parameters ....: $rclsid - The CLSID associated with the data and code that will be used to create the object. +; $pUnkOuter - If NULL, indicates that the object is not being created as part of an aggregate. +; +If non-NULL, pointer to the aggregate object's IUnknown interface (the controlling IUnknown). +; $dwClsContext - Context in which the code that manages the newly created object will run. +; +The values are taken from the enumeration CLSCTX. +; $riid - A reference to the identifier of the interface to be used to communicate with the object. +; $ppv - [out byref] Variable that receives the interface pointer requested in riid. +; +Upon successful return, *ppv contains the requested interface pointer. Upon failure, *ppv contains NULL. +; Return values .: Success - True +; Failure - 0 +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_ObjCreate, _AutoItObject_CLSIDFromString +; Link ..........: http://msdn.microsoft.com/en-us/library/ms686615(VS.85).aspx +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_CoCreateInstance($rclsid, $pUnkOuter, $dwClsContext, $riid, ByRef $ppv) + $ppv = 0 + Local $aResult = DllCall($gh_AU3Obj_ole32dll, 'long', 'CoCreateInstance', 'ptr', $rclsid, 'ptr', $pUnkOuter, 'dword', $dwClsContext, 'ptr', $riid, 'ptr*', 0) + If @error Then Return SetError(1, @error, 0) + $ppv = $aResult[5] + Return SetError($aResult[0], 0, $aResult[0] = 0) +EndFunc ;==>_AutoItObject_CoCreateInstance + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_Create +; Description ...: Creates an AutoIt-object +; Syntax.........: _AutoItObject_Create( [$oParent = 0] ) +; Parameters ....: $oParent - [optional] an AutoItObject whose methods & properties are copied. (default: 0) +; Return values .: Success - AutoIt-Object +; Failure - 0 +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_Class +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_Create($oParent = 0) + ; Author: Prog@ndy + Local $aResult + Switch IsObj($oParent) + Case True + $aResult = DllCall($ghAutoItObjectDLL, "idispatch", "CloneAutoItObject", 'idispatch', $oParent) + Case Else + $aResult = DllCall($ghAutoItObjectDLL, "idispatch", "CreateAutoItObject") + EndSwitch + If @error Then Return SetError(1, @error, 0) + Return $aResult[0] +EndFunc ;==>_AutoItObject_Create + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_DllOpen +; Description ...: Creates an object associated with specified dll +; Syntax.........: _AutoItObject_DllOpen($sDll [, $sTag = "" [, $iFlag = 0]]) +; Parameters ....: $sDll - Dll for which to create an object +; $sTag - [optional] String representing function return value and parameters. +; $iFlag - [optional] Flag specifying the level of loading. See MSDN about LoadLibraryEx function for details. Default is 0. +; Return values .: Success - Dispatch-Object +; Failure - 0 +; Author ........: trancexx +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_WrapperCreate +; Link ..........: http://msdn.microsoft.com/en-us/library/ms684179(VS.85).aspx +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_DllOpen($sDll, $sTag = "", $iFlag = 0) + Local $sTypeTag = "wstr" + If $sTag = Default Or Not $sTag Then $sTypeTag = "ptr" + Local $aCall = DllCall($ghAutoItObjectDLL, "idispatch", "CreateDllCallObject", "wstr", $sDll, $sTypeTag, __Au3Obj_GetMethods($sTag), "dword", $iFlag) + If @error Or Not IsObj($aCall[0]) Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>_AutoItObject_DllOpen + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_DllStructCreate +; Description ...: Object wrapper for DllStructCreate and related functions +; Syntax.........: _AutoItObject_DllStructCreate($sTag [, $vParam = 0]) +; Parameters ....: $sTag - A string representing the structure to create (same as with DllStructCreate) +; $vParam - [optional] If this parameter is DLLStruct type then it will be copied to newly allocated space and maintained during lifetime of the object. If this parameter is not suplied needed memory allocation is done but content is initialized to zero. In all other cases function will not allocate memory but use parameter supplied as the pointer (same as DllStructCreate) +; Return values .: Success - Object-structure +; Failure - 0, @error is set to error value of DllStructCreate() function. +; Author ........: trancexx +; Modified.......: +; Remarks .......: AutoIt can't handle pointers properly when passed to or returned from object methods. Use Number() function on pointers before using them with this function. +; +Every element of structure must be named. Values are accessed through their names. +; +Created object exposes: +; + - set of dynamic methods in names of elements of the structure +; + - readonly properties: +; | __tag__ - a string representing the object-structure +; | __size__ - the size of the struct in bytes +; | __alignment__ - alignment string (e.g. "align 2") +; | __count__ - number of elements of structure +; | __elements__ - string made of element names separated by semicolon (;) +; Related .......: +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_DllStructCreate($sTag, $vParam = 0) + Local $fNew = False + Local $tSubStructure = DllStructCreate($sTag) + If @error Then Return SetError(@error, 0, 0) + Local $iSize = DllStructGetSize($tSubStructure) + Local $pPointer = $vParam + Select + Case @NumParams = 1 + ; Will allocate fixed 128 extra bytes due to possible misalignment and other issues + $pPointer = __Au3Obj_GlobalAlloc($iSize + 128, 64) ; GPTR + If @error Then Return SetError(3, 0, 0) + $fNew = True + Case IsDllStruct($vParam) + $pPointer = __Au3Obj_GlobalAlloc($iSize, 64) ; GPTR + If @error Then Return SetError(3, 0, 0) + $fNew = True + DllStructSetData(DllStructCreate("byte[" & $iSize & "]", $pPointer), 1, DllStructGetData(DllStructCreate("byte[" & $iSize & "]", DllStructGetPtr($vParam)), 1)) + Case @NumParams = 2 And $vParam = 0 + Return SetError(3, 0, 0) + EndSelect + Local $sAlignment + Local $sNamesString = __Au3Obj_ObjStructGetElements($sTag, $sAlignment) + Local $aElements = StringSplit($sNamesString, ";", 2) + Local $oObj = _AutoItObject_Class() + For $i = 0 To UBound($aElements) - 1 + $oObj.AddMethod($aElements[$i], "__Au3Obj_ObjStructMethod") + Next + $oObj.AddProperty("__tag__", $ELSCOPE_READONLY, $sTag) + $oObj.AddProperty("__size__", $ELSCOPE_READONLY, $iSize) + $oObj.AddProperty("__alignment__", $ELSCOPE_READONLY, $sAlignment) + $oObj.AddProperty("__count__", $ELSCOPE_READONLY, UBound($aElements)) + $oObj.AddProperty("__elements__", $ELSCOPE_READONLY, $sNamesString) + $oObj.AddProperty("__new__", $ELSCOPE_PRIVATE, $fNew) + $oObj.AddProperty("__pointer__", $ELSCOPE_READONLY, Number($pPointer)) + $oObj.AddMethod("__default__", "__Au3Obj_ObjStructPointer") + $oObj.AddDestructor("__Au3Obj_ObjStructDestructor") + Return $oObj.Object +EndFunc ;==>_AutoItObject_DllStructCreate + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_IDispatchToPtr +; Description ...: Returns pointer to AutoIt's object type +; Syntax.........: _AutoItObject_IDispatchToPtr(ByRef $oIDispatch) +; Parameters ....: $oIDispatch - Object +; Return values .: Success - Pointer to object +; Failure - 0 +; Author ........: monoceres, trancexx +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_PtrToIDispatch, _AutoItObject_CoCreateInstance, _AutoItObject_ObjCreate +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_IDispatchToPtr($oIDispatch) + Local $aCall = DllCall($ghAutoItObjectDLL, "ptr", "ReturnThis", "idispatch", $oIDispatch) + If @error Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>_AutoItObject_IDispatchToPtr + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_IUnknownAddRef +; Description ...: Increments the refrence count of an IUnknown-Object +; Syntax.........: _AutoItObject_IUnknownAddRef($vUnknown) +; Parameters ....: $vUnknown - IUnkown-pointer or object itself +; Return values .: Success - New reference count. +; Failure - 0, @error is set. +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_IUnknownRelease +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_IUnknownAddRef(Const $vUnknown) + ; Author: Prog@ndy + Local $sType = "ptr" + If IsObj($vUnknown) Then $sType = "idispatch" + Local $aCall = DllCall($ghAutoItObjectDLL, "dword", "IUnknownAddRef", $sType, $vUnknown) + If @error Then Return SetError(1, @error, 0) + Return $aCall[0] +EndFunc ;==>_AutoItObject_IUnknownAddRef + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_IUnknownRelease +; Description ...: Decrements the refrence count of an IUnknown-Object +; Syntax.........: _AutoItObject_IUnknownRelease($vUnknown) +; Parameters ....: $vUnknown - IUnkown-pointer or object itself +; Return values .: Success - New reference count. +; Failure - 0, @error is set. +; Author ........: trancexx +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_IUnknownAddRef +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_IUnknownRelease(Const $vUnknown) + Local $sType = "ptr" + If IsObj($vUnknown) Then $sType = "idispatch" + Local $aCall = DllCall($ghAutoItObjectDLL, "dword", "IUnknownRelease", $sType, $vUnknown) + If @error Then Return SetError(1, @error, 0) + Return $aCall[0] +EndFunc ;==>_AutoItObject_IUnknownRelease + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_ObjCreate +; Description ...: Creates a reference to a COM object +; Syntax.........: _AutoItObject_ObjCreate($sID [, $sRefId = Default [, $tagInterface = Default ]] ) +; Parameters ....: $sID - Object identifier. Either string representation of CLSID or ProgID +; $sRefId - [optional] String representation of the identifier of the interface to be used to communicate with the object. Default is the value of IDispatch +; $tagInterface - [optional] String defining the methods of the Interface, see Remarks for _AutoItObject_WrapperCreate function for details +; Return values .: Success - Dispatch-Object +; Failure - 0 +; Author ........: trancexx +; Modified.......: +; Remarks .......: Prefix object identifier with "cbi:" to create object from ROT. +; Related .......: _AutoItObject_ObjCreateEx, _AutoItObject_WrapperCreate +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_ObjCreate($sID, $sRefId = Default, $tagInterface = Default) + Local $sTypeRef = "wstr" + If $sRefId = Default Or Not $sRefId Then $sTypeRef = "ptr" + Local $sTypeTag = "wstr" + If $tagInterface = Default Or Not $tagInterface Then $sTypeTag = "ptr" + Local $aCall = DllCall($ghAutoItObjectDLL, "idispatch", "AutoItObjectCreateObject", "wstr", $sID, $sTypeRef, $sRefId, $sTypeTag, __Au3Obj_GetMethods($tagInterface)) + If @error Or Not IsObj($aCall[0]) Then Return SetError(1, 0, 0) + If $sTypeRef = "ptr" And $sTypeTag = "ptr" Then _AutoItObject_IUnknownRelease($aCall[0]) + Return $aCall[0] +EndFunc ;==>_AutoItObject_ObjCreate + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_ObjCreateEx +; Description ...: Creates a reference to a COM object +; Syntax.........: _AutoItObject_ObjCreateEx($sModule, $sCLSID [, $sRefId = Default [, $tagInterface = Default [, $fWrapp = False]]] ) +; Parameters ....: $sModule - Full path to the module with class (object) +; $sCLSID - Object identifier. String representation of CLSID. +; $sRefId - [optional] String representation of the identifier of the interface to be used to communicate with the object. Default is the value of IDispatch +; $tagInterface - [optional] String defining the methods of the Interface, see Remarks for _AutoItObject_WrapperCreate function for details +; $fWrapped - [optional] Specifies whether to wrapp created object. +; Return values .: Success - Dispatch-Object +; Failure - 0 +; Author ........: trancexx +; Modified.......: +; Remarks .......: This function doesn't require any additional registration of the classes and interaces supported in the server module. +; +In case $tagInterface is specified $fWrapp parameter is ignored. +; +If $sRefId is left default then first supported interface by the coclass is returned (the default dispatch). +; + +; +If used to for ROT objects $sModule parameter represents the full path to the server (any form: exe, a3x or au3). Default time-out value for the function is 3000ms in that case. If required object isn't created in that time function will return failure. +; +This function sends "/StartServer" command to the server to initialize it. +; Related .......: _AutoItObject_ObjCreate, _AutoItObject_WrapperCreate +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_ObjCreateEx($sModule, $sID, $sRefId = Default, $tagInterface = Default, $fWrapp = False, $iTimeOut = Default) + Local $sTypeRef = "wstr" + If $sRefId = Default Or Not $sRefId Then $sTypeRef = "ptr" + Local $sTypeTag = "wstr" + If $tagInterface = Default Or Not $tagInterface Then + $sTypeTag = "ptr" + Else + $fWrapp = True + EndIf + If $iTimeOut = Default Then $iTimeOut = 0 + Local $aCall = DllCall($ghAutoItObjectDLL, "idispatch", "AutoItObjectCreateObjectEx", "wstr", $sModule, "wstr", $sID, $sTypeRef, $sRefId, $sTypeTag, __Au3Obj_GetMethods($tagInterface), "bool", $fWrapp, "dword", $iTimeOut) + If @error Or Not IsObj($aCall[0]) Then Return SetError(1, 0, 0) + If Not $fWrapp Then _AutoItObject_IUnknownRelease($aCall[0]) + Return $aCall[0] +EndFunc ;==>_AutoItObject_ObjCreateEx + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_ObjectFromDtag +; Description ...: Creates custom object defined with "dtag" interface description string +; Syntax.........: _AutoItObject_ObjectFromDtag($sFunctionPrefix, $dtagInterface [, $fNoUnknown = False]) +; Parameters ....: $sFunctionPrefix - The prefix of the functions you define as object methods +; $dtagInterface - string describing the interface (dtag) +; $fNoUnknown - [optional] NOT an IUnkown-Interface. Do not call "Release" method when out of scope (Default: False, meaining to call Release method) +; Return values .: Success - object type +; Failure - 0 +; Author ........: trancexx +; Modified.......: +; Remarks .......: Main purpose of this function is to create custom objects that serve as event handlers for other objects. +; +Registered callback functions (defined methods) are left for AutoIt to free at its convenience on exit. +; Related .......: _AutoItObject_ObjCreate, _AutoItObject_ObjCreateEx, _AutoItObject_WrapperCreate +; Link ..........: http://msdn.microsoft.com/en-us/library/ms692727(VS.85).aspx +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_ObjectFromDtag($sFunctionPrefix, $dtagInterface, $fNoUnknown = False) + Local $sMethods = __Au3Obj_GetMethods($dtagInterface) + $sMethods = StringReplace(StringReplace(StringReplace(StringReplace($sMethods, "object", "idispatch"), "variant*", "ptr"), "hresult", "long"), "bstr", "ptr") + Local $aMethods = StringSplit($sMethods, @LF, 3) + Local $iUbound = UBound($aMethods) + Local $sMethod, $aSplit, $sNamePart, $aTagPart, $sTagPart, $sRet, $sParams + ; Allocation. Read http://msdn.microsoft.com/en-us/library/ms810466.aspx to see why like this (object + methods): + Local $tInterface = DllStructCreate("ptr[" & $iUbound + 1 & "]", __Au3Obj_CoTaskMemAlloc($__Au3Obj_PTR_SIZE * ($iUbound + 1))) + If @error Then Return SetError(1, 0, 0) + For $i = 0 To $iUbound - 1 + $aSplit = StringSplit($aMethods[$i], "|", 2) + If UBound($aSplit) <> 2 Then ReDim $aSplit[2] + $sNamePart = $aSplit[0] + $sTagPart = $aSplit[1] + $sMethod = $sFunctionPrefix & $sNamePart + $aTagPart = StringSplit($sTagPart, ";", 2) + $sRet = $aTagPart[0] + $sParams = StringReplace($sTagPart, $sRet, "", 1) + $sParams = "ptr" & $sParams + DllStructSetData($tInterface, 1, DllCallbackGetPtr(DllCallbackRegister($sMethod, $sRet, $sParams)), $i + 2) ; Freeing is left to AutoIt. + Next + DllStructSetData($tInterface, 1, DllStructGetPtr($tInterface) + $__Au3Obj_PTR_SIZE) ; Interface method pointers are actually pointer size away + Return _AutoItObject_WrapperCreate(DllStructGetPtr($tInterface), $dtagInterface, $fNoUnknown, True) ; and first pointer is object pointer that's wrapped +EndFunc ;==>_AutoItObject_ObjectFromDtag + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_PtrToIDispatch +; Description ...: Converts IDispatch pointer to AutoIt's object type +; Syntax.........: _AutoItObject_PtrToIDispatch($pIDispatch) +; Parameters ....: $pIDispatch - IDispatch pointer +; Return values .: Success - object type +; Failure - 0 +; Author ........: monoceres, trancexx +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_IDispatchToPtr, _AutoItObject_WrapperCreate +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_PtrToIDispatch($pIDispatch) + Local $aCall = DllCall($ghAutoItObjectDLL, "idispatch", "ReturnThis", "ptr", $pIDispatch) + If @error Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>_AutoItObject_PtrToIDispatch + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_RegisterObject +; Description ...: Registers the object to ROT +; Syntax.........: _AutoItObject_RegisterObject($vObject, $sID) +; Parameters ....: $vObject - Object or object pointer. +; $sID - Object's desired identifier. +; Return values .: Success - Handle of the ROT object. +; Failure - 0 +; Author ........: trancexx +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_UnregisterObject +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_RegisterObject($vObject, $sID) + Local $sTypeObj = "ptr" + If IsObj($vObject) Then $sTypeObj = "idispatch" + Local $aCall = DllCall($ghAutoItObjectDLL, "dword", "RegisterObject", $sTypeObj, $vObject, "wstr", $sID) + If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) + Return $aCall[0] +EndFunc ;==>_AutoItObject_RegisterObject + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_RemoveMember +; Description ...: Removes a property or a function from an AutoIt-object +; Syntax.........: _AutoItObject_RemoveMember(ByRef $oObject, $sMember) +; Parameters ....: $oObject - the object to modify +; $sMember - the name of the member to remove +; Return values .: Success - True +; Failure - 0 +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_AddMethod, _AutoItObject_AddProperty, _AutoItObject_AddEnum +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_RemoveMember(ByRef $oObject, $sMember) + ; Author: Prog@ndy + If Not IsObj($oObject) Then Return SetError(2, 0, 0) + If $sMember = '__default__' Then Return SetError(3, 0, 0) + DllCall($ghAutoItObjectDLL, "none", "RemoveMember", "idispatch", $oObject, "wstr", $sMember) + If @error Then Return SetError(1, @error, 0) + Return True +EndFunc ;==>_AutoItObject_RemoveMember + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_Shutdown +; Description ...: frees the AutoItObject DLL +; Syntax.........: _AutoItObject_Shutdown() +; Parameters ....: $fFinal - [optional] Force shutdown of the library? (Default: False) +; Return values .: Remaining reference count (one for each call to _AutoItObject_Startup) +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: Usage of this function is optonal. The World wouldn't end without it. +; Related .......: _AutoItObject_Startup +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_Shutdown($fFinal = False) + ; Author: Prog@ndy + If $giAutoItObjectDLLRef <= 0 Then Return 0 + $giAutoItObjectDLLRef -= 1 + If $fFinal Then $giAutoItObjectDLLRef = 0 + If $giAutoItObjectDLLRef = 0 Then DllCall($ghAutoItObjectDLL, "ptr", "Initialize", "ptr", 0, "ptr", 0) + Return $giAutoItObjectDLLRef +EndFunc ;==>_AutoItObject_Shutdown + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_Startup +; Description ...: Initializes AutoItObject +; Syntax.........: _AutoItObject_Startup( [$fLoadDLL = False [, $sDll = "AutoitObject.dll"]] ) +; Parameters ....: $fLoadDLL - [optional] specifies whether an external DLL-file should be used (default: False) +; $sDLL - [optional] the path to the external DLL (default: AutoitObject.dll or AutoitObject_X64.dll) +; Return values .: Success - True +; Failure - False +; Author ........: trancexx, Prog@ndy +; Modified.......: +; Remarks .......: Automatically switches between 32bit and 64bit mode if no special DLL is specified. +; Related .......: _AutoItObject_Shutdown +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_Startup($fLoadDLL = False, $sDll = "AutoitObject.dll") + Local Static $__Au3Obj_FunctionProxy = DllCallbackGetPtr(DllCallbackRegister("__Au3Obj_FunctionProxy", "int", "wstr;idispatch")) + Local Static $__Au3Obj_EnumFunctionProxy = DllCallbackGetPtr(DllCallbackRegister("__Au3Obj_EnumFunctionProxy", "int", "dword;wstr;idispatch;ptr;ptr")) + If $ghAutoItObjectDLL = -1 Then + If $fLoadDLL Then + If $__Au3Obj_X64 And @NumParams = 1 Then $sDll = "AutoItObject_X64.dll" + $ghAutoItObjectDLL = DllOpen($sDll) + Else + $ghAutoItObjectDLL = __Au3Obj_Mem_DllOpen() + EndIf + If $ghAutoItObjectDLL = -1 Then Return SetError(1, 0, False) + EndIf + If $giAutoItObjectDLLRef <= 0 Then + $giAutoItObjectDLLRef = 0 + DllCall($ghAutoItObjectDLL, "ptr", "Initialize", "ptr", $__Au3Obj_FunctionProxy, "ptr", $__Au3Obj_EnumFunctionProxy) + If @error Then + DllClose($ghAutoItObjectDLL) + $ghAutoItObjectDLL = -1 + Return SetError(2, 0, False) + EndIf + EndIf + $giAutoItObjectDLLRef += 1 + Return True +EndFunc ;==>_AutoItObject_Startup + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_UnregisterObject +; Description ...: Unregisters the object from ROT +; Syntax.........: _AutoItObject_UnregisterObject($iHandle) +; Parameters ....: $iHandle - Object's ROT handle as returned by _AutoItObject_RegisterObject function. +; Return values .: Success - 1 +; Failure - 0 +; Author ........: trancexx +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_RegisterObject +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_UnregisterObject($iHandle) + Local $aCall = DllCall($ghAutoItObjectDLL, "dword", "UnRegisterObject", "dword", $iHandle) + If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) + Return 1 +EndFunc ;==>_AutoItObject_UnregisterObject + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_VariantClear +; Description ...: Clears the value of a variant +; Syntax.........: _AutoItObject_VariantClear($pvarg) +; Parameters ....: $pvarg - the VARIANT to clear +; Return values .: Success - 0 +; Failure - nonzero +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_VariantFree +; Link ..........: http://msdn.microsoft.com/en-us/library/ms221165.aspx +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_VariantClear($pvarg) + ; Author: Prog@ndy + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "long", "VariantClear", "ptr", $pvarg) + If @error Then Return SetError(1, 0, 1) + Return $aCall[0] +EndFunc ;==>_AutoItObject_VariantClear + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_VariantCopy +; Description ...: Copies a VARIANT to another +; Syntax.........: _AutoItObject_VariantCopy($pvargDest, $pvargSrc) +; Parameters ....: $pvargDest - Destionation variant +; $pvargSrc - Source variant +; Return values .: Success - 0 +; Failure - nonzero +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_VariantRead +; Link ..........: http://msdn.microsoft.com/en-us/library/ms221697.aspx +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_VariantCopy($pvargDest, $pvargSrc) + ; Author: Prog@ndy + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "long", "VariantCopy", "ptr", $pvargDest, 'ptr', $pvargSrc) + If @error Then Return SetError(1, 0, 1) + Return $aCall[0] +EndFunc ;==>_AutoItObject_VariantCopy + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_VariantFree +; Description ...: Frees a variant created by _AutoItObject_VariantSet +; Syntax.........: _AutoItObject_VariantFree($pvarg) +; Parameters ....: $pvarg - the VARIANT to free +; Return values .: Success - 0 +; Failure - nonzero +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: Use this function on variants created with _AutoItObject_VariantSet function (when first parameter for that function is 0). +; Related .......: _AutoItObject_VariantClear +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_VariantFree($pvarg) + ; Author: Prog@ndy + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "long", "VariantClear", "ptr", $pvarg) + If @error Then Return SetError(1, 0, 1) + If $aCall[0] = 0 Then __Au3Obj_CoTaskMemFree($pvarg) + Return $aCall[0] +EndFunc ;==>_AutoItObject_VariantFree + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_VariantInit +; Description ...: Initializes a variant. +; Syntax.........: _AutoItObject_VariantInit($pvarg) +; Parameters ....: $pvarg - the VARIANT to initialize +; Return values .: Success - 0 +; Failure - nonzero +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_VariantClear +; Link ..........: http://msdn.microsoft.com/en-us/library/ms221402.aspx +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_VariantInit($pvarg) + ; Author: Prog@ndy + Local $aCall = DllCall($gh_AU3Obj_oleautdll, "long", "VariantInit", "ptr", $pvarg) + If @error Then Return SetError(1, 0, 1) + Return $aCall[0] +EndFunc ;==>_AutoItObject_VariantInit + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_VariantRead +; Description ...: Reads the value of a VARIANT +; Syntax.........: _AutoItObject_VariantRead($pVariant) +; Parameters ....: $pVariant - Pointer to VARaINT-structure +; Return values .: Success - value of the VARIANT +; Failure - 0 +; Author ........: monoceres, Prog@ndy +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_VariantSet +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_VariantRead($pVariant) + ; Author: monoceres, Prog@ndy + Local $var = DllStructCreate($__Au3Obj_tagVARIANT, $pVariant), $data + ; Translate the vt id to a autoit dllcall type + Local $VT = DllStructGetData($var, "vt"), $type + Switch $VT + Case $__Au3Obj_VT_I1, $__Au3Obj_VT_UI1 + $type = "byte" + Case $__Au3Obj_VT_I2 + $type = "short" + Case $__Au3Obj_VT_I4 + $type = "int" + Case $__Au3Obj_VT_I8 + $type = "int64" + Case $__Au3Obj_VT_R4 + $type = "float" + Case $__Au3Obj_VT_R8 + $type = "double" + Case $__Au3Obj_VT_UI2 + $type = 'word' + Case $__Au3Obj_VT_UI4 + $type = 'uint' + Case $__Au3Obj_VT_UI8 + $type = 'uint64' + Case $__Au3Obj_VT_BSTR + Return __Au3Obj_SysReadString(DllStructGetData($var, "data")) + Case $__Au3Obj_VT_BOOL + $type = 'short' + Case BitOR($__Au3Obj_VT_ARRAY, $__Au3Obj_VT_UI1) + Local $pSafeArray = DllStructGetData($var, "data") + Local $bound, $pData, $lbound + If 0 = __Au3Obj_SafeArrayGetUBound($pSafeArray, 1, $bound) Then + __Au3Obj_SafeArrayGetLBound($pSafeArray, 1, $lbound) + $bound += 1 - $lbound + If 0 = __Au3Obj_SafeArrayAccessData($pSafeArray, $pData) Then + Local $tData = DllStructCreate("byte[" & $bound & "]", $pData) + $data = DllStructGetData($tData, 1) + __Au3Obj_SafeArrayUnaccessData($pSafeArray) + EndIf + EndIf + Return $data + Case BitOR($__Au3Obj_VT_ARRAY, $__Au3Obj_VT_VARIANT) + Return __Au3Obj_ReadSafeArrayVariant(DllStructGetData($var, "data")) + Case $__Au3Obj_VT_DISPATCH + Return _AutoItObject_PtrToIDispatch(DllStructGetData($var, "data")) + Case $__Au3Obj_VT_PTR + Return DllStructGetData($var, "data") + Case $__Au3Obj_VT_ERROR + Return Default + Case Else + Return SetError(1, 0, '') + EndSwitch + + $data = DllStructCreate($type, DllStructGetPtr($var, "data")) + + Switch $VT + Case $__Au3Obj_VT_BOOL + Return DllStructGetData($data, 1) <> 0 + EndSwitch + Return DllStructGetData($data, 1) + +EndFunc ;==>_AutoItObject_VariantRead + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_VariantSet +; Description ...: sets the value of a varaint or creates a new one. +; Syntax.........: _AutoItObject_VariantSet($pVar, $vVal, $iSpecialType = 0) +; Parameters ....: $pVar - Pointer to the VARIANT to modify (0 if you want to create it new) +; $vVal - Value of the VARIANT +; $iSpecialType - [optional] Modify the automatic type. NOT FOR GENERAL USE! +; Return values .: Success - Pointer to the VARIANT +; Failure - 0 +; Author ........: monoceres, Prog@ndy +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_VariantRead +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_VariantSet($pVar, $vVal, $iSpecialType = 0) + ; Author: monoceres, Prog@ndy + If Not $pVar Then + $pVar = __Au3Obj_CoTaskMemAlloc($__Au3Obj_VARIANT_SIZE) + _AutoItObject_VariantInit($pVar) + Else + _AutoItObject_VariantClear($pVar) + EndIf + Local $tVar = DllStructCreate($__Au3Obj_tagVARIANT, $pVar) + Local $iType = $__Au3Obj_VT_EMPTY, $vDataType = '' + + Switch VarGetType($vVal) + Case "Int32" + $iType = $__Au3Obj_VT_I4 + $vDataType = 'int' + Case "Int64" + $iType = $__Au3Obj_VT_I8 + $vDataType = 'int64' + Case "String", 'Text' + $iType = $__Au3Obj_VT_BSTR + $vDataType = 'ptr' + $vVal = __Au3Obj_SysAllocString($vVal) + Case "Double" + $vDataType = 'double' + $iType = $__Au3Obj_VT_R8 + Case "Float" + $vDataType = 'float' + $iType = $__Au3Obj_VT_R4 + Case "Bool" + $vDataType = 'short' + $iType = $__Au3Obj_VT_BOOL + If $vVal Then + $vVal = 0xffff + Else + $vVal = 0 + EndIf + Case 'Ptr' + If $__Au3Obj_X64 Then + $iType = $__Au3Obj_VT_UI8 + Else + $iType = $__Au3Obj_VT_UI4 + EndIf + $vDataType = 'ptr' + Case 'Object' + _AutoItObject_IUnknownAddRef($vVal) + $vDataType = 'ptr' + $iType = $__Au3Obj_VT_DISPATCH + Case "Binary" + ; ARRAY OF BYTES ! + Local $tSafeArrayBound = DllStructCreate($__Au3Obj_tagSAFEARRAYBOUND) + DllStructSetData($tSafeArrayBound, 1, BinaryLen($vVal)) + Local $pSafeArray = __Au3Obj_SafeArrayCreate($__Au3Obj_VT_UI1, 1, DllStructGetPtr($tSafeArrayBound)) + Local $pData + If 0 = __Au3Obj_SafeArrayAccessData($pSafeArray, $pData) Then + Local $tData = DllStructCreate("byte[" & BinaryLen($vVal) & "]", $pData) + DllStructSetData($tData, 1, $vVal) + __Au3Obj_SafeArrayUnaccessData($pSafeArray) + $vVal = $pSafeArray + $vDataType = 'ptr' + $iType = BitOR($__Au3Obj_VT_ARRAY, $__Au3Obj_VT_UI1) + EndIf + Case "Array" + $vDataType = 'ptr' + $vVal = __Au3Obj_CreateSafeArrayVariant($vVal) + $iType = BitOR($__Au3Obj_VT_ARRAY, $__Au3Obj_VT_VARIANT) + Case Else ;"Keyword" ; all keywords and unknown Vartypes will be handled as "default" + $iType = $__Au3Obj_VT_ERROR + $vDataType = 'int' + EndSwitch + If $vDataType Then + DllStructSetData(DllStructCreate($vDataType, DllStructGetPtr($tVar, 'data')), 1, $vVal) + + If @NumParams = 3 Then $iType = $iSpecialType + DllStructSetData($tVar, 'vt', $iType) + EndIf + Return $pVar +EndFunc ;==>_AutoItObject_VariantSet + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_WrapperAddMethod +; Description ...: Adds additional methods to the Wrapper-Object, e.g if you want alternative parameter types +; Syntax.........: _AutoItObject_WrapperAddMethod(ByRef $oWrapper, $sReturnType, $sName, $sParamTypes, $ivtableIndex) +; Parameters ....: $oWrapper - The Object you want to modify +; $sReturnType - the return type of the function +; $sName - The name of the function +; $sParamTypes - the parameter types +; $ivTableIndex - Index of the function in the object's vTable +; Return values .: Success - True +; Failure - 0 +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: +; Related .......: _AutoItObject_WrapperCreate +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_WrapperAddMethod(ByRef $oWrapper, $sReturnType, $sName, $sParamTypes, $ivtableIndex) + ; Author: Prog@ndy + If Not IsObj($oWrapper) Then Return SetError(2, 0, 0) + DllCall($ghAutoItObjectDLL, "none", "WrapperAddMethod", 'idispatch', $oWrapper, 'wstr', $sName, "wstr", StringRegExpReplace($sReturnType & ';' & $sParamTypes, "\s|(;+\Z)", ''), 'dword', $ivtableIndex) + If @error Then Return SetError(1, @error, 0) + Return True +EndFunc ;==>_AutoItObject_WrapperAddMethod + +; #FUNCTION# ==================================================================================================================== +; Name...........: _AutoItObject_WrapperCreate +; Description ...: Creates an IDispatch-Object for COM-Interfaces normally not supporting it. +; Syntax.........: _AutoItObject_WrapperCreate($pUnknown, $tagInterface [, $fNoUnknown = False [, $fCallFree = False]]) +; Parameters ....: $pUnknown - Pointer to an IUnknown-Interface not supporting IDispatch +; $tagInterface - String defining the methods of the Interface, see Remarks for details +; $fNoUnknown - [optional] $pUnknown is NOT an IUnkown-Interface. Do not release when out of scope (Default: False) +; $fCallFree - [optional] Internal parameter. Do not use. +; Return values .: Success - Dispatch-Object +; Failure - 0, @error set +; Author ........: Prog@ndy +; Modified.......: +; Remarks .......: $tagInterface can be a string in the following format (dtag): +; + "FunctionName ReturnType(ParamType1;ParamType2);FunctionName2 ..." +; + - FunctionName is the name of the function you want to call later +; + - ReturnType is the return type (like DLLCall) +; + - ParamType is the type of the parameter (like DLLCall) [do not include the THIS-param] +; + +; +Alternative Format where only method names are listed (ltag) results in different format for calling the functions/methods later. You must specify the datatypes in the call then: +; + $oObject.function("returntype", "1stparamtype", $1stparam, "2ndparamtype", $2ndparam, ...) +; + +; +The reuturn value of a call is always an array (except an error occured, then it's 0): +; + - $array[0] - containts the return value +; + - $array[n] - containts the n-th parameter +; Related .......: _AutoItObject_WrapperAddMethod +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _AutoItObject_WrapperCreate($pUnknown, $tagInterface, $fNoUnknown = False, $fCallFree = False) + If Not $pUnknown Then Return SetError(1, 0, 0) + Local $sMethods = __Au3Obj_GetMethods($tagInterface) + Local $aResult + If $sMethods Then + $aResult = DllCall($ghAutoItObjectDLL, "idispatch", "CreateWrapperObjectEx", 'ptr', $pUnknown, 'wstr', $sMethods, "bool", $fNoUnknown, "bool", $fCallFree) + Else + $aResult = DllCall($ghAutoItObjectDLL, "idispatch", "CreateWrapperObject", 'ptr', $pUnknown, "bool", $fNoUnknown) + EndIf + If @error Then Return SetError(2, @error, 0) + Return $aResult[0] +EndFunc ;==>_AutoItObject_WrapperCreate + +#EndRegion Public UDFs +;-------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Installer/vi_files/UDFs/CommMG.au3 b/Installer/vi_files/UDFs/CommMG.au3 new file mode 100644 index 00000000..1e804a25 --- /dev/null +++ b/Installer/vi_files/UDFs/CommMG.au3 @@ -0,0 +1,942 @@ +;Opt("mustdeclarevars",1) testing only +#cs + UDF for commg.dll + V1.0 Replaces mgcomm.au3 +#ce +Const $sUDFVersion = 'CommMG.au3 V2.7' +Global $mgdebug = false +#cs + Version 2.1.1 Added missing declarations which caused problems in scripts using Opt("MustDeclareVars",1) - thanks to Hannes + Version 2.1 Thanks to jps1x2 for the read/send bte array incentive and testing. + Version 2.0.2 beta changed readbytearray so returns no of bytes read + Version 2.0.1 beta + added _CommSendByteArray and _CommReadByteArray + Version 2.0 - added _CommSwitch. Can now use up to 4 ports. + Version 2.2 - add rts, dtr to setport + added option for flow control = NONE to _CommSetPort + version 2.3 use commg.dll v2.3 which allows any baud rate up to 256000. + Version 2.4 added setTimeouts, SetXonXoffProperties + Version 2.5 add _CommsetTimeouts, _CommSetXonXoffProperties + Version 2.6 added _CommSetRTS, _CommSetDTR + change switch so up to 50 com ports can be open at a time + Version 2.7 added _CommSetDllPath + AutoIt Version: 3.2.3++ + Language: English + + Description: Functions for serial comms using commg2_4.dll + Works with COM ports, USB to Serial converters, Serial to RS424 etc + + Functions available: + _CommGetVersion + _CommSetDllPath + _CommListPorts + _CommSetPort + _CommPortConnection + _CommClearOutputBuffer + _CommClearInputBuffer + _CommGetInputcount + _CommGetOutputcount + _CommSendString + _CommGetString + _CommGetLine + _CommReadByte + _CommReadChar + _CommSendByte + _CommSendBreak; not tested!!!!!!!!!! + _CommCloseport + _CommSwitch + _CommSendByteArray + _CommReadByteArray + _ComSetTimeouts + _ComSetXonXoffProperties + _CommSetRTS + _CommSetDTR + + Author: Martin Gibson +#ce +#include-once + +Global $fPortOpen = False +Global $hDll +Global $DLLNAME = 'commg.dll' + +;=============================================================================== +; +; Function Name: _CommSetDllPath($sFullPath) +; Description: Sets full path to th edll so that it can be in any location. +; +; Parameters: $sFullPath - Full path to the commg.dll e.g. "C:\COMMS\commg.dll" +; Returns; on success 1 +; on error -1 if full path does not exist +;=============================================================================== +Func _CommSetDllPath($sFullPath) + If not FileExists($sFullPath) then return -1 + + $DLLNAME = $sFullPath + return 1 + +EndFunc + + +;=============================================================================== +; +; Function Name: _CommListPorts($iReturnType=1) +; Description: Gets the list of available ports seperated by '|' or as an array +; +; Parameters: $iReturnType - integer:if $iReturnType = 1 then return a string with the list of COM ports seperated by '|' +; if $iReturnType <> 1 then return an array of strings, with element [0] holding the number of COM ports +; Returns; on success - a string eg 'COM1|COM8', or array eg ['2','COM1','COM2'] +; on failure - an empty string and @error set to 1 if dll could not list any ports +; @error set to 2 id dll not open and couldn't be opened + +;=============================================================================== +Func _CommListPorts($iReturnType = 1) + Local $vDllAns, $lpres + If Not $fPortOpen Then + $hDll = DllOpen($DLLNAME) + If $hDll = -1 Then + SetError(2) + ;$sErr = 'Failed to open commg2_2.dll' + Return 0;failed + EndIf + $fPortOpen = True + EndIf + If $fPortOpen Then + $vDllAns = DllCall($hDll, 'str', 'ListPorts') + If @error = 1 Then + SetError(1) + Return '' + Else + + ;mgdebugCW($vDllAns[0] & @CRLF) + If $iReturnType = 1 Then + Return $vDllAns[0] + Else + Return StringSplit($vDllAns[0], '|') + EndIf + + + EndIf + Else + SetError(1) + Return '' + EndIf + + +EndFunc ;==>_CommListPorts + + +;=============================================================================== +; +; Function Name: _Commgetversion($iType = 1) +; Description: Gets the version of the dll if $iType = 1 +; Or the version of this UDF if $iType = 2 +; Parameters: $iType - integer: = 1 to reurn the commg2_2.dll version +; = 2 to return the UDF version +; Returns; on success - a string eg 'V1.3' +; on failure - an empty string and @error set to 1 + +;=============================================================================== + + +Func _CommGetVersion($iType = 1) + Local $vDllAns + If $iType = 2 Then Return $sUDFVersion + + If $fPortOpen Then + $vDllAns = DllCall($hDll, 'str', 'Version') + + If @error = 1 Then + SetError(1) + mgdebugCW('error in get version' & @CRLF) + Return '' + Else + ;mgdebugCW('length of version is ' & stringlen($vDllAns[0]) & @CRLF) + Return $vDllAns[0] + + EndIf + Else + $vDllAns = DllCall($DLLNAME, 'str', 'Version') + If @error = 1 Then + SetError(1) + mgdebugCW('error in get version' & @CRLF) + Return '' + Else + ;mgdebugCW('length of version is ' & stringlen($vDllAns[0]) & @CRLF) + Return $vDllAns[0] + EndIf + EndIf + + +EndFunc ;==>_CommGetVersion + +;=============================================================================== +; +; Function Name: _CommSwitch($channel) +;switches functions to operate on channel 1, 2, 3 to 50 +;returns on succes the channel switched to ie 1 or 2 +; on failure -1 +;Remarks on start up of script channel 1 is selected, so if you only need one COM port +; you don't need to use _CommSwitch +; each channel needs to be set up with _CommSetPort +; The same COM port cannot be used on more than one channel. +;When switch is used the first time on a channel number that port will be inactive +; and the port name will be '' (an empty string) untill it is set with _CommSetport. +;The exception is that on creation channel 1 is always created and used as the +;port so switch is not needed unless more than one port is used. +; The channel number is not related to the COM port number, so channel 1 can +; be set to use COM2 and channel 4 can be set to use COM1 or any available port. +;Any channel number in the range 1 - 50 can be used, so it is possible to use +; the same channel number as the port number, ie switch(21) switches to COM21 +;====================================================================================== +Func _CommSwitch($channel) + Local $vDllAns + + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + if $channel > 50 then return -1 + $vDllAns = DllCall($hDll, 'int', 'switch', 'int', $channel) + + If @error <> 0 Then + SetError(1) + Return -1 + Else + mgdebugCW("COM port selected now is " & _CommPortConnection() & @CRLF) + Return $vDllAns[0] + EndIf + +EndFunc ;==>_CommSwitch + + + +;=========================================================================================================== +; +; Function Name: _CommSetport($iPort,ByRef $sErr,$iBaud=9600,$iBits=8,$vDllAnsar=0,$iStop=1,$iFlow=0,$RTSMode = 0,$DTRMode = 0) +; Description: Initialises the port and sets the parameters +; Parameters: $iPort - integer = the port or COM number to set. Allowed values are 1 or higher. +; NB WIndows refers To COM10 Or higher`as \\.\com10 but only use the number 10, 11 etc +; $sErr - string: the string to hold an error message if func fails. +; $iBaud - integer: the baud rate required. With commg.dll v2.3 and later any value allowed up to 256000. +; With v2.4 any value?? +; If using commg.dll before V2.3 then only allowed values are one of +; 50, 75, 110, 150, 600, 1200, 1800, 2000, 2400, 3600, 4800, 7200, 9600, 10400, +; 14400, 15625, 19200, 28800, 38400, 56000, 57600, 115200, 128000, 256000 +; $iBits - integer: number of bits in code to be transmitted +; $iParity - integer: 0=None,1=Odd,2=Even,3=Mark,4=Space +; $iStop - integer: number of stop bits, 1=1 stop bit 2 = 2 stop bits, 15 = 1.5 stop bits +; $iFlow - integer: 0 sets hardware flow control, +; 1 sets XON XOFF control, +; 2 sets NONE i.e. no flow control. + +; $RTSMode 0= turns on the RTS line when the device is opened and leaves it on +; 1= RTS handshaking. The driver raises the RTS line when the "type-ahead" (input) buffer is less than one-half full and lowers the RTS line when the buffer is more than three-quarters full. +; 2 = the RTS line will be high if bytes are available for transmission. After all buffered bytes have been sent, the RTS line will be low. +; 3 = turns off the RTS line when the port is opened and leaves it off +; $DTRMode 0 = turns on the DTR line when the port is opened and leaves it on +; 1 = enables DTR handshaking +; 2 = disables the DTR line when the device is opened and leaves it disabled. +; Returns; on success - returns 1 and sets $sErr to '' +; on failure - returns 0 and with the error message in $sErr, and sets @error as follows +; @error meaning error with +; 1 dll call failed +; 2 dll was not open and could not be opened +; -1 $iBaud +; -2 $iStop +; -4 $iBits +; -8 $iPort = 0 not allowed +; -16 $iPort not found +; -32 $iPort access denied (in use?) +; -64 unknown error +;Remarks You cannot set the same COM port on more than one channel +;=========================================================================================================== + +Func _CommSetPort($iPort, ByRef $sErr, $iBaud = 9600, $iBits = 8, $iPar = 0, $iStop = 1, $iFlow = 0, $RTSMode = 0, $DTRMode = 0) + Local $vDllAns + $sMGBuffer = '' + $sErr = '' + If Not $fPortOpen Then + $hDll = DllOpen('commg.dll') + If $hDll = -1 Then + SetError(2) + $sErr = 'Failed to open commg.dll' + Return 0;failed + EndIf + $fPortOpen = True + EndIf + mgdebugCW('port = ' & $iPort & ', baud = ' & $iBaud & ', bits = ' & $iBits & ', par = ' & $iPar & ', stop = ' & $iStop & ', flow = ' & $iFlow & @CRLF) + + $vDllAns = DllCall($hDll, 'int', 'SetPort', 'int', $iPort, 'int', $iBaud, 'int', $iBits, 'int', $iPar, 'int', $iStop, 'int', $iFlow, 'int', $RTSMode, 'int', $DTRMode) + If @error <> 0 Then + $sErr = 'dll SetPort call failed' + SetError(1) + Return 0 + EndIf + + If $vDllAns[0] < 0 Then + SetError($vDllAns[0]) + Switch $vDllAns[0] + Case - 1 + $sErr = 'undefined baud rate' + Case - 2 + $sErr = 'undefined stop bit number' + Case - 4 + $sErr = 'undefined data size' + Case - 8 + $sErr = 'port 0 not allowed' + Case - 16 + $sErr = 'port does not exist' + Case - 32 + $sErr = 'access denied, maybe port already in use' + Case - 64 + $sErr = 'unknown error accessing port' + EndSwitch + Return 0 + Else + Return 1 + EndIf + +EndFunc ;==>_CommSetPort + + +;=================================================================================== +; +; Function Name: _CommPortConnection() +; Description: Gets the port connected to the selected channel - see _CommSwitch +; Parameters: None +; Returns; on success - a string eg 'COM5' +; on failure - an empty string and @error set to the rerror set by DllCall +; Remarks - Can be used to verify the port is connected + +;==================================================================================== + +Func _CommPortConnection() + Local $vDllAns + + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + + $vDllAns = DllCall($hDll, 'str', 'Connection');reply is port eg COM8 + + If @error <> 0 Then + SetError(@error) + Return '' + Else + Return $vDllAns[0] + EndIf + + +EndFunc ;==>_CommPortConnection + + + +;===================================================================================== +; +; Function Name: _CommSendString($sMGString,$iWaitComplete=0) +; Description: Sends a string to the connected port on the currently selected channel +; Parameters: $sMGString: the string to send sent without any extra CR or LF added. +; $iWaitComplete- integer:0 = do not wait till string sent +; 1 = wait till sent +; Returns: always 1 +; on success- @error set to 0 +; on failure - @error set to the error returned from DllCall +;====================================================================================== + +Func _CommSendString($sMGString, $iWaitComplete = 0) + ;sends $sMGString on the currently open port + ;returns 1 if ok, returns 0 if port not open/active + Local $vDllAns + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + if $sMGString = '' then return + mgdebugCW("pre sendstring " & @CRLF) + $vDllAns = DllCall($hDll, 'int', 'SendString', 'str', $sMGString, 'int', $iWaitComplete) + If @error <> 0 Then + mgdebugCW("past sendstring(1)" & @CRLF) + SetError(@error) + Return '' + Else + mgdebugCW("past sendstring(2)" & @CRLF) + Return $vDllAns[0] + EndIf + +EndFunc ;==>_CommSendString + + + +;================================================================================ +; +; Function Name: _CommGetstring() +; Description: Get whatever characters are available received by the port for the selected channel +; Parameters: none +; Returns: on success the string and @error is 0 +; if input buffer empty then empty string returned +; on failure an empty string and @error set to the error set by DllCall +; Notes: Use GetLIne to get a whole line treminated by @CR or a defined character. +;================================================================================= + +Func _Commgetstring() + ;get a string NB could be part of a line depending on what is in buffer + Local $vDllAns + + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + ;$sStr1 = '' + ;$vDllAns = DllCall($hDll,'str','GetByte') + $vDllAns = DllCall($hDll, 'str', 'GetString') + + If @error <> 0 Then + SetError(1) + mgdebugCW('error in _commgetstring' & @CRLF) + Return '' + EndIf + Return $vDllAns[0] +EndFunc ;==>_Commgetstring + + +;==================================================================================== +; +; Function Name: _CommGetLine($EndChar = @CR,$maxlen = 10000, $maxtime = 10000) +; Description: Get a string ending in $EndChar +; Parameters: $EndChar the character to indicate the end of the string to return. +; The $EndChar character is included in the return string. +; $MaxLen - integer: the maximum length of a string before +; returning even if $linEnd not received +; If $maxlen is 0 then there is no max number of characters +; $maxtime - integer:the maximum time in mS to wait for the $EndChar before +; returning even if $linEnd not received. +; If $maxtime is 0 then there is no max time to wait +; +; Returns: on success the string and @error is 0 +; If $maxlen characters received without the $lineEnd character, then these +; characters are returned and @error is set To -1. +; If $maxtime passes without receiving the $lineEnd character, then the characters +; received so far are returned and @error is set To -2. +; on failure returns any characters received and sets @error to 1 +;====================================================================================== +Func _CommGetLine($sEndChar = @CR, $maxlen = 0, $maxtime = 0) + Local $vDllAns, $sLineRet, $sStr1, $waited, $sNextChar, $iSaveErr + + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + $sStr1 = ''; $sMGBuffer + $waited = TimerInit() + + While 1;stringinstr($sStr1,$EndChar) = 0 + If TimerDiff($waited) > $maxtime And $maxtime > 0 Then + SetError(-2) + Return $sStr1 + EndIf + + + If StringLen($sStr1) >= $maxlen And $maxlen > 0 Then + SetError(-1) + Return $sStr1 + EndIf + ;$ic = _CommGetInputCount() + $sNextChar = _CommReadChar() + $iSaveErr = @error + If $iSaveErr = 0 And $sNextChar <> '' Then + + $sStr1 = $sStr1 & $sNextChar + ;mgdebugCW($sStr1 & @CRLF) + If $sNextChar = $sEndChar Then ExitLoop + + EndIf + + If $iSaveErr <> 0 Then + SetError(1) + Return $sStr1 + EndIf + + WEnd + + + + Return $sStr1 +EndFunc ;==>_CommGetLine + + + + + +;============================================================================ +; +; Function Name: _CommGetInputCount() +; Description: Get the number of characters available to be read from the port. +; Parameters: none +; Returns: on success a string conversion of the number of characters.(eg '0', '26') +; on failure returns an empty string and sets @error to 1 +;=============================================================================== + +Func _CommGetInputCount() + Local $vDllAns + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + + $vDllAns = DllCall($hDll, 'str', 'GetInputCount') + + If @error <> 0 Then + SetError(1) + Return 0 + Else + Return $vDllAns[0] + + EndIf + + +EndFunc ;==>_CommGetInputCount + + + +;============================================================================ +; +; Function Name: _CommGetOutputCount() +; Description: Get the number of characters waiting to be sent from the port. +; Parameters: none +; Returns: on success a string conversion of the number of characters.(eg '0', '26') +; on failure returns an empty string and sets @error to 1 +;=============================================================================== +Func _CommGetOutputCount() + Local $vDllAns + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + + $vDllAns = DllCall($hDll, 'str', 'GetOutputCount') + + If @error <> 0 Then + SetError(1) + Return '' + Else + Return $vDllAns[0] + EndIf + + +EndFunc ;==>_CommGetOutputCount + + +;================================================================================================ +; +; Function Name: _CommReadByte($wait = 0) + +; Description: Reads the byte as a string +; Parameters: $wait:integer if 0 then if no data to read then return -1 and set @error to 1 +; if <> 0 then does not return untill a byte has been read +; Returns: on success a string conversion of the value of the byte read.(eg '0', '20') +; on failure returns empty string and sets @error to 1 if no data to read and $wait is 0 +; Returns empty string and sets @error to 2 ifDllCall failed +; +;;NB could hang if nothing rec'd when wait is <> 0 +;================================================================================================== +Func _CommReadByte($wait = 0) + Local $iCount, $vDllAns + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + + If Not $wait Then + $iCount = _CommGetInputCount() + If $iCount = 0 Then + SetError(1) + Return '' + EndIf + EndIf + + $vDllAns = DllCall($hDll, 'str', 'GetByte') + + If @error <> 0 Then + SetError(2) + Return '' + EndIf + ;mgdebugCW('byte read was ' & $vDllAns[0] & @CRLF) + Return $vDllAns[0] + +EndFunc ;==>_CommReadByte + +;============================================================================ +; +; Function Name: _CommReadChar($wait = 0) + +; Description: Reads the next Character as a string +; Parameters: $wait:integer if 0 then if no data to read then return -1 and set @error to 1 +; if <> 0 then does not return untill a byte has been read +; Returns: on success a string of 1 character +; on failure returns empty string and sets @error to 1 +; +; +;;NB could hang if nothing rec'd when wait is <> 0 +;=============================================================================== + +Func _CommReadChar($wait = 0) + Local $sChar, $iErr + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + $sChar = _CommReadByte($wait) + + $iErr = @error + If $iErr > 2 Then + SetError(1) + Return '' + EndIf + If $iErr == 0 Then Return Chr(Execute($sChar)) +EndFunc ;==>_CommReadChar + + +;============================================================================ +; Function Name: SendByte($byte,$iWaitComplete=0) + +; Description: Sends the byte value of $byte. $byte must be in range 0 to 255 +; Parameters: $byte the byte to send. +; $iWaitComplete - integer: if 0 then functions returns without +; waiting for byte to be sent +; If <> 0 then waits till byte sent. +; Returns: on success returns 1 +; on failure returns -1 and sets @error to 1 +; +;;NB could hang if byte cannot be sent and $iWaitComplete <> 0 +;=============================================================================== +Func _CommSendByte($byte, $iWaitComplete = 0) + Local $vDllAns + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + $vDllAns = DllCall($hDll, 'int', 'SendByte', 'int', $byte, 'int', $iWaitComplete) + If @error <> 0 Then + SetError(1) + Return -1 + Else + Return $vDllAns[0] + EndIf + +EndFunc ;==>_CommSendByte + + +;=============================================================================== +; Function Name: _CommSendByteArray($pAddr,$iNum,$iWait) + +; Description: Sends the bytes from address $pAddress +; Parameters: $iNum the number of bytes to send. +; $iWaitComplete - integer: if 0 then functions returns without +; waiting for bytes to be sent +; if <> 0 then waits untill all bytes are sent. +; Returns: on success returns 1 +; on failure returns -1 and sets @error to 1 +; +;;NB could hang if byte cannot be sent and $iWaitComplete <> 0 +; could lose data if you send more bytes than the size of the outbuffer. +; the output buffer size is 2048 +;=============================================================================== +Func _CommSendByteArray($pAddr, $iNum, $iWait) + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + Local $vDllAns = DllCall($hDll, 'int', 'SendByteArray', 'ptr', $pAddr, 'int', $iNum, 'int', $iWait) + If @error <> 0 Or $vDllAns[0] = -1 Then + SetError(1) + Return -1 + Else + Return $vDllAns[0] + EndIf + +EndFunc ;==>_CommSendByteArray + + + +;==================================================================================== +; Function Name: _CommReadByteArray($pAddr,$iNum,$iWait) +; +; Description: Reads bytes and writes them to memory starting at address $pAddress +; Parameters: $iNum the number of bytes to read. +; $iWaitComplete - integer: if 0 then the functions returns +; with the available bytes up to $iNum. +; if 1 then waits untill the $iNum bytes received. +; Returns: on success returns the Number of bytes read. +; on failure returns -1 and sets @error to 1 +; +;;NB could hang if bytes are not received and $iWaitComplete <> 0 +; the input buffer size is 4096 +;==================================================================================== +Func _CommReadByteArray($pAddr, $iNum, $iWait) + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + Local $vDllAns = DllCall($hDll, 'int', 'ReadByteArray', 'ptr', $pAddr, 'int', $iNum, 'int', $iWait) + If @error <> 0 Or $vDllAns[0] = -1 Then + SetError(1) + Return -1 + Else + Return $vDllAns[0] + EndIf + + + +EndFunc ;==>_CommReadByteArray + + + + +;=============================================================================== +; Function Name: ClearOutputBuffer() + +; Description: Clears any characters in the out put queue5 +; Parameters: none +; Returns: on success returns 1 +; on failure returns -1 and sets @error to 1 +; +;=============================================================================== +Func _CommClearOutputBuffer() + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + Local $vDllAns = DllCall($hDll, 'int', 'ClearOutputBuffer') + +EndFunc ;==>_CommClearOutputBuffer + +Func _CommClearInputBuffer() + Local $sMGBuffer = '' + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + Local $vDllAns = DllCall($hDll, 'int', 'ClearInputBuffer') + If @error <> 0 Then + Return -1 + Else + Return 1 + EndIf + +EndFunc ;==>_CommClearInputBuffer + + +;=============================================================================== +; Function Name: ClosePort() + +; Description: closes all ports and closes the dll +; Remarks: +; +; Parameters: none + +; Returns: no return value +;=============================================================================== +Func _CommClosePort() + ;_CommClearOutputBuffer() + ;_CommClearInputBuffer() + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + DllCall($hDll, 'int', 'CloseDown') + ; DllClose($hDll) + $fPortOpen = False +EndFunc ;==>_CommClosePort + + + +;================================================================================================ +; Function Name: SendBreak($iDowTime,$iUpTime) +; NB Simulates the break signal used by some equipment to indicate the start of a sequence +; Not tested so might Not work. Any feedback welcome - PM martin on Autoit forum + +; Description: sets the TX line low for $iDowTime, then sets it high for $iUpTime + +; Parameters: $iDowTime - integer: the number of ms to hold the TX line down +; $iUpTime - integer: the number of ms to hold the line up for before returning +; if $iDowTime or $iUpTime is zero then does nothing and returns +; Returns: on success returns 1 +; on failure returns 0 and sets @error to +; = 1 if one of params is zero +; = 2 1 unable to use the DLL file, +; = 3 unknown "return type" from dll +; = 4 "function" not found in the DLL file. + +; Notes : Not tested! +;================================================================================================ +Func _CommSendBreak($iDowTime, $iUpTime);requirescommg2_2.dllv2.0 or later + Local $vDllAns + If $iDowTime = 0 Or $iUpTime = 0 Then + SetError(1) + Return 0 + EndIf + + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + $vDllAns = DllCall($hDll, 'int', 'SendBreak', 'int', $iDowTime, 'int', $iUpTime) + If @error <> 0 Then + SetError(@error + 1) + Return 0 + Else + ;mgdebugCW('done setbreak' & @CRLF) + Return 1;success + EndIf + +EndFunc ;==>_CommSendBreak + + +;=========== _CommSetTimeouts ======================================================================================================== +; Description: Sets the timeouts for the current channel +;Parameters - ReadInt - maximum time allowed to elapse between the arrival of two characters +; - ReadMult - multiplier used to calculate the total timeout period for read operations. +; For each read operation, this value is multiplied by the requested number of bytes to be read. +; - ReadConst - constant used to calculate the total timeout period for read operations. +; For each read operation, this value is added to the product of the ReadMultiplier member and the requested number of bytes. +; - WriteMult - multiplier used to calculate the total timeout period for write operations. +; For each write operation, this value is multiplied by the number of bytes to be written. +; - WriteConst - constant used to calculate the total time-out period for write operations. +; For each write operation, this value is added to the product of the WriteMultiplier member and the number of bytes to be written. +; if a parameter is set to 0 it means that timeout will not be used. All values are at zero when a port is opened. +; Return 1 on success +; 0 on failure +;============================================================================================================================================================= +Func _CommSetTimeouts($ReadInt = 0, $ReadMult = 0, $ReadConst = 0, $WriteMult = 0, $WriteConst = 0) + Local $vDllAns + + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + $vDllAns = DllCall($hDll, 'int', 'SetTimeouts', 'int', $ReadInt, 'int', $ReadMult, 'int', $ReadConst, 'int', $WriteMult, 'int', $WriteConst) + If @error <> 0 Then + SetError(@error + 1) + Return 0 + Else + Return $vDllAns[0] + EndIf +EndFunc ;==>_CommSetTimeouts + + +;====================== SetXonXoffProperties ======================================================================= +; Description: Set the values used for the XON and XOFF characters, and when these charactyers are to be transmitted +; Parameters - $XonChar - the ASCII code for the character to be sent to indicate the port is ready to receive +; - $XoffChar - the ASCII code fo rthe character to be sent to stop receiving +; - $XonStart - when the number of characters in the input buffer falls below this value the XonChar will be sent +; - $XoffStop - when the number of bytes free in the input buffer falls below this value the XoffChar will be sent +;When a port is opened the values are as the defaults for the function. +;Return - on success 1 +; - on error 0 if error making dllcall and @error set to 1 +; -1 illegal XonChar value +; -2 illegal XoffChar value +; +Func _CommSetXonXoffProperties($XonChar = 0x11, $XoffChar = 0x13, $XonStart = 0, $XoffStop = 0) + Local $vDllAns + + + + If $XonChar > 255 Or $XonChar < 0 Then Return -1 + If $XoffChar > 255 Or $XoffChar < 0 Then Return -2 + + + $vDllAns = DllCall($hDll, 'int', 'SetXonXoffProperties', 'byte', $XonChar, 'byte', $XoffChar, 'int', $XonStart, 'int', $XoffStop) + If @error <> 0 Then + SetError(@error + 1) + Return 0 + Else + Return $vDllAns[0] + EndIf + +EndFunc ;==>_CommSetXonXoffProperties + +func mgdebugCW($sDB) +if not $mgdebug then Return +ConsoleWrite($sDB) + +EndFunc + + + +;=================================================================================== +; +; Function Name: _CommSetRTS() +; Description: Sets or restets the RTS signal for to the selected channel - see _CommSwitch +; Parameters: $iSet = 1 to set 0 to reset +; Returns; 1 on success +; on failure -1 and @error set to 1 +;==================================================================================== + +Func _CommSetRTS($iSet) + Local $vDllAns + + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + + $vDllAns = DllCall($hDll, 'int', 'SetRTS','int',$iSet) + + If @error <> 0 Then + SetError(1) + Return 0 + Else + Return 1 + EndIf + + +EndFunc + + +;=================================================================================== +; +; Function Name: _CommSetDTR() +; Description: Sets or restets the RTS signal for to the selected channel - see _CommSwitch +; Parameters: $iSet = 1 to set 0 to reset +; Returns; 1 on success +; on failure -1 and @error set to 1 +;==================================================================================== + +Func _CommSetDTR($iSet) + Local $vDllAns + + If Not $fPortOpen Then + SetError(1) + Return 0 + EndIf + + + $vDllAns = DllCall($hDll, 'int', 'SetDTR','int',$iSet) + + If @error <> 0 Then + SetError(1) + Return 0 + Else + Return 1 + EndIf + + +EndFunc + diff --git a/Installer/vi_files/UDFs/CompareFileTimeEx.au3 b/Installer/vi_files/UDFs/CompareFileTimeEx.au3 new file mode 100644 index 00000000..72f84cd7 --- /dev/null +++ b/Installer/vi_files/UDFs/CompareFileTimeEx.au3 @@ -0,0 +1,23 @@ +Func _CompareFileTimeEx($hSource, $hDestination, $iMethod) + ;Parameters ....: $hSource - Full path to the first file + ; $hDestination - Full path to the second file + ; $iMethod - 0 The date and time the file was modified + ; 1 The date and time the file was created + ; 2 The date and time the file was accessed + ;Return values .: -1 The Source file time is earlier than the Destination file time + ; 0 The Source file time is equal to the Destination file time + ; 1 The Source file time is later than the Destination file time + ;Author ........: Ian Maxwell (llewxam @ AutoIt forum) + $aSource = FileGetTime($hSource, $iMethod, 0) + $aDestination = FileGetTime($hDestination, $iMethod, 0) + For $a = 0 To 5 + If $aSource[$a] <> $aDestination[$a] Then + If $aSource[$a] < $aDestination[$a] Then + Return -1 + Else + Return 1 + EndIf + EndIf + Next + Return 0 +EndFunc ;==>_CompareFileTimeEx \ No newline at end of file diff --git a/Installer/vi_files/UDFs/FileInUse.au3 b/Installer/vi_files/UDFs/FileInUse.au3 new file mode 100644 index 00000000..9d9d08dd --- /dev/null +++ b/Installer/vi_files/UDFs/FileInUse.au3 @@ -0,0 +1,29 @@ +;=============================================================================== +; Function Name: _FileInUse() +; Description: Checks if file is in use +; Parameter(s): $sFilename = File name +; Return Value(s): 1 - file in use (@error contains system error code) +; 0 - file not in use +; Author: Siao (http://www.autoitscript.com/forum/index.php?showtopic=53994&view=findpost&p=410020) +;=============================================================================== +Func _FileInUse($sFilename) + Local $aRet, $hFile + $aRet = DllCall("Kernel32.dll", "hwnd", "CreateFile", _ + "str", $sFilename, _ ;lpFileName + "dword", 0x80000000, _ ;dwDesiredAccess = GENERIC_READ + "dword", 0, _ ;dwShareMode = DO NOT SHARE + "dword", 0, _ ;lpSecurityAttributes = NULL + "dword", 3, _ ;dwCreationDisposition = OPEN_EXISTING + "dword", 128, _ ;dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL + "hwnd", 0) ;hTemplateFile = NULL + $hFile = $aRet[0] + If $hFile = -1 Then ;INVALID_HANDLE_VALUE = -1 + $aRet = DllCall("Kernel32.dll", "int", "GetLastError") + SetError($aRet[0]) + Return 1 + Else + ;close file handle + DllCall("Kernel32.dll", "int", "CloseHandle", "hwnd", $hFile) + Return 0 + EndIf +EndFunc diff --git a/Installer/vi_files/UDFs/GoogleEarth.au3 b/Installer/vi_files/UDFs/GoogleEarth.au3 new file mode 100644 index 00000000..d81f86de --- /dev/null +++ b/Installer/vi_files/UDFs/GoogleEarth.au3 @@ -0,0 +1,49 @@ +Func _GoogleEarth_Initialize() + Local $oGoogleEarth = ObjCreate("GoogleEarth.ApplicationGE") + If @error <> 1 Then + While 1 + If $oGoogleEarth.IsOnline() = 1 Or $oGoogleEarth.IsInitialized() = 1 Then ExitLoop + WEnd + Return ($oGoogleEarth) + Else + SetError(1) + EndIf +EndFunc ;==>GoogleEarth_Initialize + +Func _GoogleEarth_GetPointonTerrain($oGoogleEarth, $x, $y) + Local $opointOnTerrain = $oGoogleEarth.GetPointOnTerrainFromScreenCoords($x, $y) + Local $PointArr[3] + $PointArr[0] = $opointOnTerrain.latitude + $PointArr[1] = $opointOnTerrain.longitude + $PointArr[2] = $opointOnTerrain.Altitude + Return($PointArr) +EndFunc ;==>GoogleEarth_GetPointonTerrain + +Func _GoogleEarth_ZoomTo($oGoogleEarth, $N, $W, $alt, $range, $tilt, $az, $mode = 1, $speed = 5.0) + $oGoogleEarth.SetCameraParams($N, $W, $alt, $mode, $range, $tilt, $az, $speed) ; zoom to a custom locus +EndFunc ;==>GoogleEarth_ZoomTo + +Func _GoogleEarth_ScreenShot($oGoogleEarth, $directory, $quality = 100) + $oGoogleEarth.SaveScreenShot($directory, $quality) ; take a snapshot +EndFunc ;==>GoogleEarth_ScreenShot + +Func _GoogleEarth_OpenKmlFile($oGoogleEarth, $fileName, $suppressMessages = True) + $oGoogleEarth.OpenKmlFile($fileName, $suppressMessages) +EndFunc ;==>GoogleEarth_OpenKmlFile + +Func _GoogleEarth_LoadKmlData($oGoogleEarth, $kmlData) + $oGoogleEarth.LoadKmlData($kmlData) +EndFunc ;==>GoogleEarth_LoadKmlData + +Func _GoogleEarth_GetCameraInfo($oGoogleEarth, $considerTerrain = True) + Local $oCameraInfo = $oGoogleEarth.GetCamera($considerTerrain) + Local $CamDataArr[7] + $CamDataArr[0] = $oCameraInfo.FocusPointLatitude + $CamDataArr[1] = $oCameraInfo.FocusPointLongitude + $CamDataArr[2] = $oCameraInfo.FocusPointAltitude + $CamDataArr[3] = $oCameraInfo.FocusPointAltitudeMode + $CamDataArr[4] = $oCameraInfo.Range + $CamDataArr[5] = $oCameraInfo.Tilt + $CamDataArr[6] = $oCameraInfo.Azimuth + Return $CamDataArr +EndFunc ;==>GoogleEarth_GetCameraInfo \ No newline at end of file diff --git a/Installer/vi_files/UDFs/HTTP.au3 b/Installer/vi_files/UDFs/HTTP.au3 new file mode 100644 index 00000000..72f34287 --- /dev/null +++ b/Installer/vi_files/UDFs/HTTP.au3 @@ -0,0 +1,454 @@ +; =================================================================== +; HTTP UDF's +; v0.5 +; +; By: Greg "Overload" Laabs +; Last Updated: 07-22-06 +; Tested with AutoIt Version 3.1.1.131 +; Extra requirements: Nothing! +; +; A set of functions that allow you to download webpages and submit +; POST requests. +; +; Main functions: +; _HTTPConnect - Connects to a webserver +; _HTTPGet - Submits a GET request to a webserver +; _HTTPPost - Submits a POST request to a webserver +; _HTTPRead - Reads the response from a webserver +; =================================================================== + + +TCPStartup() + +Global $_HTTPUserAgent = "AutoItScript/"&@AutoItVersion +Global $_HTTPLastSocket = -1 +Global $_HTTPRecvTimeout = 5000 + +; =================================================================== +; _HTTPSetUserAgent($Program, $Version) +; +; Sets the User-Agent that will be sent with all future _HTTP +; functions. If this is never called, the user agent is set to +; AutoItScript/[YourAutoItVersion] +; Parameters: +; $Program - IN - The name of the program +; $Version - IN - The version number of the program +; Returns: +; None +; =================================================================== +Func _HTTPSetUserAgent($Program, $Version) + $_HTTPUserAgent = $Program&"/"&$Version +EndFunc + +; =================================================================== +; _HTTPConnect($host, [$port]) +; +; Opens a connection to $host on the port you supply (or 80 if you don't supply a port. Returns the socket of the connection. +; Parameters: +; $host - IN - The hostname you want to connect to. This should be in the format "www.google.com" or "localhost" +; $port - OPTIONAL IN - The port to connect on. 80 is default. +; Returns: +; The socket of the connection. +; Remarks: +; Possible @errors: +; 1 - Unable to open socket - @extended is set to Windows API WSAGetLasterror return +; =================================================================== +Func _HTTPConnect($host, $port = 80) + Dim $ip = TCPNameToIP ( $host ) + Dim $socket = TCPConnect ( $ip, 80 ) + + If ($socket == -1) Then + SetError(1, @error) + Return -1 + EndIf + + $_HTTPLastSocket = $socket + SetError(0) + Return $socket +EndFunc + +; Possible @errors: +; 1 - No socket +Func _HTTPClose($socket = -1) + If $socket == -1 Then + If $_HTTPLastSocket == -1 Then + SetError(1) + Return 0 + EndIf + $socket = $_HTTPLastSocket + EndIf + TCPCloseSocket($socket) + + SetError(0) + Return 1 +EndFunc + + +; =================================================================== +; _HTTPGet($host, $page, [$socket]) +; +; Executes a GET request on an open socket. +; Parameters: +; $host - IN - The hostname you want to get the page from. This should be in the format "www.google.com" or "localhost" +; $page - IN - The the file you want to get. This should always start with a slash. Examples: "/somepage.php" or "/somedirectory/somefile.zip" +; $socket - OPTIONAL IN - The socket opened by _HTTPConnect. If this is not supplied, the last socket opened with _HTTPConnect will be used. +; Returns: +; The number of bytes sent in the request. +; Remarks: +; Possible @errors: +; 1 - No socket supplied and no current socket exists +; 2 - Error sending to socket. Check @extended for Windows API WSAGetError return +; =================================================================== +Func _HTTPGet($host, $page, $socket = -1) + Dim $command + + If $socket == -1 Then + If $_HTTPLastSocket == -1 Then + SetError(1) + Return + EndIf + $socket = $_HTTPLastSocket + EndIf + + $command = "GET "&$page&" HTTP/1.1"&@CRLF + $command &= "Host: " &$host&@CRLF + $command &= "User-Agent: "&$_HTTPUserAgent&@CRLF + $command &= "Connection: close"&@CRLF + $command &= ""&@CRLF + + Dim $bytessent = TCPSend($socket, $command) + + If $bytessent == 0 Then + SetExtended(@error) + SetError(2) + return 0 + EndIf + + SetError(0) + Return $bytessent +EndFunc + +; =================================================================== +; _HTTPPost($host, $page, [$socket]) +; +; Executes a POST request on an open socket. +; Parameters: +; $host - IN - The hostname you want to get the page from. This should be in the format "www.google.com" or "localhost" +; $page - IN - The the file you want to get. This should always start with a slash. Examples: "/" or "/somedirectory/submitform.php" +; $socket - OPTIONAL IN - The socket opened by _HTTPConnect. If this is not supplied, the last socket opened with _HTTPConnect will be used. +; $data - OPTIONAL IN - The data to send in the post request. This should first be run through _HTTPEncodeString() +; Returns: +; The number of bytes sent in the request. +; Remarks: +; Possible @errors: +; 1 - No socket supplied and no current socket exists +; 2 - Error sending to socket. Check @extended for Windows API WSAGetError return +; =================================================================== +Func _HTTPPost($host, $page, $socket = -1, $data = "") + Dim $command + + If $socket == -1 Then + If $_HTTPLastSocket == -1 Then + SetError(1) + Return + EndIf + $socket = $_HTTPLastSocket + EndIf + + Dim $datasize = StringLen($data) + + $command = "POST "&$page&" HTTP/1.1"&@CRLF + $command &= "Host: " &$host&@CRLF + $command &= "User-Agent: "&$_HTTPUserAgent&@CRLF + $command &= "Connection: close"&@CRLF + $command &= "Content-Type: application/x-www-form-urlencoded"&@CRLF + $command &= "Content-Length: "&$datasize&@CRLF + $command &= ""&@CRLF + $command &= $data&@CRLF + + Dim $bytessent = TCPSend($socket, $command) + + If $bytessent == 0 Then + SetExtended(@error) + SetError(2) + return 0 + EndIf + + SetError(0) + Return $bytessent +EndFunc + +; =================================================================== +; _HTTPRead([$socket], [$flag]) +; +; Retrieves data from an open socket. This should only be called after _HTTPGet or _HTTPPost is called. +; Parameters: +; $socket - OPTIONAL IN - The socket you want to receive data from. If this is not supplied, the last socket opened with _HTTPConnect will be used. +; $flag - OPTIONAL IN - Determines how the data will be returned. See Remarks. +; Returns: +; See "Flags" in remarks, below. +; Remarks: +; Possible @errors: +; 1 - No socket +; 3 - Timeout reached before any data came through the socket +; 4 - Some data came through, but not all of it. Return value is the number of bytes received. +; 5 - Unable to parse HTTP Response from server. Return value is the HTTP Response line +; 6 - Unexpected header data returned. Return value is the line that caused the error +; 7 - Invalid flag +; 8 - Unable to parse chunk size. Return value is the line that caused the error +; Flags: +; 0 - Return value is the body of the page (default) +; 1 - Return value is an array: +; [0] = HTTP Return Code +; [1] = HTTP Return Reason (human readable return code like "OK" or "Forbidden" +; [2] = HTTP Version +; [3] = Two dimensional array with the headers. Each item has: +; [0] = Header name +; [1] = Header value +; [4] = The body of the page +; =================================================================== +Func _HTTPRead($socket = -1, $flag = 0) + If $socket == -1 Then + If $_HTTPLastSocket == -1 Then + SetError(1) + Return + EndIf + $socket = $_HTTPLastSocket + EndIf + + Dim $timer = TimerInit() + Dim $performancetimer = TimerInit() + Dim $downloadtime = 0 + + Dim $headers[1][2] ; An Array of the headers found + Dim $numheaders = 0 ; The number of headers found + Dim $body = "" ; The body of the message + Dim $HTTPVersion ; The HTTP version of the server (almost always 1.1) + Dim $HTTPResponseCode ; The HTTP response code like 200, or 404 + Dim $HTTPResponseReason ; The human-readable response reason, like "OK" or "Not Found" + Dim $bytesreceived = 0 ; The total number of bytes received + Dim $data = "" ; The entire raw message gets put in here. + Dim $chunked = 0 ; Set to 1 if we get the "Transfer-Encoding: chunked" header. + Dim $chunksize = 0 ; The size of the current chunk we are processing. + Dim $chunkprocessed = 0 ; The amount of data we have processed on the current chunk. + Dim $contentlength ; The size of the body, if NOT using chunked transfer mode. + Dim $part = 0 ; Refers to what part of the data we're currently parsing: + ; 0 - Nothing parsed, so HTTP response should come next + ; 1 - Currently parsing headers + ; 2 - Currently waiting for the next chunk size - this is skipped if the transfer-encoding is not chunked + ; 3 - Currently waiting for or parsing body data + ; 4 - Currently parsing footers + While 1 + Sleep(10) + Dim $recv = TCPRecv($socket,16) + If @error <> 0 Then + ;ConsoleWrite("Server closed connection") + ;@error appears to be -1 after the server closes the connection. A good way to tell that we're finished, because we always send + ;the "Connection: close" header to the server. + ; !!! This is no longer used because we can now tell that we're done by checking the content-length header or properly handling + ; chunked data. + EndIf + + If $recv <> "" Then + $bytesreceived = $bytesreceived + StringLen($recv) + $timer = TimerInit() + $data &= $recv +;~ ConsoleWrite("Bytes downloaded: "&$bytesreceived&@CRLF) + EndIf + + Dim $split = StringSplit($data,@CRLF,1) + $data = "" + Dim $i + For $i=1 To $split[0] + If $i=$split[0] Then + If $part < 2 OR $chunked = 1 Then + ; This is tricky. The last line we've received might be truncated, so we only want to process it under special cases. + ; Non chunked data doesn't always send a CRLF at the end so there's no way to tell if this is truly the last line without parsing it. + ; However, we don't want to parse it if it's only a partial header or something. + ; The solution: We will only process this last line if we're at the body section and the transfer-encoding is NOT chunked. + $data = $split[$i] + ExitLoop + EndIf + EndIf + + Dim $newpart = $part + Switch $part + Case 0 ; Nothing parsed, so HTTP response should come next + If $split[$i] <> "" Then + Dim $regex = StringRegExp($split[$i],"^HTTP/([0-9.]+) ([0-9]+) ([a-zA-Z0-9 ]+)$",3) + If @error <> 0 Then + SetError(5) + Return $split[$i] + Else + $HTTPVersion = $regex[0] + $HTTPResponseCode = $regex[1] + $HTTPResponseReason = $regex[2] + If $HTTPResponseCode <> 100 Then + $newpart = 1 + EndIf + EndIf + EndIf + Case 1, 4 ; Currently parsing headers or footers + ;If the line is blank, then we're done with headers and the body is next + If $split[$i] == "" Then + If $part = 1 Then + If $chunked Then + $newpart = 2 + Else + $newpart = 3 + EndIf + ElseIf $part = 4 Then + ; If $part is 4 then we're processing footers, so we're all done now. + ExitLoop 2 + EndIf + Else ;The line wasn't blank + ;Check to see if the line begins with whitespace. If it does, it's actually + ;a continuation of the previous header + Dim $regex = StringRegExp($split[$i], "^[ \t]+([^ \t].*)$", 3) + If @error <> 1 Then + If $numheaders == 0 Then + SetError(6) + Return $split[$i] + EndIf + $headers[$numheaders-1][1] &= $regex[0] + Else;The line didn't start with a space + Dim $regex = StringRegExp($split[$i],"^([^ :]+):[ \t]*(.*)$",3) + If @error <> 1 Then + ;This is a new header, so add it to the array + $numheaders = $numheaders + 1 + ReDim $headers[$numheaders][2] + $headers[$numheaders-1][0] = $regex[0] + $headers[$numheaders-1][1] = $regex[1] + + ; There are a couple headers we need to know about. We'll process them here. + If $regex[0] = "Transfer-Encoding" AND $regex[1] = "chunked" Then + $chunked = 1 + ElseIf $regex[0] = "Content-Length" Then + $contentlength = Int($regex[1]) + EndIf + Else + SetError(6) + Return $split[$i] + EndIf + EndIf + EndIf + Case 2 ; Awaiting chunk size + $regex = StringRegExp($split[$i],"^([0-9a-f]+);?.*$",3) + If @error <> 0 Then + SetError(8) + Return $split[$i] + EndIf + $chunksize = $regex[0] + $chunksize = Dec($chunksize) + $chunkprocessed = 0 + + If $chunksize == 0 Then + $newpart = 4 + Else + $newpart = 3 + EndIf + Case 3 ; Awaiting body data + $body &= $split[$i] + + $chunkprocessed = $chunkprocessed + StringLen($split[$i]) + + If $chunked Then + If $chunkprocessed >= $chunksize Then + $newpart = 2 + Else + $body &= @CRLF + $chunkprocessed = $chunkprocessed + 2; We add 2 for the CRLF we stipped off. + EndIf + Else + If $chunkprocessed >= $contentlength Then + ExitLoop 2 + Else + If $i < $split[0] Then + ; Only add a CRLF if this is not the last line received. + $body &= @CRLF + $chunkprocessed = $chunkprocessed + 2; We add 2 for the CRLF we stipped off. + EndIf + EndIf + EndIf + Case Else + ; This should never happen + EndSwitch + $part = $newpart + Next + + If $bytesreceived == 0 AND TimerDiff($timer) > $_HTTPRecvTimeout Then + SetError(3) + Return 0 + ElseIf $bytesreceived > 0 AND TimerDiff($timer) > $_HTTPRecvTimeout Then + ConsoleWrite($body) + SetError(4) + Return $bytesreceived + EndIf + WEnd + $downloadtime = TimerDiff($performancetimer) + ;ConsoleWrite("Performance: Download time: "&$downloadtime&@CRLF) + + Switch $flag + Case 0 + SetError(0) + Return $body + Case 1 + Dim $return[5] + $return[0] = $HTTPResponseCode + $return[1] = $HTTPResponseReason + $return[2] = $HTTPVersion + $return[3] = $headers + $return[4] = $body + SetError(0) + Return $return + Case Else + SetError(7) + Return 0 + EndSwitch +EndFunc + +; =================================================================== +; _HTTPEncodeString($string) +; +; Encodes a string so it can safely be transmitted via HTTP +; Parameters: +; $string - IN - The string to encode +; Returns: +; A valid encoded string that can be used as GET or POST variables. +; =================================================================== +Func _HTTPEncodeString($string) + Local Const $aURIValidChars[256] = _ + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _ + 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, _ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, _ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, _ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + + Local $sEncoded = "" + For $i = 1 To StringLen($string) + Local $c = StringMid($string, $i, 1) + If $c = " " Then $c = "+" + If Number($aURIValidChars[Asc($c) ]) Then + $sEncoded &= $c + Else + $sEncoded &= StringFormat("%%%02X", Asc($c)) + EndIf + Next + + Return $sEncoded +EndFunc ;==>_WebComposeURL + +Func _HTTPPost_contenttype($file = "") + $fileextension = StringRight($file,4) +; I blieve these are the only 2 types that matter when uploading + Switch $fileextension + Case ".txt" + $contenttype = "text/plain" + Case Else + $contenttype = "application/octet-stream" + EndSwitch + Return $contenttype +EndFunc \ No newline at end of file diff --git a/Installer/vi_files/UDFs/JSON.au3 b/Installer/vi_files/UDFs/JSON.au3 new file mode 100644 index 00000000..79ababad --- /dev/null +++ b/Installer/vi_files/UDFs/JSON.au3 @@ -0,0 +1,959 @@ +#include-once + +#comments-start + JSON.au3 an RFC4627-compliant JSON UDF Library + Written by Gabriel Boehme, version 0.9.1 (2009-10-19) + Modified by guinness (02/03/2012) + for AutoIt v3.3.0.0 or greater + + thanks to: + Douglas Crockford, for writing the original JSON conversion code in Javascript (circa 2005-07-15), + which provided the starting point for this library + + general notes: + visit http://www.JSON.org/ for more information about JSON + this library conforms to the official JSON specifications given in RFC4627 + ? http://www.ietf.org/rfc/rfc4627.txt?number=4627 + + system dependencies: + the Scripting.Dictionary ActiveX/COM object + ? used internally for testing key uniqueness in JSON objects, and generating empty AutoIt arrays + ? should be available on Windows 98 or later, or any Windows system with IE 5 or greater installed + ? Scripting.Dictionary documentation can be found online at: + http://www.devguru.com/Technologies/vbscript/quickref/dictionary.html + http://www.csidata.com/custserv/onlinehelp/VBSdocs/vbs390.htm + http://msdn2.microsoft.com/en-us/library/x4k5wbx4.aspx + + notes on decoding: + this decoder implements all required functionality specified in RFC4627 + notes on decoding certain JSON data types: + ? null + AutoIt currently has no native null-type value + this library uses $_JSONNull to represent null, defined using the default keyword + ? be sure to use the JSON null abstractions provided within this library, as this definition of null may change in future + ? arrays + JSON arrays are decoded as-is to one-dimensional AutoIt arrays + empty arrays ARE possible + ? AutoIt does not currently allow us to define empty arrays within the language itself + ? nevertheless, they can be returned from functions, and processed like any other array + ? empty JSON arrays will be returned as empty AutoIt arrays + ? objects + a special two-dimensional array is used to represent a JSON object + ? $o[$i][0] = the key, $o[$i][1] = the value, for any $i >= 1 + this should provide compatibility with the 2D array-handling functions in the standard Array.au3 UDF + ? to uniquely identify the 2D array as a JSON object, $o[0] will always contain the following: + $o[0][0] = $_JSONNull, $o[0][1] = 'JSONObject' + a decoding error occurs if the JSON text specifies an object with duplicate key values [RFC4627:2.2] + ? this error can be suppressed by using the optional $allowDuplicatedObjectKeys parameter + this means that the LAST value specified for that key wins (i.e., the earlier value for that key is overwritten) + additionally, the following (non-RFC4627-compliant) decoding extensions have been implemented: + ? objects and arrays + whitespace may substitute for commas between elements + ? this eliminates the annoyance of having to manage commas when manually updating indented JSON text + ? objects + keys can be specified without quotes, as long as theyre alphanumeric (i.e., composed of only ASCII letters, numbers, underscore) + unquoted keys beginning with a digit (0-9) will first be decoded as numbers, then converted to string + ? strings + allowed to be delimited by either single or double quotes + additional escape sequences allowed: + ? \' single quote allows single quotes to be specified within a single-quoted string + ? \v vertical tab equivalent to \u000B + ? numbers + allowed to have leading zeroes, which are ignored (i.e., they do NOT signal an octal number) + allowed to have a leading plus sign + hexadecimal integer notation (0x) is allowed + ? hex integers are always interpreted as unsigned + ? a negative sign should be used to indicate negative hex integers (e.g., -0xF = -15) + ? Javascript-style comments + // Javascript line comments are allowed + /* Javascript block comments are allowed */ + ? whitespace between identifiers + \u0020 (space) and \u0009 thru \u000D (tab thru carriage return) are regarded as whitespace + this matches the definition of the native AutoIt3 stringIsSpace() function, which is used to determine whitespace in this library + + notes on encoding: + by default, this encoder conforms strictly to RFC4627 when producing output + notes on encoding AutoIt data types: + ? arrays + all one-dimensional AutoIt arrays will be encoded as-is to JSON arrays + for two-dimensional AutoIt arrays, only those representing JSON objects are supported + ? all JSON object keys ($a[$i][0] of the 2D array) will be encoded as strings, as required by RFC4627 + ? if duplicate key strings are encountered, the FIRST one wins (i.e., later key duplicates will be ignored) + ? strings + as JSON is a unicode data format, it is assumed that nearly all characters can be encoded as themselves + a RegExp is used internally to escape certain characters (control characters, etc.) + ? numbers + the default AutoIt number-to-string conversion is used, which produces JSON-compatible output + ? booleans + encoded normally + ? $_JSONNull + encoded as null (obviously) + ? anything else + any unsupported data type will be quietly encoded as null, and will flag a warning + ? BitAnd(@error,1) will return 1, and @extended will contain a count of the total number of unsupported values encountered + use a translator function to convert unsupported values to supported values when encoding + NON-RFC4627-COMPLIANT OPTION: when indenting, the optional $omitCommas parameter can be used + ? produces indented output WITHOUT commas between object or array elements + ? complements the ability of this decoder to allow whitespace to substitute for commas (see above) + + to do: + continue revising & testing error handling (bit of a mess at the moment) + ? continue adding $_JSONErrorMessage asssignments + check against VB version, to mirror the same level of detailed error reporting where applicable + ? figure out how to make better use of AutoIt error handling in general + start adding UDF function comments (see String.au3 or Array.au3 for examples) + remove dependency on Scripting.Dictionary? + ? wed need to figure out other ways to: + efficiently test key uniqueness for JSON objects + obtain empty AutoIt arrays + + legal: + Copyright 2007-2009 Gabriel Boehme + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the Software), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + The Software shall be used for Good, not Evil. + + THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +#comments-end + +;=============================================================================== +; JSON general functions +;=============================================================================== + +; since AutoIt does not have a native null value, we currently use default to uniquely identify null values +; always use _JSONIsNull() to test for null, as this definition may change in future +Global Const $_JSONNull = Default + +Func _JSONIsNull($v) + ; uniquely identify $_JSONNull + Return $v == Default +EndFunc ;==>_JSONIsNull + +;------------------------------------------------------------------------------- +; returns a new array, optionally populated with the parameters specified +; if no parameters are specified, returns an empty array very handy as AutoIt doesnt let you do this natively +;------------------------------------------------------------------------------- +Func _JSONArray($p0 = 0, $p1 = 0, $p2 = 0, $p3 = 0, $p4 = 0, $p5 = 0, $p6 = 0, $p7 = 0, $p8 = 0, $p9 = 0, $p10 = 0, $p11 = 0, $p12 = 0, $p13 = 0, $p14 = 0, $p15 = 0, $p16 = 0, $p17 = 0, $p18 = 0, $p19 = 0, $p20 = 0, $p21 = 0, $p22 = 0, $p23 = 0, $p24 = 0, $p25 = 0, $p26 = 0, $p27 = 0, $p28 = 0, $p29 = 0, $p30 = 0, $p31 = 0) + If @NumParams Then + ; populate an array with the given values and return it + Local $a[32] = [$p0, $p1, $p2, $p3, $p4, $p5, $p6, $p7, $p8, $p9, $p10, $p11, $p12, $p13, $p14, $p15, $p16, $p17, $p18, $p19, $p20, $p21, $p22, $p23, $p24, $p25, $p26, $p27, $p28, $p29, $p30, $p31] + ReDim $a[@NumParams] + Return $a + EndIf + ; return an empty array + Local $d = ObjCreate('Scripting.Dictionary') + Return $d.keys() ; this empty Dictionary object will return an empty array of keys +EndFunc ;==>_JSONArray + +Func _JSONIsArray($v) + Return IsArray($v) And UBound($v, 0) == 1 +EndFunc ;==>_JSONIsArray + +;------------------------------------------------------------------------------- +; allows the programmer to more easily invoke a Scripting.Dictionary object for JSON use +; can optionally specify key/value pairs: _JSONObject('key1','value1','key2','value2') +;------------------------------------------------------------------------------- +Func _JSONObject($p0 = 0, $p1 = 0, $p2 = 0, $p3 = 0, $p4 = 0, $p5 = 0, $p6 = 0, $p7 = 0, $p8 = 0, $p9 = 0, $p10 = 0, $p11 = 0, $p12 = 0, $p13 = 0, $p14 = 0, $p15 = 0, $p16 = 0, $p17 = 0, $p18 = 0, $p19 = 0, $p20 = 0, $p21 = 0, $p22 = 0, $p23 = 0, $p24 = 0, $p25 = 0, $p26 = 0, $p27 = 0, $p28 = 0, $p29 = 0, $p30 = 0, $p31 = 0) + If @NumParams Then + Local $a[32] = [$p0, $p1, $p2, $p3, $p4, $p5, $p6, $p7, $p8, $p9, $p10, $p11, $p12, $p13, $p14, $p15, $p16, $p17, $p18, $p19, $p20, $p21, $p22, $p23, $p24, $p25, $p26, $p27, $p28, $p29, $p30, $p31] + ReDim $a[@NumParams] + Return _JSONObjectFromArray($a) + EndIf + Return _JSONObjectFromArray(0) +EndFunc ;==>_JSONObject + +Func _JSONObjectFromArray($a) + Local $o[1][2] = [[$_JSONNull, 'JSONObject']], $len = UBound($a) + If $len Then + ; populate with the given key/value pairs + ReDim $o[Floor($len / 2) + 1][2] + Local $oi = 1 + Local $d = ObjCreate('Scripting.Dictionary') ; used to check for duplicate keys + For $ai = 1 To $len - 1 Step 2 + Local $k = String($a[$ai - 1]) + If $d.exists($k) Then + ; duplicate key specified + Return SetError(1, $d.count + 1, 0) + EndIf + $d.add($k, True) ; keep track of the keys in use + $o[$oi][0] = $k + $o[$oi][1] = $a[$ai] + $oi += 1 + Next + EndIf + Return $o +EndFunc ;==>_JSONObjectFromArray + +Func _JSONIsObject($v) + If IsArray($v) And UBound($v, 0) == 2 And UBound($v, 2) == 2 Then + Return _JSONIsNull($v[0][0]) And $v[0][1] == 'JSONObject' + EndIf + Return False +EndFunc ;==>_JSONIsObject + +; variable containing more detailed error information +Global $_JSONErrorMessage = '' + +; internally-used variables for decoding/encoding +Local $__JSONTranslator +Local $__JSONReadNextFunc, $__JSONOffset, $__JSONAllowDuplicatedObjectKeys +Local $__JSONCurr, $__JSONWhitespaceWasFound +Local $__JSONDecodeString, $__JSONDecodePos +Local $__JSONIndentString, $__JSONIndentLen, $__JSONComma, $__JSONColon +Local $__JSONEncodeErrFlags, $__JSONEncodeErrCount + +;=============================================================================== +; JSON decoding user functions +;=============================================================================== + +;------------------------------------------------------------------------------- +; reads a single JSON value from a text file +;------------------------------------------------------------------------------- +Func _JSONDecodeWithReadFunc($funcName, $translator = '', $allowDuplicatedObjectKeys = False, $postCheck = False) + ; reset the error message + $_JSONErrorMessage = '' + + If Not __JSONSetTranslator($translator) Then + Return SetError(999, 0, 0) + EndIf + + $__JSONReadNextFunc = $funcName + $__JSONOffset = 0 + + $__JSONAllowDuplicatedObjectKeys = $allowDuplicatedObjectKeys + + ; read the first character + __JSONReadNext() + If @error Then + Return SetError(@error, @extended, 0) + EndIf + + ; decode + Local $v = __JSONDecodeInternal() + If @error Then + Return SetError(@error, @extended, 0) + EndIf + + If $postCheck Then + ; make sure theres nothing left to decode afterwards; if there is, consider it an error + If __JSONSkipWhitespace() Then + $_JSONErrorMessage = 'string contains unexpected text after the decoded JSON value' + Return SetError(99, 0, 0) + EndIf + EndIf + + If $translator Then + $v = __JSONDecodeTranslateWalk($_JSONNull, $_JSONNull, $v) + EndIf + If @error Then + Return SetError(@error, @extended, $v) + EndIf + + Return $v +EndFunc ;==>_JSONDecodeWithReadFunc + +;------------------------------------------------------------------------------- +; decodes a JSON string containing a single JSON value +;------------------------------------------------------------------------------- +Func _JSONDecode($s, $translator = '', $allowDuplicatedObjectKeys = False, $startPos = 1) + $__JSONDecodeString = String($s) + $__JSONDecodePos = $startPos + Local $v = _JSONDecodeWithReadFunc('__JSONReadNextFromString', $translator, $allowDuplicatedObjectKeys, True) + If @error Then + Return SetError(@error, @extended, $v) + EndIf + Return $v +EndFunc ;==>_JSONDecode + +;------------------------------------------------------------------------------- +; decodes a JSON string containing one or more JSON values, returning the results in an array +;------------------------------------------------------------------------------- +Func _JSONDecodeAll($s, $translator = '', $allowDuplicatedObjectKeys = False) + ; since we do not require commas for decoding, + ; we can simply enclose the JSON text in brackets, and decode the series of JSON values as an array + Local $v = _JSONDecode('[' & $s & @LF & ']', $translator, $allowDuplicatedObjectKeys) + If @error Then + Return SetError(@error, @extended, $v) + EndIf + Return $v +EndFunc ;==>_JSONDecodeAll + + +;=============================================================================== +; JSON encoding user functions +;=============================================================================== + +;------------------------------------------------------------------------------- +; encodes a value to JSON string +; +; if $indent is specified, the encoded string will contain indentations and line breaks to show the data structure +; $linebreak is used to specify the newline separator desired when indenting +;------------------------------------------------------------------------------- +Func _JSONEncode($v, $translator = '', $indent = '', $linebreak = @CRLF, $omitCommas = False) + ; reset the error message + $_JSONErrorMessage = '' + + If Not __JSONSetTranslator($translator) Then + Return SetError(999, 0, 0) + EndIf + + If $indent And $linebreak Then + ; were indenting + If IsBool($indent) Then + $__JSONIndentString = @TAB + Else + $__JSONIndentString = String($indent) + EndIf + $__JSONIndentLen = StringLen($__JSONIndentString) + + ; pad colon with a space + $__JSONColon = ': ' + + ; omit commas if requested (IMPORTANT: this is NOT an RFC4627-compliant option!) + If $omitCommas Then + $__JSONComma = '' + Else + $__JSONComma = ',' + EndIf + Else + ; not indenting + $indent = '' + $linebreak = '' + $__JSONColon = ':' + $__JSONComma = ',' + EndIf + + ; reset our warning error flags + $__JSONEncodeErrFlags = 0 + $__JSONEncodeErrCount = 0 + + Local $s = __JSONEncodeInternal($_JSONNull, $_JSONNull, $v, $linebreak) & $linebreak ; start indentation with the linebreak character + If @error Then + ; a show-stopping error of some kind + Return SetError(@error, @extended, '') + EndIf + If $__JSONEncodeErrCount Then + ; return encoded JSON string, but also indicate the presence of errors resulting in values changed to null or omitted during encoding + Return SetError($__JSONEncodeErrFlags, $__JSONEncodeErrCount, $s) + EndIf + ; no errors encountered + Return $s +EndFunc ;==>_JSONEncode + + +;=============================================================================== +; JSON helper functions +;=============================================================================== + +Func __JSONSetTranslator($translator) + If $translator Then + ; test it first + Call($translator, 0, 0, 0) + If @error == 0xDEAD And @extended == 0xBEEF Then + $_JSONErrorMessage = 'translator function not defined, or defined with wrong number of parameters' + Return False + EndIf + EndIf + $__JSONTranslator = $translator + Return True +EndFunc ;==>__JSONSetTranslator + +;=============================================================================== +; JSON decoding helper functions +;=============================================================================== + +Func __JSONReadNext($numChars = 1) + $__JSONCurr = Call($__JSONReadNextFunc, $numChars) + If @error Then + If @error == 0xDEAD And @extended == 0xBEEF Then + $_JSONErrorMessage = 'read function not defined, or defined with wrong number of parameters' + EndIf + Return SetError(@error, @extended, 0) + EndIf + $__JSONOffset += StringLen($__JSONCurr) ; now pointing to the offset for the next read + Return $__JSONCurr +EndFunc ;==>__JSONReadNext + +Func __JSONReadNextFromString($numChars) + ; move to the next char and return it + Local $s = StringMid($__JSONDecodeString, $__JSONDecodePos, $numChars) + $__JSONDecodePos += $numChars + Return $s +EndFunc ;==>__JSONReadNextFromString + +Func __JSONSkipWhitespace() + $__JSONWhitespaceWasFound = False + While $__JSONCurr + If StringIsSpace($__JSONCurr) Then + ; whitespace, skip + $__JSONWhitespaceWasFound = True + ElseIf $__JSONCurr == '/' Then + ; check for comments to skip (decoding extension) + Switch __JSONReadNext() + Case '/' + ; line comment, skip until end-of-line (or no more characters) + While __JSONReadNext() And Not StringRegExp($__JSONCurr, "[\n\r]", 0) + WEnd + If $__JSONCurr Then + $__JSONWhitespaceWasFound = True + Else + ; weve reached the end + Return '' + EndIf + Case '*' + ; start of block comment, skip until end of block comment found + __JSONReadNext() + While $__JSONCurr + If $__JSONCurr == '*' Then + If __JSONReadNext() == '/' Then + ; end of block comment found + ExitLoop + EndIf + Else + __JSONReadNext() + EndIf + WEnd + If Not $__JSONCurr Then + $_JSONErrorMessage = 'unterminated block comment' + ExitLoop + EndIf + Case Else + $_JSONErrorMessage = 'bad comment syntax' + ExitLoop + EndSwitch + Else + ; this is neither whitespace nor a comment, so we return it + Return $__JSONCurr + EndIf + + ; if we make it here, were still looping, so proceed to the next character + __JSONReadNext() + WEnd + + Return SetError(2, 0, 0) +EndFunc ;==>__JSONSkipWhitespace + +Func __JSONDecodeObject() + Local $d = ObjCreate('Scripting.Dictionary'), $key + Local $o = _JSONObject(), $len = 1, $i + + If $__JSONCurr == '{' Then + __JSONReadNext() + If __JSONSkipWhitespace() == '}' Then + ; empty object + __JSONReadNext() + Return $o + EndIf + + While $__JSONCurr + $key = __JSONDecodeObjectKey() + If @error Then + Return SetError(@error, @extended, 0) + EndIf + + If __JSONSkipWhitespace() <> ':' Then + $_JSONErrorMessage = 'expected ":", encountered "' & $__JSONCurr & '"' + ExitLoop + EndIf + + If $d.exists($key) Then + ; this key is defined more than once for this object + If $__JSONAllowDuplicatedObjectKeys Then + ; replace the current key value with the upcoming value + $i = $d.item($key) + Else + $_JSONErrorMessage = 'duplicate key specified for object: "' & $key & '"' + ExitLoop + EndIf + Else + ; adding a new key/value pair + $i = $len + $len += 1 + ReDim $o[$len][2] + + $o[$i][0] = $key + $d.add($key, $i) ; keep track of key index + EndIf + + __JSONReadNext() + $o[$i][1] = __JSONDecodeInternal() + If @error Then + Return SetError(@error, @extended, 0) + EndIf + + Switch __JSONSkipWhitespace() + Case '}' + ; end of object + __JSONReadNext() + Return $o + Case ',' + __JSONReadNext() + __JSONSkipWhitespace() + Case Else + If Not $__JSONWhitespaceWasFound Then + ; badly-formatted object + $_JSONErrorMessage = 'expected "," or "}", encountered "' & $__JSONCurr & '"' + ExitLoop + EndIf + EndSwitch + WEnd + EndIf + + Return SetError(3, 0, 0) +EndFunc ;==>__JSONDecodeObject + +Func __JSONDecodeObjectKey() + If $__JSONCurr == '"' Or $__JSONCurr == "'" Then + ; decode string as normal + Return __JSONDecodeString() + EndIf + + If StringIsDigit($__JSONCurr) Then + ; decode number as normal, returning string representation of number to use as key + Return String(__JSONDecodeNumber()) + EndIf + + ; decode quoteless key string + Local $s = '' + While (StringIsAlNum($__JSONCurr) Or $__JSONCurr == '_') + $s &= $__JSONCurr + __JSONReadNext() + WEnd + If Not $s Then + $_JSONErrorMessage = 'expected object key, encountered "' & $__JSONCurr & '"' + Return SetError(13, 0, 0) + EndIf + Return $s +EndFunc ;==>__JSONDecodeObjectKey + +Func __JSONDecodeArray() + Local $a = _JSONArray(), $len = 0 + + If $__JSONCurr == '[' Then + __JSONReadNext() + If __JSONSkipWhitespace() == ']' Then + ; empty array + __JSONReadNext() + Return $a + EndIf + + While $__JSONCurr + $len += 1 + ReDim $a[$len] + $a[$len - 1] = __JSONDecodeInternal() + If @error Then + Return SetError(@error, @extended, 0) + EndIf + + Switch __JSONSkipWhitespace() + Case ']' + ; end of array + __JSONReadNext() + Return $a + Case ',' + __JSONReadNext() + __JSONSkipWhitespace() + Case Else + If Not $__JSONWhitespaceWasFound Then + ; badly-formatted array + $_JSONErrorMessage = 'expected "," or "]", encountered "' & $__JSONCurr & '"' + ExitLoop + EndIf + EndSwitch + WEnd + EndIf + + Return SetError(4, 0, 0) +EndFunc ;==>__JSONDecodeArray + +Func __JSONDecodeString() + Local $s = '', $q = $__JSONCurr ; save our beginning quote char so we know what were matching + + If $q == '"' Or $q == "'" Then + While $__JSONCurr + __JSONReadNext() + Select + Case $__JSONCurr == $q + ; weve reached the matching end quote char, so were done + __JSONReadNext() + Return $s + Case $__JSONCurr == '\' + ; interpret the escaped char + Switch __JSONReadNext() + Case '\', '/', '"', "'" + $s &= $__JSONCurr + Case 't' + $s &= @TAB + Case 'n' + $s &= @LF + Case 'r' + $s &= @CR + Case 'f' + $s &= ChrW(0xC) ; form feed / page break + Case 'b' + $s &= ChrW(0x8) ; backspace + Case 'v' + $s &= ChrW(0xB) ; vertical tab (decoding extension) + Case 'u' + ; unicode escape sequence + If StringIsXDigit(__JSONReadNext(4)) Then + $s &= ChrW(Dec($__JSONCurr)) + Else + ; invalid unicode escape sequence + ExitLoop + EndIf + Case Else + ; unrecognized escape character + ExitLoop + EndSwitch + Case AscW($__JSONCurr) >= 0x20 ; always use ascw() to compare on unicode value (locale-specific string compares seem to be unreliable) + ; append this character + $s &= $__JSONCurr + Case Else + ; error control characters should always be escaped within a string, we should never encounter them raw like this + ExitLoop + EndSelect + WEnd + EndIf + + Return SetError(5, 0, 0) +EndFunc ;==>__JSONDecodeString + +Func __JSONDecodeHexNumber($negative) + ; we decode hex integers manually like this, to avoid the limitations of AutoIts built-in 32-bit signed integer interpretation + Local $n = 0 + + While StringIsXDigit(__JSONReadNext()) + $n = $n * 0x10 + Dec($__JSONCurr) + WEnd + + If $negative Then + Return -$n + EndIf + Return $n +EndFunc ;==>__JSONDecodeHexNumber + +Func __JSONDecodeNumber() + Local $s = '' + + If $__JSONCurr == '+' Or $__JSONCurr == '-' Then + ; leading sign + $s &= $__JSONCurr + __JSONReadNext() + EndIf + + ; code added to allow parsing of 0x hex integer notation (decoding extension) + If $__JSONCurr == '0' Then + $s &= $__JSONCurr + __JSONReadNext() + If StringLower($__JSONCurr) == 'x' Then + ; we have a hex integer + Return __JSONDecodeHexNumber(StringLeft($s, 1) == '-') + EndIf + EndIf + + ; decimal number, collect digits + While StringIsDigit($__JSONCurr) + $s &= $__JSONCurr + __JSONReadNext() + WEnd + + If $__JSONCurr == '.' Then + ; decimal point found, collect digits + $s &= $__JSONCurr + While StringIsDigit(__JSONReadNext()) + $s &= $__JSONCurr + WEnd + EndIf + + If StringLower($__JSONCurr) == 'e' Then + ; exponent found, collect sign and digits + $s &= $__JSONCurr + __JSONReadNext() + If $__JSONCurr == '+' Or $__JSONCurr == '-' Then + $s &= $__JSONCurr + __JSONReadNext() + EndIf + While StringIsDigit($__JSONCurr) + $s &= $__JSONCurr + __JSONReadNext() + WEnd + ; number() doesnt handle exponential notation, so we use execute() here + Return Execute($s) + EndIf + + Return Number($s) +EndFunc ;==>__JSONDecodeNumber + +Func __JSONDecodeLiteral() + Switch $__JSONCurr + Case 't' + If __JSONReadNext(3) == 'rue' Then + __JSONReadNext() + Return True + EndIf + Case 'f' + If __JSONReadNext(4) == 'alse' Then + __JSONReadNext() + Return False + EndIf + Case 'n' + If __JSONReadNext(3) == 'ull' Then + __JSONReadNext() + Return $_JSONNull + EndIf + EndSwitch + + Return SetError(7, 0, 0) +EndFunc ;==>__JSONDecodeLiteral + +Func __JSONDecodeInternal() + Local $v + Switch __JSONSkipWhitespace() + Case '{' + $v = __JSONDecodeObject() + Case '[' + $v = __JSONDecodeArray() + Case '"', "'" ; allow strings to be single- or double-quoted (decoding extension) + $v = __JSONDecodeString() + Case '0' To '9', '-', '+' ; allow numbers to start with a plus sign (decoding extension) + $v = __JSONDecodeNumber() + Case Else + $v = __JSONDecodeLiteral() + EndSwitch + If @error Then + Return SetError(@error, @extended, $v) + EndIf + Return $v +EndFunc ;==>__JSONDecodeInternal + +; here, we walk through the raw results from our JSON decoding, calling the translator function for each value +Func __JSONDecodeTranslateWalk(Const ByRef $holder, Const ByRef $key, $value) + Local $v + + If IsArray($value) Then + If _JSONIsObject($value) Then + For $i = 1 To UBound($value) - 1 + $v = __JSONDecodeTranslateWalk($value, $value[$i][0], $value[$i][1]) + Switch @error + Case 0 + ; no error, assign returned value + $value[$i][1] = $v + Case 4627 + ; remove this key/value pair + $value[$i][0] = $_JSONNull ; wipe out key (placeholder logic for now) + Case Else + ; an error + Return SetError(@error, @extended, 0) + EndSwitch + Next + Else ; this can only be a one-dimensional array + For $i = 0 To UBound($value) - 1 + $v = __JSONDecodeTranslateWalk($value, $i, $value[$i]) + Switch @error + Case 0 + ; no error, assign returned value + $value[$i] = $v + Case 4627 + ; we cant completely remove values from arrays (as that could disrupt element positioning), so set to JSON null instead + $value[$i] = $_JSONNull + Case Else + ; an error + Return SetError(@error, @extended, 0) + EndSwitch + Next + EndIf + EndIf + + $v = Call($__JSONTranslator, $holder, $key, $value) + If @error Then + Return SetError(@error, @extended, 0) + EndIf + Return $v +EndFunc ;==>__JSONDecodeTranslateWalk + + +;=============================================================================== +; JSON encoding helper functions +;=============================================================================== + +Func __JSONEncodeObject($o, Const ByRef $indent) + Local $result = '', $inBetween = $__JSONComma & $indent, $d = ObjCreate('Scripting.Dictionary') + + For $i = 1 To UBound($o) - 1 + Local $key = $o[$i][0] + If Not _JSONIsNull($key) Then ; avoid deleted keys + $key = String($key) + If $d.exists($key) Then + ; duplicate key add flag to error status and ignore value (earlier value for this key wins) + $__JSONEncodeErrFlags = BitOR($__JSONEncodeErrFlags, 2) + $__JSONEncodeErrCount += 1 + Else + $d.add($key, True) ; keep track of the keys in use + Local $s = __JSONEncodeInternal($o, $key, $o[$i][1], $indent) + If @error Then + Return SetError(@error, @extended, $result) + EndIf + If $s Then + $result &= $inBetween & __JSONEncodeString($key) & $__JSONColon & $s + EndIf + EndIf + EndIf + Next + If $indent And $result Then + ; were indenting, and we dont have an empty JSON object, so append the appropriate closing indentation + $result &= StringTrimRight($indent, $__JSONIndentLen) + EndIf + + ; remove the initial comma and return the result + Return '{' & StringTrimLeft($result, StringLen($__JSONComma)) & '}' +EndFunc ;==>__JSONEncodeObject + +Func __JSONEncodeArray($a, Const ByRef $indent) + Local $result = '', $inBetween = $__JSONComma & $indent + + If UBound($a) Then + For $i = 0 To UBound($a) - 1 + Local $s = __JSONEncodeInternal($a, $i, $a[$i], $indent) + If @error Then + Return SetError(@error, @extended, $result) + EndIf + If Not $s Then + ; we cant completely remove values from arrays (as that could disrupt element positioning), so set to null instead + $s = 'null' + EndIf + $result &= $inBetween & $s + Next + If $indent Then + ; were indenting, so append the appropriate closing indentation + $result &= StringTrimRight($indent, $__JSONIndentLen) + EndIf + EndIf + + ; remove the initial comma and return the result + Return '[' & StringTrimLeft($result, StringLen($__JSONComma)) & ']' +EndFunc ;==>__JSONEncodeArray + +Func __JSONEncodeString($s) + Local Const $escape = '[\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]' + Local $result, $ch, $u + + ; use a regExp replace to escape any backslash or double-quote characters + ; (also implicitly converts $s to a string, if it isnt one already) + $s = StringRegExpReplace($s, '([\"\\])', '\\\0') + + If StringRegExp($s, $escape, 0) Then + ; we have control characters to escape, so we need to reconstruct the string to encode them + $result = '' + + For $i = 1 To StringLen($s) + $ch = StringMid($s, $i, 1) + + If StringRegExp($ch, $escape, 0) Then + ; encode + $u = AscW($ch) + Switch $u + Case 0x9 ; tab + $ch = '\t' + Case 0xA ; newline + $ch = '\n' + Case 0xD ; carriage return + $ch = '\r' + Case 0xC ; form feed / page break + $ch = '\f' + Case 0x8 ; backspace + $ch = '\b' + Case Else + ; encode as unicode character number + $ch = '\u' & Hex($u, 4) + EndSwitch + EndIf + + ; write our encoded character + $result &= $ch + Next + Else + ; no control chars present, so our string is already encoded properly + $result = $s + EndIf + + Return '"' & $result & '"' +EndFunc ;==>__JSONEncodeString + +Func __JSONEncodeInternal($holder, $k, $v, $indent) + ; encode a variable into its JSON string representation + Local $s + + If $indent Then + ; append another indentation to the given indent string, and check how deep we are + $indent &= $__JSONIndentString + ; arbitrary maximum depth check to help identify cyclical data structure errors (e.g., a dictionary containing itself) + If StringLen($indent) / $__JSONIndentLen > 255 Then + $_JSONErrorMessage = 'max depth exceeded possible data recursion' + Return SetError(1, 0, 0) + EndIf + EndIf + + If $__JSONTranslator Then + ; call the translator function first + $v = Call($__JSONTranslator, $holder, $k, $v) + Switch @error + Case 0 + ; no error + Case 4627 + ; signal to remove this value entirely from encoded output, if possible + Return '' + Case Else + ; some other error + Return SetError(@error, @extended, '') + EndSwitch + EndIf + + Select + Case _JSONIsObject($v) + $s = __JSONEncodeObject($v, $indent) + + Case _JSONIsArray($v) + $s = __JSONEncodeArray($v, $indent) + + Case IsString($v) + $s = __JSONEncodeString($v) + + Case IsNumber($v) + ; AutoIts native number-to-string conversion will produce valid JSON-compatible numeric output + $s = String($v) + + Case IsBool($v) + $s = StringLower($v) + + Case _JSONIsNull($v) + $s = 'null' + + Case Else + ; unsupported variable type; encode as null, flag presence of error + $__JSONEncodeErrFlags = BitOR($__JSONEncodeErrFlags, 1) + $__JSONEncodeErrCount += 1 + $s = 'null' + + EndSelect + + If @error Then + Return SetError(@error, @extended, $s) + EndIf + Return $s +EndFunc ;==>__JSONEncodeInternal \ No newline at end of file diff --git a/Installer/vi_files/UDFs/MD5.au3 b/Installer/vi_files/UDFs/MD5.au3 new file mode 100644 index 00000000..1e7ab476 --- /dev/null +++ b/Installer/vi_files/UDFs/MD5.au3 @@ -0,0 +1,240 @@ +; ----------------------------------------------------------------------------- +; MD5 Hash Machine Code UDF +; Purpose: Provide The Machine Code Version of MD5 Hash Algorithm In AutoIt +; Author: Ward +; url: http://www.autoitscript.com/forum/topic/121985-autoit-machine-code-algorithm-collection/ +; ----------------------------------------------------------------------------- + +#Include-once +#Include + +Global $_MD5_CodeBuffer, $_MD5_CodeBufferMemory +Global $_MD5_InitOffset, $_MD5_InputOffset, $_MD5_ResultOffset + +Global $_HASH_MD5[4] = [16, 88, '_MD5_', '_MD5_'] + +Func _MD5_Exit() + $_MD5_CodeBuffer = 0 + _MemVirtualFree($_MD5_CodeBufferMemory, 0, $MEM_RELEASE) +EndFunc + +Func _MD5_Startup() + If Not IsDllStruct($_MD5_CodeBuffer) Then + If @AutoItX64 Then + Local $Code = 'BQsAAIkO2+kECRwYhw5XCIPUBK4KD0GcnVYdVZxU/HcAU0iD7ChEiyHHBnoMZwKDWggZEnIECEkTWQMieRBBjbT4eKRqf9c/ifgGaRgx2C5jUV4h8PB8JBT3+PhHAY28OVa3x+j9bP0Q7AQG7t7BKPbBwAfYAfA9IcZ9d0EO94txCMPBxwx0FABEjawe23AgJDmJwzp0sxhQ82M2hCH7YBOKtDPuzjG9wdZcHcOwwxFG8CxjO977MdY+b+sKoIQ4rw98UPWLJNiKvonrxp7GFmo++0Wq7oSAriHzog0AhzcqxocoRwGfKYnzgAox64NGwxHANqwtE0YwUKi9HM2A3/oKjmjufURFDy7jlUb9Nijd6Tw2xRHmuP9We+OhBSBEcQJuXCQMgIwY2JiAVWmGo+t7hD+v94QWK3sgRw4VsVv/NXjb30L3eGzhuCyjcGXduQRDiR6+18+6+s7q74JsUv+mhUcwZSr3QYQiEZBrvzXIkhJ5NGBuiTwkpIkUk3GYunygjjHvdkEPwCHHRQrwCwwB/1A4rvgSRSH4QBI9jkN5ptk9pMVBukE8Avmb+aQy6UmQBtkI0UmbIELawGIlHmX2cs4ogYlm8abpSm/5DcLIi0xC9wSBBVj9D0Bys/iJ/5sy8YlQDc8Mag+8pA4EwScJAUZH7QpRWl4mmRzP1TGHN/fN16qStumNDu4TgA49zM1R+LQgQhi78jBdGxAv1hsyOv75FCw69/tRzyHPQJeMEVOYPWwCHfb4rIHRsO9jQCHvA9MFgeah2GUdLvlRfHTQbJCVihRxaIaBPsj70+ddeQlyAiMImnegBTjmzeFXIX9g/DnWBzdGw6Adhw0j1fTxDA8E7RRaRStRzwt9BAXp46ktCXYCRRiSe6ANOfij71L8g92gBC3ZAm9nOkhlg4pMKrV0i9KKHE16swz+JMjGfYJCOfr/Ac5EA6lFf02gMJo8FDiLRL+GxwTuBgGB9nGHiJJGknJd6A5t0jtT7wtE8YYFCyJhnW2sODTwwPE+DDjl/fTIx9bFiVzpELs+JCIG6r6k/9mDDMa7WmbbF0za321LsCijFG7YyeOpzyLeS9Bb5Y9ghrv2jbB4TQHBSXFUThYJcLy/vggYgYv4MaNQTA2HUonFhbn9CZQQLwYKzVgFiywkEmVR1IA8L4x+myhIzck4xSBrIPonoWbqXvUyJCwvcrQqiGsZCoUw79SyooRJ9X5SBEOoFMcL2YUB72SD2QvOoOkOBR2IUgSSVacxJQiHDGoO6kgUCIUmFx+BNTnQ1NmU5MaQZZr+kDcf5Zkk2+Zrtr0s7UZoGlXGjMD4fCSiH5lPzO5spAQlRCIp9JQFH5aoeokw77CDuqwvlxP/KkNQCWRJFDQQ8UC2MWVWrMSSz8DCOKcjlKvVjQputcb31UJp8TIZ4wxWkyJJ1hsbCc45Kqb0RcbExAb0f8woCeXHSeA2GffQZu0lJYKtOaCT/IWjCkxG5Wzt3bCoxAOkHMNZW2UyIu98bGgAxw/JFAkGgOiuqicAoCuSzAxmj9IVjJAWCQnIicsPL0zTvMTzUKa8F30U9O//b2w640QkCeD7Irzu0RNdhIUVKPw2ENnTEwnriUoQ46qU35J3kg8GPE9+qG/T05Q2quEd+zHrjtmJ1Ggi00nOG0HOgfy0KODmLO6llxR21cgd4zHLwN6NnAcUQ/yjmIuQCmkK+KxwzOZNCVks4E6CoREITkD9AcOr/bHXwd0PULnzCdiQ7KongJcsgn5TUPekrAYuNfI6vd00id7uAZgJzzHfIncBvDO70tcqReQKhwaHhMgJxoCojTQu38k9fHTzJXIMg88cHwVPOZHThgDUwQMC99Hbw76QWggJTNnCAokCi0IEUDf+2Ni1EAiJfkoASIPEKFteX105QVxvCB28p8MYvEmJftVnVArMn8tMCfhmxR1NhcDBi3FQdF/w5j8DTI15QEG+nwwC6wANSQFcJFBIhR7/dEalo+T1KZdH6/A5+3YE9v372/vxM4rYhuq23ONgHEgGKd/osAJqBoP+QHXILGf6' + $Code &= 'BuGRMPboMAH/41hGdVK6krPrhPRKSBiJ11YIzlPKaMOOjiBJgfh/dn5BkUFQ9OA/IHVHDGZAMe1A+cw+4szp30Q/m+h2r+WDOysGGvg/d+RENEPAOhvDXrtBYmcyVAeHhSbxAV5QkeMghcO9IdMpxUO06DMy75Drue7+u4gzorDx1cZ+NI0uoQtD6cZEUZcY6MejkXCHuFIHJAEjRWfrobCJq82blosgAxkI/ty6mAMRDHZUMhAbqkFAMG8rE5mXGEnYpRKGrCAKmCZmKArLBpB9aTAKAV44v4Cgq79/ZNpnxIFmwdP/mQrGIs1E8kTN99nkkNH10AEJwB74OEKIDBgDdnJIQbikz4H5Y6hqf5jUDSnAMdKaQYI/AUNL4j0W2ZRT9rdzDMMBujhRDzOFpQ1A+ccCkRSpiAQRsACJ0THAwekDKPbCzAzJ80irKq2LZBxRs0CD4gF0HybGBwoUGnIhOFDo0NAltQVDUIn2JXVMk8YOQw046Nb1+p4wQNxFMgxEBAQISBAIIExqDGIHT5CepARP8T9M0v9RKfTDxmADpI17AbIbN+lNhpBmxweohuoC0Da7GulGIwgQEhEEdCHpPmgPlUQykS8iP0hT7yTRbaxrKSAkW4nodBLNCqnfY+kmJhtWfpnPBtZAmsH88wqkX17DEETQMqpjogAA' + Else + Local $Code = 'XgsAAIkA24PsBItEJAjz26DoLgnhw/vE+cIQwYeRLxwbKIk3eRGKBCcgIVcICByJCR0PHxBhCqBVV1ZjU0JEix2EagxdMthaEHoEAIlMJDyNtDF4HqRq193px9kh+b7AAc6LSAQewcYHGP47OI0DrClWt8fo2Nkx+Tch8ULzTA2Ai2gIccE/DAF8Bpwd23Ag2kFc0fPZbOQ0MWH7Ngwhy5gOAyeNvAE97s69wYl8nT3PwMMRMfcBy8xLMEYQMyHfGgNhMfIurw/g9YlhdBbBxxbc3gHMMM5HLIAUIWb+FgMxAY2MKSrGh0dUiieTdfkQlYRkRygKGI9GAzGAhysTEEYwqJGXQYoEmRuBR/QKHIxwLwEZlUb9LSBWijLtWZYEkRCIjPDYmIBCaUGJFo7+g443YRxaSox4r/eQP4WMRBgIKHixW3H/hUQUCCx4vtfwiaSCiowzhSBHEFMwjMEiEZBrIhjaP42xCPZEIISN8PX8cBI0wcUKov2TPw6TcZjwkJBlYQgYhzY4IVLpjoAzjkN5polA0etUTg2Uiw71AZRA+4+eH96CWDyJyIrNnR/oM7TwQAydH+4IPrRJpsc+mzj5yvdgAAViACUe9on4MfAhb8gI70T8KoviwXjAJAH4EY5As16izMDBLRCZJLpl90BBw1FaXiabKzzz/AcJAU8izjHGrr+NAyNQBqrHtmnpQQbUfEEoxg6B8vcMMc8hxwgDwCONhChdEDAv1kEUiUSJx96Ii4RRA7Ej91MU4QIJAKIegeYpodiSoIeHgyF04Y10NUi4LKtpBPvI+9PnSBhIeNjmzX7hiQQagdYHN8OUQTB8R3XR+ASHDdX0SBzUCO0UWkWRCKgFEenjqSM0U/Cj7/zKQSCA1ArZAm9nfF6EbX31dM19LMqDDIyHikwqaRSE8DzxT4YDQjn6/4tDUIEmMWg9JigSkxwIdAROgYH2cYdJliQ3wcwxENYLmFTA9gYiYZ1tGYnoMTTI/camMSeSECBuBww4TOWkQcKTNPAoWheG9uobvqSJjCY0+FjkLAgEYKnP3kuE3Sk8XJVA3sE+Ac1pIIa/xdTnAA5gS0y7lEH4Zq9lMBQIau4OD3Blv77WyTSwnn0MUYvLZKoXiIQ4EsZ+m5M+QHQp0OeLIciQPGXiz0GL+ieh6lajNGz4wDEwoWn9AQaF6O/Uqusvva8EthI9JvrU0xgBeAUdiARMonSLQOSKwYZBGLni1Io5FdDU2aJmNPHAyjEMaSL0Ag3lmdvmia3QZHVMVjooBhj4fKIfyjIB+f/IGTQGzGDN/2VWrMSqlweB6PXGNq+9iegH7CIpYfQw99AJYrU/BNXWQBvABgH98Iw5DZf/KkMhCZ0gJOkS99EJTQ0DGYHQPacjlKsxbsXXkuwKALkJzzHHjSR8PXdFKAmdDykGADw5oJP8izB4xi0M99ZcCfukgBHDWVtLZVtY7FQ32hXC+gH+CUcwsvz1D6GSzAyPRMtVme1IHc4UvZEKAZwZ4OYs/lC6ffTvSP+BakNTpA5SIH0G0V2ETIU+ajVvq20QHCYVD4CsNU9+qG+Yy4KQQAsJxqDSMf6zz7jBueykCU6o7hgLicPV99OS7pDYOxRDoqMuCAnmH/PBHB/Bww+BKiihEQhOsPQvLAHLyM3YRgfFwDYugn5T99rAN4V22ED2xjHejTRsN7s2KQI18jq9idkjNAFC92w2D9U2Biu70tcq7M03GOqh8mznkfKG6whowgMykWqJ4ItymAY5WgidSgyV3uMfiUKAg8REW15fH13DVQ/VV+PPVlMAoIPsTIXJi1DidBx5jUB+kuI/SXU8QMMc6z0ii1xWyTCuT4nHriUbA+JcoJlIUBFYAVSF/3RHvkCsJ6IBOf52AonSjy+S1lzmfvVRVPayd/TQehTyAttzJfDyg/oZQHWoFzxALeja93H/CjHS65eVEUyTiDIskopmSEFA2e38/n+okRwPOIaAVUTroEJQgwvgP3VEkPMx//bFsA1y2FzqpXl57zToi58P5jd/Rz936oBGwInCo86uWfZU' + $Code &= 'ZBPqLlhhAXKhu3rrIeAslL+/gYnaKcdM6vk9AfsO/ujjeIrrop75zSqUbATChLIBBuu8cZhL0GA8Gum7UQasEEsHFI1QQMcuYQEjRWe9Du6lH5hCaqvNYO8OCP7cukCYDA12VDIQONYTeoiRcy4CCkS/1ETT5b5DccOydMbcSVBAQf2/jqjNkAr32SHRwJ4JR4gMA4LAAYDYOHZmupFyh8KNe4rqFQOeJAiZvMJCpiJQ8PqSEVR8ut/+e1H2o8zDATC6OD8PhZ7CDffHAqQMn0mJgNjAwekCOfbCmfOrJJ0VAC8BdCrGB6HpJaFmZiFjUe2EEY1DQIiUiyV7UAd90nBrVA+kDv0Dwed2CzsRgtRTPERq7kNQOIfoKPr1gf2ZWwYKRPxGBMgMSBAIIExJDNxkUnSiIFLLJkgDhsPGA7YDewGyN+lVcm4VZscHkhzqAuizK+lRELIbViFTMckgRBjZ+YwgbIGQmmLfpf7RCxggmBhbMelgG1ZXp78kgxCltCHm5C/8BIP5CHInggcBKQKWpElMEfQFEmalgwQLicqTEPPUhxnD4QO5pOu6FgZfXsNXd0QQMDEPttIMaSGHswOtCCF0AwUKqkkhCnX2Uj/8Qk0QQKpfYMMA' + EndIf + Local $Opcode = String(_MD5_CodeDecompress($Code)) + $_MD5_InitOffset = (StringInStr($Opcode, "89DB") - 3) / 2 + $_MD5_InputOffset = (StringInStr($Opcode, "87DB") - 3) / 2 + $_MD5_ResultOffset = (StringInStr($Opcode, "09DB") - 3) / 2 + $Opcode = Binary($Opcode) + + $_MD5_CodeBufferMemory = _MemVirtualAlloc(0, BinaryLen($Opcode), $MEM_COMMIT, $PAGE_EXECUTE_READWRITE) + $_MD5_CodeBuffer = DllStructCreate("byte[" & BinaryLen($Opcode) & "]", $_MD5_CodeBufferMemory) + DllStructSetData($_MD5_CodeBuffer, 1, $Opcode) + OnAutoItExitRegister("_MD5_Exit") + EndIf +EndFunc + +Func _MD5Init() + If Not IsDllStruct($_MD5_CodeBuffer) Then _MD5_Startup() + + Local $Context = DllStructCreate("byte[" & $_HASH_MD5[1] & "]") + DllCall("user32.dll", "none", "CallWindowProc", "ptr", DllStructGetPtr($_MD5_CodeBuffer) + $_MD5_InitOffset, _ + "ptr", DllStructGetPtr($Context), _ + "int", 0, _ + "int", 0, _ + "int", 0) + + Return $Context +EndFunc + +Func _MD5Input(ByRef $Context, $Data) + If Not IsDllStruct($_MD5_CodeBuffer) Then _MD5_Startup() + If Not IsDllStruct($Context) Then Return SetError(1, 0, 0) + + $Data = Binary($Data) + Local $InputLen = BinaryLen($Data) + Local $Input = DllStructCreate("byte[" & $InputLen & "]") + DllStructSetData($Input, 1, $Data) + DllCall("user32.dll", "none", "CallWindowProc", "ptr", DllStructGetPtr($_MD5_CodeBuffer) + $_MD5_InputOffset, _ + "ptr", DllStructGetPtr($Context), _ + "ptr", DllStructGetPtr($Input), _ + "uint", $InputLen, _ + "int", 0) +EndFunc + +Func _MD5Result(ByRef $Context) + If Not IsDllStruct($_MD5_CodeBuffer) Then _MD5_Startup() + If Not IsDllStruct($Context) Then Return SetError(1, 0, "") + + Local $Digest = DllStructCreate("byte[" & $_HASH_MD5[0] & "]") + DllCall("user32.dll", "none", "CallWindowProc", "ptr", DllStructGetPtr($_MD5_CodeBuffer) + $_MD5_ResultOffset, _ + "ptr", DllStructGetPtr($Context), _ + "ptr", DllStructGetPtr($Digest), _ + "int", 0, _ + "int", 0) + Return DllStructGetData($Digest, 1) +EndFunc + +Func _MD5($Data) + Local $Context = _MD5Init() + _MD5Input($Context, $Data) + Return _MD5Result($Context) +EndFunc + +Func _MD5_CodeDecompress($Code) + If @AutoItX64 Then + Local $Opcode = '0x89C04150535657524889CE4889D7FCB28031DBA4B302E87500000073F631C9E86C000000731D31C0E8630000007324B302FFC1B010E85600000010C073F77544AAEBD3E85600000029D97510E84B000000EB2CACD1E8745711C9EB1D91FFC8C1E008ACE8340000003D007D0000730A80FC05730783F87F7704FFC1FFC141904489C0B301564889FE4829C6F3A45EEB8600D275078A1648FFC610D2C331C9FFC1E8EBFFFFFF11C9E8E4FFFFFF72F2C35A4829D7975F5E5B4158C389D24883EC08C70100000000C64104004883C408C389F64156415541544D89CC555756534C89C34883EC20410FB64104418800418B3183FE010F84AB00000073434863D24D89C54889CE488D3C114839FE0F84A50100000FB62E4883C601E8C601000083ED2B4080FD5077E2480FBEED0FB6042884C00FBED078D3C1E20241885500EB7383FE020F841C01000031C083FE03740F4883C4205B5E5F5D415C415D415EC34863D24D89C54889CE488D3C114839FE0F84CA0000000FB62E4883C601E86401000083ED2B4080FD5077E2480FBEED0FB6042884C078D683E03F410845004983C501E964FFFFFF4863D24D89C54889CE488D3C114839FE0F84E00000000FB62E4883C601E81D01000083ED2B4080FD5077E2480FBEED0FB6042884C00FBED078D389D04D8D7501C1E20483E03041885501C1F804410845004839FE747B0FB62E4883C601E8DD00000083ED2B4080FD5077E6480FBEED0FB6042884C00FBED078D789D0C1E2064D8D6E0183E03C41885601C1F8024108064839FE0F8536FFFFFF41C7042403000000410FB6450041884424044489E84883C42029D85B5E5F5D415C415D415EC34863D24889CE4D89C6488D3C114839FE758541C7042402000000410FB60641884424044489F04883C42029D85B5E5F5D415C415D415EC341C7042401000000410FB6450041884424044489E829D8E998FEFFFF41C7042400000000410FB6450041884424044489E829D8E97CFEFFFF56574889CF4889D64C89C1FCF3A45F5EC3E8500000003EFFFFFF3F3435363738393A3B3C3DFFFFFFFEFFFFFF000102030405060708090A0B0C0D0E0F10111213141516171819FFFFFFFFFFFF1A1B1C1D1E1F202122232425262728292A2B2C2D2E2F3031323358C3' + Else + Local $Opcode = '0x89C0608B7424248B7C2428FCB28031DBA4B302E86D00000073F631C9E864000000731C31C0E85B0000007323B30241B010E84F00000010C073F7753FAAEBD4E84D00000029D97510E842000000EB28ACD1E8744D11C9EB1C9148C1E008ACE82C0000003D007D0000730A80FC05730683F87F770241419589E8B3015689FE29C6F3A45EEB8E00D275058A164610D2C331C941E8EEFFFFFF11C9E8E7FFFFFF72F2C32B7C2428897C241C61C389D28B442404C70000000000C6400400C2100089F65557565383EC1C8B6C243C8B5424388B5C24308B7424340FB6450488028B550083FA010F84A1000000733F8B5424388D34338954240C39F30F848B0100000FB63B83C301E8CD0100008D57D580FA5077E50FBED20FB6041084C00FBED078D78B44240CC1E2028810EB6B83FA020F841201000031C083FA03740A83C41C5B5E5F5DC210008B4C24388D3433894C240C39F30F84CD0000000FB63B83C301E8740100008D57D580FA5077E50FBED20FB6041084C078DA8B54240C83E03F080283C2018954240CE96CFFFFFF8B4424388D34338944240C39F30F84D00000000FB63B83C301E82E0100008D57D580FA5077E50FBED20FB6141084D20FBEC278D78B4C240C89C283E230C1FA04C1E004081189CF83C70188410139F374750FB60383C3018844240CE8EC0000000FB654240C83EA2B80FA5077E00FBED20FB6141084D20FBEC278D289C283E23CC1FA02C1E006081739F38D57018954240C8847010F8533FFFFFFC74500030000008B4C240C0FB60188450489C82B44243883C41C5B5E5F5DC210008D34338B7C243839F3758BC74500020000000FB60788450489F82B44243883C41C5B5E5F5DC210008B54240CC74500010000000FB60288450489D02B442438E9B1FEFFFFC7450000000000EB9956578B7C240C8B7424108B4C241485C9742FFC83F9087227F7C7010000007402A449F7C702000000740566A583E90289CAC1E902F3A589D183E103F3A4EB02F3A45F5EC3E8500000003EFFFFFF3F3435363738393A3B3C3DFFFFFFFEFFFFFF000102030405060708090A0B0C0D0E0F10111213141516171819FFFFFFFFFFFF1A1B1C1D1E1F202122232425262728292A2B2C2D2E2F3031323358C3' + EndIf + Local $AP_Decompress = (StringInStr($Opcode, "89C0") - 3) / 2 + Local $B64D_Init = (StringInStr($Opcode, "89D2") - 3) / 2 + Local $B64D_DecodeData = (StringInStr($Opcode, "89F6") - 3) / 2 + $Opcode = Binary($Opcode) + + Local $CodeBufferMemory = _MemVirtualAlloc(0, BinaryLen($Opcode), $MEM_COMMIT, $PAGE_EXECUTE_READWRITE) + Local $CodeBuffer = DllStructCreate("byte[" & BinaryLen($Opcode) & "]", $CodeBufferMemory) + DllStructSetData($CodeBuffer, 1, $Opcode) + + Local $B64D_State = DllStructCreate("byte[16]") + Local $Length = StringLen($Code) + Local $Output = DllStructCreate("byte[" & $Length & "]") + + DllCall("user32.dll", "none", "CallWindowProc", "ptr", DllStructGetPtr($CodeBuffer) + $B64D_Init, _ + "ptr", DllStructGetPtr($B64D_State), _ + "int", 0, _ + "int", 0, _ + "int", 0) + + DllCall("user32.dll", "int", "CallWindowProc", "ptr", DllStructGetPtr($CodeBuffer) + $B64D_DecodeData, _ + "str", $Code, _ + "uint", $Length, _ + "ptr", DllStructGetPtr($Output), _ + "ptr", DllStructGetPtr($B64D_State)) + + Local $ResultLen = DllStructGetData(DllStructCreate("uint", DllStructGetPtr($Output)), 1) + Local $Result = DllStructCreate("byte[" & ($ResultLen + 16) & "]") + + Local $Ret = DllCall("user32.dll", "uint", "CallWindowProc", "ptr", DllStructGetPtr($CodeBuffer) + $AP_Decompress, _ + "ptr", DllStructGetPtr($Output) + 4, _ + "ptr", DllStructGetPtr($Result), _ + "int", 0, _ + "int", 0) + + + _MemVirtualFree($CodeBufferMemory, 0, $MEM_RELEASE) + Return BinaryMid(DllStructGetData($Result, 1), 1, $Ret[0]) +EndFunc + +; #FUNCTION# ;=============================================================================== +; Name...........: _MD5ForFile +; Description ...: Calculates MD5 value for the specific file. +; Syntax.........: _MD5ForFile ($sFile) +; Parameters ....: $sFile - Full path to the file to process. +; Return values .: Success - Returns MD5 value in form of hex string +; - Sets @error to 0 +; Failure - Returns empty string and sets @error: +; |1 - CreateFile function or call to it failed. +; |2 - CreateFileMapping function or call to it failed. +; |3 - MapViewOfFile function or call to it failed. +; |4 - MD5Init function or call to it failed. +; |5 - MD5Update function or call to it failed. +; |6 - MD5Final function or call to it failed. +; Author ........: trancexx +; url ...........: http://www.autoitscript.com/forum/topic/95558-crc32-md4-md5-sha1-for-files/ +;========================================================================================== +Func _MD5ForFile($sFile) + Local $a_hCall = DllCall("kernel32.dll", "hwnd", "CreateFileW", _ + "wstr", $sFile, _ + "dword", 0x80000000, _ ; GENERIC_READ + "dword", 1, _ ; FILE_SHARE_READ + "ptr", 0, _ + "dword", 3, _ ; OPEN_EXISTING + "dword", 0, _ ; SECURITY_ANONYMOUS + "ptr", 0) + + If @error Or $a_hCall[0] = -1 Then + Return SetError(1, 0, "") + EndIf + + Local $hFile = $a_hCall[0] + + $a_hCall = DllCall("kernel32.dll", "ptr", "CreateFileMappingW", _ + "hwnd", $hFile, _ + "dword", 0, _ ; default security descriptor + "dword", 2, _ ; PAGE_READONLY + "dword", 0, _ + "dword", 0, _ + "ptr", 0) + + If @error Or Not $a_hCall[0] Then + DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFile) + Return SetError(2, 0, "") + EndIf + + DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFile) + + Local $hFileMappingObject = $a_hCall[0] + + $a_hCall = DllCall("kernel32.dll", "ptr", "MapViewOfFile", _ + "hwnd", $hFileMappingObject, _ + "dword", 4, _ ; FILE_MAP_READ + "dword", 0, _ + "dword", 0, _ + "dword", 0) + + If @error Or Not $a_hCall[0] Then + DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFileMappingObject) + Return SetError(3, 0, "") + EndIf + + Local $pFile = $a_hCall[0] + Local $iBufferSize = FileGetSize($sFile) + + Local $tMD5_CTX = DllStructCreate("dword i[2];" & _ + "dword buf[4];" & _ + "ubyte in[64];" & _ + "ubyte digest[16]") + + DllCall("advapi32.dll", "none", "MD5Init", "ptr", DllStructGetPtr($tMD5_CTX)) + + If @error Then + DllCall("kernel32.dll", "int", "UnmapViewOfFile", "ptr", $pFile) + DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFileMappingObject) + Return SetError(4, 0, "") + EndIf + + DllCall("advapi32.dll", "none", "MD5Update", _ + "ptr", DllStructGetPtr($tMD5_CTX), _ + "ptr", $pFile, _ + "dword", $iBufferSize) + + If @error Then + DllCall("kernel32.dll", "int", "UnmapViewOfFile", "ptr", $pFile) + DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFileMappingObject) + Return SetError(5, 0, "") + EndIf + + DllCall("advapi32.dll", "none", "MD5Final", "ptr", DllStructGetPtr($tMD5_CTX)) + + If @error Then + DllCall("kernel32.dll", "int", "UnmapViewOfFile", "ptr", $pFile) + DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFileMappingObject) + Return SetError(6, 0, "") + EndIf + + DllCall("kernel32.dll", "int", "UnmapViewOfFile", "ptr", $pFile) + DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hFileMappingObject) + + Local $sMD5 = Hex(DllStructGetData($tMD5_CTX, "digest")) + + Return SetError(0, 0, $sMD5) + +EndFunc ;==>_MD5ForFile + diff --git a/Installer/vi_files/UDFs/MIDIConstants.au3 b/Installer/vi_files/UDFs/MIDIConstants.au3 new file mode 100644 index 00000000..5080b072 --- /dev/null +++ b/Installer/vi_files/UDFs/MIDIConstants.au3 @@ -0,0 +1,472 @@ +; ======================================================================================================== +; +; +; Constants for Use with the MIDIFunctions UDF +; +; Author: Ascend4nt, based on work by Eynstyne +; ======================================================================================================== + +; ---------------------------- MIDI Callback Constants ---------------------------- +Global Const $MIDI_Callback_NULL = 0 +Global Const $MIDI_Callback_Window = 0x10000 +Global Const $MIDI_Callback_Thread = 0x20000 +Global Const $MIDI_Callback_Function = 0x30000 +Global Const $MIDI_Callback_Event = 0x50000 + +; ---------------------------- MULTIMEDIA SYSTEM ERRORS ---------------------------- +Global Const $MMSYSERR_BASE = 0 +Global Const $MMSYSERR_ALLOCATED = ($MMSYSERR_BASE + 4) +Global Const $MMSYSERR_BADDEVICEID = ($MMSYSERR_BASE + 2) +Global Const $MMSYSERR_BADERRNUM = ($MMSYSERR_BASE + 9) +Global Const $MMSYSERR_ERROR = ($MMSYSERR_BASE + 1) +Global Const $MMSYSERR_HANDLEBUSY = ($MMSYSERR_BASE + 12) +Global Const $MMSYSERR_INVALFLAG = ($MMSYSERR_BASE + 10) +Global Const $MMSYSERR_INVALHANDLE = ($MMSYSERR_BASE + 5) +Global Const $MMSYSERR_INVALIDALIAS = ($MMSYSERR_BASE + 13) +Global Const $MMSYSERR_INVALPARAM = ($MMSYSERR_BASE + 11) +Global Const $MMSYSERR_LASTERROR = ($MMSYSERR_BASE + 13) +Global Const $MMSYSERR_NODRIVER = ($MMSYSERR_BASE + 6) +Global Const $MMSYSERR_NOERROR = 0 +Global Const $MMSYSERR_NOMEM = ($MMSYSERR_BASE + 7) +Global Const $MMSYSERR_NOTENABLED = ($MMSYSERR_BASE + 3) +Global Const $MMSYSERR_NOTSUPPORTED = ($MMSYSERR_BASE + 8) + +; ---------------------------- MIDI MISC Global Constants ---------------------------- +Global Const $MIDI_CACHE_ALL = 1 +Global Const $MIDI_CACHE_BESTFIT = 2 +Global Const $MIDI_CACHE_QUERY = 3 +Global Const $MIDI_UNCACHE = 4 +Global Const $MIDI_CACHE_VALID = ($MIDI_CACHE_ALL Or $MIDI_CACHE_BESTFIT Or $MIDI_CACHE_QUERY Or $MIDI_UNCACHE) +Global Const $MIDI_IO_STATUS = 0x20 +Global Const $MIDICAPS_CACHE = 0x4 +Global Const $MIDICAPS_LRVOLUME = 0x20 +Global Const $MIDICAPS_STREAM = 0x8 +Global Const $MIDICAPS_VOLUME = 0x1 + +Global Const $MIDIERR_BASE = 64 +Global Const $MIDIERR_INVALIDSETUP = ($MIDIERR_BASE + 5) +Global Const $MIDIERR_LASTERROR = ($MIDIERR_BASE + 5) +Global Const $MIDIERR_NODEVICE = ($MIDIERR_BASE + 4) +Global Const $MIDIERR_NOMAP = ($MIDIERR_BASE + 2) +Global Const $MIDIERR_NOTREADY = ($MIDIERR_BASE + 3) +Global Const $MIDIERR_STILLPLAYING = ($MIDIERR_BASE + 1) +Global Const $MIDIERR_UNPREPARED = ($MIDIERR_BASE + 0) +Global Const $MIDIMAPPER = -1 +Global Const $MIDIPROP_GET = 0x40000000 +Global Const $MIDIPROP_SET = 0x80000000 +Global Const $MIDIPROP_TEMPO = 0x2 +Global Const $MIDIPROP_TIMEDIV = 0x1 +Global Const $MIDISTRM_ERROR = -2 +Global Const $MM_MPU401_MidiOUT = 10 +Global Const $MM_MPU401_MidiIN = 11 +Global Const $MM_Midi_MAPPER = 1 +Global Const $MIDIPATCHSIZE = 128 + +; ---------------------------- MIDI Message Constants ---------------------------- +Global Const $MM_MIM_CLOSE = 0x3c2 +Global Const $MM_MIM_DATA = 0x3c3 +Global Const $MM_MIM_ERROR = 0x3c5 +Global Const $MM_MIM_LONGDATA = 0x3c4 +Global Const $MM_MIM_LONGERROR = 0x3c6 +Global Const $MM_MIM_MOREDATA = 0x3cc +Global Const $MM_MIM_OPEN = 0x3c1 +Global Const $MM_MOM_CLOSE = 0x3c8 +Global Const $MM_MOM_DONE = 0x3c9 +Global Const $MM_MOM_OPEN = 0x3c7 +Global Const $MM_MOM_POSITIONCB = 0x3ca +Global Const $MIM_CLOSE = ($MM_MIM_CLOSE) +Global Const $MIM_DATA = ($MM_MIM_DATA) +Global Const $MIM_ERROR = ($MM_MIM_ERROR) +Global Const $MIM_LONGDATA = ($MM_MIM_LONGDATA) +Global Const $MIM_LONGERROR = ($MM_MIM_LONGERROR) +Global Const $MIM_MOREDATA = ($MM_MIM_MOREDATA) +Global Const $MIM_OPEN = ($MM_MIM_OPEN) +Global Const $MOM_CLOSE = ($MM_MOM_CLOSE) +Global Const $MOM_DONE = ($MM_MOM_DONE) +Global Const $MOM_OPEN = ($MM_MOM_OPEN) +Global Const $MOM_POSITIONCB = ($MM_MOM_POSITIONCB) + +; ---------------------------- MIDI Instrument Values ---------------------------- +; Piano +Global Const $INSTR_AcousticGrandPiano = 0 +Global Const $INSTR_BrightPiano = 1 +Global Const $INSTR_ElectricGrandPiano = 2 +Global Const $INSTR_HonkyTonkpiano = 3 +Global Const $INSTR_ElectricPiano1 = 4 +Global Const $INSTR_ElectricPiano2 = 5 +Global Const $INSTR_Harpsichord = 6 +Global Const $INSTR_Clav = 7 +; Chromatic Percussion +Global Const $INSTR_Celesta = 8 +Global Const $INSTR_Glockenspiel = 9 +Global Const $INSTR_MusicBox = 10 +Global Const $INSTR_Vibraphone = 11 +Global Const $INSTR_Marimba = 12 +Global Const $INSTR_Xylophone = 13 +Global Const $INSTR_TubularBells = 14 +Global Const $INSTR_Dulcimer = 15 +; Organ +Global Const $INSTR_DrawbarOrgan = 16 +Global Const $INSTR_PercussiveOrgan = 17 +Global Const $INSTR_RockOrgan = 18 +Global Const $INSTR_ChurchOrgan = 19 +Global Const $INSTR_ReedOrgan = 20 +Global Const $INSTR_Accordian = 21 +Global Const $INSTR_Harmonica = 22 +Global Const $INSTR_TangoAccordian = 23 +; Guitar +Global Const $INSTR_NylonStringGuitar = 24 +Global Const $INSTR_SteelStringGuitar = 25 +Global Const $INSTR_JazzGuitar = 26 +Global Const $INSTR_CleanElectricGuitar = 27 +Global Const $INSTR_MutedElectricGuitar = 28 +Global Const $INSTR_OverdriveGuitar = 29 +Global Const $INSTR_DistortionGuitar = 30 +Global Const $INSTR_GuitarHarmonics = 31 +; Bass +Global Const $INSTR_AcousticBass = 32 +Global Const $INSTR_FingeredBass = 33 +Global Const $INSTR_PickedBass = 34 +Global Const $INSTR_FretlessBass = 35 +Global Const $INSTR_SlapBass1 = 36 +Global Const $INSTR_SlapBass2 = 37 +Global Const $INSTR_SynthBass1 = 38 +Global Const $INSTR_SynthBass2 = 39 +; Strings +Global Const $INSTR_Violin = 40 +Global Const $INSTR_Viola = 41 +Global Const $INSTR_Cello = 42 +Global Const $INSTR_Contrabass = 43 +Global Const $INSTR_TremoloStrings = 44 +Global Const $INSTR_PizzicatoStrings = 45 +Global Const $INSTR_OrchestralHarp = 46 +Global Const $INSTR_Timpani = 47 +; Ensemble +Global Const $INSTR_StringEnsemble1 = 48 +Global Const $INSTR_StringEnsemble2 = 49 +Global Const $INSTR_SynthStrings1 = 50 +Global Const $INSTR_SynthStrings2 = 51 +Global Const $INSTR_ChoirAhh = 52 +Global Const $INSTR_ChoirOohh = 53 +Global Const $INSTR_SynthVoice = 54 +Global Const $INSTR_OrchestralHit = 55 +; Brass +Global Const $INSTR_Trumpet = 56 +Global Const $INSTR_Trombone = 57 +Global Const $INSTR_Tuba = 58 +Global Const $INSTR_MutedTrumpet = 59 +Global Const $INSTR_FrenchHorn = 60 +Global Const $INSTR_BrassSection = 61 +Global Const $INSTR_SynthBrass1 = 62 +Global Const $INSTR_SynthBrass2 = 63 +; Reed +Global Const $INSTR_SopranoSax = 64 +Global Const $INSTR_AltoSax = 65 +Global Const $INSTR_TenorSax = 66 +Global Const $INSTR_BaritoneSax = 67 +Global Const $INSTR_Oboe = 68 +Global Const $INSTR_EnglishHorn = 69 +Global Const $INSTR_Bassoon = 70 +Global Const $INSTR_Clarinet = 71 +; Pipe +Global Const $INSTR_Piccolo = 72 +Global Const $INSTR_Flute = 73 +Global Const $INSTR_Recorder = 74 +Global Const $INSTR_PanFlute = 75 +Global Const $INSTR_BlownBottle = 76 +Global Const $INSTR_Shakuhachi = 77 +Global Const $INSTR_Whistle = 78 +Global Const $INSTR_Ocarina = 79 +; Synth Lead +Global Const $INSTR_SquareWav = 80 +Global Const $INSTR_SawtoothWav = 81 +Global Const $INSTR_Caliope = 82 +Global Const $INSTR_Chiff = 83 +Global Const $INSTR_Charang = 84 +Global Const $INSTR_Voice = 85 +Global Const $INSTR_Fifths = 86 +Global Const $INSTR_BassAndLead = 87 +; Synth Pad +Global Const $INSTR_NewAge = 88 +Global Const $INSTR_Warm = 89 +Global Const $INSTR_Polysynth = 90 +Global Const $INSTR_Choir = 91 +Global Const $INSTR_Bowed = 92 +Global Const $INSTR_Metallic = 93 +Global Const $INSTR_Halo = 94 +Global Const $INSTR_Sweep = 95 +; Synth Effects +Global Const $INSTR_FXRain = 96 +Global Const $INSTR_FXSoundtrack = 97 +Global Const $INSTR_FXCrystal = 98 +Global Const $INSTR_FXAtmosphere = 99 +Global Const $INSTR_FXBrightness = 100 +Global Const $INSTR_FXGoblins = 101 +Global Const $INSTR_FXEchoDrops = 102 +Global Const $INSTR_FXStarTheme = 103 +; Ethnic +Global Const $INSTR_Sitar = 104 +Global Const $INSTR_Banjo = 105 +Global Const $INSTR_Shamisen = 106 +Global Const $INSTR_Koto = 107 +Global Const $INSTR_Kalimba = 108 +Global Const $INSTR_Bagpipe = 109 +Global Const $INSTR_Fiddle = 110 +Global Const $INSTR_Shanai = 111 +; Percussive +Global Const $INSTR_TinkleBell = 112 +Global Const $INSTR_Agogo = 113 +Global Const $INSTR_SteelDrums = 114 +Global Const $INSTR_Woodblock = 115 +Global Const $INSTR_TaikoDrum = 116 +Global Const $INSTR_MelodicTom = 117 +Global Const $INSTR_SynthDrum = 118 +Global Const $INSTR_ReverseCymbal = 119 +; Sound Effects +Global Const $INSTR_GuitarFretNoise = 120 +Global Const $INSTR_BreathNoise = 121 +Global Const $INSTR_Seashore = 122 +Global Const $INSTR_BirdTweet = 123 +Global Const $INSTR_TelephoneRing = 124 +Global Const $INSTR_Helicopter = 125 +Global Const $INSTR_Applause = 126 +Global Const $INSTR_Gunshot = 127 + +; ---------------------------- MIDI Note Values ---------------------------- +Global Const $NOTE_A0 = 0x15 +Global Const $NOTE_A0SHARP = 0x16 +Global Const $NOTE_B0 = 0x17 +Global Const $NOTE_C1 = 0x18 +Global Const $NOTE_C1SHARP = 0x19 +Global Const $NOTE_D1 = 0x1A +Global Const $NOTE_D1SHARP = 0x1B +Global Const $NOTE_E1 = 0x1C +Global Const $NOTE_F1 = 0x1D +Global Const $NOTE_F1SHARP = 0x1E +Global Const $NOTE_G1 = 0x1F +Global Const $NOTE_G1SHARP = 0x20 +Global Const $NOTE_A1 = 0x21 +Global Const $NOTE_A1SHARP = 0x22 +Global Const $NOTE_B1 = 0x23 +Global Const $NOTE_C2 = 0x24 +Global Const $NOTE_C2SHARP = 0x25 +Global Const $NOTE_D2 = 0x26 +Global Const $NOTE_D2SHARP = 0x27 +Global Const $NOTE_E2 = 0x28 +Global Const $NOTE_F2 = 0x29 +Global Const $NOTE_F2SHARP = 0x2A +Global Const $NOTE_G2 = 0x2B +Global Const $NOTE_G2SHARP = 0x2C +Global Const $NOTE_A2 = 0x2D +Global Const $NOTE_A2SHARP = 0x2E +Global Const $NOTE_B2 = 0x2F +Global Const $NOTE_C3 = 0x30 +Global Const $NOTE_C3SHARP = 0x31 +Global Const $NOTE_D3 = 0x32 +Global Const $NOTE_D3SHARP = 0x33 +Global Const $NOTE_E3 = 0x34 +Global Const $NOTE_F3 = 0x35 +Global Const $NOTE_F3SHARP = 0x36 +Global Const $NOTE_G3 = 0x37 +Global Const $NOTE_G3SHARP = 0x38 +Global Const $NOTE_A3 = 0x39 +Global Const $NOTE_A3SHARP = 0x3A +Global Const $NOTE_B3 = 0x3B +Global Const $NOTE_C4 = 0x3C +Global Const $NOTE_C4SHARP = 0x3D +Global Const $NOTE_D4 = 0x3E +Global Const $NOTE_D4SHARP = 0x3F +Global Const $NOTE_E4 = 0x40 +Global Const $NOTE_F4 = 0x41 +Global Const $NOTE_F4SHARP = 0x42 +Global Const $NOTE_G4 = 0x43 +Global Const $NOTE_G4SHARP = 0x44 +Global Const $NOTE_A4 = 0x45 +Global Const $NOTE_A4SHARP = 0x46 +Global Const $NOTE_B4 = 0x47 +Global Const $NOTE_C5 = 0x48 +Global Const $NOTE_C5SHARP = 0x49 +Global Const $NOTE_D5 = 0x4A +Global Const $NOTE_D5SHARP = 0x4B +Global Const $NOTE_E5 = 0x4C +Global Const $NOTE_F5 = 0x4D +Global Const $NOTE_F5SHARP = 0x4E +Global Const $NOTE_G5 = 0x4F +Global Const $NOTE_G5SHARP = 0x50 +Global Const $NOTE_A5 = 0x51 +Global Const $NOTE_A5SHARP = 0x52 +Global Const $NOTE_B5 = 0x53 +Global Const $NOTE_C6 = 0x54 +Global Const $NOTE_C6SHARP = 0x55 +Global Const $NOTE_D6 = 0x56 +Global Const $NOTE_D6SHARP = 0x57 +Global Const $NOTE_E6 = 0x58 +Global Const $NOTE_F6 = 0x59 +Global Const $NOTE_F6SHARP = 0x5A +Global Const $NOTE_G6 = 0x5B +Global Const $NOTE_G6SHARP = 0x5C +Global Const $NOTE_A6 = 0x5D +Global Const $NOTE_A6SHARP = 0x5E +Global Const $NOTE_B6 = 0x5F +Global Const $NOTE_C7 = 0x60 +Global Const $NOTE_C7SHARP = 0x61 +Global Const $NOTE_D7 = 0x62 +Global Const $NOTE_D7SHARP = 0x63 +Global Const $NOTE_E7 = 0x64 +Global Const $NOTE_F7 = 0x65 +Global Const $NOTE_F7SHARP = 0x66 +Global Const $NOTE_G7 = 0x67 +Global Const $NOTE_G7SHARP = 0x68 +Global Const $NOTE_A7 = 0x69 +Global Const $NOTE_A7SHARP = 0x6A +Global Const $NOTE_B7 = 0x6B +Global Const $NOTE_C8 = 0x6C +; ---------------------------- MIDI Percussion Note Values ---------------------------- +Global Const $DRUMS_AcousticBassDrum = 0x23 +Global Const $DRUMS_BassDrum1 = 0x24 +Global Const $DRUMS_SideStick = 0x25 +Global Const $DRUMS_AcousticSnare = 0x26 +Global Const $DRUMS_HandClap = 0x27 +Global Const $DRUMS_ElectricSnare = 0x28 +Global Const $DRUMS_LowFloorTom = 0x29 +Global Const $DRUMS_ClosedHiHat = 0x2A +Global Const $DRUMS_HighFloorTom = 0x2B +Global Const $DRUMS_PedalHiHat = 0x2C +Global Const $DRUMS_LowTom = 0x2D +Global Const $DRUMS_OpenHiHat = 0x2E +Global Const $DRUMS_LowMidTom = 0x2F +Global Const $DRUMS_HiMidTom = 0x30 +Global Const $DRUMS_CrashCymbal1 = 0x31 +Global Const $DRUMS_HighTom = 0x32 +Global Const $DRUMS_RideCymbal1 = 0x33 +Global Const $DRUMS_ChineseCymbal = 0x34 +Global Const $DRUMS_RideBell = 0x35 +Global Const $DRUMS_Tambourine = 0x36 +Global Const $DRUMS_SplashCymbal = 0x37 +Global Const $DRUMS_Cowbell = 0x38 +Global Const $DRUMS_CrashSymbol2 = 0x39 +Global Const $DRUMS_Vibraslap = 0x3A +Global Const $DRUMS_RideCymbal2 = 0x3B +Global Const $DRUMS_HiBongo = 0x3C +Global Const $DRUMS_LowBongo = 0x3D +Global Const $DRUMS_MuteHiConga = 0x3E +Global Const $DRUMS_OpenHiConga = 0x3F +Global Const $DRUMS_LowConga = 0x40 +Global Const $DRUMS_HighTimbale = 0x41 +Global Const $DRUMS_LowTimbale = 0x42 +Global Const $DRUMS_HighAgogo = 0x43 +Global Const $DRUMS_LowAgogo = 0x44 +Global Const $DRUMS_Cabasa = 0x45 +Global Const $DRUMS_Maracas = 0x46 +Global Const $DRUMS_ShortWhistle = 0x47 +Global Const $DRUMS_LongWhistle = 0x48 +Global Const $DRUMS_ShortGuiro = 0x49 +Global Const $DRUMS_LongGuiro = 0x4A +Global Const $DRUMS_Claves = 0x4B +Global Const $DRUMS_HiWoodBlock = 0x4C +Global Const $DRUMS_LowWoodBlock = 0x4D +Global Const $DRUMS_MuteCuica = 0x4E +Global Const $DRUMS_OpenCuica = 0x4F +Global Const $DRUMS_MuteTriangle = 0x50 +Global Const $DRUMS_OpenTriangle = 0x51 +Global Const $DRUMS_Shaker = 0x52 +; ---------------------------- MIDI Channels ---------------------------- +Global Const $MIDI_CHANNEL_1 = 1 +Global Const $MIDI_CHANNEL_2 = 2 +Global Const $MIDI_CHANNEL_3 = 3 +Global Const $MIDI_CHANNEL_4 = 4 +Global Const $MIDI_CHANNEL_5 = 5 +Global Const $MIDI_CHANNEL_6 = 6 +Global Const $MIDI_CHANNEL_7 = 7 +Global Const $MIDI_CHANNEL_8 = 8 +Global Const $MIDI_CHANNEL_9 = 9 +Global Const $MIDI_PERCUSSION_CHANNEL = 10 ; Drums etc +Global Const $MIDI_CHANNEL_11 = 11 +Global Const $MIDI_CHANNEL_12 = 12 +Global Const $MIDI_CHANNEL_13 = 13 +Global Const $MIDI_CHANNEL_14 = 14 +Global Const $MIDI_CHANNEL_15 = 15 +Global Const $MIDI_CHANNEL_16 = 16 +; ---------------------------- MIDI Range Constants ---------------------------- +; Min/Max Values +Global Const $MIDI_MIN_VALUE = 0 +Global Const $MIDI_CENTER_VALUE = 64 +Global Const $MIDI_MAX_VALUE = 0x7F +Global Const $MIDI_PITCH_BEND_MIN = 0 +Global Const $MIDI_PITCH_BEND_CENTER = 0x2000 +Global Const $MIDI_PITCH_BEND_MAX = 0x3FFF +; ---------------------------- MIDI CONTROL Messages ---------------------------- +Global Const $MIDI_CONTROL_BANK_SELECT = 0 +Global Const $MIDI_CONTROL_MODULATE = 0x01 +Global Const $MIDI_CONTROL_BREATH_CONTROLLER = 0x02 +; 0x03 = Undefined +Global Const $MIDI_CONTROL_FOOT_CONTROLLER = 0x04 +Global Const $MIDI_CONTROL_PORTAMENTO_TIME = 0x05 +Global Const $MIDI_CONTROL_DATA_ENTRY_MSB = 0x06 +Global Const $MIDI_CONTROL_CHANNEL_VOLUME = 0x07 +Global Const $MIDI_CONTROL_BALANCE = 0x08 +; 0x09 = Undefined +Global Const $MIDI_CONTROL_PAN = 0x0A +Global Const $MIDI_CONTROL_EXPRESSION_CONTROLLER = 0x0B +Global Const $MIDI_CONTROL_EFFECT_CONTROL_1 = 0x0C +Global Const $MIDI_CONTROL_EFFECT_CONTROL_2 = 0x0D +; 0x0E, 0x0F = Undefined +; ----- GENERAL PURPOSE CONTROLLERS ------ +Global Const $MIDI_CONTROL_GENERAL_PURPOSE_1 = 0x10 +Global Const $MIDI_CONTROL_GENERAL_PURPOSE_2 = 0x11 +Global Const $MIDI_CONTROL_GENERAL_PURPOSE_3 = 0x12 +Global Const $MIDI_CONTROL_GENERAL_PURPOSE_4 = 0x13 +; 0x14 -> 0x1F = Undefined +; ------- PEDALS (4 variants) --------- +Global Const $MIDI_CONTROL_DAMPER_PEDAL = 0x40 ; alternate name for 'Sustain' +Global Const $MIDI_CONTROL_SUSTAIN_PEDAL = 0x40 ; <= 63 is OFF, >= 64 is ON +Global Const $MIDI_CONTROL_PORTAMENTO_PEDAL = 0x41 ; <= 63 is OFF, >= 64 is ON +Global Const $MIDI_CONTROL_SOSTENUTO_PEDAL = 0x42 ; <= 63 is OFF, >= 64 is ON +Global Const $MIDI_CONTROL_SOFT_PEDAL = 0x43 + +Global Const $MIDI_CONTROL_LEGATO_FOOTSWITCH = 0x44 ; <= 63 is 'Normal', >= 64 is Legato +Global Const $MIDI_CONTROL_HOLD_2 = 0x45 ; <= 63 is OFF, >= 64 is ON +; ------- SOUND CONTROLLERS -------- +Global Const $MIDI_CONTROL_SOUND_CONTROLLER_1 = 0x46 ; Default: Sound Variation +Global Const $MIDI_CONTROL_SOUND_CONTROLLER_2 = 0x47 ; Default: Timbre/Harmonic Intensity +Global Const $MIDI_CONTROL_SOUND_CONTROLLER_3 = 0x48 ; Default: Release Time +Global Const $MIDI_CONTROL_SOUND_CONTROLLER_4 = 0x49 ; Default: Attack Time +Global Const $MIDI_CONTROL_SOUND_CONTROLLER_5 = 0x4A ; Default: Brightness +Global Const $MIDI_CONTROL_SOUND_CONTROLLER_6 = 0x4B ; Default: Decay Time +Global Const $MIDI_CONTROL_SOUND_CONTROLLER_7 = 0x4C ; Default: Vibrato Rate +Global Const $MIDI_CONTROL_SOUND_CONTROLLER_8 = 0x4D ; Default: Vibrato Depth +Global Const $MIDI_CONTROL_SOUND_CONTROLLER_9 = 0x4E ; Default: Vibrato Delay +Global Const $MIDI_CONTROL_SOUND_CONTROLLER_10 = 0x4F ; No Default defined +; ----- GENERAL PURPOSE CONTROLLERS ------ +Global Const $MIDI_CONTROL_GENERAL_PURPOSE_5 = 0x50 +Global Const $MIDI_CONTROL_GENERAL_PURPOSE_6 = 0x51 +Global Const $MIDI_CONTROL_GENERAL_PURPOSE_7 = 0x52 +Global Const $MIDI_CONTROL_GENERAL_PURPOSE_8 = 0x53 +Global Const $MIDI_CONTROL_PORTAMENTO_CONTROL = 0x54 +; 0x55 - 0x57 = Undefined +Global Const $MIDI_CONTROL_HIGHRES_VELOCITY_PREFIX = 0x58 +; 0x59 - 0x5A = Undefined +Global Const $MIDI_CONTROL_EFFECTS_1_DEPTH = 0x5B ; Default: Reverb Send Level (formerly External Effects Depth) +Global Const $MIDI_CONTROL_EFFECTS_2_DEPTH = 0x5C ; (formerly Tremolo Depth) +Global Const $MIDI_CONTROL_EFFECTS_3_DEPTH = 0x5D ; Default: Chorus Send Level (formerly Chorus Depth) +Global Const $MIDI_CONTROL_EFFECTS_4_DEPTH = 0x5E ; (formerly Celeste [Detune] Depth) +Global Const $MIDI_CONTROL_EFFECTS_5_DEPTH = 0x5F ; (formerly Phaser Depth) +; These are used in conjunction with other messages: +Global Const $MIDI_CONTROL_DATA_INCREMENT = 0x60 ; Data Entry + 1 **Control Value: 0 +Global Const $MIDI_CONTROL_DATA_DECREMENT = 0x61 ; Data Entry - 1 **Control Value: 0 +; ------ REGISTERED PARAMETER SEQUENCES ------ +; These are combined with other messages +Global Const $MIDI_CONTROL_NONREGISTERED_PARAM_NUM = 0x62 +; 0x63 = Non-Registered Parameter Number using MSB +Global Const $MIDI_CONTROL_REGISTERED_PARAM_NUM = 0x64 +; 0x65 = Registered Parameter Number using MSB +; 0x66 - 0x77 = Undefined +; ------ CHANNEL MODE MESSAGES ------ +Global Const $MIDI_CONTROL_ALL_SOUND_OFF = 0x78 ; Control Value: 0 +Global Const $MIDI_CONTROL_RESET_ALL_CONTROLLERS = 0x79 ; Control Value: 0 +Global Const $MIDI_CONTROL_LOCAL_CONTROL = 0x7A ; 0 = Off, 127 = On +Global Const $MIDI_CONTROL_ALL_NOTES_OFF = 0x7B ; Control Value: 0 +Global Const $MIDI_CONTROL_OMNI_MODE_OFF = 0x7C ; Additionally sets All Notes OFF **Control Value: 0 +Global Const $MIDI_CONTROL_OMNI_MODE_ON = 0x7D ; Additionally sets All Notes OFF **Control Value: 0 +Global Const $MIDI_CONTROL_MONO_MODE_ON = 0x7E ; Additionally: All Notes OFF, Poly OFF **Control Value: 0?? (see Midi Table) +Global Const $MIDI_CONTROL_POOLY_MODE_ON = 0x7F ; Additionally: All Notes OFF, Mono OFF **Control Value: 0 diff --git a/Installer/vi_files/UDFs/MIDIFunctions.au3 b/Installer/vi_files/UDFs/MIDIFunctions.au3 new file mode 100644 index 00000000..50bc8770 --- /dev/null +++ b/Installer/vi_files/UDFs/MIDIFunctions.au3 @@ -0,0 +1,925 @@ +; ==================================================================================================== +; +; +; A MIDI UDF originated by Eynstyne, furthered by Ascend4nt and others (see Changes) +; +; Changes From Original midiUDF: +; *GMK -> cleanup of code, Constants 'cleanup', addition of Drum Map +; *Ascend4nt: +; - Changed '_NOTEON/OFF' to _ON or _OFF per suggestion by Paulie* repalced with $NOTE_xx constants +; - Recently Ditched _NOTEON/OFF as the messages weren't correct and weren't using the full +; expressive capabilities of the MIDI interface +; - @error checks/returns fixed (still some consistency needed in the module overall though) +; - x64 compatibility & Structure fixes +; - Addition of functions: _MidiOutPrepareHeader, _MidiOutUnprepareHeader, _MidiStreamOut +; (Still unclear as to MIDI buffer setup, and how _MidiStreamProperty should be called) +; - fixed 'PrepareHeader' and 'UnprepareHeader' functions, and other functions that +; require a 'Prepared' Header (see function definitions for which require it) +; (Note: 'PrepareHeader' returns a structure, which must be passed (by reference) to these functions) +; - fixed 'PrepareHeader' to make buffer part of structure (otherwise buffer is lost on function exit) +; (all functions updated to calculate size of structure based on this new format) +; - added short structure definition for MIDI data.. +; - fixed $E4_OFF value (thx czardas)* also replaced with $NOTE_xx constants +; - Added WinMM DLL handle for all calls. This speeds up calls and doesn't affect memory usage as +; the module is imported by AutoIt anyway (i.e. it is preloaded) +; - Added Full expressive NoteOn/Off functions - with channel and velocity selection +; - Added nearly all useful MIDI messaging Functions +; - Added $NOTE_xx constants, $DRUMS_xx constants, CONTROLLER Constants, misc. others +; - Tidied up, declared locals, got rid of unneeded dependencies +; - Added new 'Extended Functions' (Ascend4nt) which expose most of the basic MIDI message interface +; (there's optional bit-masking in the functions to control bad input, currently commented out) +; +; Basic API Functions (Eynstyne mostly): +; _MidiOutGetNumDevs() +; _MidiInGetNumDevs() +; _MidiOutOpen() +; _MidiInOpen() +; _MidiOutSetVolume() +; _MidiOutGetVolume() +; _MidiOutReset() +; _MidiInReset() +; _MidiInStart() +; _MidiInStop() +; _MidiOutClose() +; _MidiInClose() +; _MidiOutCacheDrumPatches() +; _MidiOutCachePatches() +; _MidiInGetID() +; _MidiOutGetID() +; _MidiInGetErrorText() +; _MidiOutGetErrorText() +; _MidiOutShortMsg() +; _MidiOutLongMsg() +; _MidiOutLongMsg() +; _MidiOutGetDevCaps() +; _MidiInGetDevCaps() +; _MidiConnect() +; _MidiDisconnect() +; _MidiInPrepareHeader() +; _MidiInUnprepareHeader () +; _MidiInUnprepareHeader() +; _MidiOutPrepareHeader() +; _MidiOutUnprepareHeader () +; _MidiOutUnprepareHeader() +; _MidiInAddBuffer() +; _MidiInMessage() +; _MidiOutMessage() +; _MidiStreamClose() +; _MidiStreamOpen() +; _MidiStreamOut() +; _MidiStreamOut() +; _MidiStreamPause() +; _MidiStreamPos() +; _MidiStreamRestart() +; _MidiStreamStop() +; _MidiStreamProperty() +; +; Extended Functions (Ascend4nt): +; NoteOn() ; Turns on a given note on a given channel at a given velocity +; NoteAfterTouch(); Applies Aftertouch to a given note on a given channel at given pressure +; NoteOff() ; Turns off a given note on a given channel +; PercussionOn() ; Turns on a Percussion instrument at a given velocity +; PercussionOff() ; Turns off a Percussion instrument +; NotesAllOff() ; Turns off all notes on a given channel (unless sustain is on) +; MidiAllSoundOff() ; Turns off all sound on a given channel (even if sustain is on) +; MidiResetControllers() ; Resets Controllers (Pedals, PitchBend, Modulation, etc) +; MidiPitchBend() ; Pitch-bends all the notes on a given channel +; MidiChannelAftertouch() ; Sets Channel Pressure (AfterTouch) - different from NoteAfterTouch() +; MidiSetInstrument() ; Sets the instrument on a given channel (channel 10 is special though) +; MidiControlChange() ; Sends certain Control messages (such as Pan, Modulate, Volume) +; +; Reference: +; MIDI Message Table 1 (Status = low byte, data 1 = upper byte LowWord, 2 = low byte HiWord) +; @ http://www.midi.org/techspecs/midimessages.php +; +; "Multimedia Functions (Windows)" on MSDN +; @ http://msdn.microsoft.com/en-us/library/windows/desktop/dd743586%28v=vs.85%29.aspx +; +; MIDI Registry Keys: +; HKEY_CURRENT_USER\Software\Microsoft\ActiveMovie\devenum\{4EFE2452-168A-11D1-BC76-00C04FB9453B}\Default MidiOut Device +; HKEY_CURRENT_USER\Software\Microsoft\ActiveMovie\devenum 64-bit\{4EFE2452-168A-11D1-BC76-00C04FB9453B}\Default MidiOut Device +; +; MIDI Control on Win7: +; BASS MIDI: http://kode54.net/bassmididrv/ +; +; Special note: Callbacks can be done during Streaming. see MidiInProc and MidiOutProc @ MSDN +; +; See also: +; ; MIDI, WINMM Errors, Notes, Instruments, Controller Messages +; ; Simple demonstration of new MIDI capability +; +; Author: Eynstyne, Ascend4nt +; ==================================================================================================== + +; Speed up DLLCall's (winmm.dll is loaded with all AutoIt programs, so this doesn't hurt): +Global Const $g_MIDI_hWinMMDLL = DllOpen("winmm.dll") + + +; ------------------------ EXTENDED Functions -------------------------------------- + +; ============================================================================================== +; Func NoteOn($hMidiOut, $nNote, $nChannel = 1, $nVelocity = 127) +; +; Turns on, or restarts, $nNote on the given Channel at the given Velocity +; +; $hMidiOut = Handle to a Midi-Out device (retrieved via _MidiOutOpen() ) +; $nNote = Note to Turn On. Valid values are 0-127, with 60 representing Middle C (C4) +; There are 12 gradations of notes pitches (60 + 12 = C5) +; $nChannel = Channel to apply this to. Channels are 1-15, with 10 being percussion-only +; $nVelocity = Velocity to play note at. 127 is maximum volume, 64 is medium, and 0 is silent +; +; Author: Ascend4nt, based on code by Eynstyne [but more flexibility] +; ============================================================================================== +Func NoteOn($hMidiOut, $nNote, $nChannel = 1, $nVelocity = 127) +;~ Local Const $NOTE_ON = 0x90 + ; Adjust cut-offs for Note and Velocity (0 - 127 for each) +;~ $nVelocity = BitAND($nVelocity, 0x7F) + ; Adjust cut-off for Note (0 - 127 for each) +;~ $nNote = BitAND($nNote, 0x7F) + ; 0x90 = Note ON + Return _midiOutShortMsg($hMidiOut, ($nVelocity * 65536) + ($nNote * 256) + 0x90 + BitAND($nChannel - 1, 0xF)) +EndFunc + +; ============================================================================================== +; Func NoteAfterTouch($hMidiOut, $nNote, $nChannel = 1, $nPressure = 64) +; +; Applies Aftertouch to a given $nNote on the given Channel at the given Velocity +; "This message is most often sent by pressing down on the key after it 'bottoms out' " +; +; Your MIDI card/controller must support this. Mine doesn't so this needs further testing.. +; +; $hMidiOut = Handle to a Midi-Out device (retrieved via _MidiOutOpen() ) +; $nNote = Note to apply Aftertouch to. Valid values are 0-127, with 60 representing Middle C (C4) +; $nChannel = Channel to apply this to. Channels are 1-15, with 10 being percussion-only +; $nPressure = Afteroutch 'Pressure' to apply to note. 127 is max, 64 is medium, and 0 is none +; +; Author: Ascend4nt +; ============================================================================================== +Func NoteAfterTouch($hMidiOut, $nNote, $nChannel = 1, $nPressure = 64) + ; Adjust cut-offs for Note and Velocity (0 - 127 for each) +;~ $nPressure = BitAND($nPressure, 0x7F) + ; Adjust cut-off for Note (0 - 127 for each) +;~ $nNote = BitAND($nNote, 0x7F) + ; 0xA0 = Aftertouch + Return _midiOutShortMsg($hMidiOut, ($nPressure * 65536) + ($nNote * 256) + 0xA0 + BitAND($nChannel - 1, 0xF)) +EndFunc + +; ============================================================================================== +; Func NoteOff($hMidiOut, $nNote, $nChannel = 1, $nVelocity = 127) +; +; Turns off $nNote on the given Channel +; +; $hMidiOut = Handle to a Midi-Out device (retrieved via _MidiOutOpen() ) +; $nNote = Note to Turn On. Valid values are 0-127, with 60 representing Middle C (C4) +; There are 12 gradations of notes pitches (60 + 12 = C5) +; $nChannel = Channel to apply this to. Channels are 1-15, with 10 being percussion-only +; $nVelocity = Velocity to use at release. 127 is maximum volume, 64 is medium, and 0 is silent +; Not sure how this is applied at Note-Off, but it is nonetheless part of the mesage +; +; Author: Ascend4nt, based on code by Eynstyne [but corrected, and w/added ability] +; ============================================================================================== +Func NoteOff($hMidiOut, $nNote, $nChannel = 1, $nVelocity = 127) +;~ Local Const $NOTE_OFF = 0x80 + ; Adjust cut-off for Velocity (0 - 127) +;~ $nVelocity = BitAND($nVelocity, 0x7F) + ; Adjust cut-off for Note (0 - 127 for each) +;~ $nNote = BitAND($nNote, 0x7F) + ; 0x80 = Note OFF + Return _midiOutShortMsg($hMidiOut, ($nVelocity * 65536) + ($nNote * 256) + 0x80 + BitAND($nChannel - 1, 0xF)) +Endfunc + +; ============================================================================================== +; Func PercussionOn($hMidiOut, $nNote, $nVelocity = 127) +; +; A 'shortcut' to playing percussion instruments on channel 10 +; This is just a wrapper for a call to NoteOn for channel 10 +; +; $hMidiOut = Handle to a Midi-Out device (retrieved via _MidiOutOpen() ) +; $nNote = Instrument to Turn On. Valid values are 0-127 +; $nVelocity = Velocity to play instrument at. 127 is maximum volume, 64 is medium, and 0 is silent +; +; Author: Ascend4nt +; ============================================================================================== + +Func PercussionOn($hMidiOut, $nNote, $nVelocity = 127) + Return _midiOutShortMsg($hMidiOut, ($nVelocity * 65536) + ($nNote * 256) + 0x90 + 9) +;~ Return NoteOn($hMidiOut, $nNote, 10, $nVelocity) +EndFunc + +; ============================================================================================== +; Func PercussionOff($hMidiOut, $nNote, $nVelocity = 127) +; +; A 'shortcut' to playing percussion instruments on channel 10 +; This is just a wrapper for a call to NoteOff for channel 10 +; +; $hMidiOut = Handle to a Midi-Out device (retrieved via _MidiOutOpen() ) +; $nNote = Instrument to Turn On. Valid values are 0-127 +; $nVelocity = Velocity to use at release. 127 is maximum volume, 64 is medium, and 0 is silent +; Not sure how this is applied at Note-Off, but it is nonetheless part of the mesage +; +; Author: Ascend4nt +; ============================================================================================== + +Func PercussionOff($hMidiOut, $nNote, $nVelocity = 127) + Return _midiOutShortMsg($hMidiOut, ($nVelocity * 65536) + ($nNote * 256) + 0x80 + 9) +;~ Return NoteOff($hMidiOut, $nNote, 10, $nVelocity) +EndFunc + +; ============================================================================================== +; Func NotesAllOff($hMidiOut, $nChannel = 1) +; +; This turns off all 'On' notes for a given channel. +; NOTE however that a 'Sustain' message will continue emitting sound for any notes +; until either sustain is turned off, or MidiAllSoundOff() is called +; +; $hMidiOut = Handle to a Midi-Out device (retrieved via _MidiOutOpen() ) +; $nChannel = Channel to apply this to. Channels are 1-15, with 10 being percussion-only +; +; Author: Ascend4nt +; ============================================================================================== + +Func NotesAllOff($hMidiOut, $nChannel = 1) + ; 0xB0 = Channel Mode Message, 7B = All Notes Off + Return _midiOutShortMsg($hMidiOut, 0x7BB0 + BitAND($nChannel - 1, 0xF)) +EndFunc + +; ============================================================================================== +; Func MidiAllSoundOff($hMidiOut, $nChannel = 1) +; +; This turns off all sound for a given channel. +; This differs from NotesAllOff() in that this will additionally turn of sustained notes +; +; $hMidiOut = Handle to a Midi-Out device (retrieved via _MidiOutOpen() ) +; $nChannel = Channel to apply this to. Channels are 1-15, with 10 being percussion-only +; +; Author: Ascend4nt +; ============================================================================================== + +Func MidiAllSoundOff($hMidiOut, $nChannel = 1) + ; 0xB0 = Channel Mode Message, 78 = All Sound Off + Return _midiOutShortMsg($hMidiOut, 0x78B0 + BitAND($nChannel - 1, 0xF)) +EndFunc + +; ============================================================================================== +; Func MidiResetControllers($hMidiOut, $nChannel = 1) +; +; Resets Controllers: +; Modulation, Channel & Polyphonic Pressure are set to 0 +; Pedals (Sustain (Damper), Portamento, Sostenuto, Soft Pedal) set to 0 +; PitchBend set to center +; +; See 'RP-15: Response to Reset All Controllers' +; @ http://www.midi.org/techspecs/rp15.php +; +; $hMidiOut = Handle to a Midi-Out device (retrieved via _MidiOutOpen() ) +; $nChannel = Channel to apply this to. Channels are 1-15, with 10 being percussion-only +; +; Author: Ascend4nt +; ============================================================================================== + +Func MidiResetControllers($hMidiOut, $nChannel = 1) + ; 0xB0 = Channel Mode Message, 79 = Reset All Controllers + Return _midiOutShortMsg($hMidiOut, 0x79B0 + BitAND($nChannel - 1, 0xF)) +EndFunc + +; ============================================================================================== +; Func MidiPitchBend($hMidiOut, $nBendValue = 8192, $nChannel = 1) +; +; Pitch-Bends all Notes on specified channel +; +; $hMidiOut = Handle to a Midi-Out device (retrieved via _MidiOutOpen() ) +; $nBendValue = Value from 0 - 16383. Default (no bend) is 8192 (0x2000) +; Lower than 8192 lowers pitch, Higher #'s increase pitch +; $nChannel = Channel to apply this to. Channels are 1-15, with 10 being percussion-only +; +; The mapping of bytes appears correctly though: +; [31-24] = 0, [23] = 0, [22 - 16] = Upper 7 Bits, [15] = 0, [14 - 8] = Lower 7 Bits +; +; Author: Ascend4nt +; ============================================================================================== + +Func MidiPitchBend($hMidiOut, $nBendValue = 8192, $nChannel = 1) + ; Min-Max Range is 14 bits + If $nBendValue > 0x3FFF Or $nBendValue < 0 Then Return SetError(1,0,0) + ; Low 7 Bits - Upper Byte of Lower Word + Local $nLowBend = BitAND($nBendValue, 0x7F) * 256 + ; Upper 7 Bits -> Move to Lower Byte of Upper Word + Local $nHighBend = BitShift($nBendValue, 7) * 65536 +;~ ConsoleWrite("MidiPitchBend value = 0x" & Hex($nHighBend + $nLowBend + 0xE0 + $nChannel) & @CRLF) + ; 0xE0 = Pitch Bend + Return _midiOutShortMsg($hMidiOut, $nHighBend + $nLowBend + 0xE0 + BitAND($nChannel - 1, 0xF)) +EndFunc + +; ============================================================================================== +; Func MidiChannelAftertouch($hMidiOut, $nChannel = 1, $nVelocity = 127) +; +; Adjusts Channel Aftertouch. Different from Note Aftertouch +; +; See: 'MIDI Specification: Channel Pressure' +; @ http://www.blitter.com/~russtopia/MIDI/~jglatt/tech/midispec/pressure.htm +; +; $hMidiOut = Handle to a Midi-Out device (retrieved via _MidiOutOpen() ) +; $nChannel = Channel to apply this to. Channels are 1-15, with 10 being percussion-only +; $nVelocity = Velocity, or pressure, value. 127 is maximum volume, 64 is medium, and 0 is none +; +; Author: Ascend4nt +; ============================================================================================== + +Func MidiChannelAftertouch($hMidiOut, $nChannel = 1, $nVelocity = 127) + ; Adjust cut-off for Velocity (0 - 127) +;~ $nVelocity = BitAND($nVelocity, 0x7F) + ; 0xD0 = Channel Pressure (AfterTouch) + Return _midiOutShortMsg($hMidiOut, ($nVelocity * 256) + 0xD0 + BitAND($nChannel - 1, 0xF)) +EndFunc + +; ============================================================================================== +; Func MidiSetInstrument($hMidiOut, $nInstrument, $nChannel = 1) +; +; This sets a given instrument to a particular channel +; +; $hMidiOut = Handle to a Midi-Out device (retrieved via _MidiOutOpen() ) +; $nInstrument = Instrument to use for the given Channel. Valid values are 0-127 +; Note that this should have no effect on Channel 10, which is percussive instruments. +; $nChannel = Channel to apply this to. Channels are 1-15, with 10 being percussion-only +; +; Author: Eynstyne, Ascend4nt (added Channel capability, and filtering) +; ============================================================================================== + +Func MidiSetInstrument($hMidiOut, $nInstrument, $nChannel = 1) + ; Channels are 1-16 (represented as 0-15). Channel 10 is special- percussion instruments only + $nChannel = BitAND($nChannel - 1, 0xF) + ; Instruments are 0 - 127 +;~ $nInstrument = BitAND($nInstrument, 0x7F) + ; 0xC0 = Program Change + Return _midiOutShortMsg($hMidiOut, ($nInstrument * 256) + 0xC0 + $nChannel) +EndFunc + +; ============================================================================================== +; Func MidiControlChange($hMidiOut, $nControlID, $nControlVal, $nChannel = 1) +; +; Performs various control/mode changes on the specified channel +; +; $hMidiOut = Handle to a Midi-Out device (retrieved via _MidiOutOpen() ) +; $nControlID = # of the Control Function to use (e.g. 0x0A = Pan) +; $nControlVal = Value to be used with Control Change (0 - 127) +; $nChannel = Channel to apply this to. Channels are 1-15, with 10 being percussion-only +; +; Author: Ascend4nt +; ============================================================================================== + +Func MidiControlChange($hMidiOut, $nControlID, $nControlVal, $nChannel = 1) + ; 7-bit cut off for values + $nControlID = BitAND($nControlID, 0x7F) + $nControlVal = BitAND($nControlVal, 0x7F) + ; 0xB0 = Control Change + Return _midiOutShortMsg($hMidiOut, ($nControlVal * 65536) + ($nControlID * 256) + 0xB0 + BitAND($nChannel - 1, 0xF)) +EndFunc + + +; ------------------------ BASIC API FUNCTIONS -------------------------------------- + +;======================================================= +;Retrieves the number of Midi Output devices which exist +;Parameters - None +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiOutGetNumDevs() + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutGetNumDevs") + If @error Then Return SetError(@error, 0, 0) + Return $aRet[0] +EndFunc ;==>_MidiOutGetNumDevs + +;======================================================= +;Retrieves the number of Midi Input devices which exist +;Parameters - None +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiInGetNumDevs() ;Working + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInGetNumDevs") + If @error Then Return SetError(@error, 0, 0) + Return $aRet[0] +EndFunc ;==>_MidiInGetNumDevs + +;======================================================= +;Retrieves a MIDI handle and Opens the Device +;Parameters(Optional) - Device ID, Window Callback, +; instance, flags +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiOutOpen($nDevID = 0, $pCallback = 0, $instance = 0, $nFlags = 0) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutOpen", "handle*", 0, "int", $nDevID, "dword_ptr", $pCallback, "dword_ptr", $instance, "long", $nFlags) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[1] +EndFunc ;==>_MidiOutOpen + +;======================================================= +;Retrieves a MIDI handle and Opens the Device +;Parameters(Optional) - Device ID, Window Callback, +; instance, flags +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiInOpen($nDevID = 0, $pCallback = 0, $instance = 0, $nFlags = 0) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInOpen", "handle*", 0, "int", $nDevID, "dword_ptr", $pCallback, "dword_ptr", $instance, "long", $nFlags) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[1] +EndFunc ;==>_MidiInOpen + +;======================================================= +;Sets the Mixer Volume for MIDI +;Parameters - Volume (0 - 65535) +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiOutSetVolume($nVolume, $nDevID = 0) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutSetVolume", "handle", $nDevID, "int", $nVolume) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiOutSetVolume + +;======================================================= +;Gets the Mixer Volume for MIDI +;Parameters - None +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiOutGetVolume($nDevID = 0) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutGetVolume", "handle", $nDevID, "dword*", 0) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[2] +EndFunc ;==>_MidiOutGetVolume + +;======================================================= +;Resets MIDI Output/Input +;Parameters - MidiHandle +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiOutReset($hMidiOut) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutReset", "handle", $hMidiOut) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiOutReset + +Func _MidiInReset($hMidiIn) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInReset", "handle", $hMidiIn) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiInReset + +;======================================================= +;Starts Midi Input +;Parameters - MidiHandle +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiInStart($hMidiIn) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInStart", "handle", $hMidiIn) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiInStart + +;======================================================= +;Stops Midi Input +;Parameters - MidiHandle +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiInStop($hMidiIn) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInStop", "handle", $hMidiIn) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiInStop + +;======================================================= +;Closes Midi Output/Input devices +;Parameters - MidiHandle +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiOutClose($hMidiOut) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutClose", "handle", $hMidiOut) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiOutClose + +Func _MidiInClose($hMidiIn) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInClose", "handle", $hMidiIn) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiInClose + +;======================================================= +;Cache Drum Patches for Output +;Parameters - MidiHandle,Patch,$patches,Flag +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiOutCacheDrumPatches($hMidiOut, $Patch, $patches, $nFlags = 0) + Local $aRet, $stKeyArray = DllStructCreate("short[128]") ; "short KEYARRAY[MIDIPATCHSIZE]" (MIDIPATCHSIZE=128] + If Not IsArray($patches) Then Dim $patches[0] = [$patches] + For $i = 0 To UBound($patches) - 1 + DllStructSetData($stKeyArray, 1, $patches[$i], $i + 1) + Next + $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutCacheDrumPatches", "handle", $hMidiOut, "int", $Patch, "ptr", DllStructGetPtr($stKeyArray), "int", $nFlags) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiOutCacheDrumPatches + +;======================================================= +;Caches MIDI Patches +;Parameters - MidiHandle, Bank, $patches, Flags +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiOutCachePatches($hMidiOut, $nBank, $patches, $nFlags = 0) + Local $aRet, $stPatchArray = DllStructCreate("short[128]") ; "short PATCHARRAY[MIDIPATCHSIZE]" (MIDIPATCHSIZE=128) + If Not IsArray($patches) Then Dim $patches[0] = [$patches] + For $i = 0 To UBound($patches) - 1 + DllStructSetData($stPatchArray, 1, $patches[$i], $i + 1) + Next + $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutCachePatches", "handle", $hMidiOut, "int", $nBank, "ptr", DllStructGetPtr($stPatchArray), "int", $nFlags) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiOutCachePatches + +;======================================================= +;Gets MIDI DeviceID +;Parameters - MidiHandle +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiInGetID($hMidiIn) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInGetID", "handle", $hMidiIn, "uint*", 0) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[2] +EndFunc ;==>_MidiInGetID + +Func _MidiOutGetID($hMidiOut) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutGetID", "handle", $hMidiOut, "uint*", 0) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[2] +EndFunc ;==>_MidiOutGetID + +;======================================================= +;Translates Error codes into Plaintext +;Parameters - Error number +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiInGetErrorText($nError) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInGetErrorTextW", "int", $nError, "wstr", "", "uint", 65536) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + MsgBox(0, "MIDI In Error Text", $aRet[2]) + Return $aRet[2] +EndFunc ;==>_MidiInGetErrorText + +Func _MidiOutGetErrorText($nError) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutGetErrorTextW", "int", $nError, "wstr", "", "uint", 65536) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + MsgBox(0, "MIDI Out Error Text", $aRet[2]) + Return $aRet[2] +EndFunc ;==>_MidiOutGetErrorText + +;======================================================= +;MIDI Message Send Function +;Parameters - Message as Hexcode or Constant +;Author : Eynstyne +;Library : Microsoft winmm.dll +;======================================================= +Func _MidiOutShortMsg($hMidiOut, $nMsg) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutShortMsg", "handle", $hMidiOut, "long", $nMsg) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiOutShortMsg + +;======================================================= +; Func _MidiOutLongMsg($hMidiOut, ByRef $stPreparedMidiHdr) +; +; parameters: handle to Midi Out, structure (from _MidiOutPrepareHeader) +;======================================================= + +Func _MidiOutLongMsg($hMidiOut, ByRef $stPreparedMidiHdr) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutLongMsg", "handle", $hMidiOut, "ptr", DllStructGetPtr($stPreparedMidiHdr), "long", Number(DllStructGetPtr($stPreparedMidiHdr, 10) - DllStructGetPtr($stPreparedMidiHdr))) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiOutLongMsg + +;======================================================= +;Get the Capabilities of the MIDI Device +;Parameters - DeviceID +;Author : Eynstyne +;Library : Microsoft winmm.dll +;First Value - Manufacturer ID +;Second Value - Product ID +;Third Value - Driver Version +;Fourth Value - Driver Name +;Fifth Value - Type of Device +;Sixth Value - Voices +;Seventh Value - Notes +;eighth Value - Channel Mask +;Ninth Value - Capabilities +;======================================================= +Func _MidiOutGetDevCaps($nDeviceID = 0, $getmmsyserr = 0) + ; MIDIOUTCAPS: Mfr ID, Product ID, DriverVersion, ProductName, Technology, Voices, Notes, ChannelMask, FunctionalitySupport + Local $aRet, $stMIDIOutCaps = DllStructCreate("ushort;ushort;uint;wchar[32];ushort;ushort;ushort;ushort;uint") + $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutGetDevCapsW", "uint_ptr", $nDeviceID, "ptr", DllStructGetPtr($stMIDIOutCaps), "int", DllStructGetSize($stMIDIOutCaps)) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + If $getmmsyserr = 1 Then + Return $aRet[0] + ElseIf $getmmsyserr <> 1 Then + Dim $aRet[9] = [DllStructGetData($stMIDIOutCaps, 1), DllStructGetData($stMIDIOutCaps, 2), _ + DllStructGetData($stMIDIOutCaps, 3), DllStructGetData($stMIDIOutCaps, 4), DllStructGetData($stMIDIOutCaps, 5), _ + DllStructGetData($stMIDIOutCaps, 6), DllStructGetData($stMIDIOutCaps, 7), DllStructGetData($stMIDIOutCaps, 8), DllStructGetData($stMIDIOutCaps, 9)] + Return $aRet + EndIf +EndFunc ;==>_MidiOutGetDevCaps + +;======================================================= +;Get the Capabilities of the MIDI Device Input +;Parameters - DeviceID +;Author : Eynstyne +;Library : Microsoft winmm.dll +;First Value - Manufacturer ID +;Second Value - Product ID +;Third Value - Driver Version +;Fourth Value - Driver Name +;======================================================= +Func _MidiInGetDevCaps($nDeviceID = 0, $getmmsyserr = 0) + ; MIDIINCAPS: Mfr ID, Product ID, DriverVersion, ProductName, FunctionalitySupport + Local $aRet, $stMIDIInCaps = DllStructCreate("ushort;ushort;uint;wchar[32];dword") + $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInGetDevCapsW", "uint_ptr", $nDeviceID, "ptr", DllStructGetPtr($stMIDIInCaps), "int", DllStructGetSize($stMIDIInCaps)) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + If $getmmsyserr = 1 Then + Return $aRet[0] + ElseIf $getmmsyserr <> 1 Then + Dim $aRet[4] = [DllStructGetData($stMIDIInCaps, 1), DllStructGetData($stMIDIInCaps, 2), DllStructGetData($stMIDIInCaps, 3), DllStructGetData($stMIDIInCaps, 4)] + Return $aRet + EndIf +EndFunc ;==>_MidiInGetDevCaps + +;======================================================== +;Connect/Disconnect the MIDI Device to Application Source +; / Dest. +;Parameters - MidiHandleIn, MidiHandleOut +;Author: Eynstyne +;Library : Microsoft winmm.dll +;======================================================== +Func _MidiConnect($hMidiIn, $hMidiOut) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiConnect", "handle", $hMidiIn, "handle", $hMidiOut, "ptr", 0) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiConnect + +Func _MidiDisconnect($hMidiIn, $hMidiOut) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiDisconnect", "handle", $hMidiIn, "handle", $hMidiOut, "ptr", 0) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiDisconnect + +;======================================================== +;Prepare/Unprepare the MIDI IN header +;Parameters - MidiInHandle,Data,Bufferlength, +; BytesRecorded,User,Flags,Getmmsystemerror +; +; Returns: +; Success: Prepared Header STRUCTURE +; Failure: 0, @error set +; +;Author:Eynstyne +;Library:Microsoft winmm.dll +; +; Buffer format: +; MSDN: A series of MIDIEVENT Structures: +; struct MIDIEVENT { +; DWORD dwDeltaTime; +; DWORD dwStreamID; +; DWORD dwEvent; +; DWORD dwParms[]; +; } +;======================================================== +Func _MidiInPrepareHeader($hMidiIn, $binData, $nBufferLen, $bytesrecorded, $user, $nFlags) + ; MIDIHDR: BufferPtr,BufferLength,BytesRecorded,UserData,Flags,NextPtr,Reserved,Offset,Reserved[4] (+buffer) + Local $aRet, $stMIDIHdr = DllStructCreate("ptr;dword;dword;dword_ptr;dword;ptr;dword_ptr;dword;dword_ptr[4];byte[" & $nBufferLen + 1 & "]") + DllStructSetData($stMIDIHdr, 1, DllStructGetPtr($stMIDIHdr, 10)) + DllStructSetData($stMIDIHdr, 2, $nBufferLen) + DllStructSetData($stMIDIHdr, 3, $bytesrecorded) + DllStructSetData($stMIDIHdr, 4, $user) + DllStructSetData($stMIDIHdr, 5, $nFlags) +;~ DllStructSetData($struct, 6, $next) ; according to MSDN - do NOT use + DllStructSetData($stMIDIHdr, 7, 0) + DllStructSetData($stMIDIHdr, 10, $binData) + $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInPrepareHeader", "handle", $hMidiIn, "ptr", DllStructGetPtr($stMIDIHdr), "long", Number(DllStructGetPtr($stMIDIHdr, 10) - DllStructGetPtr($stMIDIHdr))) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $stMIDIHdr +EndFunc ;==>_MidiInPrepareHeader + +;======================================================= +; Func _MidiInUnprepareHeader ($hMidiIn, ByRef $stPreparedMidiHdr) +; +; parameters: handle to Midi In, structure (from _MidiInPrepareHeader) +;======================================================= + +Func _MidiInUnprepareHeader($hMidiIn, ByRef $stPreparedMidiHdr) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInUnprepareHeader", "handle", $hMidiIn, "ptr", DllStructGetPtr($stPreparedMidiHdr), "long", Number(DllStructGetPtr($stPreparedMidiHdr, 10) - DllStructGetPtr($stPreparedMidiHdr))) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiInUnprepareHeader + +;======================================================== +;Prepare/Unprepare the MIDI OUT header +;Parameters - MidiOutHandle,Data,Bufferlength, +; BytesRecorded,User,Flags +; +; Returns: +; Success: Prepared Header STRUCTURE +; Failure: 0, @error set +; +;Author:Eynstyne, Ascend4nt +;Library:Microsoft winmm.dll +; +; Buffer format: +; MSDN: A series of MIDIEVENT Structures: +; struct MIDIEVENT { +; DWORD dwDeltaTime; +; DWORD dwStreamID; +; DWORD dwEvent; +; DWORD dwParms[]; +; } +;======================================================== +Func _MidiOutPrepareHeader($hMidiOut, $binData, $nBufferLen, $bytesrecorded, $user, $nFlags) + ; MIDIHDR: BufferPtr,BufferLength,BytesRecorded,UserData,Flags,NextPtr,Reserved,Offset,Reserved[4] (+buffer) + Local $aRet, $stMIDIHdr = DllStructCreate("ptr;dword;dword;dword_ptr;dword;ptr;dword_ptr;dword;dword_ptr[4];byte[" & $nBufferLen + 1 & "]") + DllStructSetData($stMIDIHdr, 1, DllStructGetPtr($stMIDIHdr, 10)) + DllStructSetData($stMIDIHdr, 2, $nBufferLen) + DllStructSetData($stMIDIHdr, 3, $bytesrecorded) + DllStructSetData($stMIDIHdr, 4, $user) + DllStructSetData($stMIDIHdr, 5, $nFlags) +;~ DllStructSetData($struct, 6, $next) ; according to MSDN - do NOT use + DllStructSetData($stMIDIHdr, 7, 0) + DllStructSetData($stMIDIHdr, 10, $binData) + $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutPrepareHeader", "handle", $hMidiOut, "ptr", DllStructGetPtr($stMIDIHdr), "long", Number(DllStructGetPtr($stMIDIHdr, 10) - DllStructGetPtr($stMIDIHdr))) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $stMIDIHdr +EndFunc ;==>_MidiOutPrepareHeader + +;======================================================= +; Func _MidiOutUnprepareHeader ($hMidiOut, ByRef $stPreparedMidiHdr) +; +; parameters: handle to Midi Out, structure (from _MidiOutPrepareHeader) +;======================================================= + +Func _MidiOutUnprepareHeader($hMidiOut, ByRef $stPreparedMidiHdr) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutUnprepareHeader", "handle", $hMidiOut, "ptr", DllStructGetPtr($stPreparedMidiHdr), "long", Number(DllStructGetPtr($stPreparedMidiHdr, 10) - DllStructGetPtr($stPreparedMidiHdr))) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiOutUnprepareHeader + +;======================================================== +;Add buffer to Midi Header +; +; parameters: handle to Midi In, structure (from _MidiInPrepareHeader) +; +;Author:Eynstyne +;Library:Microsoft winmm.dll +;======================================================== + +Func _MidiInAddBuffer($hMidiIn, ByRef $stPreparedMidiHdr) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInAddBuffer", "handle", $hMidiIn, "ptr", DllStructGetPtr($stPreparedMidiHdr), "long", Number(DllStructGetPtr($stPreparedMidiHdr, 10) - DllStructGetPtr($stPreparedMidiHdr))) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiInAddBuffer + +;======================================================== +;Sends Internal MIDI Info to Input / Output device +;Parameters - MidiInHandle,message, parameter1, parameter2 +;Author:Eynstyne +;Library:Microsoft winmm.dll +;======================================================== +Func _MidiInMessage($hMidiIn, $nMsg, $dw1 = 0, $dw2 = 0) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiInMessage", "handle", $hMidiIn, "long", $nMsg, "dword_ptr", $dw1, "dword_ptr", $dw2) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiInMessage + +Func _MidiOutMessage($hMidiOut, $nMsg, $dw1 = 0, $dw2 = 0) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiOutMessage", "handle", $hMidiOut, "long", $nMsg, "dword_ptr", $dw1, "dword_ptr", $dw2) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiOutMessage + +;==================== +;Stream Functions +;==================== +Func _MidiStreamClose($hMidiStream) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiStreamClose", "handle", $hMidiStream) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiStreamClose + +Func _MidiStreamOpen($cMidi = 0, $pCallback = 0, $instance = 0, $fdwopen = 0, $getmmsyserr = 0) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiStreamOpen", "handle*", 0, "uint*", 0, "long", $cMidi, "dword_ptr", $pCallback, "dword_ptr", $instance, "long", $fdwopen) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + If $getmmsyserr = 1 Then + Return $aRet[0] + ElseIf $getmmsyserr <> 1 Then + Local $aOut[2] = [$aRet[1], $aRet[2]] + Return $aOut + EndIf +EndFunc ;==>_MidiStreamOpen + +;======================================================= +; Func _MidiStreamOut($hMidiStreamOut,ByRef $stPreparedMidiHdr) +; +; Notes: _MidiOutPrepareHeader and _MidiStreamRestart must be called before this +; +; parameters: handle to stream, structure (from _MidiOutPrepareHeader) +;======================================================= + +Func _MidiStreamOut($hMidiStreamOut, ByRef $stPreparedMidiHdr) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiStreamOut", "handle", $hMidiStreamOut, "ptr", DllStructGetPtr($stPreparedMidiHdr), "uint", Number(DllStructGetPtr($stPreparedMidiHdr, 10) - DllStructGetPtr($stPreparedMidiHdr))) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiStreamOut + +Func _MidiStreamPause($hMidiStream) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiStreamPause", "handle", $hMidiStream) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiStreamPause + +Func _MidiStreamPos($hMidiStream, $getmmsyserr = 0) + ; MMTIME: Type, Union (4 dword's max, dependent on Type) + Local $aRet, $stMMTime = DllStructCreate("uint;dword;dword;dword;dword") + $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiStreamPosition", "handle", $hMidiStream, "ptr", DllStructGetPtr($stMMTime), "long", DllStructGetSize($stMMTime)) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + If $getmmsyserr = 1 Then + Return $aRet[0] + ElseIf $getmmsyserr <> 1 Then + Dim $aRet[2] = [DllStructGetData($stMMTime, 1), DllStructGetData($stMMTime, 2)] + Return $aRet + EndIf +EndFunc ;==>_MidiStreamPos + +Func _MidiStreamRestart($hMidiStream) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiStreamRestart", "handle", $hMidiStream) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiStreamRestart + +Func _MidiStreamStop($hMidiStream) + Local $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiStreamStop", "handle", $hMidiStream) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + Return $aRet[0] +EndFunc ;==>_MidiStreamStop + +Func _MidiStreamProperty($hMidiStream, $property = 0, $getmmsyserr = 0) + Local $aRet, $stPropertyData = DllStructCreate("byte") ; should this be an array of bytes? If not, put in DLLCall as "byte*" and retrieve with $aRet[2] + $aRet = DllCall($g_MIDI_hWinMMDLL, "long", "midiStreamProperty", "handle", $hMidiStream, "ptr", DllStructGetPtr($stPropertyData), "long", $property) + If @error Then Return SetError(@error, 0, 0) + If $aRet[0] Then Return SetError(-1, $aRet[0], 0) + If $getmmsyserr = 1 Then + Return $aRet[0] + ElseIf $getmmsyserr <> 1 Then + Return DllStructGetData($stPropertyData, 1) + EndIf +EndFunc ;==>_MidiStreamProperty diff --git a/Installer/vi_files/UDFs/NativeWifi.au3 b/Installer/vi_files/UDFs/NativeWifi.au3 new file mode 100644 index 00000000..e9c2071c --- /dev/null +++ b/Installer/vi_files/UDFs/NativeWifi.au3 @@ -0,0 +1,5618 @@ +#CS +Native Wifi Functions - Version 4.1.3 - 2012-04-18 +by MattyD(mattduncan87) +http://sourceforge.net/projects/nativewifi/ +Artistic License 2.0 + +Edited 2012-08-26 by acalcutt1 - Added International 2.4Ghz channels and 5Ghz channels to _Wlan_GetNetworkInfo() +Edited 2012-11-11 by acalcutt1 - Modified _Wlan_EnumToString DOT11_AUTH_ALGORITHM and DOT11_CIPHER_ALGORITHM to match netsh output names. +Edited 2014-07-15 by acalcutt - Merge branch 'patch-1' of https://github.com/EionRobb/Vistumbler into beta. Fix to allow 802.11ac support. + +#CE +;--------------Enumerations------------- + +;DOT11_AUTH_ALGORITHM +Global Enum $DOT11_AUTH_ALGO_80211_OPEN = 1, $DOT11_AUTH_ALGO_80211_SHARED_KEY, $DOT11_AUTH_ALGO_WPA, $DOT11_AUTH_ALGO_WPA_PSK, _ + $DOT11_AUTH_ALGO_WPA_NONE, $DOT11_AUTH_ALGO_RSNA, $DOT11_AUTH_ALGO_RSNA_PSK, $DOT11_AUTH_ALGO_IHV_START = 2147483648, $DOT11_AUTH_ALGO_IHV_END = 4294967295 + +;DOT11_BSS_TYPE +Global Enum $DOT11_BSS_TYPE_INFRASTRUCTURE = 1, $DOT11_BSS_TYPE_INDEPENDENT, $DOT11_BSS_TYPE_ANY + +;DOT11_CIPHER_ALGORITHM +Global Enum $DOT11_CIPHER_ALGO_NONE, $DOT11_CIPHER_ALGO_WEP40, $DOT11_CIPHER_ALGO_TKIP, $DOT11_CIPHER_ALGO_CCMP = 0x04, $DOT11_CIPHER_ALGO_WEP104, _ + $DOT11_CIPHER_ALGO_WPA_USE_GROUP = 0x100, $DOT11_CIPHER_ALGO_RSN_USE_GROUP = 0x100, $DOT11_CIPHER_ALGO_WEP, $DOT11_CIPHER_ALGO_IHV_START = 2147483648, _ + $DOT11_CIPHER_ALGO_IHV_END = 4294967295 + +;DOT11_PHY_TYPE +Global Enum $DOT11_PHY_TYPE_UNKNOWN, $DOT11_PHY_TYPE_ANY = 0, $DOT11_PHY_TYPE_FHSS, $DOT11_PHY_TYPE_DSSS, $DOT11_PHY_TYPE_IRBASEBAND, $DOT11_PHY_TYPE_OFDM, _ + $DOT11_PHY_TYPE_HRDSSS, $DOT11_PHY_TYPE_ERP, $DOT11_PHY_TYPE_HT, $DOT11_PHY_TYPE_VHT, $DOT11_PHY_TYPE_IHV_START = 2147483648, $DOT11_PHY_TYPE_IHV_END = 4294967295 + +;DOT11_RADIO_STATE +Global Enum $DOT11_RADIO_STATE_UNKNOWN, $DOT11_RADIO_STATE_ON, $DOT11_RADIO_STATE_OFF + +;ONEX_AUTH_IDENTITY +Global Enum $OneXAuthIdentityNone, $OneXAuthIdentityMachine, $OneXAuthIdentityUser, $OneXAuthIdentityExplicitUser, $OneXAuthIdentityGuest, _ + $OneXAuthIdentityInvalid + +;ONEX_AUTH_RESTART_REASON +Global Enum $OneXRestartReasonPeerInitiated, $OneXRestartReasonMsmInitiated, $OneXRestartReasonOneXHeldStateTimeout, $OneXRestartReasonOneXAuthTimeout, _ + $OneXRestartReasonOneXConfigurationChanged, $OneXRestartReasonOneXUserChanged, $OneXRestartReasonQuarantineStateChanged, $OneXRestartReasonAltCredsTrial, _ + $OneXRestartReasonInvalid + +;ONEX_AUTH_STATUS +Global Enum $OneXAuthNotStarted, $OneXAuthInProgress, $OneXAuthNoAuthenticatorFound, $OneXAuthSuccess, $OneXAuthFailure, $OneXAuthInvalid + +;ONEX_EAP_METHOD_BACKEND_SUPPORT +Global Enum $OneXEapMethodBackendSupportUnknown, $OneXEapMethodBackendSupported, $OneXEapMethodBackendUnsupported + +;ONEX_NOTIFICATION_TYPE +Global Enum $OneXPublicNotificationBase, $OneXNotificationTypeResultUpdate, $OneXNotificationTypeAuthRestarted, $OneXNotificationTypeEventInvalid, _ + $OneXNumNotifications = 3 + +;ONEX_REASON_CODE +Global Enum $ONEX_REASON_CODE_SUCCESS, $ONEX_REASON_START = 0x5000, $ONEX_UNABLE_TO_IDENTIFY_USER, $ONEX_IDENTITY_NOT_FOUND, $ONEX_UI_DISABLED, _ + $ONEX_UI_FAILURE, $ONEX_EAP_FAILURE_RECEIVED, $ONEX_AUTHENTICATOR_NO_LONGER_PRESENT, $ONEX_NO_RESPONSE_TO_IDENTITY, $ONEX_PROFILE_VERSION_NOT_SUPPORTED, _ + $ONEX_PROFILE_INVALID_LENGTH, $ONEX_PROFILE_DISALLOWED_EAP_TYPE, $ONEX_PROFILE_INVALID_EAP_TYPE_OR_FLAG, $ONEX_PROFILE_INVALID_ONEX_FLAGS, _ + $ONEX_PROFILE_INVALID_TIMER_VALUE, $ONEX_PROFILE_INVALID_SUPPLICANT_MODE, $ONEX_PROFILE_INVALID_AUTH_MODE, $ONEX_PROFILE_INVALID_EAP_CONNECTION_PROPERTIES, _ + $ONEX_UI_CANCELLED, $ONEX_PROFILE_INVALID_EXPLICIT_CREDENTIALS, $ONEX_PROFILE_EXPIRED_EXPLICIT_CREDENTIALS, $ONEX_UI_NOT_PERMITTED + +;WL_DISPLAY_PAGES +Global Enum $WLConnectionPage, $WLSecurityPage, $WLAdvPage + +;WLAN_ADHOC_NETWORK_STATE +Global Enum $WLAN_ADHOC_NETWORK_STATE_FORMED, $WLAN_ADHOC_NETWORK_STATE_CONNECTED + +;WLAN_AUTOCONF_OPCODE +Global Enum $WLAN_AUTOCONF_OPCODE_START, $WLAN_AUTOCONF_OPCODE_SHOW_DENIED_NETWORKS, $WLAN_AUTOCONF_OPCODE_POWER_SETTING, _ + $WLAN_AUTOCONF_OPCODE_ONLY_USE_GP_PROFILES_FOR_ALLOWED_NETWORKS, $WLAN_AUTOCONF_OPCODE_ALLOW_EXPLICIT_CREDS, $WLAN_AUTOCONF_OPCODE_BLOCK_PERIOD, _ + $WLAN_AUTOCONF_OPCODE_ALLOW_VIRTUAL_STATION_EXTENSIBILITY, $WLAN_AUTOCONF_OPCODE_END + +;WLAN_CONNECTION_MODE +Global Enum $WLAN_CONNECTION_MODE_PROFILE, $WLAN_CONNECTION_MODE_TEMPORARY_PROFILE, $WLAN_CONNECTION_MODE_DISCOVERY_SECURE, _ + $WLAN_CONNECTION_MODE_DISCOVERY_UNSECURE, $WLAN_CONNECTION_MODE_AUTO, $WLAN_CONNECTION_MODE_INVALID + +;WLAN_FILTER_LIST_TYPE +Global Enum $WLAN_FILTER_LIST_TYPE_GP_PERMIT, $WLAN_FILTER_LIST_TYPE_GP_DENY, $WLAN_FILTER_LIST_TYPE_USER_PERMIT, $WLAN_FILTER_LIST_TYPE_USER_DENY + +;WLAN_HOSTED_NETWORK_NOTIFICATION_CODE +Global Enum $WLAN_HOSTED_NETWORK_STATE_CHANGE = 0X00001000, $WLAN_HOSTED_NETWORK_PEER_STATE_CHANGE, $WLAN_HOSTED_NETWORK_RADIO_STATE_CHANGE + +;WLAN_HOSTED_NETWORK_OPCODE +Global Enum $WLAN_HOSTED_NETWORK_OPCODE_CONNECTION_SETTINGS, $WLAN_HOSTED_NETWORK_OPCODE_SECURITY_SETTINGS, $WLAN_HOSTED_NETWORK_OPCODE_STATION_PROFILE, _ + $WLAN_HOSTED_NETWORK_OPCODE_ENABLE + +;WLAN_HOSTED_NETWORK_PEER_AUTH_STATE +Global Enum $WLAN_HOSTED_NETWORK_PEER_STATE_INVALID, $WLAN_HOSTED_NETWORK_PEER_STATE_AUTHENTICATED + +;WLAN_HOSTED_NETWORK_REASON +Global Enum $WLAN_HOSTED_NETWORK_REASON_SUCCESS, $WLAN_HOSTED_NETWORK_REASON_UNSPECIFIED, $WLAN_HOSTED_NETWORK_REASON_BAD_PARAMETERS, _ + $WLAN_HOSTED_NETWORK_REASON_SERVICE_SHUTTING_DOWN, $WLAN_HOSTED_NETWORK_REASON_INSUFFICIENT_RESOURCES, $WLAN_HOSTED_NETWORK_REASON_ELEVATION_REQUIRED, _ + $WLAN_HOSTED_NETWORK_REASON_READ_ONLY, $WLAN_HOSTED_NETWORK_REASON_PERSISTENCE_FAILED, $WLAN_HOSTED_NETWORK_REASON_CRYPT_ERROR, _ + $WLAN_HOSTED_NETWORK_REASON_IMPERSONATION, $WLAN_HOSTED_NETWORK_REASON_STOP_BEFORE_START, $WLAN_HOSTED_NETWORK_REASON_INTERFACE_AVAILABLE, _ + $WLAN_HOSTED_NETWORK_REASON_INTERFACE_UNAVAILABLE, $WLAN_HOSTED_NETWORK_REASON_MINIPORT_STOPPED, $WLAN_HOSTED_NETWORK_REASON_MINIPORT_STARTED, _ + $WLAN_HOSTED_NETWORK_REASON_INCOMPATIBLE_CONNECTION_STARTED, $WLAN_HOSTED_NETWORK_REASON_INCOMPATIBLE_CONNECTION_STOPPED, _ + $WLAN_HOSTED_NETWORK_REASON_USER_ACTION, $WLAN_HOSTED_NETWORK_REASON_CLIENT_ABORT, $WLAN_HOSTED_NETWORK_REASON_AP_START_FAILED, _ + $WLAN_HOSTED_NETWORK_REASON_PEER_ARRIVED, $WLAN_HOSTED_NETWORK_REASON_PEER_DEPARTED, $WLAN_HOSTED_NETWORK_REASON_PEER_TIMEOUT, _ + $WLAN_HOSTED_NETWORK_REASON_GP_DENIED, $WLAN_HOSTED_NETWORK_REASON_SERVICE_UNAVAILABLE, $WLAN_HOSTED_NETWORK_REASON_DEVICE_CHANGE, _ + $WLAN_HOSTED_NETWORK_REASON_PROPERTIES_CHANGE, $WLAN_HOSTED_NETWORK_REASON_VIRTUAL_STATION_BLOCKING_USE, _ + $WLAN_HOSTED_NETWORK_REASON_SERVICE_AVAILABLE_ON_VIRTUAL_STATION + +;WLAN_HOSTED_NETWORK_STATE +Global Enum $WLAN_HOSTED_NETWORK_UNAVAILABLE, $WLAN_HOSTED_NETWORK_IDLE, $WLAN_HOSTED_NETWORK_ACTIVE + +;WLAN_IHV_CONTROL_TYPE +Global Enum $WLAN_IHV_CONTROL_TYPE_SERVICE, $WLAN_IHV_CONTROL_TYPE_DRIVER + +;WLAN_INTERFACE_STATE +Global Enum $WLAN_INTERFACE_STATE_NOT_READY, $WLAN_INTERFACE_STATE_CONNECTED, $WLAN_INTERFACE_STATE_AD_HOC_NETWORK_FORMED, _ + $WLAN_INTERFACE_STATE_DISCONNECTING, $WLAN_INTERFACE_STATE_DISCONNECTED, $WLAN_INTERFACE_STATE_ASSOCIATING, $WLAN_INTERFACE_STATE_DISCOVERING, _ + $WLAN_INTERFACE_STATE_AUTHENTICATING + +;WLAN_INTERFACE_TYPE +Global Enum $WLAN_INTERFACE_TYPE_EMULATED_802_11, $WLAN_INTERFACE_TYPE_NATIVE_802_11, $WLAN_INTERFACE_TYPE_INVALID + +;WLAN_INTF_OPCODE +Global Enum $WLAN_INTF_OPCODE_AUTOCONF_START, $WLAN_INTF_OPCODE_AUTOCONF_ENABLED, $WLAN_INTF_OPCODE_BACKGROUND_SCAN_ENABLED, _ + $WLAN_INTF_OPCODE_MEDIA_STREAMING_MODE, $WLAN_INTF_OPCODE_RADIO_STATE, $WLAN_INTF_OPCODE_BSS_TYPE, $WLAN_INTF_OPCODE_INTERFACE_STATE, _ + $WLAN_INTF_OPCODE_CURRENT_CONNECTION, $WLAN_INTF_OPCODE_CHANNEL_NUMBER, $WLAN_INTF_OPCODE_SUPPORTED_INFRASTRUCTURE_AUTH_CIPER_PAIRS, _ + $WLAN_INTF_OPCODE_SUPPORTED_ADHOC_AUTH_CIPER_PAIRS, $WLAN_INTF_OPCODE_SUPPORTED_COUNTRY_OR_REGION_STRING_LIST, $WLAN_INTF_OPCODE_CURRENT_OPERATION_MODE, _ + $WLAN_INTF_OPCODE_SUPPORTED_SAFE_MODE, $WLAN_INTF_OPCODE_CERTIFIED_SAFE_MODE, $WLAN_INTF_OPCODE_HOSTED_NETWORK_CAPABLE, _ + $WLAN_INTF_OPCODE_AUTOCONF_END = 0x0FFFFFFF, $WLAN_INTF_OPCODE_MSM_START = 0x10000100, $WLAN_INTF_OPCODE_STATISTICS, $WLAN_INTF_OPCODE_RSSI, _ + $WLAN_INTF_OPCODE_MSM_END = 0x1FFFFFFF, $WLAN_INTF_OPCODE_SECURITY_START = 0x20010000, $WLAN_INTF_OPCODE_SECURITY_END = 0x2FFFFFFF, _ + $WLAN_INTF_OPCODE_IHV_START = 0x30000000, $WLAN_INTF_OPCODE_IHV_END = 0x3FFFFFFF + +;WLAN_NOTIFICATION_ACM +Global Enum $WLAN_NOTIFICATION_ACM_START, $WLAN_NOTIFICATION_ACM_AUTOCONF_ENABLED, $WLAN_NOTIFICATION_ACM_AUTOCONF_DISABLED, _ + $WLAN_NOTIFICATION_ACM_BACKGROUND_SCAN_ENABLED, $WLAN_NOTIFICATION_ACM_BACKGROUND_SCAN_DISABLED, $WLAN_NOTIFICATION_ACM_BSS_TYPE_CHANGE, _ + $WLAN_NOTIFICATION_ACM_POWER_SETTING_CHANGE, $WLAN_NOTIFICATION_ACM_SCAN_COMPLETE, $WLAN_NOTIFICATION_ACM_SCAN_FAIL, _ + $WLAN_NOTIFICATION_ACM_CONNECTION_START, $WLAN_NOTIFICATION_ACM_CONNECTION_COMPLETE, $WLAN_NOTIFICATION_ACM_CONNECTION_ATTEMPT_FAIL, _ + $WLAN_NOTIFICATION_ACM_FILTER_LIST_CHANGE, $WLAN_NOTIFICATION_ACM_INTERFACE_ARRIVAL, $WLAN_NOTIFICATION_ACM_INTERFACE_REMOVAL, _ + $WLAN_NOTIFICATION_ACM_PROFILE_CHANGE, $WLAN_NOTIFICATION_ACM_PROFILE_NAME_CHANGE, $WLAN_NOTIFICATION_ACM_PROFILES_EXHAUSTED, _ + $WLAN_NOTIFICATION_ACM_NETWORK_NOT_AVAILABLE, $WLAN_NOTIFICATION_ACM_NETWORK_AVAILABLE, $WLAN_NOTIFICATION_ACM_DISCONNECTING, _ + $WLAN_NOTIFICATION_ACM_DISCONNECTED, $WLAN_NOTIFICATION_ACM_ADHOC_NETWORK_STATE_CHANGE, $WLAN_NOTIFICATION_ACM_END + +;WLAN_NOTIFICATION_MSM +Global Enum $WLAN_NOTIFICATION_MSM_START, $WLAN_NOTIFICATION_MSM_ASSOCIATING, $WLAN_NOTIFICATION_MSM_ASSOCIATED, $WLAN_NOTIFICATION_MSM_AUTHENTICATING, _ + $WLAN_NOTIFICATION_MSM_CONNECTED, $WLAN_NOTIFICATION_MSM_ROAMING_START, $WLAN_NOTIFICATION_MSM_ROAMING_END, $WLAN_NOTIFICATION_MSM_RADIO_STATE_CHANGE, _ + $WLAN_NOTIFICATION_MSM_SIGNAL_QUALITY_CHANGE, $WLAN_NOTIFICATION_MSM_DISASSOCIATING, $WLAN_NOTIFICATION_MSM_DISCONNECTED, $WLAN_NOTIFICATION_MSM_PEER_JOIN, _ + $WLAN_NOTIFICATION_MSM_PEER_LEAVE, $WLAN_NOTIFICATION_MSM_ADAPTER_REMOVAL, $WLAN_NOTIFICATION_MSM_ADAPTER_OPERATION_MODE_CHANGE, $WLAN_NOTIFICATION_MSM_END + +;WLAN_OPCODE_VALUE_TYPE +Global Enum $WLAN_OPCODE_VALUE_TYPE_QUERY_ONLY, $WLAN_OPCODE_VALUE_TYPE_SET_BY_GROUP_POLICY, $WLAN_OPCODE_VALUE_TYPE_SET_BY_USER, _ + $WLAN_OPCODE_VALUE_TYPE_INVALID + +;WLAN_POWER_SETTING +Global Enum $WLAN_POWER_SETTING_NO_SAVING, $WLAN_POWER_SETTING_LOW_SAVING, $WLAN_POWER_SETTING_MEDIUM_SAVING, $WLAN_POWER_SETTING_MAXIMUM_SAVING, _ + $WLAN_POWER_SETTING_INVALID + +;WLAN_SECURABLE_OBJECT +Global Enum $WLAN_SECURE_PERMIT_LIST, $WLAN_SECURE_DENY_LIST, $WLAN_SECURE_AC_ENABLED, $WLAN_SECURE_BC_SCAN_ENABLED, $WLAN_SECURE_BSS_TYPE, _ + $WLAN_SECURE_SHOW_DENIED, $WLAN_SECURE_INTERFACE_PROPERTIES, $WLAN_SECURE_IHV_CONTROL, $WLAN_SECURE_ALL_USER_PROFILES_ORDER, _ + $WLAN_SECURE_ADD_NEW_ALL_USER_PROFILES, $WLAN_SECURE_ADD_NEW_PER_USER_PROFILES, $WLAN_SECURE_MEDIA_STREAMING_MODE_ENABLED, _ + $WLAN_SECURE_CURRENT_OPERATION_MODE, $WLAN_SECURE_GET_PLAINTEXT_KEY, $WLAN_SECURE_HOSTED_NETWORK_ELEVATED_ACCESS + +;--------------Flags------------- +;profile flags +Global Const $WLAN_PROFILE_GROUP_POLICY = 1, $WLAN_PROFILE_USER = 2, $WLAN_PROFILE_GET_PLAINTEXT_KEY = 4 , $WLAN_PROFILE_CONNECTION_MODE_SET_BY_CLIENT = 0x00010000, _ + $WLAN_PROFILE_CONNECTION_MODE_AUTO = 0x00020000 + +;EAPHost data storage flags +Global Const $WLAN_SET_EAPHOST_DATA_ALL_USERS = 1 + +;available network flags +Global Const $WLAN_AVAILABLE_NETWORK_CONNECTED = 1, $WLAN_AVAILABLE_NETWORK_HAS_PROFILE = 2, $WLAN_AVAILABLE_NETWORK_CONSOLE_USER_PROFILE = 4 + +;flags that control the list returned by WlanGetAvailableNetworkList +Global Const $WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_ADHOC_PROFILES = 1, $WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES = 2 + +;Wlan connection flags used in WLAN_CONNECTION_PARAMETERS +Global Const $WLAN_CONNECTION_HIDDEN_NETWORK = 1, $WLAN_CONNECTION_ADHOC_JOIN_ONLY = 2, $WLAN_CONNECTION_IGNORE_PRIVACY_BIT = 4, $WLAN_CONNECTION_EAPOL_PASSTHROUGH = 8 + +;flags for connection notifications +Global Const $WLAN_CONNECTION_NOTIFICATION_ADHOC_NETWORK_FORMED = 1, $WLAN_CONNECTION_NOTIFICATION_CONSOLE_USER_PROFILE = 4 + +;--------------Other------------- +;types of notification +Global Const $WLAN_NOTIFICATION_SOURCE_NONE = 0, $WLAN_NOTIFICATION_SOURCE_ALL = 0XFFFF, $WLAN_NOTIFICATION_SOURCE_ACM = 0x08, $WLAN_NOTIFICATION_SOURCE_MSM = 0X10, _ + $WLAN_NOTIFICATION_SOURCE_SECURITY = 0X20, $WLAN_NOTIFICATION_SOURCE_IHV = 0X40, $WLAN_NOTIFICATION_SOURCE_HNWK = 0X80, $WLAN_NOTIFICATION_SOURCE_ONEX = 0X04 + +;access masks +Global Const $WLAN_READ_ACCESS = 0x00020001, $WLAN_EXECUTE_ACCESS = 0x00020021, $WLAN_WRITE_ACCESS = 0x00070023 + +;dot11 Operation modes +Global Const $DOT11_OPERATION_MODE_UNKNOWN = 0, $DOT11_OPERATION_MODE_STATION = 1, $DOT11_OPERATION_MODE_AP = 2, $DOT11_OPERATION_MODE_EXTENSIBLE_STATION = 4, _ + $DOT11_OPERATION_MODE_EXTENSIBLE_AP = 8, $DOT11_OPERATION_MODE_NETWORK_MONITOR = 2147483648 + +;for the UI related functions +Global Const $WLAN_UI_API_VERSION = 1, $WLAN_UI_API_INITIAL_VERSION = 1 + +Func _Wlan_EnumToString($sCategory, $iEnumeration) + Switch $sCategory + Case "DOT11_AUTH_ALGORITHM" + Switch $iEnumeration + Case $DOT11_AUTH_ALGO_80211_OPEN + Return "Open" + Case $DOT11_AUTH_ALGO_80211_SHARED_KEY + Return "Shared Key" + Case $DOT11_AUTH_ALGO_WPA + Return "WPA-Enterprise" + Case $DOT11_AUTH_ALGO_WPA_PSK + Return "WPA-Personal" + Case $DOT11_AUTH_ALGO_WPA_NONE + Return "WPA-None" + Case $DOT11_AUTH_ALGO_RSNA + Return "WPA2-Enterprise" + Case $DOT11_AUTH_ALGO_RSNA_PSK + Return "WPA2-Personal" + Case $DOT11_AUTH_ALGO_IHV_START To $DOT11_AUTH_ALGO_IHV_END + Return "IHV Auth (0x" & Hex($iEnumeration) & ")" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "DOT11_BSS_TYPE" + Switch $iEnumeration + Case $DOT11_BSS_TYPE_INFRASTRUCTURE + Return "Infrastructure" + Case $DOT11_BSS_TYPE_INDEPENDENT + Return "Ad Hoc" + Case $DOT11_BSS_TYPE_ANY + Return "Any BSS Type" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "DOT11_CIPHER_ALGORITHM" + Switch $iEnumeration + Case $DOT11_CIPHER_ALGO_NONE + Return "None" + Case $DOT11_CIPHER_ALGO_WEP40 + Return "WEP-40" + Case $DOT11_CIPHER_ALGO_TKIP + Return "TKIP" + Case $DOT11_CIPHER_ALGO_CCMP + Return "CCMP" + Case $DOT11_CIPHER_ALGO_WEP104 + Return "WEP-104" + Case $DOT11_CIPHER_ALGO_WPA_USE_GROUP + Return "WPA Use Group" + Case $DOT11_CIPHER_ALGO_RSN_USE_GROUP + Return "WPA2 Use Group" + Case $DOT11_CIPHER_ALGO_WEP + Return "WEP" + Case $DOT11_CIPHER_ALGO_IHV_START To $DOT11_CIPHER_ALGO_IHV_END + Return "IHV Cipher (0x" & Hex($iEnumeration) & ")" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "DOT11_PHY_TYPE" + Switch $iEnumeration + Case $DOT11_PHY_TYPE_UNKNOWN + Return "Unknown/Any Phy Type" + Case $DOT11_PHY_TYPE_FHSS + Return "Bluetooth" + Case $DOT11_PHY_TYPE_DSSS + Return "b*" + Case $DOT11_PHY_TYPE_IRBASEBAND + Return "legacy" + Case $DOT11_PHY_TYPE_OFDM + Return "a" + Case $DOT11_PHY_TYPE_HRDSSS + Return "b" + Case $DOT11_PHY_TYPE_ERP + Return "g" + Case $DOT11_PHY_TYPE_HT + Return "n" + Case $DOT11_PHY_TYPE_VHT + Return "ac" + Case $DOT11_PHY_TYPE_IHV_START To $DOT11_PHY_TYPE_IHV_END + Return "IHV Phy Type (0x" & Hex($iEnumeration) & ")" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "DOT11_RADIO_STATE" + Switch $iEnumeration + Case $DOT11_RADIO_STATE_UNKNOWN + Return "Unknown" + Case $DOT11_RADIO_STATE_ON + Return "On" + Case $DOT11_RADIO_STATE_OFF + Return "Off" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "ONEX_AUTH_IDENTITY" + Switch $iEnumeration + Case $OneXAuthIdentityNone + Return "No Identity" + Case $OneXAuthIdentityMachine + Return "Local Machine Account" + Case $OneXAuthIdentityUser + Return "Logged-on User" + Case $OneXAuthIdentityExplicitUser + Return "Profile User - Explicit" + Case $OneXAuthIdentityGuest + Return "Profile User - Guest" + Case $OneXAuthIdentityInvalid + Return "Identity Not Valid" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "ONEX_AUTH_RESTART_REASON" + Switch $iEnumeration + Case $OneXRestartReasonPeerInitiated + Return "The EAPHost component (the peer) requested the 802.1x module to restart 802.1X authentication." + Case $OneXRestartReasonMsmInitiated + Return "The Media Specific Module (MSM) initiated the 802.1X authentication restart." + Case $OneXRestartReasonOneXHeldStateTimeout + Return "The 802.1X authentication restart was the result of a heldWhile timeout of the 802.1X supplicant state machine." + Case $OneXRestartReasonOneXAuthTimeout + Return "The 802.1X authentication restart was the result of an authWhile timeout of the 802.1X supplicant port access entity." + Case $OneXRestartReasonOneXConfigurationChanged + Return "The 802.1X authentication restart was the result of a configuration change to the current profile." + Case $OneXRestartReasonOneXUserChanged + Return "The 802.1X authentication restart was the result of a change of user." + Case $OneXRestartReasonQuarantineStateChanged + Return "The 802.1X authentication restart was the result of receiving a notification from the EAP quarantine enforcement client (QEC) due to a network health change." + Case $OneXRestartReasonAltCredsTrial + Return "The 802.1X authentication restart was caused by a new authentication attempt with alternate user credentials." + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "ONEX_AUTH_STATUS" + Switch $iEnumeration + Case $OneXAuthNotStarted + Return "Not Started" + Case $OneXAuthInProgress + Return "In Progress" + Case $OneXAuthNoAuthenticatorFound + Return "No Authenticator Found" + Case $OneXAuthSuccess + Return "Successful" + Case $OneXAuthFailure + Return "Failed" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "ONEX_EAP_METHOD_BACKEND_SUPPORT" + Switch $iEnumeration + Case $OneXEapMethodBackendSupportUnknown + Return "Backend Support Unknown" + Case $OneXEapMethodBackendSupported + Return "Backend Supported" + Case $OneXEapMethodBackendUnsupported + Return "Backend Unsupported" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "ONEX_REASON_CODE" + Switch $iEnumeration + Case $ONEX_REASON_CODE_SUCCESS + Return "The 802.1X authentication was a success." + Case $ONEX_UNABLE_TO_IDENTIFY_USER + Return "The 802.1X module was unable to identify a set of credentials to be used." + Case $ONEX_IDENTITY_NOT_FOUND + Return "The EAP module was unable to acquire an identity for the user." + Case $ONEX_UI_DISABLED + Return "To proceed with 802.1X authentication, the system needs to request user input, but the user interface is disabled." + Case $ONEX_UI_FAILURE + Return "The 802.1X authentication module was unable to return the requested user input." + Case $ONEX_EAP_FAILURE_RECEIVED + Return "The EAP module returned an error code." + Case $ONEX_AUTHENTICATOR_NO_LONGER_PRESENT + Return "The peer with which the 802.1X module was negotiating is no longer present or is not responding." + Case $ONEX_NO_RESPONSE_TO_IDENTITY + Return "No response was received to an EAP identity response packet." + Case $ONEX_PROFILE_VERSION_NOT_SUPPORTED + Return "The 802.1X module does not support this version of the profile." + Case $ONEX_PROFILE_INVALID_LENGTH + Return "The length member specified in the 802.1X profile is invalid." + Case $ONEX_PROFILE_DISALLOWED_EAP_TYPE + Return "The EAP type specified in the 802.1X profile is not allowed for this media." + Case $ONEX_PROFILE_INVALID_EAP_TYPE_OR_FLAG + Return "The EAP type or EAP flags specified in the 802.1X profile are not valid." + Case $ONEX_PROFILE_INVALID_ONEX_FLAGS + Return "The 802.1X flags specified in the 802.1X profile are not valid." + Case $ONEX_PROFILE_INVALID_TIMER_VALUE + Return "One or more timer values specified in the 802.1X profile is out of its valid range." + Case $ONEX_PROFILE_INVALID_SUPPLICANT_MODE + Return "The supplicant mode specified in the 802.1X profile is not valid." + Case $ONEX_PROFILE_INVALID_AUTH_MODE + Return "The authentication mode specified in the 802.1X profile is not valid." + Case $ONEX_PROFILE_INVALID_EAP_CONNECTION_PROPERTIES + Return "The EAP connection properties specified in the 802.1X profile are not valid. " + Case $ONEX_UI_CANCELLED + Return "User input was canceled." + Case $ONEX_PROFILE_INVALID_EXPLICIT_CREDENTIALS + Return "The saved user credentials are not valid." + Case $ONEX_PROFILE_EXPIRED_EXPLICIT_CREDENTIALS + Return "The saved user credentials have expired." + Case $ONEX_UI_NOT_PERMITTED + Return "User interface is not permitted." + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "WLAN_ADHOC_NETWORK_STATE" + Switch $iEnumeration + Case $WLAN_ADHOC_NETWORK_STATE_FORMED + Return "The ad hoc network has been formed, but no client or host is connected to the network." + Case $WLAN_ADHOC_NETWORK_STATE_CONNECTED + Return "A client or host is connected to the ad hoc network." + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "WLAN_CONNECTION_MODE" + Switch $iEnumeration + Case $WLAN_CONNECTION_MODE_PROFILE + Return "Profile" + Case $WLAN_CONNECTION_MODE_TEMPORARY_PROFILE + Return "Temporary Profile" + Case $WLAN_CONNECTION_MODE_DISCOVERY_SECURE + Return "Secure Discovery" + Case $WLAN_CONNECTION_MODE_DISCOVERY_UNSECURE + Return "Unsecure Discovery" + Case $WLAN_CONNECTION_MODE_AUTO + Return "Persistent Profile" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "WLAN_HOSTED_NETWORK_PEER_AUTH_STATE" + Switch $iEnumeration + Case $WLAN_HOSTED_NETWORK_PEER_STATE_INVALID + Return "Invalid Peer State" + Case $WLAN_HOSTED_NETWORK_PEER_STATE_AUTHENTICATED + Return "Authenticated" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "WLAN_HOSTED_NETWORK_REASON" + Switch $iEnumeration + Case $WLAN_HOSTED_NETWORK_REASON_SUCCESS + Return "The operation was successful." + Case $WLAN_HOSTED_NETWORK_REASON_UNSPECIFIED + Return "Unknown Error." + Case $WLAN_HOSTED_NETWORK_REASON_BAD_PARAMETERS + Return "Bad parameters." + Case $WLAN_HOSTED_NETWORK_REASON_SERVICE_SHUTTING_DOWN + Return "Service is shutting down." + Case $WLAN_HOSTED_NETWORK_REASON_INSUFFICIENT_RESOURCES + Return "Service is out of resources." + Case $WLAN_HOSTED_NETWORK_REASON_ELEVATION_REQUIRED + Return "This operation requires elevation." + Case $WLAN_HOSTED_NETWORK_REASON_READ_ONLY + Return "An attempt was made to write read-only data." + Case $WLAN_HOSTED_NETWORK_REASON_PERSISTENCE_FAILED + Return "Data persistence failed." + Case $WLAN_HOSTED_NETWORK_REASON_CRYPT_ERROR + Return "A cryptographic error occurred." + Case $WLAN_HOSTED_NETWORK_REASON_IMPERSONATION + Return "User impersonation failed." + Case $WLAN_HOSTED_NETWORK_REASON_STOP_BEFORE_START + Return "An incorrect function call sequence was made." + Case $WLAN_HOSTED_NETWORK_REASON_INTERFACE_AVAILABLE + Return "A wireless interface has become available." + Case $WLAN_HOSTED_NETWORK_REASON_INTERFACE_UNAVAILABLE + Return "A wireless interface has become unavailable." + Case $WLAN_HOSTED_NETWORK_REASON_MINIPORT_STOPPED + Return "The wireless miniport driver stopped the Hosted Network." + Case $WLAN_HOSTED_NETWORK_REASON_MINIPORT_STARTED + Return "The wireless miniport driver status changed." + Case $WLAN_HOSTED_NETWORK_REASON_INCOMPATIBLE_CONNECTION_STARTED + Return "An incompatible connection started." + Case $WLAN_HOSTED_NETWORK_REASON_INCOMPATIBLE_CONNECTION_STOPPED + Return "An incompatible connection stopped." + Case $WLAN_HOSTED_NETWORK_REASON_USER_ACTION + Return "A state change occurred that was caused by explicit user action." + Case $WLAN_HOSTED_NETWORK_REASON_CLIENT_ABORT + Return "A state change occurred that was caused by client abort." + Case $WLAN_HOSTED_NETWORK_REASON_AP_START_FAILED + Return "The driver for the wireless Hosted Network failed to start." + Case $WLAN_HOSTED_NETWORK_REASON_PEER_ARRIVED + Return "A peer connected to the wireless Hosted Network." + Case $WLAN_HOSTED_NETWORK_REASON_PEER_DEPARTED + Return "A peer disconnected from the wireless Hosted Network." + Case $WLAN_HOSTED_NETWORK_REASON_PEER_TIMEOUT + Return "A peer timed out." + Case $WLAN_HOSTED_NETWORK_REASON_GP_DENIED + Return "The operation was denied by group policy." + Case $WLAN_HOSTED_NETWORK_REASON_SERVICE_UNAVAILABLE + Return "The Wireless LAN service is not running." + Case $WLAN_HOSTED_NETWORK_REASON_DEVICE_CHANGE + Return "The wireless adapter used by the wireless Hosted Network changed." + Case $WLAN_HOSTED_NETWORK_REASON_PROPERTIES_CHANGE + Return "The properties of the wireless Hosted Network changed." + Case $WLAN_HOSTED_NETWORK_REASON_VIRTUAL_STATION_BLOCKING_USE + Return "A virtual station is active and blocking operation." + Case $WLAN_HOSTED_NETWORK_REASON_SERVICE_AVAILABLE_ON_VIRTUAL_STATION + Return "An identical service is available on a virtual station." + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "WLAN_HOSTED_NETWORK_STATE" + Switch $iEnumeration + Case $WLAN_HOSTED_NETWORK_UNAVAILABLE + Return "Unavailable" + Case $WLAN_HOSTED_NETWORK_IDLE + Return "Idle" + Case $WLAN_HOSTED_NETWORK_ACTIVE + Return "Active" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "WLAN_INTERFACE_STATE" + Switch $iEnumeration + Case $WLAN_INTERFACE_STATE_NOT_READY + Return "Not Ready" + Case $WLAN_INTERFACE_STATE_CONNECTED + Return "Connected" + Case $WLAN_INTERFACE_STATE_AD_HOC_NETWORK_FORMED + Return "Network Formed" + Case $WLAN_INTERFACE_STATE_DISCONNECTING + Return "Disconnecting" + Case $WLAN_INTERFACE_STATE_DISCONNECTED + Return "Disconnected" + Case $WLAN_INTERFACE_STATE_ASSOCIATING + Return "Associating" + Case $WLAN_INTERFACE_STATE_DISCOVERING + Return "Discovering" + Case $WLAN_INTERFACE_STATE_AUTHENTICATING + Return "Authenticating" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "WLAN_INTERFACE_TYPE" + Switch $iEnumeration + Case $WLAN_INTERFACE_TYPE_EMULATED_802_11 + Return "Emulated Interface" + Case $WLAN_INTERFACE_TYPE_NATIVE_802_11 + Return "Native Interface" + Case $WLAN_INTERFACE_TYPE_INVALID + Return "Invalid Interface" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "WLAN_OPCODE_VALUE_TYPE" + Switch $iEnumeration + Case $WLAN_OPCODE_VALUE_TYPE_QUERY_ONLY + Return "Undetermined" + Case $WLAN_OPCODE_VALUE_TYPE_SET_BY_GROUP_POLICY + Return "Group Policy" + Case $WLAN_OPCODE_VALUE_TYPE_SET_BY_USER + Return "User" + Case $WLAN_OPCODE_VALUE_TYPE_INVALID + Return "Invalid" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case "WLAN_POWER_SETTING" + Switch $iEnumeration + Case $WLAN_POWER_SETTING_NO_SAVING + Return "None" + Case $WLAN_POWER_SETTING_LOW_SAVING + Return "Low" + Case $WLAN_POWER_SETTING_MEDIUM_SAVING + Return "Medium" + Case $WLAN_POWER_SETTING_MAXIMUM_SAVING + Return "Maximum" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case Else + Return SetError(3, 0, "") + EndSwitch +EndFunc + +Func _Wlan_NotificationToString($iSource, $iNotification) + Switch $iSource + Case $WLAN_NOTIFICATION_SOURCE_IHV + Return "IHV code[" & Hex($iNotification) & "]" + Case $WLAN_NOTIFICATION_SOURCE_SECURITY + Return "Security code[" & $iNotification & "]" + Case $WLAN_NOTIFICATION_SOURCE_ONEX + Switch $iNotification + Case $OneXNotificationTypeResultUpdate + Return "802.1X authentication has had a status change." + Case $OneXNotificationTypeAuthRestarted + Return "802.1X authentication has restarted." + Case Else + Return SetError(3, 0, "") + EndSwitch + Case $WLAN_NOTIFICATION_SOURCE_HNWK + Switch $iNotification + Case $WLAN_HOSTED_NETWORK_STATE_CHANGE + Return "The Hosted Network state has changed." + Case $WLAN_HOSTED_NETWORK_PEER_STATE_CHANGE + Return "The Hosted Network peer state has changed." + Case $WLAN_HOSTED_NETWORK_RADIO_STATE_CHANGE + Return "The Hosted Network radio state has changed." + Case Else + Return SetError(3, 0, "") + EndSwitch + Case $WLAN_NOTIFICATION_SOURCE_ACM + Switch $iNotification + Case $WLAN_NOTIFICATION_ACM_AUTOCONF_ENABLED + Return "Autoconfig enabled" + Case $WLAN_NOTIFICATION_ACM_AUTOCONF_DISABLED + Return "Autoconfig disabled" + Case $WLAN_NOTIFICATION_ACM_BACKGROUND_SCAN_ENABLED + Return "Background scans enabled" + Case $WLAN_NOTIFICATION_ACM_BACKGROUND_SCAN_DISABLED + Return "Background scans disabled" + Case $WLAN_NOTIFICATION_ACM_BSS_TYPE_CHANGE + Return "BSS type change" + Case $WLAN_NOTIFICATION_ACM_POWER_SETTING_CHANGE + Return "Power setting change" + Case $WLAN_NOTIFICATION_ACM_SCAN_COMPLETE + Return "Scan completed" + Case $WLAN_NOTIFICATION_ACM_SCAN_FAIL + Return "Scan failed" + Case $WLAN_NOTIFICATION_ACM_CONNECTION_START + Return "Connection started" + Case $WLAN_NOTIFICATION_ACM_CONNECTION_COMPLETE + Return "Connection complete" + Case $WLAN_NOTIFICATION_ACM_CONNECTION_ATTEMPT_FAIL + Return "Connection failed" + Case $WLAN_NOTIFICATION_ACM_FILTER_LIST_CHANGE + Return "Filter list change" + Case $WLAN_NOTIFICATION_ACM_INTERFACE_ARRIVAL + Return "Interface added or enabled" + Case $WLAN_NOTIFICATION_ACM_INTERFACE_REMOVAL + Return "Interface removed or disabled" + Case $WLAN_NOTIFICATION_ACM_PROFILE_CHANGE + Return "Profile or profile list change" + Case $WLAN_NOTIFICATION_ACM_PROFILE_NAME_CHANGE + Return "Profile name change" + Case $WLAN_NOTIFICATION_ACM_PROFILES_EXHAUSTED + Return "All profiles exhausted" + Case $WLAN_NOTIFICATION_ACM_NETWORK_NOT_AVAILABLE + Return "No available networks" + Case $WLAN_NOTIFICATION_ACM_NETWORK_AVAILABLE + Return "Network available" + Case $WLAN_NOTIFICATION_ACM_DISCONNECTING + Return "Disconnecting" + Case $WLAN_NOTIFICATION_ACM_DISCONNECTED + Return "Disconnected (acm)" + Case $WLAN_NOTIFICATION_ACM_ADHOC_NETWORK_STATE_CHANGE + Return "Ad hoc network state change" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case $WLAN_NOTIFICATION_SOURCE_MSM + Switch $iNotification + Case $WLAN_NOTIFICATION_MSM_ASSOCIATING + Return "Associating" + Case $WLAN_NOTIFICATION_MSM_ASSOCIATED + Return "Associated" + Case $WLAN_NOTIFICATION_MSM_AUTHENTICATING + Return "Authenticating" + Case $WLAN_NOTIFICATION_MSM_CONNECTED + Return "Connected (msm)" + Case $WLAN_NOTIFICATION_MSM_ROAMING_START + Return "Roaming started" + Case $WLAN_NOTIFICATION_MSM_ROAMING_END + Return "Roaming completed" + Case $WLAN_NOTIFICATION_MSM_RADIO_STATE_CHANGE + Return "Radio state change" + Case $WLAN_NOTIFICATION_MSM_SIGNAL_QUALITY_CHANGE + Return "Signal quality change" + Case $WLAN_NOTIFICATION_MSM_DISASSOCIATING + Return "Disassociating" + Case $WLAN_NOTIFICATION_MSM_DISCONNECTED + Return "Disconnected (msm)" + Case $WLAN_NOTIFICATION_MSM_PEER_JOIN + Return "Peer joined" + Case $WLAN_NOTIFICATION_MSM_PEER_LEAVE + Return "Peer left" + Case $WLAN_NOTIFICATION_MSM_ADAPTER_REMOVAL + Return "Adapter removed" + Case $WLAN_NOTIFICATION_MSM_ADAPTER_OPERATION_MODE_CHANGE + Return "Operation mode changed" + Case Else + Return SetError(3, 0, "") + EndSwitch + Case Else + Return SetError(3, 0, "") + EndSwitch +EndFunc + +Func _Wlan_Dot11OpModeToString($iOpMode) + Switch $iOpMode + Case $DOT11_OPERATION_MODE_UNKNOWN + Return "Unknown" + Case $DOT11_OPERATION_MODE_STATION + Return "Station" + Case $DOT11_OPERATION_MODE_AP + Return "AP" + Case $DOT11_OPERATION_MODE_EXTENSIBLE_STATION + Return "Extensible Station" + Case $DOT11_OPERATION_MODE_EXTENSIBLE_AP + Return "Extensible AP" + Case $DOT11_OPERATION_MODE_NETWORK_MONITOR + Return "Network Monitor" + Case Else + Return SetError(3, 0, "") + EndSwitch +EndFunc + +Func _Wlan_pGUIDToString($pGUID) + Local $tGUID = DllStructCreate("ulong data1; ushort data2; ushort data3; ubyte data4[8]", $pGUID) + + Return "{" & Hex(DllStructGetData($tGUID, "data1"), 8) & "-" & _ + Hex(DllStructGetData($tGUID, "data2"), 4) & "-" & _ + Hex(DllStructGetData($tGUID, "data3"), 4) & "-" & _ + Hex(StringTrimRight(DllStructGetData($tGUID, "data4"), 12), 4) & "-" & _ + StringTrimLeft(DllStructGetData($tGUID, "data4"), 6) & "}" +EndFunc + +Func _Wlan_bMACToString($bMAC) + Local $sMAC, $aMAC + $aMAC = StringSplit($bMAC, "", 2) + If UBound($aMAC) <> 14 Then Return SetError(4, 0, False) + For $i = 2 To UBound($aMAC) - 2 Step 2 + $sMAC &= $aMAC[$i] & $aMAC[$i + 1] & " " + Next + Return StringTrimRight($sMAC, 1) +EndFunc + +Func _Wlan_iTimestampToString($iTimeStamp) + Local $tTimeStamp, $aResult, $tSysTime, $sDayOfWeek + $tSysTime = DllStructCreate("word Year; word month; word DayOfWk; word Day; word Hour; word Min; word Sec; word mSec;") + $tTimeStamp = DllStructCreate("uint64 TimeStamp") + DllStructSetData($tTimeStamp, "TimeStamp", $iTimeStamp) + $aResult = DllCall("kernel32.dll", "dword", "FileTimeToSystemTime", "ptr", DllStructGetPtr($tTimeStamp), "ptr", DllStructGetPtr($tSysTime)) + If @error Then Return SetError(1, @error, False) + If Not $aResult[0] Then Return False + Switch DllStructGetData($tSysTime, "DayOfWk") + Case 0 + $sDayOfWeek = "Sun" + Case 1 + $sDayOfWeek = "Mon" + Case 2 + $sDayOfWeek = "Tues" + Case 3 + $sDayOfWeek = "Wed" + Case 4 + $sDayOfWeek = "Thurs" + Case 5 + $sDayOfWeek = "Fri" + Case 6 + $sDayOfWeek = "Sat" + EndSwitch + Return $sDayOfWeek & " " & DllStructGetData($tSysTime, "Day") & "/" & DllStructGetData($tSysTime, "Month") & "/" & _ + DllStructGetData($tSysTime, "Year") & " " & DllStructGetData($tSysTime, "Hour") & ":" & DllStructGetData($tSysTime, "Min") & ":" & _ + DllStructGetData($tSysTime, "Sec") & " " & DllStructGetData($tSysTime, "mSec") +EndFunc + +Global $hWLANAPI = DllOpen("WlanAPI.dll") +OnAutoItExitRegister("_Wlan_CloseDll") + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanCloseHandle +; Description ...: Closes a connection to the server. +; Syntax.........: _WinAPI_WlanCloseHandle($hClientHandle, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: After a connection has been closed, any attempted use of the closed handle can cause unexpected errors. +; Upon closing, all outstanding notifications are discarded. +; Do not call WlanCloseHandle from a callback function or a deadlock may occur. +; Related .......: _WinAPI_WlanOpenHandle +; Link ..........: @@MsdnLink@@ WlanCloseHandle +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanCloseHandle($hClientHandle, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanCloseHandle", "ptr", $hClientHandle, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanConnect +; Description ...: Connects to a network. +; Syntax.........: _WinAPI_WlanConnect($hClientHandle, $pGUID, $pConnParams, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $pConnParams - A pointer to a WLAN_CONNECTION_PARAMETERS structure. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: WlanConnect returns immediately. A client must call WlanRegisterNotification to be notified when a connection attempt is completed. +; The caller must have execute access on an all-user profile when attempting to connect to its associated network. +; Related .......: _WinAPI_WlanDisconnect +; Link ..........: @@MsdnLink@@ WlanConnect +; @@MsdnLink@@ WLAN_CONNECTION_PARAMETERS +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanConnect($hClientHandle, $pGUID, $pConnParams, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanConnect", "hwnd", $hClientHandle, "ptr", $pGUID, "ptr", $pConnParams, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanDeleteProfile +; Description ...: Deletes a profile from the profile list. +; Syntax.........: _WinAPI_WlanDeleteProfile($hClientHandle, $pGUID, $sProfileName, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $sProfileName - The name of the profile to delete. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: +; Related .......: _WinAPI_WlanSetProfile +; Link ..........: @@MsdnLink@@ WlanDeleteProfile +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanDeleteProfile($hClientHandle, $pGUID, $sProfileName, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanDeleteProfile", "hwnd", $hClientHandle, "ptr", $pGUID, "wstr", $sProfileName, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanDisconnect +; Description ...: Disconnects from a network. +; Syntax.........: _WinAPI_WlanDisconnect($hClientHandle, $pGUID, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If the network to be disconnected is associated with an all-user profile, the WlanDisconnect caller must have execute access on the profile. +; On Windows XP, WlanDisconnect modifies the associated profile to have a manual connection type (on-demand profile). +; There is no need to call WlanDisconnect before calling WlanConnect. Any existing network connection is dropped automatically when WlanConnect is called. +; Related .......: _WinAPI_WlanConnect +; Link ..........: @@MsdnLink@@ WlanDisconnect +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanDisconnect($hClientHandle, $pGUID, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanDisconnect", "hwnd", $hClientHandle, "ptr", $pGUID, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanEnumInterfaces +; Description ...: Enumerates all of the wireless LAN interfaces currently enabled on the local computer. +; Syntax.........: _WinAPI_WlanEnumInterfaces($hClientHandle, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; Return values .: Success - A pointer to a WLAN_INTERFACE_INFO_LIST structure. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function allocates memory to recieve data. This should be released by calling _WinAPI_WlanFreeMemory. +; Related .......: _WinAPI_WlanFreeMemory +; Link ..........: @@MsdnLink@@ WlanEnumInterfaces +; @@MsdnLink@@ WLAN_INTERFACE_INFO_LIST +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanEnumInterfaces($hClientHandle, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanEnumInterfaces", "hwnd", $hClientHandle, "ptr", $pReserved, "ptr*", 0) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return $aResult[3] +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanFreeMemory +; Description ...: Frees memory. Any memory returned from Native Wifi functions must be freed. +; Syntax.........: _WinAPI_WlanFreeMemory($pMemory) +; Parameters ....: $pMemory - Pointer to the memory to be freed. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If $pMemory points to memory that has already been freed, an access violation or heap corruption may occur. +; There is a hotfix for Windows XP SP2 that can help improve the performance of WlanFreeMemory. (http://support.microsoft.com/kb/940541) +; Related .......: _WinAPI_WlanAllocateMemory +; Link ..........: @@MsdnLink@@ WlanFreeMemory +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanFreeMemory($pMemory) + DllCall($hWLANAPI, "dword", "WlanFreeMemory", "ptr", $pMemory) + If @error Then Return SetError(1, @error, False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanGetAvailableNetworkList +; Description ...: Retrieves the list of available networks on a wireless LAN interface. +; Syntax.........: _WinAPI_WlanEnumInterfaces($hClientHandle, $pGUID, $iFlags, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $iFlags - Controls the type of networks returned in the list. This parameter can be a combination of these values: +; |0x01 - Include all ad hoc profiles in the list, including profiles that are not visible. +; |0x02 - Include all 'hidden network' profiles in list. +; Return values .: Success - A pointer to a WLAN_AVAILABLE_NETWORK_LIST structure. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function allocates memory to recieve data. This should be released by calling _WinAPI_WlanFreeMemory. +; Related .......: _WinAPI_WlanFreeMemory, _WinAPI_WlanScan, _WinAPI_WlanGetNetworkBssList +; Link ..........: @@MsdnLink@@ WlanEnumInterfaces +; @@MsdnLink@@ WLAN_AVAILABLE_NETWORK_LIST +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanGetAvailableNetworkList($hClientHandle, $pGUID, $iFlags, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanGetAvailableNetworkList", "hwnd", $hClientHandle, "ptr", $pGUID, "dword", $iFlags, "ptr", $pReserved, "ptr*", 0) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return $aResult[5] +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanGetInterfaceCapability +; Description ...: Retrieves the capabilities of an interface. +; Syntax.........: _WinAPI_WlanGetInterfaceCapability($hClientHandle, $pGUID, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; Return values .: Success - A pointer to a WLAN_INTERFACE_CAPABILITY structure. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function allocates memory to recieve data. This should be released by calling _WinAPI_WlanFreeMemory. +; Related .......: +; Link ..........: @@MsdnLink@@ WlanGetInterfaceCapability +; @@MsdnLink@@ WLAN_INTERFACE_CAPABILITY +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanGetInterfaceCapability($hClientHandle, $pGUID, $pReserved = 0) + Local $aResult, $pCapability + $aResult = DllCall($hWLANAPI, "dword", "WlanGetInterfaceCapability", "hwnd", $hClientHandle, "ptr", $pGUID, "ptr", $pReserved, "ptr*", $pCapability) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return $aResult[4] +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanGetNetworkBssList +; Description ...: Retrieves a list of the BSS entries of the wireless network or networks on a given wireless LAN interface. +; Syntax.........: _WinAPI_WlanGetNetworkBssList($hClientHandle, $pGUID, $pDOT11_SSID, $iDOT11_BSS_TYPE, $fSecurityEnabled, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $pDOT11_SSID - A pointer to a DOT11_SSID structure that specifies the SSID of the network from which the BSS list is requested. +; $iDOT11_BSS_TYPE - A DOT11_BSS_TYPE enumereration that defines the BSS type of the network. (Ignored if $pDOT11_SSID is unspecified) +; $fSecurityEnabled - Indicates whether security is enabled on the network. (Ignored if $pDOT11_SSID is unspecified) +; Return values .: Success - A pointer to a WLAN_BSS_LIST structure. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is not supported in Windows XP. +; This function allocates memory to recieve data. This should be released by calling _WinAPI_WlanFreeMemory. +; If $pDOT11_SSID is not specified the returned list contains all of available BSS entries on a wireless LAN interface. +; If $pDOT11_SSID is specified and $iDOT11_BSS_TYPE is set to $DOT11_BSS_TYPE_ANY, then the WlanGetNetworkBssList function returns ERROR_SUCCESS but no BSS entries will be returned. +; The function does not validate that any information returned in the informaion element data blob pointed to by the ulIeOffset member is a valid. (The blob bay be truncated) +; Related .......: _WinAPI_WlanGetAvailableNetworkList +; Link ..........: @@MsdnLink@@ WlanGetNetworkBssList +; @@MsdnLink@@ DOT11_SSID +; @@MsdnLink@@ DOT11_BSS_TYPE +; @@MsdnLink@@ WLAN_BSS_LIST +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanGetNetworkBssList($hClientHandle, $pGUID, $pDOT11_SSID, $iDOT11_BSS_TYPE, $fSecurityEnabled, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanGetNetworkBssList", "ptr", $hClientHandle, "ptr", $pGUID, "ptr", $pDOT11_SSID, "int", $iDOT11_BSS_TYPE, "bool", $fSecurityEnabled, "ptr", $pReserved, "ptr*", 0) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return $aResult[7] +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanGetProfile +; Description ...: Retrieves all information about a specified wireless profile. +; Syntax.........: _WinAPI_WlanGetProfile($hClientHandle, $pGUID, $sProfileName, $pFlags = 0, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $sProfileName - The name of the profile. (case sensitive) +; $pFlags - A pointer to a dword value that provides additional information about the request. (Vista, 2008 and up) +; |$WLAN_PROFILE_GET_PLAINTEXT_KEY - (input) The caller wants to retrieve the unencrypted key from a profile. (7, 2008 R2 and up) +; |$WLAN_PROFILE_GROUP_POLICY - (output) The profile was created by group policy. +; |$WLAN_PROFILE_USER - (output) The profile is a per-user profile. +; Return values .: Success - A pointer to an XML representation of the profile. +; @extended - The access mask of the all-user profile. +; |$WLAN_READ_ACCESS - The user can view the contents of the profile. +; |$WLAN_EXECUTE_ACCESS - The user has read access, and the user can also connect to and disconnect from a network using the profile. +; |$WLAN_WRITE_ACCESS - The user has execute access and the user can also modify the content of the profile or delete the profile. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function allocates memory to recieve data. This should be released by calling _WinAPI_WlanFreeMemory. +; $pFlags must be 0 on XP platforms +; In Vista and Server 2008 the key is always returned encrypted. In XP it is never encrypted. +; The key is always encrypted in Windows 7 and Server 2008 R2 if the calling process lacks required permissions to return a plain text key. +; CryptUnprotectData can be used to unencrypt the key if the process is running in the context of the LocalSystem account. +; Related .......: _WinAPI_WlanSetProfile +; Link ..........: @@MsdnLink@@ WlanGetProfile +; @@MsdnLink@@ WLAN_policy Schema +; @@MsdnLink@@ CryptUnprotectData +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanGetProfile($hClientHandle, $pGUID, $sProfileName, $pFlags = 0, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanGetProfile", "hwnd", $hClientHandle, "ptr", $pGUID, "wstr", $sProfileName, "ptr", $pReserved, "wstr*", 0, "ptr", $pFlags, "dword*", 0) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return SetExtended($aResult[7], $aResult[5]) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanGetProfileList +; Description ...: Retrieves the list of profiles in preference order. +; Syntax.........: _WinAPI_WlanGetProfileList($hClientHandle, $pGUID, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; Return values .: Success - A pointer to a WLAN_PROFILE_INFO_LIST structure. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function allocates memory to recieve data. This should be released by calling _WinAPI_WlanFreeMemory. +; Related .......: _WinAPI_WlanSetProfileList _WinAPI_WlanSetProfilePosition +; Link ..........: @@MsdnLink@@ WlanGetProfileList +; @@MsdnLink@@ WLAN_PROFILE_INFO_LIST +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanGetProfileList($hClientHandle, $pGUID, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanGetProfileList", "hwnd", $hClientHandle, "ptr", $pGUID, "ptr", $pReserved, "ptr*", 0) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return $aResult[4] +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanHostedNetworkForceStart +; Description ...: Starts the wireless Hosted Network without associating the request with the application's calling handle. +; Syntax.........: _WinAPI_WlanHostedNetworkForceStart($hClientHandle, ByRef $iReasonCode, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iReasonCode - On output, A WLAN_HOSTED_NETWORK_REASON code that indicates why the function failed. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is only supported from Windows 7 and Server 2008 R2. +; Successful calls should be matched by calls to WlanHostedNetworkForceStop function. +; Any Hosted Network state change caused by this function would not be automatically undone if the application calls WlanCloseHandle or if the process ends. +; See _WinAPI_WlanHostedNetworkStartUsing for more information about the Hosted Network. +; This function can only be called if the user has the appropriate associated privilege. Permissions are stored in a discretionary access control list (DACL) associated with a WLAN_SECURABLE_OBJECT. +; To call the WlanHostedNetworkForceStart, the client access token of the caller must have elevated privileges exposed by WLAN_SECURE_HOSTED_NETWORK_ELEVATED_ACCESS in WLAN_SECURABLE_OBJECT. +; Related .......: _WinAPI_WlanHostedNetworkForceStop _WinAPI_WlanHostedNetworkStartUsing +; Link ..........: @@MsdnLink@@ WlanHostedNetworkStartUsing +; @@MsdnLink@@ WLAN_HOSTED_NETWORK_REASON +; @@MsdnLink@@ WLAN_SECURABLE_OBJECT +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanHostedNetworkForceStart($hClientHandle, ByRef $iReasonCode, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanHostedNetworkForceStart", "hwnd", $hClientHandle, "dword*", 0, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + $iReasonCode = $aResult[2] + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanHostedNetworkForceStop +; Description ...: Stops wireless Hosted Network without associating the request with the application's calling handle. +; Syntax.........: _WinAPI_WinAPI_WlanHostedNetworkForceStop($hClientHandle, ByRef $iReasonCode, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iReasonCode - On output, A WLAN_HOSTED_NETWORK_REASON code that indicates why the funtion failed. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is only supported from Windows 7 and Server 2008 R2. +; Any Hosted Network state change caused by this function would not be automatically undone if the application calls WlanCloseHandle or if the process ends. +; Any user can call the WlanHostedNetworkForceStop function to force the stop of the Hosted Network. +; Related .......: _WinAPI_WlanHostedNetworkStartUsing _WinAPI_WlanHostedNetworkForceStart _WinAPI_WlanHostedNetworkStopUsing +; Link ..........: @@MsdnLink@@ WlanHostedNetworkForceStop +; @@MsdnLink@@ WLAN_HOSTED_NETWORK_REASON +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanHostedNetworkForceStop($hClientHandle, ByRef $iReasonCode, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanHostedNetworkForceStop", "hwnd", $hClientHandle, "dword*", 0, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + $iReasonCode = $aResult[2] + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanHostedNetworkStartUsing +; Description ...: Configures and persists to storage the network connection settings on the wireless Hosted Network if these settings are not already configured. +; Syntax.........: _WinAPI_WlanHostedNetworkStartUsing($hClientHandle, ByRef $iReasonCode, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iReasonCode - On output, A WLAN_HOSTED_NETWORK_REASON code that indicates why the funtion failed. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is only supported from Windows 7 and Server 2008 R2. +; WlanHostedNetworkInitSettings should be called before using other Hosted Network features on the local computer. +; If not already configured, this function performs the following actions: +; |Computes a random and readable SSID from the host name and computes a random primary key +; |Sets the maximum number of peers allowed to 100 +; Any Hosted Network state change caused by this function would not be automatically undone if the application calls WlanCloseHandle or if the process ends. +; Related .......: _WinAPI_WlanHostedNetworkSetProperty +; Link ..........: @@MsdnLink@@ WlanHostedNetworkInitSettings +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanHostedNetworkInitSettings($hClientHandle, ByRef $iReasonCode, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanHostedNetworkInitSettings", "hwnd", $hClientHandle, "dword*", 0, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + $iReasonCode = $aResult[2] + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanHostedNetworkQueryProperty +; Description ...: Queries the current static properties of the wireless Hosted Network. +; Syntax.........: _WinAPI_WlanHostedNetworkQueryProperty($hClientHandle, $iOpCode, ByRef $iDataSize, ByRef $pData, ByRef $iValueType, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iOpCode - A WLAN_HOSTED_NETWORK_OPCODE value to identify the property to be queried (the return data type in brackets): +; |WLAN_HOSTED_NETWORK_OPCODE_CONNECTION_SETTINGS (WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS) +; |WLAN_HOSTED_NETWORK_OPCODE_SECURITY_SETTINGS (WLAN_HOSTED_NETWORK_SECURITY_SETTINGS) +; |WLAN_HOSTED_NETWORK_OPCODE_STATION_PROFILE (WSTR) +; |WLAN_HOSTED_NETWORK_OPCODE_ENABLE (BOOL) +; $iDataSize - On output, the size of the buffer returned in bytes. +; $pData - On output, a pointer to the buffer. +; $iValueType - A WLAN_OPCODE_VALUE_TYPE value that indicates the returned value type: +; |WLAN_OPCODE_VALUE_TYPE_QUERY_ONLY +; |WLAN_OPCODE_VALUE_TYPE_SET_BY_GROUP_POLICY +; |WLAN_OPCODE_VALUE_TYPE_SET_BY_USER +; |WLAN_OPCODE_VALUE_TYPE_INVALID +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is only supported from Windows 7 and Server 2008 R2. +; Related .......: _WinAPI_WlanHostedNetworkSetProperty +; Link ..........: @@MsdnLink@@ WlanHostedNetworkQueryProperty +; @@MsdnLink@@ WLAN_HOSTED_NETWORK_OPCODE +; @@MsdnLink@@ WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS +; @@MsdnLink@@ WLAN_HOSTED_NETWORK_SECURITY_SETTINGS +; @@MsdnLink@@ WLAN_OPCODE_VALUE_TYPE +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanHostedNetworkQueryProperty($hClientHandle, $iOpCode, ByRef $iDataSize, ByRef $pData, ByRef $iValueType, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanHostedNetworkQueryProperty", "hwnd", $hClientHandle, "dword", $iOpCode, "dword*", 0, "ptr*", 0, "dword*", 0, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + $iDataSize = $aResult[3] + $pData = $aResult[4] + $iValueType = $aResult[5] + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanHostedNetworkQuerySecondaryKey +; Description ...: Querys the secondary key that will be used by the wireless Hosted Network. +; Syntax.........: _WinAPI_WlanHostedNetworkQuerySecondaryKey($hClientHandle, ByRef $iKeyLength, ByRef $pKeyData, ByRef $fIsPassPhrase, ByRef $fPersistent, ByRef $iReasonCode, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iKeyLength - On output, the number of valid data bytes in the key data array pointed to by $pKeyData. This count includes a terminating null character if the key is a passphrase. +; $pKeyData - On output, a pointer to a UCHAR array that specifies the key material. +; $fIsPassPhrase - On output, a Boolean value that indicates if the key data is in passphrase format. +; $fPersistent - On output, a Boolean value that indicates if the key should be stored after one session. +; $iReasonCode - On output, a WLAN_HOSTED_NETWORK_REASON code that indicates why the function failed. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is only supported from Windows 7 and Server 2008 R2. +; Once started, the wireless Hosted Network will allow wireless peers to associate with this secondary security key in addition to the primary security key. +; The secondary security key is always specified by the user as needed, while the primary security key is generated by the operating system with greater security strength. +; The secondary security key is usually set before the wireless Hosted Network is started. Then it will be used the next time when the Hosted Network is started. +; The primary key may be obtained through WlanHostedNetworkQueryProperty using the wlan_hosted_network_opcode_station_profile opcode. +; Any user can set or query the secondary security key used in the Hosted Network. +; The ability to enable the wireless Hosted Network may be restricted by group policy in a domain. +; Related .......: _WinAPI_WlanHostedNetworkSetSecondaryKey +; Link ..........: @@MsdnLink@@ WlanHostedNetworkQuerySecondaryKey +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanHostedNetworkQuerySecondaryKey($hClientHandle, ByRef $iKeyLength, ByRef $pKeyData, ByRef $fIsPassPhrase, ByRef $fPersistent, ByRef $iReasonCode, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanHostedNetworkQuerySecondaryKey", "hwnd", $hClientHandle, "dword*", 0, "ptr*", 0, "bool*", 0, "bool*", 0, "ptr*", 0, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + $iReasonCode = $aResult[2] + If $aResult[0] Then Return SetError(2, $aResult[0], False) + $iKeyLength = $aResult[2] + $pKeyData = $aResult[3] + $fIsPassPhrase = $aResult[4] + $fPersistent = $aResult[5] + $iReasonCode = $aResult[6] + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanHostedNetworkQueryStatus +; Description ...: Queries the current status of the wireless Hosted Network. +; Syntax.........: _WinAPI_WlanHostedNetworkQueryStatus($hClientHandle, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; Return values .: Success - a pointer to a WLAN_HOSTED_NETWORK_STATUS structure +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is only supported from Windows 7 and Server 2008 R2. +; This function allocates memory to recieve data. This should be released by calling _WinAPI_WlanFreeMemory. +; Related .......: _WinAPI_WlanHostedNetworkQueryProperty +; Link ..........: @@MsdnLink@@ WlanHostedNetworkQueryStatus +; @@MsdnLink@@ WLAN_HOSTED_NETWORK_STATUS +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanHostedNetworkQueryStatus($hClientHandle, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanHostedNetworkQueryStatus", "hwnd", $hClientHandle, "ptr*", 0, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return $aResult[2] +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanHostedNetworkRefreshSecuritySettings +; Description ...: Refreshes the configurable and auto-generated parts (the primary key) of the wireless Hosted Network security settings. +; Syntax.........: _WinAPI_WlanHostedNetworkRefreshSecuritySettings($hClientHandle, ByRef $iReasonCode, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iOpCode - A WLAN_HOSTED_NETWORK_OPCODE value to identify the property to be queried (the return data type in brackets): +; $iReasonCode - On output, a WLAN_HOSTED_NETWORK_REASON value that indicates why the funtion failed. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is only supported from Windows 7 and Server 2008 R2. +; This function requires that Hosted Network state be transitioned to wlan_hosted_network_idle if it was currently running (wlan_hosted_network_active). +; Any Hosted Network state change caused by this function would be automatically undone if the application calls WlanCloseHandle or if the process ends. +; +; Related .......: +; Link ..........: @@MsdnLink@@ WlanHostedNetworkRefreshSecuritySettings +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanHostedNetworkRefreshSecuritySettings($hClientHandle, ByRef $iReasonCode, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanHostedNetworkRefreshSecuritySettings", "hwnd", $hClientHandle, "dword*", 0, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + $iReasonCode = $aResult[2] + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanHostedNetworkSetProperty +; Description ...: Sets static properties of the wireless Hosted Network. +; Syntax.........: _WinAPI_WlanHostedNetworkSetProperty($hClientHandle, $iOpCode, $iDataSize, $pData, ByRef $iReasonCode, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iOpCode - A WLAN_HOSTED_NETWORK_OPCODE value to identify the property to set (the expected data type in brackets): +; |WLAN_HOSTED_NETWORK_OPCODE_CONNECTION_SETTINGS (WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS) +; |WLAN_HOSTED_NETWORK_OPCODE_ENABLE (BOOL) +; $iDataSize - The size of the data buffer. +; $pData - A pointer to the buffer containting the expected data type (see above). +; $iReasonCode - On output, a WLAN_HOSTED_NETWORK_REASON value that indicates why the funtion failed. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is only supported from Windows 7 and Server 2008 R2. +; Related .......: _WinAPI_WlanHostedNetworkQueryProperty +; Link ..........: @@MsdnLink@@ WlanHostedNetworkSetProperty +; @@MsdnLink@@ WLAN_HOSTED_NETWORK_OPCODE +; @@MsdnLink@@ WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS +; @@MsdnLink@@ WLAN_HOSTED_NETWORK_REASON +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanHostedNetworkSetProperty($hClientHandle, $iOpCode, $iDataSize, $pData, ByRef $iReasonCode, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanHostedNetworkSetProperty", "hwnd", $hClientHandle, "dword", $iOpCode, "dword", $iDataSize, "ptr", $pData, "dword*", 0, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + $iReasonCode = $aResult[5] + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanHostedNetworkSetSecondaryKey +; Description ...: Sets a secondary key that will be used by the wireless Hosted Network. +; Syntax.........: _WinAPI_WlanHostedNetworkSetSecondaryKey($hClientHandle, $iKeyLength, $pKeyData, $fIsPassPhrase, $fPersistent, ByRef $iReasonCode, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iKeyLength - The number of valid data bytes in the key data array pointed to by $pKeyData. This count should include a terminating null character if the key is a passphrase. +; $pKeyData - A pointer to a UCHAR array that specifies the key material. +; $fIsPassPhrase - A Boolean value that indicates if the key data is in passphrase format. +; $fPersistent - A Boolean value that indicates if the key should be stored after one session. +; $iReasonCode - On output, A WLAN_HOSTED_NETWORK_REASON code that indicates why the function failed. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is only supported from Windows 7 and Server 2008 R2. +; Once started, the wireless Hosted Network will allow wireless peers to associate with this secondary security key in addition to the primary security key. +; The secondary security key is always specified by the user as needed, while the primary security key is generated by the operating system with greater security strength. +; The secondary security key is usually set before the wireless Hosted Network is started. Then it will be used the next time when the Hosted Network is started. +; The primary key may be obtained through WlanHostedNetworkQueryProperty using the wlan_hosted_network_opcode_station_profile opcode. +; Any user can set or query the secondary security key used in the Hosted Network. +; The ability to enable the wireless Hosted Network may be restricted by group policy in a domain. +; Related .......: _WinAPI_WlanHostedNetworkQuerySecondaryKey +; Link ..........: @@MsdnLink@@ WlanHostedNetworkSetSecondaryKey +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanHostedNetworkSetSecondaryKey($hClientHandle, $iKeyLength, $pKeyData, $fIsPassPhrase, $fPersistent, ByRef $iReasonCode, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanHostedNetworkSetSecondaryKey", "hwnd", $hClientHandle, "dword", $iKeyLength, "ptr", $pKeyData, "bool", $fIsPassPhrase, _ + "bool", $fPersistent, "ptr*", 0, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + $iReasonCode = $aResult[6] + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanHostedNetworkStartUsing +; Description ...: Starts the wireless Hosted Network. +; Syntax.........: _WinAPI_WlanHostedNetworkStartUsing($hClientHandle, ByRef $iReasonCode, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iReasonCode - On output, A WLAN_HOSTED_NETWORK_REASON code that indicates why the funtion failed. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is only supported from Windows 7 and Server 2008 R2. +; When called for the first time, the operating system installs a virtual device if a capable wireless adapter is present. +; The virtual device is used exclusively for performing SoftAP connections and is not present in the list returned by WlanEnumInterfaces. +; The lifetime of the virtual device is tied to the physical wireless adapter. If the physical wireless adapter is disabled, this virtual device will be removed as well. +; Successful calls must be matched by calls to WlanHostedNetworkStopUsing. +; Any Hosted Network state change caused by this function would be automatically undone if the application calls WlanCloseHandle or if the process ends. +; Related .......: _WinAPI_WlanHostedNetworkStopUsing _WinAPI_WlanHostedNetworkForceStart _WinAPI_WlanHostedNetworkForceStop +; Link ..........: @@MsdnLink@@ WlanHostedNetworkStartUsing +; @@MsdnLink@@ WLAN_HOSTED_NETWORK_REASON +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanHostedNetworkStartUsing($hClientHandle, ByRef $iReasonCode, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanHostedNetworkStartUsing", "hwnd", $hClientHandle, "dword*", 0, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + $iReasonCode = $aResult[2] + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanHostedNetworkStopUsing +; Description ...: Stops the wireless Hosted Network. +; Syntax.........: _WinAPI_WlanHostedNetworkStopUsing($hClientHandle, ByRef $iReasonCode, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iReasonCode - On output, A WLAN_HOSTED_NETWORK_REASON code that indicates why the funtion failed. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is only supported from Windows 7 and Server 2008 R2. +; A application calls the WlanHostedNetworkStopUsing function to match earlier successful calls to the WlanHostedNetworkStartUsing function. +; The wireless Hosted Network will remain active until all applications have called WlanHostedNetworkStopUsing or WlanHostedNetworkForceStop is called to force a stop. +; Related .......: _WinAPI_WlanHostedNetworkStartUsing _WinAPI_WlanHostedNetworkForceStart _WinAPI_WlanHostedNetworkForceStop +; Link ..........: @@MsdnLink@@ WlanHostedNetworkStopUsing +; @@MsdnLink@@ WLAN_HOSTED_NETWORK_REASON +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanHostedNetworkStopUsing($hClientHandle, ByRef $iReasonCode, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanHostedNetworkStopUsing", "hwnd", $hClientHandle, "dword*", 0, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + $iReasonCode = $aResult[2] + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanOpenHandle +; Description ...: Opens a connection to the server. +; Syntax.........: _WinAPI_WlanOpenHandle($iClientVersion, $pReserved = 0) +; Parameters ....: $iClientVersion - The highest version of the WLAN API that the client supports. +; |1 - XP SP2 with Wireless LAN API (KB918997), XP SP3 +; |2 - Vista, Server 2008 and above +; Return values .: Success - A handle for the client to use in this session. +; @extended - Specifies the version of the WLAN API that will be used in this session. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: +; Related .......: _WinAPI_WlanCloseHandle +; Link ..........: @@MsdnLink@@ WlanOpenHandle +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanOpenHandle($iClientVersion, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanOpenHandle", "dword", $iClientVersion, "ptr", $pReserved, "dword*", 0, "hwnd*", 0) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return SetExtended($aResult[3], $aResult[4]) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanQueryAutoConfigParameter +; Description ...: Queries for the parameters of the auto configuration service. +; Syntax.........: _WinAPI_WlanQueryAutoConfigParameter($hClientHandle, $iOpCode, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iOpCode - A WLAN_AUTOCONF_OPCODE value that specifies the configuration parameter to be queried (the return data type in brackets): +; |$WLAN_AUTOCONF_OPCODE_SHOW_DENIED_NETWORKS (BOOL) +; |$WLAN_AUTOCONF_OPCODE_POWER_SETTING (WLAN_POWER_SETTING) +; |$WLAN_AUTOCONF_OPCODE_ONLY_USE_GP_PROFILES_FOR_ALLOWED_NETWORKS (BOOL) +; |$WLAN_AUTOCONF_OPCODE_ALLOW_EXPLICIT_CREDS (BOOL) +; |$WLAN_AUTOCONF_OPCODE_BLOCK_PERIOD (DWORD) +; |$WLAN_AUTOCONF_OPCODE_ALLOW_VIRTUAL_STATION_EXTENSIBILITY (BOOL) +; Return values .: Success - A pointer to a corresponding data type - see above. +; @extended - A WLAN_OPCODE_VALUE_TYPE value. (specifies the origin of auto config settings.) +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is not supported in version 1.0 of the API (Windows XP). +; Related .......: _WinAPI_WlanSetAutoConfigParameter +; Link ..........: @@MsdnLink@@ WlanQueryAutoConfigParameter +; @@MsdnLink@@ WLAN_AUTOCONF_OPCODE +; @@MsdnLink@@ WLAN_POWER_SETTING +; @@MsdnLink@@ WLAN_OPCODE_VALUE_TYPE +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanQueryAutoConfigParameter($hClientHandle, $iOpCode, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanQueryAutoConfigParameter", "hwnd", $hClientHandle, "int", $iOpCode, "ptr", $pReserved, "ptr*", 0, "ptr*", 0, "ptr*", 0) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return SetExtended($aResult[6], $aResult[5]) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanQueryInterface +; Description ...: Queries various parameters of a specified interface. +; Syntax.........: _WinAPI_WlanQueryInterface($hClientHandle, $pGUID, $iOpCode, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $iOpCode - A WLAN_INTF_OPCODE value that specifies the parameter to be queried (the return data type in brackets): +; |$WLAN_INTF_OPCODE_AUTOCONF_ENABLED (BOOL) (XP, 2008 and up) +; |$WLAN_INTF_OPCODE_BACKGROUND_SCAN_ENABLED (BOOL) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_RADIO_STATE (WLAN_RADIO_STATE) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_BSS_TYPE (DOT11_BSS_TYPE) (XP, 2008 and up) +; |$WLAN_INTF_OPCODE_INTERFACE_STATE (WLAN_INTERFACE_STATE) (XP, 2008 and up) +; |$WLAN_INTF_OPCODE_CURRENT_CONNECTION (WLAN_CONNECTION_ATTRIBUTES) (XP, 2008 and up) +; |$WLAN_INTF_OPCODE_CHANNEL_NUMBER (ULONG) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_SUPPORTED_INFRASTRUCTURE_AUTH_CIPHER_PAIRS (WLAN_AUTH_CIPHER_PAIR_LIST) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_SUPPORTED_ADHOC_AUTH_CIPHER_PAIRS (WLAN_AUTH_CIPHER_PAIR_LIST) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_SUPPORTED_COUNTRY_OR_REGION_STRING_LIST (WLAN_COUNTRY_OR_REGION_STRING_LIST) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_MEDIA_STREAMING_MODE (BOOL) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_STATISTICS (WLAN_STATISTICS) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_RSSI (LONG) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_CURRENT_OPERATION_MODE (ULONG) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_SUPPORTED_SAFE_MODE (BOOL) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_CERTIFIED_SAFE_MODE (BOOL) (Vista, 2008 and up) +; Return values .: Success - A pointer to a corresponding data type - see above. +; @extended A pointer to a WLAN_OPCODE_VALUE_TYPE value that specifies the type of opcode returned. This parameter may be NULL. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function allocates memory to recieve data. This should be released by calling _WinAPI_WlanFreeMemory. +; Related .......: _WinAPI_WlanSetInterface +; Link ..........: @@MsdnLink@@ WlanQueryInterface +; @@MsdnLink@@ WLAN_RADIO_STATE +; @@MsdnLink@@ DOT11_BSS_TYPE +; @@MsdnLink@@ WLAN_INTERFACE_STATE +; @@MsdnLink@@ WLAN_CONNECTION_ATTRIBUTES +; @@MsdnLink@@ WLAN_AUTH_CIPHER_PAIR_LIST +; @@MsdnLink@@ WLAN_COUNTRY_OR_REGION_STRING_LIST +; @@MsdnLink@@ WLAN_STATISTICS +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanQueryInterface($hClientHandle, $pGUID, $iOpCode, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanQueryInterface", "hwnd", $hClientHandle, "ptr", $pGUID, "dword", $iOpCode, "ptr", $pReserved, "dword*", 0, "ptr*", 0, "dword*", 0) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return SetExtended($aResult[7], $aResult[6]) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanReasonCodeToString +; Description ...: Retrieves a string that describes a specified reason code. +; Syntax.........: _WinAPI_WlanReasonCodeToString($iReasonCode, $iBufferSize, $pStringBuffer, $pReserved = 0) +; Parameters ....: $iReasonCode - A WLAN_REASON_CODE value of which the string description is requested. +; $iBufferSize - The size of the buffer used to store the string, in WCHAR. +; $pStringBuffer - Pointer to a buffer that will receive the string. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If the reason code string is longer than the buffer, it will be truncated. +; If $iBufferSize is larger than the amount of memory allocated to $pStringBuffer, an access violation will occur. +; Related .......: +; Link ..........: @@MsdnLink@@ WlanReasonCodeToString +; @@MsdnLink@@ WLAN_REASON_CODE +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanReasonCodeToString($iReasonCode, $iBufferSize, $pStringBuffer, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanReasonCodeToString", "dword", $iReasonCode, "dword", $iBufferSize, "ptr", $pStringBuffer, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanRegisterNotification +; Description ...: Registers and unregisters notifications on all wireless interfaces. +; Syntax.........: _WinAPI_WlanRegisterNotification($hClientHandle, $iNotifSource, $fIgnoreDuplicate, $pNotificationCallback = 0, $pCallbackContext = 0, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iNotifSource - The notification sources to be registered: +; |$WLAN_NOTIFICATION_SOURCE_NONE - Unregisters for all notifications. (XP and up) +; |$WLAN_NOTIFICATION_SOURCE_ALL - Registers for all notifications within the capabilities of the OS. (XP and up) +; |$WLAN_NOTIFICATION_SOURCE_ACM - Registers for notifications generated by the auto configuration module. (XP and up) +; |$WLAN_NOTIFICATION_SOURCE_HNWK - Registers for notifications generated by the wireless Hosted Network. (7 and 2008 R2) +; |$WLAN_NOTIFICATION_SOURCE_ONEX - Registers for notifications generated by 802.1X. (Vista, 2008 and up) +; |$WLAN_NOTIFICATION_SOURCE_MSM - Registers for notifications generated by MSM. (Vista, 2008 and up) +; |$WLAN_NOTIFICATION_SOURCE_SECURITY - Registers for notifications generated by the security module. (Vista, 2008 and up - currently unused) +; |$WLAN_NOTIFICATION_SOURCE_IHV - Registers for notifications generated by independent hardware vendors. (Vista, 2008 and up) +; $fIgnoreDuplicate - Specifies whether duplicate notifications will be ignored. +; $pNotificationCallback - A WLAN_NOTIFICATION_CALLBACK type that defines the type of notification callback function. +; $pCallbackContext - A pointer to the client context that will be passed to the callback function with the notification. +; Return values .: Success - True +; @extended - If present, a pointer to the previously registered notification sources. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: Once registered, the callback function will be called whenever a notification is available until the client unregisters or closes the handle. +; Do not call WlanRegisterNotification or WlanCloseHandle from a callback function or a deadlock may occur. +; Notifications are handled by the Netman service in XP. +; Related .......: _WinAPI_WlanCloseHandle, _WinAPI_WlanRegisterVirtualStationNotification +; Link ..........: @@MsdnLink@@ WlanRegisterNotification +; @@MsdnLink@@ WLAN_NOTIFICATION_CALLBACK +; @@MsdnLink@@ ONEX_NOTIFICATION_TYPE +; @@MsdnLink@@ WLAN_NOTIFICATION_ACM +; @@MsdnLink@@ WLAN_NOTIFICATION_DATA +; @@MsdnLink@@ WLAN_HOSTED_NETWORK_NOTIFICATION_CODE +; @@MsdnLink@@ WLAN_NOTIFICATION_MSM +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanRegisterNotification($hClientHandle, $iNotifSource, $fIgnoreDuplicate, $pNotificationCallback = 0, $pCallbackContext = 0, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanRegisterNotification", "hwnd", $hClientHandle, "dword", $iNotifSource, "int", $fIgnoreDuplicate, "ptr", $pNotificationCallback, "ptr", $pCallbackContext, "ptr", $pReserved, "ptr*", 0) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return SetExtended($aResult[7], True) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanRenameProfile +; Description ...: Renames an existing profile. +; Syntax.........: _WinAPI_WlanRenameProfile($hClientHandle, $pGUID, $sOldProfileName, $sNewProfileName, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $sOldProfileName - The name of the profile to change. +; $sNewProfileName - The new name of the profile. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is not supported in Windows XP. +; Related .......: _WinAPI_WlanSetProfile _WinAPI_WlanGetProfile _WinAPI_WlanDeleteProfile +; Link ..........: @@MsdnLink@@ WlanRenameProfile +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanRenameProfile($hClientHandle, $pGUID, $sOldProfileName, $sNewProfileName, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanRenameProfile", "hwnd", $hClientHandle, "ptr", $pGUID, "wstr", $sOldProfileName, "wstr", $sNewProfileName, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanSaveTemporaryProfile +; Description ...: Saves a temporary profile to the profile store. +; Syntax.........: _WinAPI_WlanSaveTemporaryProfile($hClientHandle, $pGUID, $sProfileName, $iFlags, $pAllUserProfSec = 0, $fOverwrite = 0, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $sProfileName - The name to call the profile. +; $iFlags - The flags to set on the profile. +; |0 - The profile is an all-user profile. +; |$WLAN_PROFILE_USER (0x02) - The profile is a per-user profile. +; |$WLAN_PROFILE_CONNECTION_MODE_SET_BY_CLIENT (0x10000) The profile was created by the client. +; |$WLAN_PROFILE_CONNECTION_MODE_AUTO (0x20000) The profile was created by the automatic configuration module. +; $pAllUserProfSec - A pointer to a string that sets the security descriptor string on the all-user profile - see remarks. (Vista, 2008 and up) +; $fOverwrite - Specifies whether the new profile should overwrite an existing profile if it exists with the same name. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is not supported in Windows XP. +; A temporary profile is one that is passed to WlanConnect as such (in XML format). +; See _WinAPI_SetProfile for a description of how to create a security descriptor object and parse it as a string. +; Related .......: _WinAPI_WlanConnect _WinAPISetProfile +; Link ..........: @@MsdnLink@@ WlanSaveTemporaryProfile +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanSaveTemporaryProfile($hClientHandle, $pGUID, $sProfileName, $iFlags, $pAllUserProfSec = 0, $fOverwrite = 0, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanSaveTemporaryProfile", "hwnd", $hClientHandle, "ptr", $pGUID, "wstr", $sProfileName, "ptr", $pAllUserProfSec, "dword", $iFlags, "bool", $fOverwrite, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanScan +; Description ...: Requests a scan for available networks on the indicated interface. +; Syntax.........: _WinAPI_WlanScan($hClientHandle, $pGUID, $pDOT11_SSID = 0, $pWLAN_RAW_DATA = 0, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $pDOT11_SSID - A pointer to a DOT11_SSID structure that specifies the SSID of the network to be scanned (Vista, 2008 and up) +; $pWLAN_RAW_DATA - A pointer to an information element to include in probe requests. (Vista, 2008 and up) +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: To be notified when the network scan is complete, a client must call WlanRegisterNotification. (Vista, 2008 and up) +; Wireless network drivers that meet Windows logo requirements are required to complete a WlanScan function request in 4 seconds. +; Related .......: _WinAPI_WlanGetAvailableNetworkList, _WinAPI_WlanGetNetworkBssList, _WinAPI_WlanRegisterNotification, _WinAPI_WlanSetPsdIEDataList +; Link ..........: @@MsdnLink@@ WlanScan +; @@MsdnLink@@ DOT11_SSID +; @@MsdnLink@@ WLAN_RAW_DATA +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanScan($hClientHandle, $pGUID, $pDOT11_SSID = 0, $pWLAN_RAW_DATA = 0, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanScan", "hwnd", $hClientHandle, "ptr", $pGUID, "ptr", $pDOT11_SSID, "ptr", $pWLAN_RAW_DATA, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanSetAutoConfigParameter +; Description ...: Sets the parameters of the auto configuration service. +; Syntax.........: _WinAPI_WlanSetAutoConfigParameter($hClientHandle, $iOpCode, $iDataSize, $pData, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $iOpCode - A WLAN_AUTOCONF_OPCODE value that specifies the configuration parameter to be set (the expected data type of the struct pointed to by $pData in brackets): +; |$WLAN_AUTOCONF_OPCODE_SHOW_DENIED_NETWORKS (BOOL) +; |$WLAN_AUTOCONF_OPCODE_ALLOW_EXPLICIT_CREDS (BOOL) +; |$WLAN_AUTOCONF_OPCODE_BLOCK_PERIOD (DWORD) +; |$WLAN_AUTOCONF_OPCODE_ALLOW_VIRTUAL_STATION_EXTENSIBILITY (BOOL) +; $iDataSize - The size, in bytes, of the struct pointed to by $pData +; $pData - a poiter to a BOOL or DWORD, depending on the $iOpCode value - see above. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is not supported in version 1.0 of the API (Windows XP). +; Related .......: _WinAPI_WlanQueryAutoConfigParameter +; Link ..........: @@MsdnLink@@ WlanSetAutoConfigParameter +; @@MsdnLink@@ WLAN_AUTOCONF_OPCODE +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanSetAutoConfigParameter($hClientHandle, $iOpCode, $iDataSize, $pData, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanSetAutoConfigParameter", "hwnd", $hClientHandle, "int", $iOpCode, "dword", $iDataSize, "ptr", $pData, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanSetInterface +; Description ...: Sets user-configurable parameters for a specified interface. +; Syntax.........: _WinAPI_WlanSetInterface($hClientHandle, $pGUID, $iOpCode, $iDataSize, $pData, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $iOpCode - A WLAN_INTF_OPCODE value that specifies the parameter to be set (the expected data type in brackets): +; |$WLAN_INTF_OPCODE_AUTOCONF_ENABLED (BOOL) (XP, 2008 and up) +; |$WLAN_INTF_OPCODE_BACKGROUND_SCAN_ENABLED (BOOL) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_RADIO_STATE (_WLAN_PHY_RADIO_STATE) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_BSS_TYPE (DOT11_BSS_TYPE) (XP, 2008 and up) +; |$WLAN_INTF_OPCODE_MEDIA_STREAMING_MODE (BOOL) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_CURRENT_OPERATION_MODE (ULONG) (Vista, 2008 and up) +; $iDataSize - The size of the struct containing the configuration data. +; $pData - A pointer to a struct containing the configuration data. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: The hardware radio state cannot be changed by calling the WlanSetInterface function. +; Changing the software radio state will cause related changes of the wireless Hosted Network or virtual wireless adapter radio states. +; Related .......: _WinAPI_WlanConnect +; Link ..........: @@MsdnLink@@ WlanSetInterface +; @@MsdnLink@@ WLAN_RADIO_STATE +; @@MsdnLink@@ DOT11_BSS_TYPE +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanSetInterface($hClientHandle, $pGUID, $iOpCode, $iDataSize, $pData, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanSetInterface", "hwnd", $hClientHandle, "ptr", $pGUID, "int", $iOpCode, "int", $iDataSize, "ptr", $pData, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanSetProfile +; Description ...: Sets the content of a specific profile. +; Syntax.........: _WinAPI_WlanSetProfile($hClientHandle, $pGUID, $iFlags, $sProfile, ByRef $iReasonCode, $pAllUserProfSec = 0, $fOverwrite = 0, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $iFlags - The flags to set on the profile. (Vista, 2008 and up) +; |0 - The profile is an all-user profile. +; |$WLAN_PROFILE_GROUP_POLICY (0x01) - The profile is a group policy profile. +; |$WLAN_PROFILE_USER (0x02) - The profile is a per-user profile. +; $sProfile - The XML representation of the profile. (http://msdn.microsoft.com/en-us/library/bb525370(v=VS.85).aspx) +; $iReasonCode - On output, a WLAN_REASON_CODE value that indicates why the profile is not valid. +; $pAllUserProfSec - A pointer to a string that sets the security descriptor string on the all-user profile - see remarks. (Vista, 2008 and up) +; $fOverwrite - Specifies whether this profile should overwrite an existing profile if they share the same name. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: A new profile is added at the top of the list after the group policy profiles. +; A profile's position in the list is not changed if an existing profile is overwritten. +; In Windows XP, ad hoc profiles appear after the infrastructure profiles in the profile list. +; In Windows XP, new ad hoc profiles are placed at the top of the ad hoc list, after the group policy and infrastructure profiles. +; The following describes the procedure for creating a security descriptor object and parsing it as a string. +; 1.Call InitializeSecurityDescriptor to create a security descriptor in memory. +; 2.Call SetSecurityDescriptorOwner. +; 3.Call InitializeAcl to create a discretionary access control list (DACL) in memory. +; 4.Call AddAccessAllowedAce or AddAccessDeniedAce to add access control entries (ACEs) to the DACL. +; Set the AccessMask parameter to one of the following as appropriate: +; |WLAN_READ_ACCESS +; |WLAN_EXECUTE_ACCESS +; |WLAN_WRITE_ACCESS +; 5.Call SetSecurityDescriptorDacl to add the DACL to the security descriptor. +; 6.Call ConvertSecurityDescriptorToStringSecurityDescriptor to convert the descriptor to string. +; Use the string returned by ConvertSecurityDescriptorToStringSecurityDescriptor in a dll struct for the $pAllUserProfSec parameter +; Related .......: _WinAPI_WlanGetProfile +; Link ..........: @@MsdnLink@@ WlanSetProfile +; @@MsdnLink@@ WLAN_REASON_CODE +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanSetProfile($hClientHandle, $pGUID, $iFlags, $sProfile, ByRef $iReasonCode, $pAllUserProfSec = 0, $fOverwrite = 0, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanSetProfile", "hwnd", $hClientHandle, "ptr", $pGUID, "dword", $iFlags, "wstr", $sProfile, "ptr", $pAllUserProfSec, "bool", $fOverwrite, "ptr", $pReserved, "dword*", 0) + If @error Then Return SetError(1, @error, False) + $iReasonCode = $aResult[8] + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanSetProfileEapXmlUserData +; Description ...: Sets the EAP user credentials as specified by an XML string. +; Syntax.........: _WinAPI_WlanSetProfileEapXmlUserData($hClientHandle, $pGUID, $sProfileName, $iFlags, $sEAPUserData, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $sProfile - The name of the profile associated with the EAP user data. +; $iFlags - The flags to set on the profile. (7, 2008 R2 and up) +; |$WLAN_SET_EAPHOST_DATA_ALL_USERS (0x01) - Set EAP host data for all users of this profile. +; $sEAPUserData - User credentials in a XML format. (http://msdn.microsoft.com/en-us/library/bb204765(v=vs.85).aspx) +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: On Vista and Server 2008, these credentials can only be used by the caller. +; Related .......: _WinAPI_WlanSetProfile +; Link ..........: @@MsdnLink@@ SetProfileEapXmlUserData +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanSetProfileEapXmlUserData($hClientHandle, $pGUID, $sProfileName, $iFlags, $sEAPUserData, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanSetProfileEapXmlUserData", "hwnd", $hClientHandle, "ptr", $pGUID, "wstr", $sProfileName, "dword", $iFlags, "wstr", $sEAPUserData, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanSetProfileList +; Description ...: Sets a list of profiles in order of preference. +; Syntax.........: _WinAPI_WlanSetProfileList($hClientHandle, $pGUID, $iItems, $pProfileNames, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $iItems - The number of profiles in the list to set. +; $pProfileNames - A pointer to a cocatenation of pointers to strings. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: The position of group policy profiles cannot be changed. +; In Windows XP, ad hoc profiles always appear below Infrastructure profiles. +; Related .......: _WinAPI_WlanGetProfileList _WinAPI_WlanSetProfilePosition _WinAPI_WlanDeleteProfile +; Link ..........: @@MsdnLink@@ WlanSetProfileList +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanSetProfileList($hClientHandle, $pGUID, $iItems, $pProfileNames, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanSetProfileList", "hwnd", $hClientHandle, "ptr", $pGUID, "dword", $iItems, "ptr", $pProfileNames, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanSetProfilePosition +; Description ...: Sets the position of a single, specified profile in the preference list. +; Syntax.........: _WinAPI_WlanSetProfilePosition($hClientHandle, $pGUID, $sProfileName, $iPosition, $pReserved = 0) +; Parameters ....: $hClientHandle - The client's session handle, obtained by a previous call to the WlanOpenHandle function. +; $pGUID - A pointer to the GUID of the wireless LAN interface to be queried (Obtained through WlanEnumInterfaces) +; $sProfileName - The profile to move. +; $iPosition - Indicates the position in the preference list that the profile should be shifted to. (0 is the first position) +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: The position of group policy profiles cannot be changed. +; In Windows XP, ad hoc profiles always appear below Infrastructure profiles. +; Related .......: _WinAPI_WlanGetProfileList _WinAPI_WlanSetProfileList _WinAPI_DeleteProfile +; Link ..........: @@MsdnLink@@ WlanSetProfilePosition +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanSetProfilePosition($hClientHandle, $pGUID, $sProfileName, $iPosition, $pReserved = 0) + Local $aResult = DllCall($hWLANAPI, "dword", "WlanSetProfilePosition", "hwnd", $hClientHandle, "ptr", $pGUID, "wstr", $sProfileName, "dword", $iPosition, "ptr", $pReserved) + If @error Then Return SetError(1, @error, False) + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _WinAPI_WlanUIEditProfile +; Description ...: Displays the wireless profile user interface (UI). +; Syntax.........: _WinAPI_WlanUIEditProfile($iClientVersion, $sProfileName, $pGUID, $iStartPage, ByRef $iReasonCode, $pReserved = 0) +; Parameters ....: $iClientVersion - Specifies the highest version of the WLAN API that the client supports. Values must be $WLAN_UI_API_VERSION (1). +; $sProfileName - Contains the name of the profile to be viewed or edited. +; $pGUID - A pointer to the GUID of the wireless LAN interface where the profile is stored (Obtained through WlanEnumInterfaces) +; $hWindow - The handle of the application window requesting the UI display. +; $iStartPage - A WL_DISPLAY_PAGES value that specifies the active tab when the UI dialog box appears. +; |$WLConnectionPage (0) - Displays the Connection tab. +; |$WLSecurityPage (1) - Displays the Security tab. +; |$WLAdvPage (2) - Displays the advanced dialouge under the Security tab. +; $iReasonCode - On output, a WLAN_REASON_CODE value that indicates why the function failed. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is not supported in version 1.0 of the API (Windows XP). +; Any changes to the profile made in the UI will be saved in the profile store. +; Related .......: _WinAPI_WlanSetProfile +; Link ..........: @@MsdnLink@@ WlanUIEditProfile +; @@MsdnLink@@ WL_DISPLAY_PAGES +; @@MsdnLink@@ WLAN_REASON_CODE +; Example .......: +; =============================================================================================================================== +Func _WinAPI_WlanUIEditProfile($iClientVersion, $sProfileName, $pGUID, $hWindow, $iStartPage, ByRef $iReasonCode, $pReserved = 0) + Local $aResult = DllCall("Wlanui.dll", "dword", "WlanUIEditProfile", "dword", $iClientVersion, "wstr", $sProfileName, "ptr", $pGUID, "hwnd", $hWindow, "dword", $iStartPage, "ptr", $pReserved, "dword*", 0) + If @error Then Return SetError(1, @error, False) + $iReasonCode = $aResult[7] + If $aResult[0] Then Return SetError(2, $aResult[0], False) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_CloseDll +; Description ...: Closes the handle to WlanAPI.dll. +; Syntax.........: _Wlan_CloseDll() +; Parameters ....: +; Return values .: none. +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is hard coded into the UDF as an exit function. +; Related .......: +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_CloseDll() + DllClose($hWLANAPI) +EndFunc + +#include +#include +#include "AutoItObject.au3" +#include "oLinkedList.au3" + +Global $fDebugWifi, $hClientHandle, $tGUID, $pGUID, $iNegotiatedVersion, $tNotifOverlap, $pNotifOverlap, $hNotifPipe, $iNotifPID, $hNotifThread, $iNotifKeepTime = 4000, $asNotificationCache[1][2], $avOnNotif[1][4], $fOnNotif + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_APIVersion +; Description ...: Converts version numbers into a number of formats. +; Syntax.........: _Wlan_APIVersion($vVersion = $iNegotiatedVersion) +; Parameters ....: $vVersion - An API version number in one of the following formats: +; |String/Float - MajorVersion.MinorVersion +; |Int32 - the major version in the low-order word, minor in high-order. +; Return values .: Success - A vesion array. +; |$avVersion[0] - Version (string) major.minor +; |$avVersion[1] - Version (dword) major in low-order word, minor in high-order word +; |$avVersion[2] - Major version (int) +; |$avVersion[3] - Minor version (int) +; Failure - False +; @Error +; |0 - No error. +; |4 - Invalid parameter. +; Author ........: MattyD +; Modified.......: +; Remarks .......: The default $vVersion value is the current version of the API in use. +; Currently the only two versions of the API used are 1.0 (usually denotes a WinXP platform) and 2.0 (everything else) +; Related .......: _Wlan_StartSession +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_APIVersion($vVersion = $iNegotiatedVersion) + Local $avVersion[4] + If StringRegExp($vVersion, "[^0-9\.]") Or Not $vVersion Then Return SetError(4, 0, False) + If StringInStr($vVersion, ".") Then + $avVersion[2] = Number(StringRegExpReplace($vVersion, "\.[0-9]{0,}", "")) + $avVersion[3] = Number(StringRegExpReplace($vVersion, "[0-9]{1,}\.", "")) + $avVersion[0] = $avVersion[2] & "." & $avVersion[3] + $avVersion[1] = BitOR(BitShift($avVersion[3], -16), $avVersion[2]) + Else + $avVersion[1] = $vVersion + $avVersion[2] = BitAND($avVersion[1], 0x0000FFFF) + $avVersion[3] = BitShift($avVersion[1], 16) + $avVersion[0] = $avVersion[2] & "." & $avVersion[3] + EndIf + Return $avVersion +EndFunc + +; #INTERNAL_USE_ONLY# =========================================================================================================== +; Name...........: _Wlan_CacheNotification +; Description ...: Caches messages sent by the notification module. +; Syntax.........: _Wlan_CacheNotification() +; Parameters ....: +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |3 - There is no notification to cache. +; |6 - The notification module is not running. +; Author ........: MattyD +; Modified.......: +; Remarks .......: _Wlan_GetNotification should be called to read messages from the cache. +; Related .......: _Wlan_GetNotification +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_CacheNotification() + Local $iTrim = -1, $sStream, $asStream, $asEntry, $iEntryPoint, $tBuffer, $pBuffer, $iRead, $fSuccess + Local Const $ERROR_BROKEN_PIPE = 109 + + For $i = 1 To UBound($asNotificationCache) - 1 + If TimerDiff($asNotificationCache[$i][0]) < $iNotifKeepTime Then + If $iTrim < 0 Then $iTrim = $i - 1 + $asNotificationCache[$i - $iTrim][0] = $asNotificationCache[$i][0] + $asNotificationCache[$i - $iTrim][1] = $asNotificationCache[$i][1] + EndIf + Next + If $iTrim < 0 Then $iTrim = UBound($asNotificationCache) - 1 + ReDim $asNotificationCache[$i - $iTrim][2] + If Not ProcessExists($iNotifPID) Then Return SetError(6, 0, False) + + $tBuffer = DllStructCreate("char Text[4096]") + $pBuffer = DllStructGetPtr($tBuffer) + While 1 + $fSuccess = _WinAPI_ReadFile($hNotifPipe, $pBuffer, 4096, $iRead, $pNotifOverlap) + If _WinAPI_GetLastError() = $ERROR_BROKEN_PIPE Then + _Wlan_StopNotificationModule() + OnAutoItExitUnRegister("_Wlan_StopNotificationModule") + Return SetError(6, 0, False) + EndIf + If $fSuccess And $iRead Then + $sStream &= StringLeft(DllStructGetData($tBuffer, 1), $iRead) + EndIf + If StringRight($sStream, 5) == "[EON]" Or Not $sStream Then ExitLoop + Sleep(5) + Wend + If Not $sStream Then Return SetError(3, 0, "") + $asStream = StringSplit($sStream, "[EON]", 3) + + $iEntryPoint = UBound($asNotificationCache) + ReDim $asNotificationCache[$iEntryPoint + UBound($asStream) - 1][2] + For $i = 0 To UBound($asStream) - 2 + $asEntry = StringSplit($asStream[$i], "|", 2) + $asNotificationCache[$iEntryPoint + $i][0] = $asEntry[0] + $asNotificationCache[$iEntryPoint + $i][1] = $asEntry[1] + Next + + If $fOnNotif Then + For $i = 0 To UBound($asNotificationCache) - 1 + _Wlan_OnNotifHandler() + Sleep(10) + Next + EndIf + + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_Connect +; Description ...: Connects an interface to a network. +; Syntax.........: _Wlan_Connect($vProfile, $fWait = False, $iTimeout = 15, $sSSID = "", $iFlags = 0) +; Parameters ....: $vProfile - Either a profile name (connect using an existing profile), XML profile or profile object. (connect using a temporary profile) +; $fWait - Specifies if the function should wait for the connection to be disconnected before returning. +; $iTimeout - The maximum length of time in seconds the function should wait before returning. +; $SSID - Specifies which SSID within a profile to connect to. +; $iFlags - Specifies more connection parameters. (flags only applicable on networks/profiles as outlined in brackets) +; |$WLAN_CONNECTION_HIDDEN_NETWORK (0x01) - Connect to the destination network even if it is not broadcasting a SSID. (infrastructure) +; |$WLAN_CONNECTION_ADHOC_JOIN_ONLY (0x02) - Do not form an ad-hoc network. Only join an ad-hoc network if the network already exists. (ad hoc) +; |$WLAN_CONNECTION_IGNORE_PRIVACY_BIT (0x04) - Ignore whether packets are encrypted and the method of encryption used. (infrastructure with temporary profile) +; |$WLAN_CONNECTION_EAPOL_PASSTHROUGH (0x08) - Exempt EAPOL traffic from encryption and decryption. Use only when an application must send EAPOL traffic using open authentication and WEP encryption. (Infrastructure, 802.1x disabled, temporary profile) +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |5 - The function timed out. +; |6 - Notification module is not running. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; $vProfile must be a profile name on Windows XP. +; If $fWait is True then the notification module must be running and accepting ACM notifications. +; If connection attempt is successfully started but fails before timing +; If the network to be disconnected is associated with an all-user profile, the WlanDisconnect caller must have execute access on the profile. +; On Windows XP, WlanDisconnect modifies the associated profile to have a manual connection type (on-demand profile). +; There is no need to call WlanDisconnect before calling WlanConnect. Any existing network connection is dropped automatically when WlanConnect is called. +; Related .......: _Wlan_Disconnect _Wlan_SaveTemporaryProfile +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_Connect($vProfile, $fWait = False, $iTimeout = 15, $sSSID = "", $iFlags = 0);, $iConnMode = -1, $iBSSType = -1) + Local $avVersion = _Wlan_APIVersion(), $iConnectCount, $iTimer, $avNotification, $asSREXResult, $tProfile, $tConnParams + Local $tSSID, $pSSID = 0, $sReasonCode, $iConnMode = $WLAN_CONNECTION_MODE_TEMPORARY_PROFILE, $iBSSType = $DOT11_BSS_TYPE_INFRASTRUCTURE + + If $fWait < 0 Or $fWait = Default Then $fWait = False + If $iTimeout < 0 Or $iTimeout = Default Then $iTimeout = 15 + ;If $iConnMode < 0 Or $iConnMode = Default Then $iConnMode = $WLAN_CONNECTION_MODE_TEMPORARY_PROFILE + ;If $iBSSType < 0 Or $iBSSType = Default Then $iBSSType = $DOT11_BSS_TYPE_INFRASTRUCTURE + + If IsObj($vProfile) Then + If $vProfile.Type = "Ad Hoc" Then $iBSSType = $DOT11_BSS_TYPE_INDEPENDENT + $vProfile = _Wlan_GenerateXMLProfile($vProfile) + If @error Then Return SetError(@error, @extended, False) + ElseIf StringInStr($vProfile, 'xml version="1.0"') Then + $asSREXResult = StringRegExp($vProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then + If $asSREXResult[0] = "IBSS" Then $iBSSType = $DOT11_BSS_TYPE_INDEPENDENT + EndIf + ElseIf $vProfile Then + $vProfile = _Wlan_GetProfile($vProfile, $sReasonCode) + If @error Then Return SetError(@error, @extended, False) + $iConnMode = $WLAN_CONNECTION_MODE_PROFILE + If Not @error Then + If $vProfile.Type = "Ad Hoc" Then $iBSSType = $DOT11_BSS_TYPE_INDEPENDENT + $vProfile = $vProfile.Name + EndIf + EndIf + + If $sSSID Then + $tSSID = DllStructCreate("dword Length; wchar char[32]") + DllStructSetData($tSSID, "SSID", $sSSID) + DllStructSetData($tSSID, "SSID", StringLen($sSSID)) + $pSSID = DllStructGetPtr($tSSID) + EndIf + + $tProfile = DllStructCreate("wchar Profile[4096]") + DllStructSetData($tProfile, "Profile", $vProfile) + + $tConnParams = DllStructCreate("dword ConnMode; ptr Profile; ptr SSID; ptr BSSIDList; dword BSSType; dword Flags") + DllStructSetData($tConnParams, "ConnMode", $iConnMode) + DllStructSetData($tConnParams, "Profile", DllStructGetPtr($tProfile)) + DllStructSetData($tConnParams, "SSID", $pSSID) + DllStructSetData($tConnParams, "BSSType", $iBSSType) + DllStructSetData($tConnParams, "Flags", $iFlags) + + _WinAPI_WlanConnect($hClientHandle, $pGUID, DllStructGetPtr($tConnParams)) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanConnect")) + If Not $fWait Then Return True + + $iTimer = TimerInit() + While TimerDiff($iTimer) < $iTimeout * 1000 + $avNotification = _Wlan_GetNotification() + If @error And @error <> 3 Then Return SetError(6, 0, False) + If @error = 3 Then ContinueLoop + If $avNotification[0] = $WLAN_NOTIFICATION_SOURCE_ACM And $avNotification[2] = _Wlan_pGUIDToString($pGUID) Then + Switch $avNotification[1] + Case $WLAN_NOTIFICATION_ACM_CONNECTION_COMPLETE + If $avVersion[2] > 1 Then Return True + $iConnectCount += 1 + If $iConnectCount = 3 Then Return True + Case $WLAN_NOTIFICATION_ACM_DISCONNECTED, $WLAN_NOTIFICATION_ACM_CONNECTION_ATTEMPT_FAIL + Return False + EndSwitch + EndIf + WEnd + Return SetError(5, 0, False) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_ConvertProfile +; Description ...: Converts an XML profile to a profile object and vica versa. +; Syntax.........: _Wlan_ConvertProfile($vProfile) +; Parameters ....: $vProfile - An XML profile or profile object +; Return values .: Success - An XML profile or profile object depending on the input format. +; Failure - False +; @Error +; |0 - No error. +; |6 - A dependency is missing. +; @extended - _AutoItObject_Create error code. +; Author ........: MattyD +; Modified.......: +; Remarks .......: +; Related .......: +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_ConvertProfile($vProfile) + If IsObj($vProfile) Then + $vProfile = _Wlan_GenerateXMLProfile($vProfile) + Return SetError(@error, @extended, $vProfile) + Else + $vProfile = _Wlan_GenerateProfileObject($vProfile) + Return SetError(@error, @extended, $vProfile) + EndIf +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_ConvertUserData +; Description ...: Converts XML user data for profiles using 802.1x authentication to a user data object and vica versa. +; Syntax.........: _Wlan_ConvertUserData($vUserData) +; Parameters ....: $vUserData - XML EAP user data or user data object +; Return values .: Success - XML EAP user data or user data object depending on the input format. +; Failure - False +; @Error +; |0 - No error. +; |6 - A dependency is missing. +; @extended - _AutoItObject_Create error code. +; Author ........: MattyD +; Modified.......: +; Remarks .......: +; Related .......: +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_ConvertUserData($vProfile) + If IsObj($vProfile) Then + $vProfile = _Wlan_GenerateXMLUserData($vProfile) + Return SetError(@error, @extended, $vProfile) + Else + $vProfile = _Wlan_GenerateUserDataObject($vProfile) + Return SetError(@error, @extended, $vProfile) + EndIf +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_CreateProfileObject +; Description ...: Creates a profile object. +; Syntax.........: _Wlan_CreateProfileObject() +; Parameters ....: +; Return values .: Success - A profile object +; Failure - False +; @Error +; |0 - No error. +; |6 - A dependency is missing. (@extended - _AutoItObject_Create error code.) +; Author ........: MattyD +; Modified.......: +; Remarks .......: The structure of a profile object is outlined in the documentation of _Wlan_SetProfile +; Related .......: _Wlan_SetProfile _Wlan_GetProfile _Wlan_GenerateProfileObject _Wlan_GenerateXMLProfile _Wlan_Connect +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_CreateProfileObject() + Local $oProfileClass, $oProfile, $oKeyClass, $oOptionsClass, $oSSOClass, $oOneXClass, $oPMKClass, $oFIPSClass, $oServerValidationClass, _ + $oServerValidation, $oMSCHAPClass, $oTLSClass, $oTLS, $oPEAPClass, $oEAPClass + + $oKeyClass = _AutoitObject_Class() + With $oKeyClass + .AddProperty("Material", $ELSCOPE_PUBLIC, "") + .AddProperty("Protected", $ELSCOPE_PUBLIC, "") + .AddProperty("Type", $ELSCOPE_PUBLIC, "") + .AddProperty("Index", $ELSCOPE_PUBLIC, "") + EndWith + + $oOptionsClass = _AutoitObject_Class() + With $oOptionsClass + .AddProperty("NonBroadcast", $ELSCOPE_PUBLIC, "") + .AddProperty("ConnMode", $ELSCOPE_PUBLIC, "") + .AddProperty("Autoswitch", $ELSCOPE_PUBLIC, "") + .AddProperty("PhyTypes", $ELSCOPE_PUBLIC, LinkedList()) + EndWith + + $oSSOClass = _AutoitObject_Class() + With $oSSOClass + .AddProperty("MaxDelay", $ELSCOPE_PUBLIC, "") + .AddProperty("Type", $ELSCOPE_PUBLIC, "") + .AddProperty("UserBasedVLAN", $ELSCOPE_PUBLIC, "") + .AddProperty("AllowMoreDialogs", $ELSCOPE_PUBLIC, "") + EndWith + + $oOneXClass = _AutoitObject_Class() + With $oOneXClass + .AddProperty("Enabled", $ELSCOPE_PUBLIC, "") + .AddProperty("AuthMode", $ELSCOPE_PUBLIC, "") + .AddProperty("AuthPeriod", $ELSCOPE_PUBLIC, "") + .AddProperty("CacheUserData", $ELSCOPE_PUBLIC, "") + .AddProperty("HeldPeriod", $ELSCOPE_PUBLIC, "") + .AddProperty("MaxAuthFailures", $ELSCOPE_PUBLIC, "") + .AddProperty("MaxStart", $ELSCOPE_PUBLIC, "") + .AddProperty("StartPeriod", $ELSCOPE_PUBLIC, "") + .AddProperty("SuppMode", $ELSCOPE_PUBLIC, "") + .AddProperty("SSO", $ELSCOPE_PUBLIC, $oSSOClass.Object) + EndWith + + $oPMKClass = _AutoitObject_Class() + With $oPMKClass + .AddProperty("CacheEnabled", $ELSCOPE_PUBLIC, "") + .AddProperty("CacheTTL", $ELSCOPE_PUBLIC, "") + .AddProperty("CacheSize", $ELSCOPE_PUBLIC, "") + .AddProperty("PreAuthEnabled", $ELSCOPE_PUBLIC, "") + .AddProperty("PreAuthThrottle", $ELSCOPE_PUBLIC, "") + EndWith + + $oFIPSClass = _AutoitObject_Class() + $oFIPSClass.AddProperty("Enabled", $ELSCOPE_PUBLIC, "") + + $oServerValidationClass = _AutoitObject_Class() + With $oServerValidationClass + .AddProperty("NoUserPrompt", $ELSCOPE_PUBLIC, "") + .AddProperty("ServerNames", $ELSCOPE_PUBLIC, "") + .AddProperty("ThumbPrints", $ELSCOPE_PUBLIC, "") + .AddProperty("Enabled", $ELSCOPE_PUBLIC, "") + .AddProperty("AcceptServerNames", $ELSCOPE_PUBLIC, "") + EndWith + $oServerValidation = $oServerValidationClass.Object + + $oMSCHAPClass = _AutoitObject_Class() + $oMSCHAPClass.AddProperty("UseWinLogonCreds", $ELSCOPE_PUBLIC, "") + + $oTLSClass = _AutoitObject_Class() + With $oTLSClass + .AddProperty("Source", $ELSCOPE_PUBLIC, "") + .AddProperty("SimpleCertSel", $ELSCOPE_PUBLIC, "") + .AddProperty("DiffUsername", $ELSCOPE_PUBLIC, "") + .AddProperty("ServerValidation", $ELSCOPE_PUBLIC, "") + EndWith + $oTLS = $oTLSClass.Object + + $oPEAPClass = _AutoitObject_Class() + With $oPEAPClass + .AddProperty("FastReconnect", $ELSCOPE_PUBLIC, "") + .AddProperty("QuarantineChecks", $ELSCOPE_PUBLIC, "") + .AddProperty("RequireCryptobinding", $ELSCOPE_PUBLIC, "") + .AddProperty("EnableIdentityPrivacy", $ELSCOPE_PUBLIC, "") + .AddProperty("AnonUsername", $ELSCOPE_PUBLIC, "") + .AddProperty("ServerValidation", $ELSCOPE_PUBLIC, _AutoitObject_Create($oServerValidation)) + .AddProperty("MSCHAP", $ELSCOPE_PUBLIC, $oMSCHAPClass.Object) + .AddProperty("TLS", $ELSCOPE_PUBLIC, _AutoitObject_Create($oTLS)) + EndWith + + $oEAPClass = _AutoitObject_Class() + With $oEAPClass + .AddProperty("Blob", $ELSCOPE_PUBLIC, "") + .AddProperty("BaseType", $ELSCOPE_PUBLIC, "") + .AddProperty("Type", $ELSCOPE_PUBLIC, "") + .AddProperty("PEAP", $ELSCOPE_PUBLIC, _AutoitObject_Create($oPEAPClass.Object)) + .AddProperty("TLS", $ELSCOPE_PUBLIC, _AutoitObject_Create($oTLS)) + EndWith + + $oProfileClass = _AutoitObject_Class() + With $oProfileClass + .AddProperty("XML", $ELSCOPE_PUBLIC, "") + .AddProperty("Name", $ELSCOPE_PUBLIC, "") + .AddProperty("SSID", $ELSCOPE_PUBLIC, LinkedList()) + .AddProperty("Type", $ELSCOPE_PUBLIC, "") + .AddProperty("Auth", $ELSCOPE_PUBLIC, "") + .AddProperty("Encr", $ELSCOPE_PUBLIC, "") + .AddProperty("Key", $ELSCOPE_PUBLIC, $oKeyClass.Object) + .AddProperty("Options", $ELSCOPE_PUBLIC, $oOptionsClass.Object) + .AddProperty("OneX", $ELSCOPE_PUBLIC, $oOneXClass.Object) + .AddProperty("PMK", $ELSCOPE_PUBLIC, $oPMKClass.Object) + .AddProperty("FIPS", $ELSCOPE_PUBLIC, $oFIPSClass.Object) + .AddProperty("EAP", $ELSCOPE_PUBLIC, $oEAPClass.Object) + EndWith + $oProfile = $oProfileClass.Object + + $oProfile.EAP.TLS.ServerValidation = _AutoitObject_Create($oServerValidation) + $oProfile.EAP.PEAP.TLS.ServerValidation = _AutoitObject_Create($oServerValidation) + $oProfile.EAP.PEAP.ServerValidation.Thumbprints = LinkedList() + $oProfile.EAP.PEAP.TLS.ServerValidation.Thumbprints = LinkedList() + $oProfile.EAP.TLS.ServerValidation.Thumbprints = LinkedList() + + Return $oProfile +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_CreateUserDataObject +; Description ...: Creates a user data object for profiles incorperating 802.1x authentication. +; Syntax.........: _Wlan_CreateUserDataObject() +; Parameters ....: +; Return values .: Success - A user data object +; Failure - False +; @Error +; |0 - No error. +; |6 - A dependency is missing. (@extended - _AutoItObject_Create error code.) +; Author ........: MattyD +; Modified.......: +; Remarks .......: The structure of a user data object is outlined in the documentation of _Wlan_SetProfileUserData +; Related .......: _Wlan_SetProfileUserData _Wlan_GenerateUserDataObject _Wlan_GenerateXMLUserData +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_CreateUserDataObject() + Local $oUserDataClass, $oUserData, $oPEAPUserDataClass, $oTLSUserDataClass, $oTLSUserData, $oMSCHAPUserDataClass + + $oTLSUserDataClass = _AutoitObject_Class() + With $oTLSUserDataClass + .AddProperty("Domain", $ELSCOPE_PUBLIC, "") + .AddProperty("Username", $ELSCOPE_PUBLIC, "") + .AddProperty("Cert", $ELSCOPE_PUBLIC, "") + EndWith + $oTLSUserData = $oTLSUserDataClass.Object + + $oMSCHAPUserDataClass = _AutoitObject_Class() + With $oMSCHAPUserDataClass + .AddProperty("Domain", $ELSCOPE_PUBLIC, "") + .AddProperty("Username", $ELSCOPE_PUBLIC, "") + .AddProperty("Password", $ELSCOPE_PUBLIC, "") + EndWith + + $oPEAPUserDataClass = _AutoitObject_Class() + With $oPEAPUserDataClass + .AddProperty("Username", $ELSCOPE_PUBLIC, "") + .AddProperty("MSCHAP", $ELSCOPE_PUBLIC, $oMSCHAPUserDataClass.Object) + .AddProperty("TLS", $ELSCOPE_PUBLIC, "") + EndWith + + $oUserDataClass = _AutoitObject_Class() + With $oUserDataClass + .AddProperty("BaseType", $ELSCOPE_PUBLIC, "") + .AddProperty("Type", $ELSCOPE_PUBLIC, "") + .AddProperty("Blob", $ELSCOPE_PUBLIC, "") + .AddProperty("PEAP", $ELSCOPE_PUBLIC, $oPEAPUserDataClass.Object) + .AddProperty("TLS", $ELSCOPE_PUBLIC, _AutoitObject_Create($oTLSUserData)) + EndWith + $oUserData = $oUserDataClass.Object + + $oUserData.PEAP.TLS = _AutoitObject_Create($oTLSUserData) + + Return $oUserData +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_DecryptKey +; Description ...: Decrypts a protected network key returned by _Wlan_GetProfile. +; Syntax.........: _Wlan_DecryptKey($bKey) +; Parameters ....: $bKey - A binary representation of an encrypted network key. +; Return values .: Success - The decrypted network key. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; The calling process must be running in the context of the LocalSystem account in order for this function to succeed. +; Related .......: _Wlan_GetProfile +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_DecryptKey($bKey) + Local Const $CRYPTPROTECT_UI_FORBIDDEN = 0x1 + Local $tEncrKey, $tDataIn, $tDataOut, $aResult, $tDecrKey + + $tEncrKey = DllStructCreate("byte[1024]") + DllStructSetData($tEncrKey, 1, $bKey) + + $tDataIn = DllStructCreate("int; ptr") + DllStructSetData($tDataIn, 1, BinaryLen($bKey)) + DllStructSetData($tDataIn, 2, DllStructGetPtr($tEncrKey)) + + $tDataOut = DllStructCreate("int; ptr") + $aResult = DllCall("crypt32.dll","bool", "CryptUnprotectData", "ptr", DllStructGetPtr($tDataIn), "ptr", 0, "ptr", 0, "ptr", 0, "ptr", 0, "dword", $CRYPTPROTECT_UI_FORBIDDEN, "ptr", DllStructGetPtr($tDataOut)) + If @error Then Return SetError(1, @error, False) + If Not $aResult[0] Then Return SetError(2, _WinAPI_GetLastError(), False) + + $tDecrKey = DllStructCreate("char[" & DllStructGetData($tDataOut, 1) & "]", DllStructGetData($tDataOut, 2)) + Return DllStructGetData($tDecrKey, 1) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_DeleteProfile +; Description ...: Deletes a profile from the profile list. +; Syntax.........: _Wlan_DeleteProfile($sProfileName) +; Parameters ....: $sProfileName - The name of the profile to delete. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; Related .......: _Wlan_SetProfile +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_DeleteProfile($sProfileName) + _WinAPI_WlanDeleteProfile($hClientHandle, $pGUID, $sProfileName) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanDeleteprofile")) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_Disconnect +; Description ...: Disconnects an interface from its current network. +; Syntax.........: _Wlan_Disconnect($fWait = False, $iTimeout = 5) +; Parameters ....: $fWait - Specifies if the function should wait for the connection to be disconnected before returning +; $iTimeout - The maximum length of time in seconds the function should wait before returning +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |5 - The function timed out. +; |6 - Notification module is not running. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; If $fWait is True then the notification module must be running and accepting ACM notifications. +; If the network to be disconnected is associated with an all-user profile, the WlanDisconnect caller must have execute access on the profile. +; On Windows XP, WlanDisconnect modifies the associated profile to have a manual connection type (on-demand profile). +; There is no need to call WlanDisconnect before calling WlanConnect. Any existing network connection is dropped automatically when WlanConnect is called. +; Related .......: _Wlan_Connect +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_Disconnect($fWait = False, $iTimeout = 5) + Local $avVersion = _Wlan_APIVersion(), $iDisconnectCount, $iTimer, $avNotification + If $fWait < 0 Or $fWait = Default Then $fWait = False + If $iTimeout < 0 Or $iTimeout = Default Then $iTimeout = 5 + ;Check if disconnected. + _WinAPI_WlanDisconnect($hClientHandle, $pGUID) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanDisconnect")) + If Not $fWait Then Return True + $iTimer = TimerInit() + While TimerDiff($iTimer) < $iTimeout * 1000 + $avNotification = _Wlan_GetNotification() + If @error And @error <> 3 Then Return SetError(6, 0, False) + If @error = 3 Then ContinueLoop + If $avNotification[0] = $WLAN_NOTIFICATION_SOURCE_ACM And $avNotification[1] = $WLAN_NOTIFICATION_ACM_DISCONNECTED Then + If $avVersion[2] > 1 Then Return True + $iDisconnectCount += 1 + If $iDisconnectCount = 3 Then Return True + EndIf + WEnd + Return SetError(5, 0, False) +EndFunc + +; #INTERNAL_USE_ONLY# =========================================================================================================== +; Name...........: _Wlan_EndSession +; Description ...: Cleans up the wireless session. +; Syntax.........: _Wlan_EndSession() +; Parameters ....: +; Return values .: none. +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is hard coded into the UDF as an exit function. +; Related .......: _Wlan_StartSession +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_EndSession() + _WinAPI_WlanCloseHandle($hClientHandle) + If @error Then _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanCloseHandle") +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_EnumInterfaces +; Description ...: Enumerates all of the wireless LAN interfaces currently enabled on the local computer. +; Syntax.........: _Wlan_EnumInterfaces() +; Parameters ....: +; Return values .: Success - An array of interfaces. +; |$asInterfaces[$iIndex][0] - Interface GUID +; |$asInterfaces[$iIndex][1] - Interface Description +; |$asInterfaces[$iIndex][2] - Interface State +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |3 - There is no data to return. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; Interfaces must be enabled to be enumerated. +; Related .......: _Wlan_SelectInterface +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_EnumInterfaces() + Local $pInterfaceList, $tInterface, $iItems + $pInterfaceList = _WinAPI_WlanEnumInterfaces($hClientHandle) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanEnumInterfaces")) + $tInterface = DllStructCreate("dword Items", $pInterfaceList) + $iItems = DllStructGetData($tInterface, "Items") + If Not $iItems Then + _WinAPI_WlanFreeMemory($pInterfaceList) + Return SetError(3, 0, "") + EndIf + + Local $asInterfaces[$iItems][3], $pInterface + + For $i = 0 To $iItems - 1 + $pInterface = Ptr($i * 532 + Number($pInterfaceList) + 8) + $tInterface = DllStructCreate("byte GUID[16]; wchar Desc[256]; dword State", $pInterface) + $asInterfaces[$i][0] = _Wlan_pGUIDToString($pInterface) + $asInterfaces[$i][1] = DllStructGetData($tInterface, "Desc") + $asInterfaces[$i][2] = _Wlan_EnumToString("WLAN_INTERFACE_STATE", DllStructGetData($tInterface, "State")) + Next + + _WinAPI_WlanFreeMemory($pInterfaceList) + Return $asInterfaces +EndFunc + +; #INTERNAL_USE_ONLY# =========================================================================================================== +; Name...........: _Wlan_GenerateProfileObject +; Description ...: Generates a profile object from an XML profile. +; Syntax.........: _Wlan_GenerateProfileObject($sProfile) +; Parameters ....: $sProfile - An XML profile +; Return values .: Success - A profile object +; Failure - False +; @Error - 0 - No error. +; |6 - A dependency is missing. (@extended - _AutoItObject_Create error code.) +; Author ........: MattyD +; Modified.......: +; Remarks .......: +; Related .......: _Wlan_GenerateXMLProfile _Wlan_ConvertProfile +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_GenerateProfileObject($sProfile) + Local $oProfile, $asSREXResult, $asProfileSnippet + $oProfile = _Wlan_CreateProfileObject() + If @error Then Return SetError(6, @error, False) + + With $oProfile + .XML = $sProfile + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 3) + If Not @error Then + .Name = $asSREXResult[0] + For $i = 1 To UBound($asSREXResult) - 1 + .SSID.Add($asSREXResult[$i]) + Next + EndIf + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .Type = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .Auth = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .Encr = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .Key.Protected = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .Key.Type = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .Key.Material = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .Key.Index = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .Options.NonBroadcast = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .Options.ConnMode = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .Options.Autoswitch = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 3) + If Not @error Then + For $i = 0 To UBound($asSREXResult) - 1 + .Options.PhyTypes.Add($asSREXResult[$i]) + Next + EndIf + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.Enabled = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.AuthMode = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.AuthPeriod = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.CacheUserData = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.HeldPeriod = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.MaxAuthFailures = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.MaxStart = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.StartPeriod = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.SuppMode = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.SSO.Type = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.SSO.MaxDelay = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.SSO.UserBasedVLAN = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .OneX.SSO.AllowMoreDialogs = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .PMK.CacheEnabled = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .PMK.CacheTTL = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .PMK.CacheSize = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .PMK.PreAuthEnabled = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .PMK.PreAuthThrottle = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .FIPS.Enabled = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.Blob = $asSREXResult[0] + $asSREXResult = StringRegExp($sProfile, "]{0,}>([^<]{0,})<", 3) + If @error Then $asSREXResult = StringRegExp($sProfile, "<[^/]{0,}:Type" & "[^>]{0,}>([^<]{0,})<", 3) + If Not @error Then + .EAP.BaseType = $asSREXResult[0] + For $i = 1 To UBound($asSREXResult) - 1 + .EAP.Type = .EAP.Type & $asSREXResult[$i] + Next + EndIf + If .EAP.BaseType = "25" Then + $asProfileSnippet = StringRegExp($sProfile, "]{0,}>([[:print:][:space:]]{1,})]{0,}>([[:print:][:space:]]{1,})([[:print:][:space:]]{1,})", 3) + If @error Then $asProfileSnippet = StringRegExp($sProfile, "<[^/]{0,}:Eap>([[:print:][:space:]]{1,})<[^/]{0,}:Eap>([[:print:][:space:]]{1,})([[:print:][:space:]]{1,})", 1) + If Not @error Then + $asProfileSnippet[0] &= $asProfileSnippet[2] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:FastReconnect" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.FastReconnect = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:EnableQuarantineChecks" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.QuarantineChecks = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:RequireCryptoBinding" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.RequireCryptoBinding = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:EnableIdentityPrivacy" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.EnableIdentityPrivacy = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:AnonymousUserName" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.AnonUsername = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:DisableUserPromptForServerValidation" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.ServerValidation.NoUserPrompt = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:ServerNames" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.ServerValidation.ServerNames = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 3) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:TrustedRootCA" & "[^>]{0,}>([^<]{0,})<", 3) + If Not @error Then + For $i = 0 To UBound($asSREXResult) - 1 + .EAP.PEAP.ServerValidation.ThumbPrints.Add = $asSREXResult[$i] + Next + EndIf + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:PerformServerValidation" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.ServerValidation.Enabled = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:AcceptServerName" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.ServerValidation.AcceptServerNames = $asSREXResult[0] + + If StringInStr($asProfileSnippet[1], "CertificateStore", 1) Then .EAP.PEAP.TLS.Source = "Certificate Store" + If StringInStr($asProfileSnippet[1], "SmartCard", 1) Then .EAP.PEAP.TLS.Source = "Smart Card" + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:SimpleCertSelection" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.TLS.SimpleCertSel = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:DifferentUsername" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.TLS.DiffUsername = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:DisableUserPromptForServerValidation" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.TLS.ServerValidation.NoUserPrompt = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:ServerNames" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.TLS.ServerValidation.ServerNames = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 3) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:TrustedRootCA" & "[^>]{0,}>([^<]{0,})<", 3) + If Not @error Then + For $i = 0 To UBound($asSREXResult) - 1 + .EAP.PEAP.TLS.ServerValidation.ThumbPrints.Add = $asSREXResult[$i] + Next + EndIf + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:PerformServerValidation" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.TLS.ServerValidation.Enabled = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:AcceptServerName" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.TLS.ServerValidation.AcceptServerNames = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:UseWinLogonCredentials" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.PEAP.MSCHAP.UseWinLogonCreds = $asSREXResult[0] + EndIf + EndIf + If .EAP.BaseType = "13" Then + $asProfileSnippet = StringRegExp($sProfile, "]{0,}>([[:print:][:space:]]{1,})", 1) + If @error Then $asProfileSnippet = StringRegExp($sProfile, "<[^/]{0,}:Eap>([[:print:][:space:]]{1,})", 1) + If Not @error Then + If StringInStr($asProfileSnippet[0], "CertificateStore", 1) Then .EAP.TLS.Source = "Certificate Store" + If StringInStr($asProfileSnippet[0], "SmartCard", 1) Then .EAP.TLS.Source = "Smart Card" + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:SimpleCertSelection" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.TLS.SimpleCertSel = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:DifferentUsername" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.TLS.DiffUsername = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:DisableUserPromptForServerValidation" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.TLS.ServerValidation.NoUserPrompt = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:ServerNames" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.TLS.ServerValidation.ServerNames = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 3) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:TrustedRootCA" & "[^>]{0,}>([^<]{0,})<", 3) + If Not @error Then + For $i = 0 To UBound($asSREXResult) - 1 + .EAP.TLS.ServerValidation.ThumbPrints.Add = $asSREXResult[$i] + Next + EndIf + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:PerformServerValidation" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.TLS.ServerValidation.Enabled = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:AcceptServerName" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .EAP.TLS.ServerValidation.AcceptServerNames = $asSREXResult[0] + EndIf + EndIf + + If .Type = "ESS" Then .Type = "Infrastructure" + If .Type = "IBSS" Then .Type = "Ad Hoc" + If .Auth = "open" Then .Auth = "Open" + If .Auth = "shared" Then .Auth = "Shared Key" + If .Auth = "WPAPSK" Then .Auth = "WPA-Personal" + If .Auth = "WPA2PSK" Then .Auth = "WPA2-Personal" + If .Encr = "none" Then .Encr = "Unencrypted" + If .Key.Protected == "true" Then .Key.Protected = True + If .Key.Protected == "false" Then .Key.Protected = False + If .Key.Type = "networkKey" Then .Key.Type = "Network Key" + If .Key.Type = "passPhrase" Then .Key.Type = "Pass Phrase" + If .Key.Index <> "" Then .Key.Index = Number(.Key.Index) + 1 + If .Options.NonBroadcast == "true" Then .Options.NonBroadcast = True + If .Options.NonBroadcast == "false" Then .Options.NonBroadcast = False + If .Options.ConnMode = "auto" Then .Options.ConnMode = "Automatic" + If .Options.ConnMode = "manual" Then .Options.ConnMode = "Manual" + If .Options.Autoswitch == "true" Then .Options.Autoswitch = True + If .Options.Autoswitch == "false" Then .Options.Autoswitch = False + If .OneX.Enabled == "true" Then .OneX.Enabled = True + If .OneX.Enabled == "false" Then .OneX.Enabled = False + If .OneX.AuthMode = "machineOrUser" Then .OneX.AuthMode = "Machine Or User" + If .OneX.AuthMode = "machine" Then .OneX.AuthMode = "Machine" + If .OneX.AuthMode = "user" Then .OneX.AuthMode = "User" + If .OneX.AuthMode = "guest" Then .OneX.AuthMode = "Guest" + If .OneX.AuthPeriod <> "" Then .OneX.AuthPeriod = Number(.OneX.AuthPeriod) + If .OneX.CacheUserData == "true" Then .OneX.CacheUserData = True + If .OneX.CacheUserData == "false" Then .OneX.CacheUserData = False + If .OneX.HeldPeriod <> "" Then .OneX.HeldPeriod = Number(.OneX.HeldPeriod) + If .OneX.MaxAuthFailures <> "" Then .OneX.MaxAuthFailures = Number(.OneX.MaxAuthFailures) + If .OneX.MaxStart <> "" Then .OneX.MaxStart = Number(.OneX.MaxStart) + If .OneX.StartPeriod <> "" Then .OneX.StartPeriod = Number(.OneX.StartPeriod) + If .OneX.SuppMode = "inhibitTransmission" Then .OneX.SuppMode = "Inhibit Transmission" + If .OneX.SuppMode = "includeLearning" Then .OneX.SuppMode = "Include Learning" + If .OneX.SuppMode = "compliant" Then .OneX.SuppMode = "Compliant" + If .OneX.SSO.Type = "preLogon" Then .OneX.SSO.Type = "Pre Logon" + If .OneX.SSO.Type = "postLogon" Then .OneX.SSO.Type = "Post Logon" + If .OneX.SSO.MaxDelay <> "" Then .OneX.SSO.MaxDelay = Number(.OneX.SSO.MaxDelay) + If .OneX.SSO.UserBasedVLAN == "true" Then .OneX.SSO.UserBasedVLAN = True + If .OneX.SSO.UserBasedVLAN == "false" Then .OneX.SSO.UserBasedVLAN = False + If .OneX.SSO.AllowMoreDialogs == "true" Then .OneX.SSO.AllowMoreDialogs = True + If .OneX.SSO.AllowMoreDialogs == "false" Then .OneX.SSO.AllowMoreDialogs = False + If .PMK.CacheEnabled == "enabled" Then .PMK.CacheEnabled = True + If .PMK.CacheEnabled == "disabled" Then .PMK.CacheEnabled = False + If .PMK.CacheTTL <> "" Then .PMK.CacheTTL = Number(.PMK.CacheTTL) + If .PMK.CacheSize <> "" Then .PMK.CacheSize = Number(.PMK.CacheSize) + If .PMK.PreAuthEnabled == "enabled" Then .PMK.PreAuthEnabled = True + If .PMK.PreAuthEnabled == "disabled" Then .PMK.PreAuthEnabled = False + If .PMK.PreAuthThrottle <> "" Then .PMK.PreAuthThrottle = Number(.PMK.PreAuthThrottle) + If .FIPS.Enabled == "true" Then .FIPS.Enabled = True + If .FIPS.Enabled == "false" Then .FIPS.Enabled = False + If .EAP.Blob <> "" Then .EAP.Blob = Binary("0x" & .EAP.Blob) + If .EAP.BaseType = "13" Then .EAP.BaseType = "TLS" + If .EAP.BaseType = "25" Then .EAP.BaseType = "PEAP" + If .EAP.Type = "13" Then .EAP.Type = "TLS" + If .EAP.Type = "2513" Then .EAP.Type = "PEAP-TLS" + If .EAP.Type = "2526" Then .EAP.Type = "PEAP-MSCHAP" + If .EAP.PEAP.FastReconnect == "true" Then .EAP.PEAP.FastReconnect = True + If .EAP.PEAP.FastReconnect == "false" Then .EAP.PEAP.FastReconnect = False + If .EAP.PEAP.QuarantineChecks == "true" Then .EAP.PEAP.QuarantineChecks = True + If .EAP.PEAP.QuarantineChecks == "false" Then .EAP.PEAP.QuarantineChecks = False + If .EAP.PEAP.RequireCryptoBinding == "true" Then .EAP.PEAP.RequireCryptoBinding = True + If .EAP.PEAP.RequireCryptoBinding == "false" Then .EAP.PEAP.RequireCryptoBinding = False + If .EAP.PEAP.EnableIdentityPrivacy == "true" Then .EAP.PEAP.EnableIdentityPrivacy = True + If .EAP.PEAP.EnableIdentityPrivacy == "false" Then .EAP.PEAP.EnableIdentityPrivacy = False + If .EAP.PEAP.ServerValidation.NoUserPrompt == "true" Then .EAP.PEAP.ServerValidation.NoUserPrompt = True + If .EAP.PEAP.ServerValidation.NoUserPrompt == "false" Then .EAP.PEAP.ServerValidation.NoUserPrompt = False + If .EAP.PEAP.ServerValidation.Enabled == "true" Then .EAP.PEAP.ServerValidation.Enabled = True + If .EAP.PEAP.ServerValidation.Enabled == "false" Then .EAP.PEAP.ServerValidation.Enabled = False + If .EAP.PEAP.ServerValidation.AcceptServerNames == "true" Then .EAP.PEAP.ServerValidation.AcceptServerNames = True + If .EAP.PEAP.ServerValidation.AcceptServerNames == "false" Then .EAP.PEAP.ServerValidation.AcceptServerNames = False + If .EAP.PEAP.TLS.SimpleCertSel == "true" Then .EAP.PEAP.TLS.SimpleCertSel = True + If .EAP.PEAP.TLS.SimpleCertSel == "false" Then .EAP.PEAP.TLS.SimpleCertSel = False + If .EAP.PEAP.TLS.DiffUsername == "true" Then .EAP.PEAP.TLS.DiffUsername = True + If .EAP.PEAP.TLS.DiffUsername == "false" Then .EAP.PEAP.TLS.DiffUsername = False + If .EAP.PEAP.TLS.ServerValidation.NoUserPrompt == "true" Then .EAP.PEAP.TLS.ServerValidation.NoUserPrompt = True + If .EAP.PEAP.TLS.ServerValidation.NoUserPrompt == "false" Then .EAP.PEAP.TLS.ServerValidation.NoUserPrompt = False + If .EAP.PEAP.TLS.ServerValidation.Enabled == "true" Then .EAP.PEAP.TLS.ServerValidation.Enabled = True + If .EAP.PEAP.TLS.ServerValidation.Enabled == "false" Then .EAP.PEAP.TLS.ServerValidation.Enabled = False + If .EAP.PEAP.TLS.ServerValidation.AcceptServerNames == "true" Then .EAP.PEAP.TLS.ServerValidation.AcceptServerNames = True + If .EAP.PEAP.TLS.ServerValidation.AcceptServerNames == "false" Then .EAP.PEAP.TLS.ServerValidation.AcceptServerNames = False + If .EAP.PEAP.MSCHAP.UseWinLogonCreds == "true" Then .EAP.PEAP.MSCHAP.UseWinLogonCreds = True + If .EAP.PEAP.MSCHAP.UseWinLogonCreds == "false" Then .EAP.PEAP.MSCHAP.UseWinLogonCreds = False + If .EAP.TLS.SimpleCertSel == "true" Then .EAP.TLS.SimpleCertSel = True + If .EAP.TLS.SimpleCertSel == "false" Then .EAP.TLS.SimpleCertSel = False + If .EAP.TLS.DiffUsername == "true" Then .EAP.TLS.DiffUsername = True + If .EAP.TLS.DiffUsername == "false" Then .EAP.TLS.DiffUsername = False + If .EAP.TLS.ServerValidation.NoUserPrompt == "true" Then .EAP.TLS.ServerValidation.NoUserPrompt = True + If .EAP.TLS.ServerValidation.NoUserPrompt == "false" Then .EAP.TLS.ServerValidation.NoUserPrompt = False + If .EAP.TLS.ServerValidation.Enabled == "true" Then .EAP.TLS.ServerValidation.Enabled = True + If .EAP.TLS.ServerValidation.Enabled == "false" Then .EAP.TLS.ServerValidation.Enabled = False + If .EAP.TLS.ServerValidation.AcceptServerNames == "true" Then .EAP.TLS.ServerValidation.AcceptServerNames = True + If .EAP.TLS.ServerValidation.AcceptServerNames == "false" Then .EAP.TLS.ServerValidation.AcceptServerNames = False + EndWith + + Return $oProfile +EndFunc + +; #INTERNAL_USE_ONLY# =========================================================================================================== +; Name...........: _Wlan_GenerateUserDataObject +; Description ...: Generates XML EAP user data from a user data object. +; Syntax.........: _Wlan_GenerateUserDataObject($sUserData) +; Parameters ....: $sUserData - A string containing the XML user data +; Return values .: Success - A user data object +; Failure - False +; @Error +; |0 - No error. +; |6 - A dependency is missing. (@extended - _AutoItObject_Create error code.) +; Author ........: MattyD +; Modified.......: +; Remarks .......: +; Related .......: +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_GenerateUserDataObject($sUserData) + Local $oUserData, $asSREXResult, $asProfileSnippet + + $oUserData = _Wlan_CreateUserDataObject() + If @error Then Return SetError(@error, @extended, False) + + With $oUserData + $asSREXResult = StringRegExp($sUserData, "]{0,}>([^<]{0,})<", 3) + If @error Then $asSREXResult = StringRegExp($sUserData, "<[^/]{0,}:Type" & "[^>]{0,}>([^<]{0,})<", 3) + If Not @error Then + .BaseType = $asSREXResult[0] + For $i = 1 To UBound($asSREXResult) - 1 + .Type = .Type & $asSREXResult[$i] + Next + EndIf + $asSREXResult = StringRegExp($sUserData, "]{0,}>([^<]{0,})<", 1) + If Not @error Then $oUserData.Blob = $asSREXResult[0] + + If .BaseType = "25" Then + $asProfileSnippet = StringRegExp($sUserData, "]{0,}>([[:print:][:space:]]{1,})]{0,}>([[:print:][:space:]]{1,})([[:print:][:space:]]{1,})", 3) + If @error Then $asProfileSnippet = StringRegExp($sUserData, "<[^/]{0,}:Eap>([[:print:][:space:]]{1,})<[^/]{0,}:Eap>([[:print:][:space:]]{1,})([[:print:][:space:]]{1,})", 1) + If Not @error Then + $asProfileSnippet[0] &= $asProfileSnippet[2] + $asSREXResult = StringRegExp($asProfileSnippet[0], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[0], "<[^/]{0,}:RoutingIdentity" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .PEAP.Username = $asSREXResult[0] + If .Type = "2513" Then + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:Username" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .PEAP.TLS.Username = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:UserCert" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .PEAP.TLS.Cert = $asSREXResult[0] + ElseIf .Type = "2526" Then + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:Username" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .PEAP.MSCHAP.Username = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:Password" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .PEAP.MSCHAP.Password = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:LogonDomain" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .PEAP.MSCHAP.Domain = $asSREXResult[0] + EndIf + EndIf + EndIf + If .BaseType = "13" Then + $asProfileSnippet = StringRegExp($sUserData, "]{0,}>([[:print:][:space:]]{1,})", 1) + If @error Then $asProfileSnippet = StringRegExp($sUserData, "<[^/]{0,}:Eap>([[:print:][:space:]]{1,})", 1) + If Not @error Then + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:Username" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .TLS.Username = $asSREXResult[0] + $asSREXResult = StringRegExp($asProfileSnippet[1], "]{0,}>([^<]{0,})<", 1) + If @error Then $asSREXResult = StringRegExp($asProfileSnippet[1], "<[^/]{0,}:UserCert" & "[^>]{0,}>([^<]{0,})<", 1) + If Not @error Then .TLS.Cert = $asSREXResult[0] + EndIf + EndIf + + If .BaseType = "13" Then .BaseType = "TLS" + If .BaseType = "25" Then .BaseType = "PEAP" + If .Type = "13" Then .Type = "TLS" + If .Type = "2513" Then .Type = "PEAP-TLS" + If .Type = "2526" Then .Type = "PEAP-MSCHAP" + If .Blob <> "" Then .Blob = Binary("0x" & .Blob) + If StringInStr(.TLS.UserName, "\") Then $asSREXResult = StringSplit(.TLS.UserName, "\", 2) + If Not @error Then + .TLS.Domain = $asSREXResult[0] + .TLS.UserName = $asSREXResult[1] + EndIf + If StringInStr(.PEAP.TLS.UserName, "\") Then $asSREXResult = StringSplit(.PEAP.TLS.UserName, "\", 2) + If Not @error Then + .PEAP.TLS.Domain = $asSREXResult[0] + .PEAP.TLS.UserName = $asSREXResult[1] + EndIf + EndWith + + Return $oUserData +EndFunc + +; #INTERNAL_USE_ONLY# =========================================================================================================== +; Name...........: _Wlan_GenerateXMLProfile +; Description ...: Generates an XML profile from a profile object. +; Syntax.........: _Wlan_GenerateXMLProfile($oProfile) +; Parameters ....: $oProfile - A profile object +; Return values .: Success - A string containing the XML profile +; Failure - False +; @Error +; |0 - No error. +; |4 - Invalid parameter. +; Author ........: MattyD +; Modified.......: +; Remarks .......: +; Related .......: _Wlan_GenerateProfileObject _Wlan_ConvertProfile +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_GenerateXMLProfile($oProfile) + If Not IsObj($oProfile) Then Return SetError(4, 0, False) + + Local Const $sEL_BASE_START = 'WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1"+|name|SSIDConfig+|SSID+|name|-|nonBroadcast|-|' & _ + 'connectionType|connectionMode|autoSwitch|MSM+|connectivity+|phyType|-|security+|authEncryption+|authentication|encryption|useOneX|' & _ + 'FIPSMode xmlns="http://www.microsoft.com/networking/WLAN/profile/v2"|-|sharedKey+|keyType|protected|keyMaterial|-|keyIndex|PMKCacheMode|PMKCacheTTL|' & _ + 'PMKCacheSize|preAuthMode|PreAuthThrottle|' + Local Const $sEL_ONEX_START = 'OneX xmlns="http://www.microsoft.com/networking/OneX/v1"+|cacheUserData|heldPeriod|authPeriod|startPeriod|maxStart|' & _ + 'maxAuthFailures|supplicantMode|authMode|singleSignOn+|type|maxDelay|allowAdditionalDialogs|userBasedVirtualLan|-|EAPConfig+|' & _ + 'EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig"' & @CRLF & 'xmlns:eapCommon="http://www.microsoft.com/provisioning/EapCommon"+|' & _ + 'EapMethod+|eapCommon:Type|eapCommon:AuthorId|-|Config ' & _ + 'xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1"' & @CRLF & _ + 'xmlns:msPeap="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV1"' & @CRLF & _ + 'xmlns:eapTls="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV1"' & @CRLF & _ + 'xmlns:msChapV2="http://www.microsoft.com/provisioning/MsChapV2ConnectionPropertiesV1"' & @CRLF & _ + 'xmlns:msPeapV2="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2"' & @CRLF & _ + 'xmlns:eapTlsV2="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2"+|' + Local Const $sEL_PEAP_START = 'baseEap:Eap+|baseEap:Type|msPeap:EapType+|msPeap:ServerValidation+|msPeap:DisableUserPromptForServerValidation|' & _ + 'msPeap:ServerNames|msPeap:TrustedRootCA|-|msPeap:FastReconnect|msPeap:InnerEapOptional|' + Local Const $sEL_TLS = 'baseEap:Eap+|baseEap:Type|eapTls:EapType+|eapTls:CredentialsSource+|eapTls:SmartCard|eapTls:CertificateStore+|' & _ + 'eapTls:SimpleCertSelection|-|-|eapTls:ServerValidation+|eapTls:DisableUserPromptForServerValidation|eapTls:ServerNames|eapTls:TrustedRootCA|' & _ + '-|eapTls:DifferentUsername|eapTlsV2:PerformServerValidation|eapTlsV2:AcceptServerName|-|-|' + Local Const $sEL_MSCHAP = 'baseEap:Eap+|baseEap:Type|msChapV2:EapType+|msChapV2:UseWinLogonCredentials|-|-|' + Local Const $sEL_PEAP_END = 'msPeap:EnableQuarantineChecks|msPeap:RequireCryptoBinding|msPeap:PeapExtensions+|msPeapV2:PerformServerValidation|msPeapV2:AcceptServerName|' & _ + 'msPeapV2:IdentityPrivacy+|msPeapV2:EnableIdentityPrivacy|msPeapV2:AnonymousUserName|-|-|-|-|' + Local Const $sEL_ONEX_END = '-|ConfigBlob|-|-|-|' + Local Const $sEL_BASE_END = '-|-|-' + + Local $sEl_Start = $sEL_BASE_START + Local $sEl_End = $sEL_BASE_END + Local $sProfile = '' & @CRLF, $avStack[1] = [-1], $asElements + + With $oProfile + If .Type = "Infrastructure" Then .Type = "ESS" + If .Type = "Ad Hoc" Then .Type = "IBSS" + .Auth = StringReplace(StringUpper(.Auth), "-", "") + If .Auth = "OPEN" Then .Auth = "open" + If .Auth = "SHARED KEY" Then .Auth = "shared" + .Encr = StringUpper(.Encr) + If .Encr = "UNENCRYPTED" Then .Encr = "none" + If .Key.Protected == True Then .Key.Protected = "true" + If .Key.Protected == False Then .Key.Protected = "false" + If .Key.Type = "Network Key" Then .Key.Type = "networkKey" + If .Key.Type = "Pass Phrase" Then .Key.Type = "passPhrase" + If .Key.Index <> "" Then .Key.Index = String(Number(.Key.Index) - 1) + If .Key.Index = "0" Then .Key.Index = "" + If .Options.NonBroadcast == True Then .Options.NonBroadcast = "true" + If .Options.NonBroadcast == False Then .Options.NonBroadcast = "false" + If .Options.ConnMode = "Automatic" Then .Options.ConnMode = "auto" + If .Options.ConnMode = "Manual" Then .Options.ConnMode = "manual" + If .Options.Autoswitch == True Then .Options.Autoswitch = "true" + If .Options.Autoswitch == False Then .Options.Autoswitch = "false" + If .OneX.Enabled == True Then .OneX.Enabled = "true" + If .OneX.Enabled == False Then .OneX.Enabled = "false" + .OneX.AuthMode = StringLower(.OneX.AuthMode) + If .OneX.AuthMode = "machine or user" Then .OneX.AuthMode = "machineOrUser" + If .OneX.AuthPeriod <> "" Then .OneX.AuthPeriod = String(Number(.OneX.AuthPeriod)) + If .OneX.CacheUserData == True Then .OneX.CacheUserData = "true" + If .OneX.CacheUserData == False Then .OneX.CacheUserData = "false" + If .OneX.HeldPeriod <> "" Then .OneX.HeldPeriod = String(Number(.OneX.HeldPeriod)) + If .OneX.MaxAuthFailures <> "" Then .OneX.MaxAuthFailures = String(Number(.OneX.MaxAuthFailures)) + If .OneX.MaxStart <> "" Then .OneX.MaxStart = String(Number(.OneX.MaxStart)) + If .OneX.StartPeriod <> "" Then .OneX.StartPeriod = String(Number(.OneX.StartPeriod)) + If .OneX.SuppMode = "Inhibit Transmission" Then .OneX.SuppMode = "inhibitTransmission" + If .OneX.SuppMode = "Include Learning" Then .OneX.SuppMode = "includeLearning" + If .OneX.SuppMode = "Compliant" Then .OneX.SuppMode = "compliant" + If .OneX.SSO.Type = "Pre Logon" Then .OneX.SSO.Type = "preLogon" + If .OneX.SSO.Type = "Post Logon" Then .OneX.SSO.Type = "postLogon" + If .OneX.SSO.MaxDelay <> "" Then .OneX.SSO.MaxDelay = String(Number(.OneX.SSO.MaxDelay)) + If .OneX.SSO.UserBasedVLAN == True Then .OneX.SSO.UserBasedVLAN = "true" + If .OneX.SSO.UserBasedVLAN == False Then .OneX.SSO.UserBasedVLAN = "false" + If .OneX.SSO.AllowMoreDialogs == True Then .OneX.SSO.AllowMoreDialogs = "true" + If .OneX.SSO.AllowMoreDialogs == False Then .OneX.SSO.AllowMoreDialogs = "false" + If .PMK.CacheEnabled == True Then .PMK.CacheEnabled = "enabled" + If .PMK.CacheEnabled == False Then .PMK.CacheEnabled = "disabled" + If .PMK.CacheTTL <> "" Then .PMK.CacheTTL = String(Number(.PMK.CacheTTL)) + If .PMK.CacheSize <> "" Then .PMK.CacheSize = String(Number(.PMK.CacheSize)) + If .PMK.PreAuthEnabled == True Then .PMK.PreAuthEnabled = "enabled" + If .PMK.PreAuthEnabled == False Then .PMK.PreAuthEnabled = "disabled" + If .PMK.PreAuthThrottle <> "" Then .PMK.PreAuthThrottle = String(Number(.PMK.PreAuthThrottle)) + If .FIPS.Enabled == True Then .FIPS.Enabled = "true" + If .FIPS.Enabled == False Then .FIPS.Enabled = "false" + If .EAP.Blob <> "" Then .EAP.Blob = StringReplace(String(.EAP.Blob), "0x", "") + If .EAP.BaseType = "TLS" Then .EAP.BaseType = "13" + If .EAP.BaseType = "PEAP" Then .EAP.BaseType = "25" + If .EAP.Type = "TLS" Then .EAP.Type = "13" + If .EAP.Type = "PEAP-TLS" Then .EAP.Type = "2513" + If .EAP.Type = "PEAP-MSCHAP" Then .EAP.Type = "2526" + If .EAP.PEAP.FastReconnect == True Then .EAP.PEAP.FastReconnect = "true" + If .EAP.PEAP.FastReconnect == False Then .EAP.PEAP.FastReconnect = "false" + If .EAP.PEAP.QuarantineChecks == True Then .EAP.PEAP.QuarantineChecks = "true" + If .EAP.PEAP.QuarantineChecks == False Then .EAP.PEAP.QuarantineChecks = "false" + If .EAP.PEAP.RequireCryptoBinding == True Then .EAP.PEAP.RequireCryptoBinding = "true" + If .EAP.PEAP.RequireCryptoBinding == False Then .EAP.PEAP.RequireCryptoBinding = "false" + If .EAP.PEAP.EnableIdentityPrivacy == True Then .EAP.PEAP.EnableIdentityPrivacy = "true" + If .EAP.PEAP.EnableIdentityPrivacy == False Then .EAP.PEAP.EnableIdentityPrivacy = "false" + If .EAP.PEAP.ServerValidation.NoUserPrompt == True Then .EAP.PEAP.ServerValidation.NoUserPrompt = "true" + If .EAP.PEAP.ServerValidation.NoUserPrompt == False Then .EAP.PEAP.ServerValidation.NoUserPrompt = "false" + If .EAP.PEAP.ServerValidation.Enabled == True Then .EAP.PEAP.ServerValidation.Enabled = "true" + If .EAP.PEAP.ServerValidation.Enabled == False Then .EAP.PEAP.ServerValidation.Enabled = "false" + If .EAP.PEAP.ServerValidation.AcceptServerNames == True Then .EAP.PEAP.ServerValidation.AcceptServerNames = "true" + If .EAP.PEAP.ServerValidation.AcceptServerNames == False Then .EAP.PEAP.ServerValidation.AcceptServerNames = "false" + If .EAP.PEAP.TLS.SimpleCertSel == True Then .EAP.PEAP.TLS.SimpleCertSel = "true" + If .EAP.PEAP.TLS.SimpleCertSel == False Then .EAP.PEAP.TLS.SimpleCertSel = "false" + If .EAP.PEAP.TLS.DiffUsername == True Then .EAP.PEAP.TLS.DiffUsername = "true" + If .EAP.PEAP.TLS.DiffUsername == False Then .EAP.PEAP.TLS.DiffUsername = "false" + If .EAP.PEAP.TLS.ServerValidation.NoUserPrompt == True Then .EAP.PEAP.TLS.ServerValidation.NoUserPrompt = "true" + If .EAP.PEAP.TLS.ServerValidation.NoUserPrompt == False Then .EAP.PEAP.TLS.ServerValidation.NoUserPrompt = "false" + If .EAP.PEAP.TLS.ServerValidation.Enabled == True Then .EAP.PEAP.TLS.ServerValidation.Enabled = "true" + If .EAP.PEAP.TLS.ServerValidation.Enabled == False Then .EAP.PEAP.TLS.ServerValidation.Enabled = "false" + If .EAP.PEAP.TLS.ServerValidation.AcceptServerNames == True Then .EAP.PEAP.TLS.ServerValidation.AcceptServerNames = "true" + If .EAP.PEAP.TLS.ServerValidation.AcceptServerNames == False Then .EAP.PEAP.TLS.ServerValidation.AcceptServerNames = "false" + If .EAP.PEAP.MSCHAP.UseWinLogonCreds == True Then .EAP.PEAP.MSCHAP.UseWinLogonCreds = "true" + If .EAP.PEAP.MSCHAP.UseWinLogonCreds == False Then .EAP.PEAP.MSCHAP.UseWinLogonCreds = "false" + If .EAP.TLS.SimpleCertSel == True Then .EAP.TLS.SimpleCertSel = "true" + If .EAP.TLS.SimpleCertSel == False Then .EAP.TLS.SimpleCertSel = "false" + If .EAP.TLS.DiffUsername == True Then .EAP.TLS.DiffUsername = "true" + If .EAP.TLS.DiffUsername == False Then .EAP.TLS.DiffUsername = "false" + If .EAP.TLS.ServerValidation.NoUserPrompt == True Then .EAP.TLS.ServerValidation.NoUserPrompt = "true" + If .EAP.TLS.ServerValidation.NoUserPrompt == False Then .EAP.TLS.ServerValidation.NoUserPrompt = "false" + If .EAP.TLS.ServerValidation.Enabled == True Then .EAP.TLS.ServerValidation.Enabled = "true" + If .EAP.TLS.ServerValidation.Enabled == False Then .EAP.TLS.ServerValidation.Enabled = "false" + If .EAP.TLS.ServerValidation.AcceptServerNames == True Then .EAP.TLS.ServerValidation.AcceptServerNames = "true" + If .EAP.TLS.ServerValidation.AcceptServerNames == False Then .EAP.TLS.ServerValidation.AcceptServerNames = "false" + EndWith + + + If $oProfile.OneX.Enabled = "true" Then + $sEl_Start &= $sEL_ONEX_START + $sEl_End = $sEL_ONEX_END & $sEl_End + EndIf + + If StringInStr($oProfile.EAP.Type, "25") Then + $sEl_Start &= $sEL_PEAP_START + $sEl_End = $sEL_PEAP_END & $sEl_End + EndIf + + If StringInStr($oProfile.EAP.Type, "13") Then $sEl_Start &= $sEL_TLS + If StringInStr($oProfile.EAP.Type, "26") Then $sEl_Start &= $sEL_MSCHAP + + $asElements = StringSplit($sEl_Start & $sEl_End, "|") + For $i = 1 To UBound($asElements) - 1 + If StringInStr($asElements[$i], @CRLF) Then + For $j = 0 To $avStack[0] + $asElements[$i] = StringReplace($asElements[$i], @CRLF, @CRLF & @TAB) + Next + EndIf + If StringInStr($asElements[$i], "+") Then + $sProfile &= "<" & StringReplace($asElements[$i], "+", "") & ">" & @CRLF + Redim $avStack[Ubound($avStack) + 1] + $avStack[Ubound($avStack) - 1] = StringReplace($asElements[$i], "+", "") + $avStack[0] += 1 + ElseIf $asElements[$i] == "-" Then + $sProfile &= "]{0,}", "") & ">" & @CRLF + Redim $avStack[Ubound($avStack) - 1] + Else + $sProfile &= "<" & $asElements[$i] & ">]{0,}", "") & ">" & @CRLF + EndIf + If $i < UBound($asElements) - 1 And $asElements[$i + 1] == "-" Then $avStack[0] -= 1 + For $j = 0 To $avStack[0] + $sProfile &= " " + Next + Next + + $sProfile = StringReplace($sProfile, "", "" & $oProfile.Name, 1) + For $sSSID In $oProfile.SSID + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}[^<]{0,}<[^<]{0,}\r", "\0\0", 1) + $sProfile = StringReplace($sProfile, "<", "" & $sSSID & "<", 1) + Next + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}[^<]{0,}<[^<]{0,}\r", "", 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.Type, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.Auth, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.Encr, 1) + If Not $oProfile.Key.Material Then $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}[[:print:][:space:]]{0,}\r", "", 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.Key.Protected, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.Key.Type, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.Key.Material, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.Key.Index, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.Options.NonBroadcast, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.Options.ConnMode, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.Options.Autoswitch, 1) + For $sPhyType In $oProfile.Options.PhyTypes + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}<[^\r]{0,}\r", "\0\0", 1) + $sProfile = StringReplace($sProfile, "<", "" & $sPhyType & "<", 1) + Next + If Not $oProfile.Options.PhyTypes.Count Then $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}[[:print:][:space:]]{0,}\r", "", 1) + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}<[^\r]{0,}\r", "", 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.Enabled, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.AuthMode, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.AuthPeriod, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.CacheUserData, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.HeldPeriod, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.MaxAuthFailures, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.MaxStart, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.StartPeriod, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.SuppMode, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.SSO.Type, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.SSO.MaxDelay, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.SSO.AllowMoreDialogs, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.OneX.SSO.UserBasedVLAN, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.PMK.CacheEnabled, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.PMK.CacheTTL, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.PMK.CacheSize, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.PMK.PreAuthEnabled, 1) + $sProfile = StringReplace($sProfile, "", "" & $oProfile.PMK.PreAuthThrottle, 1) + $sProfile = StringReplace($sProfile, '/WLAN/profile/v2">', '/WLAN/profile/v2">' & $oProfile.FIPS.Enabled) + If $oProfile.EAP.Blob Then + $sProfile = StringRegExpReplace($sProfile, "", "" & $oProfile.EAP.Blob) + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}]{0,}>([^\r]{0,}\r){2}", "") + EndIf + $sProfile = StringReplace($sProfile, "", "0") + $sProfile = StringReplace($sProfile, "<", "" & $oProfile.EAP.BaseType & "<", 1) + $sProfile = StringReplace($sProfile, "<", "" & StringLeft($oProfile.EAP.Type, 2) & "<", 1) + $sProfile = StringReplace($sProfile, "<", "" & StringRight($oProfile.EAP.Type, 2) & "<", 1) + If $oProfile.OneX.Enabled == "false" Or $oProfile.EAP.Blob Then Return StringRegExpReplace($sProfile, "\n[^>]{0,}><[^\r]{0,}\r", "") + + $sProfile = StringReplace($sProfile, "msPeap:DisableUserPromptForServerValidation><", "msPeap:DisableUserPromptForServerValidation>" & $oProfile.EAP.PEAP.ServerValidation.NoUserPrompt & "<", 1) + $sProfile = StringReplace($sProfile, "msPeap:ServerNames><", "msPeap:ServerNames>" & $oProfile.EAP.PEAP.ServerValidation.ServerNames & "<", 1) + For $sThumbprint In $oProfile.EAP.PEAP.ServerValidation.Thumbprints + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}<[^\r]{0,}\r", "\0\0", 1) + $sProfile = StringReplace($sProfile, "TrustedRootCA><", "TrustedRootCA>" & $sThumbprint & "<", 1) + Next + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}<[^\r]{0,}\r", "", 1) + $sProfile = StringReplace($sProfile,"msPeapV2:PerformServerValidation><", "msPeapV2:PerformServerValidation>" & $oProfile.EAP.PEAP.ServerValidation.Enabled & "<") + $sProfile = StringReplace($sProfile,"msPeapV2:AcceptServerName><", "msPeapV2:AcceptServerName>" & $oProfile.EAP.PEAP.ServerValidation.AcceptServerNames & "<") + $sProfile = StringReplace($sProfile, "<", "" & $oProfile.EAP.PEAP.FastReconnect & "<", 1) + $sProfile = StringReplace($sProfile, "<", "false<", 1) + $sProfile = StringReplace($sProfile, "<", "" & $oProfile.EAP.PEAP.QuarantineChecks & "<", 1) + $sProfile = StringReplace($sProfile, "<", "" & $oProfile.EAP.PEAP.RequireCryptoBinding & "<", 1) + $sProfile = StringReplace($sProfile, "<", "" & $oProfile.EAP.PEAP.EnableIdentityPrivacy & "<", 1) + $sProfile = StringReplace($sProfile, "<", "" & $oProfile.EAP.PEAP.AnonUsername & "<", 1) + + $sProfile = StringReplace($sProfile, "eapTls:DisableUserPromptForServerValidation><", "eapTls:DisableUserPromptForServerValidation>" & $oProfile.EAP.PEAP.TLS.ServerValidation.NoUserPrompt & "<", 1) + $sProfile = StringReplace($sProfile, "eapTls:ServerNames><", "eapTls:ServerNames>" & $oProfile.EAP.PEAP.TLS.ServerValidation.ServerNames & "<", 1) + For $sThumbprint In $oProfile.EAP.PEAP.TLS.ServerValidation.Thumbprints + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}<[^\r]{0,}\r", "\0\0", 1) + $sProfile = StringReplace($sProfile, "TrustedRootCA><", "TrustedRootCA>" & $sThumbprint & "<", 1) + Next + $sProfile = StringReplace($sProfile,"eapTlsV2:PerformServerValidation><", "eapTlsV2:PerformServerValidation>" & $oProfile.EAP.PEAP.TLS.ServerValidation.Enabled & "<") + $sProfile = StringReplace($sProfile,"eapTlsV2:AcceptServerName><", "eapTlsV2:AcceptServerName>" & $oProfile.EAP.PEAP.TLS.ServerValidation.AcceptServerNames & "<") + $sProfile = StringReplace($sProfile, "<", "" & $oProfile.EAP.PEAP.TLS.DiffUsername & "<", 1) + + $sProfile = StringReplace($sProfile, "eapTls:DisableUserPromptForServerValidation><", "eapTls:DisableUserPromptForServerValidation>" & $oProfile.EAP.TLS.ServerValidation.NoUserPrompt & "<", 1) + $sProfile = StringReplace($sProfile, "eapTls:ServerNames><", "eapTls:ServerNames>" & $oProfile.EAP.TLS.ServerValidation.ServerNames & "<", 1) + For $sThumbprint In $oProfile.EAP.TLS.ServerValidation.Thumbprints + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}<[^\r]{0,}\r", "\0\0", 1) + $sProfile = StringReplace($sProfile, "TrustedRootCA><", "TrustedRootCA>" & $sThumbprint & "<", 1) + Next + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}<[^\r]{0,}\r", "", 1) + $sProfile = StringReplace($sProfile,"eapTlsV2:PerformServerValidation><", "eapTlsV2:PerformServerValidation>" & $oProfile.EAP.TLS.ServerValidation.Enabled & "<") + $sProfile = StringReplace($sProfile,"eapTlsV2:AcceptServerName><", "eapTlsV2:AcceptServerName>" & $oProfile.EAP.TLS.ServerValidation.AcceptServerNames & "<") + $sProfile = StringReplace($sProfile, "<", "" & $oProfile.EAP.TLS.DiffUsername & "<", 1) + + If $oProfile.EAP.PEAP.TLS.Source = "Certificate Store" Or $oProfile.EAP.TLS.Source = "Certificate Store" Then + If $oProfile.EAP.TLS.Source = "Certificate Store" Then $sProfile = StringReplace($sProfile, "<", "" & $oProfile.EAP.TLS.SimpleCertSel & "<", 1) + If $oProfile.EAP.PEAP.TLS.Source = "Certificate Store" Then $sProfile = StringReplace($sProfile, "<", "" & $oProfile.EAP.PEAP.TLS.SimpleCertSel & "<", 1) + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}<[^\r]{0,}\r", "", 1) + ElseIf $oProfile.EAP.PEAP.TLS.Source = "Smart Card" Or $oProfile.EAP.TLS.Source = "Smart Card" Then + $sProfile = StringReplace($sProfile, "", "", 1) + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}[[:print:][:space:]]{0,}\r", "", 1) + EndIf + + $sProfile = StringReplace($sProfile, "<", "" & $oProfile.EAP.PEAP.MSCHAP.UseWinLogonCreds & "<", 1) + + $sProfile = StringRegExpReplace($sProfile, "\n[^>]{0,}><[^\r]{0,}\r", "") + $sProfile = StringRegExpReplace($sProfile, "\n[^:]{0,}:ServerValidation>\r[[:space:]]{0,}[^:]{0,}:ServerValidation>\r", "") + $sProfile = StringRegExpReplace($sProfile, "\n[^:]{0,}:IdentityPrivacy>\r[[:space:]]{0,}[^:]{0,}:IdentityPrivacy>\r", "") + $sProfile = StringRegExpReplace($sProfile, "\n[^:]{0,}:PeapExtensions>\r[[:space:]]{0,}[^:]{0,}:PeapExtensions>\r", "") + $sProfile = StringRegExpReplace($sProfile, "\n[^<]{0,}\r[[:space:]]{0,}[^<]{0,}\r", "") + Return $sProfile +EndFunc + +; #INTERNAL_USE_ONLY# =========================================================================================================== +; Name...........: _Wlan_GenerateXMLUserData +; Description ...: Generates XML EAP user data from a user data object. +; Syntax.........: _Wlan_GenerateXMLUserData($oUserData) +; Parameters ....: $oUserData - A user data object +; Return values .: Success - A string containing the XML user data. +; Failure - False +; @Error +; |0 - No error. +; |4 - Invalid parameter. +; Author ........: MattyD +; Modified.......: +; Remarks .......: +; Related .......: +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_GenerateXMLUserData($oUserData) + If Not IsObj($oUserData) Then Return SetError(4, 0, False) + + Local Const $sEL_BASE_START = 'EapHostUserCredentials xmlns="http://www.microsoft.com/provisioning/EapHostUserCredentials"' & @CRLF & _ + 'xmlns:eapCommon="http://www.microsoft.com/provisioning/EapCommon"+|EapMethod+|eapCommon:Type|eapCommon:AuthorId|-|' + Local Const $sEL_CREDS_START = 'Credentials xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapUserPropertiesV1"' & @CRLF & _ + 'xmlns:MsPeap="http://www.microsoft.com/provisioning/MsPeapUserPropertiesV1"' & @CRLF & _ + 'xmlns:eapTls="http://www.microsoft.com/provisioning/EapTlsUserPropertiesV1"' & @CRLF & _ + 'xmlns:MsChapV2="http://www.microsoft.com/provisioning/MsChapV2UserPropertiesV1"+|' + Local Const $sEL_PEAP_START = 'baseEap:Eap+|baseEap:Type|MsPeap:EapType+|MsPeap:RoutingIdentity|' + Local Const $sEL_TLS = 'baseEap:Eap+|baseEap:Type|eapTls:EapType+|eapTls:Username|eapTls:UserCert|-|-|' + Local Const $sEL_MSCHAP = 'baseEap:Eap+|baseEap:Type|MsChapV2:EapType+|MsChapV2:Username|MsChapV2:Password|MsChapV2:LogonDomain|-|-|' + Local Const $sEL_PEAP_END = '-|-|' + Local Const $sEL_CREDS_END = '-|' + Local Const $sEL_BASE_END = 'CredentialsBlob|-' + + Local $sEl_Start = $sEL_BASE_START + Local $sEl_End = $sEL_BASE_END + Local $sUserData = '' & @CRLF, $avStack[1] = [-1], $asElements + + With $oUserData + If .BaseType = "TLS" Then .BaseType = "13" + If .BaseType = "PEAP" Then .BaseType = "25" + If .Type = "TLS" Then .Type = "13" + If .Type = "PEAP-TLS" Then .Type = "2513" + If .Type = "PEAP-MSCHAP" Then .Type = "2526" + If .TLS.Domain Then .TLS.Username = .TLS.Domain & "\" & .TLS.Username + If .PEAP.TLS.Domain Then .PEAP.TLS.Username = .PEAP.TLS.Domain & "\" & .PEAP.TLS.Username + .Blob = String(.Blob) + EndWith + + If Not $oUserData.Blob Then + $sEl_Start &= $sEL_CREDS_START + $sEl_End = $sEL_CREDS_END & $sEl_End + + If StringInStr($oUserData.Type, "25") Then + $sEl_Start &= $sEL_PEAP_START + $sEl_End = $sEL_PEAP_END & $sEl_End + EndIf + + If StringInStr($oUserData.Type, "13") Then $sEl_Start &= $sEL_TLS + If StringInStr($oUserData.Type, "26") Then $sEl_Start &= $sEL_MSCHAP + EndIf + + $asElements = StringSplit($sEl_Start & $sEl_End, "|") + For $i = 1 To UBound($asElements) - 1 + If StringInStr($asElements[$i], @CRLF) Then + For $j = 0 To $avStack[0] + $asElements[$i] = StringReplace($asElements[$i], @CRLF, @CRLF & @TAB) + Next + EndIf + If StringInStr($asElements[$i], "+") Then + $sUserData &= "<" & StringReplace($asElements[$i], "+", "") & ">" & @CRLF + Redim $avStack[Ubound($avStack) + 1] + $avStack[Ubound($avStack) - 1] = StringReplace($asElements[$i], "+", "") + $avStack[0] += 1 + ElseIf $asElements[$i] == "-" Then + $sUserData &= "]{0,}", "") & ">" & @CRLF + Redim $avStack[Ubound($avStack) - 1] + Else + $sUserData &= "<" & $asElements[$i] & ">]{0,}", "") & ">" & @CRLF + EndIf + If $i < UBound($asElements) - 1 And $asElements[$i + 1] == "-" Then $avStack[0] -= 1 + For $j = 0 To $avStack[0] + $sUserData &= " " + Next + Next + + $sUserData = StringReplace($sUserData, "", "" & $oUserData.Blob) + $sUserData = StringReplace($sUserData, "", "" & $oUserData.BaseType) + $sUserData = StringReplace($sUserData, "<", "" & StringLeft($oUserData.Type, 2) & "<", 1) + $sUserData = StringReplace($sUserData, "<", "" & StringRight($oUserData.Type, 2) & "<", 1) + $sUserData = StringReplace($sUserData, "", "0") + $sUserData = StringReplace($sUserData, "", "" & $oUserData.PEAP.Username) + If $oUserData.PEAP.TLS.Username Then $sUserData = StringReplace($sUserData, "", "" & $oUserData.PEAP.TLS.Username) + If $oUserData.PEAP.TLS.Cert Then $sUserData = StringReplace($sUserData, "", "" & $oUserData.PEAP.TLS.Cert) + If $oUserData.TLS.Username Then $sUserData = StringReplace($sUserData, "", "" & $oUserData.TLS.Username) + If $oUserData.TLS.Cert Then $sUserData = StringReplace($sUserData, "", "" & $oUserData.TLS.Cert) + $sUserData = StringReplace($sUserData, "", "" & $oUserData.PEAP.MSCHAP.Username) + $sUserData = StringReplace($sUserData, "", "" & $oUserData.PEAP.MSCHAP.Password) + $sUserData = StringReplace($sUserData, "", "" & $oUserData.PEAP.MSCHAP.Domain) + + $sUserData = StringRegExpReplace($sUserData, "\n[^>]{0,}><[^\r]{0,}\r", "") + + Return $sUserData +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_GetInterfaceCapability +; Description ...: Retrieves the capabilities of an interface. +; Syntax.........: _Wlan_GetInterfaceCapability() +; Parameters ....: +; Return values .: Success - An list of capability indications. +; |$avIntCapability[$iIndex][0] - Type of interface +; |$avIntCapability[$iIndex][1] - Indicates whether 802.11d is supported +; |$avIntCapability[$iIndex][2] - Maximum size of the SSID list +; |$avIntCapability[$iIndex][3] - Maximum size of the DSSID list +; |$avIntCapability[$iIndex][4 to n] - Supported PHY types +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |3 - There is no data to return. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; As the order of phy types is the same though all functions, a returned Phy index of 0 refers to the element at $avIntCapability[$iIndex][4] +; Related .......: +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_GetInterfaceCapability() + Local $pIntCapability, $tIntCapability, $iNoPhyTypes + $pIntCapability = _WinAPI_WlanGetInterfaceCapability($hClientHandle, $pGUID) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanGetInterfaceCapability")) + + $tIntCapability = DllStructCreate("dword Type; dword Dot11d; dword MaxSSIDList; dword MaxBSSIDList; dword NoPhyTypes", $pIntCapability) + $iNoPhyTypes = DllStructGetData($tIntCapability, "NoPhyTypes") + Local $avIntCapability[4 + $iNoPhyTypes] + $avIntCapability[0] = _Wlan_EnumToString("WLAN_INTERFACE_TYPE", DllStructGetData($tIntCapability, "Type")) + $avIntCapability[1] = "802.11d Unsupported" + If DllStructGetData($tIntCapability, "Dot11d") Then $avIntCapability[1] = "802.11d Supported" + $avIntCapability[2] = DllStructGetData($tIntCapability, "MaxSSIDList") & " SSID(s) Supported" + $avIntCapability[3] = DllStructGetData($tIntCapability, "MaxBSSIDList") & " BSSID(s) Supported" + $tIntCapability = DllStructCreate("dword PhyType[" & $iNoPhyTypes & "]", Ptr(Number($pIntCapability) + 20)) + For $i = 1 To $iNoPhyTypes + $avIntCapability[$i + 3] = _Wlan_EnumToString("DOT11_PHY_TYPE", DllStructGetData($tIntCapability, "PhyType", $i)) + Next + + _WinAPI_WlanFreeMemory($pIntCapability) + Return $avIntCapability +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_GetNetworkInfo +; Description ...: Retrieves list of BSSs found by an interface. +; Syntax.........: _Wlan_GetNetworkInfo($sSSID = "", $iBSSType = $DOT11_BSS_TYPE_INFRASTRUCTURE, $fSecured = True) +; Parameters ....: $sSSID - If specified, only BSS entries associated with the SSID are returned. +; $iBSSType - The BSS type of the network. +; |0 - Return both Infrastuctre and Ad Hoc entries +; |$DOT11_BSS_TYPE_INFRASTRUCTURE (1) - Return only Infrastuctre entries +; |$DOT11_BSS_TYPE_INDEPENDENT (2) - Return only Ad Hoc entries +; $fSecured - a Boolean that indicates whether security is enabled on the specified network. +; Return values .: Success - An array of BSS entries +; |$asBSSList[$iIndex][0] - The Phy index of the radio that detected the entry on the interface. +; |$asBSSList[$iIndex][1] - The broadcasted SSID +; |$asBSSList[$iIndex][2] - The MAC address of the BSS (BSSID) +; |$asBSSList[$iIndex][3] - Capability flags +; (ESS) - Infrastructure network +; (IBSS) - Ad Hoc network +; (Pollable) - Indicates the AP or peer station is pollable +; (PollReq) - Indicates how the AP or peer station handles poll requests +; (Priv) - Indicates the network is secured +; |$asBSSList[$iIndex][4] - BSS Type (Infratructure or Ad Hoc) +; |$asBSSList[$iIndex][5] - Radio type +; Unknown/Any Phy Type - Unknown radio type +; a - Orthogonal frequency-division multiplexing (802.11a) +; b - High-rate direct-sequence spread spectrum (802.11b >= 5.5 Mbps) +; g - Extended-rate PHY (802.11g) +; n - High throughput (802.11n) +; b* - Direct-sequence spread spectrum (802.11b < 5.5 Mbps) +; Bluetooth - Frequency-hopping spread spectrum (Bluetooth) +; legacy - Infrared baseband (Legacy 802.11) +; IHV Phy Type (n) - Independant hardware vendor type n +; $asBSSList[$iIndex][6] - Signal strength (0-100) +; $asBSSList[$iIndex][7] - Received signal strength indicator (RSSI), in decibels referenced to 1.0 milliwatts (dBm) +; $asBSSList[$iIndex][8] - Channel +; $asBSSList[$iIndex][9] - Channel center frequency, in gigahertz (GHz) +; $asBSSList[$iIndex][10] - Beacon period, in 1024 microsecond time units +; $asBSSList[$iIndex][11] - Supported data transfer rates, in megabytes per second (Mbps) +; $asBSSList[$iIndex][12] - Specifies if operation is within the regulatory domain as identified by the country/region (Unknown/In Regulatory Domain or Not In Regulatory Domain) +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |3 - There is no data to return. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; If $sSSID is not secified, $fSecured is ignored. +; If $sSSID is specified, $iBSSType must not be 0. +; Extra profiles in the list included by specifying API flags on input are not affected by the UDFs "Filter" flag. +; Related .......: _Wlan_GetNetworks +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_GetNetworkInfo($sSSID = "", $iBSSType = $DOT11_BSS_TYPE_INFRASTRUCTURE, $fSecured = True) + Local $tSSID, $pSSID, $pBSSList, $tBSSList, $pBSSEntry, $tBSSEntry, $iItems, $vData + + If $sSSID Then + $tSSID = DllStructCreate("dword;char[32]") + DllStructSetData($tSSID, 1, StringLen($sSSID)) + DllStructSetData($tSSID, 2, $sSSID) + $pSSID = DllStructGetPtr($tSSID) + EndIf + + $pBSSList = _WinAPI_WlanGetNetworkBssList($hClientHandle, $pGUID, $pSSID, $iBSSType, $fSecured) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanGetNetworkBssList")) + + $tBSSList = DllStructCreate("dword Size; dword Count", $pBSSList) + + $iItems = DllStructGetData($tBSSList, 2) + If Not $iItems Then + _WinAPI_WlanFreeMemory($pBSSList) + Return SetError(3, 0, False) + EndIf + + Local $asBSSList[$iItems][13] + For $i = 0 To $iItems - 1 + $pBSSEntry = Ptr($i * 360 + Number($pBSSList) + 8) + + $tBSSEntry = DllStructCreate("dword SSIDLen; char SSID[32]; long PhyID; byte BSSID[6]; dword BSSType; dword PHYType; long RSSI; long LinkQ; byte InRegDomain; " & _ + "short BeaconPeriod; uint64 TimeStamp; uint64 HostTimeStamp; short Capability; long ChCtrFQ; long RateSetLen; short RateSet[126]; long IEOffset; long IESize", $pBSSEntry) + + ;Local $tBinDump = DllStructCreate("byte[360]", $pBSSEntry) + ;ConsoleWrite(DllStructGetData($tBinDump, 1) & @CRLF) + + $asBSSList[$i][0] = DllStructGetData($tBSSEntry, "PhyID") + $asBSSList[$i][1] = DllStructGetData($tBSSEntry, "SSID") + $asBSSList[$i][2] = _Wlan_bMacToString(DllStructGetData($tBSSEntry, "BSSID")) + + $vData = DllStructGetData($tBSSEntry, "Capability") + If BitAND($vData, 1) Then $asBSSList[$i][3]&= "(ESS)" + If BitAND($vData, 2) Then $asBSSList[$i][3] &= "(IBSS)" + If BitAND($vData, 4) Then $asBSSList[$i][3] &= "(Pollable)" + If BitAND($vData, 8) Then $asBSSList[$i][3] &= "(PollReq)" + If BitAND($vData, 16) Then $asBSSList[$i][3] &= "(Priv)" + ;$asBSSList[$i][3] &= $vData + + $asBSSList[$i][4] = _Wlan_EnumToString("DOT11_BSS_TYPE", DllStructGetData($tBSSEntry, "BSSType")) + $asBSSList[$i][5] = _Wlan_EnumToString("DOT11_PHY_TYPE", DllStructGetData($tBSSEntry, "PHYType")) + $asBSSList[$i][6] = DllStructGetData($tBSSEntry, "LinkQ") + $asBSSList[$i][7] = DllStructGetData($tBSSEntry, "RSSI") + $asBSSList[$i][8] = DllStructGetData($tBSSEntry, "ChCtrFQ") + $asBSSList[$i][9] = $asBSSList[$i][8] / 1000000 + + Switch $asBSSList[$i][8] + Case 2412000 + $asBSSList[$i][8] = 1 + Case 2417000 + $asBSSList[$i][8] = 2 + Case 2422000 + $asBSSList[$i][8] = 3 + Case 2427000 + $asBSSList[$i][8] = 4 + Case 2432000 + $asBSSList[$i][8] = 5 + Case 2437000 + $asBSSList[$i][8] = 6 + Case 2442000 + $asBSSList[$i][8] = 7 + Case 2447000 + $asBSSList[$i][8] = 8 + Case 2452000 + $asBSSList[$i][8] = 9 + Case 2457000 + $asBSSList[$i][8] = 10 + Case 2462000 + $asBSSList[$i][8] = 11 + Case 2467000 + $asBSSList[$i][8] = 12 + Case 2472000 + $asBSSList[$i][8] = 13 + Case 2484000 + $asBSSList[$i][8] = 14 + Case 5180000 + $asBSSList[$i][8] = 36 + Case 5200000 + $asBSSList[$i][8] = 40 + Case 5220000 + $asBSSList[$i][8] = 44 + Case 5240000 + $asBSSList[$i][8] = 48 + Case 5260000 + $asBSSList[$i][8] = 52 + Case 5280000 + $asBSSList[$i][8] = 56 + Case 5300000 + $asBSSList[$i][8] = 60 + Case 5320000 + $asBSSList[$i][8] = 64 + Case 5500000 + $asBSSList[$i][8] = 100 + Case 5520000 + $asBSSList[$i][8] = 104 + Case 5540000 + $asBSSList[$i][8] = 108 + Case 5560000 + $asBSSList[$i][8] = 112 + Case 5580000 + $asBSSList[$i][8] = 116 + Case 5600000 + $asBSSList[$i][8] = 120 + Case 5620000 + $asBSSList[$i][8] = 124 + Case 5640000 + $asBSSList[$i][8] = 128 + Case 5660000 + $asBSSList[$i][8] = 132 + Case 5680000 + $asBSSList[$i][8] = 136 + Case 5700000 + $asBSSList[$i][8] = 140 + Case 5745000 + $asBSSList[$i][8] = 149 + Case 5765000 + $asBSSList[$i][8] = 153 + Case 5785000 + $asBSSList[$i][8] = 157 + Case 5805000 + $asBSSList[$i][8] = 161 + Case 5825000 + $asBSSList[$i][8] = 165 + EndSwitch + + $asBSSList[$i][10] = DllStructGetData($tBSSEntry, "BeaconPeriod") + + For $j = 1 To DllStructGetData($tBSSEntry, "RateSetLen") + $asBSSList[$i][11] &= BitAND(DllStructGetData($tBSSEntry, "RateSet", $j), 0x77F) * 0.5 & "," + Next + $asBSSList[$i][11] = StringTrimRight($asBSSList[$i][11], 1) + + If DllStructGetData($tBSSEntry, "InRegDomain") Then + $asBSSList[$i][12] = "Unknown/In Regulatory Domain" + Else + $asBSSList[$i][12] = "Not In Regulatory Domain" + EndIf + + ;$asBSSList[$i][13] = DllStructGetData($tBSSEntry, "TimeStamp");, 1) & "," & DllStructGetData($tBSSEntry, "TimeStamp", 2) + ;$asBSSList[$i][14] = DllStructGetData($tBSSEntry, "HostTimeStamp");, 1) & "," & DllStructGetData($tBSSEntry, "HostTimeStamp", 2) + ;$asBSSList[$i][15] = DllStructGetData($tBSSEntry, "IEOffset") + ;$asBSSList[$i][16] = DllStructGetData($tBSSEntry, "IESize") + Next + + _WinAPI_WlanFreeMemory($pBSSList) + Return $asBSSList +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_GetNetworks +; Description ...: Retrieves the list of available networks on an interface. +; Syntax.........: _Wlan_GetNetworks($fScan = False, $iFlags = 0, $iUDFFlags = 1) +; Parameters ....: $fScan - If True the function will initiate a scan and wait for its completion before returning a list of networks. +; $iFlags - Provides flags to the API about what to return. +; |0 - Return all found infratsucture and ad-hoc networks and add etries for their corresponding profiles. +; |1 - Include all ad hoc profiles in the list even if they cannot be found. +; |2 - Include all "manual" profiles in the list that are marked to connect if the SSID is not bradcasting. +; $iUDFFlags - Provides options to make the returned list more relevant. +; |0 - Leave the list as provided by the API. +; |1 - Filter out entries that have a corresponding profile already listed. +; |2 - Modify the authentication and encryption fields of a profile entry if they conflict with the detected network. +; Return values .: Success - An array of available networks +; |$asNetworks[$iIndex][0] - Profile name +; |$asNetworks[$iIndex][1] - SSID of the network +; |$asNetworks[$iIndex][2] - Network type (Infratructure or Ad Hoc) +; |$asNetworks[$iIndex][3] - Connectability (Connectable or Not Connectable) +; |$asNetworks[$iIndex][4] - The reason why the network is not connectable +; |$asNetworks[$iIndex][5] - Signal strength (0-100) +; |$asNetworks[$iIndex][6] - Security status (Security Enabled Or Security Disabled) +; |$asNetworks[$iIndex][7] - Authentication method +; |$asNetworks[$iIndex][8] - Encryption method +; |$asNetworks[$iIndex][9] - Flags +; C - The interface is currently connected to this network +; P - This is a profile entry +; U - The profile for this network is a per-user profile +; |$asNetworks[$iIndex][10] - Number of BSSIDs associated with the Network +; |$asNetworks[$iIndex][11] - Information on the radio types listed +; |$asNetworks[$iIndex][12] - The radio types of network +; |$asNetworks[$iIndex][13] - UDF Flags +; number - The associated profile entry can be found at this index +; C - There is a authentication and/or encryption conflict between the profile and what was detected from the network. +; M - The authentication and/or encryption fields of the entry have been modified to coincide with the detected network. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |3 - There is no data to return. +; |6 - Then notification module is not running. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; Flags on the input can be combined to specify multiple options. +; Extra profiles in the list included by specifying API flags on input are not affected by the UDFs "Filter" flag. +; Related .......: _Wlan_Scan +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_GetNetworks($fScan = False, $iFlags = 0, $iUDFFlags = 1) + Local $pNetwork, $tNetwork, $iItems + + If $fScan < 0 Or $fScan = Default Then $fScan = False + If $iFlags < 0 Or $fScan = Default Then $iFlags = 0 + If $iUDFFlags < 0 Or $fScan = Default Then $iUDFFlags = 1 + + If $fScan Then _Wlan_Scan(True) + If @error And @error <> 5 Then Return SetError(@error, @extended, False) + + $pNetwork = _WinAPI_WlanGetAvailableNetworkList($hClientHandle, $pGUID, $iFlags) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanGetAvailableNetworkList")) + + $tNetwork = DllStructCreate("dword Items", $pNetwork) + $iItems = DllStructGetData($tNetwork, "Items") + If Not $iItems Then + _WinAPI_WlanFreeMemory($pNetwork) + Return SetError(3, 0, False) + EndIf + + Local $asNetworks[$iItems][14], $pNetworkItem, $iData, $iFirstNet = -1, $iFiltered + + For $i = 0 To $iItems - 1 + $pNetworkItem = Ptr($i * 628 + Number($pNetwork) + 8) + + $tNetwork = DllStructCreate("wchar ProfName[256]; dword SSIDLen; char SSID[32]; dword BSSType; dword NoBSSIDs; dword Connectable; dword RsnCode; dword NoPhyTypes; " & _ + "dword PhyTypes[8]; dword MorePhyTypes; dword Signal; dword SecEnabled; dword Auth; dword Ciph; dword Flags", $pNetworkItem) + + $asNetworks[$i - $iFiltered][0] = DllStructGetData($tNetwork, "ProfName") + If $iFirstNet = -1 And $asNetworks[$i - $iFiltered][0] == "" Then $iFirstNet = $i - $iFiltered + + $asNetworks[$i - $iFiltered][1] = DllStructGetData($tNetwork, "SSID") + $asNetworks[$i - $iFiltered][2] = _Wlan_EnumToString("DOT11_BSS_TYPE", DllStructGetData($tNetwork, "BSSType")) + $asNetworks[$i - $iFiltered][3] = "Not Connectable" + If DllStructGetData($tNetwork, "Connectable") Then $asNetworks[$i - $iFiltered][3] = "Connectable" + $asNetworks[$i - $iFiltered][4] = _Wlan_ReasonCodeToString(DllStructGetData($tNetwork, "RsnCode")) + $asNetworks[$i - $iFiltered][5] = DllStructGetData($tNetwork, "Signal") + $asNetworks[$i - $iFiltered][6] = "Security Disabled" + If DllStructGetData($tNetwork, "SecEnabled") Then $asNetworks[$i - $iFiltered][6] = "Security Enabled" + $asNetworks[$i - $iFiltered][7] = _Wlan_EnumToString("DOT11_AUTH_ALGORITHM", DllStructGetData($tNetwork, "Auth")) + $asNetworks[$i - $iFiltered][8] = _Wlan_EnumToString("DOT11_CIPHER_ALGORITHM", DllStructGetData($tNetwork, "Ciph")) + $iData = DllStructGetData($tNetwork, "Flags") + $asNetworks[$i - $iFiltered][9] = "" + If BitAND($iData, $WLAN_AVAILABLE_NETWORK_CONNECTED) Then $asNetworks[$i - $iFiltered][9] &= "C" + If BitAND($iData, $WLAN_AVAILABLE_NETWORK_HAS_PROFILE) Then $asNetworks[$i - $iFiltered][9] &= "P" + If BitAND($iData, $WLAN_AVAILABLE_NETWORK_CONSOLE_USER_PROFILE) Then $asNetworks[$i - $iFiltered][9] &= "U" + $asNetworks[$i - $iFiltered][10] = DllStructGetData($tNetwork, "NoBSSIDs") & " BSSID(s)" + $asNetworks[$i - $iFiltered][11] = "All Phy Types Listed" + If DllStructGetData($tNetwork, "MorePhyTypes") Then $asNetworks[$i - $iFiltered][11] = ">8 Phy Types Exist" + $iData = DllStructGetData($tNetwork, "NoPhyTypes") + $asNetworks[$i - $iFiltered][12] = "" + For $j = 1 To $iData + $asNetworks[$i - $iFiltered][12] &= _Wlan_EnumToString("DOT11_PHY_TYPE", DllStructGetData($tNetwork, "PhyTypes", $j)) & "," + Next + $asNetworks[$i - $iFiltered][12] = StringTrimRight($asNetworks[$i - $iFiltered][12], 1) + $asNetworks[$i - $iFiltered][13] = "" + $iData = 0 + For $j = 0 To $iFirstNet - 1 + If Not ($asNetworks[$i - $iFiltered][1] == $asNetworks[$j][1]) Then ContinueLoop + If $asNetworks[$i - $iFiltered][2] = $asNetworks[$j][2] And $asNetworks[$i - $iFiltered][6] = $asNetworks[$j][6] Then + $iData = 1 + $asNetworks[$i - $iFiltered][13] &= $j ;Corresponding profile here + If $asNetworks[$i - $iFiltered][7] <> $asNetworks[$j][7] Or $asNetworks[$i - $iFiltered][8] <> $asNetworks[$j][8] Then + $asNetworks[$i - $iFiltered][13] &= "C" ;Auth and or Cipher conflict. + $asNetworks[$j][13] &= "C" ;Auth and or Cipher conflict. + If BitAND($iUDFFlags, 2) Then + $asNetworks[$j][7] = $asNetworks[$i - $iFiltered][7] + $asNetworks[$j][8] = $asNetworks[$i - $iFiltered][8] + $asNetworks[$j][13] &= "M" ;Auth and or Cipher Modified. + EndIf + EndIf + EndIf + Next + If BitAND($iUDFFlags, 1) And $iData Then $iFiltered += 1 + Next + If BitAND($iUDFFlags, 1) Then ReDim $asNetworks[UBound($asNetworks) - $iFiltered][14] + _WinAPI_WlanFreeMemory($pNetwork) + Return $asNetworks +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_GetNotification +; Description ...: Retrieves notifications from cache. +; Syntax.........: _Wlan_GetNotification($fInterfaceFilter = True) +; Parameters ....: $fInterfaceFilter - If True the function will only return notifications from the selected interface +; Return values .: Success - a notification array +; |$avNotification[0] - The notification source. +; |$avNotification[1] - The notification code. +; |$avNotification[2] - The GUID of the interface to which the notification corresponds. +; |$avNotification[3] - A string representation of the notification. +; |$avNotification[4 to n] - notification data. +; Failure - none. +; @Error +; |0 - No error. +; |3 - There is no data to return. +; Author ........: MattyD +; Modified.......: +; Remarks .......: +; Related .......: _Wlan_StartNotificationModule +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_GetNotification($fInterfaceFilter = True) + Sleep(20) + Local $sNotification, $avNotification + For $i = 1 To UBound($asNotificationCache) - 1 + If TimerDiff($asNotificationCache[$i][0]) <= $iNotifKeepTime Then + $sNotification = $asNotificationCache[$i][1] + $asNotificationCache[$i][0] -= TimerInit() + ExitLoop + EndIf + Next + If Not $sNotification Then Return SetError(3, 0, "") + + $avNotification = StringSplit($sNotification, ",", 2) + If $fInterfaceFilter Then + If $avNotification[2] <> _Wlan_pGUIDToString($pGUID) Then Return SetError(3, 0, "") + EndIf + Return($avNotification) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_GetProfile +; Description ...: Starts the notification module. +; Syntax.........: _Wlan_GetProfile($sProfileName, ByRef $iFlags, $fXML = False) +; Parameters ....: $sProfileName - The name of the profile to retrieve. +; $iFlags - Provides additional information about the request. (Vista, 2008 and up) +; |$WLAN_PROFILE_GET_PLAINTEXT_KEY - (input) If the caller has the apropriate privlages, the key material is returned unencrypted. (7, 2008 R2 and up) +; |$WLAN_PROFILE_GROUP_POLICY - (output) The profile was created by group policy. +; |$WLAN_PROFILE_USER - (output) The profile is a per-user profile. +; $fXML - Specifies the format of the returned profile. +; |True - Return the profile in XML format. +; |False - Return a profile object. (see _Wlan_GenerateXMLProfile) +; Return values .: Success - The profile in the specified format. +; @extended - The access mask of the all user profile. (Use BitAnd to test the level of access) +; |$WLAN_READ_ACCESS - The user can view the contents of the profile. +; |$WLAN_EXECUTE_ACCESS - The user has read access, and the user can also connect to and disconnect from a network using the profile. +; |$WLAN_WRITE_ACCESS - The user has execute access and the user can also modify the content of the profile or delete the profile. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |6 - A dependency is missing. (@extended - _AutoItObject_Create error code.) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; Windows XP always returns an unprotected key, Vista and server 2008 always returns an protected key. +; If the calling process is running in the context of the LocalSystem account, a key can be unencrypted using _Wlan_DecryptKey. +; Related .......: _Wlan_SetProfile _Wlan_DecryptKey +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_GetProfile($sProfileName, ByRef $iFlags, $fXML = False) + Local $oProfile, $sProfile, $tFlags, $iPermissions + $tFlags = DllStructCreate("dword Flags") + DllStructSetData($tFlags, "Flags", $iFlags) + + $sProfile = _WinAPI_WlanGetProfile($hClientHandle, $pGUID, $sProfileName, DllStructGetPtr($tFlags)) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanGetProfile")) + $iPermissions = @extended + + $iFlags = DllStructGetData($tFlags, "Flags") + If $fXML Then Return SetExtended($iPermissions, $sProfile) + + $oProfile = _Wlan_GenerateProfileObject($sProfile) + Return SetExtended($iPermissions, $oProfile) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_GetProfileList +; Description ...: Retrieves the list of profiles in preference order. +; Syntax.........: _Wlan_GetProfileList($fExteded = False) +; Parameters ....: +; Return values .: Success - An array of profiles. +; If $fExteded = False: +; $asProfileList[$iIndex] - Profile name +; If $fExteded = True: +; |$asProfileListEx[$iIndex][0] - Profile name +; |$asProfileListEx[$iIndex][1] - Flags (Vista, 2008 and up) +; G - The profile is a group policy profile +; U - The profile is a per-user profile +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |3 - There is no data to return. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; Related .......: _Wlan_SetProfileList _Wlan_SetProfilePosition +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_GetProfileList($fExteded = False) + Local $pProfileList, $tProfileList, $iItems + $pProfileList = _WinAPI_WlanGetProfileList($hClientHandle, $pGUID) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanGetProfileList")) + + $tProfileList = DllStructCreate("dword Items", $pProfileList) + $iItems = DllStructGetData($tProfileList, "Items") + If Not $iItems Then + _WinAPI_WlanFreeMemory($pProfileList) + Return SetError(3, 0, "") + EndIf + + Local $asProfileList[$iItems], $asProfileListEx[$iItems][2], $pProfile + For $i = 0 To $iItems - 1 + $pProfile = Ptr($i * 516 + Number($pProfileList) + 8) + $tProfileList = DllStructCreate("wchar Name[256]; dword Flags", $pProfile) + $asProfileListEx[$i][0] = DllStructGetData($tProfileList, "Name") + $asProfileList[$i] = $asProfileListEx[$i][0] + If BitAND(DllStructGetData($tProfileList, "Flags"), $WLAN_PROFILE_GROUP_POLICY) Then $asProfileListEx[$i][1] &= "G" + If BitAND(DllStructGetData($tProfileList, "Flags"), $WLAN_PROFILE_USER) Then $asProfileListEx[$i][1] &= "U" + Next + + _WinAPI_WlanFreeMemory($pProfileList) + If $fExteded Then Return $asProfileListEx + Return $asProfileList +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_HNInitialise +; Description ...: Initialises settings for the Hosted Network. +; Syntax.........: _Wlan_HNInitialise(ByRef $sReason, $sSSID = "", $sPassword = "", $fPersistentKey = False, $iMaxPeers = 100) +; Parameters ....: $sReason - Provides a reason why the function failed. (output) +; $sSSID - Specifies a desired SSID for the Hosted Network to use. +; $sPassword - Specifies the desired secondary key (in a Pass Phrase format) for the Hosted Network to use. +; $fPersistentKey - Specifies if the secondary key should expire at the end of the session. +; $iMaxPeers - Specifies the maximum number of peers allowed to connect to the Hosted Network. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; This function is only supported from Windows 7 and Server 2008 R2. +; If $sSSID is not specified, and $iMaxPeers is ignored. +; If $sPassword is not specified, $fPersistentKey is ignored. +; This function should be called before calling any other Hosted network function. +; If need be, both the SSID and the secondary key can be changed later through _Wlan_HNSetProperty and _Wlan_HNSetSecondaryKey repectively. +; If in an Active state, this function will cause the Hosted network transition to an Idle state. +; If the Hosted Network is used for the first time and no SSID is specified, a random and readable SSID is generated and the maximum number of peers defaults to 100. +; If the Hosted Network is used for the first time, the operating system installs a virtual device if a capable wireless adapter is present. +; The virtual device is not present in the list returned by WlanEnumInterfaces. It is used as an Access Point and cannot connect to an existing network. +; The lifetime of the virtual device is tied to the physical wireless adapter. If the physical wireless adapter is disabled, this virtual device will be removed also. +; Related .......: _Wlan_HNStart _Wlan_HNSetProperty _Wlan_HNSetSecondaryKey +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_HNInitialise(ByRef $sReason, $sSSID = "", $sPassword = "", $fPersistentKey = False, $iMaxPeers = 100) + Local $iReasonCode, $iError, $iExtended + + _WinAPI_WlanHostedNetworkInitSettings($hClientHandle, $iReasonCode) + If @error Then + $iError = @error + $iExtended = @extended + If $iReasonCode Then $sReason = _Wlan_EnumToString("WLAN_HOSTED_NETWORK_REASON", $iReasonCode) + Return SetError($iError, $iExtended, _Wlan_ReportAPIError($iError, $iExtended, 0, @ScriptLineNumber, "_WinAPI_WlanHostedNetworkInitSettings")) + EndIf + + If $sSSID Then + _Wlan_HNSetProperty($WLAN_HOSTED_NETWORK_OPCODE_CONNECTION_SETTINGS, $sReason, $sSSID, $iMaxPeers) + If @error Then Return SetError(@error, @extended, False) + EndIf + + If $sPassword Then + _Wlan_HNSetSecondaryKey($sPassword, $sReason, True, $fPersistentKey) + If @error Then Return SetError(@error, @extended, False) + EndIf + + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_HNQueryProperty +; Description ...: Queries the current static properties of the wireless Hosted Network. +; Syntax.........: _Wlan_HNQueryProperty($iOpCode, ByRef $iValueType) +; Parameters ....: $iOpCode - A WLAN_HOSTED_NETWORK_OPCODE value to identify the property to be queried: +; |$WLAN_HOSTED_NETWORK_OPCODE_CONNECTION_SETTINGS +; |$WLAN_HOSTED_NETWORK_OPCODE_SECURITY_SETTINGS +; |$WLAN_HOSTED_NETWORK_OPCODE_STATION_PROFILE +; |$WLAN_HOSTED_NETWORK_OPCODE_ENABLE +; $iValueType - On output, A WLAN_OPCODE_VALUE_TYPE value that indicates the returned value type: +; |$WLAN_OPCODE_VALUE_TYPE_QUERY_ONLY +; |$WLAN_OPCODE_VALUE_TYPE_SET_BY_GROUP_POLICY +; |$WLAN_OPCODE_VALUE_TYPE_SET_BY_USER +; |$WLAN_OPCODE_VALUE_TYPE_INVALID +; Return values .: Success - Data +; $WLAN_HOSTED_NETWORK_OPCODE_CONNECTION_SETTINGS - The SSID associated with the wireless Hosted Network +; @extended - The maximum number of concurrent peers allowed by the wireless Hosted Network +; $WLAN_HOSTED_NETWORK_OPCODE_SECURITY_SETTINGS - The security settings on the wireless Hosted Network +; |$vData[0] - The authentication algorithm used by the wireless Hosted Network +; |$vData[1] - The cipher algorithm used by the wireless Hosted Network +; $WLAN_HOSTED_NETWORK_OPCODE_STATION_PROFILE - The XML profile for connecting to the wireless Hosted Network +; $WLAN_HOSTED_NETWORK_OPCODE_ENABLE - a boolean that indicates if wireless Hosted Network is enabled +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |4 - Invalid parameter. +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is only supported from Windows 7 and Server 2008 R2. +; Related .......: _Wlan_HNSetProperty +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_HNQueryProperty($iOpCode, ByRef $iValueType) + Local $iDataSz, $pData, $tData, $vData, $iExtended + + _WinAPI_WlanHostedNetworkQueryProperty($hClientHandle, $iOpCode, $iDataSz, $pData, $iValueType) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanHostedNetworkQueryProperty")) + + Switch $iOpCode + Case $WLAN_HOSTED_NETWORK_OPCODE_CONNECTION_SETTINGS + $tData = DllStructCreate("dword SSIDLen; char SSID[32]; dword MaxNoPeers", $pData) + $vData = DllStructGetData($tData, "SSID") + $iExtended = DllStructGetData($tData, "MaxNoPeers") + Case $WLAN_HOSTED_NETWORK_OPCODE_SECURITY_SETTINGS + Local $vData[2] + $tData = DllStructCreate("dword Auth; dword Ciph", $pData) + $vData[0] = _Wlan_EnumToString("DOT11_AUTH_ALGORITHM", DllStructGetData($tData, "Auth")) + $vData[1] = _Wlan_EnumToString("DOT11_CIPHER_ALGORITHM", DllStructGetData($tData, "Ciph")) + Case $WLAN_HOSTED_NETWORK_OPCODE_STATION_PROFILE + $tData = DllStructCreate("wchar[" & $iDataSz / 2 & "]", $pData) + $vData = DllStructGetData($tData, 1) + Case $WLAN_HOSTED_NETWORK_OPCODE_ENABLE + $tData = DllStructCreate("bool", $pData) + If DllStructGetData($tData, 1) Then + $vData = True + Else + $vData = False + EndIf + Case Else + Return SetError(4, 0, False) + EndSwitch + + Return SetExtended($iExtended, $vData) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_HNQuerySecondaryKey +; Description ...: Sets the secondary key that will be used by the wireless Hosted Network. +; Syntax.........: _Wlan_HNQuerySecondaryKey(ByRef $sReason) +; Parameters ....: $sReason - Provides a reason why the function failed. (output) +; Return values .: Success - An array containing information about the secondary key. +; |$asKeyData[0] - The key material +; |$asKeyData[1] - The key type (Pass Phrase or Network Key) +; |$asKeyData[2] - Indicates if the key should be stored after one session (Persistent Key or One Session Key) +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; This function is only supported from Windows 7 and Server 2008 R2. +; Once started, the wireless Hosted Network will allow wireless peers to associate with this secondary security key in addition to the primary security key. +; The secondary security key is always specified by the user as needed, while the primary security key is generated by the operating system with greater security strength. +; The secondary security key is usually set before the wireless Hosted Network is started. Then it will be used the next time when the Hosted Network is started. +; The primary key may be obtained through _Wlan_HNQueryProperty using the $WLAN_HOSTED_NETWORK_OPCODE_STATION_PROFILE opcode. +; Any user can set or query the secondary security key used in the Hosted Network. +; The ability to enable the wireless Hosted Network may be restricted by group policy in a domain. +; Related .......: _Wlan_HNSetSecondaryKey +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_HNQuerySecondaryKey(ByRef $sReason) + Local $tKey, $iKeyLength, $pKeyData, $fIsPassPhrase, $fPersistent, $iReasonCode, $iError, $iExtended, $asKeyData[3] + + _WinAPI_WlanHostedNetworkQuerySecondaryKey($hClientHandle, $iKeyLength, $pKeyData, $fIsPassPhrase, $fPersistent, $iReasonCode) + If @error Then + $iError = @error + $iExtended = @extended + If $iReasonCode Then $sReason = _Wlan_EnumToString("WLAN_HOSTED_NETWORK_REASON", $iReasonCode) + Return SetError($iError, $iExtended, _Wlan_ReportAPIError($iError, $iExtended, 0, @ScriptLineNumber, "_WinAPI_WlanHostedNetworkQuerySecondaryKey")) + EndIf + + $tKey = DllStructCreate("char[64]", $pKeyData) + $asKeyData[0] = DllStructGetData($tKey, 1) + + If $fIsPassPhrase Then + $asKeyData[1] = "Pass Phrase" + Else + $asKeyData[1] = "Network Key" + EndIf + + If $fPersistent Then + $asKeyData[2] = "Persistent Key" + Else + $asKeyData[2] = "One Session Key" + EndIf + + Return $asKeyData +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_HNQueryStatus +; Description ...: Queries the current status of the wireless Hosted Network. +; Syntax.........: _Wlan_HNQueryStatus() +; Parameters ....: +; Return values .: Success - An informational array. +; |$avHNStatus[0] - Hosted Network state (Unavailable, Idle or Active) +; |$avHNStatus[1] - The Device GUID used for the Hosted Network +; |$avHNStatus[2] - The BSSID (MAC Address) used by the Hosted Network +; |$avHNStatus[3] - The PHY type (Physical radio type) (typically a,b,g or n) +; |$avHNStatus[4] - The channel number +; |$avHNStatus[5] - The number of authenticated peers +; |$avHNStatus[n] - The peer MAC address +; |$avHNStatus[n + 1] - The peer authentication state (Authenticated) +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |3 - There is no data to return. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; This function is only supported from Windows 7 and Server 2008 R2. +; Currently the only peer authentication state is "Authenticated". +; Related .......: _Wlan_HNQueryProperty +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_HNQueryStatus() + Local $tHNStatus, $pHNStatus, $tPeerState, $pPeerState, $iItems + + $pHNStatus = _WinAPI_WlanHostedNetworkQueryStatus($hClientHandle) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanHostedNetworkQueryStatus")) + + $tHNStatus = DllStructCreate("dword HNState; byte GUID[16]; byte BSSID[6]; dword PHYType; ulong ChFreq; dword PeerCount", $pHNStatus) + $iItems = DllStructGetData($tHNStatus, "PeerCount") + + Local $avHNStatus[2 * $iItems + 6] + $avHNStatus[0] = _Wlan_EnumtoString("WLAN_HOSTED_NETWORK_STATE", DllStructGetData($tHNStatus, "HNState")) + $avHNStatus[1] = _Wlan_pGUIDToString(Ptr(Number($pHNStatus) + 4)) + $avHNStatus[2] = _Wlan_bMACtoString(DllStructGetData($tHNStatus, "BSSID")) + $avHNStatus[3] = _Wlan_EnumtoString("DOT11_PHY_TYPE", DllStructGetData($tHNStatus, "PHYType")) + $avHNStatus[4] = DllStructGetData($tHNStatus, "CHFreq") + $avHNStatus[5] = $iItems + + For $i = 0 To $iItems - 1 + $pPeerState = Ptr($i * 12 + Number($pHNStatus) + 40) + $tPeerState = DllStructCreate("byte PeerMAC[6]; dword PeerAuthState", $pPeerState) + $avHNStatus[2 * $i + 6] = _Wlan_bMACtoString(DllStructGetData($tPeerState, "PeerMAC")) + $avHNStatus[2 * $i + 7] = _Wlan_EnumtoString("WLAN_HOSTED_NETWORK_PEER_AUTH_STATE", DllStructGetData($tPeerState, "PeerAuthState")) + Next + + _WinAPI_WlanFreeMemory($pHNStatus) + Return $avHNStatus +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_HNRefreshPrimaryKey +; Description ...: Regenerates a primary key for the hosted network. +; Syntax.........: _Wlan_HNRefreshPrimaryKey(ByRef $sReason) +; Parameters ....: $sReason - Provides a reason why the function failed. (output) +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; This function is only supported from Windows 7 and Server 2008 R2. +; If in an active state, this fuction will cause the Hosted Network to transition to an Idle state. +; A primary key is always persistent. (does not expire after stopping the Hosted Network) +; The primary key can be obtained by calling _Wlan_HNQueryProperty with the $WLAN_HOSTED_NETWORK_OPCODE_STATION_PROFILE opcode. +; The secondary security key is always specified by the user as needed, while the primary security key is generated by the operating system with greater security strength. +; Related .......: _Wlan_HNSetSecondaryKey +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_HNRefreshPrimaryKey(ByRef $sReason) + Local $iReasonCode, $iError, $iExtended + + _WinAPI_WlanHostedNetworkRefreshSecuritySettings($hClientHandle, $iReasonCode) + If @error Then + $iError = @error + $iExtended = @extended + If $iReasonCode Then $sReason = _Wlan_EnumToString("WLAN_HOSTED_NETWORK_REASON", $iReasonCode) + Return SetError($iError, $iExtended, _Wlan_ReportAPIError($iError, $iExtended, 0, @ScriptLineNumber, "_WinAPI_WlanHostedNetworkRefreshSecuritySettings")) + EndIf + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_HNSetProperty +; Description ...: Sets static properties of the wireless Hosted Network. +; Syntax.........: _Wlan_HNSetProperty($iOpCode, ByRef $sReason, $vData, $iMaxPeers = 100) +; Parameters ....: $iOpCode - A WLAN_HOSTED_NETWORK_OPCODE value to identify the property to set (the expected data type of $vData in brackets): +; |WLAN_HOSTED_NETWORK_OPCODE_CONNECTION_SETTINGS (the SSID of the network to create) +; |WLAN_HOSTED_NETWORK_OPCODE_ENABLE (Boolean) +; $sReason - Provides a reason why the function failed. (output) +; $vData - See above. +; $iMaxPeers - The maximum number of concurrent peers allowed by the Hosted Network. This parameter is only valid when $iOpCode = WLAN_HOSTED_NETWORK_OPCODE_CONNECTION_SETTINGS. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |4 - Invalid parameter. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; This function is only supported from Windows 7 and Server 2008 R2. +; Related .......: _Wlan_HNQueryProperty +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_HNSetProperty($iOpCode, ByRef $sReason, $vData, $iMaxPeers = 100) + Local $tData, $iReasonCode, $iError, $iExtended + + Switch $iOpCode + Case $WLAN_HOSTED_NETWORK_OPCODE_CONNECTION_SETTINGS + $tData = DllStructCreate("dword SSIDLen; char SSID[32]; dword MaxNoPeers") + DllStructSetData($tData, "SSIDLen", StringLen($vData)) + DllStructSetData($tData, "SSID", $vData) + DllStructSetData($tData, "MaxNoPeers", $iMaxPeers) + Case $WLAN_HOSTED_NETWORK_OPCODE_ENABLE + $tData = DllStructCreate("bool") + If $vData Then + DllStructSetData($tData, 1, True) + Else + DllStructSetData($tData, 1, False) + EndIf + Case Else + Return SetError(4, 0, False) + EndSwitch + + _WinAPI_WlanHostedNetworkSetProperty($hClientHandle, $iOpCode, DllStructGetSize($tData), DllStructGetPtr($tData), $iReasonCode) + + If @error Then + $iError = @error + $iExtended = @extended + If $iReasonCode Then $sReason = _Wlan_EnumToString("WLAN_HOSTED_NETWORK_REASON", $iReasonCode) + Return SetError($iError, $iExtended, _Wlan_ReportAPIError($iError, $iExtended, 0, @ScriptLineNumber, "_WinAPI_WlanHostedNetworkSetProperty")) + EndIf + + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_HNSetSecondaryKey +; Description ...: Sets the secondary key that will be used by the wireless Hosted Network. +; Syntax.........: _Wlan_HNSetSecondaryKey($sKey, ByRef $sReason, $fIsPassPhrase = True, $fPersistent = False) +; Parameters ....: $sKey - The desired key material +; $sReason - Provides a reason why the function failed. (output) +; $fIsPassPhrase - A Boolean value that indicates if the key data is in passphrase format. +; $fPersistent - A Boolean value that indicates if the key should be stored after one session. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; This function is only supported from Windows 7 and Server 2008 R2. +; Once started, the wireless Hosted Network will allow wireless peers to associate with this secondary security key in addition to the primary security key. +; The secondary security key is always specified by the user as needed, while the primary security key is generated by the operating system with greater security strength. +; The secondary security key is usually set before the wireless Hosted Network is started. Then it will be used the next time when the Hosted Network is started. +; The primary key may be obtained through _Wlan_HNQueryProperty using the $WLAN_HOSTED_NETWORK_OPCODE_STATION_PROFILE opcode. +; Any user can set or query the secondary security key used in the Hosted Network. +; The ability to enable the wireless Hosted Network may be restricted by group policy in a domain. +; Related .......: _Wlan_HNQuerySecondaryKey _Wlan_HNRefreshPrimaryKey +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_HNSetSecondaryKey($sKey, ByRef $sReason, $fIsPassPhrase = True, $fPersistent = False) + Local $tKey, $iKeyLength, $iReasonCode, $iError, $iExtended + + $tKey = DllStructCreate("char[64]") + DllStructSetData($tKey, 1, $sKey) + + If $fIsPassPhrase Then + $iKeyLength = StringLen($sKey) + 1 + Else + $iKeyLength = StringLen($sKey) + EndIf + + _WinAPI_WlanHostedNetworkSetSecondaryKey($hClientHandle, $iKeyLength, DllStructGetPtr($tKey), $fIsPassPhrase, $fPersistent, $iReasonCode) + If @error Then + $iError = @error + $iExtended = @extended + If $iReasonCode Then $sReason = _Wlan_EnumToString("WLAN_HOSTED_NETWORK_REASON", $iReasonCode) + Return SetError($iError, $iExtended, _Wlan_ReportAPIError($iError, $iExtended, 0, @ScriptLineNumber, "_WinAPI_WlanHostedNetworkSetSecondaryKey")) + EndIf + + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_HNStart +; Description ...: Starts the wireless Hosted Network. +; Syntax.........: _Wlan_HNStart(ByRef $sReason, $fForce = False) +; Parameters ....: $sReason - Provides a reason why the function failed. (output) +; $fForce - If True the Hosted Network will start without associating the request with the application's calling handle. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; This function is only supported from Windows 7 and Server 2008 R2. +; This function should be preceded by _WlanHN_Init. +; Successful calls should be matched by calls to _Wlan_HNStop. If forced to start, the Hosted Network should also be forced to stop. +; If the Hosted Network was not forced to start, any state change caused by this function would be automatically undone when the process ends. +; If forced to start, the user (not the owner of the process) must have the appropriate associated privilege. +; Related .......: _Wlan_HNInitialise _Wlan_HNStop +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_HNStart(ByRef $sReason, $fForce = False) + Local $iReasonCode, $iError, $iExtended + If Not $fForce Then + _WinAPI_WlanHostedNetworkStartUsing($hClientHandle, $iReasonCode) + If @error Then + $iError = @error + $iExtended = @extended + If $iReasonCode Then $sReason = _Wlan_EnumToString("WLAN_HOSTED_NETWORK_REASON", $iReasonCode) + Return SetError($iError, $iExtended, _Wlan_ReportAPIError($iError, $iExtended, 0, @ScriptLineNumber, "_WinAPI_WlanHostedNetworkStartUsing")) + EndIf + Else + _WinAPI_WlanHostedNetworkForceStart($hClientHandle, $iReasonCode) + If @error Then + $iError = @error + $iExtended = @extended + If $iReasonCode Then $sReason = _Wlan_EnumToString("WLAN_HOSTED_NETWORK_REASON", $iReasonCode) + Return SetError($iError, $iExtended, _Wlan_ReportAPIError($iError, $iExtended, 0, @ScriptLineNumber, "_WinAPI_WlanHostedNetworkForceStart")) + EndIf + EndIf + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_HNStop +; Description ...: Stops the wireless Hosted Network. +; Syntax.........: _Wlan_HNStop(ByRef $sReason, $fForce = False) +; Parameters ....: $sReason - Provides a reason why the function failed. (output) +; $fForce - If True the Hosted Network will stop without associating the request with the application's calling handle. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; This function is only supported from Windows 7 and Server 2008 R2. +; If the Hosted Network is in the Idle state, this function will fail. +; If the Hosted Network was not forced to stop, any state change caused by this function would be automatically undone when the process ends. +; Related .......: _Wlan_HNStart +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_HNStop(ByRef $sReason, $fForce = False) + Local $iReasonCode, $iError, $iExtended + If Not $fForce Then + _WinAPI_WlanHostedNetworkStopUsing($hClientHandle, $iReasonCode) + If @error Then + $iError = @error + $iExtended = @extended + If $iReasonCode Then $sReason = _Wlan_EnumToString("WLAN_HOSTED_NETWORK_REASON", $iReasonCode) + Return SetError($iError, $iExtended, _Wlan_ReportAPIError($iError, $iExtended, 0, @ScriptLineNumber, "_WinAPI_WlanHostedNetworkStopUsing")) + EndIf + Else + _WinAPI_WlanHostedNetworkForceStop($hClientHandle, $iReasonCode) + If @error Then + $iError = @error + $iExtended = @extended + If $iReasonCode Then $sReason = _Wlan_EnumToString("WLAN_HOSTED_NETWORK_REASON", $iReasonCode) + Return SetError($iError, $iExtended, _Wlan_ReportAPIError($iError, $iExtended, 0, @ScriptLineNumber, "_WinAPI_WlanHostedNetworkForceStop")) + EndIf + EndIf + Return True +EndFunc + +; #INTERNAL_USE_ONLY# =========================================================================================================== +; Name...........: _Wlan_OnNotifHandler +; Description ...: Calls registered "On Notification" functions. +; Syntax.........: _Wlan_OnNotifHandler() +; Parameters ....: +; Return values .: Success - The value of the registered function. +; Failure - False or a blank string with @error set not to 0. +; Author ........: MattyD +; Modified.......: +; Remarks .......: +; Related .......: _Wlan_OnNotification _Wlan_CacheNotification +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_OnNotifHandler() + Local $avNotif = _Wlan_GetNotification(False) + If @error Then Return SetError(@error, @extended, $avNotif) + For $i = 0 To UBound($avOnNotif) - 1 + If $avNotif[0] = $avOnNotif[$i][0] And $avNotif[1] = $avOnNotif[$i][1] Then + If $avOnNotif[$i][2] And $avNotif[2] <> _Wlan_pGUIDToString($pGUID) Then ExitLoop + Return Execute($avOnNotif[$i][3] & "($avNotif)") + EndIf + Next + Return SetError(3, 0, False) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_OnNotification +; Description ...: Registers or deregisters a function to be called on the arrival of a notification. +; Syntax.........: _Wlan_OnNotification($iSource, $iNotif, $sFunction = "", $fInterfaceFilter = True) +; Parameters ....: $iSource - The notification source. +; $iNotif - The notification code. +; $sFunction - A string containing the function name to register, or an empty string ("") to deregister a function. +; $fInterfaceFilter - If True the registered function will only be called if the notification is associated with the selected interface. +; Return values .: Success - True +; Author ........: MattyD +; Modified.......: +; Remarks .......: Registered functions should be defined with one parameter to recieve a notification array. (see _Wlan_GetNotification) +; On notification functions should not be used in conjuntion with a _Wlan_GetNotification loop. +; If all functions are deregistered a _Wlan_GetNotification loop will become useable again. +; Related .......: _Wlan_GetNotification +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_OnNotification($iSource, $iNotif, $sFunction = "", $fInterfaceFilter = True) + Local $fAtten = False + For $i = 0 To UBound($avOnNotif) - 1 + If $iSource = $avOnNotif[$i][0] And $iNotif = $avOnNotif[$i][1] Then + If $sFunction Then ExitLoop + $fAtten = True + ElseIf $fAtten Then + For $j = 0 To 3 + $avOnNotif[$i - 1][$j] = $avOnNotif[$i][$j] + Next + EndIf + Next + + If $fAtten Then + If Not UBound($avOnNotif) - 1 Then + $fOnNotif = False + Else + ReDim $avOnNotif[UBound($avOnNotif) - 1][4] + EndIf + Return True + ElseIf $i = UBound($avOnNotif) Then + If Not $fOnNotif Then + $fOnNotif = True + $i = 0 + Else + ReDim $avOnNotif[UBound($avOnNotif) + 1][4] + EndIf + EndIf + + $avOnNotif[$i][0] = $iSource + $avOnNotif[$i][1] = $iNotif + $avOnNotif[$i][2] = $fInterfaceFilter + $avOnNotif[$i][3] = $sFunction + + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_QueryACParameter +; Description ...: Queries for the parameters of the auto configuration service. +; Syntax.........: _Wlan_QueryACParameter($iOpCode) +; Parameters ....: $iOpCode - A WLAN_AUTOCONF_OPCODE value that specifies the configuration parameter to be queried: +; |$WLAN_AUTOCONF_OPCODE_SHOW_DENIED_NETWORKS +; |$WLAN_AUTOCONF_OPCODE_POWER_SETTING +; |$WLAN_AUTOCONF_OPCODE_ONLY_USE_GP_PROFILES_FOR_ALLOWED_NETWORKS +; |$WLAN_AUTOCONF_OPCODE_ALLOW_EXPLICIT_CREDS +; |$WLAN_AUTOCONF_OPCODE_BLOCK_PERIOD +; |$WLAN_AUTOCONF_OPCODE_ALLOW_VIRTUAL_STATION_EXTENSIBILITY +; Return values .: Success - Data +; $WLAN_AUTOCONF_OPCODE_SHOW_DENIED_NETWORKS, $WLAN_AUTOCONF_OPCODE_ONLY_USE_GP_PROFILES_FOR_ALLOWED_NETWORKS, +; $WLAN_AUTOCONF_OPCODE_ALLOW_EXPLICIT_CREDS, $WLAN_AUTOCONF_OPCODE_ALLOW_VIRTUAL_STATION_EXTENSIBILITY - Boolean +; $WLAN_AUTOCONF_OPCODE_POWER_SETTING - One of the following strings: +; |"None" - No power saving +; |"Low" - Low power saving +; |"Medium" - Medium power saving +; |"Maximum" - Maximum power saving +; $WLAN_AUTOCONF_OPCODE_BLOCK_PERIOD - Integer +; @extended - The type of opcode returned +; |0 - Undetermined +; |1 - Set by group policy +; |2 - Set by user +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; This function is not supported in Windows XP. +; Related .......: _Wlan_SetACParameter +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_QueryACParameter($iOpCode) + Local $tData, $pData, $vData, $iOpcodeValueType + $pData = _WinAPI_WlanQueryAutoConfigParameter($hClientHandle, $iOpCode) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanQueryAutoConfigParameter")) + + $iOpcodeValueType = @extended + $tData = DllStructCreate("dword DATA", $pData) + $vData = DllStructGetData($tData, "DATA") + + Switch $iOpCode + Case $WLAN_AUTOCONF_OPCODE_POWER_SETTING + $vData = _Wlan_EnumToString("WLAN_POWER_SETTING", $vData) + Case $WLAN_AUTOCONF_OPCODE_BLOCK_PERIOD + Case Else + If $vData Then + $vData = True + Else + $vData = False + EndIf + EndSwitch + Return SetExtended($iOpcodeValueType, $vData) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_QueryInterface +; Description ...: Queries various parameters of an interface. +; Syntax.........: _Wlan_QueryInterface($iOpCode = $WLAN_INTF_OPCODE_INTERFACE_STATE) +; Parameters ....: $iOpCode - A WLAN_INTF_OPCODE value that specifies the parameter to be queried (the supported platforms in brackets): +; |$WLAN_INTF_OPCODE_AUTOCONF_ENABLED (XP, 2008 and up) +; |$WLAN_INTF_OPCODE_BACKGROUND_SCAN_ENABLED (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_RADIO_STATE (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_BSS_TYPE (XP, 2008 and up) +; |$WLAN_INTF_OPCODE_INTERFACE_STATE (XP, 2008 and up) +; |$WLAN_INTF_OPCODE_CURRENT_CONNECTION (XP, 2008 and up) +; |$WLAN_INTF_OPCODE_CHANNEL_NUMBER (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_SUPPORTED_INFRASTRUCTURE_AUTH_CIPHER_PAIRS (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_SUPPORTED_ADHOC_AUTH_CIPHER_PAIRS (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_SUPPORTED_COUNTRY_OR_REGION_STRING_LIST (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_MEDIA_STREAMING_MODE (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_STATISTICS (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_RSSI (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_CURRENT_OPERATION_MODE (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_SUPPORTED_SAFE_MODE (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_CERTIFIED_SAFE_MODE (Vista, 2008 and up) +; Return values .: Success - Data +; $WLAN_INTF_OPCODE_AUTOCONF_ENABLED, $WLAN_INTF_OPCODE_BACKGROUND_SCAN_ENABLED, $WLAN_INTF_OPCODE_MEDIA_STREAMING_MODE, +; $WLAN_INTF_OPCODE_SUPPORTED_SAFE_MODE, $WLAN_INTF_OPCODE_CERTIFIED_SAFE_MODE - Boolean +; $WLAN_INTF_OPCODE_RADIO_STATE - A radio state array +; |$avRadioState[$iIndex][0] - Index of the PHY type on which the radio state is being set or queried +; |$avRadioState[$iIndex][1] - Software switch state +; |$avRadioState[$iIndex][2] - Hardware switch state +; $WLAN_INTF_OPCODE_BSS_TYPE - The type of networks the interface is permitted to connect to +; $WLAN_INTF_OPCODE_INTERFACE_STATE - Interface state +; $WLAN_INTF_OPCODE_CURRENT_CONNECTION - An informational array about current connection +; |$avConnAttrib[$iIndex][0] - Connection status +; |$avConnAttrib[$iIndex][1] - Connection mode +; |$avConnAttrib[$iIndex][2] - Profile name +; |$avConnAttrib[$iIndex][3] - SSID +; |$avConnAttrib[$iIndex][4] - BSS Type (Network Type) +; |$avConnAttrib[$iIndex][5] - BSSID (MAC of the host) +; |$avConnAttrib[$iIndex][6] - PHY type (Physical radio type) +; |$avConnAttrib[$iIndex][7] - PHY type index +; |$avConnAttrib[$iIndex][8] - Signal strength (0-100) +; |$avConnAttrib[$iIndex][9] - Recieve rate +; |$avConnAttrib[$iIndex][10] - Transmit rate +; |$avConnAttrib[$iIndex][11] - Security status +; |$avConnAttrib[$iIndex][12] - 802.1x status +; |$avConnAttrib[$iIndex][13] - Authentication method +; |$avConnAttrib[$iIndex][14] - Encryption method +; $WLAN_INTF_OPCODE_CHANNEL_NUMBER - Current channel on which the wireless interface is operating +; $WLAN_INTF_OPCODE_SUPPORTED_INFRASTRUCTURE_AUTH_CIPHER_PAIRS, +; $WLAN_INTF_OPCODE_SUPPORTED_ADHOC_AUTH_CIPHER_PAIRS - An array of supported authentication and encryption pairs on the interface. +; |$asACPairs[$iIndex][0] - Authentication method +; |$asACPairs[$iIndex][1] - Encryption method +; $WLAN_INTF_OPCODE_SUPPORTED_COUNTRY_OR_REGION_STRING_LIST - A list of supported country or region strings +; $WLAN_INTF_OPCODE_STATISTICS - An array of driver statistics +; |$aiStats[0][0] - Four way handshake failures +; |$aiStats[0][1] - TKIP counter measures invoked +; |$aiStats[1][n] - Unicast counters +; |$aiStats[2][n] - Multicast counters +; |$aiStats[1-2][0] - Transmitted frame count +; |$aiStats[1-2][1] - Received frame count +; |$aiStats[1-2][2] - WEP excluded count +; |$aiStats[1-2][3] - TKIP local MIC failures +; |$aiStats[1-2][4] - TKIP replays +; |$aiStats[1-2][5] - TKIP ICV error count +; |$aiStats[1-2][6] - CCMP replays +; |$aiStats[1-2][7] - CCMP decrypt errors +; |$aiStats[1-2][8] - WEP undecryptable count +; |$aiStats[1-2][9] - WEP ICV error count +; |$aiStats[1-2][10] - Decrypt success count +; |$aiStats[1-2][11] - Decrypt failure count +; |$aiStats[3-n][n] - PHY counters +; |$aiStats[3-n][0] - Transmitted frame count +; |$aiStats[3-n][1] - Multicast transmitted frame count +; |$aiStats[3-n][2] - Failed count +; |$aiStats[3-n][3] - Retry count +; |$aiStats[3-n][4] - Multiple retry count +; |$aiStats[3-n][5] - Max TX lifetime exceeded count +; |$aiStats[3-n][6] - Transmitted fragment count +; |$aiStats[3-n][7] - RTS success count +; |$aiStats[3-n][8] - RTS failure count +; |$aiStats[3-n][9] - ACK failure count +; |$aiStats[3-n][10] - Received frame count +; |$aiStats[3-n][11] - Multicast received frame count +; |$aiStats[3-n][12] - Promiscuous received frame count +; |$aiStats[3-n][13] - Max RX lifetime exceeded count +; |$aiStats[3-n][14] - Frame duplicate count +; |$aiStats[3-n][15] - Received fragment count +; |$aiStats[3-n][16] - Promiscuous received fragment count +; |$aiStats[3-n][17] - FCS error count +; $WLAN_INTF_OPCODE_RSSI - The received signal strength +; $WLAN_INTF_OPCODE_CURRENT_OPERATION_MODE - The current operation mode of the interfacce +; @extended - The type of opcode returned +; 0 - Undetermined +; 1 - Set by group policy +; 2 - Set by user +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |4 - Invalid parameter. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; Not all queries are supported on all interfaces. +; Related .......: _Wlan_SetInterface +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_QueryInterface($iOpCode = $WLAN_INTF_OPCODE_INTERFACE_STATE) + Local $tData, $pData, $vData, $iOpcodeValueType, $iItems + $pData = _WinAPI_WlanQueryInterface($hClientHandle, $pGUID, $iOpCode) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanQueryInterface")) + + $iOpcodeValueType = @extended + $tData = DllStructCreate("dword DATA", $pData) + $vData = DllStructGetData($tData, "DATA") + + Switch $iOpCode + Case $WLAN_INTF_OPCODE_RADIO_STATE + $iItems = $vData + Local $vData[$iItems][3] + For $i = 0 To $iItems -1 + $tData = DllStructCreate("dword Index; dword SWRadioState; dword HWRadioState", Ptr($i * 12 + Number($pData) + 4)) + $vData[$i][0] = DllStructGetData($tData, "Index") + $vData[$i][1] = "Software " & _Wlan_EnumToString("DOT11_RADIO_STATE", DllStructGetData($tData, "SWRadioState")) + $vData[$i][2] = "Hardware " & _Wlan_EnumToString("DOT11_RADIO_STATE", DllStructGetData($tData, "HWRadioState")) + Next + Case $WLAN_INTF_OPCODE_BSS_TYPE + $vData = _Wlan_EnumToString("DOT11_BSS_TYPE", $vData) + Case $WLAN_INTF_OPCODE_INTERFACE_STATE + $vData = _Wlan_EnumToString("WLAN_INTERFACE_STATE", $vData) + Case $WLAN_INTF_OPCODE_CURRENT_CONNECTION + Local $vData[15] + $tData = DllStructCreate("dword IntState; dword ConnMode; wchar ProfName[256]; dword SSIDLen; char SSID[32]; dword BSSType; byte BSSID[6]; " & _ + "dword PhyType; dword PhyIndex; dword Signal; dword RxRate; dword TxRate; dword SecEnabled; dword OneXEnabled; dword Auth; dword Ciph", $pData) + $vData[0] = _Wlan_EnumToString("WLAN_INTERFACE_STATE", DllStructGetData($tData, "IntState")) + $vData[1] = _Wlan_EnumToString("WLAN_CONNECTION_MODE", DllStructGetData($tData, "ConnMode")) + $vData[2] = DllStructGetData($tData, "ProfName") + $vData[3] = DllStructGetData($tData, "SSID") + $vData[4] = _Wlan_EnumToString("DOT11_BSS_TYPE", DllStructGetData($tData, "BSSType")) + $vData[5] = _Wlan_bMACToString(DllStructGetData($tData, "BSSID")) + $vData[6] = _Wlan_EnumToString("DOT11_PHY_TYPE", DllStructGetData($tData, "PhyType")) + $vData[7] = DllStructGetData($tData, "PhyIndex") + $vData[8] = DllStructGetData($tData, "Signal") + $vData[9] = DllStructGetData($tData, "RxRate") + $vData[10] = DllStructGetData($tData, "TxRate") + $vData[11] = "Security Disabled" + If DllStructGetData($tData, "SecEnabled") Then $vData[11] = "Security Enabled" + $vData[12] = "802.1x Disabled" + If DllStructGetData($tData, "OneXEnabled") Then $vData[12] = "802.1x Enabled" + $vData[13] = _Wlan_EnumToString("DOT11_AUTH_ALGORITHM", DllStructGetData($tData, "Auth")) + $vData[14] = _Wlan_EnumToString("DOT11_CIPHER_ALGORITHM", DllStructGetData($tData, "Ciph")) + Case $WLAN_INTF_OPCODE_SUPPORTED_INFRASTRUCTURE_AUTH_CIPER_PAIRS, $WLAN_INTF_OPCODE_SUPPORTED_ADHOC_AUTH_CIPER_PAIRS + $iItems = $vData + Local $vData[$iItems][2] + For $i = 0 To $iItems -1 + $tData = DllStructCreate("dword Auth; dword Ciph", Ptr($i * 8 + Number($pData) + 4)) + $vData[$i][0] = _Wlan_EnumToString("DOT11_AUTH_ALGORITHM", DllStructGetData($tData, "Auth")) + $vData[$i][1] = _Wlan_EnumToString("DOT11_CIPHER_ALGORITHM", DllStructGetData($tData, "Ciph")) + Next + Case $WLAN_INTF_OPCODE_SUPPORTED_COUNTRY_OR_REGION_STRING_LIST + $iItems = $vData + Local $vData[$iItems] + For $i = 0 To $iItems -1 + $tData = DllStructCreate("char Region[3]", Ptr($i * 3 + Number($pData) + 4)) + $vData[$i][1] = DllStructGetData($tData, "Region") + Next + Case $WLAN_INTF_OPCODE_STATISTICS + $tData = DllStructCreate("UINT64 4WayHSFails; UINT64 TKIPCMInv; UINT64 Reserved; UINT64 MacUcastCntrs[12]; " & _ + "UINT64 MacMcastCntrs[12]; dword noPhys; UINT64 PhyCntrs[18]", $pData) + Local $vData[3 + DllStructGetData($tData, "noPhys")][18] + $vData[0][0] = DllStructGetData($vData, "4WayHSFails") + $vData[0][1] = DllStructGetData($vData, "TKIPCMInv") + For $i = 1 To 12 + $vData[1][$i - 1] = DllStructGetData($vData, "MacUcastCntrs", $i) + $vData[2][$i - 1] = DllStructGetData($vData, "MacMcastCntrs", $i) + Next + For $i = 1 To 18 + For $j = 3 To UBound($vData) - 1 + $vData[$j][$i - 1] = DllStructGetData($vData, "PhyCntrs", $i) + Next + Next + Case $WLAN_INTF_OPCODE_CURRENT_OPERATION_MODE + $vData = _Wlan_Dot11OpModeToString($vData) + Case $WLAN_INTF_OPCODE_AUTOCONF_ENABLED, $WLAN_INTF_OPCODE_BACKGROUND_SCAN_ENABLED, $WLAN_INTF_OPCODE_MEDIA_STREAMING_MODE, _ + $WLAN_INTF_OPCODE_SUPPORTED_SAFE_MODE, $WLAN_INTF_OPCODE_CERTIFIED_SAFE_MODE + If $vData Then + $vData = True + Else + $vData = False + EndIf + Case $WLAN_INTF_OPCODE_CHANNEL_NUMBER, $WLAN_INTF_OPCODE_RSSI + Case $WLAN_INTF_OPCODE_IHV_START To $WLAN_INTF_OPCODE_IHV_END + _WinAPI_WlanFreeMemory($pData) + Return SetError(4, 0, False) + Case Else + _WinAPI_WlanFreeMemory($pData) + Return SetError(4, 0, False) + EndSwitch + + _WinAPI_WlanFreeMemory($pData) + Return SetExtended($iOpcodeValueType, $vData) +EndFunc + +; #INTERNAL_USE_ONLY# =========================================================================================================== +; Name...........: _Wlan_ReasonCodeToString +; Description ...: Retrieves a string that describes a specified reason code. +; Syntax.........: _Wlan_ReasonCodeToString($iReasonCode) +; Parameters ....: $iReasonCode - A WLAN_REASON_CODE value of which the string description is requested. +; Return values .: Success - A string that describes the specified reason code. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; Related .......: +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_ReasonCodeToString($iReasonCode) + If Not $iReasonCode Then Return "" + Local $tReason = DllStructCreate("wchar Reason[256]") + _WinAPI_WlanReasonCodeToString($iReasonCode, DllStructGetSize($tReason), DllStructGetPtr($tReason)) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanReasonCodeToString")) + Return DllStructGetData($tReason, "Reason") +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_RenameProfile +; Description ...: Renames an existing profile. +; Syntax.........: _Wlan_RenameProfile($sOldProfileName, $sNewProfileName) +; Parameters ....: $sOldProfileName - The name of the profile to change. +; $sNewProfileName - The new name of the profile. +; Return values .: Success - The profile in the specified format. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is not supported in Windows XP. +; Related .......: _Wlan_GetProfile _Wlan_SetProfile _Wlan_DeleteProfile +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_RenameProfile($sOldProfileName, $sNewProfileName) + _WinAPI_WlanRenameProfile($hClientHandle, $pGUID, $sOldProfileName, $sNewProfileName) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanRenameProfile")) + Return True +EndFunc + +; #INTERNAL_USE_ONLY# =========================================================================================================== +; Name...........: _Wlan_ReportAPIError +; Description ...: Writes API error messages to the console. +; Syntax.........: _Wlan_ReportAPIError($iErrType, $iErrCode, $iReasonCode = 0, $iLine = 0, $sFunction = "") +; Parameters ....: $iErrType - Must be 2 +; $iErrCode - The error code of the _WinAPI_Wlan* function. +; $iReasonCode - A WLAN_REASON_CODE value. +; $iLine - The line where the error occured. +; $sFunction - The function that failed. +; Return values .: Success - False +; |True - $iErrCode is null +; Failure - False +; Author ........: MattyD +; Modified.......: +; Remarks .......: $fDebugWifi must not be null for messages to be written to the console. +; Related .......: +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_ReportAPIError($iErrType, $iErrCode, $iReasonCode = 0, $iLine = 0, $sFunction = "") + If Not $iErrCode Then Return True + If Not $fDebugWifi Or $iErrType <> 2 Then Return False + Local $tBuffer, $sErrMsg, $sReasonCode + ConsoleWrite("!APIError ") + If $iLine > 0 Then ConsoleWrite("@Ln[" & $iLine & "] ") + If $sFunction Then ConsoleWrite($sFunction & " - ") + + $tBuffer = DllStructCreate("wchar Msg[128]") + DllCall("Kernel32.dll", "int", "FormatMessageW", "int", 0x1000, "hwnd", 0, "int", $iErrCode, "int", 0, "ptr", DllStructGetPtr($tBuffer), "int", DllStructGetSize($tBuffer) / 2, "ptr", 0) + $sErrMsg = DllStructGetData($tBuffer, "Msg") + If Not $sErrMsg Then ConsoleWrite(@CRLF) + + If $iReasonCode Then + $tBuffer = DllStructCreate("wchar Msg[128]") + _WinAPI_WlanReasonCodeToString($iReasonCode, DllStructGetSize($tBuffer) / 2, DllStructGetPtr($tBuffer)) + $sReasonCode = DllStructGetData($tBuffer, "Msg") + If $sReasonCode Then ConsoleWrite($sErrMsg & "!Because: " & $sReasonCode & @CRLF) + Else + ConsoleWrite($sErrMsg) + EndIf + Return False +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_ReportUDFError +; Description ...: Writes error messages to the console. +; Syntax.........: _Wlan_ReportUDFError($iError = @error, $iExtended = @extended, $iLine = @ScriptLineNumber) +; Parameters ....: $iError - The error code of the _Wlan* function. +; $iExtended - The extended value of the _Wlan* function. +; $iLine - The line where the error occured. +; Return values .: Success - False +; |True - $iError is null +; Failure - False +; Author ........: MattyD +; Modified.......: +; Remarks .......: $fDebugWifi must not be null for messages to be written to the console. +; The returned @error and @extended outputs are the same as $iError and $iExtended +; Related .......: +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_ReportUDFError($iError = @error, $iExtended = @extended, $iLine = @ScriptLineNumber) + If Not $iError Then Return SetError($iError, $iExtended, True) + If Not $fDebugWifi Then Return SetError($iError, $iExtended, False) + ConsoleWrite("!UDFError ") + If $iLine > 0 Then ConsoleWrite("@Ln[" & $iLine & "] ") + Switch $iError + Case 1 + ConsoleWrite("Could not call the dll. DllCall() error[" & $iExtended & "]" & @CRLF) + Case 2 + ConsoleWrite("An API error occurred. API error[" & $iExtended & "]" & @CRLF) + Case 3 + ConsoleWrite("The output is null." & @CRLF) + Case 4 + ConsoleWrite("Invalid parameter." & @CRLF) + Case 5 + ConsoleWrite("The function timed out." & @CRLF) + Case 6 + ConsoleWrite("A dependancy is missing or not running." & @CRLF) + EndSwitch + Return SetError($iError, $iExtended, False) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_SaveTemporaryProfile +; Description ...: Saves a temporary profile (specified when using _Wlan_Connect) to the profile store. +; Syntax.........: _Wlan_SaveTemporaryProfile($sProfileName, $iFlags = 0, $fOverwrite = True) +; Parameters ....: $sProfileName - The name to call the profile. +; $iFlags - The flags to set on the profile. +; |0 - The profile is an all-user profile. +; |$WLAN_PROFILE_USER (0x02) - The profile is a per-user profile. +; |$WLAN_PROFILE_CONNECTION_MODE_SET_BY_CLIENT (0x10000) - The profile was created by the client. +; |$WLAN_PROFILE_CONNECTION_MODE_AUTO (0x20000) - The profile was created by the automatic configuration module. +; $fOverwrite - If True, any existing profile with the same name as $sProfileName will be overwritten. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; This function is not supported in Windows XP. +; Related .......: _Wlan_Connect +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_SaveTemporaryProfile($sProfileName, $iFlags = 0, $fOverwrite = True) + _WinAPI_WlanSaveTemporaryProfile($hClientHandle, $pGUID, $sProfileName, $iFlags, 0, $fOverwrite) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanDeleteprofile")) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_Scan +; Description ...: Requests a scan for available networks on the indicated interface. +; Syntax.........: _Wlan_Scan($fWait = False, $iTimeout = 6, $sSSID = "", $pWLAN_RAW_DATA = 0) +; Parameters ....: $fWait - If True the function will wait for the scan to finish before returning. +; $iTimeout - The maximum length of time in seconds the function should wait before returning. +; $sSSID - The SSID of the network to be scanned (Vista, 2008 and up) +; $pWLAN_RAW_DATA - A pointer to an information element to include in probe requests. (Vista, 2008 and up) +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |5 - The function timed out. +; |6 - Then notification module is not running. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; In Windows XP the $sSSID and $pWLAN_RAW_DATA parameters must be null. +; If $fWait is true in Windows XP the fuction will always time out. +; Certified drivers must be able to complete a scan in 4 seconds. +; Related .......: _Wlan_GetNetworks +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_Scan($fWait = False, $iTimeout = 6, $sSSID = "", $pWLAN_RAW_DATA = 0) + Local $tSSID, $pSSID, $iTimer, $avNotification + + If $sSSID Then + $tSSID = DllStructCreate("ulong uSSIDLength; char ucSSID[32]") + DllStructSetData($tSSID, "ucSSID", $sSSID) + DllStructSetData($tSSID, "uSSIDLength", StringLen($sSSID)) + $pSSID = DllStructGetPtr($tSSID) + EndIf + + _WinAPI_WlanScan($hClientHandle, $pGUID, $pSSID, $pWLAN_RAW_DATA) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanScan")) + If Not $fWait Then Return True + + $iTimer = TimerInit() + While TimerDiff($iTimer) < $iTimeout * 1000 + $avNotification = _Wlan_GetNotification() + If @error And @error <> 3 Then Return SetError(6, 0, False) + If @error = 3 Then ContinueLoop + If $avNotification[0] = $WLAN_NOTIFICATION_SOURCE_ACM And $avNotification[1] = $WLAN_NOTIFICATION_ACM_SCAN_COMPLETE Then Return True + WEnd + Return SetError(5, 0, False) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_SelectInterface +; Description ...: Selects an interface for following functions to interact with. +; Syntax.........: _Wlan_SelectInterface($sGUID) +; Parameters ....: $sGUID - The GUID of the desired interface. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |4 - Invalid parameter. +; Author ........: MattyD +; Modified.......: +; Remarks .......: The GUIDs of compatible interfaces can be found by calling _Wlan_EnumInterfaces +; Related .......: _Wlan_EnumInterfaces +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_SelectInterface($sGUID) + Local $asGUID + $sGUID = StringRegExpReplace($sGUID, "[}{]", "") + $asGUID = StringSplit($sGUID, "-") + If UBound($asGUID) <> 6 Then Return SetError(4, 0, False) + + $tGUID = DllStructCreate("ulong data1; ushort data2; ushort data3; ubyte data4[8]") + $pGUID = DllStructGetPtr($tGUID) + DllStructSetData($tGUID, "data1", Binary(Number("0x" & $asGUID[1]))) + DllStructSetData($tGUID, "data2", Binary(Number("0x" & $asGUID[2]))) + DllStructSetData($tGUID, "data3", Binary(Number("0x" & $asGUID[3]))) + DllStructSetData($tGUID, "data4", Binary("0x" & $asGUID[4] & $asGUID[5])) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_SetACParameter +; Description ...: Sets parameters of the auto configuration service. +; Syntax.........: _Wlan_SetACParameter($iOpCode, $vData) +; Parameters ....: $iOpCode - A WLAN_AUTOCONF_OPCODE value that specifies the configuration parameter to be set (the expected data type $vData in brackets): +; |$WLAN_AUTOCONF_OPCODE_SHOW_DENIED_NETWORKS (Boolean) +; |$WLAN_AUTOCONF_OPCODE_ALLOW_EXPLICIT_CREDS (Boolean) +; |$WLAN_AUTOCONF_OPCODE_BLOCK_PERIOD (Integer) +; |$WLAN_AUTOCONF_OPCODE_ALLOW_VIRTUAL_STATION_EXTENSIBILITY (Boolean) +; $vData - an integer or boolean, depending on the $iOpCode value - see above. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; This function is not supported in Windows XP. +; Related .......: _Wlan_QueryACParameter +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_SetACParameter($iOpCode, $vData) + Local $tData + + $tData = DllStructCreate("dword DATA") + DllStructSetData($tData, "DATA", Number($vData)) + + _WinAPI_WlanSetAutoConfigParameter($hClientHandle, $iOpCode, DllStructGetSize($tData), DllStructGetPtr($tData)) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanSetAutoConfigParameter")) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_SetInterface +; Description ...: Sets user-configurable parameters for a specified interface. +; Syntax.........: _Wlan_SetInterface($iOpCode, $vData, $iPhyIndex = 0) +; Parameters ....: $iOpCode - A value that specifies the parameter to be set (the expected data type of $vData in brackets): +; |$WLAN_INTF_OPCODE_AUTOCONF_ENABLED (Boolean) (XP, 2008 and up) +; |$WLAN_INTF_OPCODE_BACKGROUND_SCAN_ENABLED (Boolean) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_RADIO_STATE (Boolean) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_BSS_TYPE ($DOT11_BSS_TYPE_INFRASTRUCTURE, $DOT11_BSS_TYPE_INDEPENDENT or $DOT11_BSS_TYPE_ANY) (XP, 2008 and up) +; |$WLAN_INTF_OPCODE_MEDIA_STREAMING_MODE (Boolean) (Vista, 2008 and up) +; |$WLAN_INTF_OPCODE_CURRENT_OPERATION_MODE ($DOT11_OPERATION_MODE_EXTENSIBLE_STATION or $DOT11_OPERATION_MODE_NETWORK_MONITOR) (Vista, 2008 and up) +; $vData - See above. +; $iPhyIndex - The Phy index to change the radio state on. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; Changing the radio state on one phy index usually results in all the indexies following suit. +; Changing the radio state will cause related changes of the wireless Hosted Network or virtual wireless adapter radio states. +; Related .......: _Wlan_QueryInterface +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_SetInterface($iOpCode, $vData, $iPhyIndex = 0) + Local $tData + + Switch $iOpCode + Case $WLAN_INTF_OPCODE_AUTOCONF_ENABLED, $WLAN_INTF_OPCODE_BACKGROUND_SCAN_ENABLED, $WLAN_INTF_OPCODE_MEDIA_STREAMING_MODE, _ + $WLAN_INTF_OPCODE_INTERFACE_STATE + $tData = DllStructCreate("dword DATA") + DllStructSetData($tData, "DATA", Number($vData)) + Case $WLAN_INTF_OPCODE_BSS_TYPE + If $vData = "Infrastructure" Then $vData = $DOT11_BSS_TYPE_INFRASTRUCTURE + If $vData = "Ad Hoc" Then $vData = $DOT11_BSS_TYPE_INDEPENDENT + If $vData = "Any BSS Type" Then $vData = $DOT11_BSS_TYPE_ANY + $tData = DllStructCreate("dword DATA") + DllStructSetData($tData, "DATA", $vData) + Case $WLAN_INTF_OPCODE_RADIO_STATE + $tData = DllStructCreate("dword Index; dword SWRadioState; dword HWRadioState") + DllStructSetData($tData, "SWRadioState", $vData) + DllStructSetData($tData, "Index", $iPhyIndex) + Case $WLAN_INTF_OPCODE_CURRENT_OPERATION_MODE + If $vData = "Extensible Station" Then $vData = $DOT11_OPERATION_MODE_EXTENSIBLE_STATION + If $vData = "Network Monitor" Then $vData = $DOT11_OPERATION_MODE_NETWORK_MONITOR + $tData = DllStructCreate("dword DATA") + DllStructSetData($tData, "DATA", Number($vData)) + Case $WLAN_INTF_OPCODE_IHV_START To $WLAN_INTF_OPCODE_IHV_END + Return SetError(4, 0, False) + Case Else + Return SetError(4, 0, False) + EndSwitch + + _WinAPI_WlanSetInterface($hClientHandle, $pGUID, $iOpCode, DllStructGetSize($tData), DllStructGetPtr($tData)) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanSetInterface")) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_SetProfile +; Description ...: Starts the notification module. +; Syntax.........: _Wlan_SetProfile($vProfile, ByRef $sReason, $iFlags = 0, $fOverwrite = True) +; Parameters ....: $vProfile - The profile to set in XML or object format. +; $sReason - Provides a reason why the function failed. (output) +; $iFlags - The flags to be set on the profile. (Vista, 2008 and up) +; |0 - The profile is a group policy profile. +; |$WLAN_PROFILE_GROUP_POLICY (1) - The profile is a group policy profile. +; |$WLAN_PROFILE_USER (2) - The profile is a per-user profile. +; $fOverwrite - Specifies whether this profile is overwriting an existing profile. +; |True - Overwrite the existing profile. +; |False - Do not overwrite the existing profile. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |6 - A dependency is missing. (@extended - _AutoItObject_Create error code.) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; A new profile is added at the top of the list after the group policy profiles. +; A profile's position in the list is not changed if an existing profile is overwritten. +; In Windows XP, ad hoc profiles appear after the infrastructure profiles in the profile list. +; In Windows XP, new ad hoc profiles are placed at the top of the ad hoc list, after the group policy and infrastructure profiles. +; Only one SSID is supported per profile in Windows XP. +; Infrastructure profile names in Windows XP must be the same as the SSID. +; Ad Hoc profile names in Windows XP must be the same as the SSID with a "-adhoc" suffix. +; The profile object is defined as follows: +; For profiles using a shared key, the key type is deemed to be a Network Key if either: +; 1. Key material value is in a hex format +; 2. Authentication is set to Shared Key +; 3. Encryption is set to WEP +; The key type is a Pass Phrase if the authentication method is WPA-PSK or WPA2-PSK and the key material in ASCII format. +; Elements of a list type should be treated as below: +; The add method should be used to add an item to the list (e.g. $oProfile.SSID.Add("MySSID")) +; Items in the list should be retrieved using a For...In...Next loop. +; General: ($oProfile) +; |.XML - The XML representation of the profile (Ignored by _Wlan_SetProfile) (String) (Opt) +; |.Name - Name of the profile (String) (Req) +; |.SSID - A list of SSIDs to connect to (List of strings) (Req) +; |.Type - The network type ("Infrastructure" or "Ad Hoc") (Req) +; |.Auth - Authentication method ("Open", "Shared Key", "WEP", "WPA-Personal", "WPA2-Personal", "WPA-Enterprise" or "WPA2-Enterprise") (Req) +; |.Encr - Encryption method ("AES" or "TKIP") (Req) +; Key: ($oProfile.Key) +; |.Protected - Specifies if the Material property is encrypted (Boolean) (Req if using a Shared Key) +; |.Type - Specifies the format of the Material property ("Network Key" or "Pass Phrase") (Req if using a Shared Key) +; |.Material - The key (String) (Req if using a Shared Key) +; |.Index - Specifies the key index to use for WEP authentication (integer 1 - 4) (Req if using WEP) +; General Options: ($oProfile.Options) +; |.NonBroadcast - Specifies whether the service should attempt to connect to the network even if it is not broadcasting a SSID (Boolean) (Opt) +; |.ConnMode - Specifies whether the service should automatically connect to the network ("Automatic" or "Manual") (Req) +; |.Autoswitch - Specifies whether the service should connect to a more preferred network if it becomes available (Boolean) (Opt - Vista, 2008 and up) +; |.PhyTypes - Specifies the radio types the network must have before it becomes connectable (List of strings - "a", "b", "g" or "n") (Opt - Vista, 2008 and up) +; 802.1x Options: ($oProfile.OneX) +; |.Enabled - Specifies if 802.1x authentication should be used (Boolean) (Req) +; |.AuthMode - The type of credentials used for authentication ("Machine Or User", "Machine", "User" or "geust") (Opt - Vista, 2008 and up) +; |.SuppMode - The method of transmission used for EAPOL-Start messages ("Inhibit Transmission", "Include Learning" or "Compliant") (Opt - Vista, 2008 and up) +; |.CacheUserData - Specifies whether the user credentials are cached for subsequent connections (Boolean) (Opt - Vista, 2008 and up) +; |.AuthPeriod - The maximum number of seconds a client should wait for a response from the authenticator (Integer 1 - 3600) (Opt - Vista, 2008 and up) +; |.HeldPeriod - The number of seconds a client should wait before re-attempting to authenticate after a failure (Integer 1 - 3600) (Opt - Vista, 2008 and up) +; |.MaxAuthFailures - The maximum number of authentication failures allowed for a set of credentials (Integer 1 - 100) (Opt - Vista, 2008 and up) +; |.MaxStart - The number of EAPOL-Start messages the client should send before assuming there is no authenticator (Integer 1 - 100) (Opt - Vista, 2008 and up) +; |.StartPeriod - The number of seconds to wait before an EAPOL-Start is sent (Integer 1 - 3600) (Opt - Vista, 2008 and up) +; Single Sign On Options: ($oProfile.OneX.SSO) +; |.Type - Specifies when single sign on should be performed ("Pre Logon", "Post Logon") (Req if using SSO - Vista, 2008 and up) +; |.MaxDelay - The maximum number of seconds the before the single sign on connection attempt fails (Integer 0 - 120) (Opt - Vista, 2008 and up) +; |.UserBasedVLAN - Specifies if the virtual LAN used by the device changes based on the user's credentials (Boolean) (Opt - Vista, 2008 and up) +; |.AllowMoreDialogs - Secifies if additional dialogs should be allowed to be displayed during single sign on (Boolean) (Opt - 7, 2008 R2 and up) +; Pairwise Master Key Options: ($oProfile.PMK) +; |.CacheEnabled - Specifies if PMK caching is enabled (Boolean) (Opt if using WPA2 - Vista, 2008 and up) +; |.CacheTTL - The number of minutes a PMK cache should be kept (Integer 5 - 1440) (Opt if using WPA2 - Vista, 2008 and up) +; |.CacheSize - The number of entries in the PMK cache (Integer 1 - 255) (Opt if using WPA2 - Vista, 2008 and up) +; |.PreAuthEnabled - Specifies whether pre-authentication should be used (Boolean) (Opt if using WPA2 - Vista, 2008 and up) +; |.PreAuthThrottle - The number pre-authentication attempts to try on neighboring APs (Integer 1 - 16) (Opt if using WPA2 - Vista, 2008 and up) +; Federal Information Processing Standards Options: ($oProfile.FIPS) +; |.Enabled - Specifies is FIPS mode is enabled (Boolean) (Opt if using WPA2 - Vista, 2008 and up) +; EAP Options: ($oProfile.EAP) +; |.BaseType - The base EAP type the network is using ("PEAP" or "TLS") (Req if using EAP) +; |.Type - The EAP type the network is using ("PEAP-MSCHAP", "PEAP-TLS" or "TLS") (Req if using EAP without blob) +; |.Blob - A binary representation of the EAP configuration of the network (Req if using EAP without further configuration) +; Server Validation Options: ($oProfile.EAP.PEAP.ServerValidation, $oProfile.EAP.PEAP.TLS.ServerValidation, $oProfile.EAP.TLS.ServerValidation) +; |.NoUserPrompt - Indicates whether the user should be asked for server validation (Boolean) (Opt if using EAP without blob) +; |.ServerNames - A list of servers the client trusts delimited by semicolons (regular expressions may be used) (String) (Opt if using EAP without blob) +; |.ThumbPrints - Thumb prints of root certificate authorities (CAs) that are trusted by the client (List of strings) (Opt if using EAP without blob) +; |.Enabled - Indicates whether server validation is performed (Boolean) (Opt if using EAP without blob - 7, 2008 R2 and up) +; |.AcceptServerNames - Indicates whether the name of a server is read (Boolean) (Opt if using EAP without blob - 7, 2008 R2 and up) +; PEAP Options: ($oProfile.EAP.PEAP) +; |.FastReconnect - Indicates whether to perform a fast reconnect (Boolean) (Opt if using PEAP without blob) +; |.QuarantineChecks - Indicates whether to perform Network Access Protection (NAP) checks (Boolean) (Opt if using PEAP without blob) +; |.RequireCryptoBinding - Indicates whether to authenticate exclusively with servers that support cryptobinding (Boolean) (Opt if using PEAP without blob) +; |.EnableIdentityPrivacy - Indicates if an anonymous identity should be used (Boolean) (Opt if using PEAP without blob - 7, 2008 R2 and up) +; |.AnonUsername - Specifies the username to be sent in place of a user's true username (String) (Opt if using PEAP without blob - 7, 2008 R2 and up) +; TLS Options: ($oProfile.EAP.PEAP.TLS, $oProfile.EAP.TLS) +; |.Source - Specifies the certificate source ("Certificate Store" or "Smart Card") (Req if using TLS without blob) +; |.SimpleCertSel - Determines if TLS should perform a certificate search without any drop-down lists for selection (Boolean) (Opt if using TLS without a smat card and without blob) +; |.DiffUsername - Determines if TLS should use a user name other than the name that appears on the certificate (Boolean) (Opt if using TLS without blob) +; MSCHAP Options: ($oProfile.EAP.PEAP.MSCHAP) +; |.UseWinLogonCreds - Determines if MSCHAP obtains credentials from winlogon othe the user (Boolean) (Opt if using PEAP-MSCHAP without blob) +; Related .......: _Wlan_GetProfile _WlanSetProfileUserData +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_SetProfile($vProfile, ByRef $sReason, $iFlags = 0, $fOverwrite = True) + Local $iReasonCode, $iError, $iExtended + If IsObj($vProfile) Then + $vProfile = _Wlan_GenerateXMLProfile($vProfile) + If @error Then Return _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_Wlan_GenerateXMLProfile") + EndIf + + _WinAPI_WlanSetProfile($hClientHandle, $pGUID, $iFlags, $vProfile, $iReasonCode, 0, $fOverwrite) + If @error Then + $iError = @error + $iExtended = @extended + $sReason = $iReasonCode + If $iReasonCode Then + $sReason = _Wlan_ReasonCodeToString($iReasonCode) + Return _Wlan_ReportAPIError($iError, $iExtended, $iReasonCode, @ScriptLineNumber, "_WinAPI_WlanSetProfile") + EndIf + Return _Wlan_ReportAPIError($iError, $iExtended, 0, @ScriptLineNumber, "_WinAPI_WlanSetProfile") + EndIf + + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_SetProfileList +; Description ...: Sets a list of profiles in order of preference. +; Syntax.........: _Wlan_SetProfileList($asProfileNames) +; Parameters ....: $asProfileNames - An array of profile names in order of preference. +; Return values .: Success - True +; Failure - False +; @Error - 0 - No error. +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |4 - Invalid parameter. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; The position of group policy profiles cannot be changed. +; In Windows XP, ad hoc profiles always appear below Infrastructure profiles. +; Related .......: _Wlan_GetProfileList _Wlan_SetProfileList _Wlan_DeleteProfile +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_SetProfileList($asProfileNames) + Local $tagProfileNames, $tProfileNames, $pProfileNames, $iItems = UBound($asProfileNames) + If Not $iItems Then Return SetError(4, 0, False) + + For $i = 0 To $iItems - 1 + $tagProfileNames &= "ptr;" + Next + For $i = 0 To $iItems - 1 + $tagProfileNames &= "wchar[256];" + Next + $tagProfileNames = StringTrimRight($tagProfileNames, 1) + + $tProfileNames = DllStructCreate($tagProfileNames) + $pProfileNames = DllStructGetPtr($tProfileNames) + For $i = 0 To $iItems - 1 + DllStructSetData($tProfileNames, $i + 1, Ptr(4 * $iItems + $i * 512 + Number($pProfileNames))) + DllStructSetData($tProfileNames, $iItems + $i + 1, $asProfileNames[$i]) + Next + + _WinAPI_WlanSetProfileList($hClientHandle, $pGUID, $iItems, $pProfileNames) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanSetProfileList")) + + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_SetProfilePosition +; Description ...: Sets the position of a single, specified profile in the preference list. +; Syntax.........: _Wlan_SetProfilePosition($sProfileName, $iPosition) +; Parameters ....: $sProfileName - The name of the profile to move. +; $iPosition - Indicates the position in the preference list that the profile should be shifted to. (0 is the first position) +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; The position of group policy profiles cannot be changed. +; In Windows XP, ad hoc profiles always appear below Infrastructure profiles. +; Related .......: _Wlan_GetProfileList _Wlan_SetProfileList _Wlan_DeleteProfile +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_SetProfilePosition($sProfileName, $iPosition) + _WinAPI_WlanSetProfilePosition($hClientHandle, $pGUID, $sProfileName, $iPosition) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanSetProfilePosition")) + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_SetProfileUserData +; Description ...: Sets the EAP user credentials as specified by an XML string. +; Syntax.........: _Wlan_SetProfileUserData($sProfileName, $vUserData, $iFlags = 0) +; Parameters ....: $sProfile - The name of the profile associated with the EAP user data. +; $vUserData - User credentials in a XML or object format. +; $iFlags - The flags to set on the profile. (7, 2008 R2 and up) +; |$WLAN_SET_EAPHOST_DATA_ALL_USERS (0x01) - Set EAP host data for all users of this profile. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: On Vista and Server 2008, these credentials can only be used by the caller. +; If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; The profile object is defined as follows: +; General: ($oUserData) +; |.BaseType - The base EAP type the network is using ("PEAP" or "TLS") (Req) +; |.Type - The EAP type the network is using ("PEAP-MSCHAP", "PEAP-TLS" or "TLS") (Req if using EAP without blob) +; |.Blob - A binary representation of the host user data (Req if there is no further configuration) +; PEAP options: ($oUserData.PEAP) +; |.Username - The username to use for routing +; TLS options: ($oUserData.TLS, $oUserData.PEAP.TLS) +; |.Domain - The domain to use for authentication +; |.Username - The username to use for authentication +; |.Cert - The user certificate thumbprint to use for authentication +; MSCHAP options: ($oUserData.PEAP.MSCHAP) +; |.Domain - The domain to use for authentication +; |.Username - The username to use for authentication +; |.Password - The password to use for authentication +; Related .......: _Wlan_SetProfile +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_SetProfileUserData($sProfileName, $vUserData, $iFlags = 0) + If IsObj($vUserData) Then $vUserData = _Wlan_GenerateXMLUserData($vUserData) + _WinAPI_WlanSetProfileEapXmlUserData($hClientHandle, $pGUID, $sProfileName, $iFlags, $vUserData) + If @error Then Return _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanSetProfileEapXmlUserData") + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_StartNotificationModule +; Description ...: Starts the notification module. +; Syntax.........: _Wlan_StartNotificationModule($sNotifPath = "WlanNotify.exe", $iSource = $WLAN_NOTIFICATION_SOURCE_ALL, $iCheckfq = 250, $iKeepTime = 4000) +; Parameters ....: $sNotifPath - The file path of the notification module. +; $iSource - Specifies the notification source(s) to register for. +; |$WLAN_NOTIFICATION_SOURCE_ALL +; |$WLAN_NOTIFICATION_SOURCE_ACM +; |$WLAN_NOTIFICATION_SOURCE_MSM +; |$WLAN_NOTIFICATION_SOURCE_SECURITY (Currently unused) +; |$WLAN_NOTIFICATION_SOURCE_IHV +; |$WLAN_NOTIFICATION_SOURCE_HNWK +; |$WLAN_NOTIFICATION_SOURCE_ONEX +; $iCheckfq - The frquency in which messages from the notification module are cached (in milliseconds). +; $iKeepTime - Specifies how long to keep cached messages before they are discarded (in milliseconds). +; Return values .: Success - The PID of the module +; Failure - False +; @Error +; |0 - No error. +; |4 - Invalid parameter. +; |6 - The notification module is not running. +; Author ........: MattyD +; Modified.......: +; Remarks .......: BitOr can be used to register for multiple notification sources. +; _Wlan_GetNotification should be called to read messages from the notification module. +; Related .......: _Wlan_StopNotificationModule +; _Wlan_GetNotification +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_StartNotificationModule($sNotifPath = "WlanNotify.exe", $iSource = $WLAN_NOTIFICATION_SOURCE_ALL, $iCheckfq = 250, $iKeepTime = $iNotifKeepTime) + Local $iLastError, $tStartupInfo, $tProcessInfo, $sNotifPipe = "\\.\pipe\NWifi" & Random(1, 100, 1) + Local Const $ERROR_PIPE_LISTENING = 536 + Local Const $ERROR_PIPE_CONNECTED = 535 + Local Const $ERROR_IO_PENDING = 997 + + If ProcessExists($iNotifPID) Or $hNotifPipe Then + _Wlan_StopNotificationModule() + OnAutoItExitUnRegister("_Wlan_StopNotificationModule") + EndIf + If Not FileExists($sNotifPath) Then Return SetError(4, 0, False) + + $tNotifOverlap = DllStructCreate($tagOVERLAPPED) + $pNotifOverlap = DllStructGetPtr($tNotifOverlap) + + $hNotifPipe = _NamedPipes_CreateNamedPipe($sNotifPipe, 0, 2, 0, 1, 1, 1, 1, 0, 4096, 5000, 0) + If $hNotifPipe = -1 Then + Return SetError(6, 0, False) + EndIf + + _NamedPipes_ConnectNamedPipe($hNotifPipe, $pNotifOverlap) + $iLastError = _WinAPI_GetLastError() + If $iLastError <> $ERROR_PIPE_LISTENING And $iLastError <> $ERROR_PIPE_CONNECTED And $iLastError <> $ERROR_IO_PENDING Then + _WinAPI_CloseHandle($hNotifPipe) + $hNotifPipe = 0 + Return SetError(6, 0, False) + EndIf + + $tStartupInfo = DllStructCreate($tagSTARTUPINFO) + $tProcessInfo = DllStructCreate($tagPROCESS_INFORMATION) + DllStructSetData($tStartupInfo, "Size", DllStructGetSize($tStartupInfo)) + + If Not _WinAPI_CreateProcess("", $sNotifPath & " " & $sNotifPipe & " " & $iSource, 0, 0, True, 0, 0, "", DllStructGetPtr($tStartupInfo), DllStructGetPtr($tProcessInfo)) Then + _WinAPI_CloseHandle($hNotifPipe) + $hNotifPipe = 0 + Return SetError(6, 0, False) + EndIf + + $hNotifThread = DllStructGetData($tProcessInfo, "hthread") + $iNotifPID = DllStructGetData($tProcessInfo, "ProcessID") + + $iNotifKeepTime = $iKeepTime + + AdlibRegister("_Wlan_CacheNotification", $iCheckfq) + OnAutoItExitRegister("_Wlan_StopNotificationModule") + Sleep(3000) + Return $iNotifPID +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_StartSession +; Description ...: Prepares the script for following functions. +; Syntax.........: _Wlan_StartSession($vClientVersion = -1) +; Parameters ....: $vClientVersion - The version of the API to use. +; |< 1 - Request the highest version of the API that the client supports. +; |1.0 - XP SP2 with Wireless LAN API (KB918997), XP SP3 +; |2.0 - Vista, Server 2008 and above +; |32-bit integer >= 1 - The high-order word designates the minor version whilst the low designates the major. +; Return values .: Success - An interface array. +; |$asInterfaces[$iIndex][0] - Interface GUID +; |$asInterfaces[$iIndex][1] - Interface Description +; |$asInterfaces[$iIndex][2] - Interface State +; @extended - Negotiated Version. See _Wlan_APIVersion. +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (@extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; |3 - There is no data to return. +; |4 - Invalid parameter. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If an API error occurs and $fDebugWifi is not null, a reason for the error will be written to the console. +; A Vista or 2008 and above platform may request to use version 1.0 of the API. +; Currently there are no minor versions of the API for versions 1 or 2. +; The interface at index 0 is set as the default for following functions. This can be changed with _Wlan_SelectInterface. +; If no interfaces are found, a program may wait for an "interface arrival" notification before calling _Wlan_EnumInterfaces and _Wlan_SelectInterface. (Vista, 2008 and up) +; Related .......: _Wlan_APIVersion +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_StartSession($vClientVersion = -1) + Local $avInterfaces, $iClientVersion + If $hClientHandle Then + _WinAPI_WlanCloseHandle($hClientHandle) + If @error Then _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanCloseHandle") + OnAutoItExitUnregister("_Wlan_EndSession") + $iNegotiatedVersion = 0 + EndIf + + If $vClientVersion < 1 Or $vClientVersion = Default Then + $iClientVersion = 2 + If @OSVersion = "WIN_XP" Then $iClientVersion = 1 + Else + $vClientVersion = _Wlan_APIVersion($vClientVersion) + If @error Then Return SetError(@error, @extended, $vClientVersion) + $iClientVersion = $vClientVersion[1] + EndIf + + $hClientHandle = _WinAPI_WlanOpenHandle($iClientVersion) + If @error Then Return SetError(@error, @extended, _Wlan_ReportAPIError(@error, @extended, 0, @ScriptLineNumber, "_WinAPI_WlanOpenHandle")) + $iNegotiatedVersion = @extended + OnAutoItExitRegister("_Wlan_EndSession") + + _AutoitObject_Startup() + If @error Then Return SetError(6, @error, False) + + $avInterfaces = _Wlan_EnumInterfaces() + If @error Then Return SetError(@error, @extended, False) + + _Wlan_SelectInterface($avInterfaces[0][0]) + Return SetExtended($iNegotiatedVersion, $avInterfaces) +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_StopNotificationModule +; Description ...: Stops the Notification Module. +; Syntax.........: _Wlan_StopNotificationModule() +; Parameters ....: +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |6 - Notification module is not running. +; Author ........: MattyD +; Modified.......: +; Remarks .......: +; Related .......: _Wlan_StartNotificationModule +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_StopNotificationModule() + Local $aResult + AdlibUnRegister("_Wlan_CacheNotification") + _WinAPI_CloseHandle($hNotifPipe) + $hNotifPipe = 0 + If Not ProcessExists($iNotifPID) Then Return SetError(6, 0, False) + $aResult = DllCall("kernel32.dll", "dword", "ResumeThread", "ptr", $hNotifThread) + If @error Or Not $aResult[0] Then + ProcessClose($iNotifPID) + EndIf + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_UIEditProfile +; Description ...: Displays the wireless profile user interface (UI). +; Syntax.........: _Wlan_UIEditProfile($sProfileName, $iStartPage, ByRef $sReason, $hWindow = 0) +; Parameters ....: $sProfileName - Contains the name of the profile to be viewed or edited. +; $iStartPage - A WL_DISPLAY_PAGES value that specifies the active tab when the UI dialog box appears. +; |$WLConnectionPage (0) - Displays the Connection tab. +; |$WLSecurityPage (1) - Displays the Security tab. +; |$WLAdvPage (2) - Displays the advanced dialouge under the Security tab. +; $sReason - Provides a reason why the function failed. (output) +; $hWindow - The handle of the application window requesting the UI display. (opt) +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |1 - DllCall error. (@extended - DllCall error code.) +; |2 - API error. (extended - API error code. (http://msdn.microsoft.com/en-us/library/ms681381.aspx)) +; Author ........: MattyD +; Modified.......: +; Remarks .......: This function is not supported in Windows XP. +; Any changes to the profile made in the UI will be saved in the profile store. +; Related .......: _Wlan_SetProfile +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_UIEditProfile($sProfileName, $iStartPage, ByRef $sReason, $hWindow = 0) + Local $iClientVersion = $WLAN_UI_API_VERSION, $iReasonCode, $iError, $iExtended + _WinAPI_WlanUIEditProfile($iClientVersion, $sProfileName, $pGUID, $hWindow, $iStartPage, $iReasonCode) + If @error Then + $iError = @error + $iExtended = @extended + $sReason = $iReasonCode + If $iReasonCode Then + $sReason = _Wlan_ReasonCodeToString($iReasonCode) + Return _Wlan_ReportAPIError($iError, $iExtended, $iReasonCode, @ScriptLineNumber, "_WinAPI_WlanUIEditProfile") + EndIf + Return _Wlan_ReportAPIError($iError, $iExtended, 0, @ScriptLineNumber, "_WinAPI_WlanUIEditProfile") + EndIf + + Return True +EndFunc + +; #FUNCTION# ==================================================================================================================== +; Name...........: _Wlan_WaitForNotification +; Description ...: Pauses a script until a specific notification is recieved. +; Syntax.........: _Wlan_WaitForNotification($iSource, $iNotification, $fInterfaceFilter = True, $iTimeout = -1) +; Parameters ....: $iSource - The notification source. +; $iNotif - The notification code. +; $fInterfaceFilter - If True the registered function will only be called if the notification is associated with the selected interface. +; $iTimeout - The maximum length of time in seconds to wait for a notification before resuming the script. +; Return values .: Success - True +; Failure - False +; @Error +; |0 - No error. +; |5 - The function timed out. +; Author ........: MattyD +; Modified.......: +; Remarks .......: If $iTimeout = -1 then the script will not time out. +; Related .......: _Wlan_GetNotification _Wlan_OnNotification +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _Wlan_WaitForNotification($iSource, $iNotification, $fInterfaceFilter = True, $iTimeout = -1) + Local $iTimer, $asNotification + $iTimer = TimerInit() + While 1 + $asNotification = _Wlan_GetNotification($fInterfaceFilter) + If @error And @error <> 3 Then Return SetError(@error, @extended, $asNotification) + If @error = 3 Then ContinueLoop + If $asNotification[0] = $iSource And $asNotification[1] = $iNotification Then Return $asNotification + If $iTimeout <> -1 And TimerDiff($iTimer) > $iTimeout * 1000 Then Return SetError(5, 0, False) + WEnd +EndFunc + diff --git a/Installer/vi_files/UDFs/ParseCSV.au3 b/Installer/vi_files/UDFs/ParseCSV.au3 new file mode 100644 index 00000000..0c609ba1 --- /dev/null +++ b/Installer/vi_files/UDFs/ParseCSV.au3 @@ -0,0 +1,83 @@ +; #FUNCTION# ==================================================================================================================== +; Name...........: _ParseCSV +; Description ...: Reads a CSV-file +; Syntax.........: _ParseCSV($sFile, $sDelimiters=',', $sQuote='"', $iFormat=0) +; Parameters ....: $sFile - File to read or string to parse +; $sDelimiters - [optional] Fieldseparators of CSV, mulitple are allowed (default: ,;) +; $sQuote - [optional] Character to quote strings (default: ") +; $iFormat - [optional] Encoding of the file (default: 0): +; |-1 - No file, plain data given +; |0 or 1 - automatic (ASCII) +; |2 - Unicode UTF16 Little Endian reading +; |3 - Unicode UTF16 Big Endian reading +; |4 or 5 - Unicode UTF8 reading +; $iAddIndex - [optional] Adds an index in first column +; $AddHeader - [optional] Adds an automatic header ("Col1", "Col2", ....) +; Return values .: Success - 2D-Array with CSV data (0-based) +; Failure - 0, sets @error to: +; |1 - could not open file +; |2 - error on parsing data +; |3 - wrong format chosen +; Author ........: ProgAndy +; Modified.......: funkey (to fit the function to the CSV-Editor) +; Remarks .......: +; Related .......: _WriteCSV +; Link ..........: +; Example .......: +; =============================================================================================================================== +Func _ParseCSV($sFile, $sDelimiters = ',;', $sQuote = '"', $iFormat = 0, $iAddIndex = 0, $AddHeader = 0) + Local Static $aEncoding[6] = [0, 0, 32, 64, 128, 256] + If $iFormat < -1 Or $iFormat > 6 Then + Return SetError(3, 0, 0) + ElseIf $iFormat > -1 Then + Local $hFile = FileOpen($sFile, $aEncoding[$iFormat]), $sLine, $aTemp, $aCSV[1], $iReserved, $iCount + If @error Then Return SetError(1, @error, 0) + $sFile = FileRead($hFile) + FileClose($hFile) + EndIf + If $sDelimiters = "" Or IsKeyword($sDelimiters) Then $sDelimiters = ',;' + If $sQuote = "" Or IsKeyword($sQuote) Then $sQuote = '"' + $sQuote = StringLeft($sQuote, 1) + $iAddIndex = Number($iAddIndex=True) + $AddHeader = Number($AddHeader=True) + Local $srDelimiters = StringRegExpReplace($sDelimiters, '[\\\^\-\[\]]', '\\\0') + Local $srQuote = StringRegExpReplace($sQuote, '[\\\^\-\[\]]', '\\\0') + Local $sPattern = StringReplace(StringReplace('(?m)(?:^|[,])\h*(["](?:[^"]|["]{2})*["]|[^,\r\n]*)(\v+)?', ',', $srDelimiters, 0, 1), '"', $srQuote, 0, 1) + Local $aREgex = StringRegExp($sFile, $sPattern, 3) + If @error Then Return SetError(2, @error, 0) + $sFile = '' ; save memory + Local $iBound = UBound($aREgex), $iIndex = $AddHeader, $iSubBound = 1+$iAddIndex, $iSub = $iAddIndex, $sLast='' ;changed + If $iBound Then $sLast = $aREgex[$iBound-1] + Local $aResult[$iBound + $iAddIndex][$iSubBound] ;changed + For $i = 0 To $iBound - 1 + If $iSub = $iSubBound Then + $iSubBound += 1 + ReDim $aResult[$iBound][$iSubBound] + EndIf + Select + Case StringLeft(StringStripWS($aREgex[$i], 1), 1) = $sQuote + $aREgex[$i] = StringStripWS($aREgex[$i], 3) + $aResult[$iIndex][$iSub] = $aREgex[$i] +;~ $aResult[$iIndex][$iSub] = StringReplace(StringMid($aREgex[$i], 2, StringLen($aREgex[$i])-2), $sQuote&$sQuote, $sQuote, 0, 1) + Case StringRegExp($aREgex[$i], '^\v+$') ; StringLen($aREgex[$i]) < 3 And StringInStr(@CRLF, $aREgex[$i]) ;new line found + StringReplace($aREgex[$i], @LF, "", 0, 1) + $iIndex += @extended + $iSub = $iAddIndex ;changed + ContinueLoop + Case Else + $aResult[$iIndex][$iSub] = $aREgex[$i] + EndSelect + $aREgex[$i] = 0 ; save memory + $iSub += 1 + If $iAddIndex Then $aResult[$iIndex][0] = $iIndex ;added + Next + If Not StringRegExp($sLast, '^\v+$') Then $iIndex+=1 + ReDim $aResult[$iIndex][$iSubBound - 1] + If $iAddIndex Then $aResult[0][0] = "Index" ;added + If $AddHeader Then + For $i = 1 To $iSubBound - 2 + $aResult[0][$i] = "Col" & $i + Next + EndIf + Return $aResult +EndFunc ;==>_ParseCSV \ No newline at end of file diff --git a/Installer/vi_files/UDFs/UnixTime.au3 b/Installer/vi_files/UDFs/UnixTime.au3 new file mode 100644 index 00000000..943cdd4f --- /dev/null +++ b/Installer/vi_files/UDFs/UnixTime.au3 @@ -0,0 +1,191 @@ +#include-once + +;=============================================================================== +; +; AutoIt Version: 3.2.3.0 +; Language: English +; Description: Dll wrapper functions for dealing with Unix timestamps. +; Requirement(s): CrtDll.dll +; Notes: If CrtDll.dll is not available then functions will return false +; and set @error = 99. +; +;=============================================================================== + + +;=============================================================================== +; +; Description: _TimeGetStamp - Get current time as Unix timestamp value. +; Parameter(s): None +; Return Value(s): On Success - Returns Unix timestamp +; On Failure - Returns False, sets @error = 99 +; Author(s): Rob Saunders (admin@therks.com) +; User Calltip: _TimeGetStamp() - Get current time as Unix timestamp value. (required: <_UnixTime.au3>) +; +;=============================================================================== + +Func _TimeGetStamp() + Local $av_Time + $av_Time = DllCall('CrtDll.dll', 'long:cdecl', 'time', 'ptr', 0) + If @error Then + SetError(99) + Return False + EndIf + Return $av_Time[0] +EndFunc + +;=============================================================================== +; +; Description: _TimeMakeStamp - Create Unix timestamp from input values. +; Syntax: _TimeMakeStamp( [ second [, minute [, hour [, day [, month [, year [, isDST ]]]]]]] ) +; Parameter(s): Second - Second for timestamp (0 - 59) +; Minute - Minute for timestamp (0 - 59) +; Hour - Hour for timestamp (0 - 23) +; Day - Day for timestamp (1 - 31) +; Month - Month for timestamp (1 - 12) +; Year - Year for timestamp (1970 - 2038) +; * All the above values default to the 'Default' keyword, where the current +; time/date value will be used. +; IsDST - Set to 1 during Daylight Saving Time (DST) +; - Set to 0 not during DST +; - Set to -1 if unknown, function will try to figure it out +; - Default is -1 +; Return Value(s): On Success - Returns Unix timestamp +; On Failure - Parameter error, returns -1 +; - Dll error, returns False, sets @error = 99 +; Notes: The function will try and calculate dates for numbers outside of the +; usual range. +; For example: _TimeMakeStamp(0, 0, 0, 32, 1, 1995) +; 32nd day of January? Obviously that's not a valid date, but the function +; automatically calculates this to be February 1st. A date of 0 will return +; the last day of the previous month. +; User CallTip: _TimeMakeStamp($i_Sec = Default, $i_Min = Default, $i_Hour = Default, $i_Day = Default, $i_Mon = Default, $i_Year = Default, $i_IsDST = -1) - Create a UNIX timestamp from input values. (required: <_UnixTime.au3>) +; Author(s): Rob Saunders (admin@therks.com) +; +;=============================================================================== +Func _TimeMakeStamp($i_Sec = Default, $i_Min = Default, $i_Hour = Default, $i_Day = Default, $i_Mon = Default, $i_Year = Default, $i_IsDST = -1) + Local $struct_Time, $ptr_Time, $av_Time + $struct_Time = DllStructCreate('uint;uint;uint;uint;uint;uint;uint;uint;uint') + + Select + Case $i_Sec = Default + $i_Sec = @SEC + ContinueCase + Case $i_Min = Default + $i_Min = @MIN + ContinueCase + Case $i_Hour = Default + $i_Hour = @HOUR + ContinueCase + Case $i_Day = Default + $i_Day = @MDAY + ContinueCase + Case $i_IsDST = Default + $i_IsDST = -1 + EndSelect + ; The following is done because the mktime function demands + ; that the month be in 0-11 (Jan = 0) format instead of 1-12. + Select + Case $i_Mon = Default + $i_Mon = (@MON - 1) + Case $i_Mon <> Default + $i_Mon -= 1 + EndSelect + ; The following is done because the mktime function expects the year in format + ; (full year - 1900), thus 99 = 1999 and 100 = 2005. The function will try + ; to figure out what year the user is trying to use. Thus if the function recieves + ; 70, it's untouched, but if the user gives 1970, 1900 is subtracted automatically. + ; Any year above 99 has 1900 automatically subtracted. + Select + Case $i_Year = Default + $i_Year = (@YEAR - 1900) + Case $i_Year < 70 + $i_Year += 100 + Case $i_Year > 99 + $i_Year -= 1900 + EndSelect + + DllStructSetData($struct_Time, 1, $i_Sec) + DllStructSetData($struct_Time, 2, $i_Min) + DllStructSetData($struct_Time, 3, $i_Hour) + DllStructSetData($struct_Time, 4, $i_Day) + DllStructSetData($struct_Time, 5, $i_Mon) + DllStructSetData($struct_Time, 6, $i_Year) + DllStructSetData($struct_Time, 9, $i_IsDST) + + $ptr_Time = DllStructGetPtr($struct_Time) + $av_Time = DllCall('CrtDll.dll', 'long:cdecl', 'mktime', 'ptr', $ptr_Time) + If @error Then + SetError(99) + Return False + EndIf + + Return $av_Time[0] +EndFunc + +;=============================================================================== +; +; Description: _StringFormatTime - Get a string representation of a timestamp +; according to the format string given to the function. +; Syntax: _StringFormatTime( "format" [, timestamp [, max length ]] ) +; Parameter(s): Format String - A format string to convert the timestamp to. +; See notes for some of the values that can be +; used in this string. +; Timestamp - A timestamp to format, possibly returned from +; _TimeMakeStamp. If left empty, default, or less +; than 0, the current time is used. (default is -1) +; Max Length - Maximum length of the string to be returned. +; Default is 255. +; Return Value(s): On Success - Returns string formatted timestamp. +; On Failure - Returns False, sets @error = 99 +; Requirement(s): _TimeGetStamp +; Notes: The date/time specifiers for the Format String: +; %a - Abbreviated weekday name (Fri) +; %A - Full weekday name (Friday) +; %b - Abbreviated month name (Jul) +; %B - Full month name (July) +; %c - Date and time representation (MM/DD/YY hh:mm:ss) +; %d - Day of the month (01-31) +; %H - Hour in 24hr format (00-23) +; %I - Hour in 12hr format (01-12) +; %j - Day of the year (001-366) +; %m - Month number (01-12) +; %M - Minute (00-59) +; %p - Ante meridiem or Post Meridiem (AM / PM) +; %S - Second (00-59) +; %U - Week of the year, with Sunday as the first day of the week (00 - 53) +; %w - Day of the week as a number (0-6; Sunday = 0) +; %W - Week of the year, with Monday as the first day of the week (00 - 53) +; %x - Date representation (MM/DD/YY) +; %X - Time representation (hh:mm:ss) +; %y - 2 digit year (99) +; %Y - 4 digit year (1999) +; %z, %Z - Either the time-zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown +; %% - Literal percent character +; The # character can be used as a flag to specify extra settings: +; %#c - Long date and time representation appropriate for current locale. (ex: "Tuesday, March 14, 1995, 12:41:29") +; %#x - Long date representation, appropriate to current locale. (ex: "Tuesday, March 14, 1995") +; %#d, %#H, %#I, %#j, %#m, %#M, %#S, %#U, %#w, %#W, %#y, %#Y - Remove leading zeros (if any). +; +; User CallTip: _StringFormatTime($s_Format, $i_Timestamp = -1, $i_MaxLen = 255) - Get a string representation of a timestamp according to the format string given to the function. (required: <_UnixTime.au3>) +; Author(s): Rob Saunders (admin@therks.com) +; +;=============================================================================== +Func _StringFormatTime($s_Format, $i_Timestamp = -1, $i_MaxLen = 255) + Local $struct_Time, $ptr_Time, $av_Time, $av_StrfTime + + If $i_Timestamp = default OR $i_Timestamp < 0 Then + $i_Timestamp = _TimeGetStamp() + EndIf + $ptr_Time = DllCall('CrtDll.dll', 'ptr:cdecl', 'localtime', 'long*', $i_Timestamp) + If @error Then + SetError(99) + Return False + EndIf + + $av_StrfTime = DllCall('CrtDll.dll', 'int:cdecl', 'strftime', _ + 'str', '', _ + 'int', $i_MaxLen, _ + 'str', $s_Format, _ + 'ptr', $ptr_Time[0]) + Return $av_StrfTime[1] +EndFunc diff --git a/Installer/vi_files/UDFs/Zip.au3 b/Installer/vi_files/UDFs/Zip.au3 new file mode 100644 index 00000000..6bb9dcda --- /dev/null +++ b/Installer/vi_files/UDFs/Zip.au3 @@ -0,0 +1,929 @@ +#include-once + +; =============================================================================================================== +; +; Description: ZIP Functions +; Author: wraithdu +; Date: 2011-12-08 +; Credits: PsaltyDS for the original idea on which this UDF is based. +; torels for the basic framework on which this UDF is based. +; +; NOTES: +; This UDF attempts to register a COM error handler if one does not exist. This is done to prevent +; any fatal COM errors. If you have implemented your own COM error handler, this WILL NOT replace it. +; +; The Shell object does not have a delete method, so some workarounds have been implemented. The +; options are either an interactive method (as in right-click -> Delete) or a slower method (slow for +; large files). The interactive method is the main function, while the slow method is in the internal +; function section near the bottom. +; +; When adding a file item to a ZIP archive, if the file exists and the overwrite flag is set, the slower +; internal delete method is used. This is the only way to make this step non-interactive. It will be +; slow for large files. +; +; NOTE: This does not work in Windows XP, it will fail with an error. +; +; As a result, neither does adding files directly to a subdirectory. So please don't try it. As a +; workaround, create the directory structure that holds your files in a temporary location, and add the +; root directory to the root of the zip file. +; +; The zipfldr library does not allow overwriting or merging of folders in a ZIP archive. That means +; if you try to add a folder and a folder with that name already exists, it will simply fail. Period. +; As such, I've disabled that functionality. +; +; I've also removed the AddFolderContents function. There are too many pitfalls with that scenario, not +; the least of which being the above restriction. +; +; =============================================================================================================== + +;;; Start COM error Handler +;===== +; if a COM error handler does not already exist, assign one +If Not ObjEvent("AutoIt.Error") Then + ; MUST assign this to a variable + Global Const $_Zip_COMErrorHandler = ObjEvent("AutoIt.Error", "_Zip_COMErrorFunc") +EndIf + + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_AddItem +; Description....: Add a file or folder to a ZIP archive +; Syntax.........: _Zip_AddItem($sZipFile, $sItem[, $sDestDir = ""[, $iFlag = 21]]) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sItem - Full path to item to add +; $sDestDir - [Optional] Destination subdirectory in which to place the item +; + Directory must be formatted similarly: "some\sub\dir" +; $iFlag - [Optional] File copy flags (Default = 1+4+16) +; | 1 - Overwrite destination file if it exists +; | 4 - No progress box +; | 8 - Rename the file if a file of the same name already exists +; | 16 - Respond "Yes to All" for any dialog that is displayed +; | 64 - Preserve undo information, if possible +; | 256 - Display a progress dialog box but do not show the file names +; | 512 - Do not confirm the creation of a new directory if the operation requires one to be created +; |1024 - Do not display a user interface if an error occurs +; |2048 - Version 4.71. Do not copy the security attributes of the file +; |4096 - Only operate in the local directory, don't operate recursively into subdirectories +; |8192 - Version 5.0. Do not copy connected files as a group, only copy the specified files +; +; Return values..: Success - 1 +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Destination ZIP file not a full path +; | 4 - Item to add not a full path +; | 5 - Item to add does not exist +; | 6 - Destination subdirectory cannot be a full path +; | 7 - Destination ZIP file does not exist +; | 8 - Destination item exists and is a folder (see Remarks) +; | 9 - Destination item exists and overwrite flag not set +; |10 - Destination item exists and failed to overwrite +; |11 - Failed to create internal directory structure +; +; Author.........: wraithdu +; Modified.......: +; Remarks........: Destination folders CANNOT be overwritten or merged. They must be manually deleted first. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_AddItem($sZipFile, $sItem, $sDestDir = "", $iFlag = 21) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + If Not _IsFullPath($sItem) Then Return SetError(4, 0, 0) + If Not FileExists($sItem) Then Return SetError(5, 0, 0) + If _IsFullPath($sDestDir) Then Return SetError(6, 0, 0) + ; clean paths + $sItem = _Zip_PathStripSlash($sItem) + $sDestDir = _Zip_PathStripSlash($sDestDir) + Local $sNameOnly = _Zip_PathNameOnly($sItem) + ; process overwrite flag + Local $iOverwrite = 0 + If BitAND($iFlag, 1) Then + $iOverwrite = 1 + $iFlag -= 1 + EndIf + ; check for overwrite, if target exists... + Local $sTest = $sNameOnly + If $sDestDir <> "" Then $sTest = $sDestDir & "\" & $sNameOnly + Local $itemExists = _Zip_ItemExists($sZipFile, $sTest) + If @error Then Return SetError(7, 0, 0) + If $itemExists Then + If @extended Then + ; get out, cannot overwrite folders... AT ALL + Return SetError(8, 0, 0) + Else + If $iOverwrite Then + _Zip_InternalDelete($sZipFile, $sTest) + If @error Then Return SetError(10, 0, 0) + Else + Return SetError(9, 0, 0) + EndIf + EndIf + EndIf + Local $sTempFile = "" + If $sDestDir <> "" Then + $sTempFile = _Zip_AddPath($sZipFile, $sDestDir) + If @error Then Return SetError(11, 0, 0) + EndIf + Local $oNS = _Zip_GetNameSpace($sZipFile, $sDestDir) + ; copy the item(s) + $oNS.CopyHere($sItem, $iFlag) + Do + Sleep(250) + Until IsObj($oNS.ParseName($sNameOnly)) + If $sTempFile <> "" Then + _Zip_InternalDelete($sZipFile, $sDestDir & "\" & $sTempFile) + If @error Then Return SetError(12, 0, 0) + EndIf + Return 1 +EndFunc ;==>_Zip_AddItem + +Func _Zip_COMErrorFunc() +EndFunc ;==>_Zip_COMErrorFunc + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_Count +; Description....: Count items in the root of a ZIP archive (not recursive) +; Syntax.........: _Zip_Count($sZipFile) +; Parameters.....: $sZipFile - Full path to ZIP file +; +; Return values..: Success - Item count +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file does not exist +; Author.........: wraithdu, torels +; Modified.......: +; Remarks........: +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_Count($sZipFile) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + Local $oNS = _Zip_GetNameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Return $oNS.Items().Count +EndFunc ;==>_Zip_Count + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_CountAll +; Description....: Recursively count items contained in a ZIP archive +; Syntax.........: _Zip_CountAll($sZipFile) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sSub - [Internal] +; $iFileCount - [Internal] +; $iFolderCount - [Internal] +; +; Return values..: Success - Array with file and folder count +; [0] - File count +; [1] - Folder count +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file does not exist +; Author.........: wraithdu +; Modified.......: +; Remarks........: +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_CountAll($sZipFile, $sSub = "", $iFileCount = 0, $iFolderCount = 0) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + Local $oNS = _Zip_GetNameSpace($sZipFile, $sSub) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $oItems = $oNS.Items(), $aCount, $sSub2 + For $oItem In $oItems + ; reset subdir so recursion doesn't break + $sSub2 = $sSub + If $oItem.IsFolder Then + ; folder, recurse + $iFolderCount += 1 + If $sSub2 = "" Then + $sSub2 = $oItem.Name + Else + $sSub2 &= "\" & $oItem.Name + EndIf + $aCount = _Zip_CountAll($sZipFile, $sSub2, $iFileCount, $iFolderCount) + $iFileCount = $aCount[0] + $iFolderCount = $aCount[1] + Else + $iFileCount += 1 + EndIf + Next + Dim $aCount[2] = [$iFileCount, $iFolderCount] + Return $aCount +EndFunc ;==>_Zip_CountAll + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_Create +; Description....: Create empty ZIP archive +; Syntax.........: _Zip_Create($sFileName[, $iOverwrite = 0]) +; Parameters.....: $sFileName - Name of new ZIP file +; $iOverwrite - [Optional] Overwrite flag (Default = 0) +; | 0 - Do not overwrite the file if it exists +; | 1 - Overwrite the file if it exists +; +; Return values..: Success - Name of the new file +; Failure - 0 and sets @error +; | 1 - A file with that name already exists and $iOverwrite flag is not set +; | 2 - Failed to create new file +; Author.........: wraithdu, torels +; Modified.......: +; Remarks........: +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_Create($sFileName, $iOverwrite = 0) + If FileExists($sFileName) And Not $iOverwrite Then Return SetError(1, 0, 0) + Local $hFp = FileOpen($sFileName, 2 + 8 + 16) + If $hFp = -1 Then Return SetError(2, 0, 0) + FileWrite($hFp, Binary("0x504B0506000000000000000000000000000000000000")) + FileClose($hFp) + Return $sFileName +EndFunc ;==>_Zip_Create + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_DeleteItem +; Description....: Delete a file or folder from a ZIP archive +; Syntax.........: _Zip_DeleteItem($sZipFile, $sFileName) +; Parameters.....: $sZipFile - Full path to the ZIP file +; $sFileName - Name of the item in the ZIP file +; +; Return values..: Success - 1 +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file does not exist +; | 5 - Item not found in ZIP file +; | 6 - Failed to get list of verbs +; | 7 - Failed to delete item +; Author.........: wraithdu +; Modified.......: +; Remarks........: $sFileName may be a path to an item from the root of the ZIP archive. +; For example, some ZIP file 'test.zip' has a subpath 'some\dir\file.ext'. Do not include a leading or trailing '\'. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_DeleteItem($sZipFile, $sFileName) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + ; parse filename + Local $sPath = "" + $sFileName = _Zip_PathStripSlash($sFileName) + If StringInStr($sFileName, "\") Then + ; subdirectory, parse out path and filename + $sPath = _Zip_PathPathOnly($sFileName) + $sFileName = _Zip_PathNameOnly($sFileName) + EndIf + Local $oNS = _Zip_GetNameSpace($sZipFile, $sPath) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $oFolderItem = $oNS.ParseName($sFileName) + If Not IsObj($oFolderItem) Then Return SetError(5, 0, 0) + Local $oVerbs = $oFolderItem.Verbs() + If Not IsObj($oVerbs) Then Return SetError(6, 0, 0) + For $oVerb In $oVerbs + If StringReplace($oVerb.Name, "&", "") = "delete" Then + $oVerb.DoIt() + Return 1 + EndIf + Next + Return SetError(7, 0, 0) +EndFunc ;==>_Zip_DeleteItem + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_ItemExists +; Description....: Determines if an item exists in a ZIP file +; Syntax.........: _Zip_ItemExists($sZipFile, $sItem) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sItem - Name of item +; +; Return values..: Success - 1 +; @extended is set to 1 if the item is a folder, 0 if a file +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file does not exist +; Author.........: wraithdu +; Modified.......: +; Remarks........: $sItem may be a path to an item from the root of the ZIP archive. +; For example, some ZIP file 'test.zip' has a subpath 'some\dir\file.ext'. Do not include a leading or trailing '\'. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_ItemExists($sZipFile, $sItem) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + Local $sPath = "" + $sItem = _Zip_PathStripSlash($sItem) + If StringInStr($sItem, "\") Then + ; subfolder + $sPath = _Zip_PathPathOnly($sItem) + $sItem = _Zip_PathNameOnly($sItem) + EndIf + Local $oNS = _Zip_GetNameSpace($sZipFile, $sPath) + If Not IsObj($oNS) Then Return 0 + Local $oItem = $oNS.ParseName($sItem) + ; @extended holds whether item is a file (0) or folder (1) + If IsObj($oItem) Then Return SetExtended(Number($oItem.IsFolder), 1) + Return 0 +EndFunc ;==>_Zip_ItemExists + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_List +; Description....: List items in the root of a ZIP archive (not recursive) +; Syntax.........: _Zip_List($sZipFile) +; Parameters.....: $sZipFile - Full path to ZIP file +; +; Return values..: Success - Array of items +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file does not exist +; Author.........: wraithdu, torels +; Modified.......: +; Remarks........: Item count is returned in array[0]. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_List($sZipFile) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + Local $oNS = _Zip_GetNameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $aArray[1] = [0] + Local $oList = $oNS.Items() + For $oItem In $oList + $aArray[0] += 1 + ReDim $aArray[$aArray[0] + 1] + $aArray[$aArray[0]] = $oItem.Name + Next + Return $aArray +EndFunc ;==>_Zip_List + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_ListAll +; Description....: List all files inside a ZIP archive +; Syntax.........: _Zip_ListAll($sZipFile[, $iFullPath = 1]) +; Parameters.....: $sZipFile - Full path to ZIP file +; $iFullPath - [Optional] Path flag (Default = 1) +; | 0 - Return file names only +; | 1 - Return full paths of files from the archive root +; +; Return values..: Success - Array of file names / paths +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file or subfolder does not exist +; Author.........: wraithdu +; Modified.......: +; Remarks........: File count is returned in array[0], does not list folders. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_ListAll($sZipFile, $iFullPath = 1) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + Local $aArray[1] = [0] + _Zip_ListAll_Internal($sZipFile, "", $aArray, $iFullPath) + If @error Then + Return SetError(@error, 0, 0) + Else + Return $aArray + EndIf +EndFunc ;==>_Zip_ListAll + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_Search +; Description....: Search for files in a ZIP archive +; Syntax.........: _Zip_Search($sZipFile, $sSearchString) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sSearchString - Substring to search +; +; Return values..: Success - Array of matching file paths from the root of the archive +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file or subfolder does not exist +; | 5 - No matching files found +; Author.........: wraithdu +; Modified.......: +; Remarks........: Found file count is returned in array[0]. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_Search($sZipFile, $sSearchString) + Local $aList = _Zip_ListAll($sZipFile) + If @error Then Return SetError(@error, 0, 0) + Local $aArray[1] = [0], $sName + For $i = 1 To $aList[0] + $sName = $aList[$i] + If StringInStr($sName, "\") Then + ; subdirectory, isolate file name + $sName = _Zip_PathNameOnly($sName) + EndIf + If StringInStr($sName, $sSearchString) Then + $aArray[0] += 1 + ReDim $aArray[$aArray[0] + 1] + $aArray[$aArray[0]] = $aList[$i] + EndIf + Next + If $aArray[0] = 0 Then + ; no files found + Return SetError(5, 0, 0) + Else + Return $aArray + EndIf +EndFunc ;==>_Zip_Search + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_SearchInFile +; Description....: Search file contents of files in a ZIP archive +; Syntax.........: _Zip_SearchInFile($sZipFile, $sSearchString) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sSearchString - Substring to search +; +; Return values..: Success - Array of matching file paths from the root of the archive +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file or subfolder does not exist +; | 5 - Failed to create temporary directory +; | 6 - Failed to extract ZIP file to temporary directory +; | 7 - No matching files found +; Author.........: wraithdu +; Modified.......: +; Remarks........: Found file count is returned in array[0]. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_SearchInFile($sZipFile, $sSearchString) + Local $aList = _Zip_ListAll($sZipFile) + If @error Then Return SetError(@error, 0, 0) + Local $sTempDir = _Zip_CreateTempDir() + If @error Then Return SetError(5, 0, 0) + _Zip_UnzipAll($sZipFile, $sTempDir) ; flag = 20 -> no dialog, yes to all + If @error Then + DirRemove($sTempDir, 1) + Return SetError(6, 0, 0) + EndIf + Local $aArray[1] = [0], $sData + For $i = 1 To $aList[0] + $sData = FileRead($sTempDir & "\" & $aList[$i]) + If StringInStr($sData, $sSearchString) Then + $aArray[0] += 1 + ReDim $aArray[$aArray[0] + 1] + $aArray[$aArray[0]] = $aList[$i] + EndIf + Next + DirRemove($sTempDir, 1) + If $aArray[0] = 0 Then + ; no files found + Return SetError(7, 0, 0) + Else + Return $aArray + EndIf +EndFunc ;==>_Zip_SearchInFile + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_Unzip +; Description....: Extract a single item from a ZIP archive +; Syntax.........: _Zip_Unzip($sZipFile, $sFileName, $sDestPath[, $iFlag = 21]) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sFileName - Name of the item in the ZIP file +; $sDestPath - Full path to the destination +; $iFlag - [Optional] File copy flags (Default = 1+4+16) +; | 1 - Overwrite destination file if it exists +; | 4 - No progress box +; | 8 - Rename the file if a file of the same name already exists +; | 16 - Respond "Yes to All" for any dialog that is displayed +; | 64 - Preserve undo information, if possible +; | 256 - Display a progress dialog box but do not show the file names +; | 512 - Do not confirm the creation of a new directory if the operation requires one to be created +; |1024 - Do not display a user interface if an error occurs +; |2048 - Version 4.71. Do not copy the security attributes of the file +; |4096 - Only operate in the local directory, don't operate recursively into subdirectories +; |8192 - Version 5.0. Do not copy connected files as a group, only copy the specified files +; +; Return values..: Success - 1 +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file / item path does not exist +; | 5 - Item not found in ZIP file +; | 6 - Failed to create destination (if necessary) +; | 7 - Failed to open destination +; | 8 - Failed to delete destination file / folder for overwriting +; | 9 - Destination exists and overwrite flag not set +; |10 - Failed to extract file +; Author.........: wraithdu, torels +; Modified.......: +; Remarks........: $sFileName may be a path to an item from the root of the ZIP archive. +; For example, some ZIP file 'test.zip' has a subpath 'some\dir\file.ext'. Do not include a leading or trailing '\'. +; If the overwrite flag is not set and the destination file / folder exists, overwriting is controlled +; by the remaining file copy flags ($iFlag) and/or user interaction. +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_Unzip($sZipFile, $sFileName, $sDestPath, $iFlag = 21) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Or Not _IsFullPath($sDestPath) Then Return SetError(3, 0, 0) + ; get temp directory created by Windows + Local $sTempDir = _Zip_TempDirName($sZipFile) + ; parse filename + Local $sPath = "" + $sFileName = _Zip_PathStripSlash($sFileName) + If StringInStr($sFileName, "\") Then + ; subdirectory, parse out path and filename + $sPath = _Zip_PathPathOnly($sFileName) + $sFileName = _Zip_PathNameOnly($sFileName) + EndIf + Local $oNS = _Zip_GetNameSpace($sZipFile, $sPath) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $oFolderItem = $oNS.ParseName($sFileName) + If Not IsObj($oFolderItem) Then Return SetError(5, 0, 0) + $sDestPath = _Zip_PathStripSlash($sDestPath) + If Not FileExists($sDestPath) Then + DirCreate($sDestPath) + If @error Then Return SetError(6, 0, 0) + EndIf + Local $oNS2 = _Zip_GetNameSpace($sDestPath) + If Not IsObj($oNS2) Then Return SetError(7, 0, 0) + ; process overwrite flag + Local $iOverwrite = 0 + If BitAND($iFlag, 1) Then + $iOverwrite = 1 + $iFlag -= 1 + EndIf + Local $sDestFullPath = $sDestPath & "\" & $sFileName + If FileExists($sDestFullPath) Then + ; destination file exists + If $iOverwrite Then + If StringInStr(FileGetAttrib($sDestFullPath), "D") Then + ; folder + If Not DirRemove($sDestFullPath, 1) Then Return SetError(8, 0, 0) + Else + If Not FileDelete($sDestFullPath) Then Return SetError(8, 0, 0) + EndIf + Else + Return SetError(9, 0, 0) + EndIf + EndIf + $oNS2.CopyHere($oFolderItem, $iFlag) + ; remove temp dir created by Windows + DirRemove($sTempDir, 1) + If FileExists($sDestFullPath) Then + ; success + Return 1 + Else + ; failure + Return SetError(10, 0, 0) + EndIf +EndFunc ;==>_Zip_Unzip + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_UnzipAll +; Description....: Extract all files contained in a ZIP archive +; Syntax.........: _Zip_UnzipAll($sZipFile, $sDestPath[, $iFlag = 20]) +; Parameters.....: $sZipFile - Full path to ZIP file +; $sDestPath - Full path to the destination +; $iFlag - [Optional] File copy flags (Default = 4+16) +; | 4 - No progress box +; | 8 - Rename the file if a file of the same name already exists +; | 16 - Respond "Yes to All" for any dialog that is displayed +; | 64 - Preserve undo information, if possible +; | 256 - Display a progress dialog box but do not show the file names +; | 512 - Do not confirm the creation of a new directory if the operation requires one to be created +; |1024 - Do not display a user interface if an error occurs +; |2048 - Version 4.71. Do not copy the security attributes of the file +; |4096 - Only operate in the local directory, don't operate recursively into subdirectories +; |8192 - Version 5.0. Do not copy connected files as a group, only copy the specified files +; +; Return values..: Success - 1 +; Failure - 0 and sets @error +; | 1 - zipfldr.dll does not exist +; | 2 - Library not installed +; | 3 - Not a full path +; | 4 - ZIP file does not exist +; | 5 - Failed to create destination (if necessary) +; | 6 - Failed to open destination +; | 7 - Failed to extract file(s) +; Author.........: wraithdu, torels +; Modified.......: +; Remarks........: Overwriting of destination files is controlled solely by the file copy flags (ie $iFlag = 1 is NOT valid). +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_UnzipAll($sZipFile, $sDestPath, $iFlag = 20) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Or Not _IsFullPath($sDestPath) Then Return SetError(3, 0, 0) + ; get temp dir created by Windows + Local $sTempDir = _Zip_TempDirName($sZipFile) + Local $oNS = _Zip_GetNameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + $sDestPath = _Zip_PathStripSlash($sDestPath) + If Not FileExists($sDestPath) Then + DirCreate($sDestPath) + If @error Then Return SetError(5, 0, 0) + EndIf + Local $oNS2 = _Zip_GetNameSpace($sDestPath) + If Not IsObj($oNS2) Then Return SetError(6, 0, 0) + $oNS2.CopyHere($oNS.Items(), $iFlag) + ; remove temp dir created by WIndows + DirRemove($sTempDir, 1) + If FileExists($sDestPath & "\" & $oNS.Items().Item($oNS.Items().Count - 1).Name) Then + ; success... most likely + ; checks for existence of last item from source in destination + Return 1 + Else + ; failure + Return SetError(7, 0, 0) + EndIf +EndFunc ;==>_Zip_UnzipAll + +#region INTERNAL FUNCTIONS +; #FUNCTION# ==================================================================================================== +; Name...........: _IsFullPath +; Description....: Determines if a given path is a fully qualified path (well, roughly...) +; Syntax.........: _IsFullPath($sPath) +; Parameters.....: $sPath - Path to check +; +; Return values..: Success - True +; Failure - False +; Author.........: torels +; Modified.......: +; Remarks........: +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _IsFullPath($sPath) + If StringInStr($sPath, ":\") Then + Return True + Else + Return False + EndIf +EndFunc ;==>_IsFullPath + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_AddPath +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_AddPath($sZipFile, $sPath) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + Local $oNS = _Zip_GetNameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + ; check and create directory structure + $sPath = _Zip_PathStripSlash($sPath) + Local $sNewPath = "", $sFileName = "" + If $sPath <> "" Then + Local $aDir = StringSplit($sPath, "\"), $oTest + For $i = 1 To $aDir[0] + ; check if item already exists + $oTest = $oNS.ParseName($aDir[$i]) + If IsObj($oTest) Then + ; check if folder + If Not $oTest.IsFolder Then Return SetError(5, 0, 0) + ; get next namespace level + $oNS = $oTest.GetFolder + Else + ; create temp dir + Local $sTempDir = _Zip_CreateTempDir() + If @error Then Return SetError(6, 0, 0) + Local $oTemp = _Zip_GetNameSpace($sTempDir) + ; create the directory structure + For $i = $i To $aDir[0] + $sNewPath &= $aDir[$i] & "\" + Next + DirCreate($sTempDir & "\" & $sNewPath) + $sFileName = _Zip_CreateTempName() + $sNewPath &= $sFileName + FileClose(FileOpen($sTempDir & "\" & $sNewPath, 2 + 8)) + $oNS.CopyHere($oTemp.Items()) + ; wait for file + Do + Sleep(250) + Until _Zip_ItemExists($sZipFile, $sNewPath) + DirRemove($sTempDir, 1) + ExitLoop + EndIf + Next + EndIf + Return $sFileName +EndFunc ;==>_Zip_AddPath + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_CreateTempDir +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_CreateTempDir() + Local $s_TempName + Do + $s_TempName = "" + While StringLen($s_TempName) < 7 + $s_TempName &= Chr(Random(97, 122, 1)) + WEnd + $s_TempName = @TempDir & "\~" & $s_TempName & ".tmp" + Until Not FileExists($s_TempName) + If Not DirCreate($s_TempName) Then Return SetError(1, 0, 0) + Return $s_TempName +EndFunc ;==>_Zip_CreateTempDir + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_CreateTempName +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_CreateTempName() + Local $GUID = DllStructCreate("dword Data1;word Data2;word Data3;byte Data4[8]") + DllCall("ole32.dll", "int", "CoCreateGuid", "ptr", DllStructGetPtr($GUID)) + Local $ret = DllCall("ole32.dll", "int", "StringFromGUID2", "ptr", DllStructGetPtr($GUID), "wstr", "", "int", 40) + If @error Then Return SetError(1, 0, "") + Return StringRegExpReplace($ret[2], "[}{-]", "") +EndFunc ;==>_Zip_CreateTempName + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_DllChk +; Description....: Checks if the zipfldr library is installed +; Syntax.........: _Zip_DllChk() +; Parameters.....: None. +; Return values..: Success - 1 +; Failure - 0 and sets @error +; | 1 - zipfldr.dll not found +; | 2 - Library not installed +; Author.........: wraithdu, torels +; Modified.......: +; Remarks........: +; Related........: +; Link...........: +; Example........: +; =============================================================================================================== +Func _Zip_DllChk() + If Not FileExists(@SystemDir & "\zipfldr.dll") Then Return SetError(1, 0, 0) + If Not RegRead("HKEY_CLASSES_ROOT\CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}", "") Then Return SetError(2, 0, 0) + Return 1 +EndFunc ;==>_Zip_DllChk + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_GetNameSpace +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_GetNameSpace($sZipFile, $sPath = "") + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + Local $oApp = ObjCreate("Shell.Application") + Local $oNS = $oApp.NameSpace($sZipFile) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + If $sPath <> "" Then + ; subfolder + Local $aPath = StringSplit($sPath, "\") + Local $oItem + For $i = 1 To $aPath[0] + $oItem = $oNS.ParseName($aPath[$i]) + If Not IsObj($oItem) Then Return SetError(5, 0, 0) + $oNS = $oItem.GetFolder + If Not IsObj($oNS) Then Return SetError(6, 0, 0) + Next + EndIf + Return $oNS +EndFunc ;==>_Zip_GetNameSpace + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_InternalDelete +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_InternalDelete($sZipFile, $sFileName) + If Not _Zip_DllChk() Then Return SetError(@error, 0, 0) + If Not _IsFullPath($sZipFile) Then Return SetError(3, 0, 0) + ; parse filename + Local $sPath = "" + $sFileName = _Zip_PathStripSlash($sFileName) + If StringInStr($sFileName, "\") Then + ; subdirectory, parse out path and filename + $sPath = _Zip_PathPathOnly($sFileName) + $sFileName = _Zip_PathNameOnly($sFileName) + EndIf + Local $oNS = _Zip_GetNameSpace($sZipFile, $sPath) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $oFolderItem = $oNS.ParseName($sFileName) + If Not IsObj($oFolderItem) Then Return SetError(5, 0, 0) + ; ## Ugh, this was ultimately a bad solution + ; move file to a temp directory and remove the directory + Local $sTempDir = _Zip_CreateTempDir() + If @error Then Return SetError(6, 0, 0) + Local $oApp = ObjCreate("Shell.Application") + $oApp.NameSpace($sTempDir).MoveHere($oFolderItem, 20) + DirRemove($sTempDir, 1) + $oFolderItem = $oNS.ParseName($sFileName) + If IsObj($oFolderItem) Then + ; failure + Return SetError(7, 0, 0) + Else + Return 1 + EndIf +EndFunc ;==>_Zip_InternalDelete + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_ListAll_Internal +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_ListAll_Internal($sZipFile, $sSub, ByRef $aArray, $iFullPath, $sPrefix = "") + Local $oNS = _Zip_GetNameSpace($sZipFile, $sSub) + If Not IsObj($oNS) Then Return SetError(4, 0, 0) + Local $oList = $oNS.Items(), $sSub2 + For $oItem In $oList + ; reset subdir so recursion doesn't break + $sSub2 = $sSub + If $oItem.IsFolder Then + If $sSub2 = "" Then + $sSub2 = $oItem.Name + Else + $sSub2 &= "\" & $oItem.Name + EndIf + ; folder, recurse + If $iFullPath Then + ; build path from root of zip + _Zip_ListAll_Internal($sZipFile, $sSub2, $aArray, $iFullPath, $sSub2 & "\") + If @error Then Return SetError(4) + Else + ; just filenames + _Zip_ListAll_Internal($sZipFile, $sSub2, $aArray, $iFullPath, "") + If @error Then Return SetError(4) + EndIf + Else + $aArray[0] += 1 + ReDim $aArray[$aArray[0] + 1] + $aArray[$aArray[0]] = $sPrefix & $oItem.Name + EndIf + Next +EndFunc ;==>_Zip_ListAll_Internal + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_PathNameOnly +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_PathNameOnly($sPath) + Return StringRegExpReplace($sPath, ".*\\", "") +EndFunc ;==>_Zip_PathNameOnly + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_PathPathOnly +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_PathPathOnly($sPath) + Return StringRegExpReplace($sPath, "^(.*)\\.*?$", "${1}") +EndFunc ;==>_Zip_PathPathOnly + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_PathStripSlash +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu +; =============================================================================================================== +Func _Zip_PathStripSlash($sString) + Return StringRegExpReplace($sString, "(^\\+|\\+$)", "") +EndFunc ;==>_Zip_PathStripSlash + +; #FUNCTION# ==================================================================================================== +; Name...........: _Zip_TempDirName +; Description....: INTERNAL FUNCTION +; Author.........: wraithdu, trancexxx +; =============================================================================================================== +Func _Zip_TempDirName($sZipFile) + Local $i = 0, $sTemp, $sName = _Zip_PathNameOnly($sZipFile) + Do + $i += 1 + $sTemp = @TempDir & "\Temporary Directory " & $i & " for " & $sName + Until Not FileExists($sTemp) ; this folder will be created during extraction + Return $sTemp +EndFunc ;==>_Zip_TempDirName +#endregion INTERNAL FUNCTIONS diff --git a/Installer/vi_files/UDFs/cfxUDF.au3 b/Installer/vi_files/UDFs/cfxUDF.au3 new file mode 100644 index 00000000..af9f2934 --- /dev/null +++ b/Installer/vi_files/UDFs/cfxUDF.au3 @@ -0,0 +1,211 @@ +#include-once +#cs + UDF cfx.au3 + serial functions using kernel32.dll + V1.0 + Uwe Lahni 2008 + V2.0 + Andrew Calcutt 05/16/2009 - Started converting to UDF + V2.1 + Mikko Keski-Heroja 02/23/2011 - UDF is now compatible with Opt("MustDeclareVars",1) and Date.au3. Global variable $dll is renamed to $commDll. +#ce + +Global $commDll +Global $hSerialPort +Global $dcb_Struct +Global $commtimeout +Global $commtimeout_Struct +Global $commState +Global $commState_Struct + +Global Const $STX=chr(2) +Global Const $ETX=chr(3) +Global Const $EOT=chr(4) +Global Const $ENQ=chr(5) +Global Const $ACK=chr(6) +Const $NAK=chr(15) +Const $DLE=chr(16) + +;==================================================================================== +; Function Name: _OpenComm($CommPort, $CommBaud, $CommBits, $CommParity, $CommStop, $CommCtrl, $DEBUG) +; Description: Opens serial port +; Parameters: $CommPort +; $CommBaud - default:4800 +; $CommBits - 4-8 +; $CommParity - 0=none, 1=odd, 2=even, 3=mark, 4=space +; $CommStop - 0,1,5,2 +; $CommCtrl = 0011 +; $DEBUG - Show debug messages = 1 +; Returns: on success, returns serial port id? +; on failure returns -1 and sets @error to 1 +; Note: +;==================================================================================== +Func _OpenComm($CommPort, $CommBaud = '4800', $CommBits = '8', $CommParity = '0', $CommStop = '0', $CommCtrl = '0011', $DEBUG = '0') + $commDll = DllOpen("kernel32.dll") + local $dcbs="long DCBlength;long BaudRate; long fBitFields;short wReserved;" & _ + "short XonLim;short XoffLim;byte Bytesize;byte parity;byte StopBits;byte XonChar; byte XoffChar;" & _ + "Byte ErrorChar;Byte EofChar;Byte EvtChar;short wReserved1" + + local $commtimeouts="long ReadIntervalTimeout;long ReadTotalTimeoutMultiplier;" & _ + "long ReadTotalTimeoutConstant;long WriteTotalTimeoutMultiplier;long WriteTotalTimeoutConstant" + + local const $GENERIC_READ_WRITE=0xC0000000 + local const $OPEN_EXISTING=3 + local const $FILE_ATTRIBUTE_NORMAL =0x80 + local const $NOPARITY=0 + local const $ONESTOPBIT=0 + + $dcb_Struct=DllStructCreate($dcbs) + if @error Then errpr() + + $commtimeout_Struct=DllStructCreate($commtimeouts) + if @error Then errpr() + + $hSerialPort = DllCall($commDll, "hwnd", "CreateFile", "str", "COM" & $CommPort, _ + "int", $GENERIC_READ_WRITE, _ + "int", 0, _ + "ptr", 0, _ + "int", $OPEN_EXISTING, _ + "int", $FILE_ATTRIBUTE_NORMAL, _ + "int", 0) + if @error Then errpr() + If number($hserialport[0])<1 Then + If $DEBUG = 1 Then consolewrite("Open Error" & @CRLF) + return (-1) + EndIf + $commState=dllcall($commDll,"long","GetCommState","hwnd",$hSerialPort[0],"ptr",DllStructGetPtr($dcb_Struct)) + if @error Then errpr() + DllStructSetData( $dcb_Struct,"DCBLength",DllStructGetSize($dcb_Struct)) + if @error Then errpr() + DllStructSetData( $dcb_Struct,"BaudRate",$CommBaud) + if @error Then errpr() + DllStructSetData( $dcb_Struct,"Bytesize",$CommBits) + if @error Then errpr() + DllStructSetData( $dcb_Struct,"fBitfields",number('0x' & $CommCtrl)) + if @error Then errpr() + DllStructSetData( $dcb_Struct,"Parity",$CommParity) + if @error Then errpr() + DllStructSetData( $dcb_Struct,"StopBits",'0x' & $CommStop) + if @error Then errpr() + DllStructSetData( $dcb_Struct,"XonLim",2048) + if @error Then errpr() + DllStructSetData( $dcb_Struct,"XoffLim",512) + if @error Then errpr() + $commState=dllcall($commDll,"short","SetCommState","hwnd",$hSerialPort[0],"ptr",DllStructGetPtr($dcb_Struct)) + if @error Then errpr() + If $DEBUG = 1 Then consolewrite("CommState: "& $commstate[0] & @CRLF) + if $commstate[0]=0 Then + If $DEBUG = 1 Then consolewrite("SetCommState Error" & @CRLF) + return (-1) + EndIf + DllStructSetData( $commtimeout_Struct,"ReadIntervalTimeout",-1) + $commtimeout=dllcall($commDll,"long","SetCommTimeouts","hwnd",$hSerialPort[0],"ptr",DllStructGetPtr($commtimeout_Struct)) + if @error Then errpr() + return number($hSerialPort[0]) +EndFunc + +;==================================================================================== +; Function Name: _CloseComm($CommSerialPort) +; Description: Closes serial port +; Parameters: $CommSerialPort - value returned by _OpenComm +; Returns: on success, returns 1 +; on failure returns -1 and sets @error to 1 +; Note: +;==================================================================================== +Func _CloseComm($CommSerialPort, $DEBUG = 0) + local $closeerr=DllCall($commDll, "int", "CloseHandle", "hwnd", $CommSerialPort) + if @error Then + errpr() + Exit + EndIf + If $DEBUG = 1 Then ConsoleWrite("Close " & $closeerr[0] & @crlf) + return($closeerr[0]) +EndFunc + +Func _tx($CommSerialPort, $t, $DEBUG = 0) + if $DEBUG=1 then FileWriteLine("debug.txt","Send " &c2s($t)) + local $lptr0=dllstructcreate("long_ptr") + local $tbuf=$t + local $txr=dllcall($commDll,"int","WriteFile","hwnd",$CommSerialPort, _ + "str",$tbuf, _ + "int",stringlen($tbuf), _ + "long_ptr", DllStructGetPtr($lptr0), _ + "ptr", 0) + if @error Then errpr() +EndFunc + +;==================================================================================== +; Function Name: _rxwait($CommSerialPort, $MinBufferSize, $MaxWaitTime, $DEBUG = 0) +; Description: Recieves data +; Parameters: $CommSerialPort - value returned by _OpenComm +; $MinBufferSize - Buffer size to wait for +; $MaxWaitTime - Maximum time to wait before failing +; $DEBUG - Show debug messages +; Returns: on success, returns 1 +; on failure returns -1 and sets @error to 1 +; Note: +;==================================================================================== +Func _rxwait($CommSerialPort, $MinBufferSize, $MaxWaitTime, $DEBUG = 0) + if $DEBUG=1 then ConsoleWrite("Wait " & $MinBufferSize & " " & $MaxWaitTime & @CRLF) + Local $rxbuf + local $jetza=TimerInit() + local $lptr0=dllstructcreate("long_ptr") + + local $rxr, $rxl, $to + Do + $rxr=dllcall($commDll,"int","ReadFile","hwnd",$CommSerialPort, _ + "str"," ", _ + "int",1, _ + "long_ptr", DllStructGetPtr($lptr0), _ + "ptr", 0) + if @error Then errpr() + $rxl=DllStructGetData($lptr0,1) + if $DEBUG=1 then ConsoleWrite("R0:" & $rxr[0] & " |R1:" & $rxr[1] & " |R2:" & $rxr[2] & " |rxl:" & $rxl & " |R4:" & $rxr[4] & @CRLF) + if $rxl>=1 then + $rxbuf&=$rxr[2] + EndIf + $to=TimerDiff($jetza) + Until stringlen($rxbuf) >= $MinBufferSize OR $to > $MaxWaitTime + Return($rxbuf) +EndFunc + +Func _rx($rxbuf, $n=0, $DEBUG = 0) + local $r + if StringLen($rxbuf)<$n then + $rxbuf="" + Return("") + EndIf + If $n=0 Then + $r=$rxbuf + $rxbuf="" + Return($r) + EndIf + If $n<0 then + $rxbuf="" + Return("") + EndIf + $r=Stringleft($rxbuf,$n) + local $rl=Stringlen($rxbuf) + $rxbuf=StringRight($rxbuf,$rl-$n) + if $DEBUG=1 then FileWriteLine("debug.txt","Read " & c2s($r)) + return($r) +EndFunc + +Func c2s($t) + local $tc + local $ts="" + For $ii= 1 To StringLen($t) + $tc=StringMid($t,$ii,1) + if Asc($tc)<32 Then + $ts&="<" & asc($tc) & ">" + Else + $ts&=$tc + EndIf + Next + return $ts +EndFunc + + +func errpr() + consolewrite ("Error " & @error & @CRLF) +EndFunc diff --git a/Installer/vi_files/UDFs/oLinkedList.au3 b/Installer/vi_files/UDFs/oLinkedList.au3 new file mode 100644 index 00000000..b435f3dc --- /dev/null +++ b/Installer/vi_files/UDFs/oLinkedList.au3 @@ -0,0 +1,103 @@ +#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 + +#include-once +#include "AutoItObject.au3" + +; special thanks to wraithdu for his contribution + +Func __Element__($data, $nextEl = 0) + Local $oClassObj = _AutoItObject_Class() + $oClassObj.AddProperty("next", $ELSCOPE_PUBLIC, 0) + $oClassObj.AddProperty("data", $ELSCOPE_PUBLIC, 0) + Local $oObj = $oClassObj.Object + $oObj.next = $nextEl + $oObj.data = $data + Return $oObj +EndFunc ;==>__Element__ + +Func LinkedList() + Local $oClassObj = _AutoItObject_Class() + ; Properties + $oClassObj.AddProperty("first", $ELSCOPE_PUBLIC, 0) + $oClassObj.AddProperty("last", $ELSCOPE_PUBLIC, 0) + $oClassObj.AddProperty("size", $ELSCOPE_PUBLIC, 0) + ; Methods + $oClassObj.AddMethod("count", "_LinkedList_count") + $oClassObj.AddMethod("add", "_LinkedList_add") + $oClassObj.AddMethod("at", "_LinkedList_at") + $oClassObj.AddMethod("remove", "_LinkedList_remove") + ; Enum + $oClassObj.AddEnum("_LinkedList_Enumnext", "_LinkedList_EnumReset") + ; Return created object + Return $oClassObj.Object +EndFunc ;==>LinkedList + +Func _LinkedList_remove($self, $index) + If $self.size = 0 Then Return SetError(1, 0, 0) + Local $current = $self.first + Local $previous = 0 + Local $i = 0 + Do + If $i = $index Then + If $self.size = 1 Then + ; very last element + $self.first = 0 + $self.last = 0 + ElseIf $i = 0 Then + ; first element + $self.first = $current.next + Else + If $i = $self.size - 1 Then $self.last = $previous ; last element + $previous.next = $current.next + EndIf + $self.size = $self.size - 1 + Return + EndIf + $i += 1 + $previous = $current + $current = $current.next + Until $current = 0 + Return SetError(2, 0, 0) +EndFunc ;==>_LinkedList_remove + +Func _LinkedList_add($self, $newdata) + Local $iSize = $self.size + Local $oLast = $self.last + If $iSize = 0 Then + $self.first = __Element__($newdata) + $self.last = $self.first + Else + $oLast.next = __Element__($newdata) + $self.last = $oLast.next + EndIf + $self.size = $iSize + 1 +EndFunc ;==>_LinkedList_add + +Func _LinkedList_at($self, $index) + Local $i = 0 + For $Element In $self + If $i = $index Then Return $Element + $i += 1 + next + Return SetError(1, 0, 0) +EndFunc ;==>_LinkedList_at + +Func _LinkedList_count($self) + Return $self.size +EndFunc ;==>_LinkedList_count + +Func _LinkedList_EnumReset(ByRef $self, ByRef $iterator) + #forceref $self + $iterator = 0 +EndFunc ;==>_LinkedList_EnumReset + +Func _LinkedList_Enumnext(ByRef $self, ByRef $iterator) + If $self.size = 0 Then Return SetError(1, 0, 0) + If Not IsObj($iterator) Then + $iterator = $self.first + Return $iterator.data + EndIf + If Not IsObj($iterator.next) Then Return SetError(1, 0, 0) + $iterator = $iterator.next + Return $iterator.data +EndFunc ;==>_LinkedList_Enumnext diff --git a/Installer/vi_files/UDFs/rijndael.au3 b/Installer/vi_files/UDFs/rijndael.au3 new file mode 100644 index 00000000..70fbb036 --- /dev/null +++ b/Installer/vi_files/UDFs/rijndael.au3 @@ -0,0 +1,4892 @@ +;=============================================================================== +; +; Name: _rijndaelCipher +; Description: Encrypts data using the rijndael (AES) algorithm +; Parameter(s): $key - String or binary that is used as the key for the encryption +; Can be 16, 20, 24, 28, or 32 in length +; $message - The data to be encrypted, can be a string or binary +; $BlockSize - The size of data blocks to be encrypted. Values can be: +; 128 (Default, also the actual size used by AES) +; 160 +; 192 +; 224 +; 256 +; $mode - Which encryption mode to use. Values can be: +; 0 - ECB mode (Default) +; 1 - CBC mode +; 2 - CBF mode +; 3 - OBF mode +; 4 - CTR mode +; $iv - The initialization vector, only used in modes 1-4, defaults to '' +; Can be a string or binary with length equal to $BlockSize / 8 +; $padding - Which padding scheme to use if the message length isn't a multiple of BlockSize / 8 +; Doesn't apply to modes 2-4. Values can be: +; 0 - Null byte padding (Default) +; 1 - Pad with a number of bytes, whose value equals the number used, to fill in the block +; 2 - Pad with 80 & Null bytes +; 3 - Ciphertext Stealing +; Requirement(s): None +; Return Value(s): On Success - Binary containing the encrypted data +; On Failure - 0 and Set +; @ERROR to: 1 - Invalid $BlockSize +; 2 - Invalid Key Length +; 3 - Invalid $mode +; 4 - @EXTENDED: 0 - $padding out of Range +; 1 - $message not long enough for $padding = 3 (See Notes) +; 5 - Invalid $iv size +; Author(s): Matthew Robinson (SkinnyWhiteGuy) +; Note(s): For @Error 4, @Extended 1, the Message should be longer than one block +; (Len($message) should be greater than $BlockSize / 8) +; Padding schemes 0 - 2 may produce output longer than the input +; Padding scheme 3 produces output the same length as the input +; For more information, visit these links: +; http://en.wikipedia.org/wiki/Rijndael +; http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation +; http://en.wikipedia.org/wiki/Padding_%28cryptography%29 +; http://en.wikipedia.org/wiki/Ciphertext_stealing +; +;=============================================================================== +Func _rijndaelCipher($key, $message, $BlockSize = 128, $mode = 0, $iv = '', $padding = 0) + Switch $BlockSize + Case 128, 160, 192, 224, 256 + Case Else + Return SetError(1,0,0) + EndSwitch + Switch BinaryLen($key) + Case 16,20,24,28,32 + Case Else + Return SetError(2,0,0) + EndSwitch + If $mode < 0 Or $mode > 4 Then Return SetError(3,0,0) + If $padding < 0 Or $padding > 3 Then Return SetError(4,0,0) + + If $padding = 3 Then + If $mode > 1 Then + Return SetError(4,1,0) + Else + If BinaryLen($message) <= ($BlockSize / 8) Then + Return SetError(4,2,0) + EndIf + EndIf + EndIf + + If $iv <> "" Then + If BinaryLen($iv) <> ($BlockSize/8) Then Return SetError(5,0,0) + EndIf + Local $m = 0, $fill, $plainNow, $plainNext + Local $result, $tempresult, $ct, $d, $P, $temp, $Cn, $i + Local $BlockBytes = $BlockSize / 8 + If Not IsBinary($message) Then $message = StringToBinary($message) + If Not IsBinary($key) Then $key = StringToBinary($key) + If Not IsBinary($iv) Then $iv = StringToBinary($iv) + Local $Nb = $BlockSize / 32 ; 128 bits per message block divided into 32-bit words + Local $Nk = BinaryLen($key) / 4 + Local $Nr = 6 + _Max($Nb, $Nk) + Local $s[$Nb] + Local $w = expand_key($key, $Nb, $Nk, $Nr) + + Local $zeros = Binary('0x0000000000000000000000000000000000000000000000000000000000000000') + If $iv = "" Then $iv = BinaryMid($zeros,1,$BlockBytes) + + ; If Mode is ECB(0) or CBC(1), and not CTS, then Make sure the message is a multiple of the State Size + If $mode < 2 And $padding <> 3 Then + Switch $padding + Case 0 + If Mod(BinaryLen($message),$BlockBytes) <> 0 Then + $message &= BinaryMid($zeros,1,$BlockBytes - Mod(BinaryLen($message),$BlockBytes)) + EndIf + Case 1 + $fill = $BlockBytes + If Mod(BinaryLen($message),$BlockBytes) <> 0 Then + $fill = $BlockBytes - Mod(BinaryLen($message),$BlockBytes) + EndIf + For $i = 1 To $fill + $message &= Binary('0x' & Hex($fill,2)) + Next + Case 2 + $message &= Binary('0x80') + If Mod(BinaryLen($message),$BlockBytes) <> 0 Then + $message &= BinaryMid($zeros,1,$BlockBytes - Mod(BinaryLen($message),$BlockBytes)) + EndIf + EndSwitch + EndIf + Local $len = BinaryLen($message) ; Number of bytes in $message + Local $blocks = Ceiling($len/$BlockBytes) ; Number of blocks in $message + + ; For each plaintext block, run the encryption + For $m = 1 To $blocks + $plainNow = BinaryMid($message,($m-1)*$BlockBytes+1,$BlockBytes) + If $m < $blocks Then + $plainNext = BinaryMid($message,$m*$BlockBytes+1,$BlockBytes) + EndIf + ; This is where I need to start checking for the different modes, that pass different values + ; on to be encrypted for s and all that + For $i = 0 To $Nb - 1 + Switch $mode + Case 0 ; ECB mode + If $padding <> 3 Or $m < $blocks Then + $s[$i] = _Dec(BinaryMid($plainNow,$i*4+1,4)) + Else + $s[$i] = _Dec(BinaryMid($d,$i*4+1,4)) ; Use $d, which we will setup after encryption of the previous block + EndIf + Case 1 ; CBC mode + If $padding <> 3 Then + If $m = 1 Then ; If we are still on the first block + $s[$i] = BitXOR(_Dec(BinaryMid($plainNow,$i*4+1,4)),_Dec(BinaryMid($iv,$i*4+1,4))) ; XOR the plaintext with the IV + Else ; Otherwise, use the previous ciphertext block made + $s[$i] = BitXOR(_Dec(BinaryMid($plainNow,$i*4+1,4)),_Dec(BinaryMid($tempresult,$i*4+1,4))) ; XOR the plaintext with the previous cipher block + EndIf + Else + ; Check for correct round to modify, otherwise continue as normal + If $m = 1 Then ; First block uses IV + $s[$i] = BitXOR(_Dec(BinaryMid($plainNow,$i*4+1,4)),_Dec(BinaryMid($iv,$i*4+1,4))) ; XOR the plaintext with the IV + ElseIf $m < $blocks Then ; From there till the last 2, use the previous cipher block as normal + $s[$i] = BitXOR(_Dec(BinaryMid($plainNow,$i*4+1,4)),_Dec(BinaryMid($tempresult,$i*4+1,4))) ; XOR the plaintext with the previous cipher block + Else ; Now is where we start mixing things up + $s[$i] = BitXOR(_Dec(BinaryMid($P,$i*4+1,4)),_Dec(BinaryMid($Cn,$i*4+1,4))) ; Use the adjusted values from before + EndIf + EndIf + Case 2 ; CFB mode + ; Use the IV for the State array input at first, then use the ciphertext from the last round + If $m = 1 Then + $s[$i] = _Dec(BinaryMid($iv,$i*4+1,4)) + Else + $s[$i] = _Dec(BinaryMid($tempresult,$i*4+1,4)) + EndIf + Case 3 ; OFB mode + ; Use the IV for the first round, then use the results from the Cipher last time in the rest + If $m = 1 Then + $s[$i] = _Dec(BinaryMid($iv,$i*4+1,4)) + EndIf + ; No need to set the state, it should still hold the value it did from the last loop :) + Case 4 ; CTR mode + ; Use the IV XOR'd with a Counter (probably round #) as the state + $s[$i] = BitXOR(_Dec(BinaryMid($iv,$i*4+1,4)),$m) + EndSwitch + Next + + ; After loading the State ,Run the Encryption on it + $s = Cipher($w, $s, $Nb, $Nk, $Nr) + $tempresult = '' + + ; Read the now encrypted state into the ciphertext array + For $i = 0 To $Nb - 1 + Switch $mode + Case 0, 1 ; ECB & CBC mode + If $padding <> 3 Or $m < $blocks - 1 Then + $tempresult = Binary($tempresult) & _Bin($s[$i]) + Else ; CTS + $temp = Binary($temp) & _Bin($s[$i]) + If $i = $Nb - 1 Then ; Wait till we have all the cipherblock from the state written + If $mode = 0 Then + If $m = $blocks - 1 Then ; Next to last cipherblock + $MBytes = BinaryLen($plainNext) ; Number of blocks to get from the beginning of the cipherblock + $Cn = $temp ; Store this until the last cipherblock is found, so they can be switched properly + $d = Binary($plainNext) & BinaryMid($temp,$MBytes+1,$BlockBytes-$MBytes) ; Setup $d for the next round + $temp = '' ; Clear $temp for next round + ElseIf $m = $blocks Then ; Last cipherblock + $result = Binary($result) & Binary($temp); add this cipher block as the next to last + $tempresult = $Cn ; setup $Cn to be added as the last block + EndIf + ElseIf $mode = 1 Then + If $m = $blocks - 1 Then ; Next to last cipherblock + $MBytes = BinaryLen($plainNext) ; Number of blocks in the last plaintext block + $Cn = $temp ; Store this for the next round + $P = Binary($plainNext) & BinaryMid(Binary($zeros),1,$BlockBytes-$MBytes) + $temp = '' ; Clear $temp for next round + ElseIf $m = $blocks Then ; Last cipherblock + $result = Binary($result) & Binary($temp); Insert this block before the one before + $tempresult = $Cn ; setup $Cn to be added as the last block + EndIf + EndIf + EndIf + EndIf + Case 2, 3, 4 ; CFB, OFB, & CTR mode + $tempresult = Binary($tempresult) & _Bin(BitXOR($s[$i],_Dec(BinaryMid($plainNow,$i*4+1,4)))) + EndSwitch + Next + + $result = Binary($result) & Binary($tempresult) + Next + + If $mode < 2 And $padding = 3 Then + $result = BinaryMid($result,1,BinaryLen($message)) + EndIf + + Return $result +EndFunc + +;=============================================================================== +; +; Name: _rijndaelInvCipher +; Description: Decrypts data using the rijndael (AES) algorithm +; Parameter(s): $key - String or binary that is used as the key for the decryption +; Can be 16, 20, 24, 28, or 32 in length +; $message - The data to be encrypted, can be a string or binary +; $BlockSize - The size of data blocks to be decrypted. Values can be: +; 128 (Default, also the actual size used by AES) +; 160 +; 192 +; 224 +; 256 +; $mode - Which decryption mode to use. Values can be: +; 0 - ECB mode (Default) +; 1 - CBC mode +; 2 - CBF mode +; 3 - OBF mode +; 4 - CTR mode +; $iv - The initialization vector, only used in modes 1-4, defaults to '' +; Can be a string or binary with length equal to $BlockSize / 8 +; $padding - Which padding scheme to use if the message length isn't a multiple of BlockSize / 8 +; Doesn't apply to modes 2-4. Values can be: +; 0 - Null byte padding (Default) +; 1 - Pad with a number of bytes, whose value equals the number used, to fill in the block +; 2 - Pad with 80 & Null bytes +; 3 - Ciphertext Stealing +; Requirement(s): None +; Return Value(s): On Success - Binary containing the decrypted data +; On Failure - 0 and Set +; @ERROR to: 1 - Invalid $BlockSize +; 2 - Invalid Key Length +; 3 - Invalid $mode +; 4 - @EXTENDED: 0 - $padding out of Range +; 1 - $message not long enough for $padding = 3 (See Notes) +; 5 - Invalid $iv size +; Author(s): Matthew Robinson (SkinnyWhiteGuy) +; Note(s): For @Error 4, @Extended 1, the Message should be longer than one block +; (Len($message) should be greater than $BlockSize / 8) +; Padding schemes 0 - 2 may produce output longer than the input +; Padding scheme 3 produces output the same length as the input +; For more information, visit these links: +; http://en.wikipedia.org/wiki/Rijndael +; http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation +; http://en.wikipedia.org/wiki/Padding_%28cryptography%29 +; http://en.wikipedia.org/wiki/Ciphertext_stealing +; +;=============================================================================== +Func _rijndaelInvCipher($key, $message, $BlockSize=128, $mode = 0, $iv = '', $padding = 0) + Switch $BlockSize + Case 128, 160, 192, 224, 256 + Case Else + Return SetError(1,0,0) + EndSwitch + Switch BinaryLen($key) + Case 16,20,24,28,32 + Case Else + Return SetError(2,0,0) + EndSwitch + If $mode < 0 Or $mode > 4 Then Return SetError(3,0,0) + If $padding < 0 Or $padding > 3 Then Return SetError(4,0,0) + + If $padding = 3 Then + If $mode > 1 Then + Return SetError(4,1,0) + Else + If BinaryLen($message) <= ($BlockSize / 8) Then + Return SetError(4,2,0) + EndIf + EndIf + EndIf + + If $iv <> "" Then + If BinaryLen($iv) <> ($BlockSize/8) Then Return SetError(5,0,0) + EndIf + Local $result, $tempresult, $ct, $pct, $En, $Pn, $temp, $C + Local $i, $j, $m=0, $n + Local $CipherBefore, $CipherPrev, $CipherNow, $CipherNext + Local $BlockBytes = $BlockSize / 8 + If Not IsBinary($message) Then $message = Binary($message) + If Not IsBinary($key) Then $key = Binary($key) + Local $Nb = $BlockSize / 32 ; 128 bits per message block divided into 32-bit words + Local $len = BinaryLen($message) ; Number of bytes in $message + Local $blocks = Ceiling($len/$BlockBytes) ; Number of blocks in $message + Local $Nk = BinaryLen($key) / 4 + Local $Nr = 6 + _Max($Nb, $Nk) + Local $s[$Nb] + If $mode < 2 Then + Local $w = inv_key($key, $Nb, $Nk, $Nr) + Else + Local $w = expand_key($key, $Nb, $Nk, $Nr) + EndIf + + Local $zeros = Binary('0x0000000000000000000000000000000000000000000000000000000000000000') + If $iv = "" Then $iv = BinaryMid($zeros,1,$BlockBytes) + + ; Read in the Message into the State $BlockBytes bytes at a time + For $m = 1 To $blocks + $CipherNow = BinaryMid($message,($m-1)*$BlockBytes+1,$BlockBytes) + If $m+1 < $blocks Then + $CipherNext = BinaryMid($message,($m)*$BlockBytes+1,$BlockBytes) + EndIf + For $i = 0 To $Nb - 1 + Switch $mode + Case 0, 1 ; ECB & CBC mode + If $padding <> 3 Or $m < $blocks - 1 Then + $s[$i] = _Dec(BinaryMid($CipherNow,$i*4+1,4)) + Else + $s[$i] = _Dec(BinaryMid($En,$i*4+1,4)) + EndIf + Case 2 ; CFB mode + ; Use the IV for the state array on the first entry, then use the previous ciphertext entry on the other rounds + If $m = 1 Then + $s[$i] = _Dec(BinaryMid($iv,$i*4+1,4)) + Else + $s[$i] = _Dec(BinaryMid($CipherPrev,$i*4+1,4)) + EndIf + Case 3 ; OFB mode + ; Use the IV for the first round, then use the encryption results from the last round on all other rounds + If $m = 1 Then + $s[$i] = _Dec(BinaryMid($iv,$i*4+1,4)) + EndIf + Case 4 ; CTR mode + ; Use the IV XOR'd with a counter (probably round #) as the state + $s[$i] = BitXOR(_Dec(BinaryMid($iv,$i*4+1,4)),$m) + EndSwitch + Next + + If $mode < 2 Then + $s = InvCipher($w, $s, $Nb, $Nk, $Nr) + Else + $s = Cipher($w, $s, $Nb, $Nk, $Nr) + EndIf + + For $i = 0 To $Nb - 1 + Switch $mode + Case 0 ; ECB mode + If $padding <> 3 Or $m < $blocks - 1 Then + $tempresult = Binary($tempresult) & _Bin($s[$i]) + Else + $temp = Binary($temp) & _Bin($s[$i]) ; Load the cipherblock into a form I can manipulate + If $i = $Nb - 1 Then + If $m = $blocks - 1 Then + $MBytes = BinaryLen($CipherNext) ; Number of blocks to get from the beginning of the cipherblock + $En = Binary($CipherNext) & BinaryMid($temp,$MBytes+1,$BlockBytes-$MBytes) ; Set the Next decryption round to use the last bit of the Ciphertext, and the filling amount of the just decrypted text + $Pn = $temp + $temp = '' + ElseIf $m = $blocks Then + $result = Binary($result) & Binary($temp) ; Add the block just decrypted + $tempresult = $Pn; setup the last block to be inserted like normal + EndIf + EndIf + EndIf + Case 1 ; CBC mode + If $padding <> 3 Then + If $m == 1 Then + $tempresult = Binary($tempresult) & _Bin(BitXOR($s[$i],_Dec(BinaryMid($iv,$i*4+1,4)))) + Else + $tempresult = Binary($tempresult) & _Bin(BitXOR($s[$i],_Dec(BinaryMid($CipherPrev,$i*4+1,4)))) + EndIf + Else + ; Check for correct round, and modify what's needed + If $m < $blocks - 1 Then + If $blocks > 2 And $m = 1 Then + $tempresult = Binary($tempresult) & _Bin(BitXOR($s[$i],_Dec(BinaryMid($iv,$i*4+1,4)))) + Else + $tempresult = Binary($tempresult) & _Bin(BitXOR($s[$i],_Dec(BinaryMid($CipherPrev,$i*4+1,4)))) + EndIf + Else + $temp = Binary($temp) & _Bin($s[$i]) ; Load the cipherblock into a form I can work with + If $i = $Nb - 1 Then + If $m = $blocks - 1 Then + $MBytes = BinaryLen($CipherNext) ; Number of blocks in the final ciphertext block + $C = Binary($CipherNext) & BinaryMid(Binary($zeros),1,$BlockBytes-$MBytes) + For $j = 0 To $Nb - 1 + $Pn = Binary($Pn) & _Bin(BitXOR(_Dec(BinaryMid($temp,$j*4+1,4)),_Dec(BinaryMid($C,$j*4+1,4)))) + Next + $En = Binary($CipherNext) & BinaryMid($Pn,$MBytes+1,$BlockBytes-$MBytes) + $temp = '' + ElseIf $m = $blocks Then + If $m - 2 < 1 Then + $n = $iv + Else + $n = $CipherBefore + EndIf + For $j = 0 To $Nb - 1 + $result = Binary($result) & _Bin(BitXOR(_Dec(BinaryMid($temp,$j*4+1,4)),_Dec(BinaryMid($n,$j*4+1,4)))) + Next + $tempresult = $Pn + EndIf + EndIf + EndIf + EndIf + Case 2, 3, 4 ; CFB, OFB, & CTR mode + ; XOR the results of the Cipher with the CipherText to produce the PlainText + $tempresult = Binary($tempresult) & _Bin2(BitXOR($s[$i],_Dec(BinaryMid($CipherNow,$i*4+1,4)))) + EndSwitch + Next + + $result = Binary($result) & Binary($tempresult) + $tempresult = '' + $CipherBefore = $CipherPrev + $CipherPrev = $CipherNow + Next + + ; Remove padding bytes from String, if mode allows it + If $mode < 2 Then + Switch $padding + Case 0 + While BinaryMid($result,BinaryLen($result),1) = Binary('0x00') + $result = BinaryMid($result,1,BinaryLen($result)-1) + WEnd + Case 1 + $result = BinaryMid($result,1,BinaryLen($result)-_Dec(BinaryMid($result,BinaryLen($result),1))) + Case 2 + While BinaryMid($result,BinaryLen($result),1) <> Binary('0x80') + $result = BinaryMid($result,1,BinaryLen($result)-1) + WEnd + $result = BinaryMid($result,1,BinaryLen($result)-1) + Case 3 + $result = BinaryMid($result,1,BinaryLen($message)) + EndSwitch + EndIf + + Return $result +EndFunc + +;=============================================================================== +; +; Name: _rijndaelHash +; Description: Hashes data using the rijndael (AES) algorithm +; Parameter(s): $message - The data to be encrypted, can be a string or binary +; $BlockSize - The size of the hash Returned. Values can be: +; 128 (Default, also the actual size used by AES) +; 160 +; 192 +; 224 +; 256 +; $mode - Which hashing mode to use. Values can be: +; 0 - Davies-Meyer Hash (Default) +; 1 - Extended Davies-Meyer Hash +; 2 - Matyas-Meyer-Oseas Hash +; 3 - Miyaguchi-Preneel Hash +; $iv - The initialization vector, only used in modes 1-4, defaults to '' +; Can be a string or binary with length equal to $BlockSize / 8 +; Requirement(s): None +; Return Value(s): On Success - Binary containing the encrypted data +; On Failure - 0 and Set +; @ERROR to: 1 - Invalid $BlockSize +; 2 - Invalid $mode +; 3 - Invalid $iv size +; Author(s): Matthew Robinson (SkinnyWhiteGuy) +; Note(s): For @Error 4, @Extended 1, the Message should be longer than one block +; (Len($message) should be greater than $BlockSize / 8) +; Padding schemes 0 - 2 may produce output longer than the input +; Padding scheme 3 produces output the same length as the input +; For more information, visit these links: +; http://en.wikipedia.org/wiki/Rijndael +; http://en.wikipedia.org/wiki/One-way_compression_function +; +;=============================================================================== +Func _rijndaelHash($message, $BlockSize = 128, $mode = 0, $iv = '') + Switch $BlockSize + Case 128, 160, 192, 224, 256 + Case Else + Return SetError(1,0,0) + EndSwitch + If $mode < 0 Or $mode > 3 Then Return SetError(2,0,0) + If $iv <> "" Then + If BinaryLen($iv) <> ($BlockSize/8) Then Return SetError(3,0,0) + EndIf + Local $m = 0, $plainNow, $hashPrev + Local $result, $i + Local $BlockBytes = $BlockSize / 8 + If Not IsBinary($message) Then $message = StringToBinary($message) + If Not IsBinary($iv) Then $iv = StringToBinary($iv) + Local $zeros = Binary('0x0000000000000000000000000000000000000000000000000000000000000000') + If $iv = "" Then $iv = BinaryMid($zeros,1,$BlockBytes) + Local $Nb = $BlockSize / 32 ; 128 bits per message block divided into 32-bit words + Local $Nk = BinaryLen($iv) / 4 + Local $Nr = 6 + _Max($Nb, $Nk) + Local $s[$Nb], $p[$Nb] + + ; Load the IV to the Previous Hash value for the first run through + For $i = 0 To $Nb - 1 + $p[$i] = _Dec(BinaryMid($iv,$i*4+1,4)) + Next + + ; Add 0's to last block if needed, should be the only padding needed + If Mod(BinaryLen($message),$BlockBytes) <> 0 Then + $message &= BinaryMid($zeros,1,$BlockBytes - Mod(BinaryLen($message),$BlockBytes)) + EndIf + Local $len = BinaryLen($message) ; Number of bytes in $message + Local $blocks = Ceiling($len/$BlockBytes) ; Number of blocks in $message + + ; For each plaintext block, run the encryption + For $m = 1 To $blocks + $plainNow = BinaryMid($message,($m-1)*$BlockBytes+1,$BlockBytes) + + ; For Mode 0 (Davies-Meyer), plaintext is key, previous hash is current state + Switch $mode + Case 0, 1 + Local $w = expand_key($plainNow, $Nb, $Nk, $Nr) + For $i = 0 To $Nb - 1 + $s[$i] = $p[$i] + Next + Case 2, 3 + For $i = 0 To $Nb - 1 + $hashPrev = Binary($hashPrev) & _Bin($p[$i]) + $s[$i] = _Dec(BinaryMid($plainNow,$i*4+1,4)) + Next + Local $w = expand_key($hashPrev, $Nb, $Nk, $Nr) + EndSwitch + + ; After loading the State ,Run the Encryption on it + $s = Cipher($w, $s, $Nb, $Nk, $Nr) + + ;For Mode 0 (Davies-Meyer), XOR Previous hash with the results of the hash to provide the current hash + Switch $mode + Case 0, 2 + For $i = 0 To $Nb - 1 + $s[$i] = BitXOR($s[$i],$p[$i]) + Next + Case 1, 3 + For $i = 0 To $Nb - 1 + $s[$i] = BitXOR($s[$i],$p[$i],_Dec(BinaryMid($plainNow,$i*4+1,4))) + Next + EndSwitch + + ; Setup the previous state for the next round + $p = $s + $hashPrev = "" + Next + + ; Read the now encrypted state into the ciphertext array + For $i = 0 To $Nb - 1 + $result = Binary($result) & _Bin($s[$i]) + Next + + Return $result +EndFunc + +;================================================================================ +; Internal Functions, Called by AES_Cipher & AES_InvCipher +;================================================================================ + +Func expand_key($key, $Nb, $Nk, $Nr) + Local $RCon[60] + $RCon[0] = 0x00000000 + $RCon[1] = 0x01000000 + $RCon[2] = 0x02000000 + $RCon[3] = 0x04000000 + $RCon[4] = 0x08000000 + $RCon[5] = 0x10000000 + $RCon[6] = 0x20000000 + $RCon[7] = 0x40000000 + $RCon[8] = 0x80000000 + $RCon[9] = 0x1B000000 + $RCon[10] = 0x36000000 + $RCon[11] = 0x6C000000 + $RCon[12] = 0xD8000000 + $RCon[13] = 0xAB000000 + $RCon[14] = 0x4D000000 + $RCon[15] = 0x9A000000 + $RCon[16] = 0x2F000000 + $RCon[17] = 0x5E000000 + $RCon[18] = 0xBC000000 + $RCon[19] = 0x63000000 + $RCon[20] = 0xC6000000 + $RCon[21] = 0x97000000 + $RCon[22] = 0x35000000 + $RCon[23] = 0x6A000000 + $RCon[24] = 0xD4000000 + $RCon[25] = 0xB3000000 + $RCon[26] = 0x7D000000 + $RCon[27] = 0xFA000000 + $RCon[28] = 0xEF000000 + $RCon[29] = 0xC5000000 + $RCon[30] = 0x91000000 + $RCon[31] = 0x39000000 + $RCon[32] = 0x72000000 + $RCon[33] = 0xE4000000 + $RCon[34] = 0xD3000000 + $RCon[35] = 0xBD000000 + $RCon[36] = 0x61000000 + $RCon[37] = 0xC2000000 + $RCon[38] = 0x9F000000 + $RCon[39] = 0x25000000 + $RCon[40] = 0x4A000000 + $RCon[41] = 0x94000000 + $RCon[42] = 0x33000000 + $RCon[43] = 0x66000000 + $RCon[44] = 0xCC000000 + $RCon[45] = 0x83000000 + $RCon[46] = 0x1D000000 + $RCon[47] = 0x3A000000 + $RCon[48] = 0x74000000 + $RCon[49] = 0xE8000000 + $RCon[50] = 0xCB000000 + $RCon[51] = 0x8D000000 + $RCon[52] = 0x01000000 + $RCon[53] = 0x02000000 + $RCon[54] = 0x04000000 + $RCon[55] = 0x08000000 + $RCon[56] = 0x10000000 + $RCon[57] = 0x20000000 + $RCon[58] = 0x40000000 + $RCon[59] = 0x1B000000 + Local $Te4[256] + $Te4[0] = 0x63636363 + $Te4[1] = 0x7C7C7C7C + $Te4[2] = 0x77777777 + $Te4[3] = 0x7B7B7B7B + $Te4[4] = 0xF2F2F2F2 + $Te4[5] = 0x6B6B6B6B + $Te4[6] = 0x6F6F6F6F + $Te4[7] = 0xC5C5C5C5 + $Te4[8] = 0x30303030 + $Te4[9] = 0x01010101 + $Te4[10] = 0x67676767 + $Te4[11] = 0x2B2B2B2B + $Te4[12] = 0xFEFEFEFE + $Te4[13] = 0xD7D7D7D7 + $Te4[14] = 0xABABABAB + $Te4[15] = 0x76767676 + $Te4[16] = 0xCACACACA + $Te4[17] = 0x82828282 + $Te4[18] = 0xC9C9C9C9 + $Te4[19] = 0x7D7D7D7D + $Te4[20] = 0xFAFAFAFA + $Te4[21] = 0x59595959 + $Te4[22] = 0x47474747 + $Te4[23] = 0xF0F0F0F0 + $Te4[24] = 0xADADADAD + $Te4[25] = 0xD4D4D4D4 + $Te4[26] = 0xA2A2A2A2 + $Te4[27] = 0xAFAFAFAF + $Te4[28] = 0x9C9C9C9C + $Te4[29] = 0xA4A4A4A4 + $Te4[30] = 0x72727272 + $Te4[31] = 0xC0C0C0C0 + $Te4[32] = 0xB7B7B7B7 + $Te4[33] = 0xFDFDFDFD + $Te4[34] = 0x93939393 + $Te4[35] = 0x26262626 + $Te4[36] = 0x36363636 + $Te4[37] = 0x3F3F3F3F + $Te4[38] = 0xF7F7F7F7 + $Te4[39] = 0xCCCCCCCC + $Te4[40] = 0x34343434 + $Te4[41] = 0xA5A5A5A5 + $Te4[42] = 0xE5E5E5E5 + $Te4[43] = 0xF1F1F1F1 + $Te4[44] = 0x71717171 + $Te4[45] = 0xD8D8D8D8 + $Te4[46] = 0x31313131 + $Te4[47] = 0x15151515 + $Te4[48] = 0x04040404 + $Te4[49] = 0xC7C7C7C7 + $Te4[50] = 0x23232323 + $Te4[51] = 0xC3C3C3C3 + $Te4[52] = 0x18181818 + $Te4[53] = 0x96969696 + $Te4[54] = 0x05050505 + $Te4[55] = 0x9A9A9A9A + $Te4[56] = 0x07070707 + $Te4[57] = 0x12121212 + $Te4[58] = 0x80808080 + $Te4[59] = 0xE2E2E2E2 + $Te4[60] = 0xEBEBEBEB + $Te4[61] = 0x27272727 + $Te4[62] = 0xB2B2B2B2 + $Te4[63] = 0x75757575 + $Te4[64] = 0x09090909 + $Te4[65] = 0x83838383 + $Te4[66] = 0x2C2C2C2C + $Te4[67] = 0x1A1A1A1A + $Te4[68] = 0x1B1B1B1B + $Te4[69] = 0x6E6E6E6E + $Te4[70] = 0x5A5A5A5A + $Te4[71] = 0xA0A0A0A0 + $Te4[72] = 0x52525252 + $Te4[73] = 0x3B3B3B3B + $Te4[74] = 0xD6D6D6D6 + $Te4[75] = 0xB3B3B3B3 + $Te4[76] = 0x29292929 + $Te4[77] = 0xE3E3E3E3 + $Te4[78] = 0x2F2F2F2F + $Te4[79] = 0x84848484 + $Te4[80] = 0x53535353 + $Te4[81] = 0xD1D1D1D1 + $Te4[82] = 0x00000000 + $Te4[83] = 0xEDEDEDED + $Te4[84] = 0x20202020 + $Te4[85] = 0xFCFCFCFC + $Te4[86] = 0xB1B1B1B1 + $Te4[87] = 0x5B5B5B5B + $Te4[88] = 0x6A6A6A6A + $Te4[89] = 0xCBCBCBCB + $Te4[90] = 0xBEBEBEBE + $Te4[91] = 0x39393939 + $Te4[92] = 0x4A4A4A4A + $Te4[93] = 0x4C4C4C4C + $Te4[94] = 0x58585858 + $Te4[95] = 0xCFCFCFCF + $Te4[96] = 0xD0D0D0D0 + $Te4[97] = 0xEFEFEFEF + $Te4[98] = 0xAAAAAAAA + $Te4[99] = 0xFBFBFBFB + $Te4[100] = 0x43434343 + $Te4[101] = 0x4D4D4D4D + $Te4[102] = 0x33333333 + $Te4[103] = 0x85858585 + $Te4[104] = 0x45454545 + $Te4[105] = 0xF9F9F9F9 + $Te4[106] = 0x02020202 + $Te4[107] = 0x7F7F7F7F + $Te4[108] = 0x50505050 + $Te4[109] = 0x3C3C3C3C + $Te4[110] = 0x9F9F9F9F + $Te4[111] = 0xA8A8A8A8 + $Te4[112] = 0x51515151 + $Te4[113] = 0xA3A3A3A3 + $Te4[114] = 0x40404040 + $Te4[115] = 0x8F8F8F8F + $Te4[116] = 0x92929292 + $Te4[117] = 0x9D9D9D9D + $Te4[118] = 0x38383838 + $Te4[119] = 0xF5F5F5F5 + $Te4[120] = 0xBCBCBCBC + $Te4[121] = 0xB6B6B6B6 + $Te4[122] = 0xDADADADA + $Te4[123] = 0x21212121 + $Te4[124] = 0x10101010 + $Te4[125] = 0xFFFFFFFF + $Te4[126] = 0xF3F3F3F3 + $Te4[127] = 0xD2D2D2D2 + $Te4[128] = 0xCDCDCDCD + $Te4[129] = 0x0C0C0C0C + $Te4[130] = 0x13131313 + $Te4[131] = 0xECECECEC + $Te4[132] = 0x5F5F5F5F + $Te4[133] = 0x97979797 + $Te4[134] = 0x44444444 + $Te4[135] = 0x17171717 + $Te4[136] = 0xC4C4C4C4 + $Te4[137] = 0xA7A7A7A7 + $Te4[138] = 0x7E7E7E7E + $Te4[139] = 0x3D3D3D3D + $Te4[140] = 0x64646464 + $Te4[141] = 0x5D5D5D5D + $Te4[142] = 0x19191919 + $Te4[143] = 0x73737373 + $Te4[144] = 0x60606060 + $Te4[145] = 0x81818181 + $Te4[146] = 0x4F4F4F4F + $Te4[147] = 0xDCDCDCDC + $Te4[148] = 0x22222222 + $Te4[149] = 0x2A2A2A2A + $Te4[150] = 0x90909090 + $Te4[151] = 0x88888888 + $Te4[152] = 0x46464646 + $Te4[153] = 0xEEEEEEEE + $Te4[154] = 0xB8B8B8B8 + $Te4[155] = 0x14141414 + $Te4[156] = 0xDEDEDEDE + $Te4[157] = 0x5E5E5E5E + $Te4[158] = 0x0B0B0B0B + $Te4[159] = 0xDBDBDBDB + $Te4[160] = 0xE0E0E0E0 + $Te4[161] = 0x32323232 + $Te4[162] = 0x3A3A3A3A + $Te4[163] = 0x0A0A0A0A + $Te4[164] = 0x49494949 + $Te4[165] = 0x06060606 + $Te4[166] = 0x24242424 + $Te4[167] = 0x5C5C5C5C + $Te4[168] = 0xC2C2C2C2 + $Te4[169] = 0xD3D3D3D3 + $Te4[170] = 0xACACACAC + $Te4[171] = 0x62626262 + $Te4[172] = 0x91919191 + $Te4[173] = 0x95959595 + $Te4[174] = 0xE4E4E4E4 + $Te4[175] = 0x79797979 + $Te4[176] = 0xE7E7E7E7 + $Te4[177] = 0xC8C8C8C8 + $Te4[178] = 0x37373737 + $Te4[179] = 0x6D6D6D6D + $Te4[180] = 0x8D8D8D8D + $Te4[181] = 0xD5D5D5D5 + $Te4[182] = 0x4E4E4E4E + $Te4[183] = 0xA9A9A9A9 + $Te4[184] = 0x6C6C6C6C + $Te4[185] = 0x56565656 + $Te4[186] = 0xF4F4F4F4 + $Te4[187] = 0xEAEAEAEA + $Te4[188] = 0x65656565 + $Te4[189] = 0x7A7A7A7A + $Te4[190] = 0xAEAEAEAE + $Te4[191] = 0x08080808 + $Te4[192] = 0xBABABABA + $Te4[193] = 0x78787878 + $Te4[194] = 0x25252525 + $Te4[195] = 0x2E2E2E2E + $Te4[196] = 0x1C1C1C1C + $Te4[197] = 0xA6A6A6A6 + $Te4[198] = 0xB4B4B4B4 + $Te4[199] = 0xC6C6C6C6 + $Te4[200] = 0xE8E8E8E8 + $Te4[201] = 0xDDDDDDDD + $Te4[202] = 0x74747474 + $Te4[203] = 0x1F1F1F1F + $Te4[204] = 0x4B4B4B4B + $Te4[205] = 0xBDBDBDBD + $Te4[206] = 0x8B8B8B8B + $Te4[207] = 0x8A8A8A8A + $Te4[208] = 0x70707070 + $Te4[209] = 0x3E3E3E3E + $Te4[210] = 0xB5B5B5B5 + $Te4[211] = 0x66666666 + $Te4[212] = 0x48484848 + $Te4[213] = 0x03030303 + $Te4[214] = 0xF6F6F6F6 + $Te4[215] = 0x0E0E0E0E + $Te4[216] = 0x61616161 + $Te4[217] = 0x35353535 + $Te4[218] = 0x57575757 + $Te4[219] = 0xB9B9B9B9 + $Te4[220] = 0x86868686 + $Te4[221] = 0xC1C1C1C1 + $Te4[222] = 0x1D1D1D1D + $Te4[223] = 0x9E9E9E9E + $Te4[224] = 0xE1E1E1E1 + $Te4[225] = 0xF8F8F8F8 + $Te4[226] = 0x98989898 + $Te4[227] = 0x11111111 + $Te4[228] = 0x69696969 + $Te4[229] = 0xD9D9D9D9 + $Te4[230] = 0x8E8E8E8E + $Te4[231] = 0x94949494 + $Te4[232] = 0x9B9B9B9B + $Te4[233] = 0x1E1E1E1E + $Te4[234] = 0x87878787 + $Te4[235] = 0xE9E9E9E9 + $Te4[236] = 0xCECECECE + $Te4[237] = 0x55555555 + $Te4[238] = 0x28282828 + $Te4[239] = 0xDFDFDFDF + $Te4[240] = 0x8C8C8C8C + $Te4[241] = 0xA1A1A1A1 + $Te4[242] = 0x89898989 + $Te4[243] = 0x0D0D0D0D + $Te4[244] = 0xBFBFBFBF + $Te4[245] = 0xE6E6E6E6 + $Te4[246] = 0x42424242 + $Te4[247] = 0x68686868 + $Te4[248] = 0x41414141 + $Te4[249] = 0x99999999 + $Te4[250] = 0x2D2D2D2D + $Te4[251] = 0x0F0F0F0F + $Te4[252] = 0xB0B0B0B0 + $Te4[253] = 0x54545454 + $Te4[254] = 0xBBBBBBBB + $Te4[255] = 0x16161616 + Local $temp, $i + Local $w[$Nb * ($Nr + 1) ] ; Actual Storage Structure to hold the key + + For $i = 0 To $Nk - 1 + $w[$i] = _Dec(BinaryMid($key,$i*4+1,4)) + Next + + For $i = $Nk To ($Nb * ($Nr + 1)) - 1 + If Mod($i, $Nk) == 0 Then + $w[$i] = BitXOR(BitAND($Te4[BitAND(BitShift($w[$i - 1],16),0xFF)],0xFF000000),BitAND($Te4[BitAND(BitShift($w[$i - 1],8),0xFF)],0xFF0000),BitAND($Te4[BitAND($w[$i - 1],0xFF)],0xFF00),BitAND($Te4[BitAND(BitShift($w[$i - 1],24),0xFF)],0xFF),$RCon[$i/$Nk],$w[$i - $Nk]) + ElseIf $Nk > 6 And Mod($i, $Nk) == 4 Then + $w[$i] = BitXOR(BitAND($Te4[BitAND(BitShift($w[$i - 1],24),0xFF)],0xFF000000),BitAND($Te4[BitAND(BitShift($w[$i - 1],16),0xFF)],0xFF0000),BitAND($Te4[BitAND(BitShift($w[$i - 1],8),0xFF)],0xFF00),BitAND($Te4[BitAND($w[$i - 1],0xFF)],0xFF),$w[$i - $Nk]) + Else + $w[$i] = BitXOR($w[$i - $Nk], $w[$i - 1]) + EndIf + Next + + Return $w +EndFunc ;==>expand_key + +Func inv_key($key, $Nb, $Nk, $Nr) + Local $Te4[256] + $Te4[0] = 0x63636363 + $Te4[1] = 0x7C7C7C7C + $Te4[2] = 0x77777777 + $Te4[3] = 0x7B7B7B7B + $Te4[4] = 0xF2F2F2F2 + $Te4[5] = 0x6B6B6B6B + $Te4[6] = 0x6F6F6F6F + $Te4[7] = 0xC5C5C5C5 + $Te4[8] = 0x30303030 + $Te4[9] = 0x01010101 + $Te4[10] = 0x67676767 + $Te4[11] = 0x2B2B2B2B + $Te4[12] = 0xFEFEFEFE + $Te4[13] = 0xD7D7D7D7 + $Te4[14] = 0xABABABAB + $Te4[15] = 0x76767676 + $Te4[16] = 0xCACACACA + $Te4[17] = 0x82828282 + $Te4[18] = 0xC9C9C9C9 + $Te4[19] = 0x7D7D7D7D + $Te4[20] = 0xFAFAFAFA + $Te4[21] = 0x59595959 + $Te4[22] = 0x47474747 + $Te4[23] = 0xF0F0F0F0 + $Te4[24] = 0xADADADAD + $Te4[25] = 0xD4D4D4D4 + $Te4[26] = 0xA2A2A2A2 + $Te4[27] = 0xAFAFAFAF + $Te4[28] = 0x9C9C9C9C + $Te4[29] = 0xA4A4A4A4 + $Te4[30] = 0x72727272 + $Te4[31] = 0xC0C0C0C0 + $Te4[32] = 0xB7B7B7B7 + $Te4[33] = 0xFDFDFDFD + $Te4[34] = 0x93939393 + $Te4[35] = 0x26262626 + $Te4[36] = 0x36363636 + $Te4[37] = 0x3F3F3F3F + $Te4[38] = 0xF7F7F7F7 + $Te4[39] = 0xCCCCCCCC + $Te4[40] = 0x34343434 + $Te4[41] = 0xA5A5A5A5 + $Te4[42] = 0xE5E5E5E5 + $Te4[43] = 0xF1F1F1F1 + $Te4[44] = 0x71717171 + $Te4[45] = 0xD8D8D8D8 + $Te4[46] = 0x31313131 + $Te4[47] = 0x15151515 + $Te4[48] = 0x04040404 + $Te4[49] = 0xC7C7C7C7 + $Te4[50] = 0x23232323 + $Te4[51] = 0xC3C3C3C3 + $Te4[52] = 0x18181818 + $Te4[53] = 0x96969696 + $Te4[54] = 0x05050505 + $Te4[55] = 0x9A9A9A9A + $Te4[56] = 0x07070707 + $Te4[57] = 0x12121212 + $Te4[58] = 0x80808080 + $Te4[59] = 0xE2E2E2E2 + $Te4[60] = 0xEBEBEBEB + $Te4[61] = 0x27272727 + $Te4[62] = 0xB2B2B2B2 + $Te4[63] = 0x75757575 + $Te4[64] = 0x09090909 + $Te4[65] = 0x83838383 + $Te4[66] = 0x2C2C2C2C + $Te4[67] = 0x1A1A1A1A + $Te4[68] = 0x1B1B1B1B + $Te4[69] = 0x6E6E6E6E + $Te4[70] = 0x5A5A5A5A + $Te4[71] = 0xA0A0A0A0 + $Te4[72] = 0x52525252 + $Te4[73] = 0x3B3B3B3B + $Te4[74] = 0xD6D6D6D6 + $Te4[75] = 0xB3B3B3B3 + $Te4[76] = 0x29292929 + $Te4[77] = 0xE3E3E3E3 + $Te4[78] = 0x2F2F2F2F + $Te4[79] = 0x84848484 + $Te4[80] = 0x53535353 + $Te4[81] = 0xD1D1D1D1 + $Te4[82] = 0x00000000 + $Te4[83] = 0xEDEDEDED + $Te4[84] = 0x20202020 + $Te4[85] = 0xFCFCFCFC + $Te4[86] = 0xB1B1B1B1 + $Te4[87] = 0x5B5B5B5B + $Te4[88] = 0x6A6A6A6A + $Te4[89] = 0xCBCBCBCB + $Te4[90] = 0xBEBEBEBE + $Te4[91] = 0x39393939 + $Te4[92] = 0x4A4A4A4A + $Te4[93] = 0x4C4C4C4C + $Te4[94] = 0x58585858 + $Te4[95] = 0xCFCFCFCF + $Te4[96] = 0xD0D0D0D0 + $Te4[97] = 0xEFEFEFEF + $Te4[98] = 0xAAAAAAAA + $Te4[99] = 0xFBFBFBFB + $Te4[100] = 0x43434343 + $Te4[101] = 0x4D4D4D4D + $Te4[102] = 0x33333333 + $Te4[103] = 0x85858585 + $Te4[104] = 0x45454545 + $Te4[105] = 0xF9F9F9F9 + $Te4[106] = 0x02020202 + $Te4[107] = 0x7F7F7F7F + $Te4[108] = 0x50505050 + $Te4[109] = 0x3C3C3C3C + $Te4[110] = 0x9F9F9F9F + $Te4[111] = 0xA8A8A8A8 + $Te4[112] = 0x51515151 + $Te4[113] = 0xA3A3A3A3 + $Te4[114] = 0x40404040 + $Te4[115] = 0x8F8F8F8F + $Te4[116] = 0x92929292 + $Te4[117] = 0x9D9D9D9D + $Te4[118] = 0x38383838 + $Te4[119] = 0xF5F5F5F5 + $Te4[120] = 0xBCBCBCBC + $Te4[121] = 0xB6B6B6B6 + $Te4[122] = 0xDADADADA + $Te4[123] = 0x21212121 + $Te4[124] = 0x10101010 + $Te4[125] = 0xFFFFFFFF + $Te4[126] = 0xF3F3F3F3 + $Te4[127] = 0xD2D2D2D2 + $Te4[128] = 0xCDCDCDCD + $Te4[129] = 0x0C0C0C0C + $Te4[130] = 0x13131313 + $Te4[131] = 0xECECECEC + $Te4[132] = 0x5F5F5F5F + $Te4[133] = 0x97979797 + $Te4[134] = 0x44444444 + $Te4[135] = 0x17171717 + $Te4[136] = 0xC4C4C4C4 + $Te4[137] = 0xA7A7A7A7 + $Te4[138] = 0x7E7E7E7E + $Te4[139] = 0x3D3D3D3D + $Te4[140] = 0x64646464 + $Te4[141] = 0x5D5D5D5D + $Te4[142] = 0x19191919 + $Te4[143] = 0x73737373 + $Te4[144] = 0x60606060 + $Te4[145] = 0x81818181 + $Te4[146] = 0x4F4F4F4F + $Te4[147] = 0xDCDCDCDC + $Te4[148] = 0x22222222 + $Te4[149] = 0x2A2A2A2A + $Te4[150] = 0x90909090 + $Te4[151] = 0x88888888 + $Te4[152] = 0x46464646 + $Te4[153] = 0xEEEEEEEE + $Te4[154] = 0xB8B8B8B8 + $Te4[155] = 0x14141414 + $Te4[156] = 0xDEDEDEDE + $Te4[157] = 0x5E5E5E5E + $Te4[158] = 0x0B0B0B0B + $Te4[159] = 0xDBDBDBDB + $Te4[160] = 0xE0E0E0E0 + $Te4[161] = 0x32323232 + $Te4[162] = 0x3A3A3A3A + $Te4[163] = 0x0A0A0A0A + $Te4[164] = 0x49494949 + $Te4[165] = 0x06060606 + $Te4[166] = 0x24242424 + $Te4[167] = 0x5C5C5C5C + $Te4[168] = 0xC2C2C2C2 + $Te4[169] = 0xD3D3D3D3 + $Te4[170] = 0xACACACAC + $Te4[171] = 0x62626262 + $Te4[172] = 0x91919191 + $Te4[173] = 0x95959595 + $Te4[174] = 0xE4E4E4E4 + $Te4[175] = 0x79797979 + $Te4[176] = 0xE7E7E7E7 + $Te4[177] = 0xC8C8C8C8 + $Te4[178] = 0x37373737 + $Te4[179] = 0x6D6D6D6D + $Te4[180] = 0x8D8D8D8D + $Te4[181] = 0xD5D5D5D5 + $Te4[182] = 0x4E4E4E4E + $Te4[183] = 0xA9A9A9A9 + $Te4[184] = 0x6C6C6C6C + $Te4[185] = 0x56565656 + $Te4[186] = 0xF4F4F4F4 + $Te4[187] = 0xEAEAEAEA + $Te4[188] = 0x65656565 + $Te4[189] = 0x7A7A7A7A + $Te4[190] = 0xAEAEAEAE + $Te4[191] = 0x08080808 + $Te4[192] = 0xBABABABA + $Te4[193] = 0x78787878 + $Te4[194] = 0x25252525 + $Te4[195] = 0x2E2E2E2E + $Te4[196] = 0x1C1C1C1C + $Te4[197] = 0xA6A6A6A6 + $Te4[198] = 0xB4B4B4B4 + $Te4[199] = 0xC6C6C6C6 + $Te4[200] = 0xE8E8E8E8 + $Te4[201] = 0xDDDDDDDD + $Te4[202] = 0x74747474 + $Te4[203] = 0x1F1F1F1F + $Te4[204] = 0x4B4B4B4B + $Te4[205] = 0xBDBDBDBD + $Te4[206] = 0x8B8B8B8B + $Te4[207] = 0x8A8A8A8A + $Te4[208] = 0x70707070 + $Te4[209] = 0x3E3E3E3E + $Te4[210] = 0xB5B5B5B5 + $Te4[211] = 0x66666666 + $Te4[212] = 0x48484848 + $Te4[213] = 0x03030303 + $Te4[214] = 0xF6F6F6F6 + $Te4[215] = 0x0E0E0E0E + $Te4[216] = 0x61616161 + $Te4[217] = 0x35353535 + $Te4[218] = 0x57575757 + $Te4[219] = 0xB9B9B9B9 + $Te4[220] = 0x86868686 + $Te4[221] = 0xC1C1C1C1 + $Te4[222] = 0x1D1D1D1D + $Te4[223] = 0x9E9E9E9E + $Te4[224] = 0xE1E1E1E1 + $Te4[225] = 0xF8F8F8F8 + $Te4[226] = 0x98989898 + $Te4[227] = 0x11111111 + $Te4[228] = 0x69696969 + $Te4[229] = 0xD9D9D9D9 + $Te4[230] = 0x8E8E8E8E + $Te4[231] = 0x94949494 + $Te4[232] = 0x9B9B9B9B + $Te4[233] = 0x1E1E1E1E + $Te4[234] = 0x87878787 + $Te4[235] = 0xE9E9E9E9 + $Te4[236] = 0xCECECECE + $Te4[237] = 0x55555555 + $Te4[238] = 0x28282828 + $Te4[239] = 0xDFDFDFDF + $Te4[240] = 0x8C8C8C8C + $Te4[241] = 0xA1A1A1A1 + $Te4[242] = 0x89898989 + $Te4[243] = 0x0D0D0D0D + $Te4[244] = 0xBFBFBFBF + $Te4[245] = 0xE6E6E6E6 + $Te4[246] = 0x42424242 + $Te4[247] = 0x68686868 + $Te4[248] = 0x41414141 + $Te4[249] = 0x99999999 + $Te4[250] = 0x2D2D2D2D + $Te4[251] = 0x0F0F0F0F + $Te4[252] = 0xB0B0B0B0 + $Te4[253] = 0x54545454 + $Te4[254] = 0xBBBBBBBB + $Te4[255] = 0x16161616 + Local $Td0[256] + $Td0[0] = 0x51F4A750 + $Td0[1] = 0x7E416553 + $Td0[2] = 0x1A17A4C3 + $Td0[3] = 0x3A275E96 + $Td0[4] = 0x3BAB6BCB + $Td0[5] = 0x1F9D45F1 + $Td0[6] = 0xACFA58AB + $Td0[7] = 0x4BE30393 + $Td0[8] = 0x2030FA55 + $Td0[9] = 0xAD766DF6 + $Td0[10] = 0x88CC7691 + $Td0[11] = 0xF5024C25 + $Td0[12] = 0x4FE5D7FC + $Td0[13] = 0xC52ACBD7 + $Td0[14] = 0x26354480 + $Td0[15] = 0xB562A38F + $Td0[16] = 0xDEB15A49 + $Td0[17] = 0x25BA1B67 + $Td0[18] = 0x45EA0E98 + $Td0[19] = 0x5DFEC0E1 + $Td0[20] = 0xC32F7502 + $Td0[21] = 0x814CF012 + $Td0[22] = 0x8D4697A3 + $Td0[23] = 0x6BD3F9C6 + $Td0[24] = 0x038F5FE7 + $Td0[25] = 0x15929C95 + $Td0[26] = 0xBF6D7AEB + $Td0[27] = 0x955259DA + $Td0[28] = 0xD4BE832D + $Td0[29] = 0x587421D3 + $Td0[30] = 0x49E06929 + $Td0[31] = 0x8EC9C844 + $Td0[32] = 0x75C2896A + $Td0[33] = 0xF48E7978 + $Td0[34] = 0x99583E6B + $Td0[35] = 0x27B971DD + $Td0[36] = 0xBEE14FB6 + $Td0[37] = 0xF088AD17 + $Td0[38] = 0xC920AC66 + $Td0[39] = 0x7DCE3AB4 + $Td0[40] = 0x63DF4A18 + $Td0[41] = 0xE51A3182 + $Td0[42] = 0x97513360 + $Td0[43] = 0x62537F45 + $Td0[44] = 0xB16477E0 + $Td0[45] = 0xBB6BAE84 + $Td0[46] = 0xFE81A01C + $Td0[47] = 0xF9082B94 + $Td0[48] = 0x70486858 + $Td0[49] = 0x8F45FD19 + $Td0[50] = 0x94DE6C87 + $Td0[51] = 0x527BF8B7 + $Td0[52] = 0xAB73D323 + $Td0[53] = 0x724B02E2 + $Td0[54] = 0xE31F8F57 + $Td0[55] = 0x6655AB2A + $Td0[56] = 0xB2EB2807 + $Td0[57] = 0x2FB5C203 + $Td0[58] = 0x86C57B9A + $Td0[59] = 0xD33708A5 + $Td0[60] = 0x302887F2 + $Td0[61] = 0x23BFA5B2 + $Td0[62] = 0x02036ABA + $Td0[63] = 0xED16825C + $Td0[64] = 0x8ACF1C2B + $Td0[65] = 0xA779B492 + $Td0[66] = 0xF307F2F0 + $Td0[67] = 0x4E69E2A1 + $Td0[68] = 0x65DAF4CD + $Td0[69] = 0x0605BED5 + $Td0[70] = 0xD134621F + $Td0[71] = 0xC4A6FE8A + $Td0[72] = 0x342E539D + $Td0[73] = 0xA2F355A0 + $Td0[74] = 0x058AE132 + $Td0[75] = 0xA4F6EB75 + $Td0[76] = 0x0B83EC39 + $Td0[77] = 0x4060EFAA + $Td0[78] = 0x5E719F06 + $Td0[79] = 0xBD6E1051 + $Td0[80] = 0x3E218AF9 + $Td0[81] = 0x96DD063D + $Td0[82] = 0xDD3E05AE + $Td0[83] = 0x4DE6BD46 + $Td0[84] = 0x91548DB5 + $Td0[85] = 0x71C45D05 + $Td0[86] = 0x0406D46F + $Td0[87] = 0x605015FF + $Td0[88] = 0x1998FB24 + $Td0[89] = 0xD6BDE997 + $Td0[90] = 0x894043CC + $Td0[91] = 0x67D99E77 + $Td0[92] = 0xB0E842BD + $Td0[93] = 0x07898B88 + $Td0[94] = 0xE7195B38 + $Td0[95] = 0x79C8EEDB + $Td0[96] = 0xA17C0A47 + $Td0[97] = 0x7C420FE9 + $Td0[98] = 0xF8841EC9 + $Td0[99] = 0x00000000 + $Td0[100] = 0x09808683 + $Td0[101] = 0x322BED48 + $Td0[102] = 0x1E1170AC + $Td0[103] = 0x6C5A724E + $Td0[104] = 0xFD0EFFFB + $Td0[105] = 0x0F853856 + $Td0[106] = 0x3DAED51E + $Td0[107] = 0x362D3927 + $Td0[108] = 0x0A0FD964 + $Td0[109] = 0x685CA621 + $Td0[110] = 0x9B5B54D1 + $Td0[111] = 0x24362E3A + $Td0[112] = 0x0C0A67B1 + $Td0[113] = 0x9357E70F + $Td0[114] = 0xB4EE96D2 + $Td0[115] = 0x1B9B919E + $Td0[116] = 0x80C0C54F + $Td0[117] = 0x61DC20A2 + $Td0[118] = 0x5A774B69 + $Td0[119] = 0x1C121A16 + $Td0[120] = 0xE293BA0A + $Td0[121] = 0xC0A02AE5 + $Td0[122] = 0x3C22E043 + $Td0[123] = 0x121B171D + $Td0[124] = 0x0E090D0B + $Td0[125] = 0xF28BC7AD + $Td0[126] = 0x2DB6A8B9 + $Td0[127] = 0x141EA9C8 + $Td0[128] = 0x57F11985 + $Td0[129] = 0xAF75074C + $Td0[130] = 0xEE99DDBB + $Td0[131] = 0xA37F60FD + $Td0[132] = 0xF701269F + $Td0[133] = 0x5C72F5BC + $Td0[134] = 0x44663BC5 + $Td0[135] = 0x5BFB7E34 + $Td0[136] = 0x8B432976 + $Td0[137] = 0xCB23C6DC + $Td0[138] = 0xB6EDFC68 + $Td0[139] = 0xB8E4F163 + $Td0[140] = 0xD731DCCA + $Td0[141] = 0x42638510 + $Td0[142] = 0x13972240 + $Td0[143] = 0x84C61120 + $Td0[144] = 0x854A247D + $Td0[145] = 0xD2BB3DF8 + $Td0[146] = 0xAEF93211 + $Td0[147] = 0xC729A16D + $Td0[148] = 0x1D9E2F4B + $Td0[149] = 0xDCB230F3 + $Td0[150] = 0x0D8652EC + $Td0[151] = 0x77C1E3D0 + $Td0[152] = 0x2BB3166C + $Td0[153] = 0xA970B999 + $Td0[154] = 0x119448FA + $Td0[155] = 0x47E96422 + $Td0[156] = 0xA8FC8CC4 + $Td0[157] = 0xA0F03F1A + $Td0[158] = 0x567D2CD8 + $Td0[159] = 0x223390EF + $Td0[160] = 0x87494EC7 + $Td0[161] = 0xD938D1C1 + $Td0[162] = 0x8CCAA2FE + $Td0[163] = 0x98D40B36 + $Td0[164] = 0xA6F581CF + $Td0[165] = 0xA57ADE28 + $Td0[166] = 0xDAB78E26 + $Td0[167] = 0x3FADBFA4 + $Td0[168] = 0x2C3A9DE4 + $Td0[169] = 0x5078920D + $Td0[170] = 0x6A5FCC9B + $Td0[171] = 0x547E4662 + $Td0[172] = 0xF68D13C2 + $Td0[173] = 0x90D8B8E8 + $Td0[174] = 0x2E39F75E + $Td0[175] = 0x82C3AFF5 + $Td0[176] = 0x9F5D80BE + $Td0[177] = 0x69D0937C + $Td0[178] = 0x6FD52DA9 + $Td0[179] = 0xCF2512B3 + $Td0[180] = 0xC8AC993B + $Td0[181] = 0x10187DA7 + $Td0[182] = 0xE89C636E + $Td0[183] = 0xDB3BBB7B + $Td0[184] = 0xCD267809 + $Td0[185] = 0x6E5918F4 + $Td0[186] = 0xEC9AB701 + $Td0[187] = 0x834F9AA8 + $Td0[188] = 0xE6956E65 + $Td0[189] = 0xAAFFE67E + $Td0[190] = 0x21BCCF08 + $Td0[191] = 0xEF15E8E6 + $Td0[192] = 0xBAE79BD9 + $Td0[193] = 0x4A6F36CE + $Td0[194] = 0xEA9F09D4 + $Td0[195] = 0x29B07CD6 + $Td0[196] = 0x31A4B2AF + $Td0[197] = 0x2A3F2331 + $Td0[198] = 0xC6A59430 + $Td0[199] = 0x35A266C0 + $Td0[200] = 0x744EBC37 + $Td0[201] = 0xFC82CAA6 + $Td0[202] = 0xE090D0B0 + $Td0[203] = 0x33A7D815 + $Td0[204] = 0xF104984A + $Td0[205] = 0x41ECDAF7 + $Td0[206] = 0x7FCD500E + $Td0[207] = 0x1791F62F + $Td0[208] = 0x764DD68D + $Td0[209] = 0x43EFB04D + $Td0[210] = 0xCCAA4D54 + $Td0[211] = 0xE49604DF + $Td0[212] = 0x9ED1B5E3 + $Td0[213] = 0x4C6A881B + $Td0[214] = 0xC12C1FB8 + $Td0[215] = 0x4665517F + $Td0[216] = 0x9D5EEA04 + $Td0[217] = 0x018C355D + $Td0[218] = 0xFA877473 + $Td0[219] = 0xFB0B412E + $Td0[220] = 0xB3671D5A + $Td0[221] = 0x92DBD252 + $Td0[222] = 0xE9105633 + $Td0[223] = 0x6DD64713 + $Td0[224] = 0x9AD7618C + $Td0[225] = 0x37A10C7A + $Td0[226] = 0x59F8148E + $Td0[227] = 0xEB133C89 + $Td0[228] = 0xCEA927EE + $Td0[229] = 0xB761C935 + $Td0[230] = 0xE11CE5ED + $Td0[231] = 0x7A47B13C + $Td0[232] = 0x9CD2DF59 + $Td0[233] = 0x55F2733F + $Td0[234] = 0x1814CE79 + $Td0[235] = 0x73C737BF + $Td0[236] = 0x53F7CDEA + $Td0[237] = 0x5FFDAA5B + $Td0[238] = 0xDF3D6F14 + $Td0[239] = 0x7844DB86 + $Td0[240] = 0xCAAFF381 + $Td0[241] = 0xB968C43E + $Td0[242] = 0x3824342C + $Td0[243] = 0xC2A3405F + $Td0[244] = 0x161DC372 + $Td0[245] = 0xBCE2250C + $Td0[246] = 0x283C498B + $Td0[247] = 0xFF0D9541 + $Td0[248] = 0x39A80171 + $Td0[249] = 0x080CB3DE + $Td0[250] = 0xD8B4E49C + $Td0[251] = 0x6456C190 + $Td0[252] = 0x7BCB8461 + $Td0[253] = 0xD532B670 + $Td0[254] = 0x486C5C74 + $Td0[255] = 0xD0B85742 + Local $Td1[256] + $Td1[0] = 0x5051F4A7 + $Td1[1] = 0x537E4165 + $Td1[2] = 0xC31A17A4 + $Td1[3] = 0x963A275E + $Td1[4] = 0xCB3BAB6B + $Td1[5] = 0xF11F9D45 + $Td1[6] = 0xABACFA58 + $Td1[7] = 0x934BE303 + $Td1[8] = 0x552030FA + $Td1[9] = 0xF6AD766D + $Td1[10] = 0x9188CC76 + $Td1[11] = 0x25F5024C + $Td1[12] = 0xFC4FE5D7 + $Td1[13] = 0xD7C52ACB + $Td1[14] = 0x80263544 + $Td1[15] = 0x8FB562A3 + $Td1[16] = 0x49DEB15A + $Td1[17] = 0x6725BA1B + $Td1[18] = 0x9845EA0E + $Td1[19] = 0xE15DFEC0 + $Td1[20] = 0x02C32F75 + $Td1[21] = 0x12814CF0 + $Td1[22] = 0xA38D4697 + $Td1[23] = 0xC66BD3F9 + $Td1[24] = 0xE7038F5F + $Td1[25] = 0x9515929C + $Td1[26] = 0xEBBF6D7A + $Td1[27] = 0xDA955259 + $Td1[28] = 0x2DD4BE83 + $Td1[29] = 0xD3587421 + $Td1[30] = 0x2949E069 + $Td1[31] = 0x448EC9C8 + $Td1[32] = 0x6A75C289 + $Td1[33] = 0x78F48E79 + $Td1[34] = 0x6B99583E + $Td1[35] = 0xDD27B971 + $Td1[36] = 0xB6BEE14F + $Td1[37] = 0x17F088AD + $Td1[38] = 0x66C920AC + $Td1[39] = 0xB47DCE3A + $Td1[40] = 0x1863DF4A + $Td1[41] = 0x82E51A31 + $Td1[42] = 0x60975133 + $Td1[43] = 0x4562537F + $Td1[44] = 0xE0B16477 + $Td1[45] = 0x84BB6BAE + $Td1[46] = 0x1CFE81A0 + $Td1[47] = 0x94F9082B + $Td1[48] = 0x58704868 + $Td1[49] = 0x198F45FD + $Td1[50] = 0x8794DE6C + $Td1[51] = 0xB7527BF8 + $Td1[52] = 0x23AB73D3 + $Td1[53] = 0xE2724B02 + $Td1[54] = 0x57E31F8F + $Td1[55] = 0x2A6655AB + $Td1[56] = 0x07B2EB28 + $Td1[57] = 0x032FB5C2 + $Td1[58] = 0x9A86C57B + $Td1[59] = 0xA5D33708 + $Td1[60] = 0xF2302887 + $Td1[61] = 0xB223BFA5 + $Td1[62] = 0xBA02036A + $Td1[63] = 0x5CED1682 + $Td1[64] = 0x2B8ACF1C + $Td1[65] = 0x92A779B4 + $Td1[66] = 0xF0F307F2 + $Td1[67] = 0xA14E69E2 + $Td1[68] = 0xCD65DAF4 + $Td1[69] = 0xD50605BE + $Td1[70] = 0x1FD13462 + $Td1[71] = 0x8AC4A6FE + $Td1[72] = 0x9D342E53 + $Td1[73] = 0xA0A2F355 + $Td1[74] = 0x32058AE1 + $Td1[75] = 0x75A4F6EB + $Td1[76] = 0x390B83EC + $Td1[77] = 0xAA4060EF + $Td1[78] = 0x065E719F + $Td1[79] = 0x51BD6E10 + $Td1[80] = 0xF93E218A + $Td1[81] = 0x3D96DD06 + $Td1[82] = 0xAEDD3E05 + $Td1[83] = 0x464DE6BD + $Td1[84] = 0xB591548D + $Td1[85] = 0x0571C45D + $Td1[86] = 0x6F0406D4 + $Td1[87] = 0xFF605015 + $Td1[88] = 0x241998FB + $Td1[89] = 0x97D6BDE9 + $Td1[90] = 0xCC894043 + $Td1[91] = 0x7767D99E + $Td1[92] = 0xBDB0E842 + $Td1[93] = 0x8807898B + $Td1[94] = 0x38E7195B + $Td1[95] = 0xDB79C8EE + $Td1[96] = 0x47A17C0A + $Td1[97] = 0xE97C420F + $Td1[98] = 0xC9F8841E + $Td1[99] = 0x00000000 + $Td1[100] = 0x83098086 + $Td1[101] = 0x48322BED + $Td1[102] = 0xAC1E1170 + $Td1[103] = 0x4E6C5A72 + $Td1[104] = 0xFBFD0EFF + $Td1[105] = 0x560F8538 + $Td1[106] = 0x1E3DAED5 + $Td1[107] = 0x27362D39 + $Td1[108] = 0x640A0FD9 + $Td1[109] = 0x21685CA6 + $Td1[110] = 0xD19B5B54 + $Td1[111] = 0x3A24362E + $Td1[112] = 0xB10C0A67 + $Td1[113] = 0x0F9357E7 + $Td1[114] = 0xD2B4EE96 + $Td1[115] = 0x9E1B9B91 + $Td1[116] = 0x4F80C0C5 + $Td1[117] = 0xA261DC20 + $Td1[118] = 0x695A774B + $Td1[119] = 0x161C121A + $Td1[120] = 0x0AE293BA + $Td1[121] = 0xE5C0A02A + $Td1[122] = 0x433C22E0 + $Td1[123] = 0x1D121B17 + $Td1[124] = 0x0B0E090D + $Td1[125] = 0xADF28BC7 + $Td1[126] = 0xB92DB6A8 + $Td1[127] = 0xC8141EA9 + $Td1[128] = 0x8557F119 + $Td1[129] = 0x4CAF7507 + $Td1[130] = 0xBBEE99DD + $Td1[131] = 0xFDA37F60 + $Td1[132] = 0x9FF70126 + $Td1[133] = 0xBC5C72F5 + $Td1[134] = 0xC544663B + $Td1[135] = 0x345BFB7E + $Td1[136] = 0x768B4329 + $Td1[137] = 0xDCCB23C6 + $Td1[138] = 0x68B6EDFC + $Td1[139] = 0x63B8E4F1 + $Td1[140] = 0xCAD731DC + $Td1[141] = 0x10426385 + $Td1[142] = 0x40139722 + $Td1[143] = 0x2084C611 + $Td1[144] = 0x7D854A24 + $Td1[145] = 0xF8D2BB3D + $Td1[146] = 0x11AEF932 + $Td1[147] = 0x6DC729A1 + $Td1[148] = 0x4B1D9E2F + $Td1[149] = 0xF3DCB230 + $Td1[150] = 0xEC0D8652 + $Td1[151] = 0xD077C1E3 + $Td1[152] = 0x6C2BB316 + $Td1[153] = 0x99A970B9 + $Td1[154] = 0xFA119448 + $Td1[155] = 0x2247E964 + $Td1[156] = 0xC4A8FC8C + $Td1[157] = 0x1AA0F03F + $Td1[158] = 0xD8567D2C + $Td1[159] = 0xEF223390 + $Td1[160] = 0xC787494E + $Td1[161] = 0xC1D938D1 + $Td1[162] = 0xFE8CCAA2 + $Td1[163] = 0x3698D40B + $Td1[164] = 0xCFA6F581 + $Td1[165] = 0x28A57ADE + $Td1[166] = 0x26DAB78E + $Td1[167] = 0xA43FADBF + $Td1[168] = 0xE42C3A9D + $Td1[169] = 0x0D507892 + $Td1[170] = 0x9B6A5FCC + $Td1[171] = 0x62547E46 + $Td1[172] = 0xC2F68D13 + $Td1[173] = 0xE890D8B8 + $Td1[174] = 0x5E2E39F7 + $Td1[175] = 0xF582C3AF + $Td1[176] = 0xBE9F5D80 + $Td1[177] = 0x7C69D093 + $Td1[178] = 0xA96FD52D + $Td1[179] = 0xB3CF2512 + $Td1[180] = 0x3BC8AC99 + $Td1[181] = 0xA710187D + $Td1[182] = 0x6EE89C63 + $Td1[183] = 0x7BDB3BBB + $Td1[184] = 0x09CD2678 + $Td1[185] = 0xF46E5918 + $Td1[186] = 0x01EC9AB7 + $Td1[187] = 0xA8834F9A + $Td1[188] = 0x65E6956E + $Td1[189] = 0x7EAAFFE6 + $Td1[190] = 0x0821BCCF + $Td1[191] = 0xE6EF15E8 + $Td1[192] = 0xD9BAE79B + $Td1[193] = 0xCE4A6F36 + $Td1[194] = 0xD4EA9F09 + $Td1[195] = 0xD629B07C + $Td1[196] = 0xAF31A4B2 + $Td1[197] = 0x312A3F23 + $Td1[198] = 0x30C6A594 + $Td1[199] = 0xC035A266 + $Td1[200] = 0x37744EBC + $Td1[201] = 0xA6FC82CA + $Td1[202] = 0xB0E090D0 + $Td1[203] = 0x1533A7D8 + $Td1[204] = 0x4AF10498 + $Td1[205] = 0xF741ECDA + $Td1[206] = 0x0E7FCD50 + $Td1[207] = 0x2F1791F6 + $Td1[208] = 0x8D764DD6 + $Td1[209] = 0x4D43EFB0 + $Td1[210] = 0x54CCAA4D + $Td1[211] = 0xDFE49604 + $Td1[212] = 0xE39ED1B5 + $Td1[213] = 0x1B4C6A88 + $Td1[214] = 0xB8C12C1F + $Td1[215] = 0x7F466551 + $Td1[216] = 0x049D5EEA + $Td1[217] = 0x5D018C35 + $Td1[218] = 0x73FA8774 + $Td1[219] = 0x2EFB0B41 + $Td1[220] = 0x5AB3671D + $Td1[221] = 0x5292DBD2 + $Td1[222] = 0x33E91056 + $Td1[223] = 0x136DD647 + $Td1[224] = 0x8C9AD761 + $Td1[225] = 0x7A37A10C + $Td1[226] = 0x8E59F814 + $Td1[227] = 0x89EB133C + $Td1[228] = 0xEECEA927 + $Td1[229] = 0x35B761C9 + $Td1[230] = 0xEDE11CE5 + $Td1[231] = 0x3C7A47B1 + $Td1[232] = 0x599CD2DF + $Td1[233] = 0x3F55F273 + $Td1[234] = 0x791814CE + $Td1[235] = 0xBF73C737 + $Td1[236] = 0xEA53F7CD + $Td1[237] = 0x5B5FFDAA + $Td1[238] = 0x14DF3D6F + $Td1[239] = 0x867844DB + $Td1[240] = 0x81CAAFF3 + $Td1[241] = 0x3EB968C4 + $Td1[242] = 0x2C382434 + $Td1[243] = 0x5FC2A340 + $Td1[244] = 0x72161DC3 + $Td1[245] = 0x0CBCE225 + $Td1[246] = 0x8B283C49 + $Td1[247] = 0x41FF0D95 + $Td1[248] = 0x7139A801 + $Td1[249] = 0xDE080CB3 + $Td1[250] = 0x9CD8B4E4 + $Td1[251] = 0x906456C1 + $Td1[252] = 0x617BCB84 + $Td1[253] = 0x70D532B6 + $Td1[254] = 0x74486C5C + $Td1[255] = 0x42D0B857 + Local $Td2[256] + $Td2[0] = 0xA75051F4 + $Td2[1] = 0x65537E41 + $Td2[2] = 0xA4C31A17 + $Td2[3] = 0x5E963A27 + $Td2[4] = 0x6BCB3BAB + $Td2[5] = 0x45F11F9D + $Td2[6] = 0x58ABACFA + $Td2[7] = 0x03934BE3 + $Td2[8] = 0xFA552030 + $Td2[9] = 0x6DF6AD76 + $Td2[10] = 0x769188CC + $Td2[11] = 0x4C25F502 + $Td2[12] = 0xD7FC4FE5 + $Td2[13] = 0xCBD7C52A + $Td2[14] = 0x44802635 + $Td2[15] = 0xA38FB562 + $Td2[16] = 0x5A49DEB1 + $Td2[17] = 0x1B6725BA + $Td2[18] = 0x0E9845EA + $Td2[19] = 0xC0E15DFE + $Td2[20] = 0x7502C32F + $Td2[21] = 0xF012814C + $Td2[22] = 0x97A38D46 + $Td2[23] = 0xF9C66BD3 + $Td2[24] = 0x5FE7038F + $Td2[25] = 0x9C951592 + $Td2[26] = 0x7AEBBF6D + $Td2[27] = 0x59DA9552 + $Td2[28] = 0x832DD4BE + $Td2[29] = 0x21D35874 + $Td2[30] = 0x692949E0 + $Td2[31] = 0xC8448EC9 + $Td2[32] = 0x896A75C2 + $Td2[33] = 0x7978F48E + $Td2[34] = 0x3E6B9958 + $Td2[35] = 0x71DD27B9 + $Td2[36] = 0x4FB6BEE1 + $Td2[37] = 0xAD17F088 + $Td2[38] = 0xAC66C920 + $Td2[39] = 0x3AB47DCE + $Td2[40] = 0x4A1863DF + $Td2[41] = 0x3182E51A + $Td2[42] = 0x33609751 + $Td2[43] = 0x7F456253 + $Td2[44] = 0x77E0B164 + $Td2[45] = 0xAE84BB6B + $Td2[46] = 0xA01CFE81 + $Td2[47] = 0x2B94F908 + $Td2[48] = 0x68587048 + $Td2[49] = 0xFD198F45 + $Td2[50] = 0x6C8794DE + $Td2[51] = 0xF8B7527B + $Td2[52] = 0xD323AB73 + $Td2[53] = 0x02E2724B + $Td2[54] = 0x8F57E31F + $Td2[55] = 0xAB2A6655 + $Td2[56] = 0x2807B2EB + $Td2[57] = 0xC2032FB5 + $Td2[58] = 0x7B9A86C5 + $Td2[59] = 0x08A5D337 + $Td2[60] = 0x87F23028 + $Td2[61] = 0xA5B223BF + $Td2[62] = 0x6ABA0203 + $Td2[63] = 0x825CED16 + $Td2[64] = 0x1C2B8ACF + $Td2[65] = 0xB492A779 + $Td2[66] = 0xF2F0F307 + $Td2[67] = 0xE2A14E69 + $Td2[68] = 0xF4CD65DA + $Td2[69] = 0xBED50605 + $Td2[70] = 0x621FD134 + $Td2[71] = 0xFE8AC4A6 + $Td2[72] = 0x539D342E + $Td2[73] = 0x55A0A2F3 + $Td2[74] = 0xE132058A + $Td2[75] = 0xEB75A4F6 + $Td2[76] = 0xEC390B83 + $Td2[77] = 0xEFAA4060 + $Td2[78] = 0x9F065E71 + $Td2[79] = 0x1051BD6E + $Td2[80] = 0x8AF93E21 + $Td2[81] = 0x063D96DD + $Td2[82] = 0x05AEDD3E + $Td2[83] = 0xBD464DE6 + $Td2[84] = 0x8DB59154 + $Td2[85] = 0x5D0571C4 + $Td2[86] = 0xD46F0406 + $Td2[87] = 0x15FF6050 + $Td2[88] = 0xFB241998 + $Td2[89] = 0xE997D6BD + $Td2[90] = 0x43CC8940 + $Td2[91] = 0x9E7767D9 + $Td2[92] = 0x42BDB0E8 + $Td2[93] = 0x8B880789 + $Td2[94] = 0x5B38E719 + $Td2[95] = 0xEEDB79C8 + $Td2[96] = 0x0A47A17C + $Td2[97] = 0x0FE97C42 + $Td2[98] = 0x1EC9F884 + $Td2[99] = 0x00000000 + $Td2[100] = 0x86830980 + $Td2[101] = 0xED48322B + $Td2[102] = 0x70AC1E11 + $Td2[103] = 0x724E6C5A + $Td2[104] = 0xFFFBFD0E + $Td2[105] = 0x38560F85 + $Td2[106] = 0xD51E3DAE + $Td2[107] = 0x3927362D + $Td2[108] = 0xD9640A0F + $Td2[109] = 0xA621685C + $Td2[110] = 0x54D19B5B + $Td2[111] = 0x2E3A2436 + $Td2[112] = 0x67B10C0A + $Td2[113] = 0xE70F9357 + $Td2[114] = 0x96D2B4EE + $Td2[115] = 0x919E1B9B + $Td2[116] = 0xC54F80C0 + $Td2[117] = 0x20A261DC + $Td2[118] = 0x4B695A77 + $Td2[119] = 0x1A161C12 + $Td2[120] = 0xBA0AE293 + $Td2[121] = 0x2AE5C0A0 + $Td2[122] = 0xE0433C22 + $Td2[123] = 0x171D121B + $Td2[124] = 0x0D0B0E09 + $Td2[125] = 0xC7ADF28B + $Td2[126] = 0xA8B92DB6 + $Td2[127] = 0xA9C8141E + $Td2[128] = 0x198557F1 + $Td2[129] = 0x074CAF75 + $Td2[130] = 0xDDBBEE99 + $Td2[131] = 0x60FDA37F + $Td2[132] = 0x269FF701 + $Td2[133] = 0xF5BC5C72 + $Td2[134] = 0x3BC54466 + $Td2[135] = 0x7E345BFB + $Td2[136] = 0x29768B43 + $Td2[137] = 0xC6DCCB23 + $Td2[138] = 0xFC68B6ED + $Td2[139] = 0xF163B8E4 + $Td2[140] = 0xDCCAD731 + $Td2[141] = 0x85104263 + $Td2[142] = 0x22401397 + $Td2[143] = 0x112084C6 + $Td2[144] = 0x247D854A + $Td2[145] = 0x3DF8D2BB + $Td2[146] = 0x3211AEF9 + $Td2[147] = 0xA16DC729 + $Td2[148] = 0x2F4B1D9E + $Td2[149] = 0x30F3DCB2 + $Td2[150] = 0x52EC0D86 + $Td2[151] = 0xE3D077C1 + $Td2[152] = 0x166C2BB3 + $Td2[153] = 0xB999A970 + $Td2[154] = 0x48FA1194 + $Td2[155] = 0x642247E9 + $Td2[156] = 0x8CC4A8FC + $Td2[157] = 0x3F1AA0F0 + $Td2[158] = 0x2CD8567D + $Td2[159] = 0x90EF2233 + $Td2[160] = 0x4EC78749 + $Td2[161] = 0xD1C1D938 + $Td2[162] = 0xA2FE8CCA + $Td2[163] = 0x0B3698D4 + $Td2[164] = 0x81CFA6F5 + $Td2[165] = 0xDE28A57A + $Td2[166] = 0x8E26DAB7 + $Td2[167] = 0xBFA43FAD + $Td2[168] = 0x9DE42C3A + $Td2[169] = 0x920D5078 + $Td2[170] = 0xCC9B6A5F + $Td2[171] = 0x4662547E + $Td2[172] = 0x13C2F68D + $Td2[173] = 0xB8E890D8 + $Td2[174] = 0xF75E2E39 + $Td2[175] = 0xAFF582C3 + $Td2[176] = 0x80BE9F5D + $Td2[177] = 0x937C69D0 + $Td2[178] = 0x2DA96FD5 + $Td2[179] = 0x12B3CF25 + $Td2[180] = 0x993BC8AC + $Td2[181] = 0x7DA71018 + $Td2[182] = 0x636EE89C + $Td2[183] = 0xBB7BDB3B + $Td2[184] = 0x7809CD26 + $Td2[185] = 0x18F46E59 + $Td2[186] = 0xB701EC9A + $Td2[187] = 0x9AA8834F + $Td2[188] = 0x6E65E695 + $Td2[189] = 0xE67EAAFF + $Td2[190] = 0xCF0821BC + $Td2[191] = 0xE8E6EF15 + $Td2[192] = 0x9BD9BAE7 + $Td2[193] = 0x36CE4A6F + $Td2[194] = 0x09D4EA9F + $Td2[195] = 0x7CD629B0 + $Td2[196] = 0xB2AF31A4 + $Td2[197] = 0x23312A3F + $Td2[198] = 0x9430C6A5 + $Td2[199] = 0x66C035A2 + $Td2[200] = 0xBC37744E + $Td2[201] = 0xCAA6FC82 + $Td2[202] = 0xD0B0E090 + $Td2[203] = 0xD81533A7 + $Td2[204] = 0x984AF104 + $Td2[205] = 0xDAF741EC + $Td2[206] = 0x500E7FCD + $Td2[207] = 0xF62F1791 + $Td2[208] = 0xD68D764D + $Td2[209] = 0xB04D43EF + $Td2[210] = 0x4D54CCAA + $Td2[211] = 0x04DFE496 + $Td2[212] = 0xB5E39ED1 + $Td2[213] = 0x881B4C6A + $Td2[214] = 0x1FB8C12C + $Td2[215] = 0x517F4665 + $Td2[216] = 0xEA049D5E + $Td2[217] = 0x355D018C + $Td2[218] = 0x7473FA87 + $Td2[219] = 0x412EFB0B + $Td2[220] = 0x1D5AB367 + $Td2[221] = 0xD25292DB + $Td2[222] = 0x5633E910 + $Td2[223] = 0x47136DD6 + $Td2[224] = 0x618C9AD7 + $Td2[225] = 0x0C7A37A1 + $Td2[226] = 0x148E59F8 + $Td2[227] = 0x3C89EB13 + $Td2[228] = 0x27EECEA9 + $Td2[229] = 0xC935B761 + $Td2[230] = 0xE5EDE11C + $Td2[231] = 0xB13C7A47 + $Td2[232] = 0xDF599CD2 + $Td2[233] = 0x733F55F2 + $Td2[234] = 0xCE791814 + $Td2[235] = 0x37BF73C7 + $Td2[236] = 0xCDEA53F7 + $Td2[237] = 0xAA5B5FFD + $Td2[238] = 0x6F14DF3D + $Td2[239] = 0xDB867844 + $Td2[240] = 0xF381CAAF + $Td2[241] = 0xC43EB968 + $Td2[242] = 0x342C3824 + $Td2[243] = 0x405FC2A3 + $Td2[244] = 0xC372161D + $Td2[245] = 0x250CBCE2 + $Td2[246] = 0x498B283C + $Td2[247] = 0x9541FF0D + $Td2[248] = 0x017139A8 + $Td2[249] = 0xB3DE080C + $Td2[250] = 0xE49CD8B4 + $Td2[251] = 0xC1906456 + $Td2[252] = 0x84617BCB + $Td2[253] = 0xB670D532 + $Td2[254] = 0x5C74486C + $Td2[255] = 0x5742D0B8 + Local $Td3[256] + $Td3[0] = 0xF4A75051 + $Td3[1] = 0x4165537E + $Td3[2] = 0x17A4C31A + $Td3[3] = 0x275E963A + $Td3[4] = 0xAB6BCB3B + $Td3[5] = 0x9D45F11F + $Td3[6] = 0xFA58ABAC + $Td3[7] = 0xE303934B + $Td3[8] = 0x30FA5520 + $Td3[9] = 0x766DF6AD + $Td3[10] = 0xCC769188 + $Td3[11] = 0x024C25F5 + $Td3[12] = 0xE5D7FC4F + $Td3[13] = 0x2ACBD7C5 + $Td3[14] = 0x35448026 + $Td3[15] = 0x62A38FB5 + $Td3[16] = 0xB15A49DE + $Td3[17] = 0xBA1B6725 + $Td3[18] = 0xEA0E9845 + $Td3[19] = 0xFEC0E15D + $Td3[20] = 0x2F7502C3 + $Td3[21] = 0x4CF01281 + $Td3[22] = 0x4697A38D + $Td3[23] = 0xD3F9C66B + $Td3[24] = 0x8F5FE703 + $Td3[25] = 0x929C9515 + $Td3[26] = 0x6D7AEBBF + $Td3[27] = 0x5259DA95 + $Td3[28] = 0xBE832DD4 + $Td3[29] = 0x7421D358 + $Td3[30] = 0xE0692949 + $Td3[31] = 0xC9C8448E + $Td3[32] = 0xC2896A75 + $Td3[33] = 0x8E7978F4 + $Td3[34] = 0x583E6B99 + $Td3[35] = 0xB971DD27 + $Td3[36] = 0xE14FB6BE + $Td3[37] = 0x88AD17F0 + $Td3[38] = 0x20AC66C9 + $Td3[39] = 0xCE3AB47D + $Td3[40] = 0xDF4A1863 + $Td3[41] = 0x1A3182E5 + $Td3[42] = 0x51336097 + $Td3[43] = 0x537F4562 + $Td3[44] = 0x6477E0B1 + $Td3[45] = 0x6BAE84BB + $Td3[46] = 0x81A01CFE + $Td3[47] = 0x082B94F9 + $Td3[48] = 0x48685870 + $Td3[49] = 0x45FD198F + $Td3[50] = 0xDE6C8794 + $Td3[51] = 0x7BF8B752 + $Td3[52] = 0x73D323AB + $Td3[53] = 0x4B02E272 + $Td3[54] = 0x1F8F57E3 + $Td3[55] = 0x55AB2A66 + $Td3[56] = 0xEB2807B2 + $Td3[57] = 0xB5C2032F + $Td3[58] = 0xC57B9A86 + $Td3[59] = 0x3708A5D3 + $Td3[60] = 0x2887F230 + $Td3[61] = 0xBFA5B223 + $Td3[62] = 0x036ABA02 + $Td3[63] = 0x16825CED + $Td3[64] = 0xCF1C2B8A + $Td3[65] = 0x79B492A7 + $Td3[66] = 0x07F2F0F3 + $Td3[67] = 0x69E2A14E + $Td3[68] = 0xDAF4CD65 + $Td3[69] = 0x05BED506 + $Td3[70] = 0x34621FD1 + $Td3[71] = 0xA6FE8AC4 + $Td3[72] = 0x2E539D34 + $Td3[73] = 0xF355A0A2 + $Td3[74] = 0x8AE13205 + $Td3[75] = 0xF6EB75A4 + $Td3[76] = 0x83EC390B + $Td3[77] = 0x60EFAA40 + $Td3[78] = 0x719F065E + $Td3[79] = 0x6E1051BD + $Td3[80] = 0x218AF93E + $Td3[81] = 0xDD063D96 + $Td3[82] = 0x3E05AEDD + $Td3[83] = 0xE6BD464D + $Td3[84] = 0x548DB591 + $Td3[85] = 0xC45D0571 + $Td3[86] = 0x06D46F04 + $Td3[87] = 0x5015FF60 + $Td3[88] = 0x98FB2419 + $Td3[89] = 0xBDE997D6 + $Td3[90] = 0x4043CC89 + $Td3[91] = 0xD99E7767 + $Td3[92] = 0xE842BDB0 + $Td3[93] = 0x898B8807 + $Td3[94] = 0x195B38E7 + $Td3[95] = 0xC8EEDB79 + $Td3[96] = 0x7C0A47A1 + $Td3[97] = 0x420FE97C + $Td3[98] = 0x841EC9F8 + $Td3[99] = 0x00000000 + $Td3[100] = 0x80868309 + $Td3[101] = 0x2BED4832 + $Td3[102] = 0x1170AC1E + $Td3[103] = 0x5A724E6C + $Td3[104] = 0x0EFFFBFD + $Td3[105] = 0x8538560F + $Td3[106] = 0xAED51E3D + $Td3[107] = 0x2D392736 + $Td3[108] = 0x0FD9640A + $Td3[109] = 0x5CA62168 + $Td3[110] = 0x5B54D19B + $Td3[111] = 0x362E3A24 + $Td3[112] = 0x0A67B10C + $Td3[113] = 0x57E70F93 + $Td3[114] = 0xEE96D2B4 + $Td3[115] = 0x9B919E1B + $Td3[116] = 0xC0C54F80 + $Td3[117] = 0xDC20A261 + $Td3[118] = 0x774B695A + $Td3[119] = 0x121A161C + $Td3[120] = 0x93BA0AE2 + $Td3[121] = 0xA02AE5C0 + $Td3[122] = 0x22E0433C + $Td3[123] = 0x1B171D12 + $Td3[124] = 0x090D0B0E + $Td3[125] = 0x8BC7ADF2 + $Td3[126] = 0xB6A8B92D + $Td3[127] = 0x1EA9C814 + $Td3[128] = 0xF1198557 + $Td3[129] = 0x75074CAF + $Td3[130] = 0x99DDBBEE + $Td3[131] = 0x7F60FDA3 + $Td3[132] = 0x01269FF7 + $Td3[133] = 0x72F5BC5C + $Td3[134] = 0x663BC544 + $Td3[135] = 0xFB7E345B + $Td3[136] = 0x4329768B + $Td3[137] = 0x23C6DCCB + $Td3[138] = 0xEDFC68B6 + $Td3[139] = 0xE4F163B8 + $Td3[140] = 0x31DCCAD7 + $Td3[141] = 0x63851042 + $Td3[142] = 0x97224013 + $Td3[143] = 0xC6112084 + $Td3[144] = 0x4A247D85 + $Td3[145] = 0xBB3DF8D2 + $Td3[146] = 0xF93211AE + $Td3[147] = 0x29A16DC7 + $Td3[148] = 0x9E2F4B1D + $Td3[149] = 0xB230F3DC + $Td3[150] = 0x8652EC0D + $Td3[151] = 0xC1E3D077 + $Td3[152] = 0xB3166C2B + $Td3[153] = 0x70B999A9 + $Td3[154] = 0x9448FA11 + $Td3[155] = 0xE9642247 + $Td3[156] = 0xFC8CC4A8 + $Td3[157] = 0xF03F1AA0 + $Td3[158] = 0x7D2CD856 + $Td3[159] = 0x3390EF22 + $Td3[160] = 0x494EC787 + $Td3[161] = 0x38D1C1D9 + $Td3[162] = 0xCAA2FE8C + $Td3[163] = 0xD40B3698 + $Td3[164] = 0xF581CFA6 + $Td3[165] = 0x7ADE28A5 + $Td3[166] = 0xB78E26DA + $Td3[167] = 0xADBFA43F + $Td3[168] = 0x3A9DE42C + $Td3[169] = 0x78920D50 + $Td3[170] = 0x5FCC9B6A + $Td3[171] = 0x7E466254 + $Td3[172] = 0x8D13C2F6 + $Td3[173] = 0xD8B8E890 + $Td3[174] = 0x39F75E2E + $Td3[175] = 0xC3AFF582 + $Td3[176] = 0x5D80BE9F + $Td3[177] = 0xD0937C69 + $Td3[178] = 0xD52DA96F + $Td3[179] = 0x2512B3CF + $Td3[180] = 0xAC993BC8 + $Td3[181] = 0x187DA710 + $Td3[182] = 0x9C636EE8 + $Td3[183] = 0x3BBB7BDB + $Td3[184] = 0x267809CD + $Td3[185] = 0x5918F46E + $Td3[186] = 0x9AB701EC + $Td3[187] = 0x4F9AA883 + $Td3[188] = 0x956E65E6 + $Td3[189] = 0xFFE67EAA + $Td3[190] = 0xBCCF0821 + $Td3[191] = 0x15E8E6EF + $Td3[192] = 0xE79BD9BA + $Td3[193] = 0x6F36CE4A + $Td3[194] = 0x9F09D4EA + $Td3[195] = 0xB07CD629 + $Td3[196] = 0xA4B2AF31 + $Td3[197] = 0x3F23312A + $Td3[198] = 0xA59430C6 + $Td3[199] = 0xA266C035 + $Td3[200] = 0x4EBC3774 + $Td3[201] = 0x82CAA6FC + $Td3[202] = 0x90D0B0E0 + $Td3[203] = 0xA7D81533 + $Td3[204] = 0x04984AF1 + $Td3[205] = 0xECDAF741 + $Td3[206] = 0xCD500E7F + $Td3[207] = 0x91F62F17 + $Td3[208] = 0x4DD68D76 + $Td3[209] = 0xEFB04D43 + $Td3[210] = 0xAA4D54CC + $Td3[211] = 0x9604DFE4 + $Td3[212] = 0xD1B5E39E + $Td3[213] = 0x6A881B4C + $Td3[214] = 0x2C1FB8C1 + $Td3[215] = 0x65517F46 + $Td3[216] = 0x5EEA049D + $Td3[217] = 0x8C355D01 + $Td3[218] = 0x877473FA + $Td3[219] = 0x0B412EFB + $Td3[220] = 0x671D5AB3 + $Td3[221] = 0xDBD25292 + $Td3[222] = 0x105633E9 + $Td3[223] = 0xD647136D + $Td3[224] = 0xD7618C9A + $Td3[225] = 0xA10C7A37 + $Td3[226] = 0xF8148E59 + $Td3[227] = 0x133C89EB + $Td3[228] = 0xA927EECE + $Td3[229] = 0x61C935B7 + $Td3[230] = 0x1CE5EDE1 + $Td3[231] = 0x47B13C7A + $Td3[232] = 0xD2DF599C + $Td3[233] = 0xF2733F55 + $Td3[234] = 0x14CE7918 + $Td3[235] = 0xC737BF73 + $Td3[236] = 0xF7CDEA53 + $Td3[237] = 0xFDAA5B5F + $Td3[238] = 0x3D6F14DF + $Td3[239] = 0x44DB8678 + $Td3[240] = 0xAFF381CA + $Td3[241] = 0x68C43EB9 + $Td3[242] = 0x24342C38 + $Td3[243] = 0xA3405FC2 + $Td3[244] = 0x1DC37216 + $Td3[245] = 0xE2250CBC + $Td3[246] = 0x3C498B28 + $Td3[247] = 0x0D9541FF + $Td3[248] = 0xA8017139 + $Td3[249] = 0x0CB3DE08 + $Td3[250] = 0xB4E49CD8 + $Td3[251] = 0x56C19064 + $Td3[252] = 0xCB84617B + $Td3[253] = 0x32B670D5 + $Td3[254] = 0x6C5C7448 + $Td3[255] = 0xB85742D0 + Local $temp, $i, $j, $rk=0 + Local $w = expand_key($key, $Nb, $Nk, $Nr) ; Get the regular Key + + ; Invert the Keys + $i = 0 + $j = $Nb * $Nr + While $i < $j + For $k = 0 To $Nb - 1 + $temp = $w[$i+$k] + $w[$i+$k] = $w[$j+$k] + $w[$j+$k] = $temp + Next + $i += $Nb + $j -= $Nb + WEnd + + ; Apply the Inverse MixColumns To all Keys except First and Last + For $i = 1 To $Nr - 1 + $rk += $Nb + For $j = 0 To $Nb - 1 + $w[$rk+$j] = BitXOR($Td0[BitAND($Te4[BitAND(BitShift($w[$rk+$j],24),0xFF)],0xFF)],$Td1[BitAND($Te4[BitAND(BitShift($w[$rk+$j],16),0xFF)],0xFF)],$Td2[BitAND($Te4[BitAND(BitShift($w[$rk+$j],8),0xFF)],0xFF)],$Td3[BitAND($Te4[BitAND($w[$rk+$j],0xFF)],0xFF)]) + Next + Next + + Return $w +EndFunc + +Func Cipher($w, $s, $Nb, $Nk, $Nr) + Local $Te0[256] + $Te0[0] = 0xC66363A5 + $Te0[1] = 0xF87C7C84 + $Te0[2] = 0xEE777799 + $Te0[3] = 0xF67B7B8D + $Te0[4] = 0xFFF2F20D + $Te0[5] = 0xD66B6BBD + $Te0[6] = 0xDE6F6FB1 + $Te0[7] = 0x91C5C554 + $Te0[8] = 0x60303050 + $Te0[9] = 0x02010103 + $Te0[10] = 0xCE6767A9 + $Te0[11] = 0x562B2B7D + $Te0[12] = 0xE7FEFE19 + $Te0[13] = 0xB5D7D762 + $Te0[14] = 0x4DABABE6 + $Te0[15] = 0xEC76769A + $Te0[16] = 0x8FCACA45 + $Te0[17] = 0x1F82829D + $Te0[18] = 0x89C9C940 + $Te0[19] = 0xFA7D7D87 + $Te0[20] = 0xEFFAFA15 + $Te0[21] = 0xB25959EB + $Te0[22] = 0x8E4747C9 + $Te0[23] = 0xFBF0F00B + $Te0[24] = 0x41ADADEC + $Te0[25] = 0xB3D4D467 + $Te0[26] = 0x5FA2A2FD + $Te0[27] = 0x45AFAFEA + $Te0[28] = 0x239C9CBF + $Te0[29] = 0x53A4A4F7 + $Te0[30] = 0xE4727296 + $Te0[31] = 0x9BC0C05B + $Te0[32] = 0x75B7B7C2 + $Te0[33] = 0xE1FDFD1C + $Te0[34] = 0x3D9393AE + $Te0[35] = 0x4C26266A + $Te0[36] = 0x6C36365A + $Te0[37] = 0x7E3F3F41 + $Te0[38] = 0xF5F7F702 + $Te0[39] = 0x83CCCC4F + $Te0[40] = 0x6834345C + $Te0[41] = 0x51A5A5F4 + $Te0[42] = 0xD1E5E534 + $Te0[43] = 0xF9F1F108 + $Te0[44] = 0xE2717193 + $Te0[45] = 0xABD8D873 + $Te0[46] = 0x62313153 + $Te0[47] = 0x2A15153F + $Te0[48] = 0x0804040C + $Te0[49] = 0x95C7C752 + $Te0[50] = 0x46232365 + $Te0[51] = 0x9DC3C35E + $Te0[52] = 0x30181828 + $Te0[53] = 0x379696A1 + $Te0[54] = 0x0A05050F + $Te0[55] = 0x2F9A9AB5 + $Te0[56] = 0x0E070709 + $Te0[57] = 0x24121236 + $Te0[58] = 0x1B80809B + $Te0[59] = 0xDFE2E23D + $Te0[60] = 0xCDEBEB26 + $Te0[61] = 0x4E272769 + $Te0[62] = 0x7FB2B2CD + $Te0[63] = 0xEA75759F + $Te0[64] = 0x1209091B + $Te0[65] = 0x1D83839E + $Te0[66] = 0x582C2C74 + $Te0[67] = 0x341A1A2E + $Te0[68] = 0x361B1B2D + $Te0[69] = 0xDC6E6EB2 + $Te0[70] = 0xB45A5AEE + $Te0[71] = 0x5BA0A0FB + $Te0[72] = 0xA45252F6 + $Te0[73] = 0x763B3B4D + $Te0[74] = 0xB7D6D661 + $Te0[75] = 0x7DB3B3CE + $Te0[76] = 0x5229297B + $Te0[77] = 0xDDE3E33E + $Te0[78] = 0x5E2F2F71 + $Te0[79] = 0x13848497 + $Te0[80] = 0xA65353F5 + $Te0[81] = 0xB9D1D168 + $Te0[82] = 0x00000000 + $Te0[83] = 0xC1EDED2C + $Te0[84] = 0x40202060 + $Te0[85] = 0xE3FCFC1F + $Te0[86] = 0x79B1B1C8 + $Te0[87] = 0xB65B5BED + $Te0[88] = 0xD46A6ABE + $Te0[89] = 0x8DCBCB46 + $Te0[90] = 0x67BEBED9 + $Te0[91] = 0x7239394B + $Te0[92] = 0x944A4ADE + $Te0[93] = 0x984C4CD4 + $Te0[94] = 0xB05858E8 + $Te0[95] = 0x85CFCF4A + $Te0[96] = 0xBBD0D06B + $Te0[97] = 0xC5EFEF2A + $Te0[98] = 0x4FAAAAE5 + $Te0[99] = 0xEDFBFB16 + $Te0[100] = 0x864343C5 + $Te0[101] = 0x9A4D4DD7 + $Te0[102] = 0x66333355 + $Te0[103] = 0x11858594 + $Te0[104] = 0x8A4545CF + $Te0[105] = 0xE9F9F910 + $Te0[106] = 0x04020206 + $Te0[107] = 0xFE7F7F81 + $Te0[108] = 0xA05050F0 + $Te0[109] = 0x783C3C44 + $Te0[110] = 0x259F9FBA + $Te0[111] = 0x4BA8A8E3 + $Te0[112] = 0xA25151F3 + $Te0[113] = 0x5DA3A3FE + $Te0[114] = 0x804040C0 + $Te0[115] = 0x058F8F8A + $Te0[116] = 0x3F9292AD + $Te0[117] = 0x219D9DBC + $Te0[118] = 0x70383848 + $Te0[119] = 0xF1F5F504 + $Te0[120] = 0x63BCBCDF + $Te0[121] = 0x77B6B6C1 + $Te0[122] = 0xAFDADA75 + $Te0[123] = 0x42212163 + $Te0[124] = 0x20101030 + $Te0[125] = 0xE5FFFF1A + $Te0[126] = 0xFDF3F30E + $Te0[127] = 0xBFD2D26D + $Te0[128] = 0x81CDCD4C + $Te0[129] = 0x180C0C14 + $Te0[130] = 0x26131335 + $Te0[131] = 0xC3ECEC2F + $Te0[132] = 0xBE5F5FE1 + $Te0[133] = 0x359797A2 + $Te0[134] = 0x884444CC + $Te0[135] = 0x2E171739 + $Te0[136] = 0x93C4C457 + $Te0[137] = 0x55A7A7F2 + $Te0[138] = 0xFC7E7E82 + $Te0[139] = 0x7A3D3D47 + $Te0[140] = 0xC86464AC + $Te0[141] = 0xBA5D5DE7 + $Te0[142] = 0x3219192B + $Te0[143] = 0xE6737395 + $Te0[144] = 0xC06060A0 + $Te0[145] = 0x19818198 + $Te0[146] = 0x9E4F4FD1 + $Te0[147] = 0xA3DCDC7F + $Te0[148] = 0x44222266 + $Te0[149] = 0x542A2A7E + $Te0[150] = 0x3B9090AB + $Te0[151] = 0x0B888883 + $Te0[152] = 0x8C4646CA + $Te0[153] = 0xC7EEEE29 + $Te0[154] = 0x6BB8B8D3 + $Te0[155] = 0x2814143C + $Te0[156] = 0xA7DEDE79 + $Te0[157] = 0xBC5E5EE2 + $Te0[158] = 0x160B0B1D + $Te0[159] = 0xADDBDB76 + $Te0[160] = 0xDBE0E03B + $Te0[161] = 0x64323256 + $Te0[162] = 0x743A3A4E + $Te0[163] = 0x140A0A1E + $Te0[164] = 0x924949DB + $Te0[165] = 0x0C06060A + $Te0[166] = 0x4824246C + $Te0[167] = 0xB85C5CE4 + $Te0[168] = 0x9FC2C25D + $Te0[169] = 0xBDD3D36E + $Te0[170] = 0x43ACACEF + $Te0[171] = 0xC46262A6 + $Te0[172] = 0x399191A8 + $Te0[173] = 0x319595A4 + $Te0[174] = 0xD3E4E437 + $Te0[175] = 0xF279798B + $Te0[176] = 0xD5E7E732 + $Te0[177] = 0x8BC8C843 + $Te0[178] = 0x6E373759 + $Te0[179] = 0xDA6D6DB7 + $Te0[180] = 0x018D8D8C + $Te0[181] = 0xB1D5D564 + $Te0[182] = 0x9C4E4ED2 + $Te0[183] = 0x49A9A9E0 + $Te0[184] = 0xD86C6CB4 + $Te0[185] = 0xAC5656FA + $Te0[186] = 0xF3F4F407 + $Te0[187] = 0xCFEAEA25 + $Te0[188] = 0xCA6565AF + $Te0[189] = 0xF47A7A8E + $Te0[190] = 0x47AEAEE9 + $Te0[191] = 0x10080818 + $Te0[192] = 0x6FBABAD5 + $Te0[193] = 0xF0787888 + $Te0[194] = 0x4A25256F + $Te0[195] = 0x5C2E2E72 + $Te0[196] = 0x381C1C24 + $Te0[197] = 0x57A6A6F1 + $Te0[198] = 0x73B4B4C7 + $Te0[199] = 0x97C6C651 + $Te0[200] = 0xCBE8E823 + $Te0[201] = 0xA1DDDD7C + $Te0[202] = 0xE874749C + $Te0[203] = 0x3E1F1F21 + $Te0[204] = 0x964B4BDD + $Te0[205] = 0x61BDBDDC + $Te0[206] = 0x0D8B8B86 + $Te0[207] = 0x0F8A8A85 + $Te0[208] = 0xE0707090 + $Te0[209] = 0x7C3E3E42 + $Te0[210] = 0x71B5B5C4 + $Te0[211] = 0xCC6666AA + $Te0[212] = 0x904848D8 + $Te0[213] = 0x06030305 + $Te0[214] = 0xF7F6F601 + $Te0[215] = 0x1C0E0E12 + $Te0[216] = 0xC26161A3 + $Te0[217] = 0x6A35355F + $Te0[218] = 0xAE5757F9 + $Te0[219] = 0x69B9B9D0 + $Te0[220] = 0x17868691 + $Te0[221] = 0x99C1C158 + $Te0[222] = 0x3A1D1D27 + $Te0[223] = 0x279E9EB9 + $Te0[224] = 0xD9E1E138 + $Te0[225] = 0xEBF8F813 + $Te0[226] = 0x2B9898B3 + $Te0[227] = 0x22111133 + $Te0[228] = 0xD26969BB + $Te0[229] = 0xA9D9D970 + $Te0[230] = 0x078E8E89 + $Te0[231] = 0x339494A7 + $Te0[232] = 0x2D9B9BB6 + $Te0[233] = 0x3C1E1E22 + $Te0[234] = 0x15878792 + $Te0[235] = 0xC9E9E920 + $Te0[236] = 0x87CECE49 + $Te0[237] = 0xAA5555FF + $Te0[238] = 0x50282878 + $Te0[239] = 0xA5DFDF7A + $Te0[240] = 0x038C8C8F + $Te0[241] = 0x59A1A1F8 + $Te0[242] = 0x09898980 + $Te0[243] = 0x1A0D0D17 + $Te0[244] = 0x65BFBFDA + $Te0[245] = 0xD7E6E631 + $Te0[246] = 0x844242C6 + $Te0[247] = 0xD06868B8 + $Te0[248] = 0x824141C3 + $Te0[249] = 0x299999B0 + $Te0[250] = 0x5A2D2D77 + $Te0[251] = 0x1E0F0F11 + $Te0[252] = 0x7BB0B0CB + $Te0[253] = 0xA85454FC + $Te0[254] = 0x6DBBBBD6 + $Te0[255] = 0x2C16163A + Local $Te1[256] + $Te1[0] = 0xA5C66363 + $Te1[1] = 0x84F87C7C + $Te1[2] = 0x99EE7777 + $Te1[3] = 0x8DF67B7B + $Te1[4] = 0x0DFFF2F2 + $Te1[5] = 0xBDD66B6B + $Te1[6] = 0xB1DE6F6F + $Te1[7] = 0x5491C5C5 + $Te1[8] = 0x50603030 + $Te1[9] = 0x03020101 + $Te1[10] = 0xA9CE6767 + $Te1[11] = 0x7D562B2B + $Te1[12] = 0x19E7FEFE + $Te1[13] = 0x62B5D7D7 + $Te1[14] = 0xE64DABAB + $Te1[15] = 0x9AEC7676 + $Te1[16] = 0x458FCACA + $Te1[17] = 0x9D1F8282 + $Te1[18] = 0x4089C9C9 + $Te1[19] = 0x87FA7D7D + $Te1[20] = 0x15EFFAFA + $Te1[21] = 0xEBB25959 + $Te1[22] = 0xC98E4747 + $Te1[23] = 0x0BFBF0F0 + $Te1[24] = 0xEC41ADAD + $Te1[25] = 0x67B3D4D4 + $Te1[26] = 0xFD5FA2A2 + $Te1[27] = 0xEA45AFAF + $Te1[28] = 0xBF239C9C + $Te1[29] = 0xF753A4A4 + $Te1[30] = 0x96E47272 + $Te1[31] = 0x5B9BC0C0 + $Te1[32] = 0xC275B7B7 + $Te1[33] = 0x1CE1FDFD + $Te1[34] = 0xAE3D9393 + $Te1[35] = 0x6A4C2626 + $Te1[36] = 0x5A6C3636 + $Te1[37] = 0x417E3F3F + $Te1[38] = 0x02F5F7F7 + $Te1[39] = 0x4F83CCCC + $Te1[40] = 0x5C683434 + $Te1[41] = 0xF451A5A5 + $Te1[42] = 0x34D1E5E5 + $Te1[43] = 0x08F9F1F1 + $Te1[44] = 0x93E27171 + $Te1[45] = 0x73ABD8D8 + $Te1[46] = 0x53623131 + $Te1[47] = 0x3F2A1515 + $Te1[48] = 0x0C080404 + $Te1[49] = 0x5295C7C7 + $Te1[50] = 0x65462323 + $Te1[51] = 0x5E9DC3C3 + $Te1[52] = 0x28301818 + $Te1[53] = 0xA1379696 + $Te1[54] = 0x0F0A0505 + $Te1[55] = 0xB52F9A9A + $Te1[56] = 0x090E0707 + $Te1[57] = 0x36241212 + $Te1[58] = 0x9B1B8080 + $Te1[59] = 0x3DDFE2E2 + $Te1[60] = 0x26CDEBEB + $Te1[61] = 0x694E2727 + $Te1[62] = 0xCD7FB2B2 + $Te1[63] = 0x9FEA7575 + $Te1[64] = 0x1B120909 + $Te1[65] = 0x9E1D8383 + $Te1[66] = 0x74582C2C + $Te1[67] = 0x2E341A1A + $Te1[68] = 0x2D361B1B + $Te1[69] = 0xB2DC6E6E + $Te1[70] = 0xEEB45A5A + $Te1[71] = 0xFB5BA0A0 + $Te1[72] = 0xF6A45252 + $Te1[73] = 0x4D763B3B + $Te1[74] = 0x61B7D6D6 + $Te1[75] = 0xCE7DB3B3 + $Te1[76] = 0x7B522929 + $Te1[77] = 0x3EDDE3E3 + $Te1[78] = 0x715E2F2F + $Te1[79] = 0x97138484 + $Te1[80] = 0xF5A65353 + $Te1[81] = 0x68B9D1D1 + $Te1[82] = 0x00000000 + $Te1[83] = 0x2CC1EDED + $Te1[84] = 0x60402020 + $Te1[85] = 0x1FE3FCFC + $Te1[86] = 0xC879B1B1 + $Te1[87] = 0xEDB65B5B + $Te1[88] = 0xBED46A6A + $Te1[89] = 0x468DCBCB + $Te1[90] = 0xD967BEBE + $Te1[91] = 0x4B723939 + $Te1[92] = 0xDE944A4A + $Te1[93] = 0xD4984C4C + $Te1[94] = 0xE8B05858 + $Te1[95] = 0x4A85CFCF + $Te1[96] = 0x6BBBD0D0 + $Te1[97] = 0x2AC5EFEF + $Te1[98] = 0xE54FAAAA + $Te1[99] = 0x16EDFBFB + $Te1[100] = 0xC5864343 + $Te1[101] = 0xD79A4D4D + $Te1[102] = 0x55663333 + $Te1[103] = 0x94118585 + $Te1[104] = 0xCF8A4545 + $Te1[105] = 0x10E9F9F9 + $Te1[106] = 0x06040202 + $Te1[107] = 0x81FE7F7F + $Te1[108] = 0xF0A05050 + $Te1[109] = 0x44783C3C + $Te1[110] = 0xBA259F9F + $Te1[111] = 0xE34BA8A8 + $Te1[112] = 0xF3A25151 + $Te1[113] = 0xFE5DA3A3 + $Te1[114] = 0xC0804040 + $Te1[115] = 0x8A058F8F + $Te1[116] = 0xAD3F9292 + $Te1[117] = 0xBC219D9D + $Te1[118] = 0x48703838 + $Te1[119] = 0x04F1F5F5 + $Te1[120] = 0xDF63BCBC + $Te1[121] = 0xC177B6B6 + $Te1[122] = 0x75AFDADA + $Te1[123] = 0x63422121 + $Te1[124] = 0x30201010 + $Te1[125] = 0x1AE5FFFF + $Te1[126] = 0x0EFDF3F3 + $Te1[127] = 0x6DBFD2D2 + $Te1[128] = 0x4C81CDCD + $Te1[129] = 0x14180C0C + $Te1[130] = 0x35261313 + $Te1[131] = 0x2FC3ECEC + $Te1[132] = 0xE1BE5F5F + $Te1[133] = 0xA2359797 + $Te1[134] = 0xCC884444 + $Te1[135] = 0x392E1717 + $Te1[136] = 0x5793C4C4 + $Te1[137] = 0xF255A7A7 + $Te1[138] = 0x82FC7E7E + $Te1[139] = 0x477A3D3D + $Te1[140] = 0xACC86464 + $Te1[141] = 0xE7BA5D5D + $Te1[142] = 0x2B321919 + $Te1[143] = 0x95E67373 + $Te1[144] = 0xA0C06060 + $Te1[145] = 0x98198181 + $Te1[146] = 0xD19E4F4F + $Te1[147] = 0x7FA3DCDC + $Te1[148] = 0x66442222 + $Te1[149] = 0x7E542A2A + $Te1[150] = 0xAB3B9090 + $Te1[151] = 0x830B8888 + $Te1[152] = 0xCA8C4646 + $Te1[153] = 0x29C7EEEE + $Te1[154] = 0xD36BB8B8 + $Te1[155] = 0x3C281414 + $Te1[156] = 0x79A7DEDE + $Te1[157] = 0xE2BC5E5E + $Te1[158] = 0x1D160B0B + $Te1[159] = 0x76ADDBDB + $Te1[160] = 0x3BDBE0E0 + $Te1[161] = 0x56643232 + $Te1[162] = 0x4E743A3A + $Te1[163] = 0x1E140A0A + $Te1[164] = 0xDB924949 + $Te1[165] = 0x0A0C0606 + $Te1[166] = 0x6C482424 + $Te1[167] = 0xE4B85C5C + $Te1[168] = 0x5D9FC2C2 + $Te1[169] = 0x6EBDD3D3 + $Te1[170] = 0xEF43ACAC + $Te1[171] = 0xA6C46262 + $Te1[172] = 0xA8399191 + $Te1[173] = 0xA4319595 + $Te1[174] = 0x37D3E4E4 + $Te1[175] = 0x8BF27979 + $Te1[176] = 0x32D5E7E7 + $Te1[177] = 0x438BC8C8 + $Te1[178] = 0x596E3737 + $Te1[179] = 0xB7DA6D6D + $Te1[180] = 0x8C018D8D + $Te1[181] = 0x64B1D5D5 + $Te1[182] = 0xD29C4E4E + $Te1[183] = 0xE049A9A9 + $Te1[184] = 0xB4D86C6C + $Te1[185] = 0xFAAC5656 + $Te1[186] = 0x07F3F4F4 + $Te1[187] = 0x25CFEAEA + $Te1[188] = 0xAFCA6565 + $Te1[189] = 0x8EF47A7A + $Te1[190] = 0xE947AEAE + $Te1[191] = 0x18100808 + $Te1[192] = 0xD56FBABA + $Te1[193] = 0x88F07878 + $Te1[194] = 0x6F4A2525 + $Te1[195] = 0x725C2E2E + $Te1[196] = 0x24381C1C + $Te1[197] = 0xF157A6A6 + $Te1[198] = 0xC773B4B4 + $Te1[199] = 0x5197C6C6 + $Te1[200] = 0x23CBE8E8 + $Te1[201] = 0x7CA1DDDD + $Te1[202] = 0x9CE87474 + $Te1[203] = 0x213E1F1F + $Te1[204] = 0xDD964B4B + $Te1[205] = 0xDC61BDBD + $Te1[206] = 0x860D8B8B + $Te1[207] = 0x850F8A8A + $Te1[208] = 0x90E07070 + $Te1[209] = 0x427C3E3E + $Te1[210] = 0xC471B5B5 + $Te1[211] = 0xAACC6666 + $Te1[212] = 0xD8904848 + $Te1[213] = 0x05060303 + $Te1[214] = 0x01F7F6F6 + $Te1[215] = 0x121C0E0E + $Te1[216] = 0xA3C26161 + $Te1[217] = 0x5F6A3535 + $Te1[218] = 0xF9AE5757 + $Te1[219] = 0xD069B9B9 + $Te1[220] = 0x91178686 + $Te1[221] = 0x5899C1C1 + $Te1[222] = 0x273A1D1D + $Te1[223] = 0xB9279E9E + $Te1[224] = 0x38D9E1E1 + $Te1[225] = 0x13EBF8F8 + $Te1[226] = 0xB32B9898 + $Te1[227] = 0x33221111 + $Te1[228] = 0xBBD26969 + $Te1[229] = 0x70A9D9D9 + $Te1[230] = 0x89078E8E + $Te1[231] = 0xA7339494 + $Te1[232] = 0xB62D9B9B + $Te1[233] = 0x223C1E1E + $Te1[234] = 0x92158787 + $Te1[235] = 0x20C9E9E9 + $Te1[236] = 0x4987CECE + $Te1[237] = 0xFFAA5555 + $Te1[238] = 0x78502828 + $Te1[239] = 0x7AA5DFDF + $Te1[240] = 0x8F038C8C + $Te1[241] = 0xF859A1A1 + $Te1[242] = 0x80098989 + $Te1[243] = 0x171A0D0D + $Te1[244] = 0xDA65BFBF + $Te1[245] = 0x31D7E6E6 + $Te1[246] = 0xC6844242 + $Te1[247] = 0xB8D06868 + $Te1[248] = 0xC3824141 + $Te1[249] = 0xB0299999 + $Te1[250] = 0x775A2D2D + $Te1[251] = 0x111E0F0F + $Te1[252] = 0xCB7BB0B0 + $Te1[253] = 0xFCA85454 + $Te1[254] = 0xD66DBBBB + $Te1[255] = 0x3A2C1616 + Local $Te2[256] + $Te2[0] = 0x63A5C663 + $Te2[1] = 0x7C84F87C + $Te2[2] = 0x7799EE77 + $Te2[3] = 0x7B8DF67B + $Te2[4] = 0xF20DFFF2 + $Te2[5] = 0x6BBDD66B + $Te2[6] = 0x6FB1DE6F + $Te2[7] = 0xC55491C5 + $Te2[8] = 0x30506030 + $Te2[9] = 0x01030201 + $Te2[10] = 0x67A9CE67 + $Te2[11] = 0x2B7D562B + $Te2[12] = 0xFE19E7FE + $Te2[13] = 0xD762B5D7 + $Te2[14] = 0xABE64DAB + $Te2[15] = 0x769AEC76 + $Te2[16] = 0xCA458FCA + $Te2[17] = 0x829D1F82 + $Te2[18] = 0xC94089C9 + $Te2[19] = 0x7D87FA7D + $Te2[20] = 0xFA15EFFA + $Te2[21] = 0x59EBB259 + $Te2[22] = 0x47C98E47 + $Te2[23] = 0xF00BFBF0 + $Te2[24] = 0xADEC41AD + $Te2[25] = 0xD467B3D4 + $Te2[26] = 0xA2FD5FA2 + $Te2[27] = 0xAFEA45AF + $Te2[28] = 0x9CBF239C + $Te2[29] = 0xA4F753A4 + $Te2[30] = 0x7296E472 + $Te2[31] = 0xC05B9BC0 + $Te2[32] = 0xB7C275B7 + $Te2[33] = 0xFD1CE1FD + $Te2[34] = 0x93AE3D93 + $Te2[35] = 0x266A4C26 + $Te2[36] = 0x365A6C36 + $Te2[37] = 0x3F417E3F + $Te2[38] = 0xF702F5F7 + $Te2[39] = 0xCC4F83CC + $Te2[40] = 0x345C6834 + $Te2[41] = 0xA5F451A5 + $Te2[42] = 0xE534D1E5 + $Te2[43] = 0xF108F9F1 + $Te2[44] = 0x7193E271 + $Te2[45] = 0xD873ABD8 + $Te2[46] = 0x31536231 + $Te2[47] = 0x153F2A15 + $Te2[48] = 0x040C0804 + $Te2[49] = 0xC75295C7 + $Te2[50] = 0x23654623 + $Te2[51] = 0xC35E9DC3 + $Te2[52] = 0x18283018 + $Te2[53] = 0x96A13796 + $Te2[54] = 0x050F0A05 + $Te2[55] = 0x9AB52F9A + $Te2[56] = 0x07090E07 + $Te2[57] = 0x12362412 + $Te2[58] = 0x809B1B80 + $Te2[59] = 0xE23DDFE2 + $Te2[60] = 0xEB26CDEB + $Te2[61] = 0x27694E27 + $Te2[62] = 0xB2CD7FB2 + $Te2[63] = 0x759FEA75 + $Te2[64] = 0x091B1209 + $Te2[65] = 0x839E1D83 + $Te2[66] = 0x2C74582C + $Te2[67] = 0x1A2E341A + $Te2[68] = 0x1B2D361B + $Te2[69] = 0x6EB2DC6E + $Te2[70] = 0x5AEEB45A + $Te2[71] = 0xA0FB5BA0 + $Te2[72] = 0x52F6A452 + $Te2[73] = 0x3B4D763B + $Te2[74] = 0xD661B7D6 + $Te2[75] = 0xB3CE7DB3 + $Te2[76] = 0x297B5229 + $Te2[77] = 0xE33EDDE3 + $Te2[78] = 0x2F715E2F + $Te2[79] = 0x84971384 + $Te2[80] = 0x53F5A653 + $Te2[81] = 0xD168B9D1 + $Te2[82] = 0x00000000 + $Te2[83] = 0xED2CC1ED + $Te2[84] = 0x20604020 + $Te2[85] = 0xFC1FE3FC + $Te2[86] = 0xB1C879B1 + $Te2[87] = 0x5BEDB65B + $Te2[88] = 0x6ABED46A + $Te2[89] = 0xCB468DCB + $Te2[90] = 0xBED967BE + $Te2[91] = 0x394B7239 + $Te2[92] = 0x4ADE944A + $Te2[93] = 0x4CD4984C + $Te2[94] = 0x58E8B058 + $Te2[95] = 0xCF4A85CF + $Te2[96] = 0xD06BBBD0 + $Te2[97] = 0xEF2AC5EF + $Te2[98] = 0xAAE54FAA + $Te2[99] = 0xFB16EDFB + $Te2[100] = 0x43C58643 + $Te2[101] = 0x4DD79A4D + $Te2[102] = 0x33556633 + $Te2[103] = 0x85941185 + $Te2[104] = 0x45CF8A45 + $Te2[105] = 0xF910E9F9 + $Te2[106] = 0x02060402 + $Te2[107] = 0x7F81FE7F + $Te2[108] = 0x50F0A050 + $Te2[109] = 0x3C44783C + $Te2[110] = 0x9FBA259F + $Te2[111] = 0xA8E34BA8 + $Te2[112] = 0x51F3A251 + $Te2[113] = 0xA3FE5DA3 + $Te2[114] = 0x40C08040 + $Te2[115] = 0x8F8A058F + $Te2[116] = 0x92AD3F92 + $Te2[117] = 0x9DBC219D + $Te2[118] = 0x38487038 + $Te2[119] = 0xF504F1F5 + $Te2[120] = 0xBCDF63BC + $Te2[121] = 0xB6C177B6 + $Te2[122] = 0xDA75AFDA + $Te2[123] = 0x21634221 + $Te2[124] = 0x10302010 + $Te2[125] = 0xFF1AE5FF + $Te2[126] = 0xF30EFDF3 + $Te2[127] = 0xD26DBFD2 + $Te2[128] = 0xCD4C81CD + $Te2[129] = 0x0C14180C + $Te2[130] = 0x13352613 + $Te2[131] = 0xEC2FC3EC + $Te2[132] = 0x5FE1BE5F + $Te2[133] = 0x97A23597 + $Te2[134] = 0x44CC8844 + $Te2[135] = 0x17392E17 + $Te2[136] = 0xC45793C4 + $Te2[137] = 0xA7F255A7 + $Te2[138] = 0x7E82FC7E + $Te2[139] = 0x3D477A3D + $Te2[140] = 0x64ACC864 + $Te2[141] = 0x5DE7BA5D + $Te2[142] = 0x192B3219 + $Te2[143] = 0x7395E673 + $Te2[144] = 0x60A0C060 + $Te2[145] = 0x81981981 + $Te2[146] = 0x4FD19E4F + $Te2[147] = 0xDC7FA3DC + $Te2[148] = 0x22664422 + $Te2[149] = 0x2A7E542A + $Te2[150] = 0x90AB3B90 + $Te2[151] = 0x88830B88 + $Te2[152] = 0x46CA8C46 + $Te2[153] = 0xEE29C7EE + $Te2[154] = 0xB8D36BB8 + $Te2[155] = 0x143C2814 + $Te2[156] = 0xDE79A7DE + $Te2[157] = 0x5EE2BC5E + $Te2[158] = 0x0B1D160B + $Te2[159] = 0xDB76ADDB + $Te2[160] = 0xE03BDBE0 + $Te2[161] = 0x32566432 + $Te2[162] = 0x3A4E743A + $Te2[163] = 0x0A1E140A + $Te2[164] = 0x49DB9249 + $Te2[165] = 0x060A0C06 + $Te2[166] = 0x246C4824 + $Te2[167] = 0x5CE4B85C + $Te2[168] = 0xC25D9FC2 + $Te2[169] = 0xD36EBDD3 + $Te2[170] = 0xACEF43AC + $Te2[171] = 0x62A6C462 + $Te2[172] = 0x91A83991 + $Te2[173] = 0x95A43195 + $Te2[174] = 0xE437D3E4 + $Te2[175] = 0x798BF279 + $Te2[176] = 0xE732D5E7 + $Te2[177] = 0xC8438BC8 + $Te2[178] = 0x37596E37 + $Te2[179] = 0x6DB7DA6D + $Te2[180] = 0x8D8C018D + $Te2[181] = 0xD564B1D5 + $Te2[182] = 0x4ED29C4E + $Te2[183] = 0xA9E049A9 + $Te2[184] = 0x6CB4D86C + $Te2[185] = 0x56FAAC56 + $Te2[186] = 0xF407F3F4 + $Te2[187] = 0xEA25CFEA + $Te2[188] = 0x65AFCA65 + $Te2[189] = 0x7A8EF47A + $Te2[190] = 0xAEE947AE + $Te2[191] = 0x08181008 + $Te2[192] = 0xBAD56FBA + $Te2[193] = 0x7888F078 + $Te2[194] = 0x256F4A25 + $Te2[195] = 0x2E725C2E + $Te2[196] = 0x1C24381C + $Te2[197] = 0xA6F157A6 + $Te2[198] = 0xB4C773B4 + $Te2[199] = 0xC65197C6 + $Te2[200] = 0xE823CBE8 + $Te2[201] = 0xDD7CA1DD + $Te2[202] = 0x749CE874 + $Te2[203] = 0x1F213E1F + $Te2[204] = 0x4BDD964B + $Te2[205] = 0xBDDC61BD + $Te2[206] = 0x8B860D8B + $Te2[207] = 0x8A850F8A + $Te2[208] = 0x7090E070 + $Te2[209] = 0x3E427C3E + $Te2[210] = 0xB5C471B5 + $Te2[211] = 0x66AACC66 + $Te2[212] = 0x48D89048 + $Te2[213] = 0x03050603 + $Te2[214] = 0xF601F7F6 + $Te2[215] = 0x0E121C0E + $Te2[216] = 0x61A3C261 + $Te2[217] = 0x355F6A35 + $Te2[218] = 0x57F9AE57 + $Te2[219] = 0xB9D069B9 + $Te2[220] = 0x86911786 + $Te2[221] = 0xC15899C1 + $Te2[222] = 0x1D273A1D + $Te2[223] = 0x9EB9279E + $Te2[224] = 0xE138D9E1 + $Te2[225] = 0xF813EBF8 + $Te2[226] = 0x98B32B98 + $Te2[227] = 0x11332211 + $Te2[228] = 0x69BBD269 + $Te2[229] = 0xD970A9D9 + $Te2[230] = 0x8E89078E + $Te2[231] = 0x94A73394 + $Te2[232] = 0x9BB62D9B + $Te2[233] = 0x1E223C1E + $Te2[234] = 0x87921587 + $Te2[235] = 0xE920C9E9 + $Te2[236] = 0xCE4987CE + $Te2[237] = 0x55FFAA55 + $Te2[238] = 0x28785028 + $Te2[239] = 0xDF7AA5DF + $Te2[240] = 0x8C8F038C + $Te2[241] = 0xA1F859A1 + $Te2[242] = 0x89800989 + $Te2[243] = 0x0D171A0D + $Te2[244] = 0xBFDA65BF + $Te2[245] = 0xE631D7E6 + $Te2[246] = 0x42C68442 + $Te2[247] = 0x68B8D068 + $Te2[248] = 0x41C38241 + $Te2[249] = 0x99B02999 + $Te2[250] = 0x2D775A2D + $Te2[251] = 0x0F111E0F + $Te2[252] = 0xB0CB7BB0 + $Te2[253] = 0x54FCA854 + $Te2[254] = 0xBBD66DBB + $Te2[255] = 0x163A2C16 + Local $Te3[256] + $Te3[0] = 0x6363A5C6 + $Te3[1] = 0x7C7C84F8 + $Te3[2] = 0x777799EE + $Te3[3] = 0x7B7B8DF6 + $Te3[4] = 0xF2F20DFF + $Te3[5] = 0x6B6BBDD6 + $Te3[6] = 0x6F6FB1DE + $Te3[7] = 0xC5C55491 + $Te3[8] = 0x30305060 + $Te3[9] = 0x01010302 + $Te3[10] = 0x6767A9CE + $Te3[11] = 0x2B2B7D56 + $Te3[12] = 0xFEFE19E7 + $Te3[13] = 0xD7D762B5 + $Te3[14] = 0xABABE64D + $Te3[15] = 0x76769AEC + $Te3[16] = 0xCACA458F + $Te3[17] = 0x82829D1F + $Te3[18] = 0xC9C94089 + $Te3[19] = 0x7D7D87FA + $Te3[20] = 0xFAFA15EF + $Te3[21] = 0x5959EBB2 + $Te3[22] = 0x4747C98E + $Te3[23] = 0xF0F00BFB + $Te3[24] = 0xADADEC41 + $Te3[25] = 0xD4D467B3 + $Te3[26] = 0xA2A2FD5F + $Te3[27] = 0xAFAFEA45 + $Te3[28] = 0x9C9CBF23 + $Te3[29] = 0xA4A4F753 + $Te3[30] = 0x727296E4 + $Te3[31] = 0xC0C05B9B + $Te3[32] = 0xB7B7C275 + $Te3[33] = 0xFDFD1CE1 + $Te3[34] = 0x9393AE3D + $Te3[35] = 0x26266A4C + $Te3[36] = 0x36365A6C + $Te3[37] = 0x3F3F417E + $Te3[38] = 0xF7F702F5 + $Te3[39] = 0xCCCC4F83 + $Te3[40] = 0x34345C68 + $Te3[41] = 0xA5A5F451 + $Te3[42] = 0xE5E534D1 + $Te3[43] = 0xF1F108F9 + $Te3[44] = 0x717193E2 + $Te3[45] = 0xD8D873AB + $Te3[46] = 0x31315362 + $Te3[47] = 0x15153F2A + $Te3[48] = 0x04040C08 + $Te3[49] = 0xC7C75295 + $Te3[50] = 0x23236546 + $Te3[51] = 0xC3C35E9D + $Te3[52] = 0x18182830 + $Te3[53] = 0x9696A137 + $Te3[54] = 0x05050F0A + $Te3[55] = 0x9A9AB52F + $Te3[56] = 0x0707090E + $Te3[57] = 0x12123624 + $Te3[58] = 0x80809B1B + $Te3[59] = 0xE2E23DDF + $Te3[60] = 0xEBEB26CD + $Te3[61] = 0x2727694E + $Te3[62] = 0xB2B2CD7F + $Te3[63] = 0x75759FEA + $Te3[64] = 0x09091B12 + $Te3[65] = 0x83839E1D + $Te3[66] = 0x2C2C7458 + $Te3[67] = 0x1A1A2E34 + $Te3[68] = 0x1B1B2D36 + $Te3[69] = 0x6E6EB2DC + $Te3[70] = 0x5A5AEEB4 + $Te3[71] = 0xA0A0FB5B + $Te3[72] = 0x5252F6A4 + $Te3[73] = 0x3B3B4D76 + $Te3[74] = 0xD6D661B7 + $Te3[75] = 0xB3B3CE7D + $Te3[76] = 0x29297B52 + $Te3[77] = 0xE3E33EDD + $Te3[78] = 0x2F2F715E + $Te3[79] = 0x84849713 + $Te3[80] = 0x5353F5A6 + $Te3[81] = 0xD1D168B9 + $Te3[82] = 0x00000000 + $Te3[83] = 0xEDED2CC1 + $Te3[84] = 0x20206040 + $Te3[85] = 0xFCFC1FE3 + $Te3[86] = 0xB1B1C879 + $Te3[87] = 0x5B5BEDB6 + $Te3[88] = 0x6A6ABED4 + $Te3[89] = 0xCBCB468D + $Te3[90] = 0xBEBED967 + $Te3[91] = 0x39394B72 + $Te3[92] = 0x4A4ADE94 + $Te3[93] = 0x4C4CD498 + $Te3[94] = 0x5858E8B0 + $Te3[95] = 0xCFCF4A85 + $Te3[96] = 0xD0D06BBB + $Te3[97] = 0xEFEF2AC5 + $Te3[98] = 0xAAAAE54F + $Te3[99] = 0xFBFB16ED + $Te3[100] = 0x4343C586 + $Te3[101] = 0x4D4DD79A + $Te3[102] = 0x33335566 + $Te3[103] = 0x85859411 + $Te3[104] = 0x4545CF8A + $Te3[105] = 0xF9F910E9 + $Te3[106] = 0x02020604 + $Te3[107] = 0x7F7F81FE + $Te3[108] = 0x5050F0A0 + $Te3[109] = 0x3C3C4478 + $Te3[110] = 0x9F9FBA25 + $Te3[111] = 0xA8A8E34B + $Te3[112] = 0x5151F3A2 + $Te3[113] = 0xA3A3FE5D + $Te3[114] = 0x4040C080 + $Te3[115] = 0x8F8F8A05 + $Te3[116] = 0x9292AD3F + $Te3[117] = 0x9D9DBC21 + $Te3[118] = 0x38384870 + $Te3[119] = 0xF5F504F1 + $Te3[120] = 0xBCBCDF63 + $Te3[121] = 0xB6B6C177 + $Te3[122] = 0xDADA75AF + $Te3[123] = 0x21216342 + $Te3[124] = 0x10103020 + $Te3[125] = 0xFFFF1AE5 + $Te3[126] = 0xF3F30EFD + $Te3[127] = 0xD2D26DBF + $Te3[128] = 0xCDCD4C81 + $Te3[129] = 0x0C0C1418 + $Te3[130] = 0x13133526 + $Te3[131] = 0xECEC2FC3 + $Te3[132] = 0x5F5FE1BE + $Te3[133] = 0x9797A235 + $Te3[134] = 0x4444CC88 + $Te3[135] = 0x1717392E + $Te3[136] = 0xC4C45793 + $Te3[137] = 0xA7A7F255 + $Te3[138] = 0x7E7E82FC + $Te3[139] = 0x3D3D477A + $Te3[140] = 0x6464ACC8 + $Te3[141] = 0x5D5DE7BA + $Te3[142] = 0x19192B32 + $Te3[143] = 0x737395E6 + $Te3[144] = 0x6060A0C0 + $Te3[145] = 0x81819819 + $Te3[146] = 0x4F4FD19E + $Te3[147] = 0xDCDC7FA3 + $Te3[148] = 0x22226644 + $Te3[149] = 0x2A2A7E54 + $Te3[150] = 0x9090AB3B + $Te3[151] = 0x8888830B + $Te3[152] = 0x4646CA8C + $Te3[153] = 0xEEEE29C7 + $Te3[154] = 0xB8B8D36B + $Te3[155] = 0x14143C28 + $Te3[156] = 0xDEDE79A7 + $Te3[157] = 0x5E5EE2BC + $Te3[158] = 0x0B0B1D16 + $Te3[159] = 0xDBDB76AD + $Te3[160] = 0xE0E03BDB + $Te3[161] = 0x32325664 + $Te3[162] = 0x3A3A4E74 + $Te3[163] = 0x0A0A1E14 + $Te3[164] = 0x4949DB92 + $Te3[165] = 0x06060A0C + $Te3[166] = 0x24246C48 + $Te3[167] = 0x5C5CE4B8 + $Te3[168] = 0xC2C25D9F + $Te3[169] = 0xD3D36EBD + $Te3[170] = 0xACACEF43 + $Te3[171] = 0x6262A6C4 + $Te3[172] = 0x9191A839 + $Te3[173] = 0x9595A431 + $Te3[174] = 0xE4E437D3 + $Te3[175] = 0x79798BF2 + $Te3[176] = 0xE7E732D5 + $Te3[177] = 0xC8C8438B + $Te3[178] = 0x3737596E + $Te3[179] = 0x6D6DB7DA + $Te3[180] = 0x8D8D8C01 + $Te3[181] = 0xD5D564B1 + $Te3[182] = 0x4E4ED29C + $Te3[183] = 0xA9A9E049 + $Te3[184] = 0x6C6CB4D8 + $Te3[185] = 0x5656FAAC + $Te3[186] = 0xF4F407F3 + $Te3[187] = 0xEAEA25CF + $Te3[188] = 0x6565AFCA + $Te3[189] = 0x7A7A8EF4 + $Te3[190] = 0xAEAEE947 + $Te3[191] = 0x08081810 + $Te3[192] = 0xBABAD56F + $Te3[193] = 0x787888F0 + $Te3[194] = 0x25256F4A + $Te3[195] = 0x2E2E725C + $Te3[196] = 0x1C1C2438 + $Te3[197] = 0xA6A6F157 + $Te3[198] = 0xB4B4C773 + $Te3[199] = 0xC6C65197 + $Te3[200] = 0xE8E823CB + $Te3[201] = 0xDDDD7CA1 + $Te3[202] = 0x74749CE8 + $Te3[203] = 0x1F1F213E + $Te3[204] = 0x4B4BDD96 + $Te3[205] = 0xBDBDDC61 + $Te3[206] = 0x8B8B860D + $Te3[207] = 0x8A8A850F + $Te3[208] = 0x707090E0 + $Te3[209] = 0x3E3E427C + $Te3[210] = 0xB5B5C471 + $Te3[211] = 0x6666AACC + $Te3[212] = 0x4848D890 + $Te3[213] = 0x03030506 + $Te3[214] = 0xF6F601F7 + $Te3[215] = 0x0E0E121C + $Te3[216] = 0x6161A3C2 + $Te3[217] = 0x35355F6A + $Te3[218] = 0x5757F9AE + $Te3[219] = 0xB9B9D069 + $Te3[220] = 0x86869117 + $Te3[221] = 0xC1C15899 + $Te3[222] = 0x1D1D273A + $Te3[223] = 0x9E9EB927 + $Te3[224] = 0xE1E138D9 + $Te3[225] = 0xF8F813EB + $Te3[226] = 0x9898B32B + $Te3[227] = 0x11113322 + $Te3[228] = 0x6969BBD2 + $Te3[229] = 0xD9D970A9 + $Te3[230] = 0x8E8E8907 + $Te3[231] = 0x9494A733 + $Te3[232] = 0x9B9BB62D + $Te3[233] = 0x1E1E223C + $Te3[234] = 0x87879215 + $Te3[235] = 0xE9E920C9 + $Te3[236] = 0xCECE4987 + $Te3[237] = 0x5555FFAA + $Te3[238] = 0x28287850 + $Te3[239] = 0xDFDF7AA5 + $Te3[240] = 0x8C8C8F03 + $Te3[241] = 0xA1A1F859 + $Te3[242] = 0x89898009 + $Te3[243] = 0x0D0D171A + $Te3[244] = 0xBFBFDA65 + $Te3[245] = 0xE6E631D7 + $Te3[246] = 0x4242C684 + $Te3[247] = 0x6868B8D0 + $Te3[248] = 0x4141C382 + $Te3[249] = 0x9999B029 + $Te3[250] = 0x2D2D775A + $Te3[251] = 0x0F0F111E + $Te3[252] = 0xB0B0CB7B + $Te3[253] = 0x5454FCA8 + $Te3[254] = 0xBBBBD66D + $Te3[255] = 0x16163A2C + Local $Te4[256] + $Te4[0] = 0x63636363 + $Te4[1] = 0x7C7C7C7C + $Te4[2] = 0x77777777 + $Te4[3] = 0x7B7B7B7B + $Te4[4] = 0xF2F2F2F2 + $Te4[5] = 0x6B6B6B6B + $Te4[6] = 0x6F6F6F6F + $Te4[7] = 0xC5C5C5C5 + $Te4[8] = 0x30303030 + $Te4[9] = 0x01010101 + $Te4[10] = 0x67676767 + $Te4[11] = 0x2B2B2B2B + $Te4[12] = 0xFEFEFEFE + $Te4[13] = 0xD7D7D7D7 + $Te4[14] = 0xABABABAB + $Te4[15] = 0x76767676 + $Te4[16] = 0xCACACACA + $Te4[17] = 0x82828282 + $Te4[18] = 0xC9C9C9C9 + $Te4[19] = 0x7D7D7D7D + $Te4[20] = 0xFAFAFAFA + $Te4[21] = 0x59595959 + $Te4[22] = 0x47474747 + $Te4[23] = 0xF0F0F0F0 + $Te4[24] = 0xADADADAD + $Te4[25] = 0xD4D4D4D4 + $Te4[26] = 0xA2A2A2A2 + $Te4[27] = 0xAFAFAFAF + $Te4[28] = 0x9C9C9C9C + $Te4[29] = 0xA4A4A4A4 + $Te4[30] = 0x72727272 + $Te4[31] = 0xC0C0C0C0 + $Te4[32] = 0xB7B7B7B7 + $Te4[33] = 0xFDFDFDFD + $Te4[34] = 0x93939393 + $Te4[35] = 0x26262626 + $Te4[36] = 0x36363636 + $Te4[37] = 0x3F3F3F3F + $Te4[38] = 0xF7F7F7F7 + $Te4[39] = 0xCCCCCCCC + $Te4[40] = 0x34343434 + $Te4[41] = 0xA5A5A5A5 + $Te4[42] = 0xE5E5E5E5 + $Te4[43] = 0xF1F1F1F1 + $Te4[44] = 0x71717171 + $Te4[45] = 0xD8D8D8D8 + $Te4[46] = 0x31313131 + $Te4[47] = 0x15151515 + $Te4[48] = 0x04040404 + $Te4[49] = 0xC7C7C7C7 + $Te4[50] = 0x23232323 + $Te4[51] = 0xC3C3C3C3 + $Te4[52] = 0x18181818 + $Te4[53] = 0x96969696 + $Te4[54] = 0x05050505 + $Te4[55] = 0x9A9A9A9A + $Te4[56] = 0x07070707 + $Te4[57] = 0x12121212 + $Te4[58] = 0x80808080 + $Te4[59] = 0xE2E2E2E2 + $Te4[60] = 0xEBEBEBEB + $Te4[61] = 0x27272727 + $Te4[62] = 0xB2B2B2B2 + $Te4[63] = 0x75757575 + $Te4[64] = 0x09090909 + $Te4[65] = 0x83838383 + $Te4[66] = 0x2C2C2C2C + $Te4[67] = 0x1A1A1A1A + $Te4[68] = 0x1B1B1B1B + $Te4[69] = 0x6E6E6E6E + $Te4[70] = 0x5A5A5A5A + $Te4[71] = 0xA0A0A0A0 + $Te4[72] = 0x52525252 + $Te4[73] = 0x3B3B3B3B + $Te4[74] = 0xD6D6D6D6 + $Te4[75] = 0xB3B3B3B3 + $Te4[76] = 0x29292929 + $Te4[77] = 0xE3E3E3E3 + $Te4[78] = 0x2F2F2F2F + $Te4[79] = 0x84848484 + $Te4[80] = 0x53535353 + $Te4[81] = 0xD1D1D1D1 + $Te4[82] = 0x00000000 + $Te4[83] = 0xEDEDEDED + $Te4[84] = 0x20202020 + $Te4[85] = 0xFCFCFCFC + $Te4[86] = 0xB1B1B1B1 + $Te4[87] = 0x5B5B5B5B + $Te4[88] = 0x6A6A6A6A + $Te4[89] = 0xCBCBCBCB + $Te4[90] = 0xBEBEBEBE + $Te4[91] = 0x39393939 + $Te4[92] = 0x4A4A4A4A + $Te4[93] = 0x4C4C4C4C + $Te4[94] = 0x58585858 + $Te4[95] = 0xCFCFCFCF + $Te4[96] = 0xD0D0D0D0 + $Te4[97] = 0xEFEFEFEF + $Te4[98] = 0xAAAAAAAA + $Te4[99] = 0xFBFBFBFB + $Te4[100] = 0x43434343 + $Te4[101] = 0x4D4D4D4D + $Te4[102] = 0x33333333 + $Te4[103] = 0x85858585 + $Te4[104] = 0x45454545 + $Te4[105] = 0xF9F9F9F9 + $Te4[106] = 0x02020202 + $Te4[107] = 0x7F7F7F7F + $Te4[108] = 0x50505050 + $Te4[109] = 0x3C3C3C3C + $Te4[110] = 0x9F9F9F9F + $Te4[111] = 0xA8A8A8A8 + $Te4[112] = 0x51515151 + $Te4[113] = 0xA3A3A3A3 + $Te4[114] = 0x40404040 + $Te4[115] = 0x8F8F8F8F + $Te4[116] = 0x92929292 + $Te4[117] = 0x9D9D9D9D + $Te4[118] = 0x38383838 + $Te4[119] = 0xF5F5F5F5 + $Te4[120] = 0xBCBCBCBC + $Te4[121] = 0xB6B6B6B6 + $Te4[122] = 0xDADADADA + $Te4[123] = 0x21212121 + $Te4[124] = 0x10101010 + $Te4[125] = 0xFFFFFFFF + $Te4[126] = 0xF3F3F3F3 + $Te4[127] = 0xD2D2D2D2 + $Te4[128] = 0xCDCDCDCD + $Te4[129] = 0x0C0C0C0C + $Te4[130] = 0x13131313 + $Te4[131] = 0xECECECEC + $Te4[132] = 0x5F5F5F5F + $Te4[133] = 0x97979797 + $Te4[134] = 0x44444444 + $Te4[135] = 0x17171717 + $Te4[136] = 0xC4C4C4C4 + $Te4[137] = 0xA7A7A7A7 + $Te4[138] = 0x7E7E7E7E + $Te4[139] = 0x3D3D3D3D + $Te4[140] = 0x64646464 + $Te4[141] = 0x5D5D5D5D + $Te4[142] = 0x19191919 + $Te4[143] = 0x73737373 + $Te4[144] = 0x60606060 + $Te4[145] = 0x81818181 + $Te4[146] = 0x4F4F4F4F + $Te4[147] = 0xDCDCDCDC + $Te4[148] = 0x22222222 + $Te4[149] = 0x2A2A2A2A + $Te4[150] = 0x90909090 + $Te4[151] = 0x88888888 + $Te4[152] = 0x46464646 + $Te4[153] = 0xEEEEEEEE + $Te4[154] = 0xB8B8B8B8 + $Te4[155] = 0x14141414 + $Te4[156] = 0xDEDEDEDE + $Te4[157] = 0x5E5E5E5E + $Te4[158] = 0x0B0B0B0B + $Te4[159] = 0xDBDBDBDB + $Te4[160] = 0xE0E0E0E0 + $Te4[161] = 0x32323232 + $Te4[162] = 0x3A3A3A3A + $Te4[163] = 0x0A0A0A0A + $Te4[164] = 0x49494949 + $Te4[165] = 0x06060606 + $Te4[166] = 0x24242424 + $Te4[167] = 0x5C5C5C5C + $Te4[168] = 0xC2C2C2C2 + $Te4[169] = 0xD3D3D3D3 + $Te4[170] = 0xACACACAC + $Te4[171] = 0x62626262 + $Te4[172] = 0x91919191 + $Te4[173] = 0x95959595 + $Te4[174] = 0xE4E4E4E4 + $Te4[175] = 0x79797979 + $Te4[176] = 0xE7E7E7E7 + $Te4[177] = 0xC8C8C8C8 + $Te4[178] = 0x37373737 + $Te4[179] = 0x6D6D6D6D + $Te4[180] = 0x8D8D8D8D + $Te4[181] = 0xD5D5D5D5 + $Te4[182] = 0x4E4E4E4E + $Te4[183] = 0xA9A9A9A9 + $Te4[184] = 0x6C6C6C6C + $Te4[185] = 0x56565656 + $Te4[186] = 0xF4F4F4F4 + $Te4[187] = 0xEAEAEAEA + $Te4[188] = 0x65656565 + $Te4[189] = 0x7A7A7A7A + $Te4[190] = 0xAEAEAEAE + $Te4[191] = 0x08080808 + $Te4[192] = 0xBABABABA + $Te4[193] = 0x78787878 + $Te4[194] = 0x25252525 + $Te4[195] = 0x2E2E2E2E + $Te4[196] = 0x1C1C1C1C + $Te4[197] = 0xA6A6A6A6 + $Te4[198] = 0xB4B4B4B4 + $Te4[199] = 0xC6C6C6C6 + $Te4[200] = 0xE8E8E8E8 + $Te4[201] = 0xDDDDDDDD + $Te4[202] = 0x74747474 + $Te4[203] = 0x1F1F1F1F + $Te4[204] = 0x4B4B4B4B + $Te4[205] = 0xBDBDBDBD + $Te4[206] = 0x8B8B8B8B + $Te4[207] = 0x8A8A8A8A + $Te4[208] = 0x70707070 + $Te4[209] = 0x3E3E3E3E + $Te4[210] = 0xB5B5B5B5 + $Te4[211] = 0x66666666 + $Te4[212] = 0x48484848 + $Te4[213] = 0x03030303 + $Te4[214] = 0xF6F6F6F6 + $Te4[215] = 0x0E0E0E0E + $Te4[216] = 0x61616161 + $Te4[217] = 0x35353535 + $Te4[218] = 0x57575757 + $Te4[219] = 0xB9B9B9B9 + $Te4[220] = 0x86868686 + $Te4[221] = 0xC1C1C1C1 + $Te4[222] = 0x1D1D1D1D + $Te4[223] = 0x9E9E9E9E + $Te4[224] = 0xE1E1E1E1 + $Te4[225] = 0xF8F8F8F8 + $Te4[226] = 0x98989898 + $Te4[227] = 0x11111111 + $Te4[228] = 0x69696969 + $Te4[229] = 0xD9D9D9D9 + $Te4[230] = 0x8E8E8E8E + $Te4[231] = 0x94949494 + $Te4[232] = 0x9B9B9B9B + $Te4[233] = 0x1E1E1E1E + $Te4[234] = 0x87878787 + $Te4[235] = 0xE9E9E9E9 + $Te4[236] = 0xCECECECE + $Te4[237] = 0x55555555 + $Te4[238] = 0x28282828 + $Te4[239] = 0xDFDFDFDF + $Te4[240] = 0x8C8C8C8C + $Te4[241] = 0xA1A1A1A1 + $Te4[242] = 0x89898989 + $Te4[243] = 0x0D0D0D0D + $Te4[244] = 0xBFBFBFBF + $Te4[245] = 0xE6E6E6E6 + $Te4[246] = 0x42424242 + $Te4[247] = 0x68686868 + $Te4[248] = 0x41414141 + $Te4[249] = 0x99999999 + $Te4[250] = 0x2D2D2D2D + $Te4[251] = 0x0F0F0F0F + $Te4[252] = 0xB0B0B0B0 + $Te4[253] = 0x54545454 + $Te4[254] = 0xBBBBBBBB + $Te4[255] = 0x16161616 + Local $t[$Nb] + Local $keypos = 0 + If $Nb < 8 Then + Local $C[4] = [0, 1, 2, 3] + Else + Local $C[4] = [0, 1, 3, 4] + EndIf + + For $i = 0 To $Nb - 1 + $s[$i] = BitXOR($s[$i],$w[$keypos]) ; The Initial Round Key + $keypos += 1 + Next + + For $i = 1 To $Nr - 1 + $t = $s + + For $j = 0 To $Nb - 1 + $s[$j] = BitXOR($Te0[BitAND(BitShift($t[Mod($j+$C[0],$Nb)],24),0xFF)],$Te1[BitAND(BitShift($t[Mod($j+$C[1],$Nb)],16),0xFF)],$Te2[BitAND(BitShift($t[Mod($j+$C[2],$Nb)],8),0xFF)],$Te3[BitAND($t[Mod($j+$C[3],$Nb)],0xFF)],$w[$keypos]) + $keypos += 1 + Next + Next + + $t = $s + + For $j = 0 To $Nb - 1 + $s[$j] = BitXOR(BitAND($Te4[BitAND(BitShift($t[Mod($j+$C[0],$Nb)],24),0xFF)],0xFF000000),BitAND($Te4[BitAND(BitShift($t[Mod($j+$C[1],$Nb)],16),0xFF)],0xFF0000),BitAND($Te4[BitAND(BitShift($t[Mod($j+$C[2],$Nb)],8),0xFF)],0xFF00),BitAND($Te4[BitAND($t[Mod($j+$C[3],$Nb)],0xFF)],0xFF),$w[$keypos]) + $keypos += 1 + Next + + Return $s +EndFunc + +Func InvCipher($w, $s, $Nb, $Nk, $Nr) + Local $Td0[256] + $Td0[0] = 0x51F4A750 + $Td0[1] = 0x7E416553 + $Td0[2] = 0x1A17A4C3 + $Td0[3] = 0x3A275E96 + $Td0[4] = 0x3BAB6BCB + $Td0[5] = 0x1F9D45F1 + $Td0[6] = 0xACFA58AB + $Td0[7] = 0x4BE30393 + $Td0[8] = 0x2030FA55 + $Td0[9] = 0xAD766DF6 + $Td0[10] = 0x88CC7691 + $Td0[11] = 0xF5024C25 + $Td0[12] = 0x4FE5D7FC + $Td0[13] = 0xC52ACBD7 + $Td0[14] = 0x26354480 + $Td0[15] = 0xB562A38F + $Td0[16] = 0xDEB15A49 + $Td0[17] = 0x25BA1B67 + $Td0[18] = 0x45EA0E98 + $Td0[19] = 0x5DFEC0E1 + $Td0[20] = 0xC32F7502 + $Td0[21] = 0x814CF012 + $Td0[22] = 0x8D4697A3 + $Td0[23] = 0x6BD3F9C6 + $Td0[24] = 0x038F5FE7 + $Td0[25] = 0x15929C95 + $Td0[26] = 0xBF6D7AEB + $Td0[27] = 0x955259DA + $Td0[28] = 0xD4BE832D + $Td0[29] = 0x587421D3 + $Td0[30] = 0x49E06929 + $Td0[31] = 0x8EC9C844 + $Td0[32] = 0x75C2896A + $Td0[33] = 0xF48E7978 + $Td0[34] = 0x99583E6B + $Td0[35] = 0x27B971DD + $Td0[36] = 0xBEE14FB6 + $Td0[37] = 0xF088AD17 + $Td0[38] = 0xC920AC66 + $Td0[39] = 0x7DCE3AB4 + $Td0[40] = 0x63DF4A18 + $Td0[41] = 0xE51A3182 + $Td0[42] = 0x97513360 + $Td0[43] = 0x62537F45 + $Td0[44] = 0xB16477E0 + $Td0[45] = 0xBB6BAE84 + $Td0[46] = 0xFE81A01C + $Td0[47] = 0xF9082B94 + $Td0[48] = 0x70486858 + $Td0[49] = 0x8F45FD19 + $Td0[50] = 0x94DE6C87 + $Td0[51] = 0x527BF8B7 + $Td0[52] = 0xAB73D323 + $Td0[53] = 0x724B02E2 + $Td0[54] = 0xE31F8F57 + $Td0[55] = 0x6655AB2A + $Td0[56] = 0xB2EB2807 + $Td0[57] = 0x2FB5C203 + $Td0[58] = 0x86C57B9A + $Td0[59] = 0xD33708A5 + $Td0[60] = 0x302887F2 + $Td0[61] = 0x23BFA5B2 + $Td0[62] = 0x02036ABA + $Td0[63] = 0xED16825C + $Td0[64] = 0x8ACF1C2B + $Td0[65] = 0xA779B492 + $Td0[66] = 0xF307F2F0 + $Td0[67] = 0x4E69E2A1 + $Td0[68] = 0x65DAF4CD + $Td0[69] = 0x0605BED5 + $Td0[70] = 0xD134621F + $Td0[71] = 0xC4A6FE8A + $Td0[72] = 0x342E539D + $Td0[73] = 0xA2F355A0 + $Td0[74] = 0x058AE132 + $Td0[75] = 0xA4F6EB75 + $Td0[76] = 0x0B83EC39 + $Td0[77] = 0x4060EFAA + $Td0[78] = 0x5E719F06 + $Td0[79] = 0xBD6E1051 + $Td0[80] = 0x3E218AF9 + $Td0[81] = 0x96DD063D + $Td0[82] = 0xDD3E05AE + $Td0[83] = 0x4DE6BD46 + $Td0[84] = 0x91548DB5 + $Td0[85] = 0x71C45D05 + $Td0[86] = 0x0406D46F + $Td0[87] = 0x605015FF + $Td0[88] = 0x1998FB24 + $Td0[89] = 0xD6BDE997 + $Td0[90] = 0x894043CC + $Td0[91] = 0x67D99E77 + $Td0[92] = 0xB0E842BD + $Td0[93] = 0x07898B88 + $Td0[94] = 0xE7195B38 + $Td0[95] = 0x79C8EEDB + $Td0[96] = 0xA17C0A47 + $Td0[97] = 0x7C420FE9 + $Td0[98] = 0xF8841EC9 + $Td0[99] = 0x00000000 + $Td0[100] = 0x09808683 + $Td0[101] = 0x322BED48 + $Td0[102] = 0x1E1170AC + $Td0[103] = 0x6C5A724E + $Td0[104] = 0xFD0EFFFB + $Td0[105] = 0x0F853856 + $Td0[106] = 0x3DAED51E + $Td0[107] = 0x362D3927 + $Td0[108] = 0x0A0FD964 + $Td0[109] = 0x685CA621 + $Td0[110] = 0x9B5B54D1 + $Td0[111] = 0x24362E3A + $Td0[112] = 0x0C0A67B1 + $Td0[113] = 0x9357E70F + $Td0[114] = 0xB4EE96D2 + $Td0[115] = 0x1B9B919E + $Td0[116] = 0x80C0C54F + $Td0[117] = 0x61DC20A2 + $Td0[118] = 0x5A774B69 + $Td0[119] = 0x1C121A16 + $Td0[120] = 0xE293BA0A + $Td0[121] = 0xC0A02AE5 + $Td0[122] = 0x3C22E043 + $Td0[123] = 0x121B171D + $Td0[124] = 0x0E090D0B + $Td0[125] = 0xF28BC7AD + $Td0[126] = 0x2DB6A8B9 + $Td0[127] = 0x141EA9C8 + $Td0[128] = 0x57F11985 + $Td0[129] = 0xAF75074C + $Td0[130] = 0xEE99DDBB + $Td0[131] = 0xA37F60FD + $Td0[132] = 0xF701269F + $Td0[133] = 0x5C72F5BC + $Td0[134] = 0x44663BC5 + $Td0[135] = 0x5BFB7E34 + $Td0[136] = 0x8B432976 + $Td0[137] = 0xCB23C6DC + $Td0[138] = 0xB6EDFC68 + $Td0[139] = 0xB8E4F163 + $Td0[140] = 0xD731DCCA + $Td0[141] = 0x42638510 + $Td0[142] = 0x13972240 + $Td0[143] = 0x84C61120 + $Td0[144] = 0x854A247D + $Td0[145] = 0xD2BB3DF8 + $Td0[146] = 0xAEF93211 + $Td0[147] = 0xC729A16D + $Td0[148] = 0x1D9E2F4B + $Td0[149] = 0xDCB230F3 + $Td0[150] = 0x0D8652EC + $Td0[151] = 0x77C1E3D0 + $Td0[152] = 0x2BB3166C + $Td0[153] = 0xA970B999 + $Td0[154] = 0x119448FA + $Td0[155] = 0x47E96422 + $Td0[156] = 0xA8FC8CC4 + $Td0[157] = 0xA0F03F1A + $Td0[158] = 0x567D2CD8 + $Td0[159] = 0x223390EF + $Td0[160] = 0x87494EC7 + $Td0[161] = 0xD938D1C1 + $Td0[162] = 0x8CCAA2FE + $Td0[163] = 0x98D40B36 + $Td0[164] = 0xA6F581CF + $Td0[165] = 0xA57ADE28 + $Td0[166] = 0xDAB78E26 + $Td0[167] = 0x3FADBFA4 + $Td0[168] = 0x2C3A9DE4 + $Td0[169] = 0x5078920D + $Td0[170] = 0x6A5FCC9B + $Td0[171] = 0x547E4662 + $Td0[172] = 0xF68D13C2 + $Td0[173] = 0x90D8B8E8 + $Td0[174] = 0x2E39F75E + $Td0[175] = 0x82C3AFF5 + $Td0[176] = 0x9F5D80BE + $Td0[177] = 0x69D0937C + $Td0[178] = 0x6FD52DA9 + $Td0[179] = 0xCF2512B3 + $Td0[180] = 0xC8AC993B + $Td0[181] = 0x10187DA7 + $Td0[182] = 0xE89C636E + $Td0[183] = 0xDB3BBB7B + $Td0[184] = 0xCD267809 + $Td0[185] = 0x6E5918F4 + $Td0[186] = 0xEC9AB701 + $Td0[187] = 0x834F9AA8 + $Td0[188] = 0xE6956E65 + $Td0[189] = 0xAAFFE67E + $Td0[190] = 0x21BCCF08 + $Td0[191] = 0xEF15E8E6 + $Td0[192] = 0xBAE79BD9 + $Td0[193] = 0x4A6F36CE + $Td0[194] = 0xEA9F09D4 + $Td0[195] = 0x29B07CD6 + $Td0[196] = 0x31A4B2AF + $Td0[197] = 0x2A3F2331 + $Td0[198] = 0xC6A59430 + $Td0[199] = 0x35A266C0 + $Td0[200] = 0x744EBC37 + $Td0[201] = 0xFC82CAA6 + $Td0[202] = 0xE090D0B0 + $Td0[203] = 0x33A7D815 + $Td0[204] = 0xF104984A + $Td0[205] = 0x41ECDAF7 + $Td0[206] = 0x7FCD500E + $Td0[207] = 0x1791F62F + $Td0[208] = 0x764DD68D + $Td0[209] = 0x43EFB04D + $Td0[210] = 0xCCAA4D54 + $Td0[211] = 0xE49604DF + $Td0[212] = 0x9ED1B5E3 + $Td0[213] = 0x4C6A881B + $Td0[214] = 0xC12C1FB8 + $Td0[215] = 0x4665517F + $Td0[216] = 0x9D5EEA04 + $Td0[217] = 0x018C355D + $Td0[218] = 0xFA877473 + $Td0[219] = 0xFB0B412E + $Td0[220] = 0xB3671D5A + $Td0[221] = 0x92DBD252 + $Td0[222] = 0xE9105633 + $Td0[223] = 0x6DD64713 + $Td0[224] = 0x9AD7618C + $Td0[225] = 0x37A10C7A + $Td0[226] = 0x59F8148E + $Td0[227] = 0xEB133C89 + $Td0[228] = 0xCEA927EE + $Td0[229] = 0xB761C935 + $Td0[230] = 0xE11CE5ED + $Td0[231] = 0x7A47B13C + $Td0[232] = 0x9CD2DF59 + $Td0[233] = 0x55F2733F + $Td0[234] = 0x1814CE79 + $Td0[235] = 0x73C737BF + $Td0[236] = 0x53F7CDEA + $Td0[237] = 0x5FFDAA5B + $Td0[238] = 0xDF3D6F14 + $Td0[239] = 0x7844DB86 + $Td0[240] = 0xCAAFF381 + $Td0[241] = 0xB968C43E + $Td0[242] = 0x3824342C + $Td0[243] = 0xC2A3405F + $Td0[244] = 0x161DC372 + $Td0[245] = 0xBCE2250C + $Td0[246] = 0x283C498B + $Td0[247] = 0xFF0D9541 + $Td0[248] = 0x39A80171 + $Td0[249] = 0x080CB3DE + $Td0[250] = 0xD8B4E49C + $Td0[251] = 0x6456C190 + $Td0[252] = 0x7BCB8461 + $Td0[253] = 0xD532B670 + $Td0[254] = 0x486C5C74 + $Td0[255] = 0xD0B85742 + Local $Td1[256] + $Td1[0] = 0x5051F4A7 + $Td1[1] = 0x537E4165 + $Td1[2] = 0xC31A17A4 + $Td1[3] = 0x963A275E + $Td1[4] = 0xCB3BAB6B + $Td1[5] = 0xF11F9D45 + $Td1[6] = 0xABACFA58 + $Td1[7] = 0x934BE303 + $Td1[8] = 0x552030FA + $Td1[9] = 0xF6AD766D + $Td1[10] = 0x9188CC76 + $Td1[11] = 0x25F5024C + $Td1[12] = 0xFC4FE5D7 + $Td1[13] = 0xD7C52ACB + $Td1[14] = 0x80263544 + $Td1[15] = 0x8FB562A3 + $Td1[16] = 0x49DEB15A + $Td1[17] = 0x6725BA1B + $Td1[18] = 0x9845EA0E + $Td1[19] = 0xE15DFEC0 + $Td1[20] = 0x02C32F75 + $Td1[21] = 0x12814CF0 + $Td1[22] = 0xA38D4697 + $Td1[23] = 0xC66BD3F9 + $Td1[24] = 0xE7038F5F + $Td1[25] = 0x9515929C + $Td1[26] = 0xEBBF6D7A + $Td1[27] = 0xDA955259 + $Td1[28] = 0x2DD4BE83 + $Td1[29] = 0xD3587421 + $Td1[30] = 0x2949E069 + $Td1[31] = 0x448EC9C8 + $Td1[32] = 0x6A75C289 + $Td1[33] = 0x78F48E79 + $Td1[34] = 0x6B99583E + $Td1[35] = 0xDD27B971 + $Td1[36] = 0xB6BEE14F + $Td1[37] = 0x17F088AD + $Td1[38] = 0x66C920AC + $Td1[39] = 0xB47DCE3A + $Td1[40] = 0x1863DF4A + $Td1[41] = 0x82E51A31 + $Td1[42] = 0x60975133 + $Td1[43] = 0x4562537F + $Td1[44] = 0xE0B16477 + $Td1[45] = 0x84BB6BAE + $Td1[46] = 0x1CFE81A0 + $Td1[47] = 0x94F9082B + $Td1[48] = 0x58704868 + $Td1[49] = 0x198F45FD + $Td1[50] = 0x8794DE6C + $Td1[51] = 0xB7527BF8 + $Td1[52] = 0x23AB73D3 + $Td1[53] = 0xE2724B02 + $Td1[54] = 0x57E31F8F + $Td1[55] = 0x2A6655AB + $Td1[56] = 0x07B2EB28 + $Td1[57] = 0x032FB5C2 + $Td1[58] = 0x9A86C57B + $Td1[59] = 0xA5D33708 + $Td1[60] = 0xF2302887 + $Td1[61] = 0xB223BFA5 + $Td1[62] = 0xBA02036A + $Td1[63] = 0x5CED1682 + $Td1[64] = 0x2B8ACF1C + $Td1[65] = 0x92A779B4 + $Td1[66] = 0xF0F307F2 + $Td1[67] = 0xA14E69E2 + $Td1[68] = 0xCD65DAF4 + $Td1[69] = 0xD50605BE + $Td1[70] = 0x1FD13462 + $Td1[71] = 0x8AC4A6FE + $Td1[72] = 0x9D342E53 + $Td1[73] = 0xA0A2F355 + $Td1[74] = 0x32058AE1 + $Td1[75] = 0x75A4F6EB + $Td1[76] = 0x390B83EC + $Td1[77] = 0xAA4060EF + $Td1[78] = 0x065E719F + $Td1[79] = 0x51BD6E10 + $Td1[80] = 0xF93E218A + $Td1[81] = 0x3D96DD06 + $Td1[82] = 0xAEDD3E05 + $Td1[83] = 0x464DE6BD + $Td1[84] = 0xB591548D + $Td1[85] = 0x0571C45D + $Td1[86] = 0x6F0406D4 + $Td1[87] = 0xFF605015 + $Td1[88] = 0x241998FB + $Td1[89] = 0x97D6BDE9 + $Td1[90] = 0xCC894043 + $Td1[91] = 0x7767D99E + $Td1[92] = 0xBDB0E842 + $Td1[93] = 0x8807898B + $Td1[94] = 0x38E7195B + $Td1[95] = 0xDB79C8EE + $Td1[96] = 0x47A17C0A + $Td1[97] = 0xE97C420F + $Td1[98] = 0xC9F8841E + $Td1[99] = 0x00000000 + $Td1[100] = 0x83098086 + $Td1[101] = 0x48322BED + $Td1[102] = 0xAC1E1170 + $Td1[103] = 0x4E6C5A72 + $Td1[104] = 0xFBFD0EFF + $Td1[105] = 0x560F8538 + $Td1[106] = 0x1E3DAED5 + $Td1[107] = 0x27362D39 + $Td1[108] = 0x640A0FD9 + $Td1[109] = 0x21685CA6 + $Td1[110] = 0xD19B5B54 + $Td1[111] = 0x3A24362E + $Td1[112] = 0xB10C0A67 + $Td1[113] = 0x0F9357E7 + $Td1[114] = 0xD2B4EE96 + $Td1[115] = 0x9E1B9B91 + $Td1[116] = 0x4F80C0C5 + $Td1[117] = 0xA261DC20 + $Td1[118] = 0x695A774B + $Td1[119] = 0x161C121A + $Td1[120] = 0x0AE293BA + $Td1[121] = 0xE5C0A02A + $Td1[122] = 0x433C22E0 + $Td1[123] = 0x1D121B17 + $Td1[124] = 0x0B0E090D + $Td1[125] = 0xADF28BC7 + $Td1[126] = 0xB92DB6A8 + $Td1[127] = 0xC8141EA9 + $Td1[128] = 0x8557F119 + $Td1[129] = 0x4CAF7507 + $Td1[130] = 0xBBEE99DD + $Td1[131] = 0xFDA37F60 + $Td1[132] = 0x9FF70126 + $Td1[133] = 0xBC5C72F5 + $Td1[134] = 0xC544663B + $Td1[135] = 0x345BFB7E + $Td1[136] = 0x768B4329 + $Td1[137] = 0xDCCB23C6 + $Td1[138] = 0x68B6EDFC + $Td1[139] = 0x63B8E4F1 + $Td1[140] = 0xCAD731DC + $Td1[141] = 0x10426385 + $Td1[142] = 0x40139722 + $Td1[143] = 0x2084C611 + $Td1[144] = 0x7D854A24 + $Td1[145] = 0xF8D2BB3D + $Td1[146] = 0x11AEF932 + $Td1[147] = 0x6DC729A1 + $Td1[148] = 0x4B1D9E2F + $Td1[149] = 0xF3DCB230 + $Td1[150] = 0xEC0D8652 + $Td1[151] = 0xD077C1E3 + $Td1[152] = 0x6C2BB316 + $Td1[153] = 0x99A970B9 + $Td1[154] = 0xFA119448 + $Td1[155] = 0x2247E964 + $Td1[156] = 0xC4A8FC8C + $Td1[157] = 0x1AA0F03F + $Td1[158] = 0xD8567D2C + $Td1[159] = 0xEF223390 + $Td1[160] = 0xC787494E + $Td1[161] = 0xC1D938D1 + $Td1[162] = 0xFE8CCAA2 + $Td1[163] = 0x3698D40B + $Td1[164] = 0xCFA6F581 + $Td1[165] = 0x28A57ADE + $Td1[166] = 0x26DAB78E + $Td1[167] = 0xA43FADBF + $Td1[168] = 0xE42C3A9D + $Td1[169] = 0x0D507892 + $Td1[170] = 0x9B6A5FCC + $Td1[171] = 0x62547E46 + $Td1[172] = 0xC2F68D13 + $Td1[173] = 0xE890D8B8 + $Td1[174] = 0x5E2E39F7 + $Td1[175] = 0xF582C3AF + $Td1[176] = 0xBE9F5D80 + $Td1[177] = 0x7C69D093 + $Td1[178] = 0xA96FD52D + $Td1[179] = 0xB3CF2512 + $Td1[180] = 0x3BC8AC99 + $Td1[181] = 0xA710187D + $Td1[182] = 0x6EE89C63 + $Td1[183] = 0x7BDB3BBB + $Td1[184] = 0x09CD2678 + $Td1[185] = 0xF46E5918 + $Td1[186] = 0x01EC9AB7 + $Td1[187] = 0xA8834F9A + $Td1[188] = 0x65E6956E + $Td1[189] = 0x7EAAFFE6 + $Td1[190] = 0x0821BCCF + $Td1[191] = 0xE6EF15E8 + $Td1[192] = 0xD9BAE79B + $Td1[193] = 0xCE4A6F36 + $Td1[194] = 0xD4EA9F09 + $Td1[195] = 0xD629B07C + $Td1[196] = 0xAF31A4B2 + $Td1[197] = 0x312A3F23 + $Td1[198] = 0x30C6A594 + $Td1[199] = 0xC035A266 + $Td1[200] = 0x37744EBC + $Td1[201] = 0xA6FC82CA + $Td1[202] = 0xB0E090D0 + $Td1[203] = 0x1533A7D8 + $Td1[204] = 0x4AF10498 + $Td1[205] = 0xF741ECDA + $Td1[206] = 0x0E7FCD50 + $Td1[207] = 0x2F1791F6 + $Td1[208] = 0x8D764DD6 + $Td1[209] = 0x4D43EFB0 + $Td1[210] = 0x54CCAA4D + $Td1[211] = 0xDFE49604 + $Td1[212] = 0xE39ED1B5 + $Td1[213] = 0x1B4C6A88 + $Td1[214] = 0xB8C12C1F + $Td1[215] = 0x7F466551 + $Td1[216] = 0x049D5EEA + $Td1[217] = 0x5D018C35 + $Td1[218] = 0x73FA8774 + $Td1[219] = 0x2EFB0B41 + $Td1[220] = 0x5AB3671D + $Td1[221] = 0x5292DBD2 + $Td1[222] = 0x33E91056 + $Td1[223] = 0x136DD647 + $Td1[224] = 0x8C9AD761 + $Td1[225] = 0x7A37A10C + $Td1[226] = 0x8E59F814 + $Td1[227] = 0x89EB133C + $Td1[228] = 0xEECEA927 + $Td1[229] = 0x35B761C9 + $Td1[230] = 0xEDE11CE5 + $Td1[231] = 0x3C7A47B1 + $Td1[232] = 0x599CD2DF + $Td1[233] = 0x3F55F273 + $Td1[234] = 0x791814CE + $Td1[235] = 0xBF73C737 + $Td1[236] = 0xEA53F7CD + $Td1[237] = 0x5B5FFDAA + $Td1[238] = 0x14DF3D6F + $Td1[239] = 0x867844DB + $Td1[240] = 0x81CAAFF3 + $Td1[241] = 0x3EB968C4 + $Td1[242] = 0x2C382434 + $Td1[243] = 0x5FC2A340 + $Td1[244] = 0x72161DC3 + $Td1[245] = 0x0CBCE225 + $Td1[246] = 0x8B283C49 + $Td1[247] = 0x41FF0D95 + $Td1[248] = 0x7139A801 + $Td1[249] = 0xDE080CB3 + $Td1[250] = 0x9CD8B4E4 + $Td1[251] = 0x906456C1 + $Td1[252] = 0x617BCB84 + $Td1[253] = 0x70D532B6 + $Td1[254] = 0x74486C5C + $Td1[255] = 0x42D0B857 + Local $Td2[256] + $Td2[0] = 0xA75051F4 + $Td2[1] = 0x65537E41 + $Td2[2] = 0xA4C31A17 + $Td2[3] = 0x5E963A27 + $Td2[4] = 0x6BCB3BAB + $Td2[5] = 0x45F11F9D + $Td2[6] = 0x58ABACFA + $Td2[7] = 0x03934BE3 + $Td2[8] = 0xFA552030 + $Td2[9] = 0x6DF6AD76 + $Td2[10] = 0x769188CC + $Td2[11] = 0x4C25F502 + $Td2[12] = 0xD7FC4FE5 + $Td2[13] = 0xCBD7C52A + $Td2[14] = 0x44802635 + $Td2[15] = 0xA38FB562 + $Td2[16] = 0x5A49DEB1 + $Td2[17] = 0x1B6725BA + $Td2[18] = 0x0E9845EA + $Td2[19] = 0xC0E15DFE + $Td2[20] = 0x7502C32F + $Td2[21] = 0xF012814C + $Td2[22] = 0x97A38D46 + $Td2[23] = 0xF9C66BD3 + $Td2[24] = 0x5FE7038F + $Td2[25] = 0x9C951592 + $Td2[26] = 0x7AEBBF6D + $Td2[27] = 0x59DA9552 + $Td2[28] = 0x832DD4BE + $Td2[29] = 0x21D35874 + $Td2[30] = 0x692949E0 + $Td2[31] = 0xC8448EC9 + $Td2[32] = 0x896A75C2 + $Td2[33] = 0x7978F48E + $Td2[34] = 0x3E6B9958 + $Td2[35] = 0x71DD27B9 + $Td2[36] = 0x4FB6BEE1 + $Td2[37] = 0xAD17F088 + $Td2[38] = 0xAC66C920 + $Td2[39] = 0x3AB47DCE + $Td2[40] = 0x4A1863DF + $Td2[41] = 0x3182E51A + $Td2[42] = 0x33609751 + $Td2[43] = 0x7F456253 + $Td2[44] = 0x77E0B164 + $Td2[45] = 0xAE84BB6B + $Td2[46] = 0xA01CFE81 + $Td2[47] = 0x2B94F908 + $Td2[48] = 0x68587048 + $Td2[49] = 0xFD198F45 + $Td2[50] = 0x6C8794DE + $Td2[51] = 0xF8B7527B + $Td2[52] = 0xD323AB73 + $Td2[53] = 0x02E2724B + $Td2[54] = 0x8F57E31F + $Td2[55] = 0xAB2A6655 + $Td2[56] = 0x2807B2EB + $Td2[57] = 0xC2032FB5 + $Td2[58] = 0x7B9A86C5 + $Td2[59] = 0x08A5D337 + $Td2[60] = 0x87F23028 + $Td2[61] = 0xA5B223BF + $Td2[62] = 0x6ABA0203 + $Td2[63] = 0x825CED16 + $Td2[64] = 0x1C2B8ACF + $Td2[65] = 0xB492A779 + $Td2[66] = 0xF2F0F307 + $Td2[67] = 0xE2A14E69 + $Td2[68] = 0xF4CD65DA + $Td2[69] = 0xBED50605 + $Td2[70] = 0x621FD134 + $Td2[71] = 0xFE8AC4A6 + $Td2[72] = 0x539D342E + $Td2[73] = 0x55A0A2F3 + $Td2[74] = 0xE132058A + $Td2[75] = 0xEB75A4F6 + $Td2[76] = 0xEC390B83 + $Td2[77] = 0xEFAA4060 + $Td2[78] = 0x9F065E71 + $Td2[79] = 0x1051BD6E + $Td2[80] = 0x8AF93E21 + $Td2[81] = 0x063D96DD + $Td2[82] = 0x05AEDD3E + $Td2[83] = 0xBD464DE6 + $Td2[84] = 0x8DB59154 + $Td2[85] = 0x5D0571C4 + $Td2[86] = 0xD46F0406 + $Td2[87] = 0x15FF6050 + $Td2[88] = 0xFB241998 + $Td2[89] = 0xE997D6BD + $Td2[90] = 0x43CC8940 + $Td2[91] = 0x9E7767D9 + $Td2[92] = 0x42BDB0E8 + $Td2[93] = 0x8B880789 + $Td2[94] = 0x5B38E719 + $Td2[95] = 0xEEDB79C8 + $Td2[96] = 0x0A47A17C + $Td2[97] = 0x0FE97C42 + $Td2[98] = 0x1EC9F884 + $Td2[99] = 0x00000000 + $Td2[100] = 0x86830980 + $Td2[101] = 0xED48322B + $Td2[102] = 0x70AC1E11 + $Td2[103] = 0x724E6C5A + $Td2[104] = 0xFFFBFD0E + $Td2[105] = 0x38560F85 + $Td2[106] = 0xD51E3DAE + $Td2[107] = 0x3927362D + $Td2[108] = 0xD9640A0F + $Td2[109] = 0xA621685C + $Td2[110] = 0x54D19B5B + $Td2[111] = 0x2E3A2436 + $Td2[112] = 0x67B10C0A + $Td2[113] = 0xE70F9357 + $Td2[114] = 0x96D2B4EE + $Td2[115] = 0x919E1B9B + $Td2[116] = 0xC54F80C0 + $Td2[117] = 0x20A261DC + $Td2[118] = 0x4B695A77 + $Td2[119] = 0x1A161C12 + $Td2[120] = 0xBA0AE293 + $Td2[121] = 0x2AE5C0A0 + $Td2[122] = 0xE0433C22 + $Td2[123] = 0x171D121B + $Td2[124] = 0x0D0B0E09 + $Td2[125] = 0xC7ADF28B + $Td2[126] = 0xA8B92DB6 + $Td2[127] = 0xA9C8141E + $Td2[128] = 0x198557F1 + $Td2[129] = 0x074CAF75 + $Td2[130] = 0xDDBBEE99 + $Td2[131] = 0x60FDA37F + $Td2[132] = 0x269FF701 + $Td2[133] = 0xF5BC5C72 + $Td2[134] = 0x3BC54466 + $Td2[135] = 0x7E345BFB + $Td2[136] = 0x29768B43 + $Td2[137] = 0xC6DCCB23 + $Td2[138] = 0xFC68B6ED + $Td2[139] = 0xF163B8E4 + $Td2[140] = 0xDCCAD731 + $Td2[141] = 0x85104263 + $Td2[142] = 0x22401397 + $Td2[143] = 0x112084C6 + $Td2[144] = 0x247D854A + $Td2[145] = 0x3DF8D2BB + $Td2[146] = 0x3211AEF9 + $Td2[147] = 0xA16DC729 + $Td2[148] = 0x2F4B1D9E + $Td2[149] = 0x30F3DCB2 + $Td2[150] = 0x52EC0D86 + $Td2[151] = 0xE3D077C1 + $Td2[152] = 0x166C2BB3 + $Td2[153] = 0xB999A970 + $Td2[154] = 0x48FA1194 + $Td2[155] = 0x642247E9 + $Td2[156] = 0x8CC4A8FC + $Td2[157] = 0x3F1AA0F0 + $Td2[158] = 0x2CD8567D + $Td2[159] = 0x90EF2233 + $Td2[160] = 0x4EC78749 + $Td2[161] = 0xD1C1D938 + $Td2[162] = 0xA2FE8CCA + $Td2[163] = 0x0B3698D4 + $Td2[164] = 0x81CFA6F5 + $Td2[165] = 0xDE28A57A + $Td2[166] = 0x8E26DAB7 + $Td2[167] = 0xBFA43FAD + $Td2[168] = 0x9DE42C3A + $Td2[169] = 0x920D5078 + $Td2[170] = 0xCC9B6A5F + $Td2[171] = 0x4662547E + $Td2[172] = 0x13C2F68D + $Td2[173] = 0xB8E890D8 + $Td2[174] = 0xF75E2E39 + $Td2[175] = 0xAFF582C3 + $Td2[176] = 0x80BE9F5D + $Td2[177] = 0x937C69D0 + $Td2[178] = 0x2DA96FD5 + $Td2[179] = 0x12B3CF25 + $Td2[180] = 0x993BC8AC + $Td2[181] = 0x7DA71018 + $Td2[182] = 0x636EE89C + $Td2[183] = 0xBB7BDB3B + $Td2[184] = 0x7809CD26 + $Td2[185] = 0x18F46E59 + $Td2[186] = 0xB701EC9A + $Td2[187] = 0x9AA8834F + $Td2[188] = 0x6E65E695 + $Td2[189] = 0xE67EAAFF + $Td2[190] = 0xCF0821BC + $Td2[191] = 0xE8E6EF15 + $Td2[192] = 0x9BD9BAE7 + $Td2[193] = 0x36CE4A6F + $Td2[194] = 0x09D4EA9F + $Td2[195] = 0x7CD629B0 + $Td2[196] = 0xB2AF31A4 + $Td2[197] = 0x23312A3F + $Td2[198] = 0x9430C6A5 + $Td2[199] = 0x66C035A2 + $Td2[200] = 0xBC37744E + $Td2[201] = 0xCAA6FC82 + $Td2[202] = 0xD0B0E090 + $Td2[203] = 0xD81533A7 + $Td2[204] = 0x984AF104 + $Td2[205] = 0xDAF741EC + $Td2[206] = 0x500E7FCD + $Td2[207] = 0xF62F1791 + $Td2[208] = 0xD68D764D + $Td2[209] = 0xB04D43EF + $Td2[210] = 0x4D54CCAA + $Td2[211] = 0x04DFE496 + $Td2[212] = 0xB5E39ED1 + $Td2[213] = 0x881B4C6A + $Td2[214] = 0x1FB8C12C + $Td2[215] = 0x517F4665 + $Td2[216] = 0xEA049D5E + $Td2[217] = 0x355D018C + $Td2[218] = 0x7473FA87 + $Td2[219] = 0x412EFB0B + $Td2[220] = 0x1D5AB367 + $Td2[221] = 0xD25292DB + $Td2[222] = 0x5633E910 + $Td2[223] = 0x47136DD6 + $Td2[224] = 0x618C9AD7 + $Td2[225] = 0x0C7A37A1 + $Td2[226] = 0x148E59F8 + $Td2[227] = 0x3C89EB13 + $Td2[228] = 0x27EECEA9 + $Td2[229] = 0xC935B761 + $Td2[230] = 0xE5EDE11C + $Td2[231] = 0xB13C7A47 + $Td2[232] = 0xDF599CD2 + $Td2[233] = 0x733F55F2 + $Td2[234] = 0xCE791814 + $Td2[235] = 0x37BF73C7 + $Td2[236] = 0xCDEA53F7 + $Td2[237] = 0xAA5B5FFD + $Td2[238] = 0x6F14DF3D + $Td2[239] = 0xDB867844 + $Td2[240] = 0xF381CAAF + $Td2[241] = 0xC43EB968 + $Td2[242] = 0x342C3824 + $Td2[243] = 0x405FC2A3 + $Td2[244] = 0xC372161D + $Td2[245] = 0x250CBCE2 + $Td2[246] = 0x498B283C + $Td2[247] = 0x9541FF0D + $Td2[248] = 0x017139A8 + $Td2[249] = 0xB3DE080C + $Td2[250] = 0xE49CD8B4 + $Td2[251] = 0xC1906456 + $Td2[252] = 0x84617BCB + $Td2[253] = 0xB670D532 + $Td2[254] = 0x5C74486C + $Td2[255] = 0x5742D0B8 + Local $Td3[256] + $Td3[0] = 0xF4A75051 + $Td3[1] = 0x4165537E + $Td3[2] = 0x17A4C31A + $Td3[3] = 0x275E963A + $Td3[4] = 0xAB6BCB3B + $Td3[5] = 0x9D45F11F + $Td3[6] = 0xFA58ABAC + $Td3[7] = 0xE303934B + $Td3[8] = 0x30FA5520 + $Td3[9] = 0x766DF6AD + $Td3[10] = 0xCC769188 + $Td3[11] = 0x024C25F5 + $Td3[12] = 0xE5D7FC4F + $Td3[13] = 0x2ACBD7C5 + $Td3[14] = 0x35448026 + $Td3[15] = 0x62A38FB5 + $Td3[16] = 0xB15A49DE + $Td3[17] = 0xBA1B6725 + $Td3[18] = 0xEA0E9845 + $Td3[19] = 0xFEC0E15D + $Td3[20] = 0x2F7502C3 + $Td3[21] = 0x4CF01281 + $Td3[22] = 0x4697A38D + $Td3[23] = 0xD3F9C66B + $Td3[24] = 0x8F5FE703 + $Td3[25] = 0x929C9515 + $Td3[26] = 0x6D7AEBBF + $Td3[27] = 0x5259DA95 + $Td3[28] = 0xBE832DD4 + $Td3[29] = 0x7421D358 + $Td3[30] = 0xE0692949 + $Td3[31] = 0xC9C8448E + $Td3[32] = 0xC2896A75 + $Td3[33] = 0x8E7978F4 + $Td3[34] = 0x583E6B99 + $Td3[35] = 0xB971DD27 + $Td3[36] = 0xE14FB6BE + $Td3[37] = 0x88AD17F0 + $Td3[38] = 0x20AC66C9 + $Td3[39] = 0xCE3AB47D + $Td3[40] = 0xDF4A1863 + $Td3[41] = 0x1A3182E5 + $Td3[42] = 0x51336097 + $Td3[43] = 0x537F4562 + $Td3[44] = 0x6477E0B1 + $Td3[45] = 0x6BAE84BB + $Td3[46] = 0x81A01CFE + $Td3[47] = 0x082B94F9 + $Td3[48] = 0x48685870 + $Td3[49] = 0x45FD198F + $Td3[50] = 0xDE6C8794 + $Td3[51] = 0x7BF8B752 + $Td3[52] = 0x73D323AB + $Td3[53] = 0x4B02E272 + $Td3[54] = 0x1F8F57E3 + $Td3[55] = 0x55AB2A66 + $Td3[56] = 0xEB2807B2 + $Td3[57] = 0xB5C2032F + $Td3[58] = 0xC57B9A86 + $Td3[59] = 0x3708A5D3 + $Td3[60] = 0x2887F230 + $Td3[61] = 0xBFA5B223 + $Td3[62] = 0x036ABA02 + $Td3[63] = 0x16825CED + $Td3[64] = 0xCF1C2B8A + $Td3[65] = 0x79B492A7 + $Td3[66] = 0x07F2F0F3 + $Td3[67] = 0x69E2A14E + $Td3[68] = 0xDAF4CD65 + $Td3[69] = 0x05BED506 + $Td3[70] = 0x34621FD1 + $Td3[71] = 0xA6FE8AC4 + $Td3[72] = 0x2E539D34 + $Td3[73] = 0xF355A0A2 + $Td3[74] = 0x8AE13205 + $Td3[75] = 0xF6EB75A4 + $Td3[76] = 0x83EC390B + $Td3[77] = 0x60EFAA40 + $Td3[78] = 0x719F065E + $Td3[79] = 0x6E1051BD + $Td3[80] = 0x218AF93E + $Td3[81] = 0xDD063D96 + $Td3[82] = 0x3E05AEDD + $Td3[83] = 0xE6BD464D + $Td3[84] = 0x548DB591 + $Td3[85] = 0xC45D0571 + $Td3[86] = 0x06D46F04 + $Td3[87] = 0x5015FF60 + $Td3[88] = 0x98FB2419 + $Td3[89] = 0xBDE997D6 + $Td3[90] = 0x4043CC89 + $Td3[91] = 0xD99E7767 + $Td3[92] = 0xE842BDB0 + $Td3[93] = 0x898B8807 + $Td3[94] = 0x195B38E7 + $Td3[95] = 0xC8EEDB79 + $Td3[96] = 0x7C0A47A1 + $Td3[97] = 0x420FE97C + $Td3[98] = 0x841EC9F8 + $Td3[99] = 0x00000000 + $Td3[100] = 0x80868309 + $Td3[101] = 0x2BED4832 + $Td3[102] = 0x1170AC1E + $Td3[103] = 0x5A724E6C + $Td3[104] = 0x0EFFFBFD + $Td3[105] = 0x8538560F + $Td3[106] = 0xAED51E3D + $Td3[107] = 0x2D392736 + $Td3[108] = 0x0FD9640A + $Td3[109] = 0x5CA62168 + $Td3[110] = 0x5B54D19B + $Td3[111] = 0x362E3A24 + $Td3[112] = 0x0A67B10C + $Td3[113] = 0x57E70F93 + $Td3[114] = 0xEE96D2B4 + $Td3[115] = 0x9B919E1B + $Td3[116] = 0xC0C54F80 + $Td3[117] = 0xDC20A261 + $Td3[118] = 0x774B695A + $Td3[119] = 0x121A161C + $Td3[120] = 0x93BA0AE2 + $Td3[121] = 0xA02AE5C0 + $Td3[122] = 0x22E0433C + $Td3[123] = 0x1B171D12 + $Td3[124] = 0x090D0B0E + $Td3[125] = 0x8BC7ADF2 + $Td3[126] = 0xB6A8B92D + $Td3[127] = 0x1EA9C814 + $Td3[128] = 0xF1198557 + $Td3[129] = 0x75074CAF + $Td3[130] = 0x99DDBBEE + $Td3[131] = 0x7F60FDA3 + $Td3[132] = 0x01269FF7 + $Td3[133] = 0x72F5BC5C + $Td3[134] = 0x663BC544 + $Td3[135] = 0xFB7E345B + $Td3[136] = 0x4329768B + $Td3[137] = 0x23C6DCCB + $Td3[138] = 0xEDFC68B6 + $Td3[139] = 0xE4F163B8 + $Td3[140] = 0x31DCCAD7 + $Td3[141] = 0x63851042 + $Td3[142] = 0x97224013 + $Td3[143] = 0xC6112084 + $Td3[144] = 0x4A247D85 + $Td3[145] = 0xBB3DF8D2 + $Td3[146] = 0xF93211AE + $Td3[147] = 0x29A16DC7 + $Td3[148] = 0x9E2F4B1D + $Td3[149] = 0xB230F3DC + $Td3[150] = 0x8652EC0D + $Td3[151] = 0xC1E3D077 + $Td3[152] = 0xB3166C2B + $Td3[153] = 0x70B999A9 + $Td3[154] = 0x9448FA11 + $Td3[155] = 0xE9642247 + $Td3[156] = 0xFC8CC4A8 + $Td3[157] = 0xF03F1AA0 + $Td3[158] = 0x7D2CD856 + $Td3[159] = 0x3390EF22 + $Td3[160] = 0x494EC787 + $Td3[161] = 0x38D1C1D9 + $Td3[162] = 0xCAA2FE8C + $Td3[163] = 0xD40B3698 + $Td3[164] = 0xF581CFA6 + $Td3[165] = 0x7ADE28A5 + $Td3[166] = 0xB78E26DA + $Td3[167] = 0xADBFA43F + $Td3[168] = 0x3A9DE42C + $Td3[169] = 0x78920D50 + $Td3[170] = 0x5FCC9B6A + $Td3[171] = 0x7E466254 + $Td3[172] = 0x8D13C2F6 + $Td3[173] = 0xD8B8E890 + $Td3[174] = 0x39F75E2E + $Td3[175] = 0xC3AFF582 + $Td3[176] = 0x5D80BE9F + $Td3[177] = 0xD0937C69 + $Td3[178] = 0xD52DA96F + $Td3[179] = 0x2512B3CF + $Td3[180] = 0xAC993BC8 + $Td3[181] = 0x187DA710 + $Td3[182] = 0x9C636EE8 + $Td3[183] = 0x3BBB7BDB + $Td3[184] = 0x267809CD + $Td3[185] = 0x5918F46E + $Td3[186] = 0x9AB701EC + $Td3[187] = 0x4F9AA883 + $Td3[188] = 0x956E65E6 + $Td3[189] = 0xFFE67EAA + $Td3[190] = 0xBCCF0821 + $Td3[191] = 0x15E8E6EF + $Td3[192] = 0xE79BD9BA + $Td3[193] = 0x6F36CE4A + $Td3[194] = 0x9F09D4EA + $Td3[195] = 0xB07CD629 + $Td3[196] = 0xA4B2AF31 + $Td3[197] = 0x3F23312A + $Td3[198] = 0xA59430C6 + $Td3[199] = 0xA266C035 + $Td3[200] = 0x4EBC3774 + $Td3[201] = 0x82CAA6FC + $Td3[202] = 0x90D0B0E0 + $Td3[203] = 0xA7D81533 + $Td3[204] = 0x04984AF1 + $Td3[205] = 0xECDAF741 + $Td3[206] = 0xCD500E7F + $Td3[207] = 0x91F62F17 + $Td3[208] = 0x4DD68D76 + $Td3[209] = 0xEFB04D43 + $Td3[210] = 0xAA4D54CC + $Td3[211] = 0x9604DFE4 + $Td3[212] = 0xD1B5E39E + $Td3[213] = 0x6A881B4C + $Td3[214] = 0x2C1FB8C1 + $Td3[215] = 0x65517F46 + $Td3[216] = 0x5EEA049D + $Td3[217] = 0x8C355D01 + $Td3[218] = 0x877473FA + $Td3[219] = 0x0B412EFB + $Td3[220] = 0x671D5AB3 + $Td3[221] = 0xDBD25292 + $Td3[222] = 0x105633E9 + $Td3[223] = 0xD647136D + $Td3[224] = 0xD7618C9A + $Td3[225] = 0xA10C7A37 + $Td3[226] = 0xF8148E59 + $Td3[227] = 0x133C89EB + $Td3[228] = 0xA927EECE + $Td3[229] = 0x61C935B7 + $Td3[230] = 0x1CE5EDE1 + $Td3[231] = 0x47B13C7A + $Td3[232] = 0xD2DF599C + $Td3[233] = 0xF2733F55 + $Td3[234] = 0x14CE7918 + $Td3[235] = 0xC737BF73 + $Td3[236] = 0xF7CDEA53 + $Td3[237] = 0xFDAA5B5F + $Td3[238] = 0x3D6F14DF + $Td3[239] = 0x44DB8678 + $Td3[240] = 0xAFF381CA + $Td3[241] = 0x68C43EB9 + $Td3[242] = 0x24342C38 + $Td3[243] = 0xA3405FC2 + $Td3[244] = 0x1DC37216 + $Td3[245] = 0xE2250CBC + $Td3[246] = 0x3C498B28 + $Td3[247] = 0x0D9541FF + $Td3[248] = 0xA8017139 + $Td3[249] = 0x0CB3DE08 + $Td3[250] = 0xB4E49CD8 + $Td3[251] = 0x56C19064 + $Td3[252] = 0xCB84617B + $Td3[253] = 0x32B670D5 + $Td3[254] = 0x6C5C7448 + $Td3[255] = 0xB85742D0 + Local $Td4[256] + $Td4[0] = 0x52525252 + $Td4[1] = 0x09090909 + $Td4[2] = 0x6A6A6A6A + $Td4[3] = 0xD5D5D5D5 + $Td4[4] = 0x30303030 + $Td4[5] = 0x36363636 + $Td4[6] = 0xA5A5A5A5 + $Td4[7] = 0x38383838 + $Td4[8] = 0xBFBFBFBF + $Td4[9] = 0x40404040 + $Td4[10] = 0xA3A3A3A3 + $Td4[11] = 0x9E9E9E9E + $Td4[12] = 0x81818181 + $Td4[13] = 0xF3F3F3F3 + $Td4[14] = 0xD7D7D7D7 + $Td4[15] = 0xFBFBFBFB + $Td4[16] = 0x7C7C7C7C + $Td4[17] = 0xE3E3E3E3 + $Td4[18] = 0x39393939 + $Td4[19] = 0x82828282 + $Td4[20] = 0x9B9B9B9B + $Td4[21] = 0x2F2F2F2F + $Td4[22] = 0xFFFFFFFF + $Td4[23] = 0x87878787 + $Td4[24] = 0x34343434 + $Td4[25] = 0x8E8E8E8E + $Td4[26] = 0x43434343 + $Td4[27] = 0x44444444 + $Td4[28] = 0xC4C4C4C4 + $Td4[29] = 0xDEDEDEDE + $Td4[30] = 0xE9E9E9E9 + $Td4[31] = 0xCBCBCBCB + $Td4[32] = 0x54545454 + $Td4[33] = 0x7B7B7B7B + $Td4[34] = 0x94949494 + $Td4[35] = 0x32323232 + $Td4[36] = 0xA6A6A6A6 + $Td4[37] = 0xC2C2C2C2 + $Td4[38] = 0x23232323 + $Td4[39] = 0x3D3D3D3D + $Td4[40] = 0xEEEEEEEE + $Td4[41] = 0x4C4C4C4C + $Td4[42] = 0x95959595 + $Td4[43] = 0x0B0B0B0B + $Td4[44] = 0x42424242 + $Td4[45] = 0xFAFAFAFA + $Td4[46] = 0xC3C3C3C3 + $Td4[47] = 0x4E4E4E4E + $Td4[48] = 0x08080808 + $Td4[49] = 0x2E2E2E2E + $Td4[50] = 0xA1A1A1A1 + $Td4[51] = 0x66666666 + $Td4[52] = 0x28282828 + $Td4[53] = 0xD9D9D9D9 + $Td4[54] = 0x24242424 + $Td4[55] = 0xB2B2B2B2 + $Td4[56] = 0x76767676 + $Td4[57] = 0x5B5B5B5B + $Td4[58] = 0xA2A2A2A2 + $Td4[59] = 0x49494949 + $Td4[60] = 0x6D6D6D6D + $Td4[61] = 0x8B8B8B8B + $Td4[62] = 0xD1D1D1D1 + $Td4[63] = 0x25252525 + $Td4[64] = 0x72727272 + $Td4[65] = 0xF8F8F8F8 + $Td4[66] = 0xF6F6F6F6 + $Td4[67] = 0x64646464 + $Td4[68] = 0x86868686 + $Td4[69] = 0x68686868 + $Td4[70] = 0x98989898 + $Td4[71] = 0x16161616 + $Td4[72] = 0xD4D4D4D4 + $Td4[73] = 0xA4A4A4A4 + $Td4[74] = 0x5C5C5C5C + $Td4[75] = 0xCCCCCCCC + $Td4[76] = 0x5D5D5D5D + $Td4[77] = 0x65656565 + $Td4[78] = 0xB6B6B6B6 + $Td4[79] = 0x92929292 + $Td4[80] = 0x6C6C6C6C + $Td4[81] = 0x70707070 + $Td4[82] = 0x48484848 + $Td4[83] = 0x50505050 + $Td4[84] = 0xFDFDFDFD + $Td4[85] = 0xEDEDEDED + $Td4[86] = 0xB9B9B9B9 + $Td4[87] = 0xDADADADA + $Td4[88] = 0x5E5E5E5E + $Td4[89] = 0x15151515 + $Td4[90] = 0x46464646 + $Td4[91] = 0x57575757 + $Td4[92] = 0xA7A7A7A7 + $Td4[93] = 0x8D8D8D8D + $Td4[94] = 0x9D9D9D9D + $Td4[95] = 0x84848484 + $Td4[96] = 0x90909090 + $Td4[97] = 0xD8D8D8D8 + $Td4[98] = 0xABABABAB + $Td4[99] = 0x00000000 + $Td4[100] = 0x8C8C8C8C + $Td4[101] = 0xBCBCBCBC + $Td4[102] = 0xD3D3D3D3 + $Td4[103] = 0x0A0A0A0A + $Td4[104] = 0xF7F7F7F7 + $Td4[105] = 0xE4E4E4E4 + $Td4[106] = 0x58585858 + $Td4[107] = 0x05050505 + $Td4[108] = 0xB8B8B8B8 + $Td4[109] = 0xB3B3B3B3 + $Td4[110] = 0x45454545 + $Td4[111] = 0x06060606 + $Td4[112] = 0xD0D0D0D0 + $Td4[113] = 0x2C2C2C2C + $Td4[114] = 0x1E1E1E1E + $Td4[115] = 0x8F8F8F8F + $Td4[116] = 0xCACACACA + $Td4[117] = 0x3F3F3F3F + $Td4[118] = 0x0F0F0F0F + $Td4[119] = 0x02020202 + $Td4[120] = 0xC1C1C1C1 + $Td4[121] = 0xAFAFAFAF + $Td4[122] = 0xBDBDBDBD + $Td4[123] = 0x03030303 + $Td4[124] = 0x01010101 + $Td4[125] = 0x13131313 + $Td4[126] = 0x8A8A8A8A + $Td4[127] = 0x6B6B6B6B + $Td4[128] = 0x3A3A3A3A + $Td4[129] = 0x91919191 + $Td4[130] = 0x11111111 + $Td4[131] = 0x41414141 + $Td4[132] = 0x4F4F4F4F + $Td4[133] = 0x67676767 + $Td4[134] = 0xDCDCDCDC + $Td4[135] = 0xEAEAEAEA + $Td4[136] = 0x97979797 + $Td4[137] = 0xF2F2F2F2 + $Td4[138] = 0xCFCFCFCF + $Td4[139] = 0xCECECECE + $Td4[140] = 0xF0F0F0F0 + $Td4[141] = 0xB4B4B4B4 + $Td4[142] = 0xE6E6E6E6 + $Td4[143] = 0x73737373 + $Td4[144] = 0x96969696 + $Td4[145] = 0xACACACAC + $Td4[146] = 0x74747474 + $Td4[147] = 0x22222222 + $Td4[148] = 0xE7E7E7E7 + $Td4[149] = 0xADADADAD + $Td4[150] = 0x35353535 + $Td4[151] = 0x85858585 + $Td4[152] = 0xE2E2E2E2 + $Td4[153] = 0xF9F9F9F9 + $Td4[154] = 0x37373737 + $Td4[155] = 0xE8E8E8E8 + $Td4[156] = 0x1C1C1C1C + $Td4[157] = 0x75757575 + $Td4[158] = 0xDFDFDFDF + $Td4[159] = 0x6E6E6E6E + $Td4[160] = 0x47474747 + $Td4[161] = 0xF1F1F1F1 + $Td4[162] = 0x1A1A1A1A + $Td4[163] = 0x71717171 + $Td4[164] = 0x1D1D1D1D + $Td4[165] = 0x29292929 + $Td4[166] = 0xC5C5C5C5 + $Td4[167] = 0x89898989 + $Td4[168] = 0x6F6F6F6F + $Td4[169] = 0xB7B7B7B7 + $Td4[170] = 0x62626262 + $Td4[171] = 0x0E0E0E0E + $Td4[172] = 0xAAAAAAAA + $Td4[173] = 0x18181818 + $Td4[174] = 0xBEBEBEBE + $Td4[175] = 0x1B1B1B1B + $Td4[176] = 0xFCFCFCFC + $Td4[177] = 0x56565656 + $Td4[178] = 0x3E3E3E3E + $Td4[179] = 0x4B4B4B4B + $Td4[180] = 0xC6C6C6C6 + $Td4[181] = 0xD2D2D2D2 + $Td4[182] = 0x79797979 + $Td4[183] = 0x20202020 + $Td4[184] = 0x9A9A9A9A + $Td4[185] = 0xDBDBDBDB + $Td4[186] = 0xC0C0C0C0 + $Td4[187] = 0xFEFEFEFE + $Td4[188] = 0x78787878 + $Td4[189] = 0xCDCDCDCD + $Td4[190] = 0x5A5A5A5A + $Td4[191] = 0xF4F4F4F4 + $Td4[192] = 0x1F1F1F1F + $Td4[193] = 0xDDDDDDDD + $Td4[194] = 0xA8A8A8A8 + $Td4[195] = 0x33333333 + $Td4[196] = 0x88888888 + $Td4[197] = 0x07070707 + $Td4[198] = 0xC7C7C7C7 + $Td4[199] = 0x31313131 + $Td4[200] = 0xB1B1B1B1 + $Td4[201] = 0x12121212 + $Td4[202] = 0x10101010 + $Td4[203] = 0x59595959 + $Td4[204] = 0x27272727 + $Td4[205] = 0x80808080 + $Td4[206] = 0xECECECEC + $Td4[207] = 0x5F5F5F5F + $Td4[208] = 0x60606060 + $Td4[209] = 0x51515151 + $Td4[210] = 0x7F7F7F7F + $Td4[211] = 0xA9A9A9A9 + $Td4[212] = 0x19191919 + $Td4[213] = 0xB5B5B5B5 + $Td4[214] = 0x4A4A4A4A + $Td4[215] = 0x0D0D0D0D + $Td4[216] = 0x2D2D2D2D + $Td4[217] = 0xE5E5E5E5 + $Td4[218] = 0x7A7A7A7A + $Td4[219] = 0x9F9F9F9F + $Td4[220] = 0x93939393 + $Td4[221] = 0xC9C9C9C9 + $Td4[222] = 0x9C9C9C9C + $Td4[223] = 0xEFEFEFEF + $Td4[224] = 0xA0A0A0A0 + $Td4[225] = 0xE0E0E0E0 + $Td4[226] = 0x3B3B3B3B + $Td4[227] = 0x4D4D4D4D + $Td4[228] = 0xAEAEAEAE + $Td4[229] = 0x2A2A2A2A + $Td4[230] = 0xF5F5F5F5 + $Td4[231] = 0xB0B0B0B0 + $Td4[232] = 0xC8C8C8C8 + $Td4[233] = 0xEBEBEBEB + $Td4[234] = 0xBBBBBBBB + $Td4[235] = 0x3C3C3C3C + $Td4[236] = 0x83838383 + $Td4[237] = 0x53535353 + $Td4[238] = 0x99999999 + $Td4[239] = 0x61616161 + $Td4[240] = 0x17171717 + $Td4[241] = 0x2B2B2B2B + $Td4[242] = 0x04040404 + $Td4[243] = 0x7E7E7E7E + $Td4[244] = 0xBABABABA + $Td4[245] = 0x77777777 + $Td4[246] = 0xD6D6D6D6 + $Td4[247] = 0x26262626 + $Td4[248] = 0xE1E1E1E1 + $Td4[249] = 0x69696969 + $Td4[250] = 0x14141414 + $Td4[251] = 0x63636363 + $Td4[252] = 0x55555555 + $Td4[253] = 0x21212121 + $Td4[254] = 0x0C0C0C0C + $Td4[255] = 0x7D7D7D7D + Local $t[$Nb] + Local $keypos = 0 + If $Nb < 8 Then + Local $C[4] = [0, 1, 2, 3] + Else + Local $C[4] = [0, 1, 3, 4] + EndIf + + ; Initial Round Key & read in Nb words into the state + For $i = 0 To $Nb - 1 + $s[$i] = BitXOR($s[$i],$w[$keypos]) + $keypos += 1 + Next + + For $i = $Nr - 1 To 1 Step -1 + $t = $s + + For $j = 0 To $Nb - 1 + $s[$j] = BitXOR($Td0[BitAND(BitShift($t[Mod($j+($Nb-$C[0]),$Nb)],24),0xFF)],$Td1[BitAND(BitShift($t[Mod($j+($Nb-$C[1]),$Nb)],16),0xFF)],$Td2[BitAND(BitShift($t[Mod($j+($Nb-$C[2]),$Nb)],8),0xFF)],$Td3[BitAND($t[Mod($j+($Nb-$C[3]),$Nb)],0xFF)],$w[$keypos]) + $keypos += 1 + Next + Next + $t = $s + + For $j = 0 To $Nb - 1 + $s[$j] = BitXOR(BitAND($Td4[BitAND(BitShift($t[Mod($j+($Nb-$C[0]),$Nb)],24),0xFF)],0xFF000000),BitAND($Td4[BitAND(BitShift($t[Mod($j+($Nb-$C[1]),$Nb)],16),0xFF)],0xFF0000),BitAND($Td4[BitAND(BitShift($t[Mod($j+($Nb-$C[2]),$Nb)],8),0xFF)],0xFF00),BitAND($Td4[BitAND($t[Mod($j+($Nb-$C[3]),$Nb)],0xFF)],0xFF),$w[$keypos]) + $keypos += 1 + Next + + Return $s +EndFunc + +Func _Max($nNum1, $nNum2) ; From Math.au3 + ; Check to see if the parameters are indeed numbers of some sort. + If (Not IsNumber($nNum1)) Then + SetError(1) + Return (0) + EndIf + If (Not IsNumber($nNum2)) Then + SetError(2) + Return (0) + EndIf + + If $nNum1 > $nNum2 Then + Return $nNum1 + Else + Return $nNum2 + EndIf +EndFunc ;==>_Max` + +Func _Dec($binary) + Return Dec(StringTrimLeft($binary,2)) +EndFunc + +Func _Bin($decimal) + Return Binary('0x' & Hex($decimal)) +EndFunc + +Func _Bin2($decimal) + Local $len = 8 + If $decimal < 256^3 Then + $len = 6 + EndIf + If $decimal < 256^2 Then + $len = 4 + EndIf + If $decimal < 256 Then + $len = 2 + EndIf + If $decimal = 0 Then Return '' + Return Binary('0x' & Hex($decimal,$len)) +EndFunc diff --git a/Installer/vi_files/UpdateManufactures.au3 b/Installer/vi_files/UpdateManufactures.au3 new file mode 100644 index 00000000..8eac7dd3 --- /dev/null +++ b/Installer/vi_files/UpdateManufactures.au3 @@ -0,0 +1,62 @@ +#RequireAdmin +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Icon=Icons\icon.ico +#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator +#AutoIt3Wrapper_Run_Tidy=y +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** +;License Information------------------------------------ +;Copyright (C) 2019 Andrew Calcutt +;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; Version 2 of the License. +;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +;You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +;-------------------------------------------------------- +;AutoIt Version: v3.3.15.1 +$Script_Author = 'Andrew Calcutt' +$Script_Name = 'Update Manufactures' +$Script_Website = 'http://www.Vistumbler.net' +$Script_Function = 'Creates Manufacturer.mdb using macmanuf.exe' +$version = 'v4' +$date = '2018/09/07' +;-------------------------------------------------------- +#include +#include "UDFs\FileInUse.au3" + +Dim $TmpDir = @TempDir & '\Vistumbler\UpdateManufactures\' +DirRemove($TmpDir, 1) +DirCreate($TmpDir) + +Dim $ManufMacEXE = $TmpDir & "\macmanuf.exe" ;script to create Manufactures.mdb based on ieee.org oui.txt +Dim $Temp_ManuDB = $TmpDir & "Manufacturers.mdb" ;Vistumbler Manufacturer mdb file (generated by manufmac.exe) +Dim $ManuDB = @ScriptDir & "\Settings\" & "Manufacturers.mdb" ;Destination Manufacturer mdb file (Vistumbler Settings Directory) + +;manufacturer script to temp dir +FileInstall("macmanuf.exe", $TmpDir, 1) + +;Run script to get manuactures +RunWait($ManufMacEXE, $TmpDir) + +;Read Geneated Manufactures.mdb from macmanuf.exe +If FileExists($Temp_ManuDB) Then + $mdboverwrite = MsgBox(4, "Done", "A new Manufactures.mdb has been created. Would you like to overwrite the old vistumbler Manufactures.mdb?") + If $mdboverwrite = 6 Then + While 1 + If _FileInUse($ManuDB) = 1 Then + $updatemsg = MsgBox(1, 'Error', 'The vistumbler Manufacturers.mdb seems to be in use. Verify that vistumbler is closed and click "OK" to continue') + If $updatemsg = 2 Then ExitLoop + EndIf + $fms = FileMove($Temp_ManuDB, $ManuDB, 1) + If $fms = 1 Then + RunWait(@ComSpec & ' /c ' & 'icacls.exe "' & $ManuDB & '" /inheritance:e', @SystemDir, @SW_HIDE) + $updatemsg = MsgBox(4, "Done", "Done. Would you like to load vistumbler?") + If $updatemsg = 6 Then Run(@ScriptDir & '\Vistumbler.exe') + ExitLoop + Else + $updatemsg = MsgBox(4, "Error", "An error occured copying Manufacturers.mdb. Would you like to try again?") + If $updatemsg = 7 Then ExitLoop + EndIf + WEnd + EndIf +EndIf + +;Cleanup Files +DirRemove($TmpDir, 1) diff --git a/Installer/vi_files/UpdateManufactures.exe b/Installer/vi_files/UpdateManufactures.exe new file mode 100644 index 00000000..433a7583 Binary files /dev/null and b/Installer/vi_files/UpdateManufactures.exe differ diff --git a/Installer/vi_files/Vistumbler.au3 b/Installer/vi_files/Vistumbler.au3 new file mode 100644 index 00000000..871e2926 --- /dev/null +++ b/Installer/vi_files/Vistumbler.au3 @@ -0,0 +1,13410 @@ +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Icon=Icons\icon.ico +#AutoIt3Wrapper_Outfile=Vistumbler.exe +#AutoIt3Wrapper_Res_Fileversion=10.6.5.4 +#AutoIt3Wrapper_Res_ProductName=Vistumbler +#AutoIt3Wrapper_Res_CompanyName=Vistumbler.net +#AutoIt3Wrapper_Res_Language=1033 +#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker +#AutoIt3Wrapper_Run_Tidy=y +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** +;License Information------------------------------------ +;Copyright (C) 2019 Andrew Calcutt +;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; Version 2 of the License. +;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +;You should have received a copy of the GNU General Public License along with this program; If not, see . +;-------------------------------------------------------- +;AutoIt Version: v3.3.15.1 +$Script_Author = 'Andrew Calcutt' +$Script_Name = 'Vistumbler' +$Script_Website = 'http://www.Vistumbler.net' +$Script_Function = 'A wireless network scanner for Windows 10, Windows 8, Windows 7, and Vista.' +$version = 'v10.6.5' +$Script_Start_Date = '2007/07/10' +$last_modified = '2019/06/28' +HttpSetUserAgent($Script_Name & ' ' & $version) +;Includes------------------------------------------------ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "UDFs\AccessCom.au3" +#include "UDFs\CommMG.au3" +#include "UDFs\cfxUDF.au3" +#include "UDFs\HTTP.au3" +#include "UDFs\JSON.au3" +#include "UDFs\MD5.au3" +#include "UDFs\NativeWifi.au3" +#include "UDFs\ParseCSV.au3" +#include "UDFs\ZIP.au3" +#include "UDFs\FileInUse.au3" +#include "UDFs\UnixTime.au3" +#include "UDFs\CompareFileTimeEx.au3" +;Set setting folder-------------------------------------- +Dim $Default_TmpDir = @ScriptDir & '\temp\' +Dim $Default_SaveDir = @ScriptDir & '\Save\' +Dim $Default_SettingsDir = @ScriptDir & '\Settings\' +Dim $Default_settings = $Default_SettingsDir & 'vistumbler_settings.ini' +Dim $Default_ManuDB = $Default_SettingsDir & 'Manufacturers.mdb' +Dim $Default_LabDB = $Default_SettingsDir & 'Labels.mdb' +Dim $Default_CamDB = $Default_SettingsDir & 'Cameras.mdb' +Dim $Default_InstDB = $Default_SettingsDir & 'Instruments.mdb' +Dim $Default_FiltDB = $Default_SettingsDir & 'Filters.mdb' +Dim $PortableMode = IniRead($Default_settings, 'Vistumbler', 'PortableMode', 0) +If $PortableMode = 1 Then + $TmpDir = $Default_TmpDir + $DefaultSaveDir = $Default_SaveDir + $SettingsDir = $Default_SettingsDir + $settings = $Default_settings + $ManuDB = $Default_ManuDB + $LabDB = $Default_LabDB + $CamDB = $Default_CamDB + $InstDB = $Default_InstDB + $FiltDB = $Default_FiltDB + + DirCreate($TmpDir) + DirCreate($DefaultSaveDir) + DirCreate($SettingsDir) +Else + $TmpDir = @TempDir & '\Vistumbler\' + $DefaultSaveDir = @MyDocumentsDir & '\Vistumbler\' + $SettingsDir = @AppDataDir & '\Vistumbler\' + $settings = $SettingsDir & 'vistumbler_settings.ini' + $ManuDB = $SettingsDir & 'Manufacturers.mdb' + $LabDB = $SettingsDir & 'Labels.mdb' + $CamDB = $SettingsDir & 'Cameras.mdb' + $InstDB = $SettingsDir & 'Instruments.mdb' + $FiltDB = $SettingsDir & 'Filters.mdb' + + DirCreate($TmpDir) + DirCreate($DefaultSaveDir) + DirCreate($SettingsDir) + + If FileExists($Default_settings) Then + If FileExists($settings) = 0 Or _CompareFileTimeEx($Default_settings, $settings, 0) = 1 Then FileCopy($Default_settings, $settings, 1) + EndIf + + If FileExists($Default_ManuDB) Then + If FileExists($ManuDB) = 0 Or _CompareFileTimeEx($Default_ManuDB, $ManuDB, 0) = 1 Then FileCopy($Default_ManuDB, $ManuDB, 1) + EndIf + + If FileExists($Default_LabDB) Then + If FileExists($LabDB) = 0 Or _CompareFileTimeEx($Default_LabDB, $LabDB, 0) = 1 Then FileCopy($Default_LabDB, $LabDB, 1) + EndIf + + If FileExists($Default_CamDB) Then + If FileExists($CamDB) = 0 Or _CompareFileTimeEx($Default_CamDB, $CamDB, 0) = 1 Then FileCopy($Default_CamDB, $CamDB, 1) + EndIf + + If FileExists($Default_InstDB) Then + If FileExists($InstDB) = 0 Or _CompareFileTimeEx($Default_InstDB, $InstDB, 0) = 1 Then FileCopy($Default_InstDB, $InstDB, 1) + EndIf + + If FileExists($Default_FiltDB) Then + If FileExists($FiltDB) = 0 Or _CompareFileTimeEx($Default_FiltDB, $FiltDB, 0) = 1 Then FileCopy($Default_FiltDB, $FiltDB, 1) + EndIf + +EndIf + +;Set directories +Dim $LanguageDir = @ScriptDir & '\Languages\' +Dim $SoundDir = @ScriptDir & '\Sounds\' +Dim $ImageDir = @ScriptDir & '\Images\' +Dim $IconDir = @ScriptDir & '\Icons\' +DirCreate($LanguageDir) +DirCreate($SoundDir) +DirCreate($ImageDir) +DirCreate($IconDir) +;Write Name And Version to settings file +IniWrite($settings, "Vistumbler", "Name", $Script_Name) +IniWrite($settings, "Vistumbler", "Version", $version) +;Cleanup Old Temp Files---------------------------------- +_CleanupFiles($TmpDir, '*.tmp') +_CleanupFiles($TmpDir, '*.ldb') +_CleanupFiles($TmpDir, '*.ini') +_CleanupFiles($TmpDir, '*.kml') +;Associate VS1 with Vistumbler +If $PortableMode = 0 Then + If StringLower(StringTrimLeft(@ScriptName, StringLen(@ScriptName) - 4)) = '.exe' Then + RegWrite('HKCR\.vsz\', '', 'REG_SZ', 'Vistumbler') + RegWrite('HKCR\.vs1\', '', 'REG_SZ', 'Vistumbler') + RegWrite('HKCR\Vistumbler\shell\open\command\', '', 'REG_SZ', '"' & @ScriptFullPath & '" "%1"') + RegWrite('HKCR\Vistumbler\DefaultIcon\', '', 'REG_SZ', '"' & @ScriptDir & '\Icons\vsfile_icon.ico"') + EndIf +EndIf +;Set Hotkeys +$hkArray = IniReadSection($settings, "Hotkeys") +If Not @error Then + For $hk = 1 To $hkArray[0][0] + ConsoleWrite("Hotkey:" & $hkArray[$hk][0] & " Function:" & $hkArray[$hk][1] & @CRLF) + HotKeySet($hkArray[$hk][0], $hkArray[$hk][1]) + Next +EndIf + +;Set vistumbler to load VS1/VSZ if one is specified by command line +Dim $Load = '' +For $loop = 1 To $CmdLine[0] + If StringLower(StringTrimLeft($CmdLine[$loop], StringLen($CmdLine[$loop]) - 4)) = '.vs1' Then $Load = $CmdLine[$loop] + If StringLower(StringTrimLeft($CmdLine[$loop], StringLen($CmdLine[$loop]) - 4)) = '.vsz' Then $Load = $CmdLine[$loop] +Next +; Set a COM Error handler-------------------------------- +$oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") +;Set Wifi Scan Type +Dim $UseNativeWifi = IniRead($settings, 'Vistumbler', 'UseNativeWifi', 1) +If @OSVersion = "WIN_XP" Then $UseNativeWifi = 1 +; ------------------------------------------------------- +GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") +;Options------------------------------------------------- +Opt("TrayIconHide", 1) ;Hide icon in system tray +Opt("GUIOnEventMode", 1) ;Change to OnEvent mode +Opt("GUIResizeMode", 802) +;Get Date/Time------------------------------------------- +$dt = StringSplit(_DateTimeUtcConvert(StringFormat("%04i", @YEAR) & '-' & StringFormat("%02i", @MON) & '-' & StringFormat("%02i", @MDAY), @HOUR & ':' & @MIN & ':' & @SEC & '.' & StringFormat("%03i", @MSEC), 1), ' ') +$datestamp = $dt[1] +$timestamp = $dt[2] +$ldatetimestamp = StringFormat("%04i", @YEAR) & '-' & StringFormat("%02i", @MON) & '-' & StringFormat("%02i", @MDAY) & ' ' & @HOUR & '-' & @MIN & '-' & @SEC +Dim $DateFormat = StringReplace(StringReplace(IniRead($settings, 'DateFormat', 'DateFormat', RegRead('HKCU\Control Panel\International\', 'sShortDate')), 'MM', 'M'), 'dd', 'd') +;Declair-Variables--------------------------------------- +Global $gdi_dll, $user32_dll +Global $hDC +Global Enum $idCopy = 1000, $idNewManu, $idNewLabel, $idGNInfo, $idGraph, $idFindAP + +Dim $NsOk +Dim $StartArraySize +Dim $Debug +Dim $debugdisplay +Dim $sErr + +Dim $VistumblerDB +Dim $VistumblerDbName +Dim $ManuDB = $SettingsDir & 'Manufacturers.mdb' +Dim $LabDB = $SettingsDir & 'Labels.mdb' +Dim $CamDB = $SettingsDir & 'Cameras.mdb' +Dim $InstDB = $SettingsDir & 'Instruments.mdb' +Dim $FiltDB = $SettingsDir & 'Filters.mdb' + +Dim $DB_OBJ +Dim $ManuDB_OBJ +Dim $LabDB_OBJ +Dim $CamDB_OBJ +Dim $InstDB_OBJ +Dim $FiltDB_OBJ +Dim $AddApRecordArray[24] +Dim $AddLabelRecordArray[3] +Dim $AddManuRecordArray[3] +Dim $AddTreeRecordArray[17] +Dim $APID = 0 +Dim $HISTID = 0 +Dim $GPS_ID = 0 +Dim $CamID = 0 +Dim $CamGroupID = 0 +Dim $Recover = 0 +Dim $VistumblerGuiOpen = 0 + +Dim $MoveMode = False +Dim $MoveArea = False +Dim $DataChild_Width +Dim $DataChild_Height + +Dim $datestamp +Dim $timestamp +Dim $GraphLastTime + +Dim $GoogleEarth_ActiveFile = _TempFile($TmpDir, "autokml_active_", ".kml") +Dim $GoogleEarth_DeadFile = _TempFile($TmpDir, "autokml_dead_", ".kml") +Dim $GoogleEarth_GpsFile = _TempFile($TmpDir, "autokml_gps_", ".kml") +Dim $GoogleEarth_TrackFile = _TempFile($TmpDir, "autokml_track_", ".kml") +Dim $GoogleEarth_OpenFile = _TempFile($TmpDir, "autokml_networklink_", ".kml") +Dim $tempfile = _TempFile($TmpDir, "netsh-tmp_", ".tmp") +Dim $tempfile_showint = _TempFile($TmpDir, "netsh-si-tmp_", ".tmp") +Dim $wifidbgpstmp = _TempFile($TmpDir, "wifidb-gps-tmp_", ".tmp") +Dim $Latitude = 'N 0000.0000' +Dim $Longitude = 'E 0000.0000' +Dim $Latitude2 = 'N 0000.0000' +Dim $Longitude2 = 'E 0000.0000' +Dim $LatitudeWifidb = 'N 0000.0000' +Dim $LongitudeWifidb = 'E 0000.0000' +Dim $Last_Latitude = 'N 0000.0000' +Dim $Last_Longitude = 'E 0000.0000' +Dim $NumberOfSatalites = '00' +Dim $HorDilPitch = '0' +Dim $Alt = '0' +Dim $AltS = 'M' +Dim $Geo = '0' +Dim $GeoS = 'M' +Dim $SpeedInKnots = '0' +Dim $SpeedInMPH = '0' +Dim $SpeedInKmH = '0' +Dim $TrackAngle = '0' +Dim $TurnOffGPS = 0 +Dim $UseGPS = 0 +Dim $Scan = 0 +Dim $Close = 0 +Dim $NewApFound = 0 +Dim $ComError = 0 +Dim $newdata = 0 +Dim $disconnected_time = -1 +Dim $SortColumn = -1 +Dim $GUIList +Dim $TempFileArray, $TempFileArrayShowInt, $NetComm, $OpenArray, $headers, $MANUF, $LABEL, $SigHist +Dim $SSID, $NetworkType, $Authentication, $Encryption, $BSSID, $Signal, $RadioType, $Channel, $BasicTransferRates, $OtherTransferRates +Dim $LatTest, $gps, $winpos +Dim $sort_timer +Dim $data_old +Dim $RefreshTimer +Dim $sizes, $sizes_old +Dim $GraphBack, $GraphGrid, $red, $black +Dim $base_add = 0, $data, $data_old, $info_old, $Graph = 0, $Graph_old, $MinimalGuiMode_old, $ResetSizes = 1, $ReGraph = 1 +Dim $LastSelected = -1 +Dim $AutoRecoveryVS1File +Dim $SaveDbOnExit = 0 +Dim $ClearAllAps = 0 +Dim $UpdateAutoSave = 0 +Dim $CompassOpen = 0 +Dim $SettingsOpen = 0 +Dim $AddMacOpen = 0 +Dim $AddLabelOpen = 0 +Dim $AutoUpApsToWifiDB = 0 +Dim $ClearListAndTree = 0 +Dim $TempBatchListviewInsert = 0 +Dim $TempBatchListviewDelete = 0 +Dim $SayProcess +Dim $MidiProcess +Dim $AutoRecoveryVS1Process +Dim $AutoKmlActiveProcess +Dim $AutoKmlDeadProcess +Dim $AutoKmlTrackProcess +Dim $NsCancel +Dim $DefaultApapterID +Dim $OpenedPort +Dim $LastGpsString +Dim $WifiDbSessionID + +Dim $AddQuery +Dim $RemoveQuery +Dim $CountQuery + +Dim $ListviewAPs +Dim $TreeviewAPs + +Dim $NetworkAdapters[1] +_Wlan_StartSession() +Dim $noadaptersid + +Dim $TreeviewAPs_left, $TreeviewAPs_width, $TreeviewAPs_top, $TreeviewAPs_height +Dim $ListviewAPs_left, $ListviewAPs_width, $ListviewAPs_top, $ListviewAPs_height +Dim $Graphic_left, $Graphic_width, $Graphic_top, $Graphic_height + +Dim $Graph_topborder = 20, $Graph_bottomborder = 20, $Graph_leftborder = 40, $Graph_rightborder = 20 +Dim $Compass_topborder = 20, $Compass_bottomborder = 20, $Compass_leftborder = 20, $Compass_rightborder = 20 +Dim $2400topborder = 20, $2400bottomborder = 40, $2400leftborder = 40, $2400rightborder = 20 +Dim $5000topborder = 20, $5000bottomborder = 40, $5000leftborder = 40, $5000rightborder = 20 + +Dim $Graph_backbuffer, $Graph_height, $Graph_width +Dim $CompassGUI, $Compass_graphics, $Compass_bitmap, $Compass_backbuffer, $Compass_height, $Compass_width, $Degree, $CompassGUI_width, $CompassGUI_height +Dim $2400chanGUI, $2400GraphicGUI, $2400chanGUIOpen, $2400height, $2400width, $2400topborder, $2400bottomborder, $2400leftborder, $2400rightborder, $2400graphheight, $2400graphwidth, $2400freqwidth, $2400percheight, $2400backbuffer, $2400bitmap, $2400graphics +Dim $5000chanGUI, $5000GraphicGUI, $5000chanGUIOpen, $5000height, $5000width, $5000topborder, $5000bottomborder, $5000leftborder, $5000rightborder, $5000graphheight, $5000graphwidth, $5000freqwidth, $5000percheight, $5000backbuffer, $5000bitmap, $5000graphics + +Dim $FixTime, $FixTime2, $FixDate +Dim $Temp_FixTime, $Temp_FixTime2, $Temp_FixDate, $Temp_Lat, $Temp_Lon, $Temp_Lat2, $Temp_Lon2, $Temp_Quality, $Temp_NumberOfSatalites, $Temp_HorDilPitch, $Temp_Alt, $Temp_AltS, $Temp_Geo, $Temp_GeoS, $Temp_Status, $Temp_SpeedInKnots, $Temp_SpeedInMPH, $Temp_SpeedInKmH, $Temp_TrackAngle +Dim $GpsDetailsGUI, $GPGGA_Update, $GPRMC_Update, $GpsDetailsOpen = 0, $WifidbGPS_Update, $UploadFileToWifiDBOpen = 0 +Dim $GpsCurrentDataGUI, $GPGGA_Time, $GPGGA_Lat, $GPGGA_Lon, $GPGGA_Quality, $GPGGA_Satalites, $GPGGA_HorDilPitch, $GPGGA_Alt, $GPGGA_Geo, $GPRMC_Time, $GPRMC_Date, $GPRMC_Lat, $GPRMC_Lon, $GPRMC_Status, $GPRMC_SpeedKnots, $GPRMC_SpeedMPH, $GPRMC_SpeedKmh, $GPRMC_TrackAngle +Dim $GUI_AutoSaveKml, $GUI_GoogleEXE, $GUI_AutoKmlActiveTime, $GUI_AutoKmlDeadTime, $GUI_AutoKmlGpsTime, $GUI_AutoKmlTrackTime, $GUI_KmlFlyTo, $AutoKmlActiveHeader, $GUI_OpenKmlNetLink, $GUI_AutoKml_Alt, $GUI_AutoKml_AltMode, $GUI_AutoKml_Heading, $GUI_AutoKml_Range, $GUI_AutoKml_Tilt +Dim $GUI_NewApSound, $GUI_ASperloop, $GUI_ASperap, $GUI_ASperapwsound, $GUI_SpeakSignal, $GUI_PlayMidiSounds, $GUI_SpeakSoundsVis, $GUI_SpeakSoundsSapi, $GUI_SpeakPercent, $GUI_SpeakSigTime, $GUI_SpeakSoundsMidi, $GUI_Midi_Instument, $GUI_Midi_PlayTime + +Dim $GUI_Import, $vistumblerfileinput, $progressbar, $percentlabel, $linemin, $newlines, $minutes, $linetotal, $estimatedtime, $RadVis, $RadCsv, $RadNs, $RadWD +Dim $ExportKMLGUI, $GUI_TrackColor +Dim $GUI_ImportImageFiles + +Dim $WifiDbUploadGUI, $WifiDb_User_GUI, $WifiDb_OtherUsers_GUI, $WifiDb_ApiKey_GUI, $upload_title_GUI, $upload_notes_GUI, $VS1_Radio_GUI, $VSZ_Radio_GUI, $CSV_Radio_GUI, $Export_Filtered_GUI +Dim $UpdateTimer, $MemReleaseTimer, $begintime, $closebtn + +Dim $Apply_Misc = 1, $Apply_Save = 1, $Apply_GPS = 1, $Apply_Language = 0, $Apply_Manu = 0, $Apply_Lab = 0, $Apply_Column = 1, $Apply_Searchword = 1, $Apply_Auto = 1, $Apply_Sound = 1, $Apply_WifiDB = 1, $Apply_Cam = 0 +Dim $SetMisc, $GUI_Comport, $GUI_Baud, $GUI_Parity, $GUI_StopBit, $GUI_DataBit, $GUI_Format, $GUI_GpsDisconnect, $GUI_GpsReset, $Rad_UseNetcomm, $Rad_UseCommMG, $Rad_UseKernel32, $LanguageBox, $SearchWord_SSID_GUI, $SearchWord_BSSID_GUI, $SearchWord_NetType_GUI +Dim $SearchWord_Authentication_GUI, $SearchWord_Signal_GUI, $SearchWord_RadioType_GUI, $SearchWord_Channel_GUI, $SearchWord_BasicRates_GUI, $SearchWord_OtherRates_GUI, $SearchWord_Encryption_GUI, $SearchWord_Open_GUI +Dim $SearchWord_None_GUI, $SearchWord_Wep_GUI, $SearchWord_Infrastructure_GUI, $SearchWord_Adhoc_GUI + +Dim $LabAuth, $LabDate, $LabWinCode, $LabDesc, $GUI_Set_SaveDir, $GUI_Set_SaveDirAuto, $GUI_Set_SaveDirAutoRecovery, $GUI_Set_SaveDirKml, $GUI_BKColor, $GUI_CBKColor, $GUI_TextColor, $GUI_CBAColor, $GUI_CBIColor, $GUI_TextSize, $GUI_dBmMaxSignal, $GUI_dBmDisassociationSignal, $GUI_TimeBeforeMarkingDead, $GUI_RefreshLoop, $GUI_AutoCheckForUpdates, $GUI_CheckForBetaUpdates, $GUI_CamTriggerScript +Dim $Gui_Csv, $GUI_Manu_List, $GUI_Lab_List, $GUI_Cam_List, $ImpLanFile +Dim $EditMacGUIForm, $GUI_Manu_NewManu, $GUI_Manu_NewMac, $EditMac_Mac, $EditMac_GUI, $EditLine, $GUI_Lab_NewMac, $GUI_Lab_NewLabel, $EditCamGUIForm, $GUI_Cam_NewID, $GUI_Cam_NewLOC, $GUI_Edit_CamID, $GUI_Edit_CamLOC, $Gui_CamTrigger, $GUI_CamTriggerTime, $GUI_ImgGroupName, $GUI_ImgGroupName, $GUI_ImpImgSkewTime, $GUI_ImpImgDir +Dim $AutoSaveAndClearBox, $AutoSaveAndClearRadioAP, $AutoSaveAndClearRadioTime, $AutoSaveAndClearAPsGUI, $AutoSaveAndClearTimeGUI, $AutoRecoveryBox, $AutoRecoveryDelBox, $AutoSaveAndClearPlaySoundGUI, $AutoRecoveryTimeGUI, $GUI_SortDirection, $GUI_RefreshNetworks, $GUI_RefreshTime, $GUI_WifidbLocate, $GUI_WiFiDbLocateRefreshTime, $GUI_SortBy, $GUI_SortTime, $GUI_AutoSort, $GUI_SortTime, $GUI_WifiDB_User, $GUI_WifiDB_ApiKey, $GUI_WifiDbGraphURL, $GUI_WifiDbWdbURL, $GUI_WifiDbApiURL, $GUI_WifidbUploadAps, $GUI_AutoUpApsToWifiDBTime +Dim $Gui_CsvFile, $Gui_CsvRadSummary, $Gui_CsvRadDetailed, $Gui_CsvFiltered +Dim $GUI_ModifyFilters, $FilterLV, $AddEditFilt_GUI, $Filter_ID_GUI, $Filter_Name_GUI, $Filter_Desc_GUI +Dim $MacAdd_GUI, $MacAdd_GUI_BSSID, $MacAdd_GUI_MANU, $LabelAdd_GUI, $LabelAdd_GUI_BSSID, $LabelAdd_GUI_LABEL + +Dim $WifiDbSessionGuiOpen, $WifiDbAutoUploadForm, $inp_autoupload_username, $inp_autoupload_key, $inp_autoupload_title, $inp_autoupload_notes, $wua_user, $wua_apikey, $wua_title, $wua_notes, $wua_ver + +Dim $CWCB_RadioType, $CWIB_RadioType, $CWCB_Channel, $CWIB_Channel, $CWCB_Latitude, $CWIB_Latitude, $CWCB_Longitude, $CWIB_Longitude, $CWCB_LatitudeDMS, $CWIB_LatitudeDMS, $CWCB_LongitudeDMS, $CWIB_LongitudeDMS, $CWCB_LatitudeDMM, $CWIB_LatitudeDMM, $CWCB_LongitudeDMM, $CWIB_LongitudeDMM, $CWCB_BtX, $CWIB_BtX, $CWCB_OtX, $CWIB_OtX, $CWCB_FirstActive, $CWIB_FirstActive +Dim $CWCB_LastActive, $CWIB_LastActive, $CWCB_Line, $CWIB_Line, $CWCB_Active, $CWIB_Active, $CWCB_SSID, $CWIB_SSID, $CWCB_BSSID, $CWIB_BSSID, $CWCB_Manu, $CWIB_Manu, $CWCB_Signal, $CWIB_Signal, $CWCB_HighSignal, $CWIB_HighSignal, $CWCB_RSSI, $CWIB_RSSI, $CWCB_HighRSSI, $CWIB_HighRSSI +Dim $CWCB_Authentication, $CWIB_Authentication, $CWCB_Encryption, $CWIB_Encryption, $CWCB_NetType, $CWIB_NetType, $CWCB_Label, $CWIB_Label + +Dim $CopyGUI_BSSID, $CopyGUI_Line, $CopyGUI_SSID, $CopyGUI_CHAN, $CopyGUI_AUTH, $CopyGUI_ENCR, $CopyGUI_NETTYPE, $CopyGUI_RADTYPE, $CopyGUI_SIG, $CopyGUI_HIGHSIG, $CopyGUI_RSSI, $CopyGUI_HIGHRSSI, $CopyGUI_MANU, $CopyGUI_LAB, $CopyGUI_LAT, $CopyGUI_LON, $CopyGUI_LATDMS, $CopyGUI_LONDMS, $CopyGUI_LATDMM, $CopyGUI_LONDMM, $CopyGUI_BTX, $CopyGUI_OTX, $CopyGUI_FirstActive, $CopyGUI_LastActive +Dim $GUI_COPY, $CopyFlag = 0, $CopyAPID, $Copy_Line, $Copy_BSSID, $Copy_SSID, $Copy_CHAN, $Copy_AUTH, $Copy_ENCR, $Copy_NETTYPE, $Copy_RADTYPE, $Copy_SIG, $Copy_HIGHSIG, $Copy_RSSI, $Copy_HIGHRSSI, $Copy_LAB, $Copy_MANU, $Copy_LAT, $Copy_LON, $Copy_LATDMS, $Copy_LONDMS, $Copy_LATDMM, $Copy_LONDMM, $Copy_BTX, $Copy_OTX, $Copy_FirstActive, $Copy_LastActive + +Dim $Filter_SSID_GUI, $Filter_BSSID_GUI, $Filter_CHAN_GUI, $Filter_AUTH_GUI, $Filter_ENCR_GUI, $Filter_RADTYPE_GUI, $Filter_NETTYPE_GUI, $Filter_SIG_GUI, $Filter_HighSig_GUI, $Filter_RSSI_GUI, $Filter_HighRSSI_GUI, $Filter_BTX_GUI, $Filter_OTX_GUI, $Filter_Line_GUI, $Filter_Active_GUI +Dim $GIT_ROOT = 'https://raw.github.com/acalcutt/Vistumbler/' +Dim $CurrentVersionFile = @ScriptDir & '\versions.ini' +Dim $NewVersionFile = $TmpDir & 'versions.ini' + +Dim $KmlSignalMapStyles = ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF + +;Define Arrays +Dim $Direction[26] ;Direction array for sorting by clicking on the header. Needs to be 1 greatet (or more) than the amount of columns +Dim $Direction2[3] +Dim $Direction3[3] +Dim $OldGraphData[1] +;Load-Settings-From-INI-File---------------------------- +Dim $SaveDir = IniRead($settings, 'Vistumbler', 'SaveDir', $DefaultSaveDir) +Dim $SaveDirAuto = IniRead($settings, 'Vistumbler', 'SaveDirAuto', $DefaultSaveDir) +Dim $SaveDirAutoRecovery = IniRead($settings, 'Vistumbler', 'SaveDirAutoRecovery', $DefaultSaveDir) +Dim $SaveDirKml = IniRead($settings, 'Vistumbler', 'SaveDirKml', $DefaultSaveDir) +Dim $netsh = IniRead($settings, 'Vistumbler', 'Netsh_exe', 'netsh.exe') +Dim $AutoCheckForUpdates = IniRead($settings, 'Vistumbler', 'AutoCheckForUpdates', 1) +Dim $CheckForBetaUpdates = IniRead($settings, 'Vistumbler', 'CheckForBetaUpdates', 1) +Dim $DefaultApapter = IniRead($settings, 'Vistumbler', 'DefaultApapter', 'Wireless Network Connection') +Dim $TextSize = IniRead($settings, 'Vistumbler', 'TextSize', 8.5) +Dim $TextColor = IniRead($settings, 'Vistumbler', 'TextColor', "0x000000") +Dim $BackgroundColor = IniRead($settings, 'Vistumbler', 'BackgroundColor', "0x99B4A1") +Dim $ControlBackgroundColor = IniRead($settings, 'Vistumbler', 'ControlBackgroundColor', "0xD7E4C2") +Dim $ButtonActiveColor = IniRead($settings, 'Vistumbler', 'ButtonActiveColor', "0xE1F2D0") +Dim $ButtonInactiveColor = IniRead($settings, 'Vistumbler', 'ButtonInactiveColor', "0xF2D0D0") +Dim $SplitPercent = IniRead($settings, 'Vistumbler', 'SplitPercent', '0.2') +Dim $SplitHeightPercent = IniRead($settings, 'Vistumbler', 'SplitHeightPercent', '0.65') +Dim $RefreshLoopTime = IniRead($settings, 'Vistumbler', 'Sleeptime', 1000) +Dim $AddDirection = IniRead($settings, 'Vistumbler', 'NewApPosistion', 0) +Dim $RefreshNetworks = IniRead($settings, 'Vistumbler', 'AutoRefreshNetworks', 1) +Dim $RefreshTime = IniRead($settings, 'Vistumbler', 'AutoRefreshTime', 1000) +Dim $Debug = IniRead($settings, 'Vistumbler', 'Debug', 0) +Dim $DebugCom = IniRead($settings, 'Vistumbler', 'DebugCom', 0) +Dim $UseRssiInGraphs = IniRead($settings, 'Vistumbler', 'UseRssiInGraphs', 1) +Dim $GraphDeadTime = IniRead($settings, 'Vistumbler', 'GraphDeadTime', 0) +Dim $SaveGpsWithNoAps = IniRead($settings, 'Vistumbler', 'SaveGpsWithNoAps', 1) +Dim $TimeBeforeMarkedDead = IniRead($settings, 'Vistumbler', 'TimeBeforeMarkedDead', 2) +Dim $AutoSelect = IniRead($settings, 'Vistumbler', 'AutoSelect', 0) +Dim $AutoSelectHS = IniRead($settings, 'Vistumbler', 'AutoSelectHS', 0) +Dim $DefFiltID = IniRead($settings, 'Vistumbler', 'DefFiltID', '-1') +Dim $AutoScan = IniRead($settings, 'Vistumbler', 'AutoScan', '0') +Dim $dBmMaxSignal = IniRead($settings, 'Vistumbler', 'dBmMaxSignal', '-30') +Dim $dBmDissociationSignal = IniRead($settings, 'Vistumbler', 'dBmDissociationSignal', '-85') +Dim $MinimalGuiMode = IniRead($settings, 'Vistumbler', 'MinimalGuiMode', 0) +Dim $MinimalGuiExitHeight = IniRead($settings, 'Vistumbler', 'MinimalGuiExitHeight', 695) +Dim $AutoScrollToBottom = IniRead($settings, 'Vistumbler', 'AutoScrollToBottom', 0) +Dim $BatchListviewInsert = IniRead($settings, 'Vistumbler', 'BatchListviewInsert', 0) + +Dim $VistumblerState = IniRead($settings, 'WindowPositions', 'VistumblerState', 'Window') +Dim $VistumblerPosition = IniRead($settings, 'WindowPositions', 'VistumblerPosition', '') +Dim $CompassPosition = IniRead($settings, 'WindowPositions', 'CompassPosition', '') +Dim $GpsDetailsPosition = IniRead($settings, 'WindowPositions', 'GpsDetailsPosition', '') +Dim $2400ChanGraphPos = IniRead($settings, 'WindowPositions', '2400ChanGraphPos', '') +Dim $5000ChanGraphPos = IniRead($settings, 'WindowPositions', '5000ChanGraphPos', '') + +Dim $ComPort = IniRead($settings, 'GpsSettings', 'ComPort', '4') +Dim $BAUD = IniRead($settings, 'GpsSettings', 'Baud', '4800') +Dim $PARITY = IniRead($settings, 'GpsSettings', 'Parity', 'N') +Dim $DATABIT = IniRead($settings, 'GpsSettings', 'DataBit', '8') +Dim $STOPBIT = IniRead($settings, 'GpsSettings', 'StopBit', '1') +Dim $GpsType = IniRead($settings, 'GpsSettings', 'GpsType', '2') +Dim $GPSformat = IniRead($settings, 'GpsSettings', 'GPSformat', 3) +Dim $GpsTimeout = IniRead($settings, 'GpsSettings', 'GpsTimeout', 30000) +Dim $GpsDisconnect = IniRead($settings, 'GpsSettings', 'GpsDisconnect', 1) +Dim $GpsReset = IniRead($settings, 'GpsSettings', 'GpsReset', 1) + +Dim $SortTime = IniRead($settings, 'AutoSort', 'AutoSortTime', 60) +Dim $AutoSort = IniRead($settings, 'AutoSort', 'AutoSort', 0) +Dim $SortBy = IniRead($settings, 'AutoSort', 'SortCombo', 'SSID') +Dim $SortDirection = IniRead($settings, 'AutoSort', 'AscDecDefault', 0) + +Dim $AutoRecoveryVS1 = IniRead($settings, 'AutoRecovery', 'AutoRecovery', 1) +Dim $AutoRecoveryVS1Del = IniRead($settings, 'AutoRecovery', 'AutoRecoveryDel', 1) +Dim $AutoRecoveryTime = IniRead($settings, 'AutoRecovery', 'AutoRecoveryTime', 5) + +Dim $AutoSaveAndClear = IniRead($settings, 'AutoSaveAndClear', 'AutoSaveAndClear', 0) +Dim $AutoSaveAndClearPlaySound = IniRead($settings, 'AutoSaveAndClear', 'AutoSaveAndClearPlaySound', 1) +Dim $AutoSaveAndClearOnTime = IniRead($settings, 'AutoSaveAndClear', 'AutoSaveAndClearOnTime', 0) +Dim $AutoSaveAndClearTime = IniRead($settings, 'AutoSaveAndClear', 'AutoSaveAndClearTime', 60) +Dim $AutoSaveAndClearOnAPs = IniRead($settings, 'AutoSaveAndClear', 'AutoSaveAndClearOnAPs', 1) +Dim $AutoSaveAndClearAPs = IniRead($settings, 'AutoSaveAndClear', 'AutoSaveAndClearAPs', 1000) + +Dim $SoundOnGps = IniRead($settings, 'Sound', 'PlaySoundOnNewGps', 0) +Dim $SoundOnAP = IniRead($settings, 'Sound', 'PlaySoundOnNewAP', 1) +Dim $SoundPerAP = IniRead($settings, 'Sound', 'SoundPerAP', 0) +Dim $NewSoundSigBased = IniRead($settings, 'Sound', 'NewSoundSigBased', 0) +Dim $new_AP_sound = IniRead($settings, 'Sound', 'NewAP_Sound', 'new_ap.wav') +Dim $new_GPS_sound = IniRead($settings, 'Sound', 'NewGPS_Sound', 'new_gps.wav') +Dim $AutoSave_sound = IniRead($settings, 'Sound', 'AutoSave_Sound', 'autosave.wav') +Dim $ErrorFlag_sound = IniRead($settings, 'Sound', 'Error_Sound', 'error.wav') + +Dim $SpeakSignal = IniRead($settings, 'MIDI', 'SpeakSignal', 0) +Dim $SpeakSigSayPecent = IniRead($settings, 'MIDI', 'SpeakSigSayPecent', 1) +Dim $SpeakSigTime = IniRead($settings, 'MIDI', 'SpeakSigTime', 2000) +Dim $SpeakType = IniRead($settings, 'MIDI', 'SpeakType', 2) +Dim $Midi_Instument = IniRead($settings, 'MIDI', 'Midi_Instument', 56) +Dim $Midi_PlayTime = IniRead($settings, 'MIDI', 'Midi_PlayTime', 500) +Dim $Midi_PlayForActiveAps = IniRead($settings, 'MIDI', 'Midi_PlayForActiveAps', 0) + +Dim $MapPos = IniRead($settings, 'KmlSettings', 'MapPos', 1) +Dim $MapSig = IniRead($settings, 'KmlSettings', 'MapSig', 1) +Dim $MapSigUseRSSI = IniRead($settings, 'KmlSettings', 'MapSigUseRSSI', 1) +Dim $MapSigType = IniRead($settings, 'KmlSettings', 'MapSigType', 0) +Dim $MapRange = IniRead($settings, 'KmlSettings', 'MapRange', 1) +Dim $ShowTrack = IniRead($settings, 'KmlSettings', 'ShowTrack', 1) +Dim $MapOpen = IniRead($settings, 'KmlSettings', 'MapOpen', 1) +Dim $MapWEP = IniRead($settings, 'KmlSettings', 'MapWEP', 1) +Dim $MapSec = IniRead($settings, 'KmlSettings', 'MapSec', 1) +Dim $UseLocalKmlImagesOnExport = IniRead($settings, 'KmlSettings', 'UseLocalKmlImagesOnExport', 0) +Dim $SigMapTimeBeforeMarkedDead = IniRead($settings, 'KmlSettings', 'SigMapTimeBeforeMarkedDead', 2) +Dim $TrackColor = IniRead($settings, 'KmlSettings', 'TrackColor', '7F0000FF') +Dim $CirSigMapColor = IniRead($settings, 'KmlSettings', 'CirSigMapColor', 'FF0055FF') +Dim $CirRangeMapColor = IniRead($settings, 'KmlSettings', 'CirRangeMapColor', 'FF00AA00') + +Dim $CamTrigger = IniRead($settings, 'Cam', 'CamTrigger', 0) +Dim $CamTriggerScript = IniRead($settings, 'Cam', 'CamTriggerScript', "") +Dim $CamTriggerTime = IniRead($settings, 'Cam', 'CamTriggerTime', 10000) +Dim $DownloadImages = IniRead($settings, 'Cam', 'DownloadImages', 0) +Dim $DownloadImagesTime = IniRead($settings, 'Cam', 'DownloadImagesTime', 10000) + +Dim $AutoKML = IniRead($settings, 'AutoKML', 'AutoKML', 0) +Dim $AutoKML_Alt = IniRead($settings, 'AutoKML', 'AutoKML_Alt', '4000') +Dim $AutoKML_AltMode = IniRead($settings, 'AutoKML', 'AutoKML_AltMode', 'clampToGround') +Dim $AutoKML_Heading = IniRead($settings, 'AutoKML', 'AutoKML_Heading', '0') +Dim $AutoKML_Range = IniRead($settings, 'AutoKML', 'AutoKML_Range', '4000') +Dim $AutoKML_Tilt = IniRead($settings, 'AutoKML', 'AutoKML_Tilt', '0') +Dim $AutoKmlActiveTime = IniRead($settings, 'AutoKML', 'AutoKmlActiveTime', 1) +Dim $AutoKmlDeadTime = IniRead($settings, 'AutoKML', 'AutoKmlDeadTime', 30) +Dim $AutoKmlGpsTime = IniRead($settings, 'AutoKML', 'AutoKmlGpsTime', 1) +Dim $AutoKmlTrackTime = IniRead($settings, 'AutoKML', 'AutoKmlTrackTime', 10) +Dim $KmlFlyTo = IniRead($settings, 'AutoKML', 'KmlFlyTo', 1) +Dim $OpenKmlNetLink = IniRead($settings, 'AutoKML', 'OpenKmlNetLink', 1) +$defaultgooglepath = RegRead('HKEY_CURRENT_USER\Software\Google\Google Earth Plus\autoupdate', 'AppPath') & '/googleearth.exe' +If $defaultgooglepath = '/googleearth.exe' And @OSArch = 'X86' Then $defaultgooglepath = 'C:/Program Files/Google/Google Earth/client/googleearth.exe' ;use as default for x86 if google earth path is not found in registry +If $defaultgooglepath = '/googleearth.exe' And @OSArch = 'X64' Then $defaultgooglepath = 'C:/Program Files (x86)/Google/Google Earth/client/googleearth.exe' ;use as default for x64 if google earth path is not found in registry +Dim $GoogleEarthExe = IniRead($settings, 'AutoKML', 'GoogleEarthExe', $defaultgooglepath) + +Dim $WifiDb_User = IniRead($settings, 'WifiDbWifiTools', 'WifiDb_User', '') +Dim $WifiDb_ApiKey = IniRead($settings, 'WifiDbWifiTools', 'WifiDb_ApiKey', '') +Dim $WifiDb_OtherUsers = IniRead($settings, 'WifiDbWifiTools', 'WifiDb_OtherUsers', '') +Dim $WifiDb_UploadType = IniRead($settings, 'WifiDbWifiTools', 'WifiDb_UploadType', 'VSZ') +Dim $WifiDb_UploadFiltered = IniRead($settings, 'WifiDbWifiTools', 'WifiDb_UploadFiltered', 0) +Dim $WifiDbGraphURL = IniRead($settings, 'WifiDbWifiTools', 'WifiDb_GRAPH_URL', 'https://api.wifidb.net/wifi/') +Dim $WifiDbWdbURL = IniRead($settings, 'WifiDbWifiTools', 'WiFiDB_URL', 'https://live.wifidb.net/wifidb/') +Dim $WifiDbApiURL = IniRead($settings, 'WifiDbWifiTools', 'WifiDB_API_URL', 'https://api.wifidb.net/') +Dim $UseWiFiDbGpsLocate = IniRead($settings, 'WifiDbWifiTools', 'UseWiFiDbGpsLocate', 0) +Dim $EnableAutoUpApsToWifiDB = IniRead($settings, 'WifiDbWifiTools', 'AutoUpApsToWifiDB', 0) +Dim $AutoUpApsToWifiDBTime = IniRead($settings, 'WifiDbWifiTools', 'AutoUpApsToWifiDBTime', 60) +Dim $WiFiDbLocateRefreshTime = IniRead($settings, 'WifiDbWifiTools', 'WiFiDbLocateRefreshTime', 5000) + +Dim $column_Line = IniRead($settings, 'Columns', 'Column_Line', 0) +Dim $column_Active = IniRead($settings, 'Columns', 'Column_Active', 1) +Dim $column_BSSID = IniRead($settings, 'Columns', 'Column_BSSID', 2) +Dim $column_SSID = IniRead($settings, 'Columns', 'Column_SSID', 3) +Dim $column_Signal = IniRead($settings, 'Columns', 'Column_Signal', 4) +Dim $column_HighSignal = IniRead($settings, 'Columns', 'Column_HighSignal', 5) +Dim $column_RSSI = IniRead($settings, 'Columns', 'Column_RSSI', 6) +Dim $column_HighRSSI = IniRead($settings, 'Columns', 'Column_HighRSSI', 7) +Dim $column_Channel = IniRead($settings, 'Columns', 'Column_Channel', 8) +Dim $column_Authentication = IniRead($settings, 'Columns', 'Column_Authentication', 9) +Dim $column_Encryption = IniRead($settings, 'Columns', 'Column_Encryption', 10) +Dim $column_NetworkType = IniRead($settings, 'Columns', 'Column_NetworkType', 11) +Dim $column_Latitude = IniRead($settings, 'Columns', 'Column_Latitude', 12) +Dim $column_Longitude = IniRead($settings, 'Columns', 'Column_Longitude', 13) +Dim $column_MANUF = IniRead($settings, 'Columns', 'Column_Manufacturer', 14) +Dim $column_Label = IniRead($settings, 'Columns', 'Column_Label', 15) +Dim $column_RadioType = IniRead($settings, 'Columns', 'Column_RadioType', 16) +Dim $column_LatitudeDMS = IniRead($settings, 'Columns', 'Column_LatitudeDMS', 17) +Dim $column_LongitudeDMS = IniRead($settings, 'Columns', 'Column_LongitudeDMS', 18) +Dim $column_LatitudeDMM = IniRead($settings, 'Columns', 'Column_LatitudeDMM', 19) +Dim $column_LongitudeDMM = IniRead($settings, 'Columns', 'Column_LongitudeDMM', 20) +Dim $column_BasicTransferRates = IniRead($settings, 'Columns', 'Column_BasicTransferRates', 21) +Dim $column_OtherTransferRates = IniRead($settings, 'Columns', 'Column_OtherTransferRates', 22) +Dim $column_FirstActive = IniRead($settings, 'Columns', 'Column_FirstActive', 23) +Dim $column_LastActive = IniRead($settings, 'Columns', 'Column_LastActive', 24) + +Dim $column_Width_Line = IniRead($settings, 'Column_Width', 'Column_Line', 60) +Dim $column_Width_Active = IniRead($settings, 'Column_Width', 'Column_Active', 60) +Dim $column_Width_SSID = IniRead($settings, 'Column_Width', 'Column_SSID', 150) +Dim $column_Width_BSSID = IniRead($settings, 'Column_Width', 'Column_BSSID', 110) +Dim $column_Width_MANUF = IniRead($settings, 'Column_Width', 'Column_Manufacturer', 110) +Dim $column_Width_Signal = IniRead($settings, 'Column_Width', 'Column_Signal', 75) +Dim $column_Width_HighSignal = IniRead($settings, 'Column_Width', 'Column_HighSignal', 75) +Dim $column_Width_RSSI = IniRead($settings, 'Column_Width', 'Column_RSSI', 75) +Dim $column_Width_HighRSSI = IniRead($settings, 'Column_Width', 'Column_HighRSSI', 75) +Dim $column_Width_Channel = IniRead($settings, 'Column_Width', 'Column_Channel', 70) +Dim $column_Width_Authentication = IniRead($settings, 'Column_Width', 'Column_Authentication', 105) +Dim $column_Width_Encryption = IniRead($settings, 'Column_Width', 'Column_Encryption', 105) +Dim $column_Width_RadioType = IniRead($settings, 'Column_Width', 'Column_RadioType', 85) +Dim $column_Width_Latitude = IniRead($settings, 'Column_Width', 'Column_Latitude', 85) +Dim $column_Width_Longitude = IniRead($settings, 'Column_Width', 'Column_Longitude', 85) +Dim $column_Width_LatitudeDMS = IniRead($settings, 'Column_Width', 'Column_LatitudeDMS', 115) +Dim $column_Width_LongitudeDMS = IniRead($settings, 'Column_Width', 'Column_LongitudeDMS', 115) +Dim $column_Width_LatitudeDMM = IniRead($settings, 'Column_Width', 'Column_LatitudeDMM', 140) +Dim $column_Width_LongitudeDMM = IniRead($settings, 'Column_Width', 'Column_LongitudeDMM', 140) +Dim $column_Width_BasicTransferRates = IniRead($settings, 'Column_Width', 'Column_BasicTransferRates', 130) +Dim $column_Width_OtherTransferRates = IniRead($settings, 'Column_Width', 'Column_OtherTransferRates', 130) +Dim $column_Width_FirstActive = IniRead($settings, 'Column_Width', 'Column_FirstActive', 130) +Dim $column_Width_LastActive = IniRead($settings, 'Column_Width', 'Column_LastActive', 130) +Dim $column_Width_NetworkType = IniRead($settings, 'Column_Width', 'Column_NetworkType', 100) +Dim $column_Width_Label = IniRead($settings, 'Column_Width', 'Column_Label', 110) + +;Load GUI Text from language file +Dim $DefaultLanguage = IniRead($settings, 'Vistumbler', 'Language', 'English') +Dim $DefaultLanguageFile = IniRead($settings, 'Vistumbler', 'LanguageFile', $DefaultLanguage & '.ini') +Dim $DefaultLanguagePath = $LanguageDir & $DefaultLanguageFile +If FileExists($DefaultLanguagePath) = 0 Then + $DefaultLanguage = 'English' + $DefaultLanguageFile = 'English.ini' + $DefaultLanguagePath = $LanguageDir & $DefaultLanguageFile +EndIf +IniDelete($settings, 'GuiText') ;Delete old GuiText section of the setting file if it exists + +Dim $Column_Names_Line = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Line', '#') +Dim $Column_Names_Active = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Active', 'Active') +Dim $Column_Names_SSID = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_SSID', 'SSID') +Dim $Column_Names_BSSID = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_BSSID', 'Mac Address') +Dim $Column_Names_MANUF = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Manufacturer', 'Manufacturer') +Dim $Column_Names_Signal = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Signal', 'Signal') +Dim $Column_Names_HighSignal = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_HighSignal', 'High Signal') +Dim $Column_Names_RSSI = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_RSSI', 'RSSI') +Dim $Column_Names_HighRSSI = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_HighRSSI', 'High RSSI') +Dim $Column_Names_Channel = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Channel', 'Channel') +Dim $Column_Names_Authentication = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Authentication', 'Authentication') +Dim $Column_Names_Encryption = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Encryption', 'Encryption') +Dim $Column_Names_RadioType = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_RadioType', 'Radio Type') +Dim $Column_Names_Latitude = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Latitude', 'Latitude') +Dim $Column_Names_Longitude = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Longitude', 'Longitude') +Dim $Column_Names_LatitudeDMS = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_LatitudeDMS', 'Latitude (DDMMSS)') +Dim $Column_Names_LongitudeDMS = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_LongitudeDMS', 'Longitude (DDMMSS)') +Dim $Column_Names_LatitudeDMM = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_LatitudeDMM', 'Latitude (DDMMMM)') +Dim $Column_Names_LongitudeDMM = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_LongitudeDMM', 'Longitude (DDMMMM)') +Dim $Column_Names_BasicTransferRates = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_BasicTransferRates', 'Basic Transfer Rates') +Dim $Column_Names_OtherTransferRates = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_OtherTransferRates', 'Other Transfer Rates') +Dim $Column_Names_FirstActive = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_FirstActive', 'First Active') +Dim $Column_Names_LastActive = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_LastActive', 'Last Active') +Dim $Column_Names_NetworkType = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_NetworkType', 'Network Type') +Dim $Column_Names_Label = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Label', 'Label') + +Dim $SearchWord_SSID = IniRead($DefaultLanguagePath, 'SearchWords', 'SSID', 'SSID') +Dim $SearchWord_BSSID = IniRead($DefaultLanguagePath, 'SearchWords', 'BSSID', 'BSSID') +Dim $SearchWord_NetworkType = IniRead($DefaultLanguagePath, 'SearchWords', 'NetworkType', 'Network type') +Dim $SearchWord_Authentication = IniRead($DefaultLanguagePath, 'SearchWords', 'Authentication', 'Authentication') +Dim $SearchWord_Encryption = IniRead($DefaultLanguagePath, 'SearchWords', 'Encryption', 'Encryption') +Dim $SearchWord_Signal = IniRead($DefaultLanguagePath, 'SearchWords', 'Signal', 'Signal') +Dim $SearchWord_RSSI = IniRead($DefaultLanguagePath, 'SearchWords', 'RSSI', 'RSSI') +Dim $SearchWord_RadioType = IniRead($DefaultLanguagePath, 'SearchWords', 'RadioType', 'Radio Type') +Dim $SearchWord_Channel = IniRead($DefaultLanguagePath, 'SearchWords', 'Channel', 'Channel') +Dim $SearchWord_BasicRates = IniRead($DefaultLanguagePath, 'SearchWords', 'BasicRates', 'Basic Rates') +Dim $SearchWord_OtherRates = IniRead($DefaultLanguagePath, 'SearchWords', 'OtherRates', 'Other Rates') +Dim $SearchWord_None = IniRead($DefaultLanguagePath, 'SearchWords', 'None', 'None') +Dim $SearchWord_Open = IniRead($DefaultLanguagePath, 'SearchWords', 'Open', 'Open') +Dim $SearchWord_Wep = IniRead($DefaultLanguagePath, 'SearchWords', 'WEP', 'WEP') +Dim $SearchWord_Infrastructure = IniRead($DefaultLanguagePath, 'SearchWords', 'Infrastructure', 'Infrastructure') +Dim $SearchWord_Adhoc = IniRead($DefaultLanguagePath, 'SearchWords', 'Adhoc', 'Adhoc') +Dim $SearchWord_Cipher = IniRead($DefaultLanguagePath, 'SearchWords', 'Cipher', 'Cipher') + +Dim $Text_Ok = IniRead($DefaultLanguagePath, 'GuiText', 'Ok', '&Ok') +Dim $Text_Cancel = IniRead($DefaultLanguagePath, 'GuiText', 'Cancel', 'C&ancel') +Dim $Text_Apply = IniRead($DefaultLanguagePath, 'GuiText', 'Apply', '&Apply') +Dim $Text_Browse = IniRead($DefaultLanguagePath, 'GuiText', 'Browse', '&Browse') + +Dim $Text_File = IniRead($DefaultLanguagePath, 'GuiText', 'File', '&File') +Dim $Text_Import = IniRead($DefaultLanguagePath, 'GuiText', 'Import', '&Import') +Dim $Text_SaveAsTXT = IniRead($DefaultLanguagePath, 'GuiText', 'SaveAsTXT', 'Save As TXT') +Dim $Text_SaveAsVS1 = IniRead($DefaultLanguagePath, 'GuiText', 'SaveAsVS1', 'Save As VS1') +Dim $Text_SaveAsVSZ = IniRead($DefaultLanguagePath, 'GuiText', 'SaveAsVSZ', 'Save As VSZ') +Dim $Text_Export = IniRead($DefaultLanguagePath, 'GuiText', 'Export', 'Ex&port') +Dim $Text_ExportToKML = IniRead($DefaultLanguagePath, 'GuiText', 'ExportToKML', 'Export To KML') +Dim $Text_ExportToGPX = IniRead($DefaultLanguagePath, 'GuiText', 'ExportToGPX', 'Export To GPX') +Dim $Text_ExportToTXT = IniRead($DefaultLanguagePath, 'GuiText', 'ExportToTXT', 'Export To TXT') +Dim $Text_ExportToNS1 = IniRead($DefaultLanguagePath, 'GuiText', 'ExportToNS1', 'Export To NS1') +Dim $Text_ExportToVS1 = IniRead($DefaultLanguagePath, 'GuiText', 'ExportToVS1', 'Export To VS1') +Dim $Text_ExportToCSV = IniRead($DefaultLanguagePath, 'GuiText', 'ExportToCSV', 'Export To CSV') +Dim $Text_ExportToVSZ = IniRead($DefaultLanguagePath, "GuiText", "ExportToVSZ", "Export To VSZ") +Dim $Text_ImportFromTXT = IniRead($DefaultLanguagePath, 'GuiText', 'ImportFromTXT', 'Import From TXT / VS1') +Dim $Text_ImportFromVSZ = IniRead($DefaultLanguagePath, 'GuiText', 'ImportFromVSZ', 'Import From VSZ') +Dim $Text_Exit = IniRead($DefaultLanguagePath, 'GuiText', 'Exit', 'E&xit') +Dim $Text_ExitSaveDb = IniRead($DefaultLanguagePath, 'GuiText', 'ExitSaveDb', 'Exit (Save DB)') + +Dim $Text_Edit = IniRead($DefaultLanguagePath, 'GuiText', 'Edit', 'E&dit') +Dim $Text_ClearAll = IniRead($DefaultLanguagePath, 'GuiText', 'ClearAll', 'Clear All') +Dim $Text_Cut = IniRead($DefaultLanguagePath, 'GuiText', 'Cut', 'Cut') +Dim $Text_Copy = IniRead($DefaultLanguagePath, 'GuiText', 'Copy', 'Copy') +Dim $Text_Paste = IniRead($DefaultLanguagePath, 'GuiText', 'Paste', 'Paste') +Dim $Text_Delete = IniRead($DefaultLanguagePath, 'GuiText', 'Delete', 'Delete') +Dim $Text_Select = IniRead($DefaultLanguagePath, 'GuiText', 'Select', 'Select') +Dim $Text_SelectAll = IniRead($DefaultLanguagePath, 'GuiText', 'SelectAll', 'Select All') + +Dim $Text_View = IniRead($DefaultLanguagePath, 'GuiText', 'View', '&View') + +Dim $Text_Options = IniRead($DefaultLanguagePath, 'GuiText', 'Options', '&Options') +Dim $Text_AutoSort = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSort', 'AutoSort') +Dim $Text_SortTree = IniRead($DefaultLanguagePath, 'GuiText', 'SortTree', 'Sort Tree - (slow on big lists)') +Dim $Text_PlaySound = IniRead($DefaultLanguagePath, 'GuiText', 'PlaySound', 'Play sound on new AP') +Dim $Text_PlayGpsSound = IniRead($DefaultLanguagePath, 'GuiText', 'PlayGpsSound', 'Play sound on new GPS') +Dim $Text_AddAPsToTop = IniRead($DefaultLanguagePath, 'GuiText', 'AddAPsToTop', 'Add new APs to top') + +Dim $Text_Extra = IniRead($DefaultLanguagePath, 'GuiText', 'Extra', 'Ex&tra') +Dim $Text_ScanAPs = IniRead($DefaultLanguagePath, 'GuiText', 'ScanAPs', '&Scan APs') +Dim $Text_StopScanAps = IniRead($DefaultLanguagePath, 'GuiText', 'StopScanAps', '&Stop') +Dim $Text_UseGPS = IniRead($DefaultLanguagePath, 'GuiText', 'UseGPS', 'Use &GPS') +Dim $Text_StopGPS = IniRead($DefaultLanguagePath, 'GuiText', 'StopGPS', 'Stop &GPS') + +Dim $Text_Settings = IniRead($DefaultLanguagePath, 'GuiText', 'Settings', 'Settings') +Dim $Text_MiscSettings = IniRead($DefaultLanguagePath, 'GuiText', 'MiscSettings', 'Misc Settings') +Dim $Text_SaveSettings = IniRead($DefaultLanguagePath, 'GuiText', 'SaveSettings', 'Save Settings') +Dim $Text_GpsSettings = IniRead($DefaultLanguagePath, 'GuiText', 'GpsSettings', 'GPS Settings') +Dim $Text_SetLanguage = IniRead($DefaultLanguagePath, 'GuiText', 'SetLanguage', 'Set Language') +Dim $Text_SetSearchWords = IniRead($DefaultLanguagePath, 'GuiText', 'SetSearchWords', 'Set Search Words') +Dim $Text_SetMacLabel = IniRead($DefaultLanguagePath, 'GuiText', 'SetMacLabel', 'Set Labels by Mac') +Dim $Text_SetMacManu = IniRead($DefaultLanguagePath, 'GuiText', 'SetMacManu', 'Set Manufactures by Mac') + +Dim $Text_WifiDbPHPgraph = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDbPHPgraph', 'Graph Selected AP Signal to Image') +Dim $Text_WifiDbWDB = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDbWDB', 'WiFiDB URL') +Dim $Text_WifiDbWdbLocate = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDbWdbLocate', 'WifiDB Locate URL') +Dim $Text_UploadDataToWifiDB = IniRead($DefaultLanguagePath, 'GuiText', 'UploadDataToWiFiDB', 'Upload Data to WiFiDB') + +Dim $Text_RefreshLoopTime = IniRead($DefaultLanguagePath, 'GuiText', 'RefreshLoopTime', 'Refresh loop time(ms):') +Dim $Text_ActualLoopTime = IniRead($DefaultLanguagePath, 'GuiText', 'ActualLoopTime', 'Loop time') +Dim $Text_Longitude = IniRead($DefaultLanguagePath, 'GuiText', 'Longitude', 'Longitude') +Dim $Text_Latitude = IniRead($DefaultLanguagePath, 'GuiText', 'Latitude', 'Latitude') +Dim $Text_ActiveAPs = IniRead($DefaultLanguagePath, 'GuiText', 'ActiveAPs', 'Active APs') +Dim $Text_Graph = IniRead($DefaultLanguagePath, 'GuiText', 'Graph', 'Graph') +Dim $Text_Graph1 = IniRead($DefaultLanguagePath, 'GuiText', 'Graph1', 'Graph1') +Dim $Text_Graph2 = IniRead($DefaultLanguagePath, 'GuiText', 'Graph2', 'Graph2') +Dim $Text_NoGraph = IniRead($DefaultLanguagePath, 'GuiText', 'NoGraph', 'No Graph') +Dim $Text_Active = IniRead($DefaultLanguagePath, 'GuiText', 'Active', 'Active') +Dim $Text_Dead = IniRead($DefaultLanguagePath, 'GuiText', 'Dead', 'Dead') + +Dim $Text_AddNewLabel = IniRead($DefaultLanguagePath, 'GuiText', 'AddNewLabel', 'Add New Label') +Dim $Text_RemoveLabel = IniRead($DefaultLanguagePath, 'GuiText', 'RemoveLabel', 'Remove Selected Label') +Dim $Text_EditLabel = IniRead($DefaultLanguagePath, 'GuiText', 'EditLabel', 'Edit Selected Label') +Dim $Text_AddNewMan = IniRead($DefaultLanguagePath, 'GuiText', 'AddNewMan', 'Add New Manufacturer') +Dim $Text_RemoveMan = IniRead($DefaultLanguagePath, 'GuiText', 'RemoveMan', 'Remove Selected Manufacturer') +Dim $Text_EditMan = IniRead($DefaultLanguagePath, 'GuiText', 'EditMan', 'Edit Selected Manufacturer') +Dim $Text_NewMac = IniRead($DefaultLanguagePath, 'GuiText', 'NewMac', 'New Mac Address:') +Dim $Text_NewMan = IniRead($DefaultLanguagePath, 'GuiText', 'NewMan', 'New Manufacturer:') +Dim $Text_NewLabel = IniRead($DefaultLanguagePath, 'GuiText', 'NewLabel', 'New Label:') +Dim $Text_Save = IniRead($DefaultLanguagePath, 'GuiText', 'Save', 'Save') +Dim $Text_SaveQuestion = IniRead($DefaultLanguagePath, 'GuiText', 'SaveQuestion', 'Data has changed. Would you like to save?') + +Dim $Text_GpsDetails = IniRead($DefaultLanguagePath, 'GuiText', 'GpsDetails', 'GPS Details') +Dim $Text_GpsCompass = IniRead($DefaultLanguagePath, 'GuiText', 'GpsCompass', 'GPS Compass') +Dim $Text_Quality = IniRead($DefaultLanguagePath, 'GuiText', 'Quality', 'Quality') +Dim $Text_Time = IniRead($DefaultLanguagePath, 'GuiText', 'Time', 'Time') +Dim $Text_NumberOfSatalites = IniRead($DefaultLanguagePath, 'GuiText', 'NumberOfSatalites', 'Number of Satalites') +Dim $Text_HorizontalDilutionPosition = IniRead($DefaultLanguagePath, 'GuiText', 'HorizontalDilutionPosition', 'Horizontal Dilution') +Dim $Text_Altitude = IniRead($DefaultLanguagePath, 'GuiText', 'Altitude', 'Altitude') +Dim $Text_HeightOfGeoid = IniRead($DefaultLanguagePath, 'GuiText', 'HeightOfGeoid', 'Height of Geoid') +Dim $Text_Status = IniRead($DefaultLanguagePath, 'GuiText', 'Status', 'Status') +Dim $Text_Date = IniRead($DefaultLanguagePath, 'GuiText', 'Date', 'Date') +Dim $Text_SpeedInKnots = IniRead($DefaultLanguagePath, 'GuiText', 'SpeedInKnots', 'Speed(knots)') +Dim $Text_SpeedInMPH = IniRead($DefaultLanguagePath, 'GuiText', 'SpeedInMPH', 'Speed(MPH)') +Dim $Text_SpeedInKmh = IniRead($DefaultLanguagePath, 'GuiText', 'SpeedInKmh', 'Speed(km/h)') +Dim $Text_TrackAngle = IniRead($DefaultLanguagePath, 'GuiText', 'TrackAngle', 'Track Angle') +Dim $Text_Close = IniRead($DefaultLanguagePath, 'GuiText', 'Close', 'Close') +Dim $Text_Start = IniRead($DefaultLanguagePath, 'GuiText', 'Start', 'Start') +Dim $Text_Stop = IniRead($DefaultLanguagePath, 'GuiText', 'Stop', 'Stop') +Dim $Text_RefreshNetworks = IniRead($DefaultLanguagePath, 'GuiText', 'RefreshingNetworks', 'Auto Refresh Networks') +Dim $Text_RefreshTime = IniRead($DefaultLanguagePath, 'GuiText', 'RefreshTime', 'Refresh time') +Dim $Text_SetColumnWidths = IniRead($DefaultLanguagePath, 'GuiText', 'SetColumnWidths', 'Set Column Widths') +Dim $Text_Enable = IniRead($DefaultLanguagePath, 'GuiText', 'Enable', 'Enable') +Dim $Text_Disable = IniRead($DefaultLanguagePath, 'GuiText', 'Disable', 'Disable') +Dim $Text_Checked = IniRead($DefaultLanguagePath, 'GuiText', 'Checked', 'Checked') +Dim $Text_UnChecked = IniRead($DefaultLanguagePath, 'GuiText', 'UnChecked', 'UnChecked') +Dim $Text_Unknown = IniRead($DefaultLanguagePath, 'GuiText', 'Unknown', 'Unknown') +Dim $Text_Restart = IniRead($DefaultLanguagePath, 'GuiText', 'Restart', 'Restart') +Dim $Text_RestartMsg = IniRead($DefaultLanguagePath, 'GuiText', 'RestartMsg', 'Please restart Vistumbler for the change to take effect') +Dim $Text_Error = IniRead($DefaultLanguagePath, 'GuiText', 'Error', 'Error') +Dim $Text_NoSignalHistory = IniRead($DefaultLanguagePath, 'GuiText', 'NoSignalHistory', 'No signal history found, check to make sure your netsh search words are correct') +Dim $Text_NoApSelected = IniRead($DefaultLanguagePath, 'GuiText', 'NoApSelected', 'You did not select an access point') +Dim $Text_UseNetcomm = IniRead($DefaultLanguagePath, 'GuiText', 'UseNetcomm', 'Use Netcomm OCX (more stable) - x32') +Dim $Text_UseCommMG = IniRead($DefaultLanguagePath, 'GuiText', 'UseCommMG', 'Use CommMG (less stable) - x32 - x64') +Dim $Text_SignalHistory = IniRead($DefaultLanguagePath, 'GuiText', 'SignalHistory', 'Signal History') +Dim $Text_AutoSortEvery = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSortEvery', 'Auto Sort Every') +Dim $Text_Seconds = IniRead($DefaultLanguagePath, 'GuiText', 'Seconds', 'Seconds') +Dim $Text_Ascending = IniRead($DefaultLanguagePath, 'GuiText', 'Ascending', 'Ascending') +Dim $Text_Decending = IniRead($DefaultLanguagePath, 'GuiText', 'Decending', 'Decending') +Dim $Text_AutoRecoveryVS1 = IniRead($DefaultLanguagePath, 'GuiText', 'AutoRecoveryVS1', 'Auto Recovery VS1') +Dim $Text_AutoSaveAndClear = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveAndClear', 'Auto Save And Clear') +Dim $Text_AutoSaveEvery = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveEvery', 'Auto Save Every') +Dim $Text_DelAutoSaveOnExit = IniRead($DefaultLanguagePath, 'GuiText', 'DelAutoSaveOnExit', 'Delete Auto Save file on exit') +Dim $Text_OpenSaveFolder = IniRead($DefaultLanguagePath, 'GuiText', 'OpenSaveFolder', 'Open Save Folder') +Dim $Text_SortBy = IniRead($DefaultLanguagePath, 'GuiText', 'SortBy', 'Sort By') +Dim $Text_SortDirection = IniRead($DefaultLanguagePath, 'GuiText', 'SortDirection', 'Sort Direction') +Dim $Text_Auto = IniRead($DefaultLanguagePath, 'GuiText', 'Auto', 'Auto') +Dim $Text_Misc = IniRead($DefaultLanguagePath, 'GuiText', 'Misc', 'Misc') +Dim $Text_Gps = IniRead($DefaultLanguagePath, 'GuiText', 'GPS', 'GPS') +Dim $Text_Labels = IniRead($DefaultLanguagePath, 'GuiText', 'Labels', 'Labels') +Dim $Text_Manufacturers = IniRead($DefaultLanguagePath, 'GuiText', 'Manufacturers', 'Manufacturers') +Dim $Text_Columns = IniRead($DefaultLanguagePath, 'GuiText', 'Columns', 'Columns') +Dim $Text_Language = IniRead($DefaultLanguagePath, 'GuiText', 'Language', 'Language') +Dim $Text_SearchWords = IniRead($DefaultLanguagePath, 'GuiText', 'SearchWords', 'SearchWords') +Dim $Text_VistumblerSettings = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerSettings', 'Vistumbler Settings') +Dim $Text_LanguageAuthor = IniRead($DefaultLanguagePath, 'GuiText', 'LanguageAuthor', 'Language Author') +Dim $Text_LanguageDate = IniRead($DefaultLanguagePath, 'GuiText', 'LanguageDate', 'Language Date') +Dim $Text_LanguageDescription = IniRead($DefaultLanguagePath, 'GuiText', 'LanguageDescription', 'Language Description') +Dim $Text_Description = IniRead($DefaultLanguagePath, 'GuiText', 'Description', 'Description') +Dim $Text_Progress = IniRead($DefaultLanguagePath, 'GuiText', 'Progress', 'Progress') +Dim $Text_LinesMin = IniRead($DefaultLanguagePath, 'GuiText', 'LinesMin', 'Lines/Min') +Dim $Text_NewAPs = IniRead($DefaultLanguagePath, 'GuiText', 'NewAPs', 'New APs') +Dim $Text_NewGIDs = IniRead($DefaultLanguagePath, 'GuiText', 'NewGIDs', 'New GIDs') +Dim $Text_Minutes = IniRead($DefaultLanguagePath, 'GuiText', 'Minutes', 'Minutes') +Dim $Text_LineTotal = IniRead($DefaultLanguagePath, 'GuiText', 'LineTotal', 'Line/Total') +Dim $Text_EstimatedTimeRemaining = IniRead($DefaultLanguagePath, 'GuiText', 'EstimatedTimeRemaining', 'Estimated Time Remaining') +Dim $Text_Ready = IniRead($DefaultLanguagePath, 'GuiText', 'Ready', 'Ready') +Dim $Text_Done = IniRead($DefaultLanguagePath, 'GuiText', 'Done', 'Done') +Dim $Text_VistumblerSaveDirectory = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerSaveDirectory', 'Vistumbler Save Directory') +Dim $Text_VistumblerAutoSaveDirectory = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerAutoSaveDirectory', 'Vistumbler Auto Save Directory') +Dim $Text_VistumblerAutoRecoverySaveDirectory = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerAutoRecoverySaveDirectory', 'Vistumbler Auto Recovery Save Directory') +Dim $Text_VistumblerKmlSaveDirectory = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerKmlSaveDirectory', 'Vistumbler KML Save Directory') +Dim $Text_BackgroundColor = IniRead($DefaultLanguagePath, 'GuiText', 'BackgroundColor', 'Background Color') +Dim $Text_ControlColor = IniRead($DefaultLanguagePath, 'GuiText', 'ControlColor', 'Control Color') +Dim $Text_BgFontColor = IniRead($DefaultLanguagePath, 'GuiText', 'BgFontColor', 'Font Color') +Dim $Text_ConFontColor = IniRead($DefaultLanguagePath, 'GuiText', 'ConFontColor', 'Control Font Color') +Dim $Text_NetshMsg = IniRead($DefaultLanguagePath, 'GuiText', 'NetshMsg', 'This section allows you to change the words Vistumbler uses to search netsh. Change to the proper words for you version of windows. Run "netsh wlan show networks mode = bssid" to find the proper words.') +Dim $Text_PHPgraphing = IniRead($DefaultLanguagePath, 'GuiText', 'PHPgraphing', 'PHP Graphing') +Dim $Text_ComInterface = IniRead($DefaultLanguagePath, 'GuiText', 'ComInterface', 'Com Interface') +Dim $Text_ComSettings = IniRead($DefaultLanguagePath, 'GuiText', 'ComSettings', 'Com Settings') +Dim $Text_Com = IniRead($DefaultLanguagePath, 'GuiText', 'Com', 'Com') +Dim $Text_Baud = IniRead($DefaultLanguagePath, 'GuiText', 'Baud', 'Baud') +Dim $Text_GPSFormat = IniRead($DefaultLanguagePath, 'GuiText', 'GPSFormat', 'GPS Format') +Dim $Text_HideOtherGpsColumns = IniRead($DefaultLanguagePath, 'GuiText', 'HideOtherGpsColumns', 'Hide Other GPS Columns') +Dim $Text_ImportLanguageFile = IniRead($DefaultLanguagePath, 'GuiText', 'ImportLanguageFile', 'Import Language File') +Dim $Text_ExportSettings = IniRead($DefaultLanguagePath, 'GuiText', 'ExportSettings', 'Export Settings') +Dim $Text_ImportSettings = IniRead($DefaultLanguagePath, 'GuiText', 'ImportSettings', 'Import Settings') +Dim $Text_AutoKml = IniRead($DefaultLanguagePath, 'GuiText', 'AutoKml', 'Auto KML') +Dim $Text_GoogleEarthEXE = IniRead($DefaultLanguagePath, 'GuiText', 'GoogleEarthEXE', 'Google Earth EXE') +Dim $Text_AutoSaveKmlEvery = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveKmlEvery', 'Auto Save KML Every') +Dim $Text_SavedAs = IniRead($DefaultLanguagePath, 'GuiText', 'SavedAs', 'Saved As') +Dim $Text_Overwrite = IniRead($DefaultLanguagePath, 'GuiText', 'Overwrite', 'Overwrite') +Dim $Text_InstallNetcommOCX = IniRead($DefaultLanguagePath, 'GuiText', 'InstallNetcommOCX', 'Install Netcomm OCX') +Dim $Text_NoFileSaved = IniRead($DefaultLanguagePath, 'GuiText', 'NoFileSaved', 'No file has been saved') +Dim $Text_NoApsWithGps = IniRead($DefaultLanguagePath, 'GuiText', 'NoApsWithGps', 'No access points found with gps coordinates.') +Dim $Text_NoAps = IniRead($DefaultLanguagePath, 'GuiText', 'NoAps', 'No access points.') +Dim $Text_MacExistsOverwriteIt = IniRead($DefaultLanguagePath, 'GuiText', 'MacExistsOverwriteIt', 'A entry for this mac address already exists. would you like to overwrite it?') +Dim $Text_SavingLine = IniRead($DefaultLanguagePath, 'GuiText', 'SavingLine', 'Saving Line') +Dim $Text_Debug = IniRead($DefaultLanguagePath, 'GuiText', 'Debug', 'Debug') +Dim $Text_DisplayDebug = IniRead($DefaultLanguagePath, 'GuiText', 'DisplayDebug', 'Display Functions') +Dim $Text_DisplayComErrors = IniRead($DefaultLanguagePath, 'GuiText', 'DisplayDebugCom', 'Display COM Errors') +Dim $Text_GraphDeadTime = IniRead($DefaultLanguagePath, 'GuiText', 'GraphDeadTime', 'Graph Dead Time') +Dim $Text_OpenKmlNetLink = IniRead($DefaultLanguagePath, 'GuiText', 'OpenKmlNetLink', 'Open KML NetworkLink') +Dim $Text_ActiveRefreshTime = IniRead($DefaultLanguagePath, 'GuiText', 'ActiveRefreshTime', 'Active Refresh Time') +Dim $Text_DeadRefreshTime = IniRead($DefaultLanguagePath, 'GuiText', 'DeadRefreshTime', 'Dead Refresh Time') +Dim $Text_GpsRefrshTime = IniRead($DefaultLanguagePath, 'GuiText', 'GpsRefrshTime', 'Gps Refrsh Time') +Dim $Text_FlyToSettings = IniRead($DefaultLanguagePath, 'GuiText', 'FlyToSettings', 'Fly To Settings') +Dim $Text_FlyToCurrentGps = IniRead($DefaultLanguagePath, 'GuiText', 'FlyToCurrentGps', 'Fly to current gps position') +Dim $Text_AltitudeMode = IniRead($DefaultLanguagePath, 'GuiText', 'AltitudeMode', 'Altitude Mode') +Dim $Text_Range = IniRead($DefaultLanguagePath, 'GuiText', 'Range', 'Range') +Dim $Text_Heading = IniRead($DefaultLanguagePath, 'GuiText', 'Heading', 'Heading') +Dim $Text_Tilt = IniRead($DefaultLanguagePath, 'GuiText', 'Tilt', 'Tilt') +Dim $Text_AutoOpenNetworkLink = IniRead($DefaultLanguagePath, 'GuiText', 'AutoOpenNetworkLink', 'Automatically Open KML Network Link') +Dim $Text_SpeakSignal = IniRead($DefaultLanguagePath, 'GuiText', 'SpeakSignal', 'Speak Signal') +Dim $Text_SpeakUseVisSounds = IniRead($DefaultLanguagePath, 'GuiText', 'SpeakUseVisSounds', 'Use Vistumbler Sound Files') +Dim $Text_SpeakUseSapi = IniRead($DefaultLanguagePath, 'GuiText', 'SpeakUseSapi', 'Use Microsoft Sound API') +Dim $Text_SpeakSayPercent = IniRead($DefaultLanguagePath, 'GuiText', 'SpeakSayPercent', 'Say "Percent" after signal') +Dim $Text_GpsTrackTime = IniRead($DefaultLanguagePath, 'GuiText', 'GpsTrackTime', 'Track Refresh Time') +Dim $Text_SaveAllGpsData = IniRead($DefaultLanguagePath, 'GuiText', 'SaveAllGpsData', 'Save GPS data when no APs are active') +Dim $Text_None = IniRead($DefaultLanguagePath, 'GuiText', 'None', 'None') +Dim $Text_Even = IniRead($DefaultLanguagePath, 'GuiText', 'Even', 'Even') +Dim $Text_Odd = IniRead($DefaultLanguagePath, 'GuiText', 'Odd', 'Odd') +Dim $Text_Mark = IniRead($DefaultLanguagePath, 'GuiText', 'Mark', 'Mark') +Dim $Text_Space = IniRead($DefaultLanguagePath, 'GuiText', 'Space', 'Space') +Dim $Text_StopBit = IniRead($DefaultLanguagePath, 'GuiText', 'StopBit', 'Stop Bit') +Dim $Text_Parity = IniRead($DefaultLanguagePath, 'GuiText', 'Parity', 'Parity') +Dim $Text_DataBit = IniRead($DefaultLanguagePath, 'GuiText', 'DataBit', 'Data Bit') +Dim $Text_Update = IniRead($DefaultLanguagePath, 'GuiText', 'Update', 'Update') +Dim $Text_UpdateMsg = IniRead($DefaultLanguagePath, 'GuiText', 'UpdateMsg', 'Update Found. Would you like to update vistumbler?') +Dim $Text_Recover = IniRead($DefaultLanguagePath, 'GuiText', 'Recover', 'Recover') +Dim $Text_RecoverMsg = IniRead($DefaultLanguagePath, 'GuiText', 'RecoverMsg', 'Old DB Found. Would you like to recover it?') +Dim $Text_SelectConnectedAP = IniRead($DefaultLanguagePath, 'GuiText', 'SelectConnectedAP', 'Select Connected AP') +Dim $Text_VistumblerHome = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerHome', 'Vistumbler Home') +Dim $Text_VistumblerForum = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerForum', 'Vistumbler Forum') +Dim $Text_VistumblerWiki = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerWiki', 'Vistumbler Wiki') +Dim $Text_CheckForUpdates = IniRead($DefaultLanguagePath, 'GuiText', 'CheckForUpdates', 'Check For Updates') +Dim $Text_SelectWhatToCopy = IniRead($DefaultLanguagePath, 'GuiText', 'SelectWhatToCopy', 'Select what you want to copy') +Dim $Text_Default = IniRead($DefaultLanguagePath, 'GuiText', 'Default', 'Default') +Dim $Text_PlayMidiSounds = IniRead($DefaultLanguagePath, 'GuiText', 'PlayMidiSounds', 'Play MIDI sounds for all active APs') +Dim $Text_Interface = IniRead($DefaultLanguagePath, 'GuiText', 'Interface', 'Interface') +Dim $Text_LanguageCode = IniRead($DefaultLanguagePath, 'GuiText', 'LanguageCode', 'Language Code') +Dim $Text_AutoCheckUpdates = IniRead($DefaultLanguagePath, 'GuiText', 'AutoCheckUpdates', 'Automatically Check For Updates') +Dim $Text_CheckBetaUpdates = IniRead($DefaultLanguagePath, 'GuiText', 'CheckBetaUpdates', 'Check For Beta Updates') +Dim $Text_GuessSearchwords = IniRead($DefaultLanguagePath, 'GuiText', 'GuessSearchwords', 'Guess Netsh Searchwords') +Dim $Text_Help = IniRead($DefaultLanguagePath, 'GuiText', 'Help', 'Help') +Dim $Text_ErrorScanningNetsh = IniRead($DefaultLanguagePath, 'GuiText', 'ErrorScanningNetsh', 'Error scanning netsh') +Dim $Text_GpsErrorBufferEmpty = IniRead($DefaultLanguagePath, 'GuiText', 'GpsErrorBufferEmpty', 'GPS Error. Buffer Empty for more than 10 seconds. GPS was probrably disconnected. GPS has been stopped') +Dim $Text_GpsErrorStopped = IniRead($DefaultLanguagePath, 'GuiText', 'GpsErrorStopped', 'GPS Error. GPS has been stopped') +Dim $Text_ShowSignalDB = IniRead($DefaultLanguagePath, 'GuiText', 'ShowSignalDB', 'Show Signal dB (Estimated)') +Dim $Text_SortingList = IniRead($DefaultLanguagePath, 'GuiText', 'SortingList', 'Sorting List') +Dim $Text_Loading = IniRead($DefaultLanguagePath, 'GuiText', 'Loading', 'Loading') +Dim $Text_MapOpenNetworks = IniRead($DefaultLanguagePath, 'GuiText', 'MapOpenNetworks', 'Map Open Networks') +Dim $Text_MapWepNetworks = IniRead($DefaultLanguagePath, 'GuiText', 'MapWepNetworks', 'Map WEP Networks') +Dim $Text_MapSecureNetworks = IniRead($DefaultLanguagePath, 'GuiText', 'MapSecureNetworks', 'Map Secure Networks') +Dim $Text_DrawTrack = IniRead($DefaultLanguagePath, 'GuiText', 'DrawTrack', 'Draw Track') +Dim $Text_UseLocalImages = IniRead($DefaultLanguagePath, 'GuiText', 'UseLocalImages', 'Use Local Images') +Dim $Text_MIDI = IniRead($DefaultLanguagePath, 'GuiText', 'MIDI', 'MIDI') +Dim $Text_MidiInstrumentNumber = IniRead($DefaultLanguagePath, 'GuiText', 'MidiInstrumentNumber', 'MIDI Instrument #') +Dim $Text_MidiPlayTime = IniRead($DefaultLanguagePath, 'GuiText', 'MidiPlayTime', 'MIDI Play Time') +Dim $Text_SpeakRefreshTime = IniRead($DefaultLanguagePath, 'GuiText', 'SpeakRefreshTime', 'Speak Refresh Time') +Dim $Text_Information = IniRead($DefaultLanguagePath, 'GuiText', 'Information', 'Information') +Dim $Text_AddedGuessedSearchwords = IniRead($DefaultLanguagePath, 'GuiText', 'AddedGuessedSearchwords', 'Added guessed netsh searchwords. Searchwords for Open, None, WEP, Infrustructure, and Adhoc will still need to be done manually') +Dim $Text_SortingTreeview = IniRead($DefaultLanguagePath, 'GuiText', 'SortingTreeview', 'Sorting Treeview') +Dim $Text_Recovering = IniRead($DefaultLanguagePath, 'GuiText', 'Recovering', 'Recovering') +Dim $Text_ErrorOpeningGpsPort = IniRead($DefaultLanguagePath, 'GuiText', 'ErrorOpeningGpsPort', 'Error opening GPS port') +Dim $Text_SecondsSinceGpsUpdate = IniRead($DefaultLanguagePath, 'GuiText', 'SecondsSinceGpsUpdate', 'Seconds Since GPS Update') +Dim $Text_SavingGID = IniRead($DefaultLanguagePath, 'GuiText', 'SavingGID', 'Saving GID') +Dim $Text_SavingHistID = IniRead($DefaultLanguagePath, 'GuiText', 'SavingHistID', 'Saving HistID') +Dim $Text_NoUpdates = IniRead($DefaultLanguagePath, 'GuiText', 'NoUpdates', 'No Updates Avalible') +Dim $Text_NoActiveApFound = IniRead($DefaultLanguagePath, 'GuiText', 'NoActiveApFound', 'No Active AP found') +Dim $Text_VistumblerDonate = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerDonate', 'Donate') +Dim $Text_VistumblerStore = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerStore', 'Store') +Dim $Text_SupportVistumbler = IniRead($DefaultLanguagePath, 'GuiText', 'SupportVistumbler', '*Support Vistumbler*') +Dim $Text_UseNativeWifiMsg = IniRead($DefaultLanguagePath, 'GuiText', 'UseNativeWifiMsg', 'Use Native Wifi') +Dim $Text_UseNativeWifiXpExtMsg = IniRead($DefaultLanguagePath, 'GuiText', 'UseNativeWifiXpExtMsg', '(No BSSID, CHAN, OTX, BTX)') + +Dim $Text_FilterMsg = IniRead($DefaultLanguagePath, 'GuiText', 'FilterMsg', 'Use asterik(*) for all. Seperate multiple filters with a comma(,). Use a dash(-) for ranges. Mac address field supports like with percent(%) as a wildcard. SSID field uses backslash(\) to escape control characters.') +Dim $Text_SetFilters = IniRead($DefaultLanguagePath, 'GuiText', 'SetFilters', 'Set Filters') +Dim $Text_Filtered = IniRead($DefaultLanguagePath, 'GuiText', 'Filtered', 'Filtered') +Dim $Text_Filters = IniRead($DefaultLanguagePath, 'GuiText', 'Filters', 'Filters') +Dim $Text_FilterName = IniRead($DefaultLanguagePath, 'GuiText', 'FilterName', 'Filter Name') +Dim $Text_FilterDesc = IniRead($DefaultLanguagePath, 'GuiText', 'FilterDesc', 'Filter Description') +Dim $Text_FilterAddEdit = IniRead($DefaultLanguagePath, 'GuiText', 'FilterAddEdit', 'Add/Edit Filter') +Dim $Text_NoAdaptersFound = IniRead($DefaultLanguagePath, 'GuiText', 'NoAdaptersFound', 'No Adapters Found') +Dim $Text_RecoveringMDB = IniRead($DefaultLanguagePath, 'GuiText', 'RecoveringMDB', 'Recovering MDB') +Dim $Text_FixingGpsTableDates = IniRead($DefaultLanguagePath, 'GuiText', 'FixingGpsTableDates', 'Fixing GPS table date(s)') +Dim $Text_FixingGpsTableTimes = IniRead($DefaultLanguagePath, 'GuiText', 'FixingGpsTableTimes', 'Fixing GPS table times(s)') +Dim $Text_FixingHistTableDates = IniRead($DefaultLanguagePath, 'GuiText', 'FixingHistTableDates', 'Fixing HIST table date(s)') +Dim $Text_VistumblerNeedsToRestart = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerNeedsToRestart', 'Vistumbler needs to be restarted. Vistumbler will now close') +Dim $Text_AddingApsIntoList = IniRead($DefaultLanguagePath, 'GuiText', 'AddingApsIntoList', 'Adding new APs into list') +Dim $Text_GoogleEarthDoesNotExist = IniRead($DefaultLanguagePath, 'GuiText', 'GoogleEarthDoesNotExist', 'Google earth file does not exist or is set wrong in the AutoKML settings') +Dim $Text_AutoKmlIsNotStarted = IniRead($DefaultLanguagePath, 'GuiText', 'AutoKmlIsNotStarted', 'AutoKML is not yet started. Would you like to turn it on now?') +Dim $Text_UseKernel32 = IniRead($DefaultLanguagePath, 'GuiText', 'UseKernel32', 'Use Kernel32 - x32 - x64') +Dim $Text_UnableToGuessSearchwords = IniRead($DefaultLanguagePath, 'GuiText', 'UnableToGuessSearchwords', 'Vistumbler was unable to guess searchwords') +Dim $Text_SelectedAP = IniRead($DefaultLanguagePath, 'GuiText', 'SelectedAP', 'Selected AP') +Dim $Text_AllAPs = IniRead($DefaultLanguagePath, 'GuiText', 'AllAPs', 'All APs') +Dim $Text_FilteredAPs = IniRead($DefaultLanguagePath, 'GuiText', 'FilteredAPs', 'Filtered APs') +Dim $Text_ImportFolder = IniRead($DefaultLanguagePath, 'GuiText', 'ImportFolder', 'Import Folder') +Dim $Text_DeleteSelected = IniRead($DefaultLanguagePath, 'GuiText', 'DeleteSelected', 'Delete Selected') +Dim $Text_RecoverSelected = IniRead($DefaultLanguagePath, 'GuiText', 'RecoverSelected', 'Recover Selected') +Dim $Text_NewSession = IniRead($DefaultLanguagePath, 'GuiText', 'NewSession', 'New Session') +Dim $Text_Size = IniRead($DefaultLanguagePath, 'GuiText', 'Size', 'Size') +Dim $Text_NoMdbSelected = IniRead($DefaultLanguagePath, 'GuiText', 'NoMdbSelected', 'No MDB Selected') +Dim $Text_LocateInWiFiDB = IniRead($DefaultLanguagePath, 'GuiText', 'LocateInWiFiDB', 'Locate Position in WiFiDB') +Dim $Text_AutoWiFiDbGpsLocate = IniRead($DefaultLanguagePath, 'GuiText', 'AutoWiFiDbGpsLocate', 'Auto WiFiDB Gps Locate') +Dim $Text_AutoWiFiDbUploadAps = IniRead($DefaultLanguagePath, 'GuiText', 'AutoWiFiDbUploadAps', 'Auto WiFiDB Upload Active AP') +Dim $Text_AutoSelectConnectedAP = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSelectConnectedAP', 'Auto Select Connected AP') +Dim $Text_AutoSelectHighSignal = IniRead($DefaultLanguagePath, "GuiText", 'AutoSelectHighSigAP', 'Auto Select Highest Signal AP') +Dim $Text_Experimental = IniRead($DefaultLanguagePath, 'GuiText', 'Experimental', 'Experimental') +Dim $Text_Color = IniRead($DefaultLanguagePath, 'GuiText', 'Color', 'Color') +Dim $Text_AddRemFilters = IniRead($DefaultLanguagePath, "GuiText", "AddRemFilters", "Add/Remove Filters") +Dim $Text_NoFilterSelected = IniRead($DefaultLanguagePath, "GuiText", "NoFilterSelected", "No filter selected.") +Dim $Text_AddFilter = IniRead($DefaultLanguagePath, "GuiText", "AddFilter", "Add Filter") +Dim $Text_EditFilter = IniRead($DefaultLanguagePath, "GuiText", "EditFilter ", "Edit Filter ") +Dim $Text_DeleteFilter = IniRead($DefaultLanguagePath, "GuiText", "DeleteFilter", "Delete Filter") +Dim $Text_TimeBeforeMarkedDead = IniRead($DefaultLanguagePath, "GuiText", "TimeBeforeMarkedDead", "Time to wait before marking AP dead (s)") +Dim $Text_FilterNameRequired = IniRead($DefaultLanguagePath, "GuiText", "FilterNameRequired", "Filter Name is required") +Dim $Text_UpdateManufacturers = IniRead($DefaultLanguagePath, "GuiText", "UpdateManufacturers", "Update Manufacturers") +Dim $Text_FixHistSignals = IniRead($DefaultLanguagePath, "GuiText", "FixHistSignals", "Fixing Missing Hist Table Signal(s)") +Dim $Text_VistumblerFile = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerFile', 'Vistumbler file') +Dim $Text_DetailedCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'DetailedFile', 'Detailed Comma Delimited file') +Dim $Text_SummaryCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'SummaryFile', 'Summary Comma Delimited file') +Dim $Text_NetstumblerTxtFile = IniRead($DefaultLanguagePath, 'GuiText', 'NetstumblerTxtFile', 'Netstumbler wi-scan file') +Dim $Text_WardriveDb3File = IniRead($DefaultLanguagePath, "GuiText", "WardriveDb3File", "Wardrive-android file") +Dim $Text_AutoScanApsOnLaunch = IniRead($DefaultLanguagePath, "GuiText", "AutoScanApsOnLaunch", "Auto Scan APs on launch") +Dim $Text_RefreshInterfaces = IniRead($DefaultLanguagePath, "GuiText", "RefreshInterfaces", "Refresh Interfaces") +Dim $Text_Sound = IniRead($DefaultLanguagePath, 'GuiText', 'Sound', 'Sound') +Dim $Text_OncePerLoop = IniRead($DefaultLanguagePath, 'GuiText', 'OncePerLoop', 'Once per loop') +Dim $Text_OncePerAP = IniRead($DefaultLanguagePath, 'GuiText', 'OncePerAP', 'Once per ap') +Dim $Text_OncePerAPwSound = IniRead($DefaultLanguagePath, 'GuiText', 'OncePerAPwSound', 'Once per ap with volume based on signal') +Dim $Text_WifiDB = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDB', 'WifiDB') +Dim $Text_Warning = IniRead($DefaultLanguagePath, 'GuiText', 'Warning', 'Warning') +Dim $Text_WifiDBLocateWarning = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDBLocateWarning', 'This feature sends active access point information to the WifiDB API URL specified in the Vistumbler WifiDB Settings. If you do not want to send data to the wifidb, do not enable this feature. Do you want to continue to enable this feature?') +Dim $Text_WifiDBAutoUploadWarning = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDBAutoUploadWarning', 'This feature sends active access point information to the WifiDB API URL specified in the Vistumbler WifiDB Settings. If you do not want to send data to the wifidb, do not enable this feature. Do you want to continue to enable this feature?') +Dim $Text_WifiDBOpenLiveAPWebpage = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDBOpenLiveAPWebpage', 'Open WifiDB Live AP Webpage') +Dim $Text_WifiDBOpenMainWebpage = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDBOpenMainWebpage', 'Open WifiDB Main Webpage') +Dim $Text_FilePath = IniRead($DefaultLanguagePath, 'GuiText', 'FilePath', 'File Path') +Dim $Text_CameraName = IniRead($DefaultLanguagePath, 'GuiText', 'CameraName', 'Camera Name') +Dim $Text_CameraURL = IniRead($DefaultLanguagePath, 'GuiText', 'CameraURL', 'Camera URL') +Dim $Text_Cameras = IniRead($DefaultLanguagePath, 'GuiText', 'Cameras', 'Camera(s)') +Dim $Text_AddCamera = IniRead($DefaultLanguagePath, 'GuiText', 'AddCamera', 'Add Camera') +Dim $Text_RemoveCamera = IniRead($DefaultLanguagePath, 'GuiText', 'RemoveCamera', 'Remove Camera') +Dim $Text_EditCamera = IniRead($DefaultLanguagePath, 'GuiText', 'EditCamera', 'Edit Camera') +Dim $Text_DownloadImages = IniRead($DefaultLanguagePath, 'GuiText', 'DownloadImages', 'Download Images') +Dim $Text_EnableCamTriggerScript = IniRead($DefaultLanguagePath, 'GuiText', 'EnableCamTriggerScript', 'Enable camera trigger script') +Dim $Text_PortableMode = IniRead($DefaultLanguagePath, 'GuiText', 'PortableMode', 'Portable Mode') +Dim $Text_CameraTriggerScript = IniRead($DefaultLanguagePath, 'GuiText', 'CameraTriggerScript', 'Camera Trigger Script') +Dim $Text_CameraTriggerScriptTypes = IniRead($DefaultLanguagePath, 'GuiText', 'CameraTriggerScriptTypes', 'Camera Trigger Script (exe,bat)') +Dim $Text_SetCameras = IniRead($DefaultLanguagePath, 'GuiText', 'SetCameras', 'Set Cameras') +Dim $Text_UpdateUpdaterMsg = IniRead($DefaultLanguagePath, 'GuiText', 'UpdateUpdaterMsg', 'There is an update to the vistumbler updater. Would you like to download and update it now?') +Dim $Text_UseRssiInGraphs = IniRead($DefaultLanguagePath, 'GuiText', 'UseRssiInGraphs', 'Use RSSI in graphs') +Dim $Text_2400ChannelGraph = IniRead($DefaultLanguagePath, 'GuiText', '2400ChannelGraph', '2.4Ghz Channel Graph') +Dim $Text_5000ChannelGraph = IniRead($DefaultLanguagePath, 'GuiText', '5000ChannelGraph', '5Ghz Channel Graph') +Dim $Text_UpdateGeolocations = IniRead($DefaultLanguagePath, 'GuiText', 'UpdateGeolocations', 'Update Geolocations') +Dim $Text_ShowGpsPositionMap = IniRead($DefaultLanguagePath, 'GuiText', 'ShowGpsPositionMap', 'Show GPS Position Map') +Dim $Text_ShowGpsSignalMap = IniRead($DefaultLanguagePath, 'GuiText', 'ShowGpsSignalMap', 'Show GPS Signal Map') +Dim $Text_UseRssiSignalValue = IniRead($DefaultLanguagePath, 'GuiText', 'UseRssiSignalValue', 'Use RSSI signal values') +Dim $Text_UseCircleToShowSigStength = IniRead($DefaultLanguagePath, 'GuiText', 'UseCircleToShowSigStength', 'Use circle to show signal strength') +Dim $Text_ShowGpsRangeMap = IniRead($DefaultLanguagePath, 'GuiText', 'ShowGpsRangeMap', 'Show GPS Range Map') +Dim $Text_ShowGpsTack = IniRead($DefaultLanguagePath, 'GuiText', 'ShowGpsTack', 'Show GPS Track') +Dim $Text_Line = IniRead($DefaultLanguagePath, 'GuiText', 'Line', 'Line') +Dim $Text_Total = IniRead($DefaultLanguagePath, 'GuiText', 'Total', 'Total') +Dim $Text_WifiDB_Upload_Discliamer = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDB_Upload_Discliamer', 'This feature uploads access points to the WifiDB. a file will be generated and uploaded to the WifiDB API URL specified in the Vistumbler WifiDB Settings.') +Dim $Text_UserInformation = IniRead($DefaultLanguagePath, 'GuiText', 'UserInformation', 'User Information') +Dim $Text_WifiDB_Username = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDB_Username', 'WifiDB Username') +Dim $Text_WifiDB_Api_Key = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDB_Api_Key', 'WifiDB Api Key') +Dim $Text_OtherUsers = IniRead($DefaultLanguagePath, 'GuiText', 'OtherUsers', 'Other users') +Dim $Text_FileType = IniRead($DefaultLanguagePath, 'GuiText', 'FileType', 'File Type') +Dim $Text_VistumblerVSZ = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerVSZ', 'Vistumbler VSZ') +Dim $Text_VistumblerVS1 = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerVS1', 'Vistumbler VS1') +Dim $Text_VistumblerCSV = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerCSV', 'Vistumbler Detailed CSV') +Dim $Text_UploadInformation = IniRead($DefaultLanguagePath, 'GuiText', 'UploadInformation', 'Upload Information') +Dim $Text_Title = IniRead($DefaultLanguagePath, 'GuiText', 'Title', 'Title') +Dim $Text_Notes = IniRead($DefaultLanguagePath, 'GuiText', 'Notes', 'Notes') +Dim $Text_UploadApsToWifidb = IniRead($DefaultLanguagePath, 'GuiText', 'UploadApsToWifidb', 'Upload APs to WifiDB') +Dim $Text_UploadingApsToWifidb = IniRead($DefaultLanguagePath, 'GuiText', 'UploadingApsToWifidb', 'Uploading APs to WifiDB') +Dim $Text_GeoNamesInfo = IniRead($DefaultLanguagePath, 'GuiText', 'GeoNamesInfo', 'Geonames Info') +Dim $Text_FindApInWifidb = IniRead($DefaultLanguagePath, 'GuiText', 'FindApInWifidb', 'Find AP in WifiDB') +Dim $Text_GpsDisconnect = IniRead($DefaultLanguagePath, 'GuiText', 'GpsDisconnect', 'Disconnect GPS when no data is received in over 10 seconds') +Dim $Text_GpsReset = IniRead($DefaultLanguagePath, 'GuiText', 'GpsReset', 'Reset GPS position when no GPGGA data is received in over 30 seconds') +Dim $Text_APs = IniRead($DefaultLanguagePath, 'GuiText', 'APs', 'APs') +Dim $Text_MaxSignal = IniRead($DefaultLanguagePath, 'GuiText', 'MaxSignal', 'Max Signal') +Dim $Text_DisassociationSignal = IniRead($DefaultLanguagePath, 'GuiText', 'DisassociationSignal', 'Disassociation Signal') +Dim $Text_SaveDirectories = IniRead($DefaultLanguagePath, 'GuiText', 'SaveDirectories', 'Save Directories') +Dim $Text_AutoSaveAndClearAfterNumberofAPs = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveAndClearAfterNumberofAPs', 'Auto Save And Clear After Number of APs') +Dim $Text_AutoSaveandClearAfterTime = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveandClearAfterTime', 'Auto Save and Clear After Time') +Dim $Text_PlaySoundWhenSaving = IniRead($DefaultLanguagePath, 'GuiText', 'PlaySoundWhenSaving', 'Play Sound When Saving') +Dim $Text_MinimalGuiMode = IniRead($DefaultLanguagePath, 'GuiText', 'MinimalGuiMode', 'Minimal GUI Mode') +Dim $Text_AutoScrollToBottom = IniRead($DefaultLanguagePath, 'GuiText', 'AutoScrollToBottom', 'Auto Scroll to Bottom of List') +Dim $Text_ListviewBatchInsertMode = IniRead($DefaultLanguagePath, 'GuiText', 'ListviewBatchInsertMode', 'Listview Batch Insert Mode') +Dim $Text_ExportVistumblerSettings = IniRead($DefaultLanguagePath, 'GuiText', 'ExportVistumblerSettings', 'Export Vistumbler Settings') +Dim $Text_ImportVistumblerSettings = IniRead($DefaultLanguagePath, 'GuiText', 'ImportVistumblerSettings', 'Import Vistumbler Settings') +Dim $Text_ErrorSavingFile = IniRead($DefaultLanguagePath, 'GuiText', 'ErrorSavingFile', 'Error Saving File') +Dim $Text_ErrorImportingFile = IniRead($DefaultLanguagePath, 'GuiText', 'ErrorImportingFile', 'Error Importing File') +Dim $Text_SettingsImportedSuccess = IniRead($DefaultLanguagePath, 'GuiText', 'SettingsImportedSuccess', 'Settings Imported Successfully. Please restart Vistumbler to apply the new settings.') +Dim $Text_ButtonActiveColor = IniRead($DefaultLanguagePath, 'GuiText', 'ButtonActiveColor', 'Button Active Color') +Dim $Text_ButtonInactiveColor = IniRead($DefaultLanguagePath, 'GuiText', 'ButtonInactiveColor', 'Button Inactive Color') +Dim $Text_Text = IniRead($DefaultLanguagePath, 'GuiText', 'Text', 'Text') +Dim $Text_GUITextSize = IniRead($DefaultLanguagePath, 'GuiText', 'GUITextSize', 'GUI Text Size') + +If $AutoCheckForUpdates = 1 Then + If _CheckForUpdates() = 1 Then + $updatemsg = MsgBox(4, $Text_Update, $Text_UpdateMsg) + If $updatemsg = 6 Then _StartUpdate() + EndIf +EndIf + +Dim $MDBfiles[1][4] +$MDBfiles[0][0] = 0 +;Add MDB Files from temp dir +$tempMDB = _FileListToArray($TmpDir, '*.MDB', 1) ;Find all files in the folder that end in .MDB +If IsArray($tempMDB) Then + For $af = 1 To $tempMDB[0] + $mdbfile = $tempMDB[$af] + If _FileInUse($TmpDir & $mdbfile) = 0 Then + ReDim $MDBfiles[UBound($MDBfiles) + 1][4] + $ArraySize = UBound($MDBfiles) - 1 + $MDBfiles[0][0] = $ArraySize ;Array Size + $MDBfiles[$ArraySize][0] = $ArraySize ;ID + $MDBfiles[$ArraySize][1] = $mdbfile ;File Name + $MDBfiles[$ArraySize][2] = $TmpDir & $mdbfile ;File Path + $MDBfiles[$ArraySize][3] = (FileGetSize($TmpDir & $mdbfile) / 1024) & 'kb' + EndIf + Next +EndIf +;Add MDB Files from save dir +$saveMDB = _FileListToArray($SaveDir, '*.MDB', 1) ;Find all files in the folder that end in .MDB +If IsArray($saveMDB) Then + For $af = 1 To $saveMDB[0] + $mdbfile = $saveMDB[$af] + If _FileInUse($SaveDir & $mdbfile) = 0 Then + ReDim $MDBfiles[UBound($MDBfiles) + 1][4] + $ArraySize = UBound($MDBfiles) - 1 + $MDBfiles[0][0] = $ArraySize ;Array Size + $MDBfiles[$ArraySize][0] = $ArraySize ;ID + $MDBfiles[$ArraySize][1] = $mdbfile ;File Name + $MDBfiles[$ArraySize][2] = $SaveDir & $mdbfile ;File Path + $MDBfiles[$ArraySize][3] = (FileGetSize($SaveDir & $mdbfile) / 1024) & 'kb' + EndIf + Next +EndIf +;Show MDB Recover GUI if MDB files exist +If $MDBfiles[0][0] > 0 Then + Opt("GUIOnEventMode", 0) + $FoundMdbFile = 0 + $RecoverMdbGui = GUICreate($Text_RecoverMsg, 461, 210, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) + GUISetBkColor($BackgroundColor) + $Recover_Del = GUICtrlCreateButton($Text_DeleteSelected, 10, 150, 215, 25) + $Recover_Rec = GUICtrlCreateButton($Text_RecoverSelected, 235, 150, 215, 25) + $Recover_Exit = GUICtrlCreateButton($Text_Exit, 10, 180, 215, 25) + $Recover_New = GUICtrlCreateButton($Text_NewSession, 235, 180, 215, 25) + $Recover_List = GUICtrlCreateListView(StringReplace($Text_File, '&', '') & "|" & $Text_Size & "|" & $Text_FilePath, 10, 8, 440, 136, $LVS_REPORT + $LVS_SINGLESEL, $LVS_EX_HEADERDRAGDROP + $LVS_EX_GRIDLINES + $LVS_EX_FULLROWSELECT) + _GUICtrlListView_SetColumnWidth($Recover_List, 0, 335) + _GUICtrlListView_SetColumnWidth($Recover_List, 1, 100) + _GUICtrlListView_SetColumnWidth($Recover_List, 2, 600) + GUICtrlSetBkColor(-1, $ControlBackgroundColor) + For $FoundMDB = 1 To $MDBfiles[0][0] + $mdbfile = $MDBfiles[$FoundMDB][1] + $mdbpath = $MDBfiles[$FoundMDB][2] + $mdbsize = $MDBfiles[$FoundMDB][3] + $ListRow = _GUICtrlListView_InsertItem($Recover_List, "", 0) + _GUICtrlListView_SetItemText($Recover_List, $ListRow, $mdbfile, 0) + _GUICtrlListView_SetItemText($Recover_List, $ListRow, $mdbsize, 1) + _GUICtrlListView_SetItemText($Recover_List, $ListRow, $mdbpath, 2) + Next + GUISetState(@SW_SHOW) + While 1 + $nMsg = GUIGetMsg() + Switch $nMsg + Case $GUI_EVENT_CLOSE + $VistumblerDB = $TmpDir & $ldatetimestamp & '.mdb' + $VistumblerDbName = $ldatetimestamp & '.mdb' + $VistumblerCamFolder = $TmpDir & $ldatetimestamp & '\' + ExitLoop + Case $Recover_New + $VistumblerDB = $TmpDir & $ldatetimestamp & '.mdb' + $VistumblerDbName = $ldatetimestamp & '.mdb' + $VistumblerCamFolder = $TmpDir & $ldatetimestamp & '\' + ExitLoop + Case $Recover_Exit + Exit + Case $Recover_Rec + $Selected = _GUICtrlListView_GetNextItem($Recover_List) ; find what AP is selected in the list. returns -1 is nothing is selected + If $Selected = '-1' Then + MsgBox(0, $Text_Error, $Text_NoMdbSelected) + Else + $VistumblerDbName = _GUICtrlListView_GetItemText($Recover_List, $Selected, 0) + $VistumblerDB = _GUICtrlListView_GetItemText($Recover_List, $Selected, 2) + $VistumblerCamFolder = StringTrimRight($VistumblerDB, 4) & '\' + ;If this MDB/ZIP is not in the temp folder, move it there and rename it + $mdbfolder = StringTrimRight($VistumblerDB, (StringLen($VistumblerDB) - StringInStr($VistumblerDB, "\", 1, -1))) + If $mdbfolder <> $TmpDir Then + $OldVistumblerDB = $VistumblerDB + $VistumblerDB = _TempFile($TmpDir, StringTrimRight($VistumblerDbName, 4) & "__", ".mdb", 4) + $VistumblerDbName = StringTrimLeft($VistumblerDB, StringInStr($VistumblerDB, "\", 1, -1)) + FileCopy($OldVistumblerDB, $VistumblerDB, 9) + $OldVistumblerCamFolder = StringTrimRight($OldVistumblerDB, 4) & '\' + $VistumblerCamFolder = StringTrimRight($VistumblerDB, 4) & '\' + DirCopy($OldVistumblerCamFolder, $VistumblerCamFolder, 1) + EndIf + ExitLoop + EndIf + Case $Recover_Del + $Selected = _GUICtrlListView_GetNextItem($Recover_List) ; find what AP is selected in the list. returns -1 is nothing is selected + If $Selected = '-1' Then + MsgBox(0, $Text_Error, $Text_NoMdbSelected) + Else + $db_fullpath = _GUICtrlListView_GetItemText($Recover_List, $Selected, 2) + FileDelete($db_fullpath) + $folder_fullpath = StringTrimRight($db_fullpath, 4) & '\' + DirRemove($folder_fullpath, 1) + _GUICtrlListView_DeleteItem(GUICtrlGetHandle($Recover_List), $Selected) + EndIf + EndSwitch + WEnd + GUIDelete($RecoverMdbGui) + Opt("GUIOnEventMode", 1) +Else + $VistumblerDB = $TmpDir & $ldatetimestamp & '.mdb' + $VistumblerDbName = $ldatetimestamp & '.mdb' + $VistumblerCamFolder = $TmpDir & $ldatetimestamp & '\' +EndIf + +;ConsoleWrite($VistumblerDB & @CRLF) +;ConsoleWrite($VistumblerCamFolder & @CRLF) + + +If FileExists($VistumblerDB) Then + _AccessConnectConn($VistumblerDB, $DB_OBJ) + $Recover = 1 +Else + _SetUpDbTables($VistumblerDB) +EndIf + +If Not FileExists($VistumblerCamFolder) Then + DirCreate($VistumblerCamFolder) +EndIf + +;Connect to manufacturer database +If FileExists($ManuDB) Then + _AccessConnectConn($ManuDB, $ManuDB_OBJ) +Else + _CreateDB($ManuDB) + _AccessConnectConn($ManuDB, $ManuDB_OBJ) + _CreateTable($ManuDB, 'Manufacturers', $ManuDB_OBJ) + _CreatMultipleFields($ManuDB, 'Manufacturers', $ManuDB_OBJ, 'BSSID TEXT(6)|Manufacturer TEXT(255)') +EndIf +;Connect to label database +If FileExists($LabDB) Then + _AccessConnectConn($LabDB, $LabDB_OBJ) +Else + _CreateDB($LabDB) + _AccessConnectConn($LabDB, $LabDB_OBJ) + _CreateTable($LabDB, 'Labels', $LabDB_OBJ) + _CreatMultipleFields($LabDB, 'Labels', $LabDB_OBJ, 'BSSID TEXT(12)|Label TEXT(255)') +EndIf +;Connect to camera database +If FileExists($CamDB) Then + _AccessConnectConn($CamDB, $CamDB_OBJ) +Else + _CreateDB($CamDB) + _AccessConnectConn($CamDB, $CamDB_OBJ) + _CreateTable($CamDB, 'Cameras', $CamDB_OBJ) + _CreatMultipleFields($CamDB, 'Cameras', $CamDB_OBJ, 'CamName TEXT(255)|CamUrl TEXT(255)') + + $query = "SELECT CamName, CamUrl FROM Cameras" +EndIf +;Connect to Instrument database +If FileExists($InstDB) Then + _AccessConnectConn($InstDB, $InstDB_OBJ) +Else + _CreateDB($InstDB) + _AccessConnectConn($InstDB, $InstDB_OBJ) + _CreateTable($InstDB, 'Instruments', $InstDB_OBJ) + _CreatMultipleFields($InstDB, 'Instruments', $InstDB_OBJ, 'INSTNUM TEXT(3)|INSTTEXT TEXT(255)') +EndIf +;Connect to Filter database +If FileExists($FiltDB) Then + _AccessConnectConn($FiltDB, $FiltDB_OBJ) + $query = "SELECT FiltID FROM Filters" + $FiltMatchArray = _RecordSearch($FiltDB, $query, $FiltDB_OBJ) + $FiltID = UBound($FiltMatchArray) - 1 +Else + _CreateDB($FiltDB) + _AccessConnectConn($FiltDB, $FiltDB_OBJ) + _CreateTable($FiltDB, 'Filters', $FiltDB_OBJ) + _CreatMultipleFields($FiltDB, 'Filters', $FiltDB_OBJ, 'FiltID TEXT(255)|FiltName TEXT(255)|FiltDesc TEXT(255)|SSID TEXT(255)|BSSID TEXT(255)|CHAN TEXT(255)|AUTH TEXT(255)|ENCR TEXT(255)|RADTYPE TEXT(255)|NETTYPE TEXT(255)|Signal TEXT(255)|HighSig TEXT(255)|RSSI TEXT(255)|HighRSSI TEXT(255)|BTX TEXT(255)|OTX TEXT(255)|ApID |Active TEXT(255)') + $FiltID = 0 +EndIf + +$var = IniReadSection($settings, "Columns") +If @error Then + $headers = '#|Active|Mac Address|SSID|Signal|High Signal|RSSI|High RSSI|Channel|Authentication|Encryption|Network Type|Latitude|Longitude|Manufacturer|Label|Radio Type|Lat (dd mm ss)|Lon (dd mm ss)|Lat (ddmm.mmmm)|Lon (ddmm.mmmm)|Basic Transfer Rates|Other Transfer Rates|First Active|Last Updated' +Else + For $a = 0 To ($var[0][0] - 1) + For $b = 1 To $var[0][0] + If $a = $var[$b][1] Then $headers &= IniRead($DefaultLanguagePath, 'Column_Names', $var[$b][0], IniRead($settings, 'Column_Names', $var[$b][0], '')) + If $a = $var[$b][1] And $b <> $var[0][0] Then $headers &= '|' + Next + Next +EndIf + +_GDIPlus_Startup() +$Pen_GraphGrid = _GDIPlus_PenCreate(StringReplace($BackgroundColor, "0x", "0xFF")) +$Pen_Red = _GDIPlus_PenCreate("0xFFFF0000") +$Brush_ControlBackgroundColor = _GDIPlus_BrushCreateSolid(StringReplace($ControlBackgroundColor, "0x", "0xFF")) +$Brush_Blue = _GDIPlus_BrushCreateSolid(0xFF00007F) +$FontFamily_Arial = _GDIPlus_FontFamilyCreate("Arial") +;------------------------------------------------------------------------------------------------------------------------------- +; GUI +;------------------------------------------------------------------------------------------------------------------------------- +Dim $title = $Script_Name & ' ' & $version & ' - By ' & $Script_Author & ' - ' & _DateLocalFormat($last_modified) & ' - (' & $VistumblerDbName & ')' +$Vistumbler = GUICreate($title, 980, 692, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) +GUISetBkColor($BackgroundColor) +GUISetFont($TextSize) + +;Set windows position and size +If $VistumblerPosition = "" Then + $a = WinGetPos($Vistumbler) + $VistumblerPosition = $a[0] & ',' & $a[1] & ',' & $a[2] & ',' & $a[3] +EndIf +$b = StringSplit($VistumblerPosition, ",") +If $VistumblerState = "Maximized" Then + WinSetState($title, "", @SW_MAXIMIZE) +Else + WinMove($title, "", $b[1], $b[2], $b[3], $b[4]) ;Resize window to ini value +EndIf + +;File Menu +$file = GUICtrlCreateMenu($Text_File) +$NewSession = GUICtrlCreateMenuItem($Text_NewSession, $file) +$Save = GUICtrlCreateMenu($Text_Import, $file) +$ImportFromTXT = GUICtrlCreateMenuItem($Text_Import, $Save) +$ImportFolder = GUICtrlCreateMenuItem($Text_ImportFolder, $Save) +$Export = GUICtrlCreateMenu($Text_Export, $file) +$ExportVS1Menu = GUICtrlCreateMenu($Text_ExportToVS1, $Export) +$ExportToVS1 = GUICtrlCreateMenuItem($Text_AllAPs, $ExportVS1Menu) +$ExportToFilVS1 = GUICtrlCreateMenuItem($Text_FilteredAPs, $ExportVS1Menu) +$ExportVSZMenu = GUICtrlCreateMenu($Text_ExportToVSZ, $Export) +$ExportToVSZ = GUICtrlCreateMenuItem($Text_AllAPs, $ExportVSZMenu) +$ExportToFilVSZ = GUICtrlCreateMenuItem($Text_FilteredAPs, $ExportVSZMenu) +$ExportCsvMenu = GUICtrlCreateMenu($Text_ExportToCSV, $Export) +$ExportToCsv = GUICtrlCreateMenuItem($Text_AllAPs, $ExportCsvMenu) +$ExportToFilCsv = GUICtrlCreateMenuItem($Text_FilteredAPs, $ExportCsvMenu) +$ExportKmlMenu = GUICtrlCreateMenu($Text_ExportToKML, $Export) +$ExportToKML = GUICtrlCreateMenuItem($Text_AllAPs, $ExportKmlMenu) +$ExportToFilKML = GUICtrlCreateMenuItem($Text_FilteredAPs, $ExportKmlMenu) +$CreateApSignalMap = GUICtrlCreateMenuItem($Text_SelectedAP, $ExportKmlMenu) +$ExportGpxMenu = GUICtrlCreateMenu($Text_ExportToGPX, $Export) +$ExportToGPX = GUICtrlCreateMenuItem($Text_AllAPs, $ExportGpxMenu) +$ExportNS1Menu = GUICtrlCreateMenu($Text_ExportToNS1, $Export) +$ExportToNS1 = GUICtrlCreateMenuItem($Text_AllAPs, $ExportNS1Menu) +;$ExportCamFile = GUICtrlCreateMenuItem("Export cam file", $Export) +$ExitSaveDB = GUICtrlCreateMenuItem($Text_ExitSaveDb, $file) +$ExitVistumbler = GUICtrlCreateMenuItem($Text_Exit, $file) +;Edit Menu +$Edit = GUICtrlCreateMenu($Text_Edit) +;$Cut = GUICtrlCreateMenuitem("Cut", $Edit) +$Copy = GUICtrlCreateMenuItem($Text_Copy, $Edit) +;$Delete = GUICtrlCreateMenuItem("Delete", $Edit) +;$SelectAll = GUICtrlCreateMenuItem("Select All", $Edit) +$ClearAll = GUICtrlCreateMenuItem($Text_ClearAll, $Edit) +$SortTree = GUICtrlCreateMenuItem($Text_SortTree, $Edit) +$SelectConnected = GUICtrlCreateMenuItem($Text_SelectConnectedAP, $Edit) + +$Options = GUICtrlCreateMenu($Text_Options) +If @OSVersion = "WIN_XP" Then ;Added extened 'Use Native Wifi' message (Since XP does not support BSSID, CHAN, Basic Transfer Rate) + $Text_UseNativeWifi = $Text_UseNativeWifiMsg & " " & $Text_UseNativeWifiXpExtMsg +Else + $Text_UseNativeWifi = $Text_UseNativeWifiMsg +EndIf +$GuiUseNativeWifi = GUICtrlCreateMenuItem($Text_UseNativeWifi, $Options) +If $UseNativeWifi = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +If @OSVersion = "WIN_XP" Then GUICtrlSetState(-1, $GUI_DISABLE) +$ScanWifiGUI = GUICtrlCreateMenuItem($Text_ScanAPs, $Options) +$RefreshMenuButton = GUICtrlCreateMenuItem($Text_RefreshNetworks, $Options) +If $RefreshNetworks = 1 Then GUICtrlSetState($RefreshMenuButton, $GUI_CHECKED) +$AutoRecoveryVS1GUI = GUICtrlCreateMenuItem($Text_AutoRecoveryVS1, $Options) +If $AutoRecoveryVS1 = 1 Then GUICtrlSetState($AutoRecoveryVS1GUI, $GUI_CHECKED) +$AutoSaveAndClearGUI = GUICtrlCreateMenuItem($Text_AutoSaveAndClear, $Options) +If $AutoSaveAndClear = 1 Then GUICtrlSetState($AutoSaveAndClearGUI, $GUI_CHECKED) +$AutoSaveKML = GUICtrlCreateMenuItem($Text_AutoKml, $Options) +If $AutoKML = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$AutoScanMenu = GUICtrlCreateMenuItem($Text_AutoScanApsOnLaunch, $Options) +If $AutoScan = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$PlaySoundOnNewAP = GUICtrlCreateMenuItem($Text_PlaySound, $Options) +If $SoundOnAP = 1 Then GUICtrlSetState($PlaySoundOnNewAP, $GUI_CHECKED) +$PlaySoundOnNewGPS = GUICtrlCreateMenuItem($Text_PlayGpsSound, $Options) +If $SoundOnGps = 1 Then GUICtrlSetState($PlaySoundOnNewGPS, $GUI_CHECKED) +$SpeakApSignal = GUICtrlCreateMenuItem($Text_SpeakSignal, $Options) +If $SpeakSignal = 1 Then GUICtrlSetState($SpeakApSignal, $GUI_CHECKED) +$GUI_MidiActiveAps = GUICtrlCreateMenuItem($Text_PlayMidiSounds, $Options) +If $Midi_PlayForActiveAps = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$MenuSaveGpsWithNoAps = GUICtrlCreateMenuItem($Text_SaveAllGpsData, $Options) +If $SaveGpsWithNoAps = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$GUI_DownloadImages = GUICtrlCreateMenuItem($Text_DownloadImages & " (" & $Text_Experimental & ")", $Options) +If $DownloadImages = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$GUI_CamTriggerMenu = GUICtrlCreateMenuItem($Text_EnableCamTriggerScript & " (" & $Text_Experimental & ")", $Options) +If $CamTrigger = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$GUI_PortableMode = GUICtrlCreateMenuItem($Text_PortableMode & " (" & $Text_Experimental & ")", $Options) +If $PortableMode = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$DebugMenu = GUICtrlCreateMenu($Text_Debug, $Options) +$DebugFunc = GUICtrlCreateMenuItem($Text_DisplayDebug, $DebugMenu) +If $Debug = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$DebugComGUI = GUICtrlCreateMenuItem($Text_DisplayComErrors, $DebugMenu) +If $DebugCom = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + +$ViewMenu = GUICtrlCreateMenu($Text_View) +$FilterMenu = GUICtrlCreateMenu($Text_Filters, $ViewMenu) +Dim $FilterMenuID_Array[1] +Dim $FilterID_Array[1] +Dim $FoundFilter = 0 +$AddRemoveFilters = GUICtrlCreateMenuItem($Text_AddRemFilters, $FilterMenu) +$query = "SELECT FiltID, FiltName FROM Filters" +$FiltMatchArray = _RecordSearch($FiltDB, $query, $FiltDB_OBJ) +$FoundFiltMatch = UBound($FiltMatchArray) - 1 +If $FoundFiltMatch <> 0 Then + For $ffm = 1 To $FoundFiltMatch + $Filter_ID = $FiltMatchArray[$ffm][1] + $Filter_Name = $FiltMatchArray[$ffm][2] + $menuid = GUICtrlCreateMenuItem($Filter_Name, $FilterMenu) + GUICtrlSetOnEvent($menuid, '_FilterChanged') + _ArrayAdd($FilterMenuID_Array, $menuid) + _ArrayAdd($FilterID_Array, $Filter_ID) + $FilterMenuID_Array[0] = UBound($FilterMenuID_Array) - 1 + $FilterID_Array[0] = UBound($FilterID_Array) - 1 + If $DefFiltID <> '-1' And $Filter_ID = $DefFiltID Then + $FoundFilter = 1 + GUICtrlSetState($menuid, $GUI_CHECKED) + EndIf + Next +EndIf +If $FoundFilter = 0 Then $DefFiltID = '-1' +_CreateFilterQuerys() + +;View Menu +$GraphViewOptions = GUICtrlCreateMenu($Text_Graph, $ViewMenu) +$UseRssiInGraphsGUI = GUICtrlCreateMenuItem($Text_UseRssiInGraphs, $GraphViewOptions) +If $UseRssiInGraphs = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$GraphDeadTimeGUI = GUICtrlCreateMenuItem($Text_GraphDeadTime, $GraphViewOptions) +If $GraphDeadTime = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$AutoSortGUI = GUICtrlCreateMenuItem($Text_AutoSort, $ViewMenu) +If $AutoSort = 1 Then GUICtrlSetState($AutoSortGUI, $GUI_CHECKED) +$AutoSelectMenuButton = GUICtrlCreateMenuItem($Text_AutoSelectConnectedAP, $ViewMenu) +If $AutoSelect = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$AutoSelectHighSignal = GUICtrlCreateMenuItem($Text_AutoSelectHighSignal, $ViewMenu) +If $AutoSelectHS = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$AddNewAPsToTop = GUICtrlCreateMenuItem($Text_AddAPsToTop, $ViewMenu) +If $AddDirection = 0 Then GUICtrlSetState(-1, $GUI_CHECKED) +$GuiAutoScrollToBottom = GUICtrlCreateMenuItem($Text_AutoScrollToBottom, $ViewMenu) +If $AutoScrollToBottom = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$GuiBatchListviewInsert = GUICtrlCreateMenuItem($Text_ListviewBatchInsertMode & " (" & $Text_Experimental & ")", $ViewMenu) +If $BatchListviewInsert = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) +$GuiMinimalGuiMode = GUICtrlCreateMenuItem($Text_MinimalGuiMode & " (" & $Text_Experimental & ")", $ViewMenu) +If $MinimalGuiMode = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + +;Settings Menu +$SettingsMenu = GUICtrlCreateMenu($Text_Settings) +$SetMisc = GUICtrlCreateMenuItem($Text_MiscSettings, $SettingsMenu) +$SetSave = GUICtrlCreateMenuItem($Text_SaveSettings, $SettingsMenu) +$SetGPS = GUICtrlCreateMenuItem($Text_GpsSettings, $SettingsMenu) +$SetLanguage = GUICtrlCreateMenuItem($Text_SetLanguage, $SettingsMenu) +$SetSearchWords = GUICtrlCreateMenuItem($Text_SetSearchWords, $SettingsMenu) +$SetMacLabel = GUICtrlCreateMenuItem($Text_SetMacLabel, $SettingsMenu) +$SetMacManu = GUICtrlCreateMenuItem($Text_SetMacManu, $SettingsMenu) +$SetColumnWidths = GUICtrlCreateMenuItem($Text_SetColumnWidths, $SettingsMenu) +$SetAuto = GUICtrlCreateMenuItem($Text_AutoKml & ' / ' & $Text_AutoSort, $SettingsMenu) +$SetSound = GUICtrlCreateMenuItem($Text_Sound, $SettingsMenu) +$SetWifiDB = GUICtrlCreateMenuItem($Text_WifiDB, $SettingsMenu) +$SetCamera = GUICtrlCreateMenuItem($Text_SetCameras, $SettingsMenu) + +$Interfaces = GUICtrlCreateMenu($Text_Interface) +$RefreshInterfaces = GUICtrlCreateMenuItem($Text_RefreshInterfaces, $Interfaces) +GUICtrlSetOnEvent($RefreshInterfaces, '_RefreshInterfaces') +_AddInterfaces() + +$ExtraMenu = GUICtrlCreateMenu($Text_Extra) +$GUI_2400ChannelGraph = GUICtrlCreateMenuItem($Text_2400ChannelGraph & " (" & $Text_Experimental & ")", $ExtraMenu) +$GUI_5000ChannelGraph = GUICtrlCreateMenuItem($Text_5000ChannelGraph & " (" & $Text_Experimental & ")", $ExtraMenu) +$GpsDetails = GUICtrlCreateMenuItem($Text_GpsDetails, $ExtraMenu) +$GpsCompass = GUICtrlCreateMenuItem($Text_GpsCompass, $ExtraMenu) +$OpenKmlNetworkLink = GUICtrlCreateMenuItem($Text_OpenKmlNetLink, $ExtraMenu) +$OpenSaveFolder = GUICtrlCreateMenuItem($Text_OpenSaveFolder, $ExtraMenu) +$ExportSettings = GUICtrlCreateMenuItem($Text_ExportVistumblerSettings, $ExtraMenu) +$ImportSettings = GUICtrlCreateMenuItem($Text_ImportVistumblerSettings, $ExtraMenu) +$UpdateManufacturers = GUICtrlCreateMenuItem($Text_UpdateManufacturers, $ExtraMenu) +;$GUI_ImportImageFolder = GUICtrlCreateMenuItem("Import Image Folder (" & $Text_Experimental & ")", $ExtraMenu) +;$GUI_CleanupNonMatchingImages = GUICtrlCreateMenuItem("Cleanup non-matching images (" & $Text_Experimental & ")", $ExtraMenu) + + +$WifidbMenu = GUICtrlCreateMenu($Text_WifiDB) +$UseWiFiDbGpsLocateButton = GUICtrlCreateMenuItem($Text_AutoWiFiDbGpsLocate & ' (' & $Text_Experimental & ')', $WifidbMenu) +If @OSVersion = "WIN_XP" Then GUICtrlSetState($UseWiFiDbGpsLocateButton, $GUI_DISABLE) +If @OSVersion = "WIN_XP" Then $UseWiFiDbGpsLocate = 0 +If $UseWiFiDbGpsLocate = 1 Then GUICtrlSetState($UseWiFiDbGpsLocateButton, $GUI_CHECKED) +$UseWiFiDbAutoUploadButton = GUICtrlCreateMenuItem($Text_AutoWiFiDbUploadAps & ' (' & $Text_Experimental & ')', $WifidbMenu) +$ViewWifiDbWDB = GUICtrlCreateMenuItem($Text_UploadDataToWifiDB & ' (' & $Text_Experimental & ')', $WifidbMenu) +$LocateInWDB = GUICtrlCreateMenuItem($Text_LocateInWiFiDB & ' (' & $Text_Experimental & ')', $WifidbMenu) +$ViewLiveInWDB = GUICtrlCreateMenuItem($Text_WifiDBOpenLiveAPWebpage & ' (' & $Text_Experimental & ')', $WifidbMenu) +$UpdateGeolocations = GUICtrlCreateMenuItem($Text_UpdateGeolocations & ' (' & $Text_Experimental & ')', $WifidbMenu) +$ViewWDBWebpage = GUICtrlCreateMenuItem($Text_WifiDBOpenMainWebpage, $WifidbMenu) +$ViewInWifiDbGraph = GUICtrlCreateMenuItem($Text_WifiDbPHPgraph, $WifidbMenu) + +$Help = GUICtrlCreateMenu($Text_Help) +$VistumblerHome = GUICtrlCreateMenuItem($Text_VistumblerHome, $Help) +$VistumblerForum = GUICtrlCreateMenuItem($Text_VistumblerForum, $Help) +$VistumblerWiki = GUICtrlCreateMenuItem($Text_VistumblerWiki, $Help) +$UpdateVistumbler = GUICtrlCreateMenuItem($Text_CheckForUpdates, $Help) + +$SupportVistumbler = GUICtrlCreateMenu($Text_SupportVistumbler) +$VistumblerDonate = GUICtrlCreateMenuItem($Text_VistumblerDonate, $SupportVistumbler) +$VistumblerStore = GUICtrlCreateMenuItem($Text_VistumblerStore, $SupportVistumbler) + +$GraphicGUI = GUICreate("", 900, 400, 10, 60, $WS_CHILD, -1, $Vistumbler) +GUISetBkColor($ControlBackgroundColor) +$Graphic = _GDIPlus_GraphicsCreateFromHWND($GraphicGUI) +$Graph_bitmap = _GDIPlus_BitmapCreateFromGraphics(900, 400, $Graphic) +$Graph_backbuffer = _GDIPlus_ImageGetGraphicsContext($Graph_bitmap) +GUISwitch($Vistumbler) + +$ListviewAPs = _GUICtrlListView_Create($Vistumbler, $headers, 260, 65, 725, 585, BitOR($LVS_REPORT, $LVS_SINGLESEL)) +_GUICtrlListView_SetExtendedListViewStyle($ListviewAPs, BitOR($LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER)) +_GUICtrlListView_SetBkColor($ListviewAPs, RGB2BGR($ControlBackgroundColor)) +_GUICtrlListView_SetTextBkColor($ListviewAPs, RGB2BGR($ControlBackgroundColor)) +WinSetState($ListviewAPs, "", @SW_HIDE) + +$hImage = _GUIImageList_Create() +_GUIImageList_AddIcon($hImage, $IconDir & "Signal\open-grey.ico") +_GUIImageList_AddIcon($hImage, $IconDir & "Signal\open-red.ico") +_GUIImageList_AddIcon($hImage, $IconDir & "Signal\open-orange.ico") +_GUIImageList_AddIcon($hImage, $IconDir & "Signal\open-yellow.ico") +_GUIImageList_AddIcon($hImage, $IconDir & "Signal\open-light-green.ico") +_GUIImageList_AddIcon($hImage, $IconDir & "Signal\open-green.ico") +_GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-grey.ico") +_GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-red.ico") +_GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-orange.ico") +_GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-yellow.ico") +_GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-light-green.ico") +_GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-green.ico") +_GUICtrlListView_SetImageList($ListviewAPs, $hImage, 1) + +$TreeviewAPs = _GUICtrlTreeView_Create($Vistumbler, 5, 65, 150, 585) +_GUICtrlTreeView_SetBkColor($TreeviewAPs, $ControlBackgroundColor) +WinSetState($TreeviewAPs, "", @SW_HIDE) + +$ScanButton = GUICtrlCreateButton($Text_ScanAPs, 10, 8, 70, 22) +GUICtrlSetBkColor($ScanButton, $ButtonInactiveColor) +If $AutoScan = 1 Then ScanToggle() +$GpsButton = GUICtrlCreateButton($Text_UseGPS, 80, 8, 70, 22) +GUICtrlSetBkColor($GpsButton, $ButtonInactiveColor) +$GraphButton1 = GUICtrlCreateButton($Text_Graph1, 10, 35, 70, 22) +GUICtrlSetBkColor($GraphButton1, $ButtonInactiveColor) +$GraphButton2 = GUICtrlCreateButton($Text_Graph2, 80, 35, 70, 22) +GUICtrlSetBkColor($GraphButton2, $ButtonInactiveColor) +$SaveAndClearButton = GUICtrlCreateButton($Text_AutoSaveAndClear, 10, 35, 140, 22) +If $MinimalGuiMode = 1 Then + GUICtrlSetState($GraphButton1, $GUI_HIDE) + GUICtrlSetState($GraphButton2, $GUI_HIDE) +Else + GUICtrlSetState($SaveAndClearButton, $GUI_HIDE) +EndIf + +$ActiveAPs = GUICtrlCreateLabel($Text_ActiveAPs & ': ' & '0 / 0', 155, 10, 300, 15) +GUICtrlSetColor(-1, $TextColor) +$timediff = GUICtrlCreateLabel($Text_ActualLoopTime & ': 0 ms', 155, 25, 300, 15) +GUICtrlSetColor(-1, $TextColor) +$GuiLat = GUICtrlCreateLabel($Text_Latitude & ': ' & _GpsFormat($Latitude), 460, 10, 300, 15) +GUICtrlSetColor(-1, $TextColor) +$GuiLon = GUICtrlCreateLabel($Text_Longitude & ': ' & _GpsFormat($Longitude), 460, 25, 300, 15) +GUICtrlSetColor(-1, $TextColor) +$debugdisplay = GUICtrlCreateLabel('', 765, 10, 200, 15) +GUICtrlSetColor(-1, $TextColor) +$msgdisplay = GUICtrlCreateLabel('', 155, 40, 610, 15) +GUICtrlSetColor(-1, $TextColor) + +GUISwitch($Vistumbler) +GUISetState(@SW_SHOW) +_SetControlSizes() + +$VistumblerGuiOpen = 1 + +;Button-Events------------------------------------------- +GUISetOnEvent($GUI_EVENT_CLOSE, '_CloseToggle') +GUISetOnEvent($GUI_EVENT_RESIZED, '_ResetSizes') +GUISetOnEvent($GUI_EVENT_MINIMIZE, '_ResetSizes') +GUISetOnEvent($GUI_EVENT_RESTORE, '_ResetSizes') +GUISetOnEvent($GUI_EVENT_MAXIMIZE, '_ResetSizes') +;Buttons +GUICtrlSetOnEvent($ScanButton, 'ScanToggle') +GUICtrlSetOnEvent($GpsButton, '_GpsToggle') +GUICtrlSetOnEvent($GraphButton1, '_GraphToggle') +GUICtrlSetOnEvent($GraphButton2, '_GraphToggle2') +GUICtrlSetOnEvent($SaveAndClearButton, '_AutoSaveAndClear') +;File Menu +GUICtrlSetOnEvent($NewSession, '_NewSession') +GUICtrlSetOnEvent($ImportFromTXT, 'LoadList') +GUICtrlSetOnEvent($ImportFolder, '_LoadFolder') +GUICtrlSetOnEvent($ExportToVS1, '_ExportDetailedData') +GUICtrlSetOnEvent($ExportToFilVS1, '_ExportFilteredDetailedData') +GUICtrlSetOnEvent($ExportToVSZ, '_ExportVszData') +GUICtrlSetOnEvent($ExportToFilVSZ, '_ExportVszFilteredData') +GUICtrlSetOnEvent($ExportToCsv, '_ExportCsvData') +GUICtrlSetOnEvent($ExportToFilCsv, '_ExportCsvFilteredData') +GUICtrlSetOnEvent($ExportToKML, 'SaveToKML') +GUICtrlSetOnEvent($ExportToFilKML, '_ExportFilteredKML') +GUICtrlSetOnEvent($CreateApSignalMap, '_KmlSignalMapSelectedAP') +GUICtrlSetOnEvent($ExportToGPX, '_SaveToGPX') +GUICtrlSetOnEvent($ExportToNS1, '_ExportNS1') +;GUICtrlSetOnEvent($ExportCamFile, '_ExportCamFile') +GUICtrlSetOnEvent($ExitSaveDB, '_ExitSaveDB') +GUICtrlSetOnEvent($ExitVistumbler, '_CloseToggle') +;Edit Menu +GUICtrlSetOnEvent($ClearAll, '_ClearAll') +GUICtrlSetOnEvent($Copy, '_CopySelectedAP') +GUICtrlSetOnEvent($SelectConnected, '_MenuSelectConnectedAp') +GUICtrlSetOnEvent($SortTree, '_SortTree') +;Optons Menu +GUICtrlSetOnEvent($ScanWifiGUI, 'ScanToggle') +GUICtrlSetOnEvent($RefreshMenuButton, '_AutoRefreshToggle') +GUICtrlSetOnEvent($AutoRecoveryVS1GUI, '_AutoRecoveryVS1Toggle') +GUICtrlSetOnEvent($AutoSaveAndClearGUI, '_AutoSaveAndClearToggle') +GUICtrlSetOnEvent($AutoSaveKML, '_AutoKmlToggle') +GUICtrlSetOnEvent($AutoScanMenu, '_AutoScanToggle') +GUICtrlSetOnEvent($PlaySoundOnNewAP, '_SoundToggle') +GUICtrlSetOnEvent($PlaySoundOnNewGPS, '_GpsSoundToggle') +GUICtrlSetOnEvent($SpeakApSignal, '_SpeakSigToggle') +GUICtrlSetOnEvent($GUI_MidiActiveAps, '_ActiveApMidiToggle') +GUICtrlSetOnEvent($MenuSaveGpsWithNoAps, '_SaveGpsWithNoAPsToggle') +GUICtrlSetOnEvent($GuiUseNativeWifi, '_NativeWifiToggle') +GUICtrlSetOnEvent($DebugFunc, '_DebugToggle') +GUICtrlSetOnEvent($DebugComGUI, '_DebugComToggle') +GUICtrlSetOnEvent($GUI_DownloadImages, '_DownloadImagesToggle') +GUICtrlSetOnEvent($GUI_CamTriggerMenu, '_CamTriggerToggle') +GUICtrlSetOnEvent($GUI_PortableMode, '_PortableModeToggle') +;View Menu +GUICtrlSetOnEvent($AddRemoveFilters, '_ModifyFilters') +GUICtrlSetOnEvent($AutoSortGUI, '_AutoSortToggle') +GUICtrlSetOnEvent($AutoSelectMenuButton, '_AutoConnectToggle') +GUICtrlSetOnEvent($AutoSelectHighSignal, '_AutoSelHighSigToggle') +GUICtrlSetOnEvent($AddNewAPsToTop, '_AddApPosToggle') +GUICtrlSetOnEvent($UseRssiInGraphsGUI, '_UseRssiInGraphsToggle') +GUICtrlSetOnEvent($GraphDeadTimeGUI, '_GraphDeadTimeToggle') +GUICtrlSetOnEvent($GuiAutoScrollToBottom, '_AutoScrollToBottomToggle') +GUICtrlSetOnEvent($GuiBatchListviewInsert, '_BatchListviewInsertToggle') +GUICtrlSetOnEvent($GuiMinimalGuiMode, '_MinimalGuiModeToggle') +;Settings Menu +GUICtrlSetOnEvent($SetMisc, '_SettingsGUI_Misc') +GUICtrlSetOnEvent($SetSave, '_SettingsGUI_Save') +GUICtrlSetOnEvent($SetGPS, '_SettingsGUI_GPS') +GUICtrlSetOnEvent($SetLanguage, '_SettingsGUI_Lan') +GUICtrlSetOnEvent($SetMacManu, '_SettingsGUI_Manu') +GUICtrlSetOnEvent($SetMacLabel, '_SettingsGUI_Lab') +GUICtrlSetOnEvent($SetColumnWidths, '_SettingsGUI_Col') +GUICtrlSetOnEvent($SetSearchWords, '_SettingsGUI_SW') +GUICtrlSetOnEvent($SetAuto, '_SettingsGUI_Auto') +GUICtrlSetOnEvent($SetSound, '_SettingsGUI_Sound') +GUICtrlSetOnEvent($SetWifiDB, '_SettingsGUI_WifiDB') +GUICtrlSetOnEvent($SetCamera, '_SettingsGUI_Cam') +;Extra Menu +GUICtrlSetOnEvent($GpsCompass, '_CompassGUI') +GUICtrlSetOnEvent($GpsDetails, '_OpenGpsDetailsGUI') +GUICtrlSetOnEvent($GUI_2400ChannelGraph, '_Channels2400_GUI') +GUICtrlSetOnEvent($GUI_5000ChannelGraph, '_Channels5000_GUI') +GUICtrlSetOnEvent($OpenSaveFolder, '_OpenSaveFolder') +GUICtrlSetOnEvent($OpenKmlNetworkLink, '_StartGoogleAutoKmlRefresh') +GUICtrlSetOnEvent($ExportSettings, '_ExportSettings') +GUICtrlSetOnEvent($ImportSettings, '_ImportSettings') +GUICtrlSetOnEvent($UpdateManufacturers, '_ManufacturerUpdate') +;GUICtrlSetOnEvent($GUI_ImportImageFolder, '_GUI_ImportImageFiles') +;GUICtrlSetOnEvent($GUI_CleanupNonMatchingImages, '_RemoveNonMatchingImages') +;WifiDB Menu +GUICtrlSetOnEvent($UseWiFiDbGpsLocateButton, '_WifiDbLocateToggle') +GUICtrlSetOnEvent($UseWiFiDbAutoUploadButton, '_WifiDbAutoUploadToggleWarn') +GUICtrlSetOnEvent($ViewWifiDbWDB, '_AddToYourWDB') +GUICtrlSetOnEvent($LocateInWDB, '_LocatePositionInWiFiDB') +GUICtrlSetOnEvent($ViewLiveInWDB, '_ViewLiveInWDB') +GUICtrlSetOnEvent($UpdateGeolocations, '_GeoLocateAllAps') +GUICtrlSetOnEvent($ViewWDBWebpage, '_ViewWDBWebpage') +GUICtrlSetOnEvent($ViewInWifiDbGraph, '_ViewInWifiDbGraph') +;Help Menu +GUICtrlSetOnEvent($VistumblerHome, '_OpenVistumblerHome') +GUICtrlSetOnEvent($VistumblerForum, '_OpenVistumblerForum') +GUICtrlSetOnEvent($VistumblerWiki, '_OpenVistumblerWiki') +GUICtrlSetOnEvent($UpdateVistumbler, '_MenuUpdate') +;Support Vistumbler +GUICtrlSetOnEvent($VistumblerDonate, '_OpenVistumblerDonate') +GUICtrlSetOnEvent($VistumblerStore, '_OpenVistumblerStore') + +;Set Listview Widths +_SetListviewWidths() + +Dim $Authentication_tree = _GUICtrlTreeView_InsertItem($TreeviewAPs, $Column_Names_Authentication) +Dim $channel_tree = _GUICtrlTreeView_InsertItem($TreeviewAPs, $Column_Names_Channel) +Dim $Encryption_tree = _GUICtrlTreeView_InsertItem($TreeviewAPs, $Column_Names_Encryption) +Dim $NetworkType_tree = _GUICtrlTreeView_InsertItem($TreeviewAPs, $Column_Names_NetworkType) +Dim $SSID_tree = _GUICtrlTreeView_InsertItem($TreeviewAPs, $Column_Names_SSID) + +If $Recover = 1 Then _RecoverMDB() +If $Load <> '' Then _LoadListGUI($Load) +If $EnableAutoUpApsToWifiDB = 1 Then _WifiDbAutoUploadToggle(0) + +;------------------------------------------------------------------------------------------------------------------------------- +; PROGRAM RUNNING LOOP +;------------------------------------------------------------------------------------------------------------------------------- +$UpdatedWiFiDbGPS = 0 +$UpdatedGPS = 0 +$UpdatedAPs = 0 +$UpdatedGraph = 0 +$UpdatedAutoKML = 0 +$UpdatedSpeechSig = 0 +$begin = TimerInit() ;Start $begin timer, used to measure loop time +$kml_active_timer = TimerInit() +$kml_dead_timer = TimerInit() +$kml_gps_timer = TimerInit() +$kml_track_timer = TimerInit() +$ReleaseMemory_Timer = TimerInit() +$Speech_Timer = TimerInit() +$WiFiDbLocate_Timer = TimerInit() +$wifidb_au_timer = TimerInit() +$cam_timer = TimerInit() +$camtrig_timer = TimerInit() +$save_timer = TimerInit() +$autosave_timer = TimerInit() +While 1 + ;Set TimeStamps (UTC Values) + $dt = StringSplit(_DateTimeUtcConvert(StringFormat("%04i", @YEAR) & '-' & StringFormat("%02i", @MON) & '-' & StringFormat("%02i", @MDAY), @HOUR & ':' & @MIN & ':' & @SEC & '.' & StringFormat("%03i", @MSEC), 1), ' ') ;UTC Time + $datestamp = $dt[1] + $timestamp = $dt[2] + $ldatetimestamp = StringFormat("%04i", @YEAR) & '-' & StringFormat("%02i", @MON) & '-' & StringFormat("%02i", @MDAY) & ' ' & @HOUR & '-' & @MIN & '-' & @SEC ;Local Time + + ;Get GPS position from WiFiDB + If $UseWiFiDbGpsLocate = 1 And $UpdatedWiFiDbGPS <> 1 And $Scan = 1 And TimerDiff($WiFiDbLocate_Timer) >= $WiFiDbLocateRefreshTime Then + $GetWifidbGpsSuccess = _LocateGpsInWifidb() + If $GetWifidbGpsSuccess = 1 Then + If $LatitudeWifidb <> 'N 0000.0000' And $LongitudeWifidb <> 'E 0000.0000' Then + $Latitude = $LatitudeWifidb + $Longitude = $LongitudeWifidb + EndIf + GUICtrlSetData($GuiLat, $Text_Latitude & ': ' & _GpsFormat($Latitude)) ;Set GPS Latitude in GUI + GUICtrlSetData($GuiLon, $Text_Longitude & ': ' & _GpsFormat($Longitude)) ;Set GPS Longitude in GUI + EndIf + $WiFiDbLocate_Timer = TimerInit() + $UpdatedWiFiDbGPS = 1 + ;ConsoleWrite($GetWifidbGpsSuccess & @CRLF) + EndIf + + ;Get GPS Information (if enabled) + If $UseGPS = 1 And $UpdatedGPS <> 1 Then ; If 'Use GPS' is checked then scan gps and display information + $GetGpsSuccess = _GetGPS() ;Scan for GPS if GPS enabled + If $GetGpsSuccess = 1 Then + GUICtrlSetData($GuiLat, $Text_Latitude & ': ' & _GpsFormat($Latitude)) ;Set GPS Latitude in GUI + GUICtrlSetData($GuiLon, $Text_Longitude & ': ' & _GpsFormat($Longitude)) ;Set GPS Longitude in GUI + $UpdatedGPS = 1 + Else + If $GpsType = 1 Then GUICtrlSetData($msgdisplay, $Text_GpsErrorBufferEmpty) + If $GpsType = 0 Then GUICtrlSetData($msgdisplay, $Text_GpsErrorStopped) + Sleep(1000) + EndIf + EndIf + + ;Play New GPS sound (if enabled) + If $SoundOnGps = 1 Then + If $Last_Latitude <> $Latitude Or $Last_Longitude <> $Longitude Then + _SoundPlay($SoundDir & $new_GPS_sound) + $Last_Latitude = $Latitude + $Last_Longitude = $Longitude + EndIf + EndIf + + ;Get AP Information (if enabled) + If $Scan = 1 And $UpdatedAPs <> 1 Then + ;Scan For New Aps + $ScanResults = _ScanAccessPoints() ;Scan for Access Points if scanning enabled + If $ScanResults = -1 Then + GUICtrlSetData($msgdisplay, $Text_ErrorScanningNetsh) + Sleep(1000) + Else + ;Set Update flag so APs do not get scanned again on this loop + $UpdatedAPs = 1 + ;Set flag that new data has been added + If $ScanResults <> 0 Then $newdata = 1 + ;Add GPS ID If no access points are found and Save GPS when no APs are active is on + If $ScanResults = 0 And $SaveGpsWithNoAps = 1 Then + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $Latitude & '|' & $Longitude & '|' & $NumberOfSatalites & '|' & $HorDilPitch & '|' & $Alt & '|' & $Geo & '|' & $SpeedInMPH & '|' & $SpeedInKmH & '|' & $TrackAngle & '|' & $datestamp & '|' & $timestamp) + EndIf + ;Mark Dead Access Points + _MarkDeadAPs() + If $MinimalGuiMode = 0 Then + ;Remove APs that do not match the filter + _FilterRemoveNonMatchingInList() + ;Add APs back into the listview that match but are not there + _UpdateListview($BatchListviewInsert) + EndIf + ;Play Midi Sounds for all active APs (if enabled) + _PlayMidiForActiveAPs() + EndIf + If $ScanResults > 0 Then $UpdateAutoSave = 1 + ;Refresh Networks If Enabled + If $RefreshNetworks = 1 Then _RefreshNetworks() + ;Select connected AP + If $AutoSelect = 1 And WinActive($Vistumbler) Then _SelectConnectedAp() + ;Select the active AP with the highest signal + If $AutoSelectHS = 1 And WinActive($Vistumbler) Then _SelectHighSignalAp() + ElseIf $Scan = 0 And $UpdatedAPs <> 1 Then + $UpdatedAPs = 1 + ;Add GPS ID If AP Scanning is off, UseGPS is on, and Save GPS when no AP are active is on + If $UseGPS = 1 And $SaveGpsWithNoAps = 1 Then + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $Latitude & '|' & $Longitude & '|' & $NumberOfSatalites & '|' & $HorDilPitch & '|' & $Alt & '|' & $Geo & '|' & $SpeedInMPH & '|' & $SpeedInKmH & '|' & $TrackAngle & '|' & $datestamp & '|' & $timestamp) + EndIf + ;Mark Dead Access Points + _MarkDeadAPs() + If $MinimalGuiMode = 0 Then + ;Remove APs that do not match the filter + _FilterRemoveNonMatchingInList() + ;Add APs back into the listview that match but are not there + _UpdateListview($BatchListviewInsert) + EndIf + EndIf + ;Resize Controls / Control Resize Monitoring + _TreeviewListviewResize() + + + ;Graph Selected AP + If $UpdatedGraph = 0 Then + _GraphDraw() + $UpdatedGraph = 1 + EndIf + + ;Speak Signal of selected AP (if enabled) + If $SpeakSignal = 1 And $Scan = 1 And $UpdatedSpeechSig = 0 And TimerDiff($Speech_Timer) >= $SpeakSigTime Then + $SpeakSuccess = _SpeakSelectedSignal() + If $SpeakSuccess = 1 Then + $UpdatedSpeechSig = 1 + $Speech_Timer = TimerInit() + EndIf + EndIf + + ;Get Webcam Images + If $DownloadImages = 1 And TimerDiff($cam_timer) >= $DownloadImagesTime Then + _ImageDownloader() + $cam_timer = TimerInit() + EndIf + + ;Trigger Camera Script + If $CamTrigger = 1 And TimerDiff($camtrig_timer) >= $CamTriggerTime Then + _CamTrigger() + $camtrig_timer = TimerInit() + EndIf + + ;Export KML files for AutoKML Google Earth Tracking (if enabled) + If $AutoKML = 1 Then + If TimerDiff($kml_gps_timer) >= ($AutoKmlGpsTime * 1000) And $AutoKmlGpsTime <> 0 Then + _AutoKmlGpsFile($GoogleEarth_GpsFile) + $kml_gps_timer = TimerInit() + EndIf + If TimerDiff($kml_dead_timer) >= ($AutoKmlDeadTime * 1000) And $AutoKmlDeadTime <> 0 And ProcessExists($AutoKmlDeadProcess) = 0 Then + $AutoKmlDeadProcess = Run(@ComSpec & " /C " & FileGetShortName(@ScriptDir & '\Export.exe') & ' /db="' & $VistumblerDB & '" /t=k /f="' & $GoogleEarth_DeadFile & '" /d', '', @SW_HIDE) + $kml_dead_timer = TimerInit() + EndIf + If TimerDiff($kml_active_timer) >= ($AutoKmlActiveTime * 1000) And $AutoKmlActiveTime <> 0 And ProcessExists($AutoKmlActiveProcess) = 0 Then + $AutoKmlActiveProcess = Run(@ComSpec & " /C " & FileGetShortName(@ScriptDir & '\Export.exe') & ' /db="' & $VistumblerDB & '" /t=k /f="' & $GoogleEarth_ActiveFile & '" /a', '', @SW_HIDE) + $kml_active_timer = TimerInit() + EndIf + If TimerDiff($kml_track_timer) >= ($AutoKmlTrackTime * 1000) And $AutoKmlTrackTime <> 0 And ProcessExists($AutoKmlTrackProcess) = 0 Then + $AutoKmlTrackProcess = Run(@ComSpec & " /C " & FileGetShortName(@ScriptDir & '\Export.exe') & ' /db="' & $VistumblerDB & '" /t=k /f="' & $GoogleEarth_TrackFile & '" /p', '', @SW_HIDE) + $kml_track_timer = TimerInit() + EndIf + EndIf + + ;Upload Active APs to WiFiDB (if enabled) + If $AutoUpApsToWifiDB = 1 Then + If TimerDiff($wifidb_au_timer) >= ($AutoUpApsToWifiDBTime * 1000) Then + $run = 'Export.exe' & ' /db="' & $VistumblerDB & '" /t=w /u="' & $WifiDbApiURL & '" /wa="' & $WifiDb_User & '" /wk="' & $WifiDb_ApiKey & '" /wsid="' & $WifiDbSessionID & '"' + ConsoleWrite($run & @CRLF) + $WifiDbUploadProcess = Run($run, @ScriptDir, @SW_HIDE) + $wifidb_au_timer = TimerInit() + EndIf + EndIf + + If $AutoRecoveryVS1 = 1 And $UpdateAutoSave = 1 And TimerDiff($save_timer) >= ($AutoRecoveryTime * 60000) Then + _AutoRecoveryVS1() + $UpdateAutoSave = 0 + EndIf + + If $AutoSaveAndClear = 1 Then + If $AutoSaveAndClearOnAPs = 1 And $APID >= $AutoSaveAndClearAPs Then + _AutoSaveAndClear() + ElseIf $AutoSaveAndClearOnTime = 1 And TimerDiff($autosave_timer) >= ($AutoSaveAndClearTime * 60000) Then + _AutoSaveAndClear() + EndIf + EndIf + + ;Check GPS Details Windows Position + If WinExists($GpsDetailsGUI) And $GpsDetailsOpen = 1 Then + $p = WinGetPos($GpsDetailsGUI) + If $p[0] & ',' & $p[1] & ',' & $p[2] & ',' & $p[3] <> $GpsDetailsPosition Then $GpsDetailsPosition = $p[0] & ',' & $p[1] & ',' & $p[2] & ',' & $p[3] ;If the $GpsDetails has moved or resized, set $GpsDetailsPosition to current window size + EndIf + + ;Check Compass Window Position + If WinExists($CompassGUI) And $CompassOpen = 1 Then + $CompassPosition_old = $CompassPosition + $p = WinGetPos($CompassGUI) + If $p[0] & ',' & $p[1] & ',' & $p[2] & ',' & $p[3] <> $CompassPosition Then $CompassPosition = $p[0] & ',' & $p[1] & ',' & $p[2] & ',' & $p[3] ;If the $CompassGUI has moved or resized, set $pompassPosition to current window size + If $CompassPosition <> $CompassPosition_old Then _SetCompassSizes() + _DrawCompass() + EndIf + + ;Check 2.4Ghz Channel Graph Window Position + If WinExists($2400chanGUI) And $2400chanGUIOpen = 1 Then + $2400ChanGraphPos_old = $2400ChanGraphPos + $p = WinGetPos($2400chanGUI) + If $p[0] & ',' & $p[1] & ',' & $p[2] & ',' & $p[3] <> $2400ChanGraphPos Then $2400ChanGraphPos = $p[0] & ',' & $p[1] & ',' & $p[2] & ',' & $p[3] ;If the $2400chanGUI has moved or resized, set $GpsDetailsPosition to current window size + If $2400ChanGraphPos <> $2400ChanGraphPos_old Then _Set2400ChanGraphSizes() + _Draw2400ChanGraph() + EndIf + + ;Check 5Ghz Channel Graph Position + If WinExists($5000chanGUI) And $5000chanGUIOpen = 1 Then + $5000ChanGraphPos_old = $5000ChanGraphPos + $p = WinGetPos($5000chanGUI) + If $p[0] & ',' & $p[1] & ',' & $p[2] & ',' & $p[3] <> $5000ChanGraphPos Then $5000ChanGraphPos = $p[0] & ',' & $p[1] & ',' & $p[2] & ',' & $p[3] ;If the $5000chanGUI has moved or resized, set $pompassPosition to current window size + If $5000ChanGraphPos <> $5000ChanGraphPos_old Then _Set5000ChanGraphSizes() + _Draw5000ChanGraph() + EndIf + + ;Check Vistumbler Window Position + If WinExists($Vistumbler) Then + ;Set Position + $p = WinGetPos($Vistumbler) + If $p[0] & ',' & $p[1] & ',' & $p[2] & ',' & $p[3] <> $VistumblerPosition Then $VistumblerPosition = $p[0] & ',' & $p[1] & ',' & $p[2] & ',' & $p[3] ;If the $VistumblerPosition has moved or resized, set $pompassPosition to current window size + ;Set Window State + $ws = WinGetState($title, "") + If BitAND($ws, 32) Then ;Set + $VistumblerState = "Maximized" + Else + $VistumblerState = "Window" + EndIf + $winpos_old = $winpos + $winpos = $VistumblerPosition & '-' & $VistumblerState + If $winpos <> $winpos_old Or $MinimalGuiMode <> $MinimalGuiMode_old Then _SetControlSizes() + EndIf + + ;Flag Actions + If $CopyFlag = 1 Then _CopySetClipboard() + If $Close = 1 Then _ExitVistumbler() ;If the close flag has been set, exit visumbler + If $SortColumn <> -1 Then _HeaderSort($SortColumn) ;Sort clicked listview column + If $ClearAllAps = 1 Then _ClearAllAp() ;Clear all access points + If $ClearListAndTree = 1 Then _ClearListAndTree() ;Clear list and tree for Minimal GUI Mode + If $AutoScrollToBottom = 1 Then _GUICtrlListView_Scroll($ListviewAPs, 0, _GUICtrlListView_GetItemCount($ListviewAPs) * 16) + + ;Release Memory (Working Set) + If TimerDiff($ReleaseMemory_Timer) > 30000 Then + _ReduceMemory() + $ReleaseMemory_Timer = TimerInit() + EndIf + + If TimerDiff($begin) >= $RefreshLoopTime Then + $UpdatedWiFiDbGPS = 0 + $UpdatedGPS = 0 + $UpdatedAPs = 0 + $UpdatedGraph = 0 + $UpdatedAutoKML = 0 + $UpdatedSpeechSig = 0 + GUICtrlSetData($msgdisplay, '') ;Clear Message + $time = TimerDiff($begin) + GUICtrlSetData($timediff, $Text_ActualLoopTime & ': ' & StringFormat("%04i", $time) & ' ms') ; Set 'Actual Loop Time' in GUI + $begin = TimerInit() ;Start $begin timer, used to measure loop time + Else + Sleep(10) + EndIf +WEnd +Exit + +;------------------------------------------------------------------------------------------------------------------------------- +; WIFI SCAN FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _ScanAccessPoints() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, ' _ScanAccessPoints()') ;#Debug Display + Local $FoundAPs = 0 + Local $FilterMatches = 0 + If $UseNativeWifi = 1 Then + $aplist = _Wlan_GetNetworks(False, 0, 0) + ;_ArrayDisplay($aplist) + $aplistsize = UBound($aplist) - 1 + For $add = 0 To $aplistsize + $SSID = $aplist[$add][1] + $NetworkType = $aplist[$add][2] + $SecurityEnabled = $aplist[$add][6] + $Authentication = $aplist[$add][7] + $Encryption = $aplist[$add][8] + $RadioType = "802.11" & $aplist[$add][12] + $Signal = $aplist[$add][5] + If $Signal <> 0 Then + $FoundAPs += 1 + ;Add new GPS ID + If $FoundAPs = 1 Then + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $Latitude & '|' & $Longitude & '|' & $NumberOfSatalites & '|' & $HorDilPitch & '|' & $Alt & '|' & $Geo & '|' & $SpeedInMPH & '|' & $SpeedInKmH & '|' & $TrackAngle & '|' & $datestamp & '|' & $timestamp) + EndIf + ;Add new access point(s) + If @OSVersion = "WIN_XP" Then ;WinXP Does not support _Wlan_GetNetworkInfo, so fall back to olf functionality + $BasicTransferRates = $aplist[$add][11] + $OtherTransferRates = "" + $BSSID = $aplist[$add][10] + $RSSI = _SignalPercentToDb($Signal) + $Channel = 0 + $NewFound = _AddApData(1, $GPS_ID, $BSSID, $SSID, $Channel, $Authentication, $Encryption, $NetworkType, $RadioType, $BasicTransferRates, $OtherTransferRates, $Signal, $RSSI) + If $NewFound <> 0 Then + ;Check if this AP matches the filter + If StringInStr($AddQuery, "WHERE") Then + $fquery = $AddQuery & " AND ApID = " & $NewFound + Else + $fquery = $AddQuery & " WHERE ApID = " & $NewFound + EndIf + $LoadApMatchArray = _RecordSearch($VistumblerDB, $fquery, $DB_OBJ) + $FoundLoadApMatch = UBound($LoadApMatchArray) - 1 + ;If AP Matches filter, increment $FilterMatches + If $FoundLoadApMatch = 1 Then $FilterMatches += 1 + ;Play per-ap new ap sound + If $SoundPerAP = 1 And $FoundLoadApMatch = 1 Then + If $NewSoundSigBased = 1 Then + $run = FileGetShortName(@ScriptDir & '\say.exe') & ' /s="' & $Signal & '" /t=5' + $SayProcess = Run(@ComSpec & " /C " & $run, '', @SW_HIDE) + Else + $run = FileGetShortName(@ScriptDir & '\say.exe') & ' /s="100" /t=5' + $SayProcess = Run(@ComSpec & " /C " & $run, '', @SW_HIDE) + EndIf + EndIf + EndIf + Else ;Uses _Wlan_GetNetworkInfo and get extended information + If $SecurityEnabled = "Security Enabled" Then + $Secured = True + Else + $Secured = False + EndIf + If $NetworkType = "Infrastructure" Then + $BssType = $DOT11_BSS_TYPE_INFRASTRUCTURE + Else + $BssType = $DOT11_BSS_TYPE_INDEPENDENT + EndIf + + $apinfo = _Wlan_GetNetworkInfo($SSID, $BssType, $Secured) + ;_ArrayDisplay($apinfo) + $apinfosize = UBound($apinfo) - 1 + For $addinfo = 0 To $apinfosize + $InfoSSID = $apinfo[$addinfo][1] + $BSSID = StringReplace($apinfo[$addinfo][2], " ", ":") + $Flags = $apinfo[$addinfo][3] + $NetworkType = $apinfo[$addinfo][4] + If $apinfo[$addinfo][5] = "Unknown/Any Phy Type" Then + $RadioType = "Unknown" + Else + $RadioType = "802.11" & $apinfo[$addinfo][5] + EndIf + $Signal = $apinfo[$addinfo][6] + $RSSI = $apinfo[$addinfo][7] + $Channel = $apinfo[$addinfo][8] + + $TypeMatch = BitOR(BitAND($BssType = $DOT11_BSS_TYPE_INFRASTRUCTURE, StringInStr($Flags, "(ESS)") <> 0), BitAND($BssType = $DOT11_BSS_TYPE_INDEPENDENT, StringInStr($Flags, "(IBSS)") <> 0)) + $SecMatch = BitOR(BitAND($Secured = True, StringInStr($Flags, "(Priv)") <> 0), BitAND($Secured = False, StringInStr($Flags, "(Priv)") = 0)) + ;ConsoleWrite($SSID & ' - ' & $InfoSSID & ' - ' & $Signal & ' - ' & $BSSID & ' - ' & $Flags & ' - ' & $Secured & ' - ' & $SecMatch & ' - ' & $TypeMatch & @CRLF) + If $Signal <> 0 And $RSSI < 0 And $SSID = $InfoSSID And $SecMatch = 1 And $TypeMatch = 1 Then ;"$SSID = $InfoSSID And $SecMatch = 1 And $TypeMatch = 1" check is a temporary workaround for blank SSIDse + ;ConsoleWrite($SSID & ' - ' & $Signal & ' - ' & $RSSI & ' - ' & _SignalPercentToDb($Signal) & @CRLF) + ;Split Other Transfer Rates from Basic Transfer Rates + Local $highchan = 0, $otrswitch = 0, $BasicTransferRates = "", $OtherTransferRates = "" + $tr_split = StringSplit($apinfo[$addinfo][11], ",") + For $trs = 1 To $tr_split[0] + $transferrate = $tr_split[$trs] - 0 + If ($transferrate > $highchan) And ($otrswitch = 0) Then + $highchan = $transferrate + If $BasicTransferRates <> "" Then $BasicTransferRates &= "," + $BasicTransferRates &= $transferrate + Else + $otrswitch = 1 + If $OtherTransferRates <> "" Then $OtherTransferRates &= "," + $OtherTransferRates &= $transferrate + EndIf + Next + ;End Split Other Transfer Rates from Basic Transfer Rates + $NewFound = _AddApData(1, $GPS_ID, $BSSID, $SSID, $Channel, $Authentication, $Encryption, $NetworkType, $RadioType, $BasicTransferRates, $OtherTransferRates, $Signal, $RSSI) + If $NewFound <> 0 Then + ;Check if this AP matches the filter + If StringInStr($AddQuery, "WHERE") Then + $fquery = $AddQuery & " AND ApID = " & $NewFound + Else + $fquery = $AddQuery & " WHERE ApID = " & $NewFound + EndIf + $LoadApMatchArray = _RecordSearch($VistumblerDB, $fquery, $DB_OBJ) + $FoundLoadApMatch = UBound($LoadApMatchArray) - 1 + ;If AP Matches filter, increment $FilterMatches + If $FoundLoadApMatch = 1 Then $FilterMatches += 1 + ;Play per-ap new ap sound + If $SoundPerAP = 1 And $FoundLoadApMatch = 1 Then + If $NewSoundSigBased = 1 Then + $run = FileGetShortName(@ScriptDir & '\say.exe') & ' /s="' & $Signal & '" /t=5' + $SayProcess = Run(@ComSpec & " /C " & $run, '', @SW_HIDE) + Else + $run = FileGetShortName(@ScriptDir & '\say.exe') & ' /s="100" /t=5' + $SayProcess = Run(@ComSpec & " /C " & $run, '', @SW_HIDE) + EndIf + EndIf + EndIf + EndIf + Next + EndIf + EndIf + Next + ;Play New AP sound if sounds are enabled if per-ap sound is disabled + If $SoundPerAP = 0 And $FilterMatches <> 0 And $SoundOnAP = 1 Then _SoundPlay($SoundDir & $new_AP_sound) + ;Return number of active APs + Return ($FoundAPs) + Else + Local $NewAP = 0 + ;Delete old temp file + FileDelete($tempfile) + ;Dump data from netsh + _RunDos($netsh & ' wlan show networks mode=bssid interface="' & $DefaultApapter & '" > ' & '"' & $tempfile & '"') ;copy the output of the 'netsh wlan show networks mode=bssid' command to the temp file + ;Open netsh temp file and go through it + $netshtempfile = FileOpen($tempfile, 0) + If $netshtempfile <> -1 Then + $netshfile = FileRead($netshtempfile) + $netshfile = StringReplace($netshfile, ":" & @CRLF, ":") ;Fix for turkish netsh file + $TempFileArray = StringSplit($netshfile, @CRLF) + If IsArray($TempFileArray) Then + ;Strip out whitespace before and after text on each line + For $stripws = 1 To $TempFileArray[0] + $TempFileArray[$stripws] = StringStripWS($TempFileArray[$stripws], 3) + Next + ;Go through each line to get data + For $loop = 1 To $TempFileArray[0] + $temp = StringSplit(StringStripWS($TempFileArray[$loop], 3), ":") + If IsArray($temp) Then + If $temp[0] = 2 Then + If StringInStr($TempFileArray[$loop], $SearchWord_SSID) And StringInStr($TempFileArray[$loop], $SearchWord_BSSID) <> 1 Then + $SSID = StringStripWS($temp[2], 3) + Dim $NetworkType = '', $Authentication = '', $Encryption = '', $BSSID = '' + EndIf + If StringInStr($TempFileArray[$loop], $SearchWord_NetworkType) Then $NetworkType = StringStripWS($temp[2], 3) + If StringInStr($TempFileArray[$loop], $SearchWord_Authentication) Then $Authentication = StringStripWS($temp[2], 3) + If StringInStr($TempFileArray[$loop], $SearchWord_Encryption) Then $Encryption = StringStripWS($temp[2], 3) + If StringInStr($TempFileArray[$loop], $SearchWord_Signal) Then $Signal = StringStripWS(StringReplace($temp[2], '%', ''), 3) + If StringInStr($TempFileArray[$loop], $SearchWord_RadioType) Then $RadioType = StringStripWS($temp[2], 3) + If StringInStr($TempFileArray[$loop], $SearchWord_Channel) Then $Channel = StringStripWS($temp[2], 3) + If StringInStr($TempFileArray[$loop], $SearchWord_BasicRates) Then $BasicTransferRates = StringStripWS($temp[2], 3) + If StringInStr($TempFileArray[$loop], $SearchWord_OtherRates) Then $OtherTransferRates = StringStripWS($temp[2], 3) + ElseIf $temp[0] = 7 Then + If StringInStr($TempFileArray[$loop], $SearchWord_BSSID) Then + Dim $Signal = '0', $RadioType = '', $Channel = '', $BasicTransferRates = '', $OtherTransferRates = '', $MANUF + $NewAP = 1 + $BSSID = StringStripWS(StringUpper($temp[2] & ':' & $temp[3] & ':' & $temp[4] & ':' & $temp[5] & ':' & $temp[6] & ':' & $temp[7]), 3) + EndIf + EndIf + EndIf + ;Set Update Flag (if needed) + $Update = 0 + If $loop = $TempFileArray[0] Then + $Update = 1 + Else + If StringInStr($TempFileArray[$loop + 1], $SearchWord_SSID) Or StringInStr($TempFileArray[$loop + 1], $SearchWord_BSSID) Then $Update = 1 + EndIf + ;Add data into database and gui + If $Update = 1 And $NewAP = 1 And $BSSID <> '' Then + $NewAP = 0 + If $BSSID <> "" Then + $FoundAPs += 1 + ;Add new GPS ID + If $FoundAPs = 1 Then + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $Latitude & '|' & $Longitude & '|' & $NumberOfSatalites & '|' & $HorDilPitch & '|' & $Alt & '|' & $Geo & '|' & $SpeedInMPH & '|' & $SpeedInKmH & '|' & $TrackAngle & '|' & $datestamp & '|' & $timestamp) + EndIf + ;Add new access point + $RSSI = _SignalPercentToDb($Signal) + $NewFound = _AddApData(1, $GPS_ID, $BSSID, $SSID, $Channel, $Authentication, $Encryption, $NetworkType, $RadioType, $BasicTransferRates, $OtherTransferRates, $Signal, $RSSI) + If $NewFound <> 0 Then + ;Check if this AP matches the filter + If StringInStr($AddQuery, "WHERE") Then + $fquery = $AddQuery & " AND ApID = " & $NewFound + Else + $fquery = $AddQuery & " WHERE ApID = " & $NewFound + EndIf + $LoadApMatchArray = _RecordSearch($VistumblerDB, $fquery, $DB_OBJ) + $FoundLoadApMatch = UBound($LoadApMatchArray) - 1 + ;If AP Matches filter, increment $FilterMatches + If $FoundLoadApMatch = 1 Then $FilterMatches += 1 + ;Play per-ap new AP sound + If $SoundPerAP = 1 And $FoundLoadApMatch = 1 Then + If $NewSoundSigBased = 1 Then + $run = FileGetShortName(@ScriptDir & '\say.exe') & ' /s="' & $Signal & '" /t=5' + $SayProcess = Run(@ComSpec & " /C " & $run, '', @SW_HIDE) + Else + $run = FileGetShortName(@ScriptDir & '\say.exe') & ' /s="100" /t=5' + $SayProcess = Run(@ComSpec & " /C " & $run, '', @SW_HIDE) + EndIf + EndIf + EndIf + EndIf + EndIf + Next + ;Play New AP sound if sounds are enabled if per-ap sound is disabled + If $SoundPerAP = 0 And $FilterMatches <> 0 And $SoundOnAP = 1 Then _SoundPlay($SoundDir & $new_AP_sound) + EndIf + FileClose($netshtempfile) + ;Return number of active APs + Return ($FoundAPs) + Else + Return ("-1") + EndIf + EndIf +EndFunc ;==>_ScanAccessPoints + +;------------------------------------------------------------------------------------------------------------------------------- +; ADD DB/LISTVIEW/TREEVIEW FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _AddApData($New, $NewGpsId, $BSSID, $SSID, $CHAN, $AUTH, $ENCR, $NETTYPE, $RADTYPE, $BTX, $OtX, $SIG, $RSSI) + ;ConsoleWrite("$New:" & $New & " $NewGpsId:" & $NewGpsId & " $BSSID:" & $BSSID & " $SSID:" & $SSID & " $CHAN:" & $CHAN & " $AUTH:" & $AUTH & " $ENCR:" & $ENCR & " $NETTYPE:" & $NETTYPE & " $RADTYPE" & $RADTYPE & " $BTX:" & $BTX & "$OtX:" & $OtX & " $SIG:" & $SIG & " $RSSI:" & $RSSI & @CRLF) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AddApData()') ;#Debug Display + If $New = 1 And $SIG <> 0 Then + $AP_Status = $Text_Active + $AP_StatusNum = 1 + $AP_DisplaySig = $SIG + $AP_DisplayRSSI = $RSSI + Else + $AP_Status = $Text_Dead + $AP_StatusNum = 0 + $AP_DisplaySig = 0 + $AP_DisplayRSSI = -100 + EndIf + ;Get Current GPS/Date/Time Information + $query = "SELECT TOP 1 Latitude, Longitude, NumOfSats, Date1, Time1 FROM GPS WHERE GpsID = " & $NewGpsId + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $New_Lat = $GpsMatchArray[1][1] + $New_Lon = $GpsMatchArray[1][2] + $New_NumSat = $GpsMatchArray[1][3] + $New_Date = $GpsMatchArray[1][4] + $New_Time = $GpsMatchArray[1][5] + $New_DateTime = $New_Date & ' ' & $New_Time + $NewApFound = 0 + If $GpsMatchArray <> 0 Then ;If GPS ID Is Found + ;Query AP table for New AP + $query = "SELECT TOP 1 ApID, ListRow, HighGpsHistId, LastGpsID, FirstHistID, LastHistID, Active, SecType, HighSignal, HighRSSI FROM AP WHERE BSSID = '" & $BSSID & "' And SSID ='" & StringReplace($SSID, "'", "''") & "' And CHAN = " & $CHAN & " And AUTH = '" & $AUTH & "' And ENCR = '" & $ENCR & "' And RADTYPE = '" & $RADTYPE & "'" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + ;ConsoleWrite($query & @CRLF) + If $FoundApMatch = 0 Then ;If AP is not found then add it + $APID += 1 + $HISTID += 1 + $NewApFound = $APID + $ListRow = -1 + ;Set Security Type + If BitOR($AUTH = $SearchWord_Open, $AUTH = 'Open') And BitOR($ENCR = $SearchWord_None, $ENCR = 'Unencrypted') Then + $SecType = 1 + ElseIf BitOR($ENCR = $SearchWord_Wep, $ENCR = 'WEP') Then + $SecType = 2 + Else + $SecType = 3 + EndIf + ;Get Label and Manufacturer information + $MANUF = _FindManufacturer($BSSID) ;Set Manufacturer + $LABEL = _SetLabels($BSSID) + ;Set HISTID + If $New_Lat <> 'N 0000.0000' And $New_Lon <> 'E 0000.0000' Then + $DBHighGpsHistId = $HISTID + Else + $DBHighGpsHistId = '0' + EndIf + ;Add History Information + _AddRecord($VistumblerDB, "HIST", $DB_OBJ, $HISTID & '|' & $APID & '|' & $NewGpsId & '|' & $SIG & '|' & $RSSI & '|' & $New_Date & '|' & $New_Time) + ;Add AP Data into the AP table + ReDim $AddApRecordArray[32] + $AddApRecordArray[0] = 21 + $AddApRecordArray[1] = $APID + $AddApRecordArray[2] = $ListRow + $AddApRecordArray[3] = $AP_StatusNum + $AddApRecordArray[4] = $BSSID + $AddApRecordArray[5] = $SSID + $AddApRecordArray[6] = $CHAN + $AddApRecordArray[7] = $AUTH + $AddApRecordArray[8] = $ENCR + $AddApRecordArray[9] = $SecType + $AddApRecordArray[10] = $NETTYPE + $AddApRecordArray[11] = $RADTYPE + $AddApRecordArray[12] = $BTX + $AddApRecordArray[13] = $OtX + $AddApRecordArray[14] = $DBHighGpsHistId + $AddApRecordArray[15] = $NewGpsId + $AddApRecordArray[16] = $HISTID + $AddApRecordArray[17] = $HISTID + $AddApRecordArray[18] = $MANUF + $AddApRecordArray[19] = $LABEL + $AddApRecordArray[20] = $AP_DisplaySig + $AddApRecordArray[21] = $SIG + $AddApRecordArray[22] = $AP_DisplayRSSI + $AddApRecordArray[23] = $RSSI + $AddApRecordArray[24] = "" ;Geonames CountryCode + $AddApRecordArray[25] = "" ;Geonames CountryName + $AddApRecordArray[26] = "" ;Geonames AdminCode + $AddApRecordArray[27] = "" ;Geonames AdminName + $AddApRecordArray[28] = "" ;Geonames Admin2Name + $AddApRecordArray[29] = "" ;Geonames Areaname + $AddApRecordArray[30] = -1 ;Geonames Accuracy(miles) + $AddApRecordArray[31] = -1 ;Geonames Accuracy(km) + _AddRecord($VistumblerDB, "AP", $DB_OBJ, $AddApRecordArray) + ElseIf $FoundApMatch = 1 Then ;If the AP is already in the AP table, update it + $Found_APID = $ApMatchArray[1][1] + $Found_ListRow = $ApMatchArray[1][2] + $Found_HighGpsHistId = $ApMatchArray[1][3] + $Found_LastGpsID = $ApMatchArray[1][4] + $Found_FirstHistID = $ApMatchArray[1][5] + $Found_LastHistID = $ApMatchArray[1][6] + $Found_Active = $ApMatchArray[1][7] + $Found_SecType = $ApMatchArray[1][8] + $Found_HighSignal = Round($ApMatchArray[1][9]) + $Found_HighRSSI = Round($ApMatchArray[1][10]) + $HISTID += 1 + ;Set Last Time and First Time + If $New = 1 Then ;If this is a new access point, use new information + $ExpLastHistID = $HISTID + $ExpFirstHistID = -1 + $ExpGpsID = $NewGpsId + $ExpLastDateTime = $New_DateTime + $ExpFirstDateTime = -1 + Else ;If this is not a new check if this information is newer or older + $query = "SELECT TOP 1 Date1, Time1 FROM Hist WHERE HistID=" & $Found_LastHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + If _CompareDate($HistMatchArray[1][1] & ' ' & $HistMatchArray[1][2], $New_Date & ' ' & $New_Time) = 1 Then + $ExpLastHistID = $Found_LastHistID + $ExpGpsID = $Found_LastGpsID + $ExpLastDateTime = $HistMatchArray[1][1] & ' ' & $HistMatchArray[1][2] + Else + $ExpLastHistID = $HISTID + $ExpGpsID = $NewGpsId + $ExpLastDateTime = $New_DateTime + EndIf + $query = "SELECT TOP 1 Date1, Time1 FROM Hist WHERE HistID=" & $Found_FirstHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + If _CompareDate($HistMatchArray[1][1] & ' ' & $HistMatchArray[1][2], $New_Date & ' ' & $New_Time) = 2 Then + $ExpFirstDateTime = -1 + $ExpFirstHistID = -1 + Else + $ExpFirstDateTime = $New_Date & ' ' & $New_Time + $ExpFirstHistID = $HISTID + EndIf + EndIf + ;Set Highest GPS History ID + If $New_Lat <> 'N 0000.0000' And $New_Lon <> 'E 0000.0000' Then ;If new latitude and longitude are valid + If $Found_HighGpsHistId = 0 Then ;If old HighGpsHistId is blank then use the new Hist ID + $DBLat = $New_Lat + $DBLon = $New_Lon + $DBHighGpsHistId = $HISTID + Else ;If old HighGpsHistId has a postion, check if the new posion has a higher number of satalites/higher signal + ;Get Old GpsID and Signal + $query = "SELECT GpsID, RSSI FROM HIST WHERE HistID=" & $Found_HighGpsHistId + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_GpsID = $HistMatchArray[1][1] + $Found_RSSI = $HistMatchArray[1][2] + ;Get Old Latititude, Logitude and Number of Satalites from Old GPS ID + $query = "SELECT Latitude, Longitude, NumOfSats FROM GPS WHERE GpsID=" & $Found_GpsID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_Lat = $GpsMatchArray[1][1] + $Found_Lon = $GpsMatchArray[1][2] + $Found_NumSat = $GpsMatchArray[1][3] + If $RSSI > $Found_RSSI Then ;If the new RSSI is greater or eqaul to the old RSSI + $DBHighGpsHistId = $HISTID + $DBLat = $New_Lat + $DBLon = $New_Lon + ElseIf $RSSI = $Found_RSSI Then ;If the RSSIs are equal, use the position with the higher number of sats + If $New_NumSat > $Found_NumSat Then + $DBHighGpsHistId = $HISTID + $DBLat = $New_Lat + $DBLon = $New_Lon + Else + $DBHighGpsHistId = $Found_HighGpsHistId + $DBLat = -1 + $DBLon = -1 + EndIf + Else ;If the old RSSI is greater than the new, use the old position + $DBHighGpsHistId = $Found_HighGpsHistId + $DBLat = -1 + $DBLon = -1 + EndIf + EndIf + Else ;If new lat and lon are not valid, use the old position and do not update lat and lon + $DBHighGpsHistId = $Found_HighGpsHistId + $DBLat = -1 + $DBLon = -1 + EndIf + ;If HighGpsHistID is different from the origional, update it + If $DBHighGpsHistId <> $Found_HighGpsHistId Then + $query = "UPDATE AP SET HighGpsHistId=" & $DBHighGpsHistId & " WHERE ApID=" & $Found_APID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + EndIf + ;If High Signal has changed, update it + If $SIG > $Found_HighSignal Then + $ExpHighSig = $SIG + Else + $ExpHighSig = $Found_HighSignal + EndIf + ;If High Signal has changed, update it + If $RSSI > $Found_HighRSSI Then + $ExpHighRSSI = $RSSI + Else + $ExpHighRSSI = $Found_HighRSSI + EndIf + ;Update AP in DB. Set Active, LastGpsID, and LastHistID + $query = "UPDATE AP SET Active=" & $AP_StatusNum & ", LastGpsID=" & $ExpGpsID & ", LastHistId=" & $ExpLastHistID & ",Signal=" & $AP_DisplaySig & ",HighSignal=" & $ExpHighSig & ",RSSI=" & $AP_DisplayRSSI & ",HighRSSI=" & $ExpHighRSSI & " WHERE ApId=" & $Found_APID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + ;ConsoleWrite($query & @CRLF) + ;Update AP in DB. Set FirstHistID + If $ExpFirstHistID <> -1 Then + $query = "UPDATE AP SET FirstHistId=" & $ExpFirstHistID & " WHERE ApId=" & $Found_APID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + EndIf + ;Add new history ID + _AddRecord($VistumblerDB, "HIST", $DB_OBJ, $HISTID & '|' & $Found_APID & '|' & $NewGpsId & '|' & $SIG & '|' & $RSSI & '|' & $New_Date & '|' & $New_Time) + ;Update List information + If $New = 0 And $Found_Active = 0 Then + $Exp_AP_Status = -1 + $Exp_AP_DisplaySig = -1 + $Exp_AP_DisplayRSSI = -1 + Else + $Exp_AP_Status = $AP_Status + $Exp_AP_DisplaySig = $AP_DisplaySig + $Exp_AP_DisplayRSSI = $AP_DisplayRSSI + EndIf + If $Found_ListRow <> -1 Then + ;Update AP Listview data + _GUICtrlListView_BeginUpdate($ListviewAPs) + _ListViewAdd($Found_ListRow, -1, $Exp_AP_Status, -1, -1, -1, -1, $Exp_AP_DisplaySig, $ExpHighSig, $Exp_AP_DisplayRSSI, $ExpHighRSSI, -1, -1, -1, -1, -1, $ExpFirstDateTime, $ExpLastDateTime, $DBLat, $DBLon, -1, -1) + ;Update Signal Icon + _UpdateIcon($Found_ListRow, $Exp_AP_DisplaySig, $Found_SecType) + _GUICtrlListView_EndUpdate($ListviewAPs) + EndIf + EndIf + EndIf + Return ($NewApFound) +EndFunc ;==>_AddApData + +Func _AddIconListRow($SigLev, $IconSecType, $LineTxt, $AddPos) + ;Add Into ListView, Set icon color + Local $addListRow + If $SigLev >= 1 And $SigLev <= 20 Then + If $IconSecType = 1 Then + $addListRow = _GUICtrlListView_InsertItem($ListviewAPs, $LineTxt, $AddPos, 1) + Else + $addListRow = _GUICtrlListView_InsertItem($ListviewAPs, $LineTxt, $AddPos, 7) + EndIf + ElseIf $SigLev >= 21 And $SigLev <= 40 Then + If $IconSecType = 1 Then + $addListRow = _GUICtrlListView_InsertItem($ListviewAPs, $LineTxt, $AddPos, 2) + Else + $addListRow = _GUICtrlListView_InsertItem($ListviewAPs, $LineTxt, $AddPos, 8) + EndIf + ElseIf $SigLev >= 41 And $SigLev <= 60 Then + If $IconSecType = 1 Then + $addListRow = _GUICtrlListView_InsertItem($ListviewAPs, $LineTxt, $AddPos, 3) + Else + $addListRow = _GUICtrlListView_InsertItem($ListviewAPs, $LineTxt, $AddPos, 9) + EndIf + ElseIf $SigLev >= 61 And $SigLev <= 80 Then + If $IconSecType = 1 Then + $addListRow = _GUICtrlListView_InsertItem($ListviewAPs, $LineTxt, $AddPos, 4) + Else + $addListRow = _GUICtrlListView_InsertItem($ListviewAPs, $LineTxt, $AddPos, 10) + EndIf + ElseIf $SigLev >= 81 And $SigLev <= 100 Then + If $IconSecType = 1 Then + $addListRow = _GUICtrlListView_InsertItem($ListviewAPs, $LineTxt, $AddPos, 5) + Else + $addListRow = _GUICtrlListView_InsertItem($ListviewAPs, $LineTxt, $AddPos, 11) + EndIf + Else + If $IconSecType = 1 Then + $addListRow = _GUICtrlListView_InsertItem($ListviewAPs, $LineTxt, $AddPos, 0) + Else + $addListRow = _GUICtrlListView_InsertItem($ListviewAPs, $LineTxt, $AddPos, 6) + EndIf + EndIf + Return ($addListRow) +EndFunc ;==>_AddIconListRow + +Func _UpdateIcon($ApListRow, $ApSig, $ApSecType) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_UpdateIcon()') ;#Debug Display + If $ApSig >= 1 And $ApSig <= 20 Then + If $ApSecType = 1 Then + _GUICtrlListView_SetItemImage($ListviewAPs, $ApListRow, 1) + Else + _GUICtrlListView_SetItemImage($ListviewAPs, $ApListRow, 7) + EndIf + ElseIf $ApSig >= 21 And $ApSig <= 40 Then + If $ApSecType = 1 Then + _GUICtrlListView_SetItemImage($ListviewAPs, $ApListRow, 2) + Else + _GUICtrlListView_SetItemImage($ListviewAPs, $ApListRow, 8) + EndIf + ElseIf $ApSig >= 41 And $ApSig <= 60 Then + If $ApSecType = 1 Then + _GUICtrlListView_SetItemImage($ListviewAPs, $ApListRow, 3) + Else + _GUICtrlListView_SetItemImage($ListviewAPs, $ApListRow, 9) + EndIf + ElseIf $ApSig >= 61 And $ApSig <= 80 Then + If $ApSecType = 1 Then + _GUICtrlListView_SetItemImage($ListviewAPs, $ApListRow, 4) + Else + _GUICtrlListView_SetItemImage($ListviewAPs, $ApListRow, 10) + EndIf + ElseIf $ApSig >= 81 And $ApSig <= 100 Then + If $ApSecType = 1 Then + _GUICtrlListView_SetItemImage($ListviewAPs, $ApListRow, 5) + Else + _GUICtrlListView_SetItemImage($ListviewAPs, $ApListRow, 11) + EndIf + Else + If $ApSecType = 1 Then + _GUICtrlListView_SetItemImage($ListviewAPs, $ApListRow, 0) + Else + _GUICtrlListView_SetItemImage($ListviewAPs, $ApListRow, 6) + EndIf + EndIf +EndFunc ;==>_UpdateIcon + +Func _MarkDeadAPs() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_MarkDeadAPs()') ;#Debug Display + ;Set APs Dead in Listview + $query = "SELECT ApID, ListRow, LastGpsID, SecType FROM AP WHERE Active=1" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + For $resetdead = 1 To $FoundApMatch + $Found_APID = $ApMatchArray[$resetdead][1] + $Found_ListRow = $ApMatchArray[$resetdead][2] + $Found_LastGpsID = $ApMatchArray[$resetdead][3] + $Found_SecType = $ApMatchArray[$resetdead][4] + ;Get Last Time + $query = "SELECT Date1, Time1 FROM GPS WHERE GpsID=" & $Found_LastGpsID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_Date = $GpsMatchArray[1][1] + $Found_Time = _TimeToSeconds($GpsMatchArray[1][2]) + $Current_Time = _TimeToSeconds($timestamp) + $Found_dts = StringReplace($Found_Date & $Found_Time, '-', '') + $Current_dts = StringReplace($datestamp & $Current_Time, '-', '') + ;Set APs that have been inactive for specified time dead + If (($Current_dts - $Found_dts) > $TimeBeforeMarkedDead) Or $Scan = 0 Then + If $MinimalGuiMode = 0 Then + _ListViewAdd($Found_ListRow, -1, $Text_Dead, -1, -1, -1, -1, '0', -1, '-100', -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1) + _UpdateIcon($Found_ListRow, 0, $Found_SecType) + EndIf + $query = "UPDATE AP SET Active=0, Signal=0, RSSI=-100 WHERE ApID=" & $Found_APID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + EndIf + Next + + ;Fix APs that are marked dead but still have a signal + $query = "SELECT ApID, ListRow, SecType FROM AP WHERE Active=0 And Signal<>0" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + For $resetdead = 1 To $FoundApMatch + $Found_APID = $ApMatchArray[$resetdead][1] + $Found_ListRow = $ApMatchArray[$resetdead][2] + $Found_SecType = $ApMatchArray[$resetdead][3] + $query = "UPDATE AP SET Signal=0 WHERE ApID='" & $Found_APID & "'" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + If $MinimalGuiMode = 0 Then _UpdateIcon($Found_ListRow, 0, $Found_SecType) + Next + + ;Update active/total ap label + $query = "Select COUNT(ApID) FROM AP WHERE Active=1" + $ActiveCountArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ActiveCount = $ActiveCountArray[1][1] + If $DefFiltID = '-1' Then + GUICtrlSetData($ActiveAPs, $Text_ActiveAPs & ': ' & $ActiveCount & " / " & $APID) + Else + ;$query = "Select COUNT(ApID) FROM AP WHERE ListRow<>-1" + $FilteredCountArray = _RecordSearch($VistumblerDB, $CountQuery, $DB_OBJ) + $FilteredCount = $FilteredCountArray[1][1] + + Local $query + If StringInStr($CountQuery, "WHERE") Then + $query = $CountQuery & " AND Active=1" + Else + $query = $CountQuery & " WHERE Active=1" + EndIf + ;$query = "Select COUNT(ApID) FROM AP WHERE Active=1 And ListRow<>-1" + $ActiveFilteredCountArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ActiveFilteredCount = $ActiveFilteredCountArray[1][1] + GUICtrlSetData($ActiveAPs, $Text_ActiveAPs & ': ' & $ActiveFilteredCount & " / " & $FilteredCount & " " & $Text_Filtered & " " & $ActiveCount & " / " & $APID & " " & $Text_Total) + ;GUICtrlSetData($ActiveAPs, $Text_ActiveAPs & ': ' & $ActiveCount & " / " & $APID & " ( " & $ActiveFilteredCount & " / " & $FilteredCount & " filtered )") + EndIf +EndFunc ;==>_MarkDeadAPs + +Func _ListViewAdd($line, $Add_Line = -1, $Add_Active = -1, $Add_BSSID = -1, $Add_SSID = -1, $Add_Authentication = -1, $Add_Encryption = -1, $Add_Signal = -1, $Add_HighSignal = -1, $Add_RSSI = -1, $Add_HighRSSI = -1, $Add_Channel = -1, $Add_RadioType = -1, $Add_BasicTransferRates = -1, $Add_OtherTransferRates = -1, $Add_NetworkType = -1, $Add_FirstAcvtive = -1, $Add_LastActive = -1, $Add_LatitudeDMM = -1, $Add_LongitudeDMM = -1, $Add_MANU = -1, $Add_Label = -1) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ListViewAdd()') ;#Debug Display + + If $Add_Active <> -1 Then $Add_Active = StringReplace(StringReplace($Add_Active, "1", $Text_Active), "0", $Text_Dead) + + If $Add_LatitudeDMM <> -1 And $Add_LongitudeDMM <> -1 Then + $LatDMS = _Format_GPS_DMM_to_DMS($Add_LatitudeDMM) + $LonDMS = _Format_GPS_DMM_to_DMS($Add_LongitudeDMM) + $LatDDD = _Format_GPS_DMM_to_DDD($Add_LatitudeDMM) + $LonDDD = _Format_GPS_DMM_to_DDD($Add_LongitudeDMM) + Else ;Do nothing (Reset lat,lon variables) + $LatDMS = -1 + $LonDMS = -1 + $LatDDD = -1 + $LonDDD = -1 + EndIf + + If $Add_Line <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, Round($Add_Line), $column_Line) + If $Add_Active <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_Active, $column_Active) + If $Add_SSID <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_SSID, $column_SSID) + If $Add_BSSID <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_BSSID, $column_BSSID) + If $Add_MANU <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_MANU, $column_MANUF) + If $Add_Signal <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, Round($Add_Signal) & '% ', $column_Signal) + If $Add_HighSignal <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, Round($Add_HighSignal) & '% ', $column_HighSignal) + If $Add_RSSI <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_RSSI & ' dBm', $column_RSSI) + If $Add_HighSignal <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_HighRSSI & ' dBm', $column_HighRSSI) + If $Add_Authentication <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_Authentication, $column_Authentication) + If $Add_Encryption <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_Encryption, $column_Encryption) + If $Add_RadioType <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_RadioType, $column_RadioType) + If $Add_Channel <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, Round($Add_Channel), $column_Channel) + If $LatDDD <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $LatDDD, $column_Latitude) + If $LonDDD <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $LonDDD, $column_Longitude) + If $LatDMS <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $LatDMS, $column_LatitudeDMS) + If $LonDMS <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $LonDMS, $column_LongitudeDMS) + If $Add_LatitudeDMM <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_LatitudeDMM, $column_LatitudeDMM) + If $Add_LongitudeDMM <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_LongitudeDMM, $column_LongitudeDMM) + If $Add_BasicTransferRates <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_BasicTransferRates, $column_BasicTransferRates) + If $Add_OtherTransferRates <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_OtherTransferRates, $column_OtherTransferRates) + If $Add_NetworkType <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_NetworkType, $column_NetworkType) + If $Add_Label <> -1 Then _GUICtrlListView_SetItemText($ListviewAPs, $line, $Add_Label, $column_Label) + If $Add_FirstAcvtive <> -1 Then + $LTD = StringSplit($Add_FirstAcvtive, ' ') + _GUICtrlListView_SetItemText($ListviewAPs, $line, _DateTimeLocalFormat(_DateTimeUtcConvert($LTD[1], $LTD[2], 0)), $column_FirstActive) + EndIf + If $Add_LastActive <> -1 Then + $LTD = StringSplit($Add_LastActive, ' ') + _GUICtrlListView_SetItemText($ListviewAPs, $line, _DateTimeLocalFormat(_DateTimeUtcConvert($LTD[1], $LTD[2], 0)), $column_LastActive) + EndIf +EndFunc ;==>_ListViewAdd + +Func _SetListviewWidths() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SetListviewWidths()') ;#Debug Display + ;Set column widths - All variables have ' - 0' after them to make this work. it would not set column widths without the ' - 0' + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_Line - 0, $column_Width_Line - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_Active - 0, $column_Width_Active - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_SSID - 0, $column_Width_SSID - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_BSSID - 0, $column_Width_BSSID - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_MANUF - 0, $column_Width_MANUF - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_Signal - 0, $column_Width_Signal - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_HighSignal - 0, $column_Width_HighSignal - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_RSSI - 0, $column_Width_RSSI - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_HighRSSI - 0, $column_Width_HighRSSI - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_Authentication - 0, $column_Width_Authentication - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_Encryption - 0, $column_Width_Encryption - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_RadioType - 0, $column_Width_RadioType - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_Channel - 0, $column_Width_Channel - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_Latitude - 0, $column_Width_Latitude - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_Longitude - 0, $column_Width_Longitude - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_LatitudeDMS - 0, $column_Width_LatitudeDMS - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_LongitudeDMS - 0, $column_Width_LongitudeDMS - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_LatitudeDMM - 0, $column_Width_LatitudeDMM - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_LongitudeDMM - 0, $column_Width_LongitudeDMM - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_BasicTransferRates - 0, $column_Width_BasicTransferRates - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_OtherTransferRates - 0, $column_Width_OtherTransferRates - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_FirstActive - 0, $column_Width_FirstActive - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_LastActive - 0, $column_Width_LastActive - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_NetworkType - 0, $column_Width_NetworkType - 0) + _GUICtrlListView_SetColumnWidth($ListviewAPs, $column_Label - 0, $column_Width_Label - 0) +EndFunc ;==>_SetListviewWidths + +Func _GetListviewWidths() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GetListviewWidths()') ;#Debug Display + $column_Width_Line = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Line - 0) + $column_Width_Active = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Active - 0) + $column_Width_SSID = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_SSID - 0) + $column_Width_BSSID = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_BSSID - 0) + $column_Width_MANUF = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_MANUF - 0) + $column_Width_Signal = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Signal - 0) + $column_Width_HighSignal = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_HighSignal - 0) + $column_Width_RSSI = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_RSSI - 0) + $column_Width_HighRSSI = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_HighRSSI - 0) + $column_Width_Authentication = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Authentication - 0) + $column_Width_Encryption = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Encryption - 0) + $column_Width_RadioType = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_RadioType - 0) + $column_Width_Channel = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Channel - 0) + $column_Width_Latitude = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Latitude - 0) + $column_Width_Longitude = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Longitude - 0) + $column_Width_LatitudeDMS = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_LatitudeDMS - 0) + $column_Width_LongitudeDMS = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_LongitudeDMS - 0) + $column_Width_LatitudeDMM = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_LatitudeDMM - 0) + $column_Width_LongitudeDMM = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_LongitudeDMM - 0) + $column_Width_BasicTransferRates = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_BasicTransferRates - 0) + $column_Width_OtherTransferRates = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_OtherTransferRates - 0) + $column_Width_FirstActive = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_FirstActive - 0) + $column_Width_LastActive = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_LastActive - 0) + $column_Width_NetworkType = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_NetworkType - 0) + $column_Width_Label = _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Label - 0) +EndFunc ;==>_GetListviewWidths + +Func _TreeViewAdd($ImpApID, $ImpSSID, $ImpBSSID, $ImpCHAN, $ImpNET, $ImpENCR, $ImpRAD, $ImpAUTH, $ImpBTX, $ImpOTX, $ImpMANU, $ImpLAB) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_TreeViewAdd()') ;#Debug Display + ;Format Treeview Names + $channel_treeviewname = StringFormat("%03i", $ImpCHAN) + $SSID_treeviewname = '(' & $ImpSSID & ')' + $Encryption_treeviewname = $ImpENCR + $Authentication_treeviewname = $ImpAUTH + $NetworkType_treeviewname = $ImpNET + ;Create sub menu item for AP details + _AddTreeviewItem('CHAN', $TreeviewAPs, $channel_tree, $channel_treeviewname, $ImpApID, $ImpSSID, $ImpBSSID, $ImpCHAN, $ImpNET, $ImpENCR, $ImpRAD, $ImpAUTH, $ImpBTX, $ImpOTX, $ImpMANU, $ImpLAB) + _AddTreeviewItem('SSID', $TreeviewAPs, $SSID_tree, $SSID_treeviewname, $ImpApID, $ImpSSID, $ImpBSSID, $ImpCHAN, $ImpNET, $ImpENCR, $ImpRAD, $ImpAUTH, $ImpBTX, $ImpOTX, $ImpMANU, $ImpLAB) + _AddTreeviewItem('ENCR', $TreeviewAPs, $Encryption_tree, $Encryption_treeviewname, $ImpApID, $ImpSSID, $ImpBSSID, $ImpCHAN, $ImpNET, $ImpENCR, $ImpRAD, $ImpAUTH, $ImpBTX, $ImpOTX, $ImpMANU, $ImpLAB) + _AddTreeviewItem('AUTH', $TreeviewAPs, $Authentication_tree, $Authentication_treeviewname, $ImpApID, $ImpSSID, $ImpBSSID, $ImpCHAN, $ImpNET, $ImpENCR, $ImpRAD, $ImpAUTH, $ImpBTX, $ImpOTX, $ImpMANU, $ImpLAB) + _AddTreeviewItem('NETTYPE', $TreeviewAPs, $NetworkType_tree, $NetworkType_treeviewname, $ImpApID, $ImpSSID, $ImpBSSID, $ImpCHAN, $ImpNET, $ImpENCR, $ImpRAD, $ImpAUTH, $ImpBTX, $ImpOTX, $ImpMANU, $ImpLAB) +EndFunc ;==>_TreeViewAdd + +Func _AddTreeviewItem($RootTree, $Treeview, $tree, $SubTreeName, $ImpApID, $ImpSSID, $ImpBSSID, $ImpCHAN, $ImpNET, $ImpENCR, $ImpRAD, $ImpAUTH, $ImpBTX, $ImpOTX, $ImpMANU, $ImpLAB) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AddTreeviewItem()') ;#Debug Display + $query = "SELECT TOP 1 SubTreePos FROM TreeviewPos WHERE RootTree='" & $RootTree & "' And SubTreeName='" & StringReplace($SubTreeName, "'", "''") & "'" + $TreeMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundTreeMatch = UBound($TreeMatchArray) - 1 + If $FoundTreeMatch = 0 Then + $treeviewposition = _GUICtrlTreeView_InsertItem($Treeview, $SubTreeName, $tree) + Else + $treeviewposition = $TreeMatchArray[1][1] + EndIf + $subtreeviewposition = _GUICtrlTreeView_InsertItem($Treeview, '(' & $ImpSSID & ')', $treeviewposition) + $st_ssid = _GUICtrlTreeView_InsertItem($Treeview, $Column_Names_SSID & ' : ' & $ImpSSID, $subtreeviewposition) + $st_bssid = _GUICtrlTreeView_InsertItem($Treeview, $Column_Names_BSSID & ' : ' & $ImpBSSID, $subtreeviewposition) + $st_chan = _GUICtrlTreeView_InsertItem($Treeview, $Column_Names_Channel & ' : ' & StringFormat("%03i", $ImpCHAN), $subtreeviewposition) + $st_net = _GUICtrlTreeView_InsertItem($Treeview, $Column_Names_NetworkType & ' : ' & $ImpNET, $subtreeviewposition) + $st_encr = _GUICtrlTreeView_InsertItem($Treeview, $Column_Names_Encryption & ' : ' & $ImpENCR, $subtreeviewposition) + $st_rad = _GUICtrlTreeView_InsertItem($Treeview, $Column_Names_RadioType & ' : ' & $ImpRAD, $subtreeviewposition) + $st_auth = _GUICtrlTreeView_InsertItem($Treeview, $Column_Names_Authentication & ' : ' & $ImpAUTH, $subtreeviewposition) + $st_btx = _GUICtrlTreeView_InsertItem($Treeview, $Column_Names_BasicTransferRates & ' : ' & $ImpBTX, $subtreeviewposition) + $st_otx = _GUICtrlTreeView_InsertItem($Treeview, $Column_Names_OtherTransferRates & ' : ' & $ImpOTX, $subtreeviewposition) + $st_manu = _GUICtrlTreeView_InsertItem($Treeview, $Column_Names_MANUF & ' : ' & $ImpMANU, $subtreeviewposition) + $st_lab = _GUICtrlTreeView_InsertItem($Treeview, $Column_Names_Label & ' : ' & $ImpLAB, $subtreeviewposition) + ;Write treeview position information to DB + ReDim $AddTreeRecordArray[17] + $AddTreeRecordArray[0] = 16 + $AddTreeRecordArray[1] = $ImpApID + $AddTreeRecordArray[2] = $RootTree + $AddTreeRecordArray[3] = $SubTreeName + $AddTreeRecordArray[4] = $treeviewposition + $AddTreeRecordArray[5] = $subtreeviewposition + $AddTreeRecordArray[6] = $st_ssid + $AddTreeRecordArray[7] = $st_bssid + $AddTreeRecordArray[8] = $st_chan + $AddTreeRecordArray[9] = $st_net + $AddTreeRecordArray[10] = $st_encr + $AddTreeRecordArray[11] = $st_rad + $AddTreeRecordArray[12] = $st_auth + $AddTreeRecordArray[13] = $st_btx + $AddTreeRecordArray[14] = $st_otx + $AddTreeRecordArray[15] = $st_manu + $AddTreeRecordArray[16] = $st_lab + _AddRecord($VistumblerDB, "TreeviewPos", $DB_OBJ, $AddTreeRecordArray) +EndFunc ;==>_AddTreeviewItem + +Func _TreeViewRemove($ImpApID) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_TreeViewRemove()') ;#Debug Display + _RemoveTreeviewItem($TreeviewAPs, 'CHAN', $ImpApID) + _RemoveTreeviewItem($TreeviewAPs, 'SSID', $ImpApID) + _RemoveTreeviewItem($TreeviewAPs, 'ENCR', $ImpApID) + _RemoveTreeviewItem($TreeviewAPs, 'AUTH', $ImpApID) + _RemoveTreeviewItem($TreeviewAPs, 'NETTYPE', $ImpApID) +EndFunc ;==>_TreeViewRemove + +Func _RemoveTreeviewItem($Treeview, $RootTree, $ImpApID) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_RemoveTreeviewItem()') ;#Debug Display + $query = "SELECT SubTreePos, InfoSubPos FROM TreeviewPos WHERE ApID=" & $ImpApID & " And RootTree='" & $RootTree & "'" + $TreeMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundTreeMatch = UBound($TreeMatchArray) - 1 + If $FoundTreeMatch = 1 Then + $STP = $TreeMatchArray[1][1] + $ISP = $TreeMatchArray[1][2] + $query = "SELECT TOP 1 SubTreePos FROM TreeviewPos WHERE ApID<>" & $ImpApID & " And SubTreePos=" & $STP & " And RootTree='" & $RootTree & "'" + $TreeMatchArray2 = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundTreeMatch2 = UBound($TreeMatchArray2) - 1 + If $FoundTreeMatch2 = 0 Then _GUICtrlTreeView_Delete($Treeview, $STP) + EndIf + $query = "DELETE FROM TreeviewPos WHERE ApID=" & $ImpApID & " And RootTree='" & $RootTree & "'" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) +EndFunc ;==>_RemoveTreeviewItem + +Func _FilterRemoveNonMatchingInList($Batch = 0) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_FilterRemoveNonMatchingInList()') ;#Debug Display + If $Batch = 1 Or $TempBatchListviewDelete = 1 Then + _GUICtrlListView_BeginUpdate($ListviewAPs) + _GUICtrlTreeView_BeginUpdate($TreeviewAPs) + EndIf + If StringInStr($RemoveQuery, 'WHERE') Then + $query = $RemoveQuery & " And (Listrow<>-1)" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + If $ApMatchArray[0][0] <> 0 Then + For $frnm = 1 To $ApMatchArray[0][0] + $fApID = $ApMatchArray[$frnm][1] + ;Get ListRow of AP + $query = "Select ListRow FROM AP WHERE ApID=" & $fApID + ;ConsoleWrite($query & @CRLF) + $ListRowArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $fListRow = $ListRowArray[1][1] + _TreeViewRemove($fApID) + ;Delete AP Row + _GUICtrlListView_DeleteItem($ListviewAPs, $fListRow) + ;Set AP ListRow to -1 + $query = "UPDATE AP SET ListRow=-1 WHERE ApID=" & $fApID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + ;Subtract 1 from all listsrows higher that the one being deleted + $query = "Select ApID, ListRow FROM AP WHERE ListRow<>-1" + $ListRowArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ListRowMatch = UBound($ListRowArray) - 1 + If $ListRowMatch <> 0 Then + For $lrnu = 1 To $ListRowMatch + $lApID = $ListRowArray[$lrnu][1] + $lListRow = $ListRowArray[$lrnu][2] + If StringFormat("%09i", $lListRow) > StringFormat("%09i", $fListRow) Then + $nListRow = $lListRow - 1 + $query = "UPDATE AP SET ListRow=" & $nListRow & " WHERE ApID=" & $lApID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + EndIf + Next + _FixListIcons() + EndIf + Next + EndIf + EndIf + If $Batch = 1 Or $TempBatchListviewDelete = 1 Then + _GUICtrlListView_EndUpdate($ListviewAPs) + _GUICtrlTreeView_EndUpdate($TreeviewAPs) + $TempBatchListviewDelete = 0 + EndIf +EndFunc ;==>_FilterRemoveNonMatchingInList + +Func _UpdateListview($Batch = 0) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_UpdateListview()') ;#Debug Display + If $Batch = 1 Or $TempBatchListviewInsert = 1 Then + _GUICtrlListView_BeginUpdate($ListviewAPs) + _GUICtrlTreeView_BeginUpdate($TreeviewAPs) + EndIf + ;Find APs that meet criteria but are not in the listview + If StringInStr($AddQuery, "WHERE") Then + $fquery = $AddQuery & " AND ListRow=-1" + Else + $fquery = $AddQuery & " WHERE ListRow=-1" + EndIf + $LoadApMatchArray = _RecordSearch($VistumblerDB, $fquery, $DB_OBJ) + $FoundLoadApMatch = UBound($LoadApMatchArray) - 1 + + If $AutoSort = 0 Then + For $imp = 1 To $FoundLoadApMatch + $ImpApID = $LoadApMatchArray[$imp][1] + $ImpSSID = $LoadApMatchArray[$imp][2] + $ImpBSSID = $LoadApMatchArray[$imp][3] + $ImpNET = $LoadApMatchArray[$imp][4] + $ImpRAD = $LoadApMatchArray[$imp][5] + $ImpCHAN = $LoadApMatchArray[$imp][6] + $ImpAUTH = $LoadApMatchArray[$imp][7] + $ImpENCR = $LoadApMatchArray[$imp][8] + $ImpSecType = $LoadApMatchArray[$imp][9] + $ImpBTX = $LoadApMatchArray[$imp][10] + $ImpOTX = $LoadApMatchArray[$imp][11] + $ImpMANU = $LoadApMatchArray[$imp][12] + $ImpLAB = $LoadApMatchArray[$imp][13] + $ImpHighGpsHistID = $LoadApMatchArray[$imp][14] + $ImpFirstHistID = $LoadApMatchArray[$imp][15] + $ImpLastHistID = $LoadApMatchArray[$imp][16] + $ImpLastGpsID = $LoadApMatchArray[$imp][17] + $ImpActive = $LoadApMatchArray[$imp][18] + $ImpHighSignal = $LoadApMatchArray[$imp][19] + $ImpHighRSSI = $LoadApMatchArray[$imp][20] + ;Get GPS Position + If $ImpHighGpsHistID = 0 Then + $ImpLat = 'N 0000.0000' + $ImpLon = 'E 0000.0000' + Else + $query = "SELECT GpsID FROM Hist WHERE HistID=" & $ImpHighGpsHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ImpGID = $HistMatchArray[1][1] + $query = "SELECT Latitude, Longitude FROM GPS WHERE GpsID=" & $ImpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + $ImpLat = $GpsMatchArray[1][1] + $ImpLon = $GpsMatchArray[1][2] + EndIf + ;Get First Time + $query = "SELECT Date1, Time1 FROM Hist WHERE HistID=" & $ImpFirstHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ImpDate = $HistMatchArray[1][1] + $ImpTime = $HistMatchArray[1][2] + $ImpFirstDateTime = $ImpDate & ' ' & $ImpTime + ;Get Last Time + $query = "SELECT Date1, Time1, Signal, RSSI FROM Hist WHERE HistID=" & $ImpLastHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ImpDate = $HistMatchArray[1][1] + $ImpTime = $HistMatchArray[1][2] + $ImpSig = $HistMatchArray[1][3] + $ImpRSSI = $HistMatchArray[1][4] + $ImpLastDateTime = $ImpDate & ' ' & $ImpTime + ;If AP is not active, mark as dead and set signal to 0 + If $ImpActive <> 0 And $ImpSig <> 0 Then + $LActive = $Text_Active + Else + $LActive = $Text_Dead + $ImpSig = '0' + $ImpRSSI = '-100' + EndIf + + ;Add APs to top of list + If $AddDirection = 0 Then + $query = "UPDATE AP SET ListRow=ListRow+1 WHERE ListRow<>-1" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + $DBAddPos = 0 + Else ;Add to bottom + $DBAddPos = -1 + EndIf + + ;Add New Listrow with Icon + If $Batch = 0 And $TempBatchListviewInsert = 0 Then _GUICtrlListView_BeginUpdate($ListviewAPs) + $ListRow = _AddIconListRow($ImpSig, $ImpSecType, $ImpApID, $DBAddPos) + _ListViewAdd($ListRow, $ImpApID, $LActive, $ImpBSSID, $ImpSSID, $ImpAUTH, $ImpENCR, $ImpSig, $ImpHighSignal, $ImpRSSI, $ImpHighRSSI, $ImpCHAN, $ImpRAD, $ImpBTX, $ImpOTX, $ImpNET, $ImpFirstDateTime, $ImpLastDateTime, $ImpLat, $ImpLon, $ImpMANU, $ImpLAB) + If $Batch = 0 And $TempBatchListviewInsert = 0 Then _GUICtrlListView_EndUpdate($ListviewAPs) + $query = "UPDATE AP SET ListRow=" & $ListRow & " WHERE ApID=" & $ImpApID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + ;Add Into TreeView + If $Batch = 0 And $TempBatchListviewInsert = 0 Then _GUICtrlTreeView_BeginUpdate($TreeviewAPs) + _TreeViewAdd($ImpApID, $ImpSSID, $ImpBSSID, $ImpCHAN, $ImpNET, $ImpENCR, $ImpRAD, $ImpAUTH, $ImpBTX, $ImpOTX, $ImpMANU, $ImpLAB) + If $Batch = 0 And $TempBatchListviewInsert = 0 Then _GUICtrlTreeView_EndUpdate($TreeviewAPs) + Next + Else + Local $ListRowPos = -1, $DbColName, $SortDir + ;Mark APs that are not in the list but meet the criteria + For $imp = 1 To $FoundLoadApMatch + ;Set the ListRow to -2 so it gets added later + $ImpApID = $LoadApMatchArray[$imp][1] + $query = "UPDATE AP SET ListRow=-2 WHERE ApID=" & $ImpApID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + Next + ;Get Sort Direction from settings + If $SortDirection = 1 Then + $SortDir = "DESC" + Else + $SortDir = "ASC" + EndIf + $DbCol = _GetDbColNameByListColName($SortBy) ;Set DB Column to sort by + ;ConsoleWrite("$DbCol:" & $DbCol & " $SortDir:" & $SortDir & @CRLF) + If $DbCol = "Latitude" Or $DbCol = "Longitude" Then ; Sort by Latitude Or Longitude + ;Add results that have no GPS postion first if DESC + If $SortDir = "DESC" Then + $query = "SELECT ListRow, ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active, Signal, HighSignal, RSSI, HighRSSI FROM AP WHERE HighGpsHistID=0 And ListRow<>-1 ORDER BY ApID " & $SortDir + $ListRowPos = __UpdateListviewDbQueryToList($query, $ListRowPos) + EndIf + ;Add sorted results with GPS + If $DbCol = "Latitude" Then $query = "SELECT AP.ListRow, AP.ApID, AP.SSID, AP.BSSID, AP.NETTYPE, AP.RADTYPE, AP.CHAN, AP.AUTH, AP.ENCR, AP.SecType, AP.BTX, AP.OTX, AP.MANU, AP.LABEL, AP.HighGpsHistID, AP.FirstHistID, AP.LastHistID, AP.LastGpsID, AP.Active, AP.Signal, AP.HighSignal, AP.RSSI, AP.HighRSSI FROM (AP INNER JOIN Hist ON AP.HighGpsHistId = Hist.HistID) INNER JOIN GPS ON Hist.GpsID = GPS.GPSID WHERE ListRow<>-1 ORDER BY GPS.Latitude " & $SortDir & ", GPS.Longitude " & $SortDir & ", AP.ApID " & $SortDir + If $DbCol = "Longitude" Then $query = "SELECT AP.ListRow, AP.ApID, AP.SSID, AP.BSSID, AP.NETTYPE, AP.RADTYPE, AP.CHAN, AP.AUTH, AP.ENCR, AP.SecType, AP.BTX, AP.OTX, AP.MANU, AP.LABEL, AP.HighGpsHistID, AP.FirstHistID, AP.LastHistID, AP.LastGpsID, AP.Active, AP.Signal, AP.HighSignal, AP.RSSI, AP.HighRSSI FROM (AP INNER JOIN Hist ON AP.HighGpsHistId = Hist.HistID) INNER JOIN GPS ON Hist.GpsID = GPS.GPSID WHERE ListRow<>-1 ORDER BY GPS.Longitude " & $SortDir & ", GPS.Latitude " & $SortDir & ", AP.ApID " & $SortDir + $ListRowPos = __UpdateListviewDbQueryToList($query, $ListRowPos) + ;Add results that have no GPS postion last if ASC + If $SortDir = "ASC" Then + $query = "SELECT ListRow, ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active, Signal, HighSignal, RSSI, HighRSSI FROM AP WHERE HighGpsHistID=0 And ListRow<>-1 ORDER BY ApID " & $SortDir + $ListRowPos = __UpdateListviewDbQueryToList($query, $ListRowPos) + EndIf + ElseIf $DbCol = "FirstActive" Then ; Sort by First Active Time + $query = "SELECT AP.ListRow, AP.ApID, AP.SSID, AP.BSSID, AP.NETTYPE, AP.RADTYPE, AP.CHAN, AP.AUTH, AP.ENCR, AP.SecType, AP.BTX, AP.OTX, AP.MANU, AP.LABEL, AP.HighGpsHistID, AP.FirstHistID, AP.LastHistID, AP.LastGpsID, AP.Active, AP.Signal, AP.HighSignal, AP.RSSI, AP.HighRSSI, Hist.Date1, Hist.Time1 FROM AP INNER JOIN Hist ON AP.FirstHistID = Hist.HistID WHERE ListRow<>-1 ORDER BY Hist.Date1 " & $SortDir & ", Hist.Time1 " & $SortDir & ", AP.ApID " & $SortDir + $ListRowPos = __UpdateListviewDbQueryToList($query, $ListRowPos) + ElseIf $DbCol = "LastActive" Then ; Sort by Last Active Time + $query = "SELECT AP.ListRow, AP.ApID, AP.SSID, AP.BSSID, AP.NETTYPE, AP.RADTYPE, AP.CHAN, AP.AUTH, AP.ENCR, AP.SecType, AP.BTX, AP.OTX, AP.MANU, AP.LABEL, AP.HighGpsHistID, AP.FirstHistID, AP.LastHistID, AP.LastGpsID, AP.Active, AP.Signal, AP.HighSignal, AP.RSSI, AP.HighRSSI, Hist.Date1, Hist.Time1 FROM AP INNER JOIN Hist ON AP.LastHistID = Hist.HistID WHERE ListRow<>-1 ORDER BY Hist.Date1 " & $SortDir & ", Hist.Time1 " & $SortDir & ", AP.ApID " & $SortDir + $ListRowPos = __UpdateListviewDbQueryToList($query, $ListRowPos) + ElseIf $DbCol = "Signal" Or $DbCol = "HighSignal" Or $DbCol = "RSSI" Or $DbCol = "HighRSSI" Or $DbCol = "CHAN" Then ; Sort by Last Active Time + $query = "SELECT ListRow, ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active, Signal, HighSignal, RSSI, HighRSSI FROM AP WHERE ListRow<>-1 ORDER BY " & $DbCol & " " & $SortDir & ", ApID " & $SortDir + $ListRowPos = __UpdateListviewDbQueryToList($query, $ListRowPos) + Else ; Sort by any other column + $query = "SELECT ListRow, ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active, Signal, HighSignal, RSSI, HighRSSI FROM AP WHERE ListRow<>-1 ORDER BY " & $DbCol & " " & $SortDir & ", ApID " & $SortDir + $ListRowPos = __UpdateListviewDbQueryToList($query, $ListRowPos) + EndIf + EndIf + If $Batch = 1 Or $TempBatchListviewInsert = 1 Then + _GUICtrlListView_EndUpdate($ListviewAPs) + _GUICtrlTreeView_EndUpdate($TreeviewAPs) + $TempBatchListviewInsert = 0 + EndIf +EndFunc ;==>_UpdateListview + +Func __UpdateListviewDbQueryToList($query, $listpos) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '__UpdateListviewDbQueryToList()') ;#Debug Display + If $MinimalGuiMode = 0 Then + $ListCurrentRowCount = _GUICtrlListView_GetItemCount($ListviewAPs) + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + For $wlv = 1 To $FoundApMatch + $listpos += 1 + $Found_ListRow = $ApMatchArray[$wlv][1] + If $Found_ListRow <> $listpos Then ;If row has changed, update list information + $Found_APID = $ApMatchArray[$wlv][2] + $Found_SSID = $ApMatchArray[$wlv][3] + $Found_BSSID = $ApMatchArray[$wlv][4] + $Found_NETTYPE = $ApMatchArray[$wlv][5] + $Found_RADTYPE = $ApMatchArray[$wlv][6] + $Found_CHAN = $ApMatchArray[$wlv][7] + $Found_AUTH = $ApMatchArray[$wlv][8] + $Found_ENCR = $ApMatchArray[$wlv][9] + $Found_SecType = $ApMatchArray[$wlv][10] + $Found_BTX = $ApMatchArray[$wlv][11] + $Found_OTX = $ApMatchArray[$wlv][12] + $Found_MANU = $ApMatchArray[$wlv][13] + $Found_LABEL = $ApMatchArray[$wlv][14] + $Found_HighGpsHistId = $ApMatchArray[$wlv][15] + $Found_FirstHistID = $ApMatchArray[$wlv][16] + $Found_LastHistID = $ApMatchArray[$wlv][17] + $Found_LastGpsID = $ApMatchArray[$wlv][18] + $Found_Active = $ApMatchArray[$wlv][19] + $Found_Signal = $ApMatchArray[$wlv][20] + $Found_HighSignal = $ApMatchArray[$wlv][21] + $Found_RSSI = $ApMatchArray[$wlv][22] + $Found_HighRSSI = $ApMatchArray[$wlv][23] + + ;Get First Time + $query = "SELECT Date1, Time1 FROM Hist WHERE HistID=" & $Found_FirstHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_FirstDate = $HistMatchArray[1][1] + $Found_FirstTime = $HistMatchArray[1][2] + $Found_FirstDateTime = $Found_FirstDate & ' ' & $Found_FirstTime + + ;Get Last Time + $query = "SELECT Date1, Time1 FROM Hist WHERE HistID=" & $Found_LastHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_LastDate = $HistMatchArray[1][1] + $Found_LastTime = $HistMatchArray[1][2] + $Found_LastDateTime = $Found_LastDate & ' ' & $Found_LastTime + + ;Get GPS Position + If $Found_HighGpsHistId = 0 Then + $Found_Lat = "N 0000.0000" + $Found_Lon = "E 0000.0000" + Else + $query = "SELECT GpsID FROM Hist WHERE HistID=" & $Found_HighGpsHistId + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_GpsID = $HistMatchArray[1][1] + $query = "SELECT Latitude, Longitude FROM GPS WHERE GPSID=" & $Found_GpsID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_Lat = $GpsMatchArray[1][1] + $Found_Lon = $GpsMatchArray[1][2] + EndIf + + If $wlv > $ListCurrentRowCount Then + ;Add new row with icon to the bottom of the list + _GUICtrlListView_BeginUpdate($ListviewAPs) + $ListRow = _AddIconListRow($Found_Signal, $Found_SecType, $Found_APID, -1) + ;Write changes to listview + _ListViewAdd($ListRow, $Found_APID, $Found_Active, $Found_BSSID, $Found_SSID, $Found_AUTH, $Found_ENCR, $Found_Signal, $Found_HighSignal, $Found_RSSI, $Found_HighRSSI, $Found_CHAN, $Found_RADTYPE, $Found_BTX, $Found_OTX, $Found_NETTYPE, $Found_FirstDateTime, $Found_LastDateTime, $Found_Lat, $Found_Lon, $Found_MANU, $Found_LABEL) + _GUICtrlListView_EndUpdate($ListviewAPs) + ;Update ListRow + $query = "UPDATE AP SET ListRow=" & $ListRow & " WHERE ApID=" & $Found_APID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + ;Add Into TreeView + _GUICtrlTreeView_BeginUpdate($TreeviewAPs) + _TreeViewAdd($Found_APID, $Found_SSID, $Found_BSSID, $Found_CHAN, $Found_NETTYPE, $Found_ENCR, $Found_RADTYPE, $Found_AUTH, $Found_BTX, $Found_OTX, $Found_MANU, $Found_LABEL) + _GUICtrlTreeView_EndUpdate($TreeviewAPs) + Else + ;Write changes to listview + _GUICtrlListView_BeginUpdate($ListviewAPs) + _GUICtrlListView_BeginUpdate($ListviewAPs) + _ListViewAdd($listpos, $Found_APID, $Found_Active, $Found_BSSID, $Found_SSID, $Found_AUTH, $Found_ENCR, $Found_Signal, $Found_HighSignal, $Found_RSSI, $Found_HighRSSI, $Found_CHAN, $Found_RADTYPE, $Found_BTX, $Found_OTX, $Found_NETTYPE, $Found_FirstDateTime, $Found_LastDateTime, $Found_Lat, $Found_Lon, $Found_MANU, $Found_LABEL) + ;Update ListRow Icon + _UpdateIcon($listpos, $Found_Signal, $Found_SecType) + _GUICtrlListView_EndUpdate($ListviewAPs) + ;Update ListRow + $query = "UPDATE AP SET ListRow=" & $listpos & " WHERE ApID=" & $Found_APID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + EndIf + EndIf + Next + ;Remove extra rows + If $ListCurrentRowCount > $FoundApMatch Then + _GUICtrlListView_BeginUpdate($ListviewAPs) + For $remrow = $FoundApMatch To $ListCurrentRowCount + _GUICtrlListView_DeleteItem($ListviewAPs, $remrow) + Next + _GUICtrlListView_EndUpdate($ListviewAPs) + EndIf + EndIf +EndFunc ;==>__UpdateListviewDbQueryToList + +Func _ClearAllAp() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ClearAllAp()') ;#Debug Display + ;Reset Variables + $APID = 0 + $CamID = 0 + $GPS_ID = 0 + $HISTID = 0 + ;Clear DB + $query = "DELETE * FROM AP" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + $query = "DELETE * FROM Cam" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + $query = "DELETE * FROM GPS" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + $query = "DELETE * FROM Hist" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + $query = "DELETE * FROM TreeviewPos" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + $query = "DELETE * FROM LoadedFiles" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + ;Update Column Widths + _GetListviewWidths() + ;Update Column Order + Local $sheaders + $currentcolumn = StringSplit(_GUICtrlListView_GetColumnOrder($ListviewAPs), '|') + For $c = 1 To $currentcolumn[0] + $cinfo = _GUICtrlListView_GetColumn($ListviewAPs, $currentcolumn[$c] - 0) + $sheaders &= $cinfo[5] & '|' + If $column_Line = $currentcolumn[$c] Then $save_column_Line = $c - 1 + If $column_Active = $currentcolumn[$c] Then $save_column_Active = $c - 1 + If $column_BSSID = $currentcolumn[$c] Then $save_column_BSSID = $c - 1 + If $column_SSID = $currentcolumn[$c] Then $save_column_SSID = $c - 1 + If $column_Signal = $currentcolumn[$c] Then $save_column_Signal = $c - 1 + If $column_HighSignal = $currentcolumn[$c] Then $save_column_HighSignal = $c - 1 + If $column_RSSI = $currentcolumn[$c] Then $save_column_RSSI = $c - 1 + If $column_HighRSSI = $currentcolumn[$c] Then $save_column_HighRSSI = $c - 1 + If $column_Channel = $currentcolumn[$c] Then $save_column_Channel = $c - 1 + If $column_Authentication = $currentcolumn[$c] Then $save_column_Authentication = $c - 1 + If $column_Encryption = $currentcolumn[$c] Then $save_column_Encryption = $c - 1 + If $column_NetworkType = $currentcolumn[$c] Then $save_column_NetworkType = $c - 1 + If $column_Latitude = $currentcolumn[$c] Then $save_column_Latitude = $c - 1 + If $column_Longitude = $currentcolumn[$c] Then $save_column_Longitude = $c - 1 + If $column_MANUF = $currentcolumn[$c] Then $save_column_MANUF = $c - 1 + If $column_Label = $currentcolumn[$c] Then $save_column_Label = $c - 1 + If $column_RadioType = $currentcolumn[$c] Then $save_column_RadioType = $c - 1 + If $column_LatitudeDMS = $currentcolumn[$c] Then $save_column_LatitudeDMS = $c - 1 + If $column_LongitudeDMS = $currentcolumn[$c] Then $save_column_LongitudeDMS = $c - 1 + If $column_LatitudeDMM = $currentcolumn[$c] Then $save_column_LatitudeDMM = $c - 1 + If $column_LongitudeDMM = $currentcolumn[$c] Then $save_column_LongitudeDMM = $c - 1 + If $column_BasicTransferRates = $currentcolumn[$c] Then $save_column_BasicTransferRates = $c - 1 + If $column_OtherTransferRates = $currentcolumn[$c] Then $save_column_OtherTransferRates = $c - 1 + If $column_FirstActive = $currentcolumn[$c] Then $save_column_FirstActive = $c - 1 + If $column_LastActive = $currentcolumn[$c] Then $save_column_LastActive = $c - 1 + Next + $headers = $sheaders + $column_Line = $save_column_Line + $column_Active = $save_column_Active + $column_BSSID = $save_column_BSSID + $column_SSID = $save_column_SSID + $column_Signal = $save_column_Signal + $column_HighSignal = $save_column_HighSignal + $column_RSSI = $save_column_RSSI + $column_HighRSSI = $save_column_HighRSSI + $column_Channel = $save_column_Channel + $column_Authentication = $save_column_Authentication + $column_Encryption = $save_column_Encryption + $column_NetworkType = $save_column_NetworkType + $column_Latitude = $save_column_Latitude + $column_Longitude = $save_column_Longitude + $column_MANUF = $save_column_MANUF + $column_Label = $save_column_Label + $column_RadioType = $save_column_RadioType + $column_LatitudeDMS = $save_column_LatitudeDMS + $column_LongitudeDMS = $save_column_LongitudeDMS + $column_LatitudeDMM = $save_column_LatitudeDMM + $column_LongitudeDMM = $save_column_LongitudeDMM + $column_BasicTransferRates = $save_column_BasicTransferRates + $column_OtherTransferRates = $save_column_OtherTransferRates + $column_FirstActive = $save_column_FirstActive + $column_LastActive = $save_column_LastActive + ;Recreate Listview + GUISwitch($Vistumbler) + _GUICtrlListView_DeleteAllItems($ListviewAPs) + ;GUICtrlDelete($ListviewAPs) + ;$ListviewAPs = GUICtrlCreateListView($headers, $ListviewAPs_left, $ListviewAPs_top, $ListviewAPs_width, $ListviewAPs_height, $LVS_REPORT + $LVS_SINGLESEL, $LVS_EX_HEADERDRAGDROP + $LVS_EX_GRIDLINES + $LVS_EX_FULLROWSELECT) + ;$ListviewAPs = _GUICtrlListView_Create($Vistumbler, $headers, 260, 65, 725, 585, BitOR($LVS_REPORT, $LVS_SINGLESEL)) + ;_GUICtrlListView_SetExtendedListViewStyle($ListviewAPs, BitOR($LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER)) + ;$hImage = _GUIImageList_Create() + ;_GUIImageList_AddIcon($hImage, $IconDir & "Signal\open-grey.ico") + ;_GUIImageList_AddIcon($hImage, $IconDir & "Signal\open-red.ico") + ;_GUIImageList_AddIcon($hImage, $IconDir & "Signal\open-orange.ico") + ;_GUIImageList_AddIcon($hImage, $IconDir & "Signal\open-yellow.ico") + ;_GUIImageList_AddIcon($hImage, $IconDir & "Signal\open-light-green.ico") + ;_GUIImageList_AddIcon($hImage, $IconDir & "Signal\open-green.ico") + ;_GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-grey.ico") + ;_GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-red.ico") + ;_GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-orange.ico") + ;_GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-yellow.ico") + ;_GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-light-green.ico") + ;_GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-green.ico") + ;_GUICtrlListView_SetImageList($ListviewAPs, $hImage, 1) + ;GUICtrlSetBkColor(-1, $ControlBackgroundColor) + _SetListviewWidths() + _SetControlSizes() + ;Clear Treeview + _GUICtrlTreeView_DeleteChildren($TreeviewAPs, $Authentication_tree) + _GUICtrlTreeView_DeleteChildren($TreeviewAPs, $channel_tree) + _GUICtrlTreeView_DeleteChildren($TreeviewAPs, $Encryption_tree) + _GUICtrlTreeView_DeleteChildren($TreeviewAPs, $NetworkType_tree) + _GUICtrlTreeView_DeleteChildren($TreeviewAPs, $SSID_tree) + $ClearAllAps = 0 +EndFunc ;==>_ClearAllAp + +Func _ClearListAndTree() + ;Clear Listview + _GUICtrlListView_DeleteAllItems($ListviewAPs) + ;Clear Treeview + _GUICtrlTreeView_DeleteChildren($TreeviewAPs, $Authentication_tree) + _GUICtrlTreeView_DeleteChildren($TreeviewAPs, $channel_tree) + _GUICtrlTreeView_DeleteChildren($TreeviewAPs, $Encryption_tree) + _GUICtrlTreeView_DeleteChildren($TreeviewAPs, $NetworkType_tree) + _GUICtrlTreeView_DeleteChildren($TreeviewAPs, $SSID_tree) + ;Reset Listview positions + $query = "UPDATE AP SET ListRow=-1" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + ;Reset Treeview positions + $query = "DELETE * FROM TreeviewPos" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + ;Reset flag + $ClearListAndTree = 0 +EndFunc ;==>_ClearListAndTree + +Func _FixLineNumbers() ;Update Listview Row Numbers in DataArray + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_FixLineNumbers()') ;#Debug Display + $ListViewSize = _GUICtrlListView_GetItemCount($ListviewAPs) - 1 ; Get List Size + For $lisviewrow = 0 To $ListViewSize + $APNUM = _GUICtrlListView_GetItemText($ListviewAPs, $lisviewrow, $column_Line) + $query = "UPDATE AP SET ListRow=" & $lisviewrow & " WHERE ApId=" & $APNUM + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + Next +EndFunc ;==>_FixLineNumbers + +Func _FixListIcons() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_FixListIcons()') ;#Debug Display + $query = "SELECT ListRow, SecType, Signal FROM AP WHERE ListRow<>-1" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + ;Update in Listview + For $resetdead = 1 To $FoundApMatch + $Found_ListRow = $ApMatchArray[$resetdead][1] + $Found_SecType = $ApMatchArray[$resetdead][2] + $Found_Signal = $ApMatchArray[$resetdead][3] + _UpdateIcon($Found_ListRow, $Found_Signal, $Found_SecType) + Next +EndFunc ;==>_FixListIcons + +Func _RecoverMDB() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_RecoverMDB()') ;#Debug Display + GUICtrlSetData($msgdisplay, $Text_RecoveringMDB) + ;Get total APIDs + $query = "Select COUNT(ApID) FROM AP" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $APID = $ApMatchArray[1][1] + GUICtrlSetData($ActiveAPs, $Text_ActiveAPs & ': ' & "0 / " & $APID) + ;ConsoleWrite("APID:" & $APID & @CRLF) + ;Get total HistIDs + $query = "Select COUNT(HistID) FROM Hist" + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $HISTID = $HistMatchArray[1][1] + ;ConsoleWrite("HISTID:" & $HISTID & @CRLF) + ;Get total GPSIDs + $query = "Select COUNT(GpsID) FROM GPS" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $GPS_ID = $GpsMatchArray[1][1] + ;ConsoleWrite("GPS_ID:" & $GPS_ID & @CRLF) + ;Get total CamIDs + $query = "Select COUNT(CamID) FROM Cam" + $CamIDCountArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $CamID = $CamIDCountArray[1][1] + ;ConsoleWrite("CamID:" & $CamID & @CRLF) + ;Remove treeview postion table + $query = "DELETE * FROM TreeviewPos" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + ;Reset Listview positions and set all access points to inactive + $query = "UPDATE AP SET ListRow=-1, Active=0, Signal=0" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + If $MinimalGuiMode = 0 Then + ;Add APs into Listview and Treeview + _UpdateListview(1) + ;Update Labels and Manufacturers + _UpdateListMacLabels() + EndIf + GUICtrlSetData($msgdisplay, '') +EndFunc ;==>_RecoverMDB + +Func _SetUpDbTables($dbfile) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SetUpDbTables()') ;#Debug Display + _CreateDB($dbfile) + _AccessConnectConn($dbfile, $DB_OBJ) + _CreateTable($dbfile, 'GPS', $DB_OBJ) + _CreateTable($dbfile, 'AP', $DB_OBJ) + _CreateTable($dbfile, 'Hist', $DB_OBJ) + _CreateTable($dbfile, 'TreeviewPos', $DB_OBJ) + _CreateTable($dbfile, 'LoadedFiles', $DB_OBJ) + _CreateTable($dbfile, 'CAM', $DB_OBJ) + _CreatMultipleFields($dbfile, 'GPS', $DB_OBJ, 'GPSID INTEGER|Latitude TEXT(20)|Longitude TEXT(20)|NumOfSats TEXT(2)|HorDilPitch TEXT(255)|Alt TEXT(255)|Geo TEXT(255)|SpeedInMPH TEXT(255)|SpeedInKmH TEXT(255)|TrackAngle TEXT(255)|Date1 TEXT(50)|Time1 TEXT(50)') + _CreatMultipleFields($dbfile, 'AP', $DB_OBJ, 'ApID INTEGER|ListRow INTEGER|Active INTEGER|BSSID TEXT(20)|SSID TEXT(255)|CHAN INTEGER|AUTH TEXT(20)|ENCR TEXT(20)|SECTYPE INTEGER|NETTYPE TEXT(20)|RADTYPE TEXT(20)|BTX TEXT(100)|OTX TEXT(100)|HighGpsHistId INTEGER|LastGpsID INTEGER|FirstHistID INTEGER|LastHistID INTEGER|MANU TEXT(100)|LABEL TEXT(100)|Signal INTEGER|HighSignal INTEGER|RSSI INTEGER|HighRSSI INTEGER|CountryCode TEXT(100)|CountryName TEXT(100)|AdminCode TEXT(100)|AdminName TEXT(100)|Admin2Name TEXT(100)|AreaName TEXT(100)|GNAmiles FLOAT|GNAkm FLOAT') + _CreatMultipleFields($dbfile, 'Hist', $DB_OBJ, 'HistID INTEGER|ApID INTEGER|GpsID INTEGER|Signal INTEGER|RSSI INTEGER|Date1 TEXT(50)|Time1 TEXT(50)') + _CreatMultipleFields($dbfile, 'TreeviewPos', $DB_OBJ, 'ApID INTEGER|RootTree TEXT(255)|SubTreeName TEXT(255)|SubTreePos INTEGER|InfoSubPos INTEGER|SsidPos INTEGER|BssidPos INTEGER|ChanPos INTEGER|NetPos INTEGER|EncrPos INTEGER|RadPos INTEGER|AuthPos INTEGER|BtxPos INTEGER|OtxPos INTEGER|ManuPos INTEGER|LabPos INTEGER') + _CreatMultipleFields($dbfile, 'LoadedFiles', $DB_OBJ, 'File TEXT(255)|MD5 TEXT(255)') + _CreatMultipleFields($dbfile, 'CAM', $DB_OBJ, 'CamID INTEGER|CamGroup TEXT(255)|GpsID INTEGER|CamName TEXT(255)|CamFile TEXT(255)|ImgMD5 TEXT(255)|Date1 TEXT(255)|Time1 TEXT(255)') +EndFunc ;==>_SetUpDbTables + +;------------------------------------------------------------------------------------------------------------------------------- +; MANUFACTURER/LABEL FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _FindManufacturer($findmac) ;Returns Manufacturer for given Mac Address + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_FindManufacturer()') ;#Debug Display + $findmac = StringReplace($findmac, ':', '') + If StringLen($findmac) <> 6 Then $findmac = StringTrimRight($findmac, StringLen($findmac) - 6) + $query = "SELECT Manufacturer FROM Manufacturers WHERE BSSID = '" & $findmac & "'" + $ManuMatchArray = _RecordSearch($ManuDB, $query, $ManuDB_OBJ) + $FoundManuMatch = UBound($ManuMatchArray) - 1 + If $FoundManuMatch = 0 Then + Return ($Text_Unknown) + Else + $Manu = $ManuMatchArray[1][1] + Return ($Manu) + EndIf +EndFunc ;==>_FindManufacturer + +Func _SetLabels($findmac) ;Returns Label for given Mac Address + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SetLabels()') ;#Debug Display + $findmac = StringReplace($findmac, ':', '') + $query = "SELECT Label FROM Labels WHERE BSSID = '" & $findmac & "'" + $LabMatchArray = _RecordSearch($LabDB, $query, $LabDB_OBJ) + $FoundLabMatch = UBound($LabMatchArray) - 1 + If $FoundLabMatch = 0 Then + Return ($Text_Unknown) + Else + $LABEL = $LabMatchArray[1][1] + Return ($LABEL) + EndIf +EndFunc ;==>_SetLabels + +Func _UpdateListMacLabels() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_UpdateListMacLabels()') ;#Debug Display + GUICtrlSetData($msgdisplay, "Updating manufacturers") + $query = "SELECT BSSID, MANU, LABEL, ListRow, ApID FROM AP" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + For $up = 1 To $FoundApMatch + $Found_BSSID = $ApMatchArray[$up][1] + $Found_MANU = $ApMatchArray[$up][2] + $Found_LAB = $ApMatchArray[$up][3] + $Found_ListRow = $ApMatchArray[$up][4] + $Found_APID = $ApMatchArray[$up][5] + $New_MANU = _FindManufacturer($Found_BSSID) + $New_LAB = _SetLabels($Found_BSSID) + ;Set Manufacturer + If $Found_MANU <> $New_MANU Then + _GUICtrlListView_SetItemText($ListviewAPs, $Found_ListRow, $New_MANU, $column_MANUF) + $query = "UPDATE AP SET MANU='" & $New_MANU & "' WHERE ApID=" & $Found_APID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + EndIf + ;Set Label + If $Found_LAB <> $New_LAB Then + _GUICtrlListView_SetItemText($ListviewAPs, $Found_ListRow, $New_LAB, $column_Label) + $query = "UPDATE AP SET LABEL='" & $New_LAB & "' WHERE ApID=" & $Found_APID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + EndIf + Next +EndFunc ;==>_UpdateListMacLabels + +;------------------------------------------------------------------------------------------------------------------------------- +; TOGGLE/BUTTON FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _CloseToggle() ;Sets Close to 1 to exit vistumbler + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CloseToggle()') ;#Debug Display + $Close = 1 +EndFunc ;==>_CloseToggle + +Func _ExitSaveDB() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExitSaveDB()') ;#Debug Display + $SaveDbOnExit = 1 + _CloseToggle() +EndFunc ;==>_ExitSaveDB + +Func _ExitVistumbler() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExitVistumbler()') ;#Debug Display + If $newdata = 1 Then ;If Access point data has changed since /last save, ask user if they want to save the data + $savemsg = MsgBox(3, $Text_Save, $Text_SaveQuestion) + If $savemsg <> 2 Then + If $savemsg = 6 Then _ExportDetailedData() + _Exit(1) + EndIf + Else + _Exit(1) + EndIf + $Close = 0 +EndFunc ;==>_ExitVistumbler + +Func _Exit($SaveSettings = 1) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_Exit()') ;#Debug Display + _GDIPlus_Shutdown() + GUISetState(@SW_HIDE, $Vistumbler) + _AccessCloseConn($DB_OBJ) + _AccessCloseConn($ManuDB_OBJ) + _AccessCloseConn($LabDB_OBJ) + _AccessCloseConn($InstDB_OBJ) + ; Write current settings to back to INI file + If $SaveSettings = 1 Then _WriteINI() + $PID = -1 + $CloseTimer = TimerInit() + While $PID <> 0 + $PID = ProcessExists("Export.exe") + ProcessClose($PID) + If TimerDiff($CloseTimer) >= 10000 Then ExitLoop + WEnd + FileDelete($GoogleEarth_ActiveFile) + FileDelete($GoogleEarth_DeadFile) + FileDelete($GoogleEarth_GpsFile) + FileDelete($GoogleEarth_OpenFile) + FileDelete($GoogleEarth_TrackFile) + FileDelete($tempfile) + FileDelete($tempfile_showint) + If $SaveDbOnExit = 1 Then + FileMove($VistumblerDB, $SaveDir, 9) ;Move to save directory for later use + DirMove($VistumblerCamFolder, $SaveDir & StringTrimRight($VistumblerDbName, 4) & "\", 1) + Else + FileDelete($VistumblerDB) + FileDelete($VistumblerCamFolder & "*") + DirRemove($VistumblerCamFolder, 1) + EndIf + If $AutoRecoveryVS1Del = 1 Then FileDelete($AutoRecoveryVS1File) + If $UseGPS = 1 Then ;If GPS is active, stop it so the COM port does not stay open + _TurnOffGPS() + EndIf + + ;Exit Vistumbler + Exit +EndFunc ;==>_Exit + +Func ScanToggle() ;Turns AP scanning on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, 'ScanToggle()') ;#Debug Display + If $Scan = 1 Then + $Scan = 0 + GUICtrlSetState($ScanWifiGUI, $GUI_UNCHECKED) + GUICtrlSetData($ScanButton, $Text_ScanAPs) + GUICtrlSetBkColor($ScanButton, $ButtonInactiveColor) + Else + $Scan = 1 + GUICtrlSetState($ScanWifiGUI, $GUI_CHECKED) + GUICtrlSetData($ScanButton, $Text_StopScanAps) + GUICtrlSetBkColor($ScanButton, $ButtonActiveColor) + ;Refresh Wireless networks + _Wlan_Scan() + EndIf +EndFunc ;==>ScanToggle + +Func _AutoScanToggle() ;Turns auto scan on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AutoScanToggle()') ;#Debug Display + If $AutoScan = 1 Then + GUICtrlSetState($AutoScanMenu, $GUI_UNCHECKED) + $AutoScan = 0 + Else + GUICtrlSetState($AutoScanMenu, $GUI_CHECKED) + $AutoScan = 1 + EndIf +EndFunc ;==>_AutoScanToggle + +Func _AutoRefreshToggle() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AutoRefreshToggle()') ;#Debug Display + If $RefreshNetworks = 1 Then + GUICtrlSetState($RefreshMenuButton, $GUI_UNCHECKED) + $RefreshNetworks = 0 + Else + GUICtrlSetState($RefreshMenuButton, $GUI_CHECKED) + $RefreshNetworks = 1 + $RefreshTimer = TimerInit() + EndIf +EndFunc ;==>_AutoRefreshToggle + +Func _AutoConnectToggle() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AutoConnectToggle()') ;#Debug Display + If $AutoSelect = 1 Then + GUICtrlSetState($AutoSelectMenuButton, $GUI_UNCHECKED) + $AutoSelect = 0 + Else + GUICtrlSetState($AutoSelectMenuButton, $GUI_CHECKED) + $AutoSelect = 1 + EndIf +EndFunc ;==>_AutoConnectToggle + +Func _AutoSelHighSigToggle() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AutoSelHighSigToggle()') ;#Debug Display + If $AutoSelectHS = 1 Then + GUICtrlSetState($AutoSelectHighSignal, $GUI_UNCHECKED) + $AutoSelectHS = 0 + Else + GUICtrlSetState($AutoSelectHighSignal, $GUI_CHECKED) + $AutoSelectHS = 1 + EndIf +EndFunc ;==>_AutoSelHighSigToggle + +Func _ActiveApMidiToggle() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ActiveApMidiToggle()') ;#Debug Display + If $Midi_PlayForActiveAps = 1 Then + GUICtrlSetState($GUI_MidiActiveAps, $GUI_UNCHECKED) + $Midi_PlayForActiveAps = 0 + Else + GUICtrlSetState($GUI_MidiActiveAps, $GUI_CHECKED) + $Midi_PlayForActiveAps = 1 + EndIf +EndFunc ;==>_ActiveApMidiToggle + +Func _AutoKmlToggle() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AutoKmlToggle()') ;#Debug Display + If $AutoKML = 1 Then + GUICtrlSetState($AutoSaveKML, $GUI_UNCHECKED) + $AutoKML = 0 + Else + GUICtrlSetState($AutoSaveKML, $GUI_CHECKED) + $AutoKML = 1 + $kml_active_timer = TimerInit() + $kml_dead_timer = TimerInit() + $kml_gps_timer = TimerInit() + $kml_track_timer = TimerInit() + EndIf +EndFunc ;==>_AutoKmlToggle + +Func _GpsToggle() ;Turns GPS on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GpsToggle()') ;#Debug Display + If $UseGPS = 1 Then + $TurnOffGPS = 1 + Else + $openport = _OpenComPort($ComPort, $BAUD, $PARITY, $DATABIT, $STOPBIT) ;Open The GPS COM port + + If $openport = 1 Then + $UseGPS = 1 + GUICtrlSetData($GpsButton, $Text_StopGPS) + GUICtrlSetBkColor($GpsButton, $ButtonActiveColor) + $GPGGA_Update = TimerInit() + $GPRMC_Update = TimerInit() + Else + $UseGPS = 0 + GUICtrlSetData($msgdisplay, $Text_ErrorOpeningGpsPort) + EndIf + EndIf +EndFunc ;==>_GpsToggle + +Func _TurnOffGPS() ;Turns off GPS, resets variable + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_TurnOffGPS()') ;#Debug Display + $UseGPS = 0 + $TurnOffGPS = 0 + $disconnected_time = -1 + $Latitude = 'N 0000.0000' + $Longitude = 'E 0000.0000' + $Latitude2 = 'N 0000.0000' + $Longitude2 = 'E 0000.0000' + $NumberOfSatalites = '00' + $HorDilPitch = '0' + $Alt = '0' + $AltS = 'M' + $Geo = '0' + $GeoS = 'M' + $SpeedInKnots = '0' + $SpeedInMPH = '0' + $SpeedInKmH = '0' + $TrackAngle = '0' + _CloseComPort($ComPort) ;Close The GPS COM port + GUICtrlSetData($GpsButton, $Text_UseGPS) + GUICtrlSetBkColor($GpsButton, $ButtonInactiveColor) + GUICtrlSetData($msgdisplay, '') +EndFunc ;==>_TurnOffGPS + +Func _GraphToggle() ; Graph1 Button + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GraphToggle()') ;#Debug Display + GUISetState(@SW_LOCK, $Vistumbler) ;lock gui - will be unlocked by _SetControlSizes + If $Graph = 1 Then + $Graph = 0 + GUICtrlSetData($GraphButton1, $Text_Graph1) + GUICtrlSetBkColor($GraphButton1, $ButtonInactiveColor) + ElseIf $Graph = 2 Then + $Graph = 1 + GUISwitch($Vistumbler) + GUICtrlSetData($GraphButton1, $Text_NoGraph) + GUICtrlSetBkColor($GraphButton1, $ButtonActiveColor) + GUICtrlSetData($GraphButton2, $Text_Graph2) + GUICtrlSetBkColor($GraphButton2, $ButtonInactiveColor) + ElseIf $Graph = 0 Then + $Graph = 1 + GUICtrlSetData($GraphButton1, $Text_NoGraph) + GUICtrlSetBkColor($GraphButton1, $ButtonActiveColor) + EndIf + _SetControlSizes() +EndFunc ;==>_GraphToggle + +Func _GraphToggle2() ; Graph2 Button + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GraphToggle2()') ;#Debug Display + If $Graph = 2 Then + $Graph = 0 + GUICtrlSetData($GraphButton2, $Text_Graph2) + GUICtrlSetBkColor($GraphButton2, $ButtonInactiveColor) + ElseIf $Graph = 1 Then + $Graph = 2 + GUICtrlSetData($GraphButton2, $Text_NoGraph) + GUICtrlSetBkColor($GraphButton2, $ButtonActiveColor) + GUICtrlSetData($GraphButton1, $Text_Graph1) + GUICtrlSetBkColor($GraphButton1, $ButtonInactiveColor) + ElseIf $Graph = 0 Then + $Graph = 2 + GUICtrlSetData($GraphButton2, $Text_NoGraph) + GUICtrlSetBkColor($GraphButton2, $ButtonActiveColor) + EndIf + _SetControlSizes() +EndFunc ;==>_GraphToggle2 + +Func _MinimalGuiModeToggle() + If $MinimalGuiMode = 1 Then + $MinimalGuiMode = 0 + GUICtrlSetState($GuiMinimalGuiMode, $GUI_UNCHECKED) + GUICtrlSetData($msgdisplay, "Restoring GUI") + _UpdateListview(1) + $a = WinGetPos($Vistumbler) + WinMove($title, "", $a[0], $a[1], $a[2], $MinimalGuiExitHeight) ;Resize window to Minimal GUI Height + GUICtrlSetData($msgdisplay, "") + Else + $MinimalGuiMode = 1 + $ClearListAndTree = 1 + GUICtrlSetState($GuiMinimalGuiMode, $GUI_CHECKED) + If $VistumblerState = "Maximized" Then + WinSetState($title, "", @SW_RESTORE) + $VistumblerState = "Window" + EndIf + $a = WinGetPos($Vistumbler) + $MinimalGuiExitHeight = $a[3] + $b = _WinAPI_GetClientRect($Vistumbler) + $titlebar_height = $a[3] - (DllStructGetData($b, "Bottom") - DllStructGetData($b, "Top")) + WinMove($title, "", $a[0], $a[1], $a[2], $titlebar_height + 65) ;Resize window to Minimal GUI Height + EndIf +EndFunc ;==>_MinimalGuiModeToggle + +Func _AutoScrollToBottomToggle() + If $AutoScrollToBottom = 1 Then + $AutoScrollToBottom = 0 + GUICtrlSetState($GuiAutoScrollToBottom, $GUI_UNCHECKED) + Else + $AutoScrollToBottom = 1 + GUICtrlSetState($GuiAutoScrollToBottom, $GUI_CHECKED) + EndIf +EndFunc ;==>_AutoScrollToBottomToggle + +Func _BatchListviewInsertToggle() + If $BatchListviewInsert = 1 Then + $BatchListviewInsert = 0 + GUICtrlSetState($GuiBatchListviewInsert, $GUI_UNCHECKED) + Else + $BatchListviewInsert = 1 + GUICtrlSetState($GuiBatchListviewInsert, $GUI_CHECKED) + EndIf +EndFunc ;==>_BatchListviewInsertToggle + +Func _DebugToggle() ;Sets if current function should be displayed in the gui + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_DebugToggle()') ;#Debug Display + If $Debug = 1 Then + GUICtrlSetState($DebugFunc, $GUI_UNCHECKED) + GUICtrlSetData($debugdisplay, '') + $Debug = 0 + Else + GUICtrlSetState($DebugFunc, $GUI_CHECKED) + $Debug = 1 + EndIf +EndFunc ;==>_DebugToggle + +Func _DebugComToggle() ;Sets if current function should be displayed in the gui + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_DebugComToggle()') ;#Debug Display + If $DebugCom = 1 Then + GUICtrlSetState($DebugComGUI, $GUI_UNCHECKED) + $DebugCom = 0 + Else + GUICtrlSetState($DebugComGUI, $GUI_CHECKED) + $DebugCom = 1 + EndIf +EndFunc ;==>_DebugComToggle + +Func _NativeWifiToggle() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_NativeWifiToggle()') ;#Debug Display + If $UseNativeWifi = 1 Then + GUICtrlSetState($GuiUseNativeWifi, $GUI_UNCHECKED) + $UseNativeWifi = 0 + Else + GUICtrlSetState($GuiUseNativeWifi, $GUI_CHECKED) + $UseNativeWifi = 1 + EndIf + MsgBox(0, $Text_Information, $Text_VistumblerNeedsToRestart) + _ExitVistumbler() +EndFunc ;==>_NativeWifiToggle + +Func _SoundToggle() ;turns new ap sound on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SoundToggle()') ;#Debug Display + If $SoundOnAP = 1 Then + GUICtrlSetState($PlaySoundOnNewAP, $GUI_UNCHECKED) + $SoundOnAP = 0 + Else + GUICtrlSetState($PlaySoundOnNewAP, $GUI_CHECKED) + $SoundOnAP = 1 + EndIf +EndFunc ;==>_SoundToggle + +Func _GpsSoundToggle() ;turns new gps sound on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GpsSoundToggle()') ;#Debug Display + If $SoundOnGps = 1 Then + GUICtrlSetState($PlaySoundOnNewGPS, $GUI_UNCHECKED) + $SoundOnGps = 0 + Else + GUICtrlSetState($PlaySoundOnNewGPS, $GUI_CHECKED) + $SoundOnGps = 1 + EndIf +EndFunc ;==>_GpsSoundToggle + +Func _SaveGpsWithNoAPsToggle() ;turns saving gps data without APs on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SaveGpsWithNoAPsToggle()') ;#Debug Display + If $SaveGpsWithNoAps = 1 Then + GUICtrlSetState($MenuSaveGpsWithNoAps, $GUI_UNCHECKED) + $SaveGpsWithNoAps = 0 + Else + GUICtrlSetState($MenuSaveGpsWithNoAps, $GUI_CHECKED) + $SaveGpsWithNoAps = 1 + EndIf +EndFunc ;==>_SaveGpsWithNoAPsToggle + +Func _SpeakSigToggle() ;turns speak ap signal on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SpeakSigToggle()') ;#Debug Display + If $SpeakSignal = 1 Then + GUICtrlSetState($SpeakApSignal, $GUI_UNCHECKED) + $SpeakSignal = 0 + Else + GUICtrlSetState($SpeakApSignal, $GUI_CHECKED) + $SpeakSignal = 1 + EndIf +EndFunc ;==>_SpeakSigToggle + +Func _AddApPosToggle() ;Sets if new aps are added to the top or bottom of the list + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AddApPosToggle()') ;#Debug Display + If $AddDirection = 0 Then + GUICtrlSetState($AddNewAPsToTop, $GUI_UNCHECKED) + $AddDirection = -1 + Else + GUICtrlSetState($AddNewAPsToTop, $GUI_CHECKED) + $AddDirection = 0 + EndIf +EndFunc ;==>_AddApPosToggle + +Func _GraphDeadTimeToggle() ;Sets if new aps are added to the top or bottom of the list + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GraphDeadTimeToggle') ;#Debug Display + If $GraphDeadTime = 1 Then + GUICtrlSetState($GraphDeadTimeGUI, $GUI_UNCHECKED) + $GraphDeadTime = 0 + Else + GUICtrlSetState($GraphDeadTimeGUI, $GUI_CHECKED) + $GraphDeadTime = 1 + EndIf +EndFunc ;==>_GraphDeadTimeToggle + +Func _UseRssiInGraphsToggle() ;Sets if new aps are added to the top or bottom of the list + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_UseRssiInGraphsToggle') ;#Debug Display + If $UseRssiInGraphs = 1 Then + GUICtrlSetState($UseRssiInGraphsGUI, $GUI_UNCHECKED) + $UseRssiInGraphs = 0 + Else + GUICtrlSetState($UseRssiInGraphsGUI, $GUI_CHECKED) + $UseRssiInGraphs = 1 + EndIf +EndFunc ;==>_UseRssiInGraphsToggle + +Func _AutoRecoveryVS1Toggle() ;Turns auto recovery vs1 on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AutoRecoveryVS1Toggle()') ;#Debug Display + If $AutoRecoveryVS1 = 1 Then + GUICtrlSetState($AutoRecoveryVS1GUI, $GUI_UNCHECKED) + $AutoRecoveryVS1 = 0 + Else + GUICtrlSetState($AutoRecoveryVS1GUI, $GUI_CHECKED) + $AutoRecoveryVS1 = 1 + EndIf +EndFunc ;==>_AutoRecoveryVS1Toggle + +Func _AutoSaveAndClearToggle() ;Turns auto save and clear on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AutoSaveAndClearToggle()') ;#Debug Display + If $AutoSaveAndClear = 1 Then + GUICtrlSetState($AutoSaveAndClearGUI, $GUI_UNCHECKED) + $AutoSaveAndClear = 0 + Else + GUICtrlSetState($AutoSaveAndClearGUI, $GUI_CHECKED) + $AutoSaveAndClear = 1 + EndIf +EndFunc ;==>_AutoSaveAndClearToggle + + +Func _AutoSortToggle() ;Turns auto sort on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AutoSortToggle()') ;#Debug Display + If $AutoSort = 1 Then + GUICtrlSetState($AutoSortGUI, $GUI_UNCHECKED) + $AutoSort = 0 + Else + GUICtrlSetState($AutoSortGUI, $GUI_CHECKED) + $AutoSort = 1 + $sort_timer = TimerInit() + EndIf +EndFunc ;==>_AutoSortToggle + +Func _WifiDbLocateToggle() ;Turns wifi gps locate on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_WifiDbLocateToggle()') ;#Debug Display + If $UseWiFiDbGpsLocate = 1 Then + GUICtrlSetState($UseWiFiDbGpsLocateButton, $GUI_UNCHECKED) + $UseWiFiDbGpsLocate = 0 + $Latitude = 'N 0000.0000' + $Longitude = 'E 0000.0000' + $LatitudeWifidb = 'N 0000.0000' + $LongitudeWifidb = 'E 0000.0000' + Else + $UploadWarn = MsgBox(4, $Text_Warning, $Text_WifiDBLocateWarning) + If $UploadWarn = 6 Then + GUICtrlSetState($UseWiFiDbGpsLocateButton, $GUI_CHECKED) + $UseWiFiDbGpsLocate = 1 + $WifidbGPS_Update = TimerInit() + EndIf + EndIf +EndFunc ;==>_WifiDbLocateToggle + +Func _WifiDbAutoUploadToggleWarn() + _WifiDbAutoUploadToggle(1) +EndFunc ;==>_WifiDbAutoUploadToggleWarn + +Func _WifiDbAutoUploadToggle($Warn = 1) + If $AutoUpApsToWifiDB = 1 Then + _StopWifiDBAutoUpload() + Else + _WifiDbCreateSessionGUI() + EndIf +EndFunc ;==>_WifiDbAutoUploadToggle + +Func _DownloadImagesToggle() ;Turns Estimated DB value on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_DownloadImagesToggle()') ;#Debug Display + If $DownloadImages = 1 Then + GUICtrlSetState($GUI_DownloadImages, $GUI_UNCHECKED) + $DownloadImages = 0 + Else + GUICtrlSetState($GUI_DownloadImages, $GUI_CHECKED) + $DownloadImages = 1 + EndIf +EndFunc ;==>_DownloadImagesToggle + +Func _CamTriggerToggle() ;Turns cam trigger on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CamTriggerToggle()') ;#Debug Display + If $CamTrigger = 1 Then + GUICtrlSetState($GUI_CamTriggerMenu, $GUI_UNCHECKED) + $CamTrigger = 0 + Else + GUICtrlSetState($GUI_CamTriggerMenu, $GUI_CHECKED) + $CamTrigger = 1 + EndIf +EndFunc ;==>_CamTriggerToggle + +Func _PortableModeToggle() ;Turns portable mode on or off + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_PortableModeToggle()') ;#Debug Display + If $PortableMode = 1 Then + GUICtrlSetState($GUI_PortableMode, $GUI_UNCHECKED) + $PortableMode = 0 + Else + GUICtrlSetState($GUI_PortableMode, $GUI_CHECKED) + $PortableMode = 1 + EndIf + IniWrite($Default_settings, "Vistumbler", "PortableMode", $PortableMode) + MsgBox(0, $Text_Restart, $Text_RestartMsg) +EndFunc ;==>_PortableModeToggle + + +Func _ResetSizes() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ResetSizes()') ;#Debug Display + $ResetSizes = 1 +EndFunc ;==>_ResetSizes + +Func _ClearAll() ;Clear all APs + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ClearAll()') ;#Debug Display + $ClearAllAps = 1 +EndFunc ;==>_ClearAll + +Func _MenuSelectConnectedAp() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_MenuSelectConnectedAp()') ;#Debug Display + Local $SelConAP = _SelectConnectedAp() + If $SelConAP = -1 Then + ;MsgBox(0, $Text_Error, $Text_NoActiveApFound & @CRLF & @CRLF & $Column_Names_BSSID & ':' & $IntBSSID & @CRLF & $Column_Names_SSID & ':' & $IntSSID & @CRLF & $Column_Names_Channel & ':' & $IntChan & @CRLF & $Column_Names_Authentication & ':' & $IntAuth) + ElseIf $SelConAP = 0 Then + MsgBox(0, $Text_Error, $Text_NoActiveApFound) + EndIf +EndFunc ;==>_MenuSelectConnectedAp + +Func _SelectConnectedAp() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SelectConnectedAp()') ;#Debug Display + $return = 0 + FileDelete($tempfile_showint) + _RunDos($netsh & ' wlan show interfaces interface="' & $DefaultApapter & '" > ' & '"' & $tempfile_showint & '"') ;copy the output of the 'netsh wlan show interfaces' command to the temp file + $showintarraysize = _FileReadToArray($tempfile_showint, $TempFileArrayShowInt) ;read the tempfile into the '$TempFileArrayShowInt' Araay + If $showintarraysize = 1 Then + For $strip_ws = 1 To $TempFileArrayShowInt[0] + $TempFileArrayShowInt[$strip_ws] = StringStripWS($TempFileArrayShowInt[$strip_ws], 3) + Next + + Dim $IntSSID, $IntBSSID, $IntChan, $IntAuth, $InEncr + For $loop = 1 To $TempFileArrayShowInt[0] + $temp = StringSplit(StringStripWS($TempFileArrayShowInt[$loop], 3), ":") + If IsArray($temp) Then + If $temp[0] = 2 Then + If StringInStr($TempFileArrayShowInt[$loop], $SearchWord_SSID) And StringInStr($TempFileArrayShowInt[$loop], $SearchWord_BSSID) <> 1 Then $IntSSID = StringStripWS($temp[2], 3) + If StringInStr($TempFileArrayShowInt[$loop], $SearchWord_Channel) Then $IntChan = StringStripWS($temp[2], 3) + If StringInStr($TempFileArrayShowInt[$loop], $SearchWord_Authentication) Then $IntAuth = StringStripWS($temp[2], 3) + If StringInStr($TempFileArrayShowInt[$loop], $SearchWord_Cipher) Then $InEncr = StringStripWS($temp[2], 3) + $NewAP = 1 + ElseIf $temp[0] = 7 Then + If StringInStr($TempFileArrayShowInt[$loop], $SearchWord_BSSID) Then + Dim $Signal = '', $RadioType = '', $Channel = '', $BasicTransferRates = '', $OtherTransferRates = '', $MANUF + $NewAP = 1 + $IntBSSID = StringStripWS(StringUpper($temp[2] & ':' & $temp[3] & ':' & $temp[4] & ':' & $temp[5] & ':' & $temp[6] & ':' & $temp[7]), 3) + EndIf + EndIf + EndIf + Next + If $UseNativeWifi = 1 And @OSVersion = "WIN_XP" Then + If $IntAuth = $SearchWord_Open And $InEncr = $SearchWord_None Then + $SecType = 1 + ElseIf $InEncr = $SearchWord_Wep Then + $SecType = 2 + Else + $SecType = 3 + EndIf + $query = "SELECT ListRow FROM AP WHERE SSID='" & StringReplace($IntSSID, "'", "''") & "' And SECTYPE=" & $SecType + Else + $query = "SELECT ListRow FROM AP WHERE BSSID='" & $IntBSSID & "' And SSID='" & StringReplace($IntSSID, "'", "''") & "' And CHAN=" & $IntChan & " And AUTH='" & $IntAuth & "'" + EndIf + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch > 0 Then + $return = 1 + $Found_ListRow = $ApMatchArray[1][1] + _GUICtrlListView_SetItemState($ListviewAPs, $Found_ListRow, $LVIS_FOCUSED, $LVIS_FOCUSED) + _GUICtrlListView_SetItemState($ListviewAPs, $Found_ListRow, $LVIS_SELECTED, $LVIS_SELECTED) + GUICtrlSetState($ListviewAPs, $GUI_FOCUS) + Else + $return = 0 + EndIf + EndIf + Return ($return) +EndFunc ;==>_SelectConnectedAp + +Func _SelectHighSignalAp() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SelectHighSignalAp()') ;#Debug Display + $query = "SELECT TOP 1 ListRow FROM AP WHERE ListRow<>-1 ORDER BY RSSI DESC" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch <> 0 Then + $Found_ListRow = $ApMatchArray[1][1] + _GUICtrlListView_SetItemState($ListviewAPs, $Found_ListRow, $LVIS_FOCUSED, $LVIS_FOCUSED) + _GUICtrlListView_SetItemState($ListviewAPs, $Found_ListRow, $LVIS_SELECTED, $LVIS_SELECTED) + GUICtrlSetState($ListviewAPs, $GUI_FOCUS) + Return (1) + Else + Return (0) + EndIf +EndFunc ;==>_SelectHighSignalAp +;------------------------------------------------------------------------------------------------------------------------------- +; GPS FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _OpenComPort($CommPort = '8', $sBAUD = '4800', $sPARITY = 'N', $sDataBit = '8', $sStopBit = '1', $sFlow = '0') ;Open specified COM port + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_OpenComPort()') ;#Debug Display + If $GpsType = 0 Then + If $sPARITY = 'O' Then ;Odd + $iPar = '1' + ElseIf $sPARITY = 'E' Then ;Even + $iPar = '2' + ElseIf $sPARITY = 'M' Then ;Mark + $iPar = '3' + ElseIf $sPARITY = 'S' Then ;Space + $iPar = '4' + Else + $iPar = '0' ;None + EndIf + $OpenedPort = _CommSetPort($CommPort, $sErr, $sBAUD, $sDataBit, $iPar, $sStopBit, $sFlow) + If $OpenedPort = 1 Then + Return (1) + Else + Return (0) + EndIf + ElseIf $GpsType = 1 Then + $return = 0 + $ComError = 0 + $CommSettings = $sBAUD & ',' & $sPARITY & ',' & $sDataBit & ',' & $sStopBit + ; Create NETComm.ocx object + $NetComm = ObjCreate("NETCommOCX.NETComm") + If IsObj($NetComm) = 0 Then ;If $NetComm is not an object then netcomm ocx is probrably not installed + MsgBox(0, $Text_Error, $Text_InstallNetcommOCX) + Else + $NetComm.CommPort = $CommPort ;Set port number + $NetComm.settings = $CommSettings ;Set port settings + $NetComm.InputLen = 0 ;reads entire buffer + If $ComError <> 1 Then + $NetComm.InputMode = 0 ;reads in text mode + $NetComm.HandShaking = 3 ;uses both RTS and Xon/Xoff handshaking + $NetComm.PortOpen = "True" + $return = 1 + EndIf + EndIf + Return ($return) + ElseIf $GpsType = 2 Then + If $sPARITY = 'O' Then ;Odd + $iPar = '1' + ElseIf $sPARITY = 'E' Then ;Even + $iPar = '2' + ElseIf $sPARITY = 'M' Then ;Mark + $iPar = '3' + ElseIf $sPARITY = 'S' Then ;Space + $iPar = '4' + Else + $iPar = '0' ;None + EndIf + If $sStopBit = '1' Then + $iStop = '0' + ElseIf $sStopBit = '1.5' Then + $iStop = '1' + ElseIf $sStopBit = '2' Then + $iStop = '2' + EndIf + $OpenedPort = _OpenComm($CommPort, $sBAUD, $sDataBit, $iPar, $iStop) + If $OpenedPort = '-1' Then + Return (0) + Else + Return (1) + EndIf + EndIf +EndFunc ;==>_OpenComPort + +Func _CloseComPort($CommPort = '8') ;Closes specified COM port + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CloseComPort()') ;#Debug Display + ;Close the COM Port + If $GpsType = 0 Then + _CommClosePort() + ElseIf $GpsType = 1 Then + With $NetComm + .CommPort = $CommPort ;Set port number + .PortOpen = "False" + EndWith + ElseIf $GpsType = 2 Then + _CloseComm($OpenedPort) + EndIf +EndFunc ;==>_CloseComPort + +Func _GetGPS() ; Recieves data from gps device + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GetGPS()') ;#Debug Display + $timeout = TimerInit() + $return = 1 + $FoundData = 0 + + $maxtime = $RefreshLoopTime * 0.8 ; Set GPS timeout to 80% of the given timout time + If $maxtime < 800 Then $maxtime = 800 ;Set GPS timeout to 800 if it is under that + + Dim $Temp_FixTime, $Temp_FixTime2, $Temp_FixDate, $Temp_Lat, $Temp_Lon, $Temp_Lat2, $Temp_Lon2, $Temp_Quality, $Temp_NumberOfSatalites, $Temp_HorDilPitch, $Temp_Alt, $Temp_AltS, $Temp_Geo, $Temp_GeoS, $Temp_Status, $Temp_SpeedInKnots, $Temp_SpeedInMPH, $Temp_SpeedInKmH, $Temp_TrackAngle + Dim $Temp_Quality = 0, $Temp_Status = "V" + + While 1 ;Loop to extract gps data untill location is found or timout time is reached + If $UseGPS = 0 Then ExitLoop + If $GpsType = 0 Then ;Use CommMG + $dataline = StringStripWS(_CommGetLine(@CR, 500, $maxtime), 8) ;Read data line from GPS + If $GpsDetailsOpen = 1 Then GUICtrlSetData($GpsCurrentDataGUI, $dataline) ;Show data line in "GPS Details" GUI if it is open + If StringInStr($dataline, '$') And StringInStr($dataline, '*') Then ;Check if string containts start character ($) and checsum character (*). If it does not have them, ignore the data + $FoundData = 1 + If StringInStr($dataline, "$GPGGA") Then + _GPGGA($dataline) ;Split GPGGA data from data string + $disconnected_time = -1 + ElseIf StringInStr($dataline, "$GPRMC") Then + _GPRMC($dataline) ;Split GPRMC data from data string + $disconnected_time = -1 + EndIf + EndIf + ElseIf $GpsType = 1 Then ;Use Netcomm ocx to get data (more stable right now) + If $NetComm.InBufferCount Then + $Buffer = $NetComm.InBufferCount + If $Buffer > 85 And $LatTest = 0 And TimerDiff($timeout) < $maxtime Then + $inputdata = $NetComm.inputdata + If StringInStr($inputdata, '$') And StringInStr($inputdata, '*') Then ;Check if string containts start character ($) and checsum character (*). If it does not have them, ignore the data + $FoundData = 1 + $gps = StringSplit($inputdata, @CR) ;Split data string by CR and put data into the $gps array + For $readloop = 1 To $gps[0] ;go through array + $gpsline = StringStripWS($gps[$readloop], 3) + If $GpsDetailsOpen = 1 Then GUICtrlSetData($GpsCurrentDataGUI, $gpsline) ;Show data line in "GPS Details" GUI if it is open + If StringInStr($gpsline, '$') And StringInStr($gpsline, '*') Then ;Check if string containts start character ($) and checsum character (*). If it does not have them, ignore the data + If StringInStr($gpsline, "$GPGGA") Then + _GPGGA($gpsline) ;Split GPGGA data from data string + ElseIf StringInStr($gpsline, "$GPRMC") Then + _GPRMC($gpsline) ;Split GPRMC data from data string + EndIf + EndIf + If BitOR($Temp_Quality = 1, $Temp_Quality = 2) = 1 And BitOR($Temp_Status = "A", $GpsDetailsOpen <> 1) Then ExitLoop ;If $Temp_Quality = 1 (GPS has a fix) And, If the details window is open, $Temp_Status = "A" (Active data, not Void) + If TimerDiff($timeout) > $maxtime Then ExitLoop ;If time is over timeout period, exitloop + Next + EndIf + EndIf + EndIf + ElseIf $GpsType = 2 Then ;Use Kernel32 + $gstring = StringStripWS(_rxwait($OpenedPort, '500', $maxtime), 8) ;Read data line from GPS + $dataline = $gstring ; & $LastGpsString + $LastGpsString = $gstring + If StringInStr($dataline, '$') And StringInStr($dataline, '*') Then + $FoundData = 1 + $dlsplit = StringSplit($dataline, '$') + For $gda = 1 To $dlsplit[0] + If $GpsDetailsOpen = 1 Then GUICtrlSetData($GpsCurrentDataGUI, $dlsplit[$gda]) ;Show data line in "GPS Details" GUI if it is open + If StringInStr($dlsplit[$gda], '*') Then ;Check if string containts start character ($) and checsum character (*). If it does not have them, ignore the data + If StringInStr($dlsplit[$gda], "GPGGA") Then + _GPGGA($dlsplit[$gda]) ;Split GPGGA data from data string + $disconnected_time = -1 + ElseIf StringInStr($dlsplit[$gda], "GPRMC") Then + _GPRMC($dlsplit[$gda]) ;Split GPRMC data from data string + $disconnected_time = -1 + EndIf + EndIf + Next + EndIf + EndIf + If BitOR($Temp_Quality = 1, $Temp_Quality = 2) = 1 And BitOR($Temp_Status = "A", $GpsDetailsOpen <> 1) Then ExitLoop ;If $Temp_Quality = 1 (GPS has a fix) And, If the details window is open, $Temp_Status = "A" (Active data, not Void) + If TimerDiff($timeout) > $maxtime Then ExitLoop ;If time is over timeout period, exitloop + WEnd + If $FoundData = 1 Then + $disconnected_time = -1 + If BitOR($Temp_Quality = 1, $Temp_Quality = 2) = 1 Then ;If the GPGGA data has a fix(1) then write data to perminant variables + $GPGGA_Update = TimerInit() + $FixTime = $Temp_FixTime + $Latitude = _Format_GPS_DMM($Temp_Lat) + $Longitude = _Format_GPS_DMM($Temp_Lon) + $NumberOfSatalites = $Temp_NumberOfSatalites + $HorDilPitch = $Temp_HorDilPitch + $Alt = $Temp_Alt + $AltS = $Temp_AltS + $Geo = $Temp_Geo + $GeoS = $Temp_GeoS + EndIf + If $Temp_Status = "A" Then ;If the GPRMC data is Active(A) then write data to perminant variables + $GPRMC_Update = TimerInit() + $FixTime2 = $Temp_FixTime2 + $Latitude2 = $Temp_Lat2 + $Longitude2 = $Temp_Lon2 + $SpeedInKnots = $Temp_SpeedInKnots + $SpeedInMPH = $Temp_SpeedInMPH + $SpeedInKmH = $Temp_SpeedInKmH + $TrackAngle = $Temp_TrackAngle + $FixDate = $Temp_FixDate + EndIf + Else + If $disconnected_time = -1 Then $disconnected_time = TimerInit() + If (TimerDiff($disconnected_time) > 10000) And ($GpsDisconnect = 1) Then ; If nothing has been found in the buffer for 10 seconds, turn off gps + $disconnected_time = -1 + $return = 0 + _TurnOffGPS() + _SoundPlay($SoundDir & $ErrorFlag_sound) + EndIf + EndIf + + _ClearGpsDetailsGUI() ;Reset variables if they are over the allowed timeout + _UpdateGpsDetailsGUI() ;Write changes to "GPS Details" GUI if it is open + $Degree = $TrackAngle + + If $TurnOffGPS = 1 Then _TurnOffGPS() + + Return ($return) +EndFunc ;==>_GetGPS + +Func _FormatGpsTime($time) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_FormatGpsTime()') ;#Debug Display + $h = StringLeft($time, 2) + $m = StringMid($time, 3, 2) + $s = StringMid($time, 5, 2) + If $h > 12 Then + $h = $h - 12 + $l = "PM" + Else + $l = "AM" + EndIf + Return ($h & ":" & $m & ":" & $s & $l & ' (UTC)') +EndFunc ;==>_FormatGpsTime + +Func _FormatGpsDate($Date) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_FormatGpsDate()') ;#Debug Display + $d = StringTrimRight($Date, 4) + $m = StringTrimLeft(StringTrimRight($Date, 2), 2) + $y = StringTrimLeft($Date, 4) + Return (StringReplace(StringReplace(StringReplace($DateFormat, 'M', $m), 'd', $d), 'yyyy', $y)) +EndFunc ;==>_FormatGpsDate + +Func _CheckGpsChecksum($checkdata) ;Checks if GPS Data Checksum is correct. Returns 1 if it is correct, else Returns 0 + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CheckGpsChecksum') ;#Debug Display + $end = 0 + $calc_checksum = 0 + $checkdata_checksum = '' + $gps_data_split = StringSplit($checkdata, '') ;Seperate all characters of data and put them into an array + For $gds = 1 To $gps_data_split[0] + If $gps_data_split[$gds] <> '$' And $gps_data_split[$gds] <> '*' And $end = 0 Then + If $calc_checksum = 0 Then ;If $calc_checksum is equal 0, set $calc_checksum to the ascii value of this character + $calc_checksum = Asc($gps_data_split[$gds]) + Else ;If $calc_checksum is not equal 0 then XOR the new character ascii value with the $calc_checksum value + $calc_checksum = BitXOR($calc_checksum, Asc($gps_data_split[$gds])) + EndIf + ElseIf $gps_data_split[$gds] = '*' Then ;If the checksum has been reached, set the $end flag + $end = 1 + ElseIf $end = 1 And StringIsAlNum($gps_data_split[$gds]) Then ;if the end flag is equal 1 and the character is alpha-numeric then add the character to the end of $checkdata_checksum + $checkdata_checksum &= $gps_data_split[$gds] + EndIf + Next + $calc_checksum = Hex($calc_checksum, 2) + If $calc_checksum = $checkdata_checksum Then ;If the calculated checksum matches the given checksum then Return 1, Else Return 0 + Return (1) + Else + Return (0) + EndIf +EndFunc ;==>_CheckGpsChecksum + +Func _GPGGA($data) ;Strips data from a gps $GPGGA data string + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GPGGA()') ;#Debug Display + GUICtrlSetData($msgdisplay, $data) + If _CheckGpsChecksum($data) = 1 Then + $GPGGA_Split = StringSplit($data, ",") ; + If $GPGGA_Split[0] >= 14 Then + $Temp_Quality = $GPGGA_Split[7] + If BitOR($Temp_Quality = 1, $Temp_Quality = 2) = 1 Then + ;Start BlueNMEA fixes...WTF + If StringInStr($GPGGA_Split[3], "-") Then ;Fix latitude + $GPGGA_Split[3] = StringReplace($GPGGA_Split[3], "-", "") + $GPGGA_Split[4] = "S" + EndIf + If StringInStr($GPGGA_Split[5], "-") Then ;Fix longitude + $GPGGA_Split[5] = StringReplace($GPGGA_Split[5], "-", "") + $GPGGA_Split[6] = "W" + EndIf + ;End BlueNMEA fixes + $Temp_FixTime = _FormatGpsTime($GPGGA_Split[2]) + $Temp_Lat = $GPGGA_Split[4] & " " & StringFormat('%0.4f', $GPGGA_Split[3]) + $Temp_Lon = $GPGGA_Split[6] & " " & StringFormat('%0.4f', $GPGGA_Split[5]) + $Temp_NumberOfSatalites = $GPGGA_Split[8] + $Temp_HorDilPitch = StringFormat('%0.2f', $GPGGA_Split[9]) + $Temp_Alt = StringFormat('%0.2f', $GPGGA_Split[10] * 3.2808399) + $Temp_AltS = $GPGGA_Split[11] + $Temp_Geo = StringFormat('%0.2f', $GPGGA_Split[12]) + $Temp_GeoS = $GPGGA_Split[13] + EndIf + EndIf + EndIf +EndFunc ;==>_GPGGA + +Func _GPRMC($data) ;Strips data from a gps $GPRMC data string + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GPRMC()') ;#Debug Display + GUICtrlSetData($msgdisplay, $data) + If _CheckGpsChecksum($data) = 1 Then + $GPRMC_Split = StringSplit($data, ",") + If $GPRMC_Split[0] >= 11 Then + $Temp_Status = $GPRMC_Split[3] + If $Temp_Status = "A" Then + ;Start BlueNMEA fixes...WTF + If StringInStr($GPRMC_Split[4], "-") Then ;Fix latitude + $GPRMC_Split[4] = StringReplace($GPRMC_Split[4], "-", "") + $GPRMC_Split[5] = "S" + EndIf + If StringInStr($GPRMC_Split[6], "-") Then ;Fix longitude + $GPRMC_Split[6] = StringReplace($GPRMC_Split[6], "-", "") + $GPRMC_Split[7] = "W" + EndIf + ;End BlueNMEA fixes + $Temp_FixTime2 = _FormatGpsTime($GPRMC_Split[2]) + $Temp_Lat2 = $GPRMC_Split[5] & ' ' & StringFormat('%0.4f', $GPRMC_Split[4]) + $Temp_Lon2 = $GPRMC_Split[7] & ' ' & StringFormat('%0.4f', $GPRMC_Split[6]) + $Temp_SpeedInKnots = $GPRMC_Split[8] + $Temp_SpeedInMPH = Round($GPRMC_Split[8] * 1.15, 2) + $Temp_SpeedInKmH = Round($GPRMC_Split[8] * 1.85200, 2) + $Temp_TrackAngle = $GPRMC_Split[9] + $Temp_FixDate = _FormatGpsDate($GPRMC_Split[10]) + EndIf + EndIf + EndIf +EndFunc ;==>_GPRMC + +Func _Format_GPS_DMM($gps) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_Format_GPS_DMM()') ;#Debug Display + $return = '0000.0000' + $splitlatlon1 = StringSplit($gps, " ") ;Split N,S,E,W from data + If $splitlatlon1[0] = 2 Then + $splitlatlon2 = StringSplit(StringFormat("%0.4f", $splitlatlon1[2]), ".") ;Split dd from data + $return = $splitlatlon1[1] & ' ' & StringFormat("%04i", $splitlatlon2[1]) & '.' & $splitlatlon2[2] ;set return + EndIf + Return ($return) +EndFunc ;==>_Format_GPS_DMM + +Func _Format_GPS_DMM_to_DDD($gps) ;converts gps position from ddmm.mmmm to dd.ddddddd + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_Format_GPS_DMM_to_DDD()') ;#Debug Display + $return = '0.0000000' + $splitlatlon1 = StringSplit($gps, " ") ;Split N,S,E,W from data + If $splitlatlon1[0] = 2 Then + $splitlatlon2 = StringSplit($splitlatlon1[2], ".") ;Split dd from data + $latlonleft = StringTrimRight($splitlatlon2[1], 2) + $latlonright = (StringTrimLeft($splitlatlon2[1], StringLen($splitlatlon2[1]) - 2) & '.' & $splitlatlon2[2]) / 60 + $return = $splitlatlon1[1] & ' ' & StringFormat('%0.7f', $latlonleft + $latlonright) ;set return + EndIf + Return ($return) +EndFunc ;==>_Format_GPS_DMM_to_DDD + +Func _Format_GPS_DMM_to_DMS($gps) ;converts gps ddmm.mmmm to 'dd° mm' ss" + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_Format_GPS_DMM_to_DMS()') ;#Debug Display + $return = '0° 0' & Chr(39) & ' 0"' + $splitlatlon1 = StringSplit($gps, " ") ;Split N,S,E,W from data + If $splitlatlon1[0] = 2 Then + $splitlatlon2 = StringSplit($splitlatlon1[2], ".") + If $splitlatlon2[0] = 2 Then + $DD = StringTrimRight($splitlatlon2[1], 2) + $MM = StringTrimLeft($splitlatlon2[1], StringLen($splitlatlon2[1]) - 2) + $SS = StringFormat('%0.4f', (('.' & $splitlatlon2[2]) * 60)) ; multiply remaining minutes by 60 to get ss + If $DD = "" Then $DD = "0" + $return = $splitlatlon1[1] & ' ' & $DD & '° ' & $MM & Chr(39) & ' ' & $SS & '"' ;Format data properly (ex. dd� mm' ss"N) + Else + $return = $splitlatlon1[1] & ' 0° 0' & Chr(39) & ' 0"' + EndIf + EndIf + Return ($return) +EndFunc ;==>_Format_GPS_DMM_to_DMS + +Func _Format_GPS_All_to_DMM($gps) ;converts dd.ddddddd, 'dd� mm' ss", or ddmm.mmmm to ddmm.mmmm + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_Format_GPS_All_to_DMM()') ;#Debug Display + ;All GPS Formats to ddmm.mmmm + $return = '0.0000' + $splitlatlon1 = StringSplit($gps, " ") ;Split N,S,E,W from data + If $splitlatlon1[0] = 2 Then + $splitlatlon2 = StringSplit($splitlatlon1[2], ".") + If StringLen($splitlatlon2[2]) = 4 Then ;ddmm.mmmm to ddmm.mmmm + $return = $splitlatlon1[1] & ' ' & StringFormat('%0.4f', $splitlatlon1[2]) + ElseIf StringLen($splitlatlon2[2]) = 7 Then ; dd.dddd to ddmm.mmmm + $DD = $splitlatlon2[1] * 100 + $MM = ('.' & $splitlatlon2[2]) * 60 ;multiply remaining decimal by 60 to get mm.mmmm + $return = $splitlatlon1[1] & ' ' & StringFormat('%0.4f', $DD + $MM) ;Format data properly (ex. N ddmm.mmmm) + EndIf + ElseIf $splitlatlon1[0] = 4 Then ; ddmmss to ddmm.mmmm + $DD = StringTrimRight($splitlatlon1[2], 1) * 100 + $MM = StringTrimRight($splitlatlon1[3], 1) + (StringTrimRight($splitlatlon1[4], 1) / 60) + $return = $splitlatlon1[1] & ' ' & StringFormat('%0.4f', $DD + $MM) + EndIf + Return ($return) +EndFunc ;==>_Format_GPS_All_to_DMM + +Func _Format_GPS_DDD_to_DMM($gps, $PosChr, $NegChr) ;converts dd.ddddddd, to ddmm.mmmm + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_Format_GP_DDD_to_DMM()') ;#Debug Display + ;dd.ddddddd to ddmm.mmmm + $return = '0000.0000' + If StringInStr($gps, '-') Or StringInStr($gps, $NegChr) Then + $gDir = $NegChr + Else + $gDir = $PosChr + EndIf + $gps = StringReplace(StringReplace(StringReplace(StringReplace(StringReplace($gps, " ", ""), "-", ""), "+", ""), $PosChr, ""), $NegChr, "") + $splitlatlon1 = StringSplit($gps, ".") + If $splitlatlon1[0] = 2 Then + $DD = $splitlatlon1[1] * 100 + $MM = ('.' & $splitlatlon1[2]) * 60 ;multiply remaining decimal by 60 to get mm.mmmm + $return = $gDir & ' ' & StringFormat('%0.4f', $DD + $MM) ;Format data properly (ex. N ddmm.mmmm) + EndIf + Return ($return) +EndFunc ;==>_Format_GPS_DDD_to_DMM + +Func _GpsFormat($gps) ;Converts ddmm.mmmm to the users set gps format + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GpsFormat()') ;#Debug Display + If $GPSformat = 1 Then $return = _Format_GPS_DMM_to_DDD($gps) + If $GPSformat = 2 Then $return = _Format_GPS_DMM_to_DMS($gps) + If $GPSformat = 3 Then $return = $gps + Return ($return) +EndFunc ;==>_GpsFormat + +;------------------------------------------------------------------------------------------------------------------------------- +; GPS COMPASS GUI FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _CompassGUI() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CompassGUI()') ;#Debug Display + If $CompassOpen = 0 Then + $CompassGUI = GUICreate($Text_GpsCompass, 130, 130, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) + GUISetBkColor($BackgroundColor) + GUISetOnEvent($GUI_EVENT_CLOSE, '_CloseCompassGui') + GUISetOnEvent($GUI_EVENT_RESIZED, '_SetCompassSizes') + GUISetOnEvent($GUI_EVENT_RESTORE, '_SetCompassSizes') + GUISetState(@SW_SHOW) + + $cpsplit = StringSplit($CompassPosition, ',') + If $cpsplit[0] = 4 Then ;If $CompassPosition is a proper position, move and resize window + WinMove($CompassGUI, '', $cpsplit[1], $cpsplit[2], $cpsplit[3], $cpsplit[4]) + Else ;Set $CompassPosition to the current window position + $c = WinGetPos($CompassGUI) + $CompassPosition = $c[0] & ',' & $c[1] & ',' & $c[2] & ',' & $c[3] + EndIf + + _SetCompassSizes() + _DrawCompass() + + $CompassOpen = 1 + Else + WinActivate($CompassGUI) + EndIf +EndFunc ;==>_CompassGUI + +Func _CloseCompassGui() ;closes the compass window + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CloseCompassGui()') ;#Debug Display + GUIDelete($CompassGUI) + $CompassOpen = 0 +EndFunc ;==>_CloseCompassGui + +Func _SetCompassSizes() ;Takes the size of a hidden label in the compass window and determines the Width/Height of the compass + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SetCompassSizes()') ;#Debug Display + ;---- Keep Window Square ---- + $cs = WinGetPos($CompassGUI) + $cs_x = $cs[0] + $cs_y = $cs[1] + $cs_width = $cs[2] + $cs_height = $cs[3] + If $cs_height < $cs_width Then $cs_width = $cs_height + If $cs_height > $cs_width Then $cs_height = $cs_width + WinMove($CompassGUI, "", $cs_x, $cs_y, $cs_width, $cs_height) + ;---- End Keep Window Square ---- + ;---- Redraw Circle ---- + $p = _WinAPI_GetClientRect($CompassGUI) + $CompassGUI_height = DllStructGetData($p, "Bottom") + $CompassGUI_width = DllStructGetData($p, "Right") + $Compass_height = $CompassGUI_height - ($Compass_topborder + $Compass_bottomborder) + $Compass_width = $CompassGUI_width - ($Compass_leftborder + $Compass_rightborder) + If $Compass_height < $Compass_width Then $Compass_width = $Compass_height + If $Compass_height > $Compass_width Then $Compass_height = $Compass_width + + $Compass_graphics = _GDIPlus_GraphicsCreateFromHWND($CompassGUI) + $Compass_bitmap = _GDIPlus_BitmapCreateFromGraphics($CompassGUI_width, $CompassGUI_height, $Compass_graphics) + $Compass_backbuffer = _GDIPlus_ImageGetGraphicsContext($Compass_bitmap) + ;---- End Redraw Circle ---- +EndFunc ;==>_SetCompassSizes + +Func _DrawCompass() + ;Set Background Color + _GDIPlus_GraphicsClear($Compass_backbuffer, StringReplace($BackgroundColor, "0x", "0xFF")) + ;Draw Circle + $Radius = ($Compass_width / 2) + $CenterX = ($CompassGUI_width / 2) + $CenterY = ($CompassGUI_height / 2) + $CLeft = $CenterX - ($Compass_width / 2) + $CTop = $CenterY - ($Compass_height / 2) + _GDIPlus_GraphicsFillEllipse($Compass_backbuffer, $CLeft, $CTop, $Compass_width, $Compass_height, $Brush_ControlBackgroundColor) + ;Draw direction lables + _GDIPlus_GraphicsDrawString($Compass_backbuffer, "N", $CenterX - 6, $CTop - 15) + _GDIPlus_GraphicsDrawString($Compass_backbuffer, "S", $CenterX - 6, ($CTop + $Compass_height)) + _GDIPlus_GraphicsDrawString($Compass_backbuffer, "W", $CLeft - 17, $CenterY - 8) + _GDIPlus_GraphicsDrawString($Compass_backbuffer, "E", ($CLeft + $Compass_width), $CenterY - 8) + ;Draw Compass Line-Calculate (X, Y) based on Degrees, Radius, And Center of circle (X, Y) + If $Degree = 0 Or $Degree = 360 Then + $CircleX = $CenterX + $CircleY = $CenterY - $Radius + ElseIf $Degree > 0 And $Degree < 90 Then + $Radians = $Degree * 0.0174532925 + $CircleX = $CenterX + (Sin($Radians) * $Radius) + $CircleY = $CenterY - (Cos($Radians) * $Radius) + ElseIf $Degree = 90 Then + $CircleX = $CenterX + $Radius + $CircleY = $CenterY + ElseIf $Degree > 90 And $Degree < 180 Then + $TmpDegree = $Degree - 90 + $Radians = $TmpDegree * 0.0174532925 + $CircleX = $CenterX + (Cos($Radians) * $Radius) + $CircleY = $CenterY + (Sin($Radians) * $Radius) + ElseIf $Degree = 180 Then + $CircleX = $CenterX + $CircleY = $CenterY + $Radius + ElseIf $Degree > 180 And $Degree < 270 Then + $TmpDegree = $Degree - 180 + $Radians = $TmpDegree * 0.0174532925 + $CircleX = $CenterX - (Sin($Radians) * $Radius) + $CircleY = $CenterY + (Cos($Radians) * $Radius) + ElseIf $Degree = 270 Then + $CircleX = $CenterX - $Radius + $CircleY = $CenterY + ElseIf $Degree > 270 And $Degree < 360 Then + $TmpDegree = $Degree - 270 + $Radians = $TmpDegree * 0.0174532925 + $CircleX = $CenterX - (Cos($Radians) * $Radius) + $CircleY = $CenterY - (Sin($Radians) * $Radius) + EndIf + If $UseGPS = 1 Then _GDIPlus_GraphicsDrawLine($Compass_backbuffer, $CenterX, $CenterY, $CircleX, $CircleY) + ;Draw new image to the screen + _GDIPlus_GraphicsDrawImageRect($Compass_graphics, $Compass_bitmap, 0, 0, $CompassGUI_width, $CompassGUI_height) +EndFunc ;==>_DrawCompass + +;------------------------------------------------------------------------------------------------------------------------------- +; GPS DETAILS GUI FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _OpenGpsDetailsGUI() ;Opens GPS Details GUI + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_OpenGpsDetailsGUI()') ;#Debug Display + If $GpsDetailsOpen = 0 Then + Opt("GUIResizeMode", 1) + $GpsDetailsGUI = GUICreate($Text_GpsDetails, 565, 190, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) + GUISetBkColor($BackgroundColor) + $GpsCurrentDataGUI = GUICtrlCreateLabel('', 8, 5, 550, 15) + GUICtrlSetColor(-1, $TextColor) + $GPGGA_Quality = GUICtrlCreateLabel($Text_Quality & ":", 310, 22, 180, 15) + GUICtrlSetColor(-1, $TextColor) + $GPRMC_Status = GUICtrlCreateLabel($Text_Status & ":", 32, 22, 235, 15) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateGroup("GPRMC", 8, 40, 273, 145) + GUICtrlSetColor(-1, $TextColor) + $GPRMC_Time = GUICtrlCreateLabel($Text_Time & ":", 25, 55, 235, 15) + GUICtrlSetColor(-1, $TextColor) + $GPRMC_Date = GUICtrlCreateLabel($Text_Date & ":", 25, 70, 235, 15) + GUICtrlSetColor(-1, $TextColor) + $GPRMC_Lat = GUICtrlCreateLabel($Column_Names_Latitude & ":", 25, 85, 235, 15) + GUICtrlSetColor(-1, $TextColor) + $GPRMC_Lon = GUICtrlCreateLabel($Column_Names_Longitude & ":", 25, 100, 235, 15) + GUICtrlSetColor(-1, $TextColor) + $GPRMC_SpeedKnots = GUICtrlCreateLabel($Text_SpeedInKnots & ":", 25, 115, 235, 15) + GUICtrlSetColor(-1, $TextColor) + $GPRMC_SpeedMPH = GUICtrlCreateLabel($Text_SpeedInMPH & ":", 25, 130, 243, 15) + GUICtrlSetColor(-1, $TextColor) + $GPRMC_SpeedKmh = GUICtrlCreateLabel($Text_SpeedInKmh & ":", 25, 145, 243, 15) + GUICtrlSetColor(-1, $TextColor) + $GPRMC_TrackAngle = GUICtrlCreateLabel($Text_TrackAngle & ":", 25, 160, 243, 20) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateGroup("GPGGA", 287, 40, 273, 125) + GUICtrlSetColor(-1, $TextColor) + $GPGGA_Time = GUICtrlCreateLabel($Text_Time & ":", 304, 55, 235, 15) + GUICtrlSetColor(-1, $TextColor) + $GPGGA_Satalites = GUICtrlCreateLabel($Text_NumberOfSatalites & ":", 304, 70, 235, 15) + GUICtrlSetColor(-1, $TextColor) + $GPGGA_Lat = GUICtrlCreateLabel($Column_Names_Latitude & ":", 304, 85, 235, 15) + GUICtrlSetColor(-1, $TextColor) + $GPGGA_Lon = GUICtrlCreateLabel($Column_Names_Longitude & ":", 304, 100, 235, 15) + GUICtrlSetColor(-1, $TextColor) + $GPGGA_HorDilPitch = GUICtrlCreateLabel($Text_HorizontalDilutionPosition & ":", 304, 115, 235, 15) + GUICtrlSetColor(-1, $TextColor) + $GPGGA_Alt = GUICtrlCreateLabel($Text_Altitude & ":", 304, 130, 243, 15) + GUICtrlSetColor(-1, $TextColor) + $GPGGA_Geo = GUICtrlCreateLabel($Text_HeightOfGeoid & ":", 304, 145, 243, 15) + GUICtrlSetColor(-1, $TextColor) + $CloseGpsDetailsGUI = GUICtrlCreateButton($Text_Close, 375, 165, 97, 25, 0) + GUICtrlSetOnEvent($CloseGpsDetailsGUI, '_CloseGpsDetailsGUI') + GUISetOnEvent($GUI_EVENT_CLOSE, '_CloseGpsDetailsGUI') + + GUISetState(@SW_SHOW) + + $gpsplit = StringSplit($GpsDetailsPosition, ',') + If $gpsplit[0] = 4 Then ;If $GpsDetailsPosition is a proper position, move and resize window + WinMove($GpsDetailsGUI, '', $gpsplit[1], $gpsplit[2], $gpsplit[3], $gpsplit[4]) + Else ;Set $GpsDetailsPosition to the current window position + $g = WinGetPos($GpsDetailsGUI) + $GpsDetailsPosition = $g[0] & ',' & $g[1] & ',' & $g[2] & ',' & $g[3] + EndIf + + Opt("GUIResizeMode", 802) + $GpsDetailsOpen = 1 + Else + WinActivate($GpsDetailsGUI) + EndIf +EndFunc ;==>_OpenGpsDetailsGUI + +Func _UpdateGpsDetailsGUI() ;Updates information on GPS Details GUI + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_UpdateGpsDetailsGUI()') ;#Debug Display + If $GpsDetailsOpen = 1 Then + GUICtrlSetData($GPGGA_Time, $Text_Time & ": " & $FixTime) + GUICtrlSetData($GPGGA_Lat, $Column_Names_Latitude & ": " & _GpsFormat($Latitude)) + GUICtrlSetData($GPGGA_Lon, $Column_Names_Longitude & ": " & _GpsFormat($Longitude)) + GUICtrlSetData($GPGGA_Quality, $Text_Quality & ": " & $Temp_Quality) + GUICtrlSetData($GPGGA_Satalites, $Text_NumberOfSatalites & ": " & $NumberOfSatalites) + GUICtrlSetData($GPGGA_HorDilPitch, $Text_HorizontalDilutionPosition & ": " & $HorDilPitch) + GUICtrlSetData($GPGGA_Alt, $Text_Altitude & ": " & $Alt & $AltS) + GUICtrlSetData($GPGGA_Geo, $Text_HeightOfGeoid & ": " & $Geo & $GeoS) + + GUICtrlSetData($GPRMC_Time, $Text_Time & ": " & $FixTime2) + GUICtrlSetData($GPRMC_Date, $Text_Date & ": " & $FixDate) + GUICtrlSetData($GPRMC_Lat, $Column_Names_Latitude & ": " & _GpsFormat($Latitude2)) + GUICtrlSetData($GPRMC_Lon, $Column_Names_Longitude & ": " & _GpsFormat($Longitude2)) + GUICtrlSetData($GPRMC_Status, $Text_Status & ": " & $Temp_Status) + GUICtrlSetData($GPRMC_SpeedKnots, $Text_SpeedInKnots & ": " & $SpeedInKnots & " Kn") + GUICtrlSetData($GPRMC_SpeedMPH, $Text_SpeedInMPH & ": " & $SpeedInMPH & " MPH") + GUICtrlSetData($GPRMC_SpeedKmh, $Text_SpeedInKmh & ": " & $SpeedInKmH & " Km/H") + GUICtrlSetData($GPRMC_TrackAngle, $Text_TrackAngle & ": " & $TrackAngle) + EndIf +EndFunc ;==>_UpdateGpsDetailsGUI + +Func _ClearGpsDetailsGUI() ;Clears all GPS Details information + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ClearGpsDetailsGUI()') ;#Debug Display + If $UseGPS = 1 Then + If $GpsReset = 1 Then + GUICtrlSetData($msgdisplay, $Text_SecondsSinceGpsUpdate & ": GPGGA:" & Round(TimerDiff($GPGGA_Update) / 1000) & " / " & ($GpsTimeout / 1000) & " - " & "GPRMC:" & Round(TimerDiff($GPRMC_Update) / 1000) & " / " & ($GpsTimeout / 1000)) + If Round(TimerDiff($GPGGA_Update)) > $GpsTimeout Then + If $UseWiFiDbGpsLocate = 0 Then + $Latitude = 'N 0000.0000' + $Longitude = 'E 0000.0000' + EndIf + $FixTime = '' + $NumberOfSatalites = '00' + $HorDilPitch = '0' + $Alt = '0' + $AltS = 'M' + $Geo = '0' + $GeoS = 'M' + $GPGGA_Update = TimerInit() + EndIf + If Round(TimerDiff($GPRMC_Update)) > $GpsTimeout Then + $FixTime2 = '' + $Latitude2 = 'N 0000.0000' + $Longitude2 = 'E 0000.0000' + $SpeedInKnots = '0' + $SpeedInMPH = '0' + $SpeedInKmH = '0' + $TrackAngle = '0' + $FixDate = '' + $GPRMC_Update = TimerInit() + EndIf + EndIf + If $UseWiFiDbGpsLocate = 1 Then + If Round(TimerDiff($WifidbGPS_Update)) > $GpsTimeout Then + GUICtrlSetData($msgdisplay, $Text_SecondsSinceGpsUpdate & ": WifiDB:" & Round(TimerDiff($WifidbGPS_Update) / 1000) & " / " & ($GpsTimeout / 1000)) + $Latitude = 'N 0000.0000' + $Longitude = 'E 0000.0000' + $LatitudeWifidb = 'N 0000.0000' + $LongitudeWifidb = 'E 0000.0000' + GUICtrlSetData($GuiLat, $Text_Latitude & ': ' & _GpsFormat($Latitude)) ;Set GPS Latitude in GUI + GUICtrlSetData($GuiLon, $Text_Longitude & ': ' & _GpsFormat($Longitude)) ;Set GPS Longitude in GUI + $WifidbGPS_Update = TimerInit() + EndIf + EndIf + EndIf +EndFunc ;==>_ClearGpsDetailsGUI + +Func _CloseGpsDetailsGUI() ; Closes GPS Details GUI + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CloseGpsDetailsGUI()') ;#Debug Display + GUIDelete($GpsDetailsGUI) + $GpsDetailsOpen = 0 +EndFunc ;==>_CloseGpsDetailsGUI + +;------------------------------------------------------------------------------------------------------------------------------- +; SORT FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- +Func _SortTree() ;Sort the data in the treeview + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SortTree()') ;#Debug Display + GUICtrlSetData($msgdisplay, $Text_SortingTreeview) + _GUICtrlTreeView_Sort($TreeviewAPs) + GUICtrlSetData($msgdisplay, '') +EndFunc ;==>_SortTree + +Func _SortListColumn($ListColName, $SortOrder) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SortListColumn()') ;#Debug Display + Local $DbColName = _GetDbColNameByListColName($ListColName) ;Set DB Column to sort by + _ListSort($DbColName, $SortOrder) ;Sort List + $sort_timer = TimerInit() ;Reset Sort Timer +EndFunc ;==>_SortListColumn + +Func _HeaderSort($column) ;Sort a column in ap list + ;ConsoleWrite($column & @CRLF) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_HeaderSort()') ;#Debug Display + ;Get Column Name + Local $colInfo = _GUICtrlListView_GetColumn($ListviewAPs, $column) + Local $colName = $colInfo[5] + ;Set DB Column to sort by + Local $DbColName = _GetDbColNameByListColName($colName) + ;Sort List + GUICtrlSetData($msgdisplay, $Text_SortingList) + _ListSort($DbColName, $Direction[$column]) + GUICtrlSetData($msgdisplay, '') + ;Reverse sort direction (for next sort) + If $Direction[$column] = 1 Then + $Direction[$column] = 0 + Else + $Direction[$column] = 1 + EndIf + ;Sort complete. Reset sort variable. + $SortColumn = -1 +EndFunc ;==>_HeaderSort + +Func _ListSort($DbCol, $SortOrder) + If $DbCol <> "" Then + ;ConsoleWrite($DbCol & @CRLF) + Local $ListRowPos = -1 + If $SortOrder = 1 Then + $SortDir = "DESC" + Else + $SortDir = "ASC" + EndIf + ConsoleWrite("$DbCol:" & $DbCol & " $SortOrder:" & $SortOrder & " $SortDir:" & $SortDir & @CRLF) + If $DbCol = "Latitude" Or $DbCol = "Longitude" Then ; Sort by Latitude Or Longitude + ;Add results that have no GPS postion first if DESC + If $SortDir = "DESC" Then + $query = "SELECT ListRow, ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active, Signal, HighSignal, RSSI, HighRSSI FROM AP WHERE HighGpsHistID=0 And ListRow<>-1 ORDER BY ApID " & $SortDir + $ListRowPos = _SortDbQueryToList($query, $ListRowPos) + EndIf + ;Add sorted results with GPS + If $DbCol = "Latitude" Then $query = "SELECT AP.ListRow, AP.ApID, AP.SSID, AP.BSSID, AP.NETTYPE, AP.RADTYPE, AP.CHAN, AP.AUTH, AP.ENCR, AP.SecType, AP.BTX, AP.OTX, AP.MANU, AP.LABEL, AP.HighGpsHistID, AP.FirstHistID, AP.LastHistID, AP.LastGpsID, AP.Active, AP.Signal, AP.HighSignal, AP.RSSI, AP.HighRSSI FROM (AP INNER JOIN Hist ON AP.HighGpsHistId = Hist.HistID) INNER JOIN GPS ON Hist.GpsID = GPS.GPSID WHERE ListRow<>-1 ORDER BY GPS.Latitude " & $SortDir & ", GPS.Longitude " & $SortDir & ", AP.ApID " & $SortDir + If $DbCol = "Longitude" Then $query = "SELECT AP.ListRow, AP.ApID, AP.SSID, AP.BSSID, AP.NETTYPE, AP.RADTYPE, AP.CHAN, AP.AUTH, AP.ENCR, AP.SecType, AP.BTX, AP.OTX, AP.MANU, AP.LABEL, AP.HighGpsHistID, AP.FirstHistID, AP.LastHistID, AP.LastGpsID, AP.Active, AP.Signal, AP.HighSignal, AP.RSSI, AP.HighRSSI FROM (AP INNER JOIN Hist ON AP.HighGpsHistId = Hist.HistID) INNER JOIN GPS ON Hist.GpsID = GPS.GPSID WHERE ListRow<>-1 ORDER BY GPS.Longitude " & $SortDir & ", GPS.Latitude " & $SortDir & ", AP.ApID " & $SortDir + $ListRowPos = _SortDbQueryToList($query, $ListRowPos) + ;Add results that have no GPS postion last if ASC + If $SortDir = "ASC" Then + $query = "SELECT ListRow, ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active, Signal, HighSignal, RSSI, HighRSSI FROM AP WHERE HighGpsHistID=0 And ListRow<>-1 ORDER BY ApID " & $SortDir + $ListRowPos = _SortDbQueryToList($query, $ListRowPos) + EndIf + ElseIf $DbCol = "FirstActive" Then ; Sort by First Active Time + $query = "SELECT AP.ListRow, AP.ApID, AP.SSID, AP.BSSID, AP.NETTYPE, AP.RADTYPE, AP.CHAN, AP.AUTH, AP.ENCR, AP.SecType, AP.BTX, AP.OTX, AP.MANU, AP.LABEL, AP.HighGpsHistID, AP.FirstHistID, AP.LastHistID, AP.LastGpsID, AP.Active, AP.Signal, AP.HighSignal, AP.RSSI, AP.HighRSSI, Hist.Date1, Hist.Time1 FROM AP INNER JOIN Hist ON AP.FirstHistID = Hist.HistID WHERE ListRow<>-1 ORDER BY Hist.Date1 " & $SortDir & ", Hist.Time1 " & $SortDir & ", AP.ApID " & $SortDir + $ListRowPos = _SortDbQueryToList($query, $ListRowPos) + ElseIf $DbCol = "LastActive" Then ; Sort by Last Active Time + $query = "SELECT AP.ListRow, AP.ApID, AP.SSID, AP.BSSID, AP.NETTYPE, AP.RADTYPE, AP.CHAN, AP.AUTH, AP.ENCR, AP.SecType, AP.BTX, AP.OTX, AP.MANU, AP.LABEL, AP.HighGpsHistID, AP.FirstHistID, AP.LastHistID, AP.LastGpsID, AP.Active, AP.Signal, AP.HighSignal, AP.RSSI, AP.HighRSSI, Hist.Date1, Hist.Time1 FROM AP INNER JOIN Hist ON AP.LastHistID = Hist.HistID WHERE ListRow<>-1 ORDER BY Hist.Date1 " & $SortDir & ", Hist.Time1 " & $SortDir & ", AP.ApID " & $SortDir + $ListRowPos = _SortDbQueryToList($query, $ListRowPos) + ElseIf $DbCol = "Signal" Or $DbCol = "HighSignal" Or $DbCol = "RSSI" Or $DbCol = "HighRSSI" Or $DbCol = "CHAN" Then ; Sort by Last Active Time + $query = "SELECT ListRow, ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active, Signal, HighSignal, RSSI, HighRSSI FROM AP WHERE ListRow<>-1 ORDER BY " & $DbCol & " " & $SortDir & ", ApID " & $SortDir + $ListRowPos = _SortDbQueryToList($query, $ListRowPos) + Else ; Sort by any other column + $query = "SELECT ListRow, ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active, Signal, HighSignal, RSSI, HighRSSI FROM AP WHERE ListRow<>-1 ORDER BY " & $DbCol & " " & $SortDir & ", ApID " & $SortDir + $ListRowPos = _SortDbQueryToList($query, $ListRowPos) + EndIf + EndIf +EndFunc ;==>_ListSort + +Func _SortDbQueryToList($query, $listpos) + ;ConsoleWrite($query & @CRLF) + _GUICtrlListView_BeginUpdate($ListviewAPs) + GUISetState(@SW_LOCK, $Vistumbler) + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + For $wlv = 1 To $FoundApMatch + $listpos += 1 + $Found_ListRow = $ApMatchArray[$wlv][1] + If $Found_ListRow <> $listpos Then ;If row has changed, update list information + $Found_APID = $ApMatchArray[$wlv][2] + $Found_SSID = $ApMatchArray[$wlv][3] + $Found_BSSID = $ApMatchArray[$wlv][4] + $Found_NETTYPE = $ApMatchArray[$wlv][5] + $Found_RADTYPE = $ApMatchArray[$wlv][6] + $Found_CHAN = $ApMatchArray[$wlv][7] + $Found_AUTH = $ApMatchArray[$wlv][8] + $Found_ENCR = $ApMatchArray[$wlv][9] + $Found_SecType = $ApMatchArray[$wlv][10] + $Found_BTX = $ApMatchArray[$wlv][11] + $Found_OTX = $ApMatchArray[$wlv][12] + $Found_MANU = $ApMatchArray[$wlv][13] + $Found_LABEL = $ApMatchArray[$wlv][14] + $Found_HighGpsHistId = $ApMatchArray[$wlv][15] + $Found_FirstHistID = $ApMatchArray[$wlv][16] + $Found_LastHistID = $ApMatchArray[$wlv][17] + $Found_LastGpsID = $ApMatchArray[$wlv][18] + $Found_Active = $ApMatchArray[$wlv][19] + $Found_Signal = $ApMatchArray[$wlv][20] + $Found_HighSignal = $ApMatchArray[$wlv][21] + $Found_RSSI = $ApMatchArray[$wlv][22] + $Found_HighRSSI = $ApMatchArray[$wlv][23] + + ;Get First Time + $query = "SELECT Date1, Time1 FROM Hist WHERE HistID=" & $Found_FirstHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_FirstDate = $HistMatchArray[1][1] + $Found_FirstTime = $HistMatchArray[1][2] + $Found_FirstDateTime = $Found_FirstDate & ' ' & $Found_FirstTime + + ;Get Last Time + $query = "SELECT Date1, Time1 FROM Hist WHERE HistID=" & $Found_LastHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_LastDate = $HistMatchArray[1][1] + $Found_LastTime = $HistMatchArray[1][2] + $Found_LastDateTime = $Found_LastDate & ' ' & $Found_LastTime + + ;Get GPS Position + If $Found_HighGpsHistId = 0 Then + $Found_Lat = "N 0000.0000" + $Found_Lon = "E 0000.0000" + Else + $query = "SELECT GpsID FROM Hist WHERE HistID=" & $Found_HighGpsHistId + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_GpsID = $HistMatchArray[1][1] + $query = "SELECT Latitude, Longitude FROM GPS WHERE GPSID=" & $Found_GpsID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_Lat = $GpsMatchArray[1][1] + $Found_Lon = $GpsMatchArray[1][2] + EndIf + + ;Write changes to listview + _ListViewAdd($listpos, $Found_APID, $Found_Active, $Found_BSSID, $Found_SSID, $Found_AUTH, $Found_ENCR, $Found_Signal, $Found_HighSignal, $Found_RSSI, $Found_HighRSSI, $Found_CHAN, $Found_RADTYPE, $Found_BTX, $Found_OTX, $Found_NETTYPE, $Found_FirstDateTime, $Found_LastDateTime, $Found_Lat, $Found_Lon, $Found_MANU, $Found_LABEL) + + ;Update ListRow Icon + _UpdateIcon($listpos, $Found_Signal, $Found_SecType) + + ;Update ListRow + $query = "UPDATE AP SET ListRow=" & $listpos & " WHERE ApID=" & $Found_APID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + EndIf + Next + GUISetState(@SW_UNLOCK, $Vistumbler) + _GUICtrlListView_EndUpdate($ListviewAPs) + Return ($listpos) +EndFunc ;==>_SortDbQueryToList + +Func _GetDbColNameByListColName($colName) + Local $DbSortCol = "" + ;ConsoleWrite($colName & @CRLF) + If $colName = $Column_Names_Line Then + $DbSortCol = "ApID" + ElseIf $colName = $Column_Names_Active Then + $DbSortCol = "Active" + ElseIf $colName = $Column_Names_BSSID Then + $DbSortCol = "BSSID" + ElseIf $colName = $Column_Names_SSID Then + $DbSortCol = "SSID" + ElseIf $colName = $Column_Names_Signal Then + $DbSortCol = "Signal" + ElseIf $colName = $Column_Names_HighSignal Then + $DbSortCol = "HighSignal" + ElseIf $colName = $Column_Names_RSSI Then + $DbSortCol = "RSSI" + ElseIf $colName = $Column_Names_HighRSSI Then + $DbSortCol = "HighRSSI" + ElseIf $colName = $Column_Names_Channel Then + $DbSortCol = "CHAN" + ElseIf $colName = $Column_Names_Authentication Then + $DbSortCol = "AUTH" + ElseIf $colName = $Column_Names_Encryption Then + $DbSortCol = "ENCR" + ElseIf $colName = $Column_Names_NetworkType Then + $DbSortCol = "NETTYPE" + ElseIf $colName = $Column_Names_Latitude Then + $DbSortCol = "Latitude" + ElseIf $colName = $Column_Names_Longitude Then + $DbSortCol = "Longitude" + ElseIf $colName = $Column_Names_LatitudeDMM Then + $DbSortCol = "Latitude" + ElseIf $colName = $Column_Names_LongitudeDMM Then + $DbSortCol = "Longitude" + ElseIf $colName = $Column_Names_LatitudeDMS Then + $DbSortCol = "Latitude" + ElseIf $colName = $Column_Names_LongitudeDMS Then + $DbSortCol = "Longitude" + ElseIf $colName = $Column_Names_MANUF Then + $DbSortCol = "MANU" + ElseIf $colName = $Column_Names_Label Then + $DbSortCol = "Label" + ElseIf $colName = $Column_Names_RadioType Then + $DbSortCol = "RADTYPE" + ElseIf $colName = $Column_Names_BasicTransferRates Then + $DbSortCol = "BTX" + ElseIf $colName = $Column_Names_OtherTransferRates Then + $DbSortCol = "OTX" + ElseIf $colName = $Column_Names_FirstActive Then + $DbSortCol = "FirstActive" + ElseIf $colName = $Column_Names_LastActive Then + $DbSortCol = "LastActive" + EndIf + Return ($DbSortCol) +EndFunc ;==>_GetDbColNameByListColName + +Func _ManufacturerSort() ;Sorts manufacturer column in manufacturer list + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ManufacturerSort()') ;#Debug Display + $column = GUICtrlGetState($GUI_Manu_List) + If $Direction2[$column] = 0 Then + Dim $v_sort = False ;set descending + $Direction2[$column] = 1 + Else + Dim $v_sort = True ;set ascending + $Direction2[$column] = 0 + EndIf + _GUICtrlListView_SimpleSort($GUI_Manu_List, $v_sort, $column) + $Apply_Manu = 1 +EndFunc ;==>_ManufacturerSort + +Func _LabelSort() ;Sorts manufacturer column in manufacturer list + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_LabelSort()') ;#Debug Display + $column = GUICtrlGetState($GUI_Lab_List) + If $Direction3[$column] = 0 Then + Dim $v_sort = False ;set descending + $Direction3[$column] = 1 + Else + Dim $v_sort = True ;set ascending + $Direction3[$column] = 0 + EndIf + _GUICtrlListView_SimpleSort($GUI_Lab_List, $v_sort, $column) + $Apply_Lab = 1 +EndFunc ;==>_LabelSort + +;------------------------------------------------------------------------------------------------------------------------------- +; WINDOW FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + + +Func _SetControlSizes() ;Sets control positions in GUI based on the windows current size + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SetControlSizes()') ;#Debug Display + $a = _WinAPI_GetClientRect($Vistumbler) + $b = _WinAPI_GetClientRect($GraphicGUI) + $sizes = DllStructGetData($a, "Right") & '-' & DllStructGetData($a, "Bottom") & '-' & DllStructGetData($b, "Right") & '-' & DllStructGetData($b, "Bottom") + If $sizes <> $sizes_old Or $Graph <> $Graph_old Or $MinimalGuiMode <> $MinimalGuiMode_old Then + $DataChild_Left = 2 + $DataChild_Width = DllStructGetData($a, "Right") + $DataChild_Top = 65 + $DataChild_Height = DllStructGetData($a, "Bottom") - $DataChild_Top + If $MinimalGuiMode = 1 Then + GUISetState(@SW_LOCK, $Vistumbler) + WinSetState($TreeviewAPs, "", @SW_HIDE) + WinSetState($ListviewAPs, "", @SW_HIDE) + GUISetState(@SW_HIDE, $GraphicGUI) + GUICtrlSetState($GraphButton1, $GUI_HIDE) + GUICtrlSetState($GraphButton2, $GUI_HIDE) + GUICtrlSetState($SaveAndClearButton, $GUI_SHOW) + GUISetState(@SW_UNLOCK, $Vistumbler) + ElseIf $Graph <> 0 Then + $Graphic_left = $DataChild_Left + $Graphic_width = $DataChild_Width - $Graphic_left + $Graphic_top = $DataChild_Top + $Graphic_height = $DataChild_Height * $SplitHeightPercent + + $Graph_height = $Graphic_height - ($Graph_topborder + $Graph_bottomborder) + $Graph_width = $Graphic_width - ($Graph_leftborder + $Graph_rightborder) + + $ListviewAPs_left = $DataChild_Left + $ListviewAPs_width = $DataChild_Width - $ListviewAPs_left + $ListviewAPs_top = $DataChild_Top + ($Graphic_height + 1) + $ListviewAPs_height = $DataChild_Height - ($Graphic_height + 1) + + GUISetState(@SW_LOCK, $Vistumbler) + WinMove($ListviewAPs, "", $ListviewAPs_left, $ListviewAPs_top, $ListviewAPs_width, $ListviewAPs_height) + WinMove($GraphicGUI, "", $Graphic_left, $Graphic_top, $Graphic_width, $Graphic_height) + WinSetState($TreeviewAPs, "", @SW_HIDE) + WinSetState($ListviewAPs, "", @SW_SHOW) + GUISetState(@SW_SHOW, $GraphicGUI) + GUICtrlSetState($GraphButton1, $GUI_SHOW) + GUICtrlSetState($GraphButton2, $GUI_SHOW) + GUICtrlSetState($SaveAndClearButton, $GUI_HIDE) + GUISetState(@SW_UNLOCK, $Vistumbler) + + $Graphic = _GDIPlus_GraphicsCreateFromHWND($GraphicGUI) + $Graph_bitmap = _GDIPlus_BitmapCreateFromGraphics($Graphic_width, $Graphic_height, $Graphic) + $Graph_backbuffer = _GDIPlus_ImageGetGraphicsContext($Graph_bitmap) + Else + $TreeviewAPs_left = $DataChild_Left + $TreeviewAPs_width = ($DataChild_Width * $SplitPercent) - $TreeviewAPs_left + $TreeviewAPs_top = $DataChild_Top + $TreeviewAPs_height = $DataChild_Height + + $ListviewAPs_left = ($DataChild_Width * $SplitPercent) + 1 + $ListviewAPs_width = $DataChild_Width - $ListviewAPs_left + $ListviewAPs_top = $DataChild_Top + $ListviewAPs_height = $DataChild_Height + + GUISetState(@SW_LOCK, $Vistumbler) + WinMove($ListviewAPs, "", $ListviewAPs_left, $ListviewAPs_top, $ListviewAPs_width, $ListviewAPs_height) + WinMove($TreeviewAPs, "", $TreeviewAPs_left, $TreeviewAPs_top, $TreeviewAPs_width, $TreeviewAPs_height) + WinSetState($TreeviewAPs, "", @SW_SHOW) + WinSetState($ListviewAPs, "", @SW_SHOW) + GUISetState(@SW_HIDE, $GraphicGUI) + GUICtrlSetState($GraphButton1, $GUI_SHOW) + GUICtrlSetState($GraphButton2, $GUI_SHOW) + GUISetState(@SW_UNLOCK, $Vistumbler) + EndIf + $sizes_old = $sizes + $Graph_old = $Graph + $MinimalGuiMode_old = $MinimalGuiMode + EndIf +EndFunc ;==>_SetControlSizes + +Func _TreeviewListviewResize() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_TreeviewListviewResize()') ;#Debug Display + $cursorInfo = GUIGetCursorInfo($Vistumbler) + If $Graph = 0 Then + If WinActive($Vistumbler) And $cursorInfo[0] > ($TreeviewAPs_left + $TreeviewAPs_width - 5) And $cursorInfo[0] < ($TreeviewAPs_left + $TreeviewAPs_width + 5) And $cursorInfo[1] > $TreeviewAPs_top And $cursorInfo[1] < ($TreeviewAPs_top + $TreeviewAPs_height) And $MoveMode = False Then + $MoveArea = True + GUISetCursor(13, 1) ; 13 = SIZEWE + ElseIf $MoveArea = True Then + $MoveArea = False + GUISetCursor(2, 1) ; 2 = ARROW + EndIf + If $MoveArea = True And $cursorInfo[2] = 1 Then + $MoveMode = True + EndIf + If $MoveMode = True Then + GUISetCursor(13, 1) ; 13 = SIZEWE + $TreeviewAPs_width = $cursorInfo[0] - $TreeviewAPs_left + WinMove($TreeviewAPs, "", $TreeviewAPs_left, $TreeviewAPs_top, $TreeviewAPs_width, $TreeviewAPs_height) ; resize treeview + $ListviewAPs_left = $TreeviewAPs_left + $TreeviewAPs_width + 1 + $ListviewAPs_width = $DataChild_Width - $ListviewAPs_left + WinMove($ListviewAPs, "", $ListviewAPs_left, $ListviewAPs_top, $ListviewAPs_width, $ListviewAPs_height) ; resize listview + $SplitPercent = StringFormat('%0.2f', $TreeviewAPs_width / $DataChild_Width) + _WinAPI_RedrawWindow($ListviewAPs) + EndIf + If $MoveMode = True And $cursorInfo[2] = 0 Then + $MoveMode = False + GUISetCursor(2, 1) ; 2 = ARROW + EndIf + Else + If WinActive($Vistumbler) And $cursorInfo[1] > $ListviewAPs_top - 5 And $cursorInfo[1] < $ListviewAPs_top + 5 And $MoveMode = False Then + $MoveArea = True + GUISetCursor(11, 1) ; 11 = SIZENS + ElseIf $MoveArea = True Then + $MoveArea = False + GUISetCursor(2, 1) ; 2 = ARROW + EndIf + If $MoveArea = True And $cursorInfo[2] = 1 Then + $MoveMode = True + EndIf + If $MoveMode = True Then + GUISetCursor(11, 1) ; 11 = SIZENS + $Graphic_height = $cursorInfo[1] - $Graphic_top + WinMove($GraphicGUI, "", $Graphic_left, $Graphic_top, $Graphic_width, $Graphic_height) + $ListviewAPs_top = $Graphic_top + $Graphic_height + 1 + $ListviewAPs_height = $DataChild_Height - $Graphic_height + WinMove($ListviewAPs, "", $ListviewAPs_left, $ListviewAPs_top, $ListviewAPs_width, $ListviewAPs_height) ; resize listview + $SplitHeightPercent = StringFormat('%0.2f', $Graphic_height / $DataChild_Height) + _WinAPI_RedrawWindow($ListviewAPs) + EndIf + If $MoveMode = True And $cursorInfo[2] = 0 Then + $MoveMode = False + GUISetCursor(2, 1) ; 2 = ARROW + EndIf + EndIf +EndFunc ;==>_TreeviewListviewResize + +Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) + Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo + $hWndListView = $ListviewAPs + If Not IsHWnd($ListviewAPs) Then $hWndListView = GUICtrlGetHandle($ListviewAPs) + + $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) + $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) + ;$iIDFrom = DllStructGetData($tNMHDR, "IDFrom") + $iCode = DllStructGetData($tNMHDR, "Code") + Switch $hWndFrom + Case $hWndListView + Switch $iCode + Case $NM_CLICK + ;ConsoleWrite('Listview Left Click' & @CRLF) + Case $NM_RCLICK + ;ConsoleWrite('Listview Right Click' & @CRLF) + ListViewAPs_RClick() + Case $NM_DBLCLK + ;ConsoleWrite("Listview Double Click" & @CRLF) + $Selected = _GUICtrlListView_GetNextItem($ListviewAPs) ; find what AP is selected in the list. returns -1 is nothing is selected + If $Selected <> -1 Then _GUICtrlListView_SetItemSelected($ListviewAPs, $Selected, False) ; Deselect selected AP + Case $LVN_COLUMNCLICK + ;ConsoleWrite("Listview Column Click" & @CRLF) + $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam) + $SortColumn = DllStructGetData($tInfo, "SubItem") + EndSwitch + EndSwitch + Return $GUI_RUNDEFMSG +EndFunc ;==>WM_NOTIFY + +Func ListViewAPs_RClick() + Local $aHit + $hWndListView = $ListviewAPs + If Not IsHWnd($ListviewAPs) Then $hWndListView = GUICtrlGetHandle($ListviewAPs) + $aHit = _GUICtrlListView_SubItemHitTest($hWndListView) + If ($aHit[0] <> -1) Then + ; Create a standard popup menu + $hMenu = _GUICtrlMenu_CreatePopup() + _GUICtrlMenu_AddMenuItem($hMenu, $Text_Copy, $idCopy) + _GUICtrlMenu_AddMenuItem($hMenu, $Text_AddNewMan, $idNewManu) + _GUICtrlMenu_AddMenuItem($hMenu, $Text_AddNewLabel, $idNewLabel) + _GUICtrlMenu_AddMenuItem($hMenu, $Text_GeoNamesInfo, $idGNInfo) + _GUICtrlMenu_AddMenuItem($hMenu, $Text_WifiDbPHPgraph, $idGraph) + _GUICtrlMenu_AddMenuItem($hMenu, $Text_FindApInWifidb, $idFindAP) + + + ; ======================================================================== + ; capture the context menu selections + ; ======================================================================== + Switch _GUICtrlMenu_TrackPopupMenu($hMenu, $hWndListView, -1, -1, 1, 1, 2) + Case $idCopy + ConsoleWrite("Copy: " & StringFormat("Item, SubItem [%d, %d]", $aHit[0], $aHit[1]) & @CRLF) + _CopySelectedAP() + Case $idNewManu + ConsoleWrite("AddManu: " & StringFormat("Item, SubItem [%d, %d]", $aHit[0], $aHit[1]) & @CRLF) + _RClick_AddManu() + Case $idNewLabel + ConsoleWrite("AddLabel: " & StringFormat("Item, SubItem [%d, %d]", $aHit[0], $aHit[1]) & @CRLF) + _RClick_AddLabel() + Case $idGNInfo + ConsoleWrite("Info: " & StringFormat("Item, SubItem [%d, %d]", $aHit[0], $aHit[1]) & @CRLF) + _GeonamesInfo($aHit[0]) + Case $idGraph + ConsoleWrite("Graph: " & StringFormat("Item, SubItem [%d, %d]", $aHit[0], $aHit[1]) & @CRLF) + _ViewInWifiDbGraph_Open($aHit[0]) + Case $idFindAP + ConsoleWrite("Find AP: " & StringFormat("Item, SubItem [%d, %d]", $aHit[0], $aHit[1]) & @CRLF) + _LocateAPInWifidb($aHit[0], 1) + EndSwitch + _GUICtrlMenu_DestroyMenu($hMenu) + EndIf +EndFunc ;==>ListViewAPs_RClick + +Func _RClick_AddManu() ;Adds new manucaturer to settings gui manufacturer list + If $AddMacOpen = 1 Then _MacAdd_Close() + $Selected = _GUICtrlListView_GetNextItem($ListviewAPs) ; find what AP is selected in the list. returns -1 is nothing is selected + If $Selected <> -1 Then ;If a access point is selected in the listview, map its data + ;Get Mac Address + $query = "SELECT BSSID FROM AP WHERE ListRow=" & $Selected + $ListRowMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_BSSID = StringUpper(StringReplace(StringReplace(StringReplace(StringReplace($ListRowMatchArray[1][1], ':', ''), '-', ''), '"', ''), ' ', '')) + $Found_BSSID = StringTrimRight($Found_BSSID, StringLen($Found_BSSID) - 6) + + ;Get existing mac address information if it exists + Local $Found_MMANU + $query = "SELECT Manufacturer FROM Manufacturers WHERE BSSID='" & $Found_BSSID & "'" + $ManuMatchArray = _RecordSearch($ManuDB, $query, $ManuDB_OBJ) + $FoundManuMatch = UBound($ManuMatchArray) - 1 + If $FoundManuMatch = 1 Then + $Found_MMANU = $ManuMatchArray[1][1] + EndIf + + ;Present GUI to change mac address + $MacAdd_GUI = GUICreate($Text_AddNewMan, 623, 96) + GUISetBkColor($BackgroundColor) + GUICtrlCreateLabel($Column_Names_BSSID, 15, 10, 150, 15) + $MacAdd_GUI_BSSID = GUICtrlCreateInput($Found_BSSID, 16, 30, 153, 21) + GUICtrlCreateLabel($Column_Names_MANUF, 185, 10, 420, 15) + $MacAdd_GUI_MANU = GUICtrlCreateInput($Found_MMANU, 185, 30, 420, 21) + $MacAdd_OK = GUICtrlCreateButton($Text_Ok, 160, 60, 129, 25) + GUICtrlSetState(-1, 512) + $MacAdd_Cancel = GUICtrlCreateButton($Text_Cancel, 298, 60, 129, 25) + GUISetState(@SW_SHOW) + $AddMacOpen = 1 + GUICtrlSetOnEvent($MacAdd_OK, "_MacAdd_Ok") + GUICtrlSetOnEvent($MacAdd_Cancel, "_MacAdd_Close") + + Else + MsgBox(0, $Text_Error, "No AP selected") + EndIf +EndFunc ;==>_RClick_AddManu + +Func _MacAdd_Ok() + $MacAdd_BSSID = GUICtrlRead($MacAdd_GUI_BSSID) + $MacAdd_MANU = GUICtrlRead($MacAdd_GUI_MANU) + ;Check if mac already exists + $query = "SELECT Manufacturer FROM Manufacturers WHERE BSSID='" & $MacAdd_BSSID & "'" + $ManuMatchArray = _RecordSearch($ManuDB, $query, $ManuDB_OBJ) + $FoundManuMatch = UBound($ManuMatchArray) - 1 + If $FoundManuMatch = 1 Then ; Mac Exists, ask to update it + $overwrite_entry = MsgBox(4, $Text_Overwrite & '?', $Text_MacExistsOverwriteIt) + If $overwrite_entry = 6 Then + $query = "UPDATE Manufacturers SET Manufacturer='" & StringReplace($MacAdd_MANU, "'", "''") & "' WHERE BSSID='" & $MacAdd_BSSID & "'" + _ExecuteMDB($ManuDB, $ManuDB_OBJ, $query) + EndIf + Else ; Mac doesn't exist, Add it + ReDim $AddManuRecordArray[3] + $AddManuRecordArray[0] = 2 + $AddManuRecordArray[1] = $MacAdd_BSSID + $AddManuRecordArray[2] = $MacAdd_MANU + _AddRecord($ManuDB, "Manufacturers", $ManuDB_OBJ, $AddManuRecordArray) + EndIf + _MacAdd_Close() +EndFunc ;==>_MacAdd_Ok + +Func _MacAdd_Close() ;Close edit manufacturer window + GUIDelete($MacAdd_GUI) + $AddMacOpen = 0 + _UpdateListMacLabels() +EndFunc ;==>_MacAdd_Close + +Func _RClick_AddLabel() ;Adds new manucaturer to settings gui manufacturer list + If $AddLabelOpen = 1 Then _LabelAdd_Close() + $Selected = _GUICtrlListView_GetNextItem($ListviewAPs) ; find what AP is selected in the list. returns -1 is nothing is selected + If $Selected <> -1 Then ;If a access point is selected in the listview, map its data + ;Get Mac Address + $query = "SELECT BSSID FROM AP WHERE ListRow=" & $Selected + $ListRowMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_BSSID = StringUpper(StringReplace(StringReplace(StringReplace(StringReplace($ListRowMatchArray[1][1], ':', ''), '-', ''), '"', ''), ' ', '')) + ;Get existing mac address information if it exists + Local $Found_MLABEL + $query = "SELECT Label FROM Labels WHERE BSSID='" & $Found_BSSID & "'" + $ManuMatchArray = _RecordSearch($LabDB, $query, $LabDB_OBJ) + $FoundManuMatch = UBound($ManuMatchArray) - 1 + If $FoundManuMatch = 1 Then + $Found_MLABEL = $ManuMatchArray[1][1] + EndIf + ;Present GUI to change mac address + $LabelAdd_GUI = GUICreate($Text_AddNewLabel, 623, 96) + GUISetBkColor($BackgroundColor) + GUICtrlCreateLabel($Column_Names_BSSID, 15, 10, 150, 15) + $LabelAdd_GUI_BSSID = GUICtrlCreateInput($Found_BSSID, 16, 30, 153, 21) + GUICtrlCreateLabel($Column_Names_Label, 185, 10, 420, 15) + $LabelAdd_GUI_LABEL = GUICtrlCreateInput($Found_MLABEL, 185, 30, 420, 21) + $LabelAdd_OK = GUICtrlCreateButton($Text_Ok, 160, 60, 129, 25) + GUICtrlSetState(-1, 512) + $LabelAdd_Cancel = GUICtrlCreateButton($Text_Cancel, 298, 60, 129, 25) + GUISetState(@SW_SHOW) + $AddLabelOpen = 1 + GUICtrlSetOnEvent($LabelAdd_OK, "_LabelAdd_Ok") + GUICtrlSetOnEvent($LabelAdd_Cancel, "_LabelAdd_Close") + Else + MsgBox(0, $Text_Error, "No AP selected") + EndIf +EndFunc ;==>_RClick_AddLabel + +Func _LabelAdd_Ok() + $LabelAdd_BSSID = GUICtrlRead($LabelAdd_GUI_BSSID) + $LabelAdd_LABEL = GUICtrlRead($LabelAdd_GUI_LABEL) + ;Check if mac already exists + $query = "SELECT Label FROM Labels WHERE BSSID='" & $LabelAdd_BSSID & "'" + $ManuMatchArray = _RecordSearch($LabDB, $query, $LabDB_OBJ) + $FoundManuMatch = UBound($ManuMatchArray) - 1 + If $FoundManuMatch = 1 Then ; Mac Exists, ask to update it + $overwrite_entry = MsgBox(4, $Text_Overwrite & '?', $Text_MacExistsOverwriteIt) + If $overwrite_entry = 6 Then + $query = "UPDATE Labels SET Label='" & StringReplace($LabelAdd_LABEL, "'", "''") & "' WHERE BSSID='" & $LabelAdd_BSSID & "'" + ;ConsoleWrite('old: ' & $query & @CRLF) + _ExecuteMDB($LabDB, $LabDB_OBJ, $query) + EndIf + Else ; Mac doesn't exist, Add it + ReDim $AddLabelRecordArray[3] + $AddLabelRecordArray[0] = 2 + $AddLabelRecordArray[1] = $LabelAdd_BSSID + $AddLabelRecordArray[2] = $LabelAdd_LABEL + _AddRecord($LabDB, "Labels", $LabDB_OBJ, $AddLabelRecordArray) + EndIf + _LabelAdd_Close() +EndFunc ;==>_LabelAdd_Ok + +Func _LabelAdd_Close() ;Close edit manufacturer window + GUIDelete($LabelAdd_GUI) + $AddLabelOpen = 0 + _UpdateListMacLabels() +EndFunc ;==>_LabelAdd_Close +;------------------------------------------------------------------------------------------------------------------------------- +; GRAPH FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +;---------- Signal Graph Functions ---------- +Func _GraphDraw() + _GDIPlus_GraphicsClear($Graph_backbuffer) + ;Set Background Color + _GDIPlus_GraphicsClear($Graph_backbuffer, StringReplace($ControlBackgroundColor, "0x", "0xFF")) + ;Draw % or dBm labels and lines + If $UseRssiInGraphs = 1 Then ;Draw dBm labels + For $sn = 0 To 10 + $RSSI = ($sn * -10) + $vposition = $Graph_topborder + (($Graph_height / 10) * $sn) + _GDIPlus_GraphicsDrawString($Graph_backbuffer, $RSSI, 0, $vposition - 5) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $Graph_leftborder, $vposition, $Graph_leftborder + $Graph_width, $vposition, $Pen_GraphGrid) + Next + Else ;Draw % labels + For $sn = 0 To 10 + $percent = ($sn * 10) & "%" + $vposition = $Graph_topborder + ($Graph_height - (($Graph_height / 10) * $sn)) + _GDIPlus_GraphicsDrawString($Graph_backbuffer, $percent, 0, $vposition - 5) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $Graph_leftborder, $vposition, $Graph_leftborder + $Graph_width, $vposition, $Pen_GraphGrid) + Next + EndIf + + ;Graph Selected AP + $Selected = _GUICtrlListView_GetNextItem($ListviewAPs) ; find what AP is selected in the list. returns -1 is nothing is selected + If $Selected <> -1 Then ;If a access point is selected in the listview, map its data + $query = "SELECT ApID FROM AP WHERE ListRow=" & $Selected + $ListRowMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $GraphApID = $ListRowMatchArray[1][1] + If $Graph = 1 Then + $max_graph_points = '125' + $query = "SELECT TOP " & $max_graph_points & " Signal, RSSI, ApID, Date1, Time1 FROM Hist WHERE ApID=" & $GraphApID & " And Signal<>0 ORDER BY Date1, Time1 Desc" + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $HistSize = UBound($HistMatchArray) - 1 + If $HistSize <> 0 Then + If $HistSize < $max_graph_points Then $max_graph_points = $HistSize ;Fix to prevent graph from drawing outside its region when the are 0% marks + Local $graph_point_center_y, $graph_point_center_x, $Found_dts, $gloop + Local $GraphWidthSpacing = $Graph_width / ($HistSize - 1) + Local $GraphHeightSpacing = $Graph_height / 100 + For $gs = 1 To $HistSize + $gloop += 1 + If $gloop > $max_graph_points Then ExitLoop + $ExpSig = $HistMatchArray[$gs][1] - 0 + $ExpRSSI = $HistMatchArray[$gs][2] + $ExpApID = $HistMatchArray[$gs][3] + $ExpDate = $HistMatchArray[$gs][4] + + $Last_dts = $Found_dts + $ts = StringSplit($HistMatchArray[$gs][5], ":") + $ExpTime = ($ts[1] * 3600) + ($ts[2] * 60) + StringTrimRight($ts[3], 4) ;In seconds + $Found_dts = StringReplace($ExpDate & $ExpTime, '-', '') + + + $old_graph_point_center_x = $graph_point_center_x + $old_graph_point_center_y = $graph_point_center_y + $graph_point_center_x = ($Graph_leftborder + $Graph_width) - ($GraphWidthSpacing * ($gloop - 1)) + If $UseRssiInGraphs = 1 Then + $graph_point_center_y = $Graph_topborder + ($Graph_height - ($GraphHeightSpacing * (100 + $ExpRSSI))) + ;ConsoleWrite($graph_point_center_y & @CRLF) + Else + $graph_point_center_y = $Graph_topborder + ($Graph_height - ($GraphHeightSpacing * $ExpSig)) + EndIf + + ;Draw Point + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y - 1, $graph_point_center_x + 1, $graph_point_center_y - 1, $Pen_Red) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y, $graph_point_center_x + 1, $graph_point_center_y, $Pen_Red) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y + 1, $graph_point_center_x + 1, $graph_point_center_y + 1, $Pen_Red) + + ;Draw Connecting line + If $gs <> 1 Then + ;Draw Connecting line + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $old_graph_point_center_x, $old_graph_point_center_y, $graph_point_center_x, $graph_point_center_y, $Pen_Red) + ;Draw any gaps that may exist (AP at 0%) + If ($Last_dts - $Found_dts) > $TimeBeforeMarkedDead Then + If $GraphDeadTime = 1 Then + $numofzeros = ($Last_dts - $Found_dts) - $TimeBeforeMarkedDead + For $wz = 1 To $numofzeros + $gloop += 1 + If $gloop > $max_graph_points Then ExitLoop + + $old_graph_point_center_x = $graph_point_center_x + $old_graph_point_center_y = $graph_point_center_y + $graph_point_center_x = ($Graph_leftborder + $Graph_width) - ($GraphWidthSpacing * ($gloop - 1)) + $graph_point_center_y = $Graph_topborder + $Graph_height + + ;Draw Point + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y - 1, $graph_point_center_x + 1, $graph_point_center_y - 1, $Pen_Red) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y, $graph_point_center_x + 1, $graph_point_center_y, $Pen_Red) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y + 1, $graph_point_center_x + 1, $graph_point_center_y + 1, $Pen_Red) + + ;Draw Line + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $old_graph_point_center_x, $old_graph_point_center_y, $graph_point_center_x, $graph_point_center_y, $Pen_Red) + Next + Else + $gloop += 1 + If $gloop > $max_graph_points Then ExitLoop + + $old_graph_point_center_x = $graph_point_center_x + $old_graph_point_center_y = $graph_point_center_y + $graph_point_center_x = ($Graph_leftborder + $Graph_width) - ($GraphWidthSpacing * ($gloop - 1)) + $graph_point_center_y = $Graph_topborder + $Graph_height + + ;Draw Point + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y - 1, $graph_point_center_x + 1, $graph_point_center_y - 1, $Pen_Red) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y, $graph_point_center_x + 1, $graph_point_center_y, $Pen_Red) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y + 1, $graph_point_center_x + 1, $graph_point_center_y + 1, $Pen_Red) + + ;Draw Line + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $old_graph_point_center_x, $old_graph_point_center_y, $graph_point_center_x, $graph_point_center_y, $Pen_Red) + EndIf + EndIf + EndIf + Next + EndIf + ElseIf $Graph = 2 Then + $max_graph_points = $Graph_width + $query = "SELECT TOP " & $max_graph_points & " Signal, RSSI, ApID, Date1, Time1 FROM Hist WHERE ApID=" & $GraphApID & " And Signal<>0 ORDER BY Date1, Time1 Desc" + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $HistSize = UBound($HistMatchArray) - 1 + If $HistSize <> 0 Then + Local $Found_dts, $gloop + Local $GraphWidthSpacing = $Graph_width / $max_graph_points + Local $GraphHeightSpacing = $Graph_height / 100 + For $gs = 1 To $HistSize + $gloop += 1 + If $gloop > $max_graph_points Then ExitLoop + $ExpSig = $HistMatchArray[$gs][1] - 0 + $ExpRSSI = $HistMatchArray[$gs][2] + $ExpApID = $HistMatchArray[$gs][3] + $ExpDate = $HistMatchArray[$gs][4] + + $Last_dts = $Found_dts + $ts = StringSplit($HistMatchArray[$gs][5], ":") + $ExpTime = ($ts[1] * 3600) + ($ts[2] * 60) + StringTrimRight($ts[3], 4) ;In seconds + $Found_dts = StringReplace($ExpDate & $ExpTime, '-', '') + + ;Draw line for signal strength + If $UseRssiInGraphs = 1 Then + $graph_line_top_y = $Graph_topborder + ($Graph_height - ($GraphHeightSpacing * (100 + $ExpRSSI))) + Else + $graph_line_top_y = $Graph_topborder + ($Graph_height - ($GraphHeightSpacing * $ExpSig)) + EndIf + $graph_line_top_x = ($Graph_leftborder + $Graph_width) - ($gloop * $GraphWidthSpacing) + $graph_line_bottom_x = ($Graph_leftborder + $Graph_width) - ($gloop * $GraphWidthSpacing) + $graph_line_bottom_y = $Graph_topborder + $Graph_height + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_line_top_x, $graph_line_top_y, $graph_line_bottom_x, $graph_line_bottom_y, $Pen_Red) + + ;increment $gloop for any gaps that may exist (AP at 0%) + If $gs <> 1 Then + If ($Last_dts - $Found_dts) > $TimeBeforeMarkedDead Then + If $GraphDeadTime = 1 Then + $numofzeros = ($Last_dts - $Found_dts) - $TimeBeforeMarkedDead + For $wz = 1 To $numofzeros + $gloop += 1 + If $gloop > $max_graph_points Then ExitLoop + Next + Else + $gloop += 1 + If $gloop > $max_graph_points Then ExitLoop + EndIf + EndIf + EndIf + + Next + EndIf + EndIf + EndIf + + ;Draw temporary image to GUI + _GDIPlus_GraphicsDrawImageRect($Graphic, $Graph_bitmap, 0, 0, $Graphic_width, $Graphic_height) + +EndFunc ;==>_GraphDraw + +;---------- 2.4Ghz Channel Graph Function ---------- +Func _Channels2400_GUI() + If $2400chanGUIOpen = 0 Then + $2400chanGUIOpen = 1 + + $2400chanGUI = GUICreate($Text_2400ChannelGraph, 800, 400, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) + GUISetBkColor($ControlBackgroundColor, $2400chanGUI) + + $cpsplit = StringSplit($2400ChanGraphPos, ',') + If $cpsplit[0] = 4 Then ;If $2400ChanGraphPos is a proper position, move and resize window + WinMove($2400chanGUI, '', $cpsplit[1], $cpsplit[2], $cpsplit[3], $cpsplit[4]) + Else ;Set $2400ChanGraphPos to the current window position + $c = WinGetPos($2400chanGUI) + $2400ChanGraphPos = $c[0] & ',' & $c[1] & ',' & $c[2] & ',' & $c[3] + EndIf + + GUISetState(@SW_SHOW, $2400chanGUI) + GUISetOnEvent($GUI_EVENT_CLOSE, '_Close2400GUI') + GUISetOnEvent($GUI_EVENT_RESIZED, '_Set2400ChanGraphSizes') + GUISetOnEvent($GUI_EVENT_RESTORE, '_Set2400ChanGraphSizes') + + _Set2400ChanGraphSizes() + _Draw2400ChanGraph() + Else + WinActivate($2400chanGUI) + EndIf +EndFunc ;==>_Channels2400_GUI + +Func _Close2400GUI() + GUIDelete($2400chanGUI) + $2400chanGUIOpen = 0 +EndFunc ;==>_Close2400GUI + +Func _Set2400ChanGraphSizes() + ;Get Window Size + $p = _WinAPI_GetClientRect($2400chanGUI) + $2400width = DllStructGetData($p, "Right") + $2400height = DllStructGetData($p, "Bottom") + ;Set Sizes + + $2400graphheight = $2400height - ($2400topborder + $2400bottomborder) + $2400graphwidth = $2400width - ($2400leftborder + $2400rightborder) + $2400freqwidth = $2400graphwidth / 100 + $2400percheight = $2400graphheight / 100 + + $2400graphics = _GDIPlus_GraphicsCreateFromHWND($2400chanGUI) + $2400bitmap = _GDIPlus_BitmapCreateFromGraphics($2400width, $2400height, $2400graphics) + $2400backbuffer = _GDIPlus_ImageGetGraphicsContext($2400bitmap) +EndFunc ;==>_Set2400ChanGraphSizes + +Func _Draw2400ChanGraph() + ;Set Background Color + _GDIPlus_GraphicsClear($2400backbuffer, StringReplace($ControlBackgroundColor, "0x", "0xFF")) + ;Draw 10% labels and lines + If $UseRssiInGraphs = 1 Then + For $sn = 0 To 10 + $RSSI = ($sn * -10) + $vposition = $2400topborder + (($2400graphheight / 10) * $sn) + _GDIPlus_GraphicsDrawString($2400backbuffer, $RSSI, 0, $vposition - 5) + _GDIPlus_GraphicsDrawLine($2400backbuffer, $2400leftborder, $vposition, $2400width - $2400rightborder, $vposition, $Pen_GraphGrid) + Next + Else + For $sn = 0 To 10 + $percent = ($sn * 10) & "%" + $vposition = ($2400height - $2400bottomborder) - (($2400graphheight / 10) * $sn) + _GDIPlus_GraphicsDrawString($2400backbuffer, $percent, 0, $vposition - 5) + _GDIPlus_GraphicsDrawLine($2400backbuffer, $2400leftborder, $vposition, $2400width - $2400rightborder, $vposition, $Pen_GraphGrid) + Next + EndIf + + ;Draw Channel labels and lines + _Draw2400ChanLine(2412, 1) + _Draw2400ChanLine(2417, 2) + _Draw2400ChanLine(2422, 3) + _Draw2400ChanLine(2427, 4) + _Draw2400ChanLine(2432, 5) + _Draw2400ChanLine(2437, 6) + _Draw2400ChanLine(2442, 7) + _Draw2400ChanLine(2447, 8) + _Draw2400ChanLine(2452, 9) + _Draw2400ChanLine(2457, 10) + _Draw2400ChanLine(2462, 11) + _Draw2400ChanLine(2467, 12) + _Draw2400ChanLine(2472, 13) + _Draw2400ChanLine(2484, 14) + + ;Draw graph lines + $query = "SELECT SSID, CHAN, Signal, RSSI FROM AP WHERE Active=1 And ListRow<>-1" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + For $dc = 1 To $FoundApMatch + $Found_SSID = $ApMatchArray[$dc][1] + $Found_CHAN = $ApMatchArray[$dc][2] + $Found_Signal = $ApMatchArray[$dc][3] - 0 + $Found_RSSI = $ApMatchArray[$dc][4] + If $Found_CHAN = 1 Then + $Found_Freq = 2412 + ElseIf $Found_CHAN = 2 Then + $Found_Freq = 2417 + ElseIf $Found_CHAN = 3 Then + $Found_Freq = 2422 + ElseIf $Found_CHAN = 4 Then + $Found_Freq = 2427 + ElseIf $Found_CHAN = 5 Then + $Found_Freq = 2432 + ElseIf $Found_CHAN = 6 Then + $Found_Freq = 2437 + ElseIf $Found_CHAN = 7 Then + $Found_Freq = 2442 + ElseIf $Found_CHAN = 8 Then + $Found_Freq = 2447 + ElseIf $Found_CHAN = 9 Then + $Found_Freq = 2452 + ElseIf $Found_CHAN = 10 Then + $Found_Freq = 2457 + ElseIf $Found_CHAN = 11 Then + $Found_Freq = 2462 + ElseIf $Found_CHAN = 12 Then + $Found_Freq = 2467 + ElseIf $Found_CHAN = 13 Then + $Found_Freq = 2472 + ElseIf $Found_CHAN = 14 Then + $Found_Freq = 2484 + Else + $Found_Freq = 0 + EndIf + + If $Found_Freq <> 0 Then + $x_center = $2400leftborder + (($Found_Freq - 2400) * $2400freqwidth) + $x_left = $x_center - (11 * $2400freqwidth) + $x_right = $x_center + (11 * $2400freqwidth) + $y_bottom = $2400topborder + $2400graphheight + If $UseRssiInGraphs = 1 Then + $y_sigheight = (100 + $Found_RSSI) * $2400percheight + Else + $y_sigheight = $Found_Signal * $2400percheight + EndIf + $y_top = $2400topborder + ($2400graphheight - $y_sigheight) + + ;Draw left side or curve + Local $aPoints[4][2] + $aPoints[0][0] = 3 + $aPoints[1][0] = $x_left + 5 + $aPoints[1][1] = $y_top + $aPoints[2][0] = $x_left + 5 + $aPoints[2][1] = $y_top + ($y_sigheight / 2) + $aPoints[3][0] = $x_left + $aPoints[3][1] = $y_bottom + _GDIPlus_GraphicsDrawCurve($2400backbuffer, $aPoints, $Pen_Red) + ;Draw right side or curve + Local $aPoints[4][2] + $aPoints[0][0] = 3 + $aPoints[1][0] = $x_right - 5 + $aPoints[1][1] = $y_top + $aPoints[2][0] = $x_right - 5 + $aPoints[2][1] = $y_top + ($y_sigheight / 2) + $aPoints[3][0] = $x_right + $aPoints[3][1] = $y_bottom + _GDIPlus_GraphicsDrawCurve($2400backbuffer, $aPoints, $Pen_Red) + ;Draw top of curve + _GDIPlus_GraphicsDrawLine($2400backbuffer, $x_left + 5, $y_top, $x_right - 5, $y_top, $Pen_Red) + ;Draw SSID text + $hFont = _GDIPlus_FontCreate($FontFamily_Arial, 9, 1) + $tLayout = _GDIPlus_RectFCreate($x_left, $y_top - 15, $x_right - $x_left, 15) + $hFormat = _GDIPlus_StringFormatCreate() + _GDIPlus_StringFormatSetAlign($hFormat, 1) + _GDIPlus_GraphicsDrawStringEx($2400backbuffer, $Found_SSID, $hFont, $tLayout, $hFormat, $Brush_Blue) + EndIf + Next + _GDIPlus_GraphicsDrawImageRect($2400graphics, $2400bitmap, 0, 0, $2400width, $2400height) +EndFunc ;==>_Draw2400ChanGraph + +Func _Draw2400ChanLine($frequency, $Channel) + $hposition = $2400leftborder + ($2400freqwidth * ($frequency - 2400)) + _GDIPlus_GraphicsDrawString($2400backbuffer, $Channel, $hposition - 5, ($2400graphheight + $2400topborder) + 5) + _GDIPlus_GraphicsDrawLine($2400backbuffer, $hposition, $2400topborder, $hposition, $2400graphheight + $2400topborder, $Pen_GraphGrid) +EndFunc ;==>_Draw2400ChanLine + +;---------- 5Ghz Channel Graph Function ---------- +Func _Channels5000_GUI() + If $5000chanGUIOpen = 0 Then + $5000chanGUIOpen = 1 + + $5000chanGUI = GUICreate($Text_5000ChannelGraph, 800, 400, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) + GUISetBkColor($ControlBackgroundColor, $5000chanGUI) + + $cpsplit = StringSplit($5000ChanGraphPos, ',') + If $cpsplit[0] = 4 Then ;If $5000ChanGraphPos is a proper position, move and resize window + WinMove($5000chanGUI, '', $cpsplit[1], $cpsplit[2], $cpsplit[3], $cpsplit[4]) + Else ;Set $5000ChanGraphPos to the current window position + $c = WinGetPos($5000chanGUI) + $5000ChanGraphPos = $c[0] & ',' & $c[1] & ',' & $c[2] & ',' & $c[3] + EndIf + + GUISetOnEvent($GUI_EVENT_CLOSE, '_Close5000GUI') + GUISetOnEvent($GUI_EVENT_RESIZED, '_Set5000ChanGraphSizes') + GUISetOnEvent($GUI_EVENT_RESTORE, '_Set5000ChanGraphSizes') + + GUISetState(@SW_SHOW, $5000chanGUI) + + _Set5000ChanGraphSizes() + _Draw5000ChanGraph() + Else + WinActivate($5000chanGUI) + EndIf +EndFunc ;==>_Channels5000_GUI + +Func _Close5000GUI() + GUIDelete($5000chanGUI) + $5000chanGUIOpen = 0 +EndFunc ;==>_Close5000GUI + +Func _Set5000ChanGraphSizes() + ;Get Window Size + $p = _WinAPI_GetClientRect($5000chanGUI) + $5000width = DllStructGetData($p, "Right") + $5000height = DllStructGetData($p, "Bottom") + ;Set Sizes + $5000graphheight = $5000height - ($5000topborder + $5000bottomborder) + $5000graphwidth = $5000width - ($5000leftborder + $5000rightborder) + $5000freqwidth = $5000graphwidth / 700 ; Freq Range 5150 - 5850 (700points) + $5000percheight = $5000graphheight / 100 + + $5000graphics = _GDIPlus_GraphicsCreateFromHWND($5000chanGUI) + $5000bitmap = _GDIPlus_BitmapCreateFromGraphics($5000width, $5000height, $5000graphics) + $5000backbuffer = _GDIPlus_ImageGetGraphicsContext($5000bitmap) +EndFunc ;==>_Set5000ChanGraphSizes + +Func _Draw5000ChanGraph() + _GDIPlus_GraphicsClear($5000backbuffer) + ;Set Background Color + _GDIPlus_GraphicsClear($5000backbuffer, StringReplace($ControlBackgroundColor, "0x", "0xFF")) + ;Draw 10% labels and lines + If $UseRssiInGraphs = 1 Then + For $sn = 0 To 10 + $RSSI = ($sn * -10) + $vposition = $5000topborder + (($5000graphheight / 10) * $sn) + _GDIPlus_GraphicsDrawString($5000backbuffer, $RSSI, 0, $vposition - 5) + _GDIPlus_GraphicsDrawLine($5000backbuffer, $5000leftborder, $vposition, $5000width - $5000rightborder, $vposition, $Pen_GraphGrid) + Next + Else + For $sn = 0 To 10 + $percent = ($sn * 10) & "%" + $vposition = ($5000height - $5000bottomborder) - (($5000graphheight / 10) * $sn) + _GDIPlus_GraphicsDrawString($5000backbuffer, $percent, 0, $vposition - 5) + _GDIPlus_GraphicsDrawLine($5000backbuffer, $5000leftborder, $vposition, $5000width - $5000rightborder, $vposition, $Pen_GraphGrid) + Next + EndIf + ;Draw Channel labels and lines + _Draw5000ChanLine(5180, 36) + _Draw5000ChanLine(5200, 40) + _Draw5000ChanLine(5220, 44) + _Draw5000ChanLine(5240, 48) + _Draw5000ChanLine(5260, 52) + _Draw5000ChanLine(5280, 56) + _Draw5000ChanLine(5300, 60) + _Draw5000ChanLine(5320, 64) + _Draw5000ChanLine(5500, 100) + _Draw5000ChanLine(5520, 104) + _Draw5000ChanLine(5540, 108) + _Draw5000ChanLine(5560, 112) + _Draw5000ChanLine(5580, 116) + _Draw5000ChanLine(5600, 120) + _Draw5000ChanLine(5620, 124) + _Draw5000ChanLine(5640, 128) + _Draw5000ChanLine(5660, 132) + _Draw5000ChanLine(5680, 136) + _Draw5000ChanLine(5700, 140) + _Draw5000ChanLine(5745, 149) + _Draw5000ChanLine(5765, 153) + _Draw5000ChanLine(5785, 157) + _Draw5000ChanLine(5805, 161) + _Draw5000ChanLine(5825, 165) + + $query = "SELECT SSID, CHAN, Signal, RSSI FROM AP WHERE Active=1 And ListRow<>-1" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + For $dc = 1 To $FoundApMatch + $Found_SSID = $ApMatchArray[$dc][1] + $Found_CHAN = $ApMatchArray[$dc][2] + $Found_Signal = $ApMatchArray[$dc][3] - 0 + $Found_RSSI = $ApMatchArray[$dc][4] + If $Found_CHAN = 36 Then + $Found_Freq = 5180 + ElseIf $Found_CHAN = 40 Then + $Found_Freq = 5200 + ElseIf $Found_CHAN = 44 Then + $Found_Freq = 5220 + ElseIf $Found_CHAN = 48 Then + $Found_Freq = 5240 + ElseIf $Found_CHAN = 52 Then + $Found_Freq = 5260 + ElseIf $Found_CHAN = 56 Then + $Found_Freq = 5280 + ElseIf $Found_CHAN = 60 Then + $Found_Freq = 5300 + ElseIf $Found_CHAN = 64 Then + $Found_Freq = 5320 + ElseIf $Found_CHAN = 100 Then + $Found_Freq = 5500 + ElseIf $Found_CHAN = 104 Then + $Found_Freq = 5520 + ElseIf $Found_CHAN = 108 Then + $Found_Freq = 5540 + ElseIf $Found_CHAN = 112 Then + $Found_Freq = 5560 + ElseIf $Found_CHAN = 116 Then + $Found_Freq = 5580 + ElseIf $Found_CHAN = 120 Then + $Found_Freq = 5600 + ElseIf $Found_CHAN = 124 Then + $Found_Freq = 5620 + ElseIf $Found_CHAN = 128 Then + $Found_Freq = 5640 + ElseIf $Found_CHAN = 132 Then + $Found_Freq = 5660 + ElseIf $Found_CHAN = 136 Then + $Found_Freq = 5680 + ElseIf $Found_CHAN = 140 Then + $Found_Freq = 5700 + ElseIf $Found_CHAN = 149 Then + $Found_Freq = 5745 + ElseIf $Found_CHAN = 153 Then + $Found_Freq = 5765 + ElseIf $Found_CHAN = 157 Then + $Found_Freq = 5785 + ElseIf $Found_CHAN = 161 Then + $Found_Freq = 5805 + ElseIf $Found_CHAN = 165 Then + $Found_Freq = 5825 + Else + $Found_Freq = 0 + EndIf + + If $Found_Freq <> 0 Then + $x_center = $5000leftborder + (($Found_Freq - 5150) * $5000freqwidth) + $x_left = $x_center - (10 * $5000freqwidth) + $x_right = $x_center + (10 * $5000freqwidth) + $y_bottom = $5000topborder + $5000graphheight + If $UseRssiInGraphs = 1 Then + $y_sigheight = (100 + $Found_RSSI) * $5000percheight + Else + $y_sigheight = $Found_Signal * $5000percheight + EndIf + $y_top = $5000topborder + ($5000graphheight - $y_sigheight) + + ;Draw left side or curve + Local $aPoints[4][2] + $aPoints[0][0] = 3 + $aPoints[1][0] = $x_left + 5 + $aPoints[1][1] = $y_top + $aPoints[2][0] = $x_left + 5 + $aPoints[2][1] = $y_top + ($y_sigheight / 2) + $aPoints[3][0] = $x_left + $aPoints[3][1] = $y_bottom + _GDIPlus_GraphicsDrawCurve($5000backbuffer, $aPoints, $Pen_Red) + ;Draw right side or curve + Local $aPoints[4][2] + $aPoints[0][0] = 3 + $aPoints[1][0] = $x_right - 5 + $aPoints[1][1] = $y_top + $aPoints[2][0] = $x_right - 5 + $aPoints[2][1] = $y_top + ($y_sigheight / 2) + $aPoints[3][0] = $x_right + $aPoints[3][1] = $y_bottom + _GDIPlus_GraphicsDrawCurve($5000backbuffer, $aPoints, $Pen_Red) + ;Draw top of curve + _GDIPlus_GraphicsDrawLine($5000backbuffer, $x_left + 5, $y_top, $x_right - 5, $y_top, $Pen_Red) + ;Draw SSID text + $hFont = _GDIPlus_FontCreate($FontFamily_Arial, 9, 1) + $tLayout = _GDIPlus_RectFCreate($x_left, $y_top - 15, $x_right - $x_left, 15) + $hFormat = _GDIPlus_StringFormatCreate() + _GDIPlus_StringFormatSetAlign($hFormat, 1) + _GDIPlus_GraphicsDrawStringEx($5000backbuffer, $Found_SSID, $hFont, $tLayout, $hFormat, $Brush_Blue) + EndIf + Next + _GDIPlus_GraphicsDrawImageRect($5000graphics, $5000bitmap, 0, 0, $5000width, $5000height) +EndFunc ;==>_Draw5000ChanGraph + +Func _Draw5000ChanLine($frequency, $Channel) + $hposition = $5000leftborder + ($5000freqwidth * ($frequency - 5150)) + _GDIPlus_GraphicsDrawString($5000backbuffer, $Channel, $hposition - 5, ($5000graphheight + $5000topborder) + 5) + _GDIPlus_GraphicsDrawLine($5000backbuffer, $hposition, $5000topborder, $hposition, $5000graphheight + $5000topborder, $Pen_GraphGrid) +EndFunc ;==>_Draw5000ChanLine + +;------------------------------------------------------------------------------------------------------------------------------- +; WifiDB FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- +Func _ViewInWifiDbGraph() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ViewInWifiDbGraph()') ;#Debug Display + $Selected = _GUICtrlListView_GetNextItem($ListviewAPs) ; find what AP is selected in the list. returns -1 is nothing is selected + _ViewInWifiDbGraph_Open($Selected) +EndFunc ;==>_ViewInWifiDbGraph + +Func _ViewInWifiDbGraph_Open($Selected) ;Sends data to WifiDb php graphing script + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ViewInWifiDbGraph_Open()') ;#Debug Display + If $Selected <> -1 Then ;If a access point is selected in the listview, map its data + $query = "SELECT ApID, SSID, BSSID, AUTH, ENCR, RADTYPE, NETTYPE, CHAN, BTX, OTX, MANU, LABEL, HighGpsHistID FROM AP WHERE ListRow=" & $Selected + $ListRowMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundListRowMatch = UBound($ListRowMatchArray) - 1 + If $FoundListRowMatch <> 0 Then + $Found_APID = $ListRowMatchArray[1][1] + $Found_SSID = $ListRowMatchArray[1][2] + $Found_BSSID = $ListRowMatchArray[1][3] + $Found_AUTH = $ListRowMatchArray[1][4] + $Found_ENCR = $ListRowMatchArray[1][5] + $Found_RADTYPE = $ListRowMatchArray[1][6] + $Found_NETTYPE = $ListRowMatchArray[1][7] + $Found_CHAN = $ListRowMatchArray[1][8] + $Found_BTX = $ListRowMatchArray[1][9] + $Found_OTX = $ListRowMatchArray[1][10] + $Found_MANU = $ListRowMatchArray[1][11] + $Found_LAB = $ListRowMatchArray[1][12] + $Found_HighGpsHistId = $ListRowMatchArray[1][13] - 0 + + If $Found_HighGpsHistId = 0 Then + $Found_Lat = 'N 0000.0000' + $Found_Lon = 'E 0000.0000' + Else + $query = "SELECT GpsID FROM Hist WHERE HistID=" & $Found_HighGpsHistId + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundHistMatch = UBound($HistMatchArray) - 1 + $Found_HighGpsID = $HistMatchArray[1][1] + $query = "SELECT Latitude, Longitude FROM GPS WHERE GpsID=" & $Found_HighGpsID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_Lat = $GpsMatchArray[1][1] + $Found_Lon = $GpsMatchArray[1][2] + EndIf + + ;--------------------- + + $max_graph_points = 1000 + $query = "SELECT TOP " & $max_graph_points & " Signal, Date1, Time1 FROM Hist WHERE ApID=" & $Found_APID & " And Signal<>0 ORDER BY Date1, Time1 Desc" + $SignalMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundSignalMatch = UBound($SignalMatchArray) - 1 + If $FoundSignalMatch <> 0 Then + Local $Found_dts, $gloop, $pgsigdata, $Found_FirstSeen, $Found_LastSeen + For $gs = 1 To $FoundSignalMatch + $gloop += 1 + If $gloop > $max_graph_points Then ExitLoop + $ExpSig = $SignalMatchArray[$gs][1] - 0 + $ExpDate = $SignalMatchArray[$gs][2] + $ExpTime = $SignalMatchArray[$gs][3] + + $Last_dts = $Found_dts + $ts = StringSplit($ExpTime, ":") + $ExpTimeSecs = ($ts[1] * 3600) + ($ts[2] * 60) + StringTrimRight($ts[3], 4) ;In seconds + $Found_dts = StringReplace($ExpDate & $ExpTimeSecs, '-', '') + + If $gs = 1 Then + $pgsigdata = $ExpSig + $Found_FirstSeen = $ExpDate & ' ' & $ExpTime + $Found_LastSeen = $ExpDate & ' ' & $ExpTime + Else + If ($Last_dts - $Found_dts) > $TimeBeforeMarkedDead Then + $numofzeros = ($Last_dts - $Found_dts) - $TimeBeforeMarkedDead + For $wz = 1 To $numofzeros + $gloop += 1 + $pgsigdata &= '-0' + If $gloop > $max_graph_points Then ExitLoop + Next + EndIf + $pgsigdata &= '-' & $ExpSig + $Found_LastSeen = $ExpDate & ' ' & $ExpTime + EndIf + Next + If $pgsigdata = "" Then + MsgBox(0, $Text_Error, "No data to graph") + Else + $url_root = $WifiDbGraphURL + $url_data = "?SSID=" & $Found_SSID & "&Mac=" & $Found_BSSID & "&Manuf=" & $Found_MANU & "&Auth=" & $Found_AUTH & "&Encry=" & $Found_ENCR & "&radio=" & $Found_RADTYPE & "&Chn=" & $Found_CHAN & "&Lat=" & $Found_Lat & "&Long=" & $Found_Lon & "&BTx=" & $Found_BTX & "&OTx=" & $Found_OTX & "&FA=" & $Found_FirstSeen & "&LU=" & $Found_LastSeen & "&NT=" & $Found_NETTYPE & "&Label=" & $Found_LAB & "&Sig=" & $pgsigdata + $url_full = $url_root & $url_data + $url_trimmed = StringTrimRight($url_full, (StringLen($url_full) - 2048)) ;trim sting to internet explorer max url lenth + $url_trimmed2 = StringTrimRight($url_trimmed, (StringLen($url_trimmed) - StringInStr($url_trimmed, "-", 1, -1)) + 1) ;find - that marks the last full data and get rid of the rest + Run("RunDll32.exe url.dll,FileProtocolHandler " & $url_trimmed2) ;open url with rundll 32 + EndIf + EndIf + EndIf + Else + MsgBox(0, $Text_Error, $Text_NoApSelected) + EndIf +EndFunc ;==>_ViewInWifiDbGraph_Open + +Func _AddToYourWDB() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AddToYourWDB()') ;#Debug Display + If $UploadFileToWifiDBOpen = 0 Then + $UploadFileToWifiDBOpen = 1 + $WifiDbUploadGUI = GUICreate($Text_UploadApsToWifidb, 580, 525) + GUISetBkColor($BackgroundColor) + GUICtrlCreateLabel($Text_WifiDB_Upload_Discliamer, 24, 8, 532, 89) + + GUICtrlCreateGroup($Text_UserInformation, 24, 104, 281, 161) + GUICtrlCreateLabel($Text_WifiDB_Username, 39, 124, 236, 20) + $WifiDb_User_GUI = GUICtrlCreateInput($WifiDb_User, 39, 144, 241, 20) + GUICtrlCreateLabel($Text_OtherUsers, 39, 169, 236, 20) + $WifiDb_OtherUsers_GUI = GUICtrlCreateInput($WifiDb_OtherUsers, 39, 189, 241, 20) + GUICtrlCreateLabel($Text_WifiDB_Api_Key, 39, 213, 236, 20) + $WifiDb_ApiKey_GUI = GUICtrlCreateInput($WifiDb_ApiKey, 39, 233, 241, 21) + + GUICtrlCreateGroup($Text_FileType, 312, 104, 249, 161) + $VSZ_Radio_GUI = GUICtrlCreateRadio($Text_VistumblerVSZ, 327, 150, 220, 20) + ;If $WifiDb_UploadType = "VSZ" Then GUICtrlSetState($VSZ_Radio_GUI, $GUI_CHECKED) + GUICtrlSetState($VSZ_Radio_GUI, $GUI_DISABLE) + $VS1_Radio_GUI = GUICtrlCreateRadio($Text_VistumblerVS1, 327, 170, 220, 20) + If $WifiDb_UploadType = "VS1" Then GUICtrlSetState($VS1_Radio_GUI, $GUI_CHECKED) + If $WifiDb_UploadType = "VSZ" Then GUICtrlSetState($VS1_Radio_GUI, $GUI_CHECKED) ;temporarily make vsz export vs1 since vsz support is not ready + $CSV_Radio_GUI = GUICtrlCreateRadio($Text_VistumblerCSV, 327, 190, 220, 20) + If $WifiDb_UploadType = "CSV" Then GUICtrlSetState($CSV_Radio_GUI, $GUI_CHECKED) + $Export_Filtered_GUI = GUICtrlCreateCheckbox($Text_Filtered, 327, 210, 220, 20) + If $WifiDb_UploadFiltered = 1 Then GUICtrlSetState($Export_Filtered_GUI, $GUI_CHECKED) + + GUICtrlCreateGroup($Text_UploadInformation, 24, 272, 537, 201) + GUICtrlCreateLabel($Text_Title, 39, 297, 500, 20) + $upload_title_GUI = GUICtrlCreateInput($ldatetimestamp, 39, 317, 500, 21) + GUICtrlCreateLabel($Text_Notes, 39, 342, 500, 20) + $upload_notes_GUI = GUICtrlCreateEdit("", 39, 362, 497, 100) + + $WifiDbUploadGUI_Upload = GUICtrlCreateButton($Text_UploadApsToWifidb, 35, 488, 241, 25) + $WifiDbUploadGUI_Cancel = GUICtrlCreateButton($Text_Cancel, 305, 487, 241, 25) + GUISetState(@SW_SHOW) + + GUICtrlSetOnEvent($WifiDbUploadGUI_Upload, '_UploadFileToWifiDB') + GUICtrlSetOnEvent($WifiDbUploadGUI_Cancel, '_CloseWifiDbUploadGUI') + GUISetOnEvent($GUI_EVENT_CLOSE, '_CloseWifiDbUploadGUI') + Else + WinActivate($WifiDbUploadGUI) + EndIf +EndFunc ;==>_AddToYourWDB + +Func _CloseWifiDbUploadGUI() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CloseWifiDbUploadGUI() ') ;#Debug Display + GUIDelete($WifiDbUploadGUI) + $UploadFileToWifiDBOpen = 0 +EndFunc ;==>_CloseWifiDbUploadGUI + +Func _UploadFileToWifiDB() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_UploadFileToWifiDB() ') ;#Debug Display + GUICtrlSetData($msgdisplay, $Text_UploadingApsToWifidb) + ;Get Upload Information from upload GUI + $WifiDb_User = GUICtrlRead($WifiDb_User_GUI) + If $WifiDb_User = "" Then $WifiDb_User = "Unknown" + $WifiDb_OtherUsers = GUICtrlRead($WifiDb_OtherUsers_GUI) + $WifiDb_ApiKey = GUICtrlRead($WifiDb_ApiKey_GUI) + $upload_title = GUICtrlRead($upload_title_GUI) + $upload_notes = GUICtrlRead($upload_notes_GUI) + + If GUICtrlRead($VS1_Radio_GUI) = 1 Then + $WdbFile = $SaveDir & 'WDB_Export.VS1' + $WifiDb_UploadType = "VS1" + ElseIf GUICtrlRead($CSV_Radio_GUI) = 1 Then + $WdbFile = $SaveDir & 'WDB_Export.CSV' + $WifiDb_UploadType = "CSV" + Else + $WdbFile = $SaveDir & 'WDB_Export.VSZ' + $WifiDb_UploadType = "VSZ" + EndIf + + If GUICtrlRead($Export_Filtered_GUI) = 1 Then + $WifiDb_UploadFiltered = 1 + Else + $WifiDb_UploadFiltered = 0 + EndIf + + ConsoleWrite("$WifiDb_UploadType:" & $WifiDb_UploadType & "$WifiDb_UploadFiltered:" & $WifiDb_UploadFiltered & " $WifiDb_User:" & $WifiDb_User & " $WifiDb_OtherUsers:" & $WifiDb_OtherUsers & " $WifiDb_ApiKey:" & $WifiDb_ApiKey & " $upload_title:" & $upload_title & " $upload_notes:" & $upload_notes & @CRLF) + _CloseWifiDbUploadGUI() + + + ;Export WDB File + Local $fileexported, $filetype, $fileuname, $fileread + If $WifiDb_UploadType = "VS1" Then + $fileexported = _ExportVS1($WdbFile, $WifiDb_UploadFiltered) + $filetype = "text/plain; charset=""UTF-8""" + $fileuname = $ldatetimestamp & "_VS.VS1" + If $fileexported = 1 Then $fileread = FileRead($WdbFile) + ElseIf $WifiDb_UploadType = "CSV" Then + $fileexported = _ExportToCSV($WdbFile, $WifiDb_UploadFiltered, 1) + $filetype = "text/plain; charset=""UTF-8""" + $fileuname = $ldatetimestamp & "_VS.CSV" + If $fileexported = 1 Then $fileread = FileRead($WdbFile) + Else + $fileexported = _ExportVSZ($WdbFile, $WifiDb_UploadFiltered) + $filetype = "application/octet-stream" + $fileuname = $ldatetimestamp & "_VS.VSZ" + If $fileexported = 1 Then $fileread = FileRead($WdbFile) & @CRLF + EndIf + + If $fileexported = 1 Then ;Upload File to WifiDB + $httprecv = _HTTPPost_WifiDB_File($WifiDbApiURL, $fileread, $fileuname, $filetype, $WifiDb_ApiKey, $WifiDb_User, $WifiDb_OtherUsers, $upload_title, $upload_notes) + ConsoleWrite($httprecv & @CRLF) + + Local $import_json_response, $json_array_size, $json_msg + $import_json_response = _JSONDecode($httprecv) + $import_json_response_iRows = UBound($import_json_response, 1) + $import_json_response_iCols = UBound($import_json_response, 2) + ;Pull out information from decoded json array + If $import_json_response_iCols = 2 Then + Local $imtitle, $imuser, $immessage, $imimportnum, $imfilehash, $imerror + For $ji = 0 To ($import_json_response_iRows - 1) + If $import_json_response[$ji][0] = 'title' Then $imtitle = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'user' Then $imuser = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'message' Then $immessage = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'importnum' Then $imimportnum = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'filehash' Then $imfilehash = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'error' Then $imerror = $import_json_response[$ji][1] + Next + If $imtitle <> "" Or $imuser <> "" Or $immessage <> "" Or $imimportnum <> "" Or $imfilehash <> "" Then + MsgBox(0, $Text_Information, "Title: " & $imtitle & @CRLF & "User: " & $imuser & @CRLF & "Message: " & $immessage & @CRLF & "Import Number: " & $imimportnum & @CRLF & "File Hash: " & $imfilehash & @CRLF) + ConsoleWrite("Title: " & $imtitle & @CRLF & "User: " & $imuser & @CRLF & "Message: " & $immessage & @CRLF & "Import Number: " & $imimportnum & @CRLF & "File Hash: " & $imfilehash & @CRLF) + Else + MsgBox(0, $Text_Error, $httprecv) + EndIf + Else + MsgBox(0, $Text_Error, "Unexpected array size from _JSONDecode()" & @CRLF & @CRLF & "-- HTTP Response --" & @CRLF & $httprecv) + EndIf + Else ;File Export failed + ConsoleWrite("No export created for some reason... are there APs to be exported?" & @CRLF) + MsgBox(0, $Text_Error, "No export created for some reason... are there APs to be exported?") + EndIf + + GUICtrlSetData($msgdisplay, '') ;Clear $msgdisplay +EndFunc ;==>_UploadFileToWifiDB + +Func _HTTPPost_WifiDB_File($apiurl, $file, $filename, $contenttype, $apikey, $user, $otherusers, $title, $notes) + Local $PostData + Local $boundary = "------------" & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Random(1, 9, 1) & Random(1, 9, 1) & Random(1, 9, 1) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Random(1, 9, 1) & Random(1, 9, 1) & Random(1, 9, 1) + + $sUrl = $apiurl & "import.php" + $oHttpRequest = ObjCreate("WinHttp.WinHttpRequest.5.1") + ;$oHttpRequest.Option(4) = 13056 + $oHttpRequest.Open("POST", $sUrl, False) + $oHttpRequest.setRequestHeader("User-Agent", $Script_Name & ' ' & $version) + $oHttpRequest.setRequestHeader("Content-Type", "multipart/form-data; boundary=" & $boundary) + + If $apikey <> "" Then + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""apikey""" & @CRLF & @CRLF + $PostData &= $apikey & @CRLF + EndIf + If $user <> "" Then + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""username""" & @CRLF & @CRLF + $PostData &= $user & @CRLF + EndIf + If $otherusers <> "" Then + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""otherusers""" & @CRLF & @CRLF + $PostData &= $otherusers & @CRLF + EndIf + If $title <> "" Then + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""title""" & @CRLF & @CRLF + $PostData &= $title & @CRLF + EndIf + If $notes <> "" Then + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""notes""" & @CRLF & @CRLF + $PostData &= $notes & @CRLF + EndIf + + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""file""; filename=""" & $filename & """" & @CRLF + $PostData &= "Content-Type: " & $contenttype & @CRLF & @CRLF + $PostData &= $file & @CRLF + $PostData &= "--" & $boundary & "--" & @CRLF + ConsoleWrite(StringReplace($PostData, $file, "## DATA FILE ##" & @CRLF) & @CRLF) + + $oHttpRequest.Send(StringToBinary($PostData)) + ConsoleWrite("STATUS:" & $oHttpRequest.Status & @CRLF) + $Response = $oHttpRequest.ResponseText + + $oHttpRequest = "" + Return ($Response) +EndFunc ;==>_HTTPPost_WifiDB_File + +Func _LocatePositionInWiFiDB() ;Finds GPS based on active acess points displays information in message box + _LocateGpsInWifidb(1) +EndFunc ;==>_LocatePositionInWiFiDB + +Func _LocateGpsInWifidb($ShowPrompts = 0) ;Finds GPS based on active acess points based on WifiDB for use in vistumbler + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_LocatePositionInWiFiDB()') ;#Debug Display + Local $ActiveMacs = "" + Local $return = 0 + $query = "SELECT BSSID, Signal FROM AP WHERE Active=1 And ListRow<>-1 And BSSID<>'' ORDER BY Signal DESC" + $BssidMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundBssidMatch = UBound($BssidMatchArray) - 1 + If $FoundBssidMatch <> 0 Then + For $exb = 1 To $FoundBssidMatch + If $exb <> 1 Then $ActiveMacs &= '-' + $ActiveMacs &= $BssidMatchArray[$exb][1] & '|' & ($BssidMatchArray[$exb][2] + 0) + Next + If $ActiveMacs <> "" Then + $httprecv = _HTTPPost_WifiDB_LocateGPS($WifiDbApiURL, $ActiveMacs) + ConsoleWrite($httprecv & @CRLF) + $import_json_response = _JSONDecode($httprecv) + $import_json_response_iRows = UBound($import_json_response, 1) + $import_json_response_iCols = UBound($import_json_response, 2) + If $import_json_response_iCols = 2 Then + ;Pull out information from decoded json array + Local $lglat, $lglon, $lgdate, $lgtime, $lgsats, $lgerror + For $ji = 0 To ($import_json_response_iRows - 1) + If $import_json_response[$ji][0] = 'lat' Then $lglat = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'long' Then $lglon = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'date' Then $lgdate = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'time' Then $lgtime = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'sats' Then $lgsats = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'error' Then $lgerror = $import_json_response[$ji][1] + Next + ;Update Vistumbler GPS info with what was pulled from wifidb + If $lglat <> '' And $lglon <> '' Then + ;Format Lat/Lon + If StringInStr($lglat, "-") Then + $lglat = "S " & StringReplace(StringReplace($lglat, "-", ""), "0.0000", "0000.0000") + Else + $lglat = "N " & StringReplace(StringReplace($lglat, "+", ""), "0.0000", "0000.0000") + EndIf + If StringInStr($lglon, "-") Then + $lglon = "W " & StringReplace(StringReplace($lglon, "-", ""), "0.0000", "0000.0000") + Else + $lglon = "E " & StringReplace(StringReplace($lglon, "+", ""), "0.0000", "0000.0000") + EndIf + ;Set WifiDB Lat/Lon + $LatitudeWifidb = $lglat + $LongitudeWifidb = $lglon + ;Show Prompt + If $ShowPrompts = 1 Then MsgBox(0, $Text_Information, $Text_Latitude & ': ' & $lglat & @CRLF & $Text_Longitude & ': ' & $lglon & @CRLF & $Text_Date & ': ' & $lgdate & @CRLF & $Text_Time & ': ' & $lgtime & @CRLF) + ConsoleWrite('$lglat:' & $lglat & ' $lglon:' & $lglon & ' $lgdate:' & $lgdate & ' $lgtime:' & $lgtime & ' $lgsats:' & $lgsats & @CRLF) + ;Reset update timer + $WifidbGPS_Update = TimerInit() + $return = 1 + ElseIf $lgerror <> '' Then + If $ShowPrompts = 1 Then MsgBox(0, $Text_Error, $Text_Error & ': ' & $lgerror) + ConsoleWrite($Text_Error & ': ' & $lgerror & @CRLF) + Else + If $ShowPrompts = 1 Then MsgBox(0, $Text_Error, $Text_Error & ': ' & $httprecv) + ConsoleWrite($Text_Error & ': ' & $httprecv & @CRLF) + EndIf + Else + If $ShowPrompts = 1 Then MsgBox(0, $Text_Error, "Unexpected array size from _JSONDecode()" & @CRLF & @CRLF & "-- HTTP Response --" & @CRLF & $httprecv) + EndIf + + EndIf + Else + If $ShowPrompts = 1 Then MsgBox(0, $Text_Error, $Text_NoActiveApFound) + EndIf + + ;Update GPS Information in GUI + _ClearGpsDetailsGUI() ;Reset variables if they are over the allowed timeout + _UpdateGpsDetailsGUI() ;Write changes to "GPS Details" GUI if it is open + + Return ($return) +EndFunc ;==>_LocateGpsInWifidb + +Func _HTTPPost_WifiDB_LocateGPS($apiurl, $ActiveBSSIDs) + Local $PostData + Local $boundary = "------------" & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Random(1, 9, 1) & Random(1, 9, 1) & Random(1, 9, 1) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Random(1, 9, 1) & Random(1, 9, 1) & Random(1, 9, 1) + + $sUrl = $apiurl & "locate.php" + $oHttpRequest = ObjCreate("WinHttp.WinHttpRequest.5.1") + ;$oHttpRequest.Option(4) = 13056 + $oHttpRequest.Open("POST", $sUrl, False) + $oHttpRequest.setRequestHeader("User-Agent", $Script_Name & ' ' & $version) + $oHttpRequest.setRequestHeader("Content-Type", "multipart/form-data; boundary=" & $boundary) + + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""ActiveBSSIDs""" & @CRLF & @CRLF + $PostData &= $ActiveBSSIDs & @CRLF + $PostData &= "--" & $boundary & "--" & @CRLF + ConsoleWrite($PostData & @CRLF) + + $oHttpRequest.Send(StringToBinary($PostData)) + ConsoleWrite("STATUS:" & $oHttpRequest.Status & @CRLF) + $Response = $oHttpRequest.ResponseText + + $oHttpRequest = "" + Return ($Response) +EndFunc ;==>_HTTPPost_WifiDB_LocateGPS + +Func _GeoLocate($lat, $lon, $ShowPrompts = 0) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GeoLocate()') ;#Debug Display + Local $return = 0 + $lat = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($lat), "N", ""), "S", "-"), " ", "") + $lon = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($lon), "E", ""), "W", "-"), " ", "") + + $httprecv = _HTTPPost_WifiDB_GeoLocate($WifiDbApiURL, $lat, $lon) + ConsoleWrite($httprecv & @CRLF) + $import_json_response = _JSONDecode($httprecv) + $import_json_response_iRows = UBound($import_json_response, 1) + $import_json_response_iCols = UBound($import_json_response, 2) + If $import_json_response_iCols = 2 Then + ;Pull out information from decoded json array + Local $gncc, $gncn, $gna1c, $gna1n, $gna2n, $gnan, $gnerr, $gnm, $gnkm + For $ji = 0 To ($import_json_response_iRows - 1) + If $import_json_response[$ji][0] = 'Country Code' Then $gncc = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'Country Name' Then $gncn = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'Admin1 Code' Then $gna1c = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'Admin1 Name' Then $gna1n = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'Admin2 Name' Then $gna2n = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'Area Name' Then $gnan = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'miles' Then $gnm = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'km' Then $gnkm = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'error' Then $gnerr = $import_json_response[$ji][1] + Next + If $gncc <> "" Or $gncn <> "" Or $gna1c <> "" Or $gna1n <> "" Or $gna2n <> "" Or $gnan <> "" Or $gnm <> "" Or $gnkm <> "" Or $gnerr <> "" Then + Local $aReturn[9] + $aReturn[1] = $gncc + $aReturn[2] = $gncn + $aReturn[3] = $gna1c + $aReturn[4] = $gna1n + $aReturn[5] = $gna2n + $aReturn[6] = $gnan + $aReturn[7] = $gnm + $aReturn[8] = $gnkm + Return $aReturn + Else + Local $aReturn[2] + $aReturn[1] = $gnerr + SetError(1) + Return + EndIf + Else + If $ShowPrompts = 1 Then MsgBox(0, $Text_Error, "Unexpected array size from _JSONDecode()" & @CRLF & @CRLF & "-- HTTP Response --" & @CRLF & $httprecv) + EndIf +EndFunc ;==>_GeoLocate + +Func _HTTPPost_WifiDB_GeoLocate($apiurl, $lat, $lon) + Local $PostData + Local $boundary = "------------" & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Random(1, 9, 1) & Random(1, 9, 1) & Random(1, 9, 1) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Random(1, 9, 1) & Random(1, 9, 1) & Random(1, 9, 1) + + $sUrl = $apiurl & "geonames.php" + ConsoleWrite($sUrl & @CRLF) + $oHttpRequest = ObjCreate("WinHttp.WinHttpRequest.5.1") + ;$oHttpRequest.Option(4) = 13056 + $oHttpRequest.Open("POST", $sUrl, False) + $oHttpRequest.setRequestHeader("User-Agent", $Script_Name & ' ' & $version) + $oHttpRequest.setRequestHeader("Content-Type", "multipart/form-data; boundary=" & $boundary) + + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""lat""" & @CRLF & @CRLF + $PostData &= $lat & @CRLF + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""long""" & @CRLF & @CRLF + $PostData &= $lon & @CRLF + $PostData &= "--" & $boundary & "--" & @CRLF + ConsoleWrite($PostData & @CRLF) + + $oHttpRequest.Send(StringToBinary($PostData)) + ConsoleWrite("STATUS:" & $oHttpRequest.Status & @CRLF) + $Response = $oHttpRequest.ResponseText + + $oHttpRequest = "" + Return ($Response) +EndFunc ;==>_HTTPPost_WifiDB_GeoLocate + +Func _GeonamesInfo($SelectedRow) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CopyAP_GUI() ') ;#Debug Display + $query = "SELECT CountryCode, CountryName, AdminCode, AdminName, Admin2Name, AreaName, GNAmiles, GNAkm FROM AP WHERE ListRow=" & $SelectedRow + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $SelectedRow <> -1 And $FoundApMatch <> 0 Then ;If a access point is selected in the listview, map its data + Local $GN_CountryCode = "Not Available", $GN_CountryName = "Not Available", $GN_AdminCode = "Not Available", $GN_AdminName = "Not Available", $GN_Admin2Name = "Not Available", $GN_AreaName = "Not Available", $GN_GNAmiles = "Not Available", $GN_GNAkm = "Not Available" + If $ApMatchArray[1][1] <> "" Then $GN_CountryCode = $ApMatchArray[1][1] + If $ApMatchArray[1][2] <> "" Then $GN_CountryName = $ApMatchArray[1][2] + If $ApMatchArray[1][3] <> "" Then $GN_AdminCode = $ApMatchArray[1][3] + If $ApMatchArray[1][4] <> "" Then $GN_AdminName = $ApMatchArray[1][4] + If $ApMatchArray[1][5] <> "" Then $GN_Admin2Name = $ApMatchArray[1][5] + If $ApMatchArray[1][6] <> "" Then $GN_AreaName = $ApMatchArray[1][6] + If $ApMatchArray[1][7] <> -1 Then $GN_GNAmiles = $ApMatchArray[1][7] + If $ApMatchArray[1][8] <> -1 Then $GN_GNAkm = $ApMatchArray[1][8] + MsgBox(0, $Text_Information, "Country Code: " & $GN_CountryCode & @CRLF & "Country Name: " & $GN_CountryName & @CRLF & "Admin Code: " & $GN_AdminCode & @CRLF & "Admin Name: " & $GN_AdminName & @CRLF & "Admin2 Name: " & $GN_Admin2Name & @CRLF & "Area Name: " & $GN_AreaName & @CRLF & 'Accuracy(miles): ' & $GN_GNAmiles & @CRLF & 'Accuracy(km): ' & $GN_GNAkm) + Else + If $SelectedRow = -1 Then + MsgBox(0, $Text_Error, $Text_NoApSelected) + ElseIf $FoundApMatch = 0 Then + MsgBox(0, $Text_Error, "No AP match found") + EndIf + EndIf +EndFunc ;==>_GeonamesInfo + +Func _ViewLiveInWDB() ;View wifidb live aps in browser + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ViewLiveInWDB()') ;#Debug Display + $url = $WifiDbWdbURL & 'opt/live.php' + Run("RunDll32.exe url.dll,FileProtocolHandler " & $url) ;open url with rundll 32 +EndFunc ;==>_ViewLiveInWDB + +Func _LocateAPInWifidb($Selected, $ShowPrompts = 0) ;Finds AP in WifiDB + ConsoleWrite("$Selected:" & $Selected & @CRLF) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_LocateAPInWifidb()') ;#Debug Display + If $Selected <> -1 Then + $query = "SELECT TOP 1 SSID, BSSID, RADTYPE, CHAN, AUTH, ENCR FROM AP WHERE ListRow=" & $Selected + ConsoleWrite("$query:" & $query & @CRLF) + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch <> 0 Then + Local $ExpSSID, $ExpBSSID, $ExpRAD, $ExpCHAN, $ExpAUTH, $ExpENCR + $ExpSSID = $ApMatchArray[1][1] + $ExpBSSID = $ApMatchArray[1][2] + $ExpRAD = $ApMatchArray[1][3] + $ExpCHAN = $ApMatchArray[1][4] + $ExpAUTH = $ApMatchArray[1][5] + $ExpENCR = $ApMatchArray[1][6] + + $httprecv = _HTTPPost_WifiDB_LocateAP($WifiDbApiURL, $ExpSSID, $ExpBSSID, $ExpRAD, $ExpCHAN, $ExpAUTH, $ExpENCR) + ConsoleWrite($httprecv & @CRLF) + $import_json_response = _JSONDecode($httprecv) + $import_json_response_iRows = UBound($import_json_response, 1) + $import_json_response_iCols = UBound($import_json_response, 2) + ConsoleWrite('$import_json_response_iCols:' & $import_json_response_iCols & @CRLF) + If $import_json_response_iRows <> 0 And $import_json_response_iCols = 0 Then + ;Pull out information from decoded json array + Local $lglat, $lglon, $lgdate, $lgtime, $lgsats, $lgerror + For $ji = 0 To ($import_json_response_iRows - 1) + $aparr = $import_json_response[$ji] + $aparr_iRows = UBound($aparr, 1) + $aparr_iCols = UBound($aparr, 2) + ConsoleWrite('$aparr_iCols:' & $aparr_iCols & @CRLF) + If $aparr_iCols = 2 Then + Local $aid, $assid, $amac, $asectype, $achan, $aauth, $aencry, $aradio, $abtx, $aotx, $alabel, $afa, $ala, $ant, $amanuf, $ageonames_id, $aadmin1_id, $aadmin2_id, $ausername, $aap_hash + For $ai = 0 To ($aparr_iRows - 1) + If $aparr[$ai][0] = 'id' Then $aid = $aparr[$ai][1] + If $aparr[$ai][0] = 'ssid' Then $assid = $aparr[$ai][1] + If $aparr[$ai][0] = 'mac' Then $amac = $aparr[$ai][1] + If $aparr[$ai][0] = 'sectype' Then $asectype = $aparr[$ai][1] + If $aparr[$ai][0] = 'chan' Then $achan = $aparr[$ai][1] + If $aparr[$ai][0] = 'auth' Then $aauth = $aparr[$ai][1] + If $aparr[$ai][0] = 'encry' Then $aencry = $aparr[$ai][1] + If $aparr[$ai][0] = 'radio' Then $aradio = $aparr[$ai][1] + If $aparr[$ai][0] = 'BTx' Then $abtx = $aparr[$ai][1] + If $aparr[$ai][0] = 'OTx' Then $aotx = $aparr[$ai][1] + If $aparr[$ai][0] = 'label' Then $alabel = $aparr[$ai][1] + If $aparr[$ai][0] = 'FA' Then $afa = $aparr[$ai][1] + If $aparr[$ai][0] = 'LA' Then $ala = $aparr[$ai][1] + If $aparr[$ai][0] = 'NT' Then $ant = $aparr[$ai][1] + If $aparr[$ai][0] = 'manuf' Then $amanuf = $aparr[$ai][1] + If $aparr[$ai][0] = 'geonames_id' Then $ageonames_id = $aparr[$ai][1] + If $aparr[$ai][0] = 'admin1_id' Then $aadmin1_id = $aparr[$ai][1] + If $aparr[$ai][0] = 'admin2_id' Then $aadmin2_id = $aparr[$ai][1] + If $aparr[$ai][0] = 'username' Then $ausername = $aparr[$ai][1] + If $aparr[$ai][0] = 'ap_hash' Then $aap_hash = $aparr[$ai][1] + Next + If $ShowPrompts = 1 Then MsgBox(0, $Text_Information, 'ID: ' & $aid & @CRLF & 'SSID: ' & $assid & @CRLF & 'BSSID: ' & $amac & @CRLF & 'SecType: ' & $asectype & @CRLF & 'Channel: ' & $achan & @CRLF & 'Authentication: ' & $aauth & @CRLF & 'Encrytion: ' & $aencry & @CRLF & 'Radio Type' & $aradio & @CRLF & 'BTX: ' & $abtx & @CRLF & 'OTX: ' & $aotx & @CRLF & 'Label: ' & $alabel & @CRLF & 'First Seen: ' & $afa & @CRLF & 'Last Seen: ' & $ala & @CRLF & 'Network Type: ' & $ant & @CRLF & 'Manufacturer: ' & $amanuf & @CRLF & 'Geonames ID: ' & $ageonames_id & @CRLF & 'Admin ID:' & $aadmin1_id & @CRLF & 'Admin2 ID: ' & $aadmin2_id & @CRLF & 'Username: ' & $ausername & @CRLF & 'Hash: ' & $aap_hash) + ConsoleWrite($aid & ' - ' & $assid & ' - ' & $amac & ' - ' & $asectype & ' - ' & $achan & ' - ' & $aauth & ' - ' & $aencry & ' - ' & $aradio & ' - ' & $abtx & ' - ' & $aotx & ' - ' & $alabel & ' - ' & $afa & ' - ' & $ala & ' - ' & $ant & ' - ' & $amanuf & ' - ' & $ageonames_id & ' - ' & $aadmin1_id & ' - ' & $aadmin2_id & ' - ' & $ausername & ' - ' & $aap_hash & @CRLF) + EndIf + Next + Else + If $ShowPrompts = 1 Then MsgBox(0, $Text_Error, "Unexpected array size from _JSONDecode()" & @CRLF & @CRLF & "-- HTTP Response --" & @CRLF & $httprecv) + EndIf + EndIf + Else + If $ShowPrompts = 1 Then MsgBox(0, $Text_Error, $Text_NoApSelected) + EndIf +EndFunc ;==>_LocateAPInWifidb + +Func _HTTPPost_WifiDB_LocateAP($apiurl, $SSID, $mac, $radio, $CHAN, $AUTH, $encry) + Local $PostData + Local $boundary = "------------" & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Random(1, 9, 1) & Random(1, 9, 1) & Random(1, 9, 1) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Random(1, 9, 1) & Random(1, 9, 1) & Random(1, 9, 1) + + $sUrl = $apiurl & "import.php" + ConsoleWrite($sUrl & @CRLF) + $oHttpRequest = ObjCreate("WinHttp.WinHttpRequest.5.1") + ;$oHttpRequest.Option(4) = 13056 + $oHttpRequest.Open("POST", $sUrl, False) + $oHttpRequest.setRequestHeader("User-Agent", $Script_Name & ' ' & $version) + $oHttpRequest.setRequestHeader("Content-Type", "multipart/form-data; boundary=" & $boundary) + + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""ssid""" & @CRLF & @CRLF + $PostData &= $SSID & @CRLF + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""mac""" & @CRLF & @CRLF + $PostData &= $mac & @CRLF + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""radio""" & @CRLF & @CRLF + $PostData &= $radio & @CRLF + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""chan""" & @CRLF & @CRLF + $PostData &= $CHAN & @CRLF + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""auth""" & @CRLF & @CRLF + $PostData &= $AUTH & @CRLF + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""encry""" & @CRLF & @CRLF + $PostData &= $encry & @CRLF + $PostData &= "--" & $boundary & "--" & @CRLF + ConsoleWrite($PostData & @CRLF) + + $oHttpRequest.Send(StringToBinary($PostData)) + ConsoleWrite("STATUS:" & $oHttpRequest.Status & @CRLF) + $Response = $oHttpRequest.ResponseText + + $oHttpRequest = "" + Return ($Response) +EndFunc ;==>_HTTPPost_WifiDB_LocateAP + +Func _ViewWDBWebpage() ;View wifidb live aps in browser + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ViewWDBWebpage()') ;#Debug Display + $url = $WifiDbWdbURL + Run("RunDll32.exe url.dll,FileProtocolHandler " & $url) ;open url with rundll 32 +EndFunc ;==>_ViewWDBWebpage + +Func _GeoLocateAllAps() + $OnlyUpdateBlank = InputBox("Geolocate Update Type", "1=Update only blank" & @CRLF & "0=update all aps", 1) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GeoLocateAllAps()') ;#Debug Display + If $OnlyUpdateBlank = 0 Then + $query = "SELECT ApID, HighGpsHistId FROM AP WHERE HighGpsHistId<>0" + Else + $query = "SELECT ApID, HighGpsHistId FROM AP WHERE HighGpsHistId<>0 And CountryCode='' And CountryName='' And AdminCode='' And AdminName='' And Admin2Name='' And AreaName=''" + EndIf + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ApMatch = UBound($ApMatchArray) - 1 + For $ugn = 1 To $ApMatch + GUICtrlSetData($msgdisplay, 'Updating Geoname information for AP ' & $ugn & "/" & $ApMatch) + ;ConsoleWrite($ugn & "/" & $ApMatch & @CRLF) + $Ap_ApID = $ApMatchArray[$ugn][1] + $Ap_HighGpsHist = $ApMatchArray[$ugn][2] + ;ConsoleWrite("APID:" & $Ap_ApID & @CRLF) + ;ConsoleWrite("HighGpsHist:" & $Ap_HighGpsHist & @CRLF) + $query = "SELECT GpsID FROM Hist WHERE HistID=" & $Ap_HighGpsHist + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $HistMatch = UBound($ApMatchArray) - 1 + If $HistMatch <> 0 Then + $Ap_GpsID = $HistMatchArray[1][1] + ;ConsoleWrite("GpsID:" & $Ap_GpsID & @CRLF) + $query = "SELECT Latitude, Longitude FROM GPS WHERE GPSID=" & $Ap_GpsID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $GpsMatch = UBound($ApMatchArray) - 1 + If $GpsMatch <> 0 Then + $Ap_Lat = $GpsMatchArray[1][1] + $Ap_Lon = $GpsMatchArray[1][2] + $GeoInfo = _GeoLocate($Ap_Lat, $Ap_Lon) + If Not @error Then + $GL_CountryCode = $GeoInfo[1] + $GL_CountryName = $GeoInfo[2] + $GL_AdminCode = $GeoInfo[3] + $GL_AdminName = $GeoInfo[4] + $GL_Admin2Name = $GeoInfo[5] + $GL_AreaName = $GeoInfo[6] + $GL_Miles = $GeoInfo[7] + $GL_km = $GeoInfo[8] + ConsoleWrite($GL_CountryCode & @CRLF & $GL_CountryName & @CRLF & $GL_AdminCode & @CRLF & $GL_AdminName & @CRLF & $GL_Admin2Name & @CRLF & $GL_AreaName & @CRLF & $GL_Miles & @CRLF & $GL_km & @CRLF) + $query = "UPDATE AP SET CountryCode='" & $GL_CountryCode & "', CountryName='" & $GL_CountryName & "' , AdminCode='" & $GL_AdminCode & "' , AdminName='" & $GL_AdminName & "' , Admin2Name='" & $GL_Admin2Name & "' , AreaName='" & $GL_AreaName & "' , GNAmiles='" & $GL_Miles & "' , GNAkm='" & $GL_km & "' WHERE ApID=" & $Ap_ApID + ConsoleWrite($query & @CRLF) + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + EndIf + ;ConsoleWrite("---------------------------------------------------" & @CRLF) + EndIf + EndIf + Next + MsgBox(0, $Text_Information, 'Finished updating geolocations') + GUICtrlSetData($msgdisplay, '') +EndFunc ;==>_GeoLocateAllAps + +Func _WifiDbCreateSessionGUI() + If $WifiDbSessionGuiOpen = 0 Then + $WifiDbAutoUploadForm = GUICreate($Text_AutoWiFiDbUploadAps, 496, 398) + GUISetBkColor($BackgroundColor) + $Group1 = GUICtrlCreateGroup($Text_Warning, 8, 16, 473, 105) + $lab_api_warning = GUICtrlCreateLabel($Text_WifiDBAutoUploadWarning, 16, 40, 452, 65) + GUICtrlCreateGroup("", -99, -99, 1, 1) + GUICtrlCreateLabel($Text_WifiDB_Username, 15, 147, 465, 17) + $inp_autoupload_username = GUICtrlCreateInput($WifiDb_User, 15, 165, 465, 21) + GUICtrlCreateLabel($Text_WifiDB_Api_Key, 15, 192, 465, 17) + $inp_autoupload_key = GUICtrlCreateInput($WifiDb_ApiKey, 15, 210, 465, 21) + GUICtrlCreateLabel($Text_Title, 15, 237, 465, 17) + $inp_autoupload_title = GUICtrlCreateInput($datestamp & ' ' & $timestamp, 15, 255, 465, 21) + GUICtrlCreateLabel($Text_Notes, 15, 282, 465, 17) + $inp_autoupload_notes = GUICtrlCreateInput("", 15, 300, 465, 21) + $btn_autoupload_ok = GUICtrlCreateButton($Text_Ok, 88, 344, 153, 33) + $btn_autoupload_can = GUICtrlCreateButton($Text_Cancel, 251, 344, 153, 33) + GUISetOnEvent($GUI_EVENT_CLOSE, '_CloseWifiDbAutoUpload') + GUICtrlSetOnEvent($btn_autoupload_can, '_CloseWifiDbAutoUpload') + GUICtrlSetOnEvent($btn_autoupload_ok, '_StartWifiDBAutoUpload') + GUISetState(@SW_SHOW) + $WifiDbSessionGuiOpen = 1 + Else + WinActivate($WifiDbAutoUploadForm) + EndIf +EndFunc ;==>_WifiDbCreateSessionGUI + +Func _CloseWifiDbAutoUpload() + GUIDelete($WifiDbAutoUploadForm) + $WifiDbSessionGuiOpen = 0 +EndFunc ;==>_CloseWifiDbAutoUpload + +Func _StartWifiDBAutoUpload() + $wua_user = GUICtrlRead($inp_autoupload_username) + $wua_apikey = GUICtrlRead($inp_autoupload_key) + $wua_title = GUICtrlRead($inp_autoupload_title) + $wua_notes = GUICtrlRead($inp_autoupload_notes) + + If $wua_user <> '' Then $WifiDb_User = $wua_user + If $wua_apikey <> '' Then $WifiDb_ApiKey = $wua_apikey + If $wua_title = '' Then $wua_title = $datestamp & ' ' & $timestamp + + ;Check API Version + $url = $WifiDbApiURL & "live.php?LiveVersion=1" + $webpagesource = _INetGetSource($url) + ConsoleWrite("--- " & $webpagesource & " ---" & @CRLF) + If @error Then + MsgBox(0, $Text_Error, "There was an error connection to the API. Auto Upload will not be started") + _CloseWifiDbAutoUpload() + ElseIf StringLeft($webpagesource, 1) <> "{" Or StringRight($webpagesource, 1) <> "}" Then + ;Version 1 API + $wua_ver = 1 + ;Set WifiDB Session ID + $WifiDbSessionID = StringTrimLeft(_MD5(Random(1000, 9999, 1) & Random(1000, 9999, 1) & Random(1000, 9999, 1) & Random(1000, 9999, 1) & Random(1000, 9999, 1) & Random(1000, 9999, 1) & Random(1000, 9999, 1) & Random(1000, 9999, 1) & Random(1000, 9999, 1) & Random(1000, 9999, 1) & $ldatetimestamp & '-' & @MSEC), 2) + ConsoleWrite("WifiDb Session ID:" & $WifiDbSessionID & @CRLF) + GUICtrlSetState($UseWiFiDbAutoUploadButton, $GUI_CHECKED) + $AutoUpApsToWifiDB = 1 + $wifidb_au_timer = TimerInit() + _CloseWifiDbAutoUpload() + Else + ;Version 2.0+ API + $wua_ver = 2 + If $wua_user = '' Or $wua_apikey = '' Then + $setanon = MsgBox(1, $Text_Warning, "Username or Api Key were not entered. Your username will be set to 'AnonCoward' if you continue.") + If $setanon = "-1" Or $setanon = "2" Then Return (0) + $wua_user = "AnonCoward" + $wua_apikey = "scaredycat" + EndIf + ;Request Session ID + $httprecv = _HTTPPost_WifiDB_Live_Start($WifiDbApiURL, $wua_user, $wua_apikey, $wua_title, $wua_notes) + ConsoleWrite($httprecv & @CRLF) + $import_json_response = _JSONDecode($httprecv) + $import_json_response_iRows = UBound($import_json_response, 1) + $import_json_response_iCols = UBound($import_json_response, 2) + ;Pull out information from decoded json array + If $import_json_response_iCols = 2 Then + Local $WifiDbSessionError + $WifiDbSessionID = "" + For $ji = 0 To ($import_json_response_iRows - 1) + ConsoleWrite($import_json_response[$ji][0] & ' -- ' & $import_json_response[$ji][1] & @CRLF) + If $import_json_response[$ji][0] = 'error' Then $WifiDbSessionError = $import_json_response[$ji][1] + If $import_json_response[$ji][0] = 'SessionID' Then $WifiDbSessionID = $import_json_response[$ji][1] + Next + If $WifiDbSessionID <> "" Then + ConsoleWrite("WifiDb Session ID:" & $WifiDbSessionID & @CRLF) + GUICtrlSetState($UseWiFiDbAutoUploadButton, $GUI_CHECKED) + $AutoUpApsToWifiDB = 1 + $wifidb_au_timer = TimerInit() + _CloseWifiDbAutoUpload() + ElseIf $WifiDbSessionError <> "" Then + MsgBox(0, $Text_Error, $WifiDbSessionError) + Else + MsgBox(0, $Text_Error, "An Unknown Error Occured") + EndIf + Else + MsgBox(0, $Text_Error, "Unexpected array size from _JSONDecode()" & @CRLF & @CRLF & "-- HTTP Response --" & @CRLF & $httprecv) + EndIf + EndIf +EndFunc ;==>_StartWifiDBAutoUpload + + +Func _StopWifiDBAutoUpload() + GUICtrlSetState($UseWiFiDbAutoUploadButton, $GUI_UNCHECKED) + $AutoUpApsToWifiDB = 0 + If $wua_ver <> 1 Then + $url = $WifiDbApiURL & "live.php?completed=1&username=" & $wua_user & "&apikey=" & $wua_apikey & "&SessionID=" & $WifiDbSessionID + $webpagesource = _INetGetSource($url) + ConsoleWrite("--- " & $webpagesource & " ---" & @CRLF) + EndIf +EndFunc ;==>_StopWifiDBAutoUpload + +Func _HTTPPost_WifiDB_Live_Start($apiurl, $WifiDb_User, $WifiDb_ApiKey, $WifiDB_Title, $WifiDB_Notes) + Local $PostData + Local $boundary = "------------" & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Random(1, 9, 1) & Random(1, 9, 1) & Random(1, 9, 1) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Chr(Random(Asc("A"), Asc("Z"), 3)) & Chr(Random(Asc("a"), Asc("z"), 3)) & Random(1, 9, 1) & Random(1, 9, 1) & Random(1, 9, 1) + + $sUrl = $apiurl & "live.php" + $oHttpRequest = ObjCreate("WinHttp.WinHttpRequest.5.1") + ;$oHttpRequest.Option(4) = 13056 + $oHttpRequest.Open("POST", $sUrl, False) + $oHttpRequest.setRequestHeader("User-Agent", $Script_Name & ' ' & $version) + $oHttpRequest.setRequestHeader("Content-Type", "multipart/form-data; boundary=" & $boundary) + + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""username""" & @CRLF & @CRLF + $PostData &= $WifiDb_User & @CRLF + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""apikey""" & @CRLF & @CRLF + $PostData &= $WifiDb_ApiKey & @CRLF + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""title""" & @CRLF & @CRLF + $PostData &= $WifiDB_Title & @CRLF + $PostData &= "--" & $boundary & @CRLF + $PostData &= "Content-Disposition: form-data; name=""notes""" & @CRLF & @CRLF + $PostData &= $WifiDB_Notes & @CRLF + $PostData &= "--" & $boundary & "--" & @CRLF + ConsoleWrite($PostData & @CRLF) + + $oHttpRequest.Send(StringToBinary($PostData)) + ConsoleWrite("STATUS:" & $oHttpRequest.Status & @CRLF) + $Response = $oHttpRequest.ResponseText + + $oHttpRequest = "" + Return ($Response) +EndFunc ;==>_HTTPPost_WifiDB_Live_Start + +;------------------------------------------------------------------------------------------------------------------------------- +; REFRESH NETWORK FUNCTION +;------------------------------------------------------------------------------------------------------------------------------- + +Func _RefreshNetworks() ;Refresh Wireless networks + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_RefreshNetworks() ') ;#Debug Display + If $Scan = 1 And $RefreshNetworks = 1 Then + If TimerDiff($RefreshTimer) >= $RefreshTime Then + _Wlan_Scan() + $RefreshTimer = TimerInit() + EndIf + EndIf +EndFunc ;==>_RefreshNetworks + +;------------------------------------------------------------------------------------------------------------------------------- +; HELP FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _OpenVistumblerHome() ;Opens Vistumbler Website + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_OpenVistumblerHome() ') ;#Debug Display + Run("RunDll32.exe url.dll,FileProtocolHandler " & 'http://www.vistumbler.net') +EndFunc ;==>_OpenVistumblerHome + +Func _OpenVistumblerForum() ;Opens Vistumbler Forum + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_OpenVistumblerForum() ') ;#Debug Display + Run("RunDll32.exe url.dll,FileProtocolHandler " & 'http://forum.vistumbler.net') +EndFunc ;==>_OpenVistumblerForum + +Func _OpenVistumblerWiki() ;Opens Vistumbler Wiki + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_OpenVistumblerWiki() ') ;#Debug Display + Run("RunDll32.exe url.dll,FileProtocolHandler " & 'https://github.com/RIEI/Vistumbler/wiki') +EndFunc ;==>_OpenVistumblerWiki + +;------------------------------------------------------------------------------------------------------------------------------- +; SUPPORT VISTUMBLER FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _OpenVistumblerDonate() ;Opens Vistumbler Donate + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_OpenVistumblerDonate() ') ;#Debug Display + Run("RunDll32.exe url.dll,FileProtocolHandler " & 'http://donate.vistumbler.net') +EndFunc ;==>_OpenVistumblerDonate + +Func _OpenVistumblerStore() ;Opens Vistumbler Store + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_OpenVistumblerStore() ') ;#Debug Display + Run("RunDll32.exe url.dll,FileProtocolHandler " & 'http://store.vistumbler.net') +EndFunc ;==>_OpenVistumblerStore +;------------------------------------------------------------------------------------------------------------------------------- +; COPY GUI FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _CopySelectedAP() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CopySelectedAP() ') ;#Debug Display + $CopySelected = _GUICtrlListView_GetNextItem($ListviewAPs) ; find what AP is selected in the list. returns -1 is nothing is selected + _CopyAP_GUI($CopySelected) +EndFunc ;==>_CopySelectedAP + +Func _CopyAP_GUI($SelectedRow) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CopyAP_GUI() ') ;#Debug Display + $query = "SELECT ApID FROM AP WHERE ListRow=" & $SelectedRow + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $SelectedRow <> -1 And $FoundApMatch <> 0 Then ;If a access point is selected in the listview, map its data + $CopyAPID = $ApMatchArray[1][1] + $GUI_COPY = GUICreate($Text_Copy, 491, 249) + GUISetBkColor($BackgroundColor) + GUICtrlCreateGroup($Text_SelectWhatToCopy, 8, 8, 473, 201) + $CopyGUI_Line = GUICtrlCreateCheckbox($Column_Names_Line, 27, 25, 200, 15) + If $Copy_Line = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_BSSID = GUICtrlCreateCheckbox($Column_Names_BSSID, 27, 40, 200, 15) + If $Copy_BSSID = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_SSID = GUICtrlCreateCheckbox($Column_Names_SSID, 27, 55, 200, 15) + If $Copy_SSID = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_CHAN = GUICtrlCreateCheckbox($Column_Names_Channel, 27, 70, 200, 15) + If $Copy_CHAN = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_AUTH = GUICtrlCreateCheckbox($Column_Names_Authentication, 27, 85, 200, 15) + If $Copy_AUTH = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_ENCR = GUICtrlCreateCheckbox($Column_Names_Encryption, 27, 100, 200, 15) + If $Copy_ENCR = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_NETTYPE = GUICtrlCreateCheckbox($Column_Names_NetworkType, 27, 115, 200, 15) + If $Copy_NETTYPE = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_RADTYPE = GUICtrlCreateCheckbox($Column_Names_RadioType, 27, 130, 200, 15) + If $Copy_RADTYPE = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_SIG = GUICtrlCreateCheckbox($Column_Names_Signal, 27, 145, 200, 15) + If $Copy_SIG = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_HIGHSIG = GUICtrlCreateCheckbox($Column_Names_HighSignal, 27, 160, 200, 15) + If $Copy_HIGHSIG = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_RSSI = GUICtrlCreateCheckbox($Column_Names_RSSI, 27, 175, 200, 15) + If $Copy_RSSI = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_HIGHRSSI = GUICtrlCreateCheckbox($Column_Names_HighRSSI, 27, 190, 200, 15) + If $Copy_HIGHRSSI = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_MANU = GUICtrlCreateCheckbox($Column_Names_MANUF, 267, 25, 200, 15) + If $Copy_MANU = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_LAB = GUICtrlCreateCheckbox($Column_Names_Label, 267, 40, 200, 15) + If $Copy_LAB = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_LAT = GUICtrlCreateCheckbox($Column_Names_Latitude, 267, 55, 200, 15) + If $Copy_LAT = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_LON = GUICtrlCreateCheckbox($Column_Names_Longitude, 267, 70, 200, 15) + If $Copy_LON = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_LATDMS = GUICtrlCreateCheckbox($Column_Names_LatitudeDMS, 267, 85, 200, 15) + If $Copy_LATDMS = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_LONDMS = GUICtrlCreateCheckbox($Column_Names_LongitudeDMS, 267, 100, 200, 15) + If $Copy_LONDMS = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_LATDMM = GUICtrlCreateCheckbox($Column_Names_LatitudeDMM, 267, 115, 200, 15) + If $Copy_LATDMM = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_LONDMM = GUICtrlCreateCheckbox($Column_Names_LongitudeDMM, 267, 130, 200, 15) + If $Copy_LONDMM = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_BTX = GUICtrlCreateCheckbox($Column_Names_BasicTransferRates, 267, 145, 200, 15) + If $Copy_BTX = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_OTX = GUICtrlCreateCheckbox($Column_Names_OtherTransferRates, 267, 160, 200, 15) + If $Copy_OTX = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_FirstActive = GUICtrlCreateCheckbox($Column_Names_FirstActive, 267, 175, 200, 15) + If $Copy_FirstActive = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + $CopyGUI_LastActive = GUICtrlCreateCheckbox($Column_Names_LastActive, 267, 190, 200, 15) + If $Copy_LastActive = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + + $CopyOK = GUICtrlCreateButton($Text_Ok, 142, 216, 100, 25, 0) + $CopyCancel = GUICtrlCreateButton($Text_Cancel, 256, 216, 100, 25, 0) + GUISetState(@SW_SHOW) + + GUISetOnEvent($GUI_EVENT_CLOSE, '_CloseCopyGUI') + GUICtrlSetOnEvent($CopyCancel, '_CloseCopyGUI') + GUICtrlSetOnEvent($CopyOK, '_CopyOK') + Else + MsgBox(0, $Text_Error, $Text_NoApSelected) + EndIf +EndFunc ;==>_CopyAP_GUI + +Func _CloseCopyGUI() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CloseCopyGUI() ') ;#Debug Display + GUIDelete($GUI_COPY) +EndFunc ;==>_CloseCopyGUI + +Func _CopyOK() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CopyOK() ') ;#Debug Display + $CopyFlag = 1 + Dim $Copy_Line = 0, $Copy_BSSID = 0, $Copy_SSID = 0, $Copy_CHAN = 0, $Copy_AUTH = 0, $Copy_ENCR = 0, $Copy_NETTYPE = 0, $Copy_RADTYPE = 0, $Copy_SIG = 0, $Copy_HIGHSIG = 0, $Copy_RSSI = 0, $Copy_HIGHRSSI = 0, $Copy_MANU = 0, $Copy_LAB = 0, $Copy_LAT = 0, $Copy_LON = 0, $Copy_LATDMS = 0, $Copy_LONDMS = 0, $Copy_LATDMM = 0, $Copy_LONDMM = 0, $Copy_BTX = 0, $Copy_OTX = 0, $Copy_FirstActive = 0, $Copy_LastActive = 0 + If GUICtrlRead($CopyGUI_Line) = 1 Then $Copy_Line = 1 + If GUICtrlRead($CopyGUI_BSSID) = 1 Then $Copy_BSSID = 1 + If GUICtrlRead($CopyGUI_SSID) = 1 Then $Copy_SSID = 1 + If GUICtrlRead($CopyGUI_CHAN) = 1 Then $Copy_CHAN = 1 + If GUICtrlRead($CopyGUI_AUTH) = 1 Then $Copy_AUTH = 1 + If GUICtrlRead($CopyGUI_ENCR) = 1 Then $Copy_ENCR = 1 + If GUICtrlRead($CopyGUI_NETTYPE) = 1 Then $Copy_NETTYPE = 1 + If GUICtrlRead($CopyGUI_RADTYPE) = 1 Then $Copy_RADTYPE = 1 + If GUICtrlRead($CopyGUI_SIG) = 1 Then $Copy_SIG = 1 + If GUICtrlRead($CopyGUI_HIGHSIG) = 1 Then $Copy_HIGHSIG = 1 + If GUICtrlRead($CopyGUI_RSSI) = 1 Then $Copy_RSSI = 1 + If GUICtrlRead($CopyGUI_HIGHRSSI) = 1 Then $Copy_HIGHRSSI = 1 + If GUICtrlRead($CopyGUI_MANU) = 1 Then $Copy_MANU = 1 + If GUICtrlRead($CopyGUI_LAB) = 1 Then $Copy_LAB = 1 + If GUICtrlRead($CopyGUI_LAT) = 1 Then $Copy_LAT = 1 + If GUICtrlRead($CopyGUI_LON) = 1 Then $Copy_LON = 1 + If GUICtrlRead($CopyGUI_LATDMS) = 1 Then $Copy_LATDMS = 1 + If GUICtrlRead($CopyGUI_LONDMS) = 1 Then $Copy_LONDMS = 1 + If GUICtrlRead($CopyGUI_LATDMM) = 1 Then $Copy_LATDMM = 1 + If GUICtrlRead($CopyGUI_LONDMM) = 1 Then $Copy_LONDMM = 1 + If GUICtrlRead($CopyGUI_BTX) = 1 Then $Copy_BTX = 1 + If GUICtrlRead($CopyGUI_OTX) = 1 Then $Copy_OTX = 1 + If GUICtrlRead($CopyGUI_FirstActive) = 1 Then $Copy_FirstActive = 1 + If GUICtrlRead($CopyGUI_LastActive) = 1 Then $Copy_LastActive = 1 + _CloseCopyGUI() +EndFunc ;==>_CopyOK + +Func _CopySetClipboard() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CopySetClipboard() ') ;#Debug Display + $query = "SELECT ApID, BSSID, SSID, CHAN, AUTH, ENCR, NETTYPE, RADTYPE, HighSignal, HighRSSI, MANU, LABEL, HighGpsHistID, BTX, OTX, FirstHistID, LastHistID FROM AP WHERE ApID=" & $CopyAPID + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch <> 0 Then + $CopyText = '' + If $Copy_Line = 1 Then + $CopyText = Round($ApMatchArray[1][1]) + EndIf + If $Copy_BSSID = 1 Then + If $CopyText = '' Then + $CopyText = $ApMatchArray[1][2] + Else + $CopyText &= '|' & $ApMatchArray[1][2] + EndIf + EndIf + If $Copy_SSID = 1 Then + If $CopyText = '' Then + $CopyText = $ApMatchArray[1][3] + Else + $CopyText &= '|' & $ApMatchArray[1][3] + EndIf + EndIf + If $Copy_CHAN = 1 Then + If $CopyText = '' Then + $CopyText = Round($ApMatchArray[1][4]) + Else + $CopyText &= '|' & Round($ApMatchArray[1][4]) + EndIf + EndIf + If $Copy_AUTH = 1 Then + If $CopyText = '' Then + $CopyText = $ApMatchArray[1][5] + Else + $CopyText &= '|' & $ApMatchArray[1][5] + EndIf + EndIf + If $Copy_ENCR = 1 Then + If $CopyText = '' Then + $CopyText = $ApMatchArray[1][6] + Else + $CopyText &= '|' & $ApMatchArray[1][6] + EndIf + EndIf + If $Copy_NETTYPE = 1 Then + If $CopyText = '' Then + $CopyText = $ApMatchArray[1][7] + Else + $CopyText &= '|' & $ApMatchArray[1][7] + EndIf + EndIf + If $Copy_RADTYPE = 1 Then + If $CopyText = '' Then + $CopyText = $ApMatchArray[1][8] + Else + $CopyText &= '|' & $ApMatchArray[1][8] + EndIf + EndIf + If $Copy_SIG = 1 Then + $LastHistID = $ApMatchArray[1][17] - 0 + $query = "SELECT Signal FROM Hist Where HistID=" & $LastHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpSig = $HistMatchArray[1][1] + If $CopyText = '' Then + $CopyText = $ExpSig + Else + $CopyText &= '|' & $ExpSig + EndIf + EndIf + If $Copy_HIGHSIG = 1 Then + If $CopyText = '' Then + $CopyText = $ApMatchArray[1][9] + Else + $CopyText &= '|' & $ApMatchArray[1][9] + EndIf + EndIf + If $Copy_RSSI = 1 Then + $LastHistID = $ApMatchArray[1][17] - 0 + $query = "SELECT RSSI FROM Hist Where HistID=" & $LastHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpRSSI = $HistMatchArray[1][1] + If $CopyText = '' Then + $CopyText = $ExpRSSI + Else + $CopyText &= '|' & $ExpRSSI + EndIf + EndIf + If $Copy_HIGHRSSI = 1 Then + If $CopyText = '' Then + $CopyText = $ApMatchArray[1][10] + Else + $CopyText &= '|' & $ApMatchArray[1][10] + EndIf + EndIf + If $Copy_MANU = 1 Then + If $CopyText = '' Then + $CopyText = $ApMatchArray[1][11] + Else + $CopyText &= '|' & $ApMatchArray[1][11] + EndIf + EndIf + If $Copy_LAB = 1 Then + If $CopyText = '' Then + $CopyText = $ApMatchArray[1][12] + Else + $CopyText &= '|' & $ApMatchArray[1][12] + EndIf + EndIf + If $Copy_LAT = 1 Or $Copy_LON = 1 Or $Copy_LATDMS = 1 Or $Copy_LONDMS = 1 Or $Copy_LATDMM = 1 Or $Copy_LONDMM = 1 Then + $HighGpsHistID = $ApMatchArray[1][13] - 0 + If $HighGpsHistID = 0 Then + $CopyLat = 'N 0000.0000' + $CopyLon = 'E 0000.0000' + Else + $query = "SELECT GpsId FROM Hist Where HistID=" & $HighGpsHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpGID = $HistMatchArray[1][1] + $query = "SELECT Latitude, Longitude FROM GPS WHERE GpsId=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $CopyLat = $GpsMatchArray[1][1] + $CopyLon = $GpsMatchArray[1][2] + EndIf + If $Copy_LAT = 1 Then + If $CopyText = '' Then + $CopyText = _Format_GPS_DMM_to_DDD($CopyLat) + Else + $CopyText &= '|' & _Format_GPS_DMM_to_DDD($CopyLat) + EndIf + EndIf + If $Copy_LON = 1 Then + If $CopyText = '' Then + $CopyText = _Format_GPS_DMM_to_DDD($CopyLon) + Else + $CopyText &= '|' & _Format_GPS_DMM_to_DDD($CopyLon) + EndIf + EndIf + If $Copy_LATDMS = 1 Then + If $CopyText = '' Then + $CopyText = _Format_GPS_DMM_to_DMS($CopyLat) + Else + $CopyText &= '|' & _Format_GPS_DMM_to_DMS($CopyLat) + EndIf + EndIf + If $Copy_LONDMS = 1 Then + If $CopyText = '' Then + $CopyText = _Format_GPS_DMM_to_DMS($CopyLon) + Else + $CopyText &= '|' & _Format_GPS_DMM_to_DMS($CopyLon) + EndIf + EndIf + If $Copy_LATDMM = 1 Then + If $CopyText = '' Then + $CopyText = $CopyLat + Else + $CopyText &= '|' & $CopyLat + EndIf + EndIf + If $Copy_LONDMM = 1 Then + If $CopyText = '' Then + $CopyText = $CopyLon + Else + $CopyText &= '|' & $CopyLon + EndIf + EndIf + EndIf + If $Copy_BTX = 1 Then + If $CopyText = '' Then + $CopyText = $ApMatchArray[1][14] + Else + $CopyText &= '|' & $ApMatchArray[1][14] + EndIf + EndIf + If $Copy_OTX = 1 Then + If $CopyText = '' Then + $CopyText = $ApMatchArray[1][13] + Else + $CopyText &= '|' & $ApMatchArray[1][15] + EndIf + EndIf + If $Copy_FirstActive = 1 Then + $FirstHistID = $ApMatchArray[1][16] + $query = "SELECT GpsID FROM Hist Where HistID=" & $FirstHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpGID = $HistMatchArray[1][1] + $query = "SELECT Date1, Time1 FROM Gps Where GpsID=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpDate = $GpsMatchArray[1][1] + $ExpTime = $GpsMatchArray[1][2] + If $CopyText = '' Then + $CopyText = $ExpDate & ' ' & $ExpTime + Else + $CopyText &= '|' & $ExpDate & ' ' & $ExpTime + EndIf + EndIf + If $Copy_LastActive = 1 Then + $LastHistID = $ApMatchArray[1][17] + $query = "SELECT GpsID FROM Hist Where HistID=" & $LastHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpGID = $HistMatchArray[1][1] + $query = "SELECT Date1, Time1 FROM Gps Where GpsID=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpDate = $GpsMatchArray[1][1] + $ExpTime = $GpsMatchArray[1][2] + If $CopyText = '' Then + $CopyText = $ExpDate & ' ' & $ExpTime + Else + $CopyText &= '|' & $ExpDate & ' ' & $ExpTime + EndIf + EndIf + ;ConsoleWrite($CopyText & @CRLF) + ClipPut($CopyText) + EndIf + $CopyFlag = 0 +EndFunc ;==>_CopySetClipboard + +;------------------------------------------------------------------------------------------------------------------------------- +; VISTUMBLER SAVE FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _OpenSaveFolder() ;Opens save folder in explorer + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_OpenSaveFolder() ') ;#Debug Display + Run('RunDll32.exe url.dll,FileProtocolHandler "' & $SaveDir & '"') +EndFunc ;==>_OpenSaveFolder + +Func _AutoRecoveryVS1() ;Autosaves data to a file name based on current time + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AutoRecoveryVS1()') ;#Debug Display + DirCreate($SaveDirAuto) + FileDelete($AutoRecoveryVS1File) + $AutoRecoveryVS1File = $SaveDirAutoRecovery & $ldatetimestamp & '_AutoRecovery' & '.VS1' + If ProcessExists($AutoRecoveryVS1Process) = 0 Then + $AutoRecoveryVS1Process = Run(@ComSpec & " /C " & FileGetShortName(@ScriptDir & '\Export.exe') & ' /db="' & $VistumblerDB & '" /t=d /f="' & $AutoRecoveryVS1File & '"', '', @SW_HIDE) + $save_timer = TimerInit() + EndIf +EndFunc ;==>_AutoRecoveryVS1 + +Func _AutoSaveAndClear() ;Autosaves data to a file name based on current time + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_AutoSaveAndClear()') ;#Debug Display + $AutoSaveAndClearFile = $SaveDirAuto & $ldatetimestamp & '_AutoSave' & '.VS1' + If $AutoSaveAndClearPlaySound = 1 Then _SoundPlay($SoundDir & $AutoSave_sound) + GUICtrlSetData($msgdisplay, "Running Auto Save and Clear") + $expvs1 = _ExportVS1($AutoSaveAndClearFile, 0) + If $expvs1 = 1 Then + GUICtrlSetData($msgdisplay, "File Exported Successfully. Clearing List") + _ClearAll() + Else + GUICtrlSetData($msgdisplay, "Error Saving File. List will not be cleared.") + EndIf + $autosave_timer = TimerInit() +EndFunc ;==>_AutoSaveAndClear + +Func _ExportDetailedData() ;Saves data to a selected file + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportDetailedData() ') ;#Debug Display + _ExportDetailedDataGui(0) +EndFunc ;==>_ExportDetailedData + +Func _ExportFilteredDetailedData() ;Saves filtered data to a selected file + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportFilteredDetailedData() ') ;#Debug Display + _ExportDetailedDataGui(1) +EndFunc ;==>_ExportFilteredDetailedData + +Func _ExportDetailedDataGui($Filter = 0) ;Save VS1 GUI + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportDetailedDataGui()') ;#Debug Display + DirCreate($SaveDir) + $filename = FileSaveDialog($Text_SaveAsTXT, $SaveDir, $Text_VistumblerFile & ' (*.VS1)', '', $ldatetimestamp & '.VS1') + If @error <> 1 Then + If StringInStr($filename, '.VS1') = 0 Then $filename = $filename & '.VS1' + $saved = _ExportVS1($filename, $Filter) + If $saved = 1 Then + MsgBox(0, $Text_Done, $Text_SavedAs & ': "' & $filename & '"') + Else + MsgBox(0, $Text_Error, $Text_NoAps & ' ' & $Text_NoFileSaved) + EndIf + GUICtrlSetData($msgdisplay, '') + $newdata = 0 + EndIf +EndFunc ;==>_ExportDetailedDataGui + +Func _ExportVS1($savefile, $Filter = 0) ;writes vistumbler detailed data to a txt file + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportDetailedTXT()') ;#Debug Display + $file = "# Vistumbler VS1 - Detailed Export Version 4.0" & @CRLF & _ + "# Created By: " & $Script_Name & ' ' & $version & @CRLF & _ + "# -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" & @CRLF & _ + "# GpsID|Latitude|Longitude|NumOfSatalites|HorizontalDilutionOfPrecision|Altitude(m)|HeightOfGeoidAboveWGS84Ellipsoid(m)|Speed(km/h)|Speed(MPH)|TrackAngle(Deg)|Date(UTC y-m-d)|Time(UTC h:m:s.ms)" & @CRLF & _ + "# -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" & @CRLF + ;Export GPS IDs + $query = "SELECT GpsID, Latitude, Longitude, NumOfSats, HorDilPitch, Alt, Geo, SpeedInMPH, SpeedInKmH, TrackAngle, Date1, Time1 FROM GPS ORDER BY Date1, Time1" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + For $exp = 1 To $FoundGpsMatch + GUICtrlSetData($msgdisplay, $Text_SavingGID & ' ' & $exp & ' / ' & $FoundGpsMatch) + $ExpGID = $GpsMatchArray[$exp][1] + $ExpLat = $GpsMatchArray[$exp][2] + $ExpLon = $GpsMatchArray[$exp][3] + $ExpSat = $GpsMatchArray[$exp][4] + $ExpHorDilPitch = $GpsMatchArray[$exp][5] + $ExpAlt = $GpsMatchArray[$exp][6] + $ExpGeo = $GpsMatchArray[$exp][7] + $ExpSpeedMPH = $GpsMatchArray[$exp][8] + $ExpSpeedKmh = $GpsMatchArray[$exp][9] + $ExpTrack = $GpsMatchArray[$exp][10] + $ExpDate = $GpsMatchArray[$exp][11] + $ExpTime = $GpsMatchArray[$exp][12] + $file &= $ExpGID & '|' & $ExpLat & '|' & $ExpLon & '|' & $ExpSat & '|' & $ExpHorDilPitch & '|' & $ExpAlt & '|' & $ExpGeo & '|' & $ExpSpeedKmh & '|' & $ExpSpeedMPH & '|' & $ExpTrack & '|' & $ExpDate & '|' & $ExpTime & @CRLF + Next + + ;Export AP Information + $file &= "# ---------------------------------------------------------------------------------------------------------------------------------------------------------" & @CRLF & _ + "# SSID|BSSID|MANUFACTURER|Authentication|Encryption|Security Type|Radio Type|Channel|Basic Transfer Rates|Other Transfer Rates|High Signal|High RSSI|Network Type|Label|GID,SIGNAL,RSSI" & @CRLF & _ + "# ---------------------------------------------------------------------------------------------------------------------------------------------------------" & @CRLF + If $Filter = 1 Then + $query = $AddQuery + Else + $query = "SELECT ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, HighSignal, HighRSSI, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID FROM AP" + EndIf + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch > 0 Then + For $exp = 1 To $FoundApMatch + GUICtrlSetData($msgdisplay, $Text_SavingLine & ' ' & $exp & ' / ' & $FoundApMatch) + $ExpApID = $ApMatchArray[$exp][1] + $ExpSSID = $ApMatchArray[$exp][2] + $ExpBSSID = $ApMatchArray[$exp][3] + $ExpNET = $ApMatchArray[$exp][4] + $ExpRAD = $ApMatchArray[$exp][5] + $ExpCHAN = $ApMatchArray[$exp][6] + $ExpAUTH = $ApMatchArray[$exp][7] + $ExpENCR = $ApMatchArray[$exp][8] + $ExpSECTYPE = $ApMatchArray[$exp][9] + $ExpBTX = $ApMatchArray[$exp][10] + $ExpOTX = $ApMatchArray[$exp][11] + $ExpHighSig = $ApMatchArray[$exp][12] + $ExpHighRSSI = $ApMatchArray[$exp][13] + $ExpMANU = $ApMatchArray[$exp][14] + $ExpLAB = $ApMatchArray[$exp][15] + $ExpHighGpsID = $ApMatchArray[$exp][16] + $ExpFirstID = $ApMatchArray[$exp][17] + $ExpLastID = $ApMatchArray[$exp][18] + + ;Create GID,SIG String + $ExpGidSid = '' + $query = "SELECT GpsID, Signal, RSSI FROM Hist WHERE ApID=" & $ExpApID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundHistMatch = UBound($HistMatchArray) - 1 + For $epgs = 1 To $FoundHistMatch + $ExpGID = $HistMatchArray[$epgs][1] + $ExpSig = $HistMatchArray[$epgs][2] + $ExpRSSI = $HistMatchArray[$epgs][3] + If $epgs = 1 Then + $ExpGidSid = $ExpGID & ',' & $ExpSig & ',' & $ExpRSSI + Else + $ExpGidSid &= '\' & $ExpGID & ',' & $ExpSig & ',' & $ExpRSSI + EndIf + Next + + $file &= $ExpSSID & '|' & $ExpBSSID & '|' & $ExpMANU & '|' & $ExpAUTH & '|' & $ExpENCR & '|' & $ExpSECTYPE & '|' & $ExpRAD & '|' & $ExpCHAN & '|' & $ExpBTX & '|' & $ExpOTX & '|' & $ExpHighSig & '|' & $ExpHighRSSI & '|' & $ExpNET & '|' & $ExpLAB & '|' & $ExpGidSid & @CRLF + Next + $savefile = FileOpen($savefile, 128 + 2) ;Open in UTF-8 write mode + FileWrite($savefile, $file) + FileClose($savefile) + Return (1) + Else + Return (0) + EndIf +EndFunc ;==>_ExportVS1 + +Func _ExportVszData() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportVszData()') ;#Debug Display + $file = FileSaveDialog($Text_SaveAsVSZ, $SaveDir, $Text_VistumblerFile & ' (*.VSZ)', '', $ldatetimestamp & '.VSZ') + If @error <> 1 Then _ExportVSZ($file, 0) +EndFunc ;==>_ExportVszData + +Func _ExportVszFilteredData() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportVszFilteredData()') ;#Debug Display + $file = FileSaveDialog($Text_SaveAsVSZ & ' ' & $Text_Filtered, $SaveDir, $Text_VistumblerFile & ' (*.VSZ)', '', $ldatetimestamp & '.VSZ') + If @error <> 1 Then _ExportVSZ($file, 1) +EndFunc ;==>_ExportVszFilteredData + +Func _ExportVSZ($savefile, $Filter = 0) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportVSZ()') ;#Debug Display + If StringInStr($savefile, '.VSZ') = 0 Then $savefile = $savefile & '.VSZ' + $vsz_temp_file = $TmpDir & 'data.zip' + $vsz_file = $savefile + $vs1_file = $TmpDir & 'data.vs1' + If FileExists($vsz_temp_file) Then FileDelete($vsz_temp_file) + If FileExists($vsz_file) Then FileDelete($vsz_file) + If FileExists($vs1_file) Then FileDelete($vs1_file) + $vs1tmpcreated = _ExportVS1($vs1_file, $Filter) + If $vs1tmpcreated = 1 Then + _Zip_Create($vsz_temp_file) + _Zip_AddItem($vsz_temp_file, $vs1_file) + FileMove($vsz_temp_file, $vsz_file) + FileDelete($vs1_file) + If FileExists($savefile) Then Return (1) + EndIf + Return (0) +EndFunc ;==>_ExportVSZ + +Func _ExportCsvData() ;Saves data to a selected file + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportCsvData()') ;#Debug Display + _ExportCsvDataGui(0) +EndFunc ;==>_ExportCsvData + +Func _ExportCsvFilteredData() ;Saves data to a selected file + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportCsvFilteredData()') ;#Debug Display + _ExportCsvDataGui(1) +EndFunc ;==>_ExportCsvFilteredData + +Func _ExportCsvDataGui($Gui_CsvFilter = 0) ;Saves data to a selected file + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportCsvDataGui()') ;#Debug Display + $Gui_Csv = GUICreate($Text_ExportToCSV, 543, 132) + GUISetBkColor($BackgroundColor) + $Gui_CsvFile = GUICtrlCreateInput($SaveDir & $ldatetimestamp & '.csv', 20, 20, 409, 21) + $GUI_CsvSaveAs = GUICtrlCreateButton($Text_Browse, 440, 20, 81, 22, $WS_GROUP) + $Gui_CsvRadDetailed = GUICtrlCreateRadio($Text_DetailedCsvFile, 20, 50, 250, 20) + GUICtrlSetState($Gui_CsvRadDetailed, $GUI_CHECKED) + $Gui_CsvRadSummary = GUICtrlCreateRadio($Text_SummaryCsvFile, 20, 70, 250, 20) + $Gui_CsvFiltered = GUICtrlCreateCheckbox($Text_Filtered, 300, 50, 250, 20) + If $Gui_CsvFilter = 1 Then GUICtrlSetState($Gui_CsvFiltered, $GUI_CHECKED) + $Gui_CsvOk = GUICtrlCreateButton($Text_Ok, 128, 95, 97, 25, $WS_GROUP) + $Gui_CsvCancel = GUICtrlCreateButton($Text_Cancel, 290, 95, 97, 25, $WS_GROUP) + GUISetState(@SW_SHOW) + GUICtrlSetOnEvent($GUI_CsvSaveAs, "_ExportCsvDataGui_SaveAs") + GUICtrlSetOnEvent($Gui_CsvOk, "_ExportCsvDataGui_Ok") + GUICtrlSetOnEvent($Gui_CsvCancel, "_ExportCsvDataGui_Close") + GUISetOnEvent($GUI_EVENT_CLOSE, '_ExportCsvDataGui_Close') +EndFunc ;==>_ExportCsvDataGui + +Func _ExportCsvDataGui_Ok() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportCsvDataGui_Ok()') ;#Debug Display + $filename = GUICtrlRead($Gui_CsvFile) + If GUICtrlRead($Gui_CsvRadSummary) = 1 Then + $CsvDetailed = 0 + Else + $CsvDetailed = 1 + EndIf + If GUICtrlRead($Gui_CsvFiltered) = 1 Then + $CsvFiltered = 1 + Else + $CsvFiltered = 0 + EndIf + _ExportCsvDataGui_Close() + + If StringInStr($filename, '.csv') = 0 Then $filename = $filename & '.csv' + $saved = _ExportToCSV($filename, $CsvFiltered, $CsvDetailed) + If $saved = 1 Then + MsgBox(0, $Text_Done, $Text_SavedAs & ': "' & $filename & '"') + Else + MsgBox(0, $Text_Error, $Text_NoAps & ' ' & $Text_NoFileSaved) + EndIf + GUICtrlSetData($msgdisplay, '') + $newdata = 0 +EndFunc ;==>_ExportCsvDataGui_Ok + +Func _ExportCsvDataGui_SaveAs() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportCsvDataGui_SaveAs()') ;#Debug Display + $filename = FileSaveDialog($Text_SaveAsTXT, $SaveDir, 'CSV (*.csv)', '', GUICtrlRead($Gui_CsvFile)) + If @error <> 1 Then GUICtrlSetData($Gui_CsvFile, $filename) +EndFunc ;==>_ExportCsvDataGui_SaveAs + +Func _ExportCsvDataGui_Close() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportCsvDataGui_Close()') ;#Debug Display + GUIDelete($Gui_Csv) +EndFunc ;==>_ExportCsvDataGui_Close + +Func _ExportToCSV($savefile, $Filter = 0, $Detailed = 0) ;writes vistumbler data to a csv file + ConsoleWrite("$Filter:" & $Filter & ' - $Detailed:' & $Detailed & @CRLF) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportToCSV()') ;#Debug Display + If $Filter = 1 Then + $query = $AddQuery + Else + $query = "SELECT ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, HighSignal, HighRSSI, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active FROM AP" + EndIf + If $Detailed = 0 Then + $file = "SSID,BSSID,MANUFACTURER,HIGHEST SIGNAL W/GPS,AUTHENTICATION,ENCRYPTION,RADIO TYPE,CHANNEL,LATITUDE,LONGITUDE,BTX,OTX,FIRST SEEN(UTC),LAST SEEN(UTC),NETWORK TYPE,LABEL, HIGHEST SIGNAL, HIGHEST RSSI" & @CRLF + ElseIf $Detailed = 1 Then + $file = "SSID,BSSID,MANUFACTURER,SIGNAL,High Signal,RSSI,High RSSI,AUTHENTICATION,ENCRYPTION,RADIO TYPE,CHANNEL,BTX,OTX,NETWORK TYPE,LABEL,LATITUDE,LONGITUDE,SATELLITES,HDOP,ALTITUDE,HEIGHT OF GEOID,SPEED(km/h),SPEED(MPH),TRACK ANGLE,DATE(UTC),TIME(UTC)" & @CRLF + EndIf + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch > 0 Then + For $exp = 1 To $FoundApMatch + GUICtrlSetData($msgdisplay, $Text_SavingLine & ' ' & $exp & ' / ' & $FoundApMatch) + $ExpApID = $ApMatchArray[$exp][1] + $ExpSSID = $ApMatchArray[$exp][2] + $ExpBSSID = $ApMatchArray[$exp][3] + $ExpNET = $ApMatchArray[$exp][4] + $ExpRAD = $ApMatchArray[$exp][5] + $ExpCHAN = $ApMatchArray[$exp][6] + $ExpAUTH = $ApMatchArray[$exp][7] + $ExpENCR = $ApMatchArray[$exp][8] + $ExpSECTYPE = $ApMatchArray[$exp][9] + $ExpBTX = $ApMatchArray[$exp][10] + $ExpOTX = $ApMatchArray[$exp][11] + $ExpHighSig = $ApMatchArray[$exp][12] + $ExpHighRSSI = $ApMatchArray[$exp][13] + $ExpMANU = $ApMatchArray[$exp][14] + $ExpLAB = $ApMatchArray[$exp][15] + $ExpHighGpsID = $ApMatchArray[$exp][16] + $ExpFirstID = $ApMatchArray[$exp][17] + $ExpLastID = $ApMatchArray[$exp][18] + + If $Detailed = 0 Then + ;Get High GPS Signal + If $ExpHighGpsID = 0 Then + $ExpHighGpsSig = 0 + $ExpHighGpsLat = 'N 0000.0000' + $ExpHighGpsLon = 'E 0000.0000' + Else + $query = "SELECT Signal, GpsID FROM Hist WHERE HistID=" & $ExpHighGpsID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpHighGpsSig = $HistMatchArray[1][1] + $ExpHighGpsID = $HistMatchArray[1][2] + $query = "SELECT Latitude, Longitude FROM GPS WHERE GpsID=" & $ExpHighGpsID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpHighGpsLat = $GpsMatchArray[1][1] + $ExpHighGpsLon = $GpsMatchArray[1][2] + EndIf + ;Get First Found Time From FirstHistID + $query = "SELECT GpsID FROM Hist WHERE HistID=" & $ExpFirstID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpFirstGpsId = $HistMatchArray[1][1] + $query = "SELECT Date1, Time1 FROM GPS WHERE GpsID=" & $ExpFirstGpsId + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FirstDateTime = $GpsMatchArray[1][1] & ' ' & $GpsMatchArray[1][2] + ;Get Last Found Time From LastHistID + $query = "SELECT GpsID FROM Hist WHERE HistID=" & $ExpLastID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLastGpsID = $HistMatchArray[1][1] + $query = "SELECT Date1, Time1 FROM GPS WHERE GpsID=" & $ExpLastGpsID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $LastDateTime = $GpsMatchArray[1][1] & ' ' & $GpsMatchArray[1][2] + ;Write summary csv line + $file &= '"' & $ExpSSID & '",' & $ExpBSSID & ',"' & $ExpMANU & '",' & $ExpHighGpsSig & ',' & $ExpAUTH & ',' & $ExpENCR & ',' & $ExpRAD & ',' & $ExpCHAN & ',' & StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($ExpHighGpsLat), 'S', '-'), 'N', ''), ' ', '') & ',' & StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($ExpHighGpsLon), 'W', '-'), 'E', ''), ' ', '') & ',"' & $ExpBTX & '","' & $ExpOTX & '",' & $FirstDateTime & ',' & $LastDateTime & ',' & $ExpNET & ',"' & $ExpLAB & '",' & $ExpHighSig & ',' & $ExpHighRSSI & @CRLF + ElseIf $Detailed = 1 Then + ;Get All Signals and GpsIDs for current ApID + $query = "SELECT GpsID, Signal, RSSI FROM Hist WHERE ApID=" & $ExpApID & " And Signal<>0 ORDER BY Date1, Time1" + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundHistMatch = UBound($HistMatchArray) - 1 + For $exph = 1 To $FoundHistMatch + $ExpGID = $HistMatchArray[$exph][1] + $ExpSig = $HistMatchArray[$exph][2] + $ExpRSSI = $HistMatchArray[$exph][3] + ;Get GPS Data Based on GpsID + $query = "SELECT Latitude, Longitude, NumOfSats, HorDilPitch, Alt, Geo, SpeedInMPH, SpeedInKmH, TrackAngle, Date1, Time1 FROM GPS WHERE GpsID=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLat = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][1]), 'S', '-'), 'N', ''), ' ', '') + $ExpLon = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][2]), 'W', '-'), 'E', ''), ' ', '') + $ExpSat = $GpsMatchArray[1][3] + $ExpHorDilPitch = $GpsMatchArray[1][4] + $ExpAlt = $GpsMatchArray[1][5] + $ExpGeo = $GpsMatchArray[1][6] + $ExpSpeedMPH = $GpsMatchArray[1][7] + $ExpSpeedKmh = $GpsMatchArray[1][8] + $ExpTrack = $GpsMatchArray[1][9] + $ExpDate = $GpsMatchArray[1][10] + $ExpTime = $GpsMatchArray[1][11] + ;Write detailed csv line + $file &= '"' & $ExpSSID & '",' & $ExpBSSID & ',"' & $ExpMANU & '",' & $ExpSig & ',' & $ExpHighSig & ',' & $ExpRSSI & ',' & $ExpHighRSSI & ',' & $ExpAUTH & ',' & $ExpENCR & ',' & $ExpRAD & ',' & $ExpCHAN & ',"' & $ExpBTX & '","' & $ExpOTX & '",' & $ExpNET & ',"' & $ExpLAB & '",' & $ExpLat & ',' & $ExpLon & ',' & $ExpSat & ',' & $ExpHorDilPitch & ',' & $ExpAlt & ',' & $ExpGeo & ',' & $ExpSpeedKmh & ',' & $ExpSpeedMPH & ',' & $ExpTrack & ',' & $ExpDate & ',' & $ExpTime & @CRLF + Next + EndIf + Next + $savefile = FileOpen($savefile, 128 + 2) ;Open in UTF-8 write mode + FileWrite($savefile, $file) + FileClose($savefile) + Return (1) + Else + Return (0) + EndIf +EndFunc ;==>_ExportToCSV + +Func _SaveToGPX() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SaveToGPX()') ;#Debug Display + Opt("GUIOnEventMode", 0) + $ExportGPXGUI = GUICreate($Text_ExportToGPX, 263, 143) + GUISetBkColor($BackgroundColor) + $GUI_ExportGPX_MapOpen = GUICtrlCreateCheckbox($Text_MapOpenNetworks, 15, 15, 240, 15) + If $MapOpen = 1 Then GUICtrlSetState($GUI_ExportGPX_MapOpen, $GUI_CHECKED) + $GUI_ExportGPX_MapWEP = GUICtrlCreateCheckbox($Text_MapWepNetworks, 15, 35, 240, 15) + If $MapWEP = 1 Then GUICtrlSetState($GUI_ExportGPX_MapWEP, $GUI_CHECKED) + $GUI_ExportGPX_MapSec = GUICtrlCreateCheckbox($Text_MapSecureNetworks, 15, 55, 240, 15) + If $MapSec = 1 Then GUICtrlSetState($GUI_ExportGPX_MapSec, $GUI_CHECKED) + $GUI_ExportGPX_DrawTrack = GUICtrlCreateCheckbox($Text_DrawTrack, 15, 75, 240, 15) + If $ShowTrack = 1 Then GUICtrlSetState($GUI_ExportGPX_DrawTrack, $GUI_CHECKED) + $GUI_ExportGPX_OK = GUICtrlCreateButton($Text_Ok, 40, 115, 81, 25, 0) + $GUI_ExportGPX_Cancel = GUICtrlCreateButton($Text_Cancel, 139, 115, 81, 25, 0) + GUISetState(@SW_SHOW) + + While 1 + $nMsg = GUIGetMsg() + Switch $nMsg + Case $GUI_EVENT_CLOSE + GUIDelete($ExportGPXGUI) + ExitLoop + Case $GUI_ExportGPX_Cancel + GUIDelete($ExportGPXGUI) + ExitLoop + Case $GUI_ExportGPX_OK + If GUICtrlRead($GUI_ExportGPX_MapOpen) = 1 Then + $MapOpen = 1 + Else + $MapOpen = 0 + EndIf + If GUICtrlRead($GUI_ExportGPX_MapWEP) = 1 Then + $MapWEP = 1 + Else + $MapWEP = 0 + EndIf + If GUICtrlRead($GUI_ExportGPX_MapSec) = 1 Then + $MapSec = 1 + Else + $MapSec = 0 + EndIf + If GUICtrlRead($GUI_ExportGPX_DrawTrack) = 1 Then + $ShowTrack = 1 + Else + $ShowTrack = 0 + EndIf + GUIDelete($ExportGPXGUI) + DirCreate($SaveDir) + $filename = FileSaveDialog("Garmin Output File", $SaveDir, 'GPS eXchange Format (*.gpx)', '', $ldatetimestamp & '.gpx') + If Not @error Then + If StringInStr($filename, '.gpx') = 0 Then $filename = $filename & '.gpx' + $saved = _SaveGarminGPX($filename, $MapOpen, $MapWEP, $MapSec, $ShowTrack) + If $saved = 1 Then + MsgBox(0, $Text_Done, $Text_SavedAs & ': "' & $filename & '"') + Else + MsgBox(0, $Text_Done, $Text_NoApsWithGps & ' ' & $Text_NoFileSaved) + EndIf + EndIf + ExitLoop + EndSwitch + WEnd + Opt("GUIOnEventMode", 1) +EndFunc ;==>_SaveToGPX + +Func _SaveGarminGPX($savefile, $MapOpenAPs = 1, $MapWepAps = 1, $MapSecAps = 1, $GpsTrack = 0, $Sanitize = 1) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SaveGarminGPX()') ;#Debug Display + $FoundApWithGps = 0 + + $file = '' & @CRLF _ + & '' & @CRLF + If $MapOpenAPs = 1 Then + $query = "SELECT SSID, BSSID, HighGpsHistId FROM AP WHERE SECTYPE=1 And HighGpsHistId<>0" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch <> 0 Then + $FoundApWithGps = 1 + For $exp = 1 To $FoundApMatch + GUICtrlSetData($msgdisplay, 'Saving Open AP ' & $exp & '/' & $FoundApMatch) + $ExpSSID = $ApMatchArray[$exp][1] + If $Sanitize = 1 Then $ExpSSID = StringReplace(StringReplace(StringReplace($ExpSSID, '&', ''), '>', ''), '<', '') + $ExpBSSID = $ApMatchArray[$exp][2] + $ExpHighGpsHistID = $ApMatchArray[$exp][3] + ;Get Gps ID of HighGpsHistId + $query = "SELECT GpsID FROM Hist Where HistID=" & $ExpHighGpsHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpGID = $HistMatchArray[1][1] + ;Get Latitude and Longitude + $query = "SELECT Latitude, Longitude, Alt, Date1, Time1 FROM GPS WHERE GpsId=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLat = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][1]), 'S', '-'), 'N', ''), ' ', '') + $ExpLon = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][2]), 'W', '-'), 'E', ''), ' ', '') + $ExpAlt = _MetersToFeet($GpsMatchArray[1][3]) + $ExpDate = $GpsMatchArray[1][4] + $ExpTime = $GpsMatchArray[1][5] + + If $ExpLat <> 'N 0.0000000' And $ExpLon <> 'E 0.0000000' Then + $file &= '' & @CRLF _ + & '' & $ExpAlt & '' & @CRLF _ + & '' & @CRLF _ + & '' & $ExpSSID & '' & @CRLF _ + & '' & $ExpBSSID & '' & @CRLF _ + & '' & $ExpBSSID & '' & @CRLF _ + & 'Navaid, Green' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF _ + & 'SymbolAndName' & @CRLF _ + & '' & @CRLF _ + & 'Category 1' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF & @CRLF + EndIf + Next + EndIf + EndIf + If $MapWepAps = 1 Then + $query = "SELECT SSID, BSSID, HighGpsHistId FROM AP WHERE SECTYPE=2 And HighGpsHistId<>0" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch <> 0 Then + $FoundApWithGps = 1 + For $exp = 1 To $FoundApMatch + GUICtrlSetData($msgdisplay, 'Saving WEP AP ' & $exp & '/' & $FoundApMatch) + $ExpSSID = $ApMatchArray[$exp][1] + If $Sanitize = 1 Then $ExpSSID = StringReplace(StringReplace(StringReplace($ExpSSID, '&', ''), '>', ''), '<', '') + $ExpBSSID = $ApMatchArray[$exp][2] + $ExpHighGpsHistID = $ApMatchArray[$exp][3] + + ;Get Gps ID of HighGpsHistId + $query = "SELECT GpsID FROM Hist Where HistID=" & $ExpHighGpsHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpGID = $HistMatchArray[1][1] + ;Get Latitude and Longitude + $query = "SELECT Latitude, Longitude, Alt, Date1, Time1 FROM GPS WHERE GpsId=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLat = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][1]), 'S', '-'), 'N', ''), ' ', '') + $ExpLon = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][2]), 'W', '-'), 'E', ''), ' ', '') + $ExpAlt = _MetersToFeet($GpsMatchArray[1][3]) + $ExpDate = $GpsMatchArray[1][4] + $ExpTime = $GpsMatchArray[1][5] + + If $ExpLat <> 'N 0.0000000' And $ExpLon <> 'E 0.0000000' Then + $file &= '' & @CRLF _ + & '' & $ExpAlt & '' & @CRLF _ + & '' & @CRLF _ + & '' & $ExpSSID & '' & @CRLF _ + & '' & $ExpBSSID & '' & @CRLF _ + & '' & $ExpBSSID & '' & @CRLF _ + & 'Navaid, Amber' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF _ + & 'SymbolAndName' & @CRLF _ + & '' & @CRLF _ + & 'Category 2' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF & @CRLF + EndIf + Next + EndIf + EndIf + If $MapSecAps = 1 Then + $query = "SELECT SSID, BSSID, HighGpsHistId FROM AP WHERE SECTYPE=3 And HighGpsHistId<>0" + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch <> 0 Then + $FoundApWithGps = 1 + For $exp = 1 To $FoundApMatch + GUICtrlSetData($msgdisplay, 'Saving Secure AP ' & $exp & '/' & $FoundApMatch) + $ExpSSID = $ApMatchArray[$exp][1] + If $Sanitize = 1 Then $ExpSSID = StringReplace(StringReplace(StringReplace($ExpSSID, '&', ''), '>', ''), '<', '') + $ExpBSSID = $ApMatchArray[$exp][2] + $ExpHighGpsHistID = $ApMatchArray[$exp][3] + + ;Get Gps ID of HighGpsHistId + $query = "SELECT GpsID FROM Hist Where HistID=" & $ExpHighGpsHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpGID = $HistMatchArray[1][1] + ;Get Latitude and Longitude + $query = "SELECT Latitude, Longitude, Alt, Date1, Time1 FROM GPS WHERE GpsId=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLat = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][1]), 'S', '-'), 'N', ''), ' ', '') + $ExpLon = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][2]), 'W', '-'), 'E', ''), ' ', '') + $ExpAlt = _MetersToFeet($GpsMatchArray[1][3]) + $ExpDate = $GpsMatchArray[1][4] + $ExpTime = $GpsMatchArray[1][5] + + If $ExpLat <> 'N 0.0000000' And $ExpLon <> 'E 0.0000000' Then + $file &= '' & @CRLF _ + & '' & $ExpAlt & '' & @CRLF _ + & '' & @CRLF _ + & '' & $ExpSSID & '' & @CRLF _ + & '' & $ExpBSSID & '' & @CRLF _ + & '' & $ExpBSSID & '' & @CRLF _ + & 'Navaid, Red' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF _ + & 'SymbolAndName' & @CRLF _ + & '' & @CRLF _ + & 'Category 3' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF & @CRLF + EndIf + Next + EndIf + EndIf + + If $GpsTrack = 1 Then + $query = "SELECT Latitude, Longitude, Alt, Date1, Time1, SpeedInKmH FROM GPS WHERE Latitude <> 'N 0000.0000' And Longitude <> 'E 0000.0000' ORDER BY Date1, Time1" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch <> 0 Then + $file &= '' & @CRLF _ + & 'GPS Track' & @CRLF _ + & '' & @CRLF + For $exp = 1 To $FoundGpsMatch + GUICtrlSetData($msgdisplay, 'Saving Gps Position ' & $exp & '/' & $FoundGpsMatch) + $ExpLat = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[$exp][1]), 'S', '-'), 'N', ''), ' ', '') + $ExpLon = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[$exp][2]), 'W', '-'), 'E', ''), ' ', '') + $ExpAlt = _MetersToFeet($GpsMatchArray[$exp][3]) + $ExpDate = $GpsMatchArray[$exp][4] + $ExpTime = $GpsMatchArray[$exp][5] + $ExpSpeedKmh = $GpsMatchArray[$exp][6] + If $ExpLat <> 'N 0.0000000' And $ExpLon <> 'E 0.0000000' Then + $FoundApWithGps = 1 + $file &= '' & @CRLF _ + & '' & $ExpAlt & '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF + EndIf + Next + $file &= '' & @CRLF _ + & '' & @CRLF + EndIf + EndIf + $file &= '' & @CRLF + + If $FoundApWithGps = 1 Then + $savefile = FileOpen($savefile, 128 + 2) ;Open in UTF-8 write mode + FileWrite($savefile, $file) + FileClose($savefile) + Return (1) + Else + Return (0) + EndIf + ;EndIf +EndFunc ;==>_SaveGarminGPX + +Func _WriteINI() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_WriteINI()') ;#Debug Display + ;write ini settings + If $SaveDir <> $DefaultSaveDir Then + IniWrite($settings, "Vistumbler", "SaveDir", $SaveDir) ;Write new save dir ro ini + Else + IniDelete($settings, "Vistumbler", "SaveDir") ;delete entry from the ini file + EndIf + If $SaveDirAuto <> $DefaultSaveDir Then + IniWrite($settings, "Vistumbler", "SaveDirAuto", $SaveDirAuto) ;Write new auto save dir ro ini + Else + IniDelete($settings, "Vistumbler", "SaveDirAuto") ;delete entry from the ini file + EndIf + If $SaveDirAutoRecovery <> $DefaultSaveDir Then + IniWrite($settings, "Vistumbler", "SaveDirAutoRecovery", $SaveDirAutoRecovery) ;Write new auto save dir ro ini + Else + IniDelete($settings, "Vistumbler", "SaveDirAutoRecovery") ;delete entry from the ini file + EndIf + If $SaveDirKml <> $DefaultSaveDir Then + IniWrite($settings, "Vistumbler", "SaveDirKml", $SaveDirKml) ;Write new save kml dir ro ini + Else + IniDelete($settings, "Vistumbler", "SaveDirKml") ;delete entry from the ini file + EndIf + IniWrite($settings, "Vistumbler", "Netsh_exe", $netsh) + IniWrite($settings, "Vistumbler", 'PortableMode', $PortableMode) + IniWrite($settings, "Vistumbler", "UseNativeWifi", $UseNativeWifi) + IniWrite($settings, "Vistumbler", "AutoCheckForUpdates", $AutoCheckForUpdates) + IniWrite($settings, "Vistumbler", "CheckForBetaUpdates", $CheckForBetaUpdates) + IniWrite($settings, "Vistumbler", "DefaultApapter", $DefaultApapter) + IniWrite($settings, "Vistumbler", "TextSize", $TextSize) + IniWrite($settings, "Vistumbler", "TextColor", $TextColor) + IniWrite($settings, "Vistumbler", "BackgroundColor", $BackgroundColor) + IniWrite($settings, "Vistumbler", "ControlBackgroundColor", $ControlBackgroundColor) + IniWrite($settings, "Vistumbler", "ButtonActiveColor", $ButtonActiveColor) + IniWrite($settings, "Vistumbler", "ButtonInactiveColor", $ButtonInactiveColor) + IniWrite($settings, "Vistumbler", "SplitPercent", $SplitPercent) + IniWrite($settings, "Vistumbler", "SplitHeightPercent", $SplitHeightPercent) + IniWrite($settings, "Vistumbler", "Sleeptime", $RefreshLoopTime) + IniWrite($settings, "Vistumbler", "NewApPosistion", $AddDirection) + IniWrite($settings, "Vistumbler", "Language", $DefaultLanguage) + IniWrite($settings, "Vistumbler", "LanguageFile", $DefaultLanguageFile) + IniWrite($settings, "Vistumbler", "AutoRefreshNetworks", $RefreshNetworks) + IniWrite($settings, "Vistumbler", "AutoRefreshTime", $RefreshTime) + IniWrite($settings, 'Vistumbler', 'Debug', $Debug) + IniWrite($settings, 'Vistumbler', 'DebugCom', $DebugCom) + IniWrite($settings, 'Vistumbler', 'GraphDeadTime', $GraphDeadTime) + IniWrite($settings, 'Vistumbler', 'UseRssiInGraphs', $UseRssiInGraphs) + IniWrite($settings, "Vistumbler", 'SaveGpsWithNoAps', $SaveGpsWithNoAps) + IniWrite($settings, "Vistumbler", 'TimeBeforeMarkedDead', $TimeBeforeMarkedDead) + IniWrite($settings, "Vistumbler", 'AutoSelect', $AutoSelect) + IniWrite($settings, "Vistumbler", 'AutoSelectHS', $AutoSelectHS) + IniWrite($settings, "Vistumbler", 'DefFiltID', $DefFiltID) + IniWrite($settings, "Vistumbler", 'AutoScan', $AutoScan) + IniWrite($settings, "Vistumbler", 'dBmMaxSignal', $dBmMaxSignal) + IniWrite($settings, "Vistumbler", 'dBmDissociationSignal', $dBmDissociationSignal) + IniWrite($settings, "Vistumbler", 'MinimalGuiMode', $MinimalGuiMode) + IniWrite($settings, "Vistumbler", 'MinimalGuiExitHeight', $MinimalGuiExitHeight) + IniWrite($settings, "Vistumbler", 'BatchListviewInsert', $BatchListviewInsert) + IniWrite($settings, "Vistumbler", 'AutoScrollToBottom', $AutoScrollToBottom) + + IniWrite($settings, 'WindowPositions', 'VistumblerState', $VistumblerState) + IniWrite($settings, 'WindowPositions', 'VistumblerPosition', $VistumblerPosition) + IniWrite($settings, 'WindowPositions', 'CompassPosition', $CompassPosition) + IniWrite($settings, 'WindowPositions', 'GpsDetailsPosition', $GpsDetailsPosition) + IniWrite($settings, 'WindowPositions', '2400ChanGraphPos', $2400ChanGraphPos) + IniWrite($settings, 'WindowPositions', '5000ChanGraphPos', $5000ChanGraphPos) + + IniWrite($settings, "DateFormat", "DateFormat", $DateFormat) + + IniWrite($settings, 'GpsSettings', 'ComPort', $ComPort) + IniWrite($settings, 'GpsSettings', 'Baud', $BAUD) + IniWrite($settings, 'GpsSettings', 'Parity', $PARITY) + IniWrite($settings, 'GpsSettings', 'DataBit', $DATABIT) + IniWrite($settings, 'GpsSettings', 'StopBit', $STOPBIT) + IniWrite($settings, 'GpsSettings', 'GpsType', $GpsType) + IniWrite($settings, 'GpsSettings', 'GPSformat', $GPSformat) + IniWrite($settings, 'GpsSettings', 'GpsTimeout', $GpsTimeout) + IniWrite($settings, 'GpsSettings', 'GpsDisconnect', $GpsDisconnect) + IniWrite($settings, 'GpsSettings', 'GpsReset', $GpsReset) + + IniWrite($settings, "AutoSort", "AutoSortTime", $SortTime) + IniWrite($settings, "AutoSort", "AutoSort", $AutoSort) + IniWrite($settings, "AutoSort", "SortCombo", $SortBy) + IniWrite($settings, "AutoSort", "AscDecDefault", $SortDirection) + + IniWrite($settings, "AutoRecovery", "AutoRecovery", $AutoRecoveryVS1) + IniWrite($settings, "AutoRecovery", "AutoRecoveryDel", $AutoRecoveryVS1Del) + IniWrite($settings, "AutoRecovery", "AutoSaveTime", $AutoRecoveryTime) + + IniWrite($settings, "AutoSaveAndClear", "AutoSaveAndClear", $AutoSaveAndClear) + IniWrite($settings, "AutoSaveAndClear", "AutoSaveAndClearPlaySound", $AutoSaveAndClearPlaySound) + IniWrite($settings, "AutoSaveAndClear", "AutoSaveAndClearOnTime", $AutoSaveAndClearOnTime) + IniWrite($settings, "AutoSaveAndClear", "AutoSaveAndClearTime", $AutoSaveAndClearTime) + IniWrite($settings, "AutoSaveAndClear", "AutoSaveAndClearOnAPs", $AutoSaveAndClearOnAPs) + IniWrite($settings, "AutoSaveAndClear", "AutoSaveAndClearAPs", $AutoSaveAndClearAPs) + + IniWrite($settings, "Sound", 'PlaySoundOnNewGps', $SoundOnGps) + IniWrite($settings, "Sound", 'PlaySoundOnNewAP', $SoundOnAP) + IniWrite($settings, "Sound", 'SoundPerAP', $SoundPerAP) + IniWrite($settings, "Sound", 'NewSoundSigBased', $NewSoundSigBased) + IniWrite($settings, "Sound", "NewAP_Sound", $new_AP_sound) + IniWrite($settings, "Sound", "NewGPS_Sound", $new_GPS_sound) + IniWrite($settings, "Sound", "AutoSave_Sound", $AutoSave_sound) + IniWrite($settings, "Sound", "Error_Sound", $ErrorFlag_sound) + + IniWrite($settings, "MIDI", 'SpeakSignal', $SpeakSignal) + IniWrite($settings, "MIDI", 'SpeakSigSayPecent', $SpeakSigSayPecent) + IniWrite($settings, "MIDI", 'SpeakSigTime', $SpeakSigTime) + IniWrite($settings, "MIDI", 'SpeakType', $SpeakType) + IniWrite($settings, "MIDI", 'Midi_Instument', $Midi_Instument) + IniWrite($settings, "MIDI", 'Midi_PlayTime', $Midi_PlayTime) + IniWrite($settings, "MIDI", 'Midi_PlayForActiveAps', $Midi_PlayForActiveAps) + + IniWrite($settings, 'Cam', 'CamTriggerScript', $CamTriggerScript) + IniWrite($settings, 'Cam', 'CamTriggerTime', $CamTriggerTime) + IniWrite($settings, 'Cam', 'DownloadImages', $DownloadImages) + IniWrite($settings, 'Cam', 'DownloadImagesTime', $DownloadImagesTime) + + IniWrite($settings, 'AutoKML', 'AutoKML', $AutoKML) + IniWrite($settings, 'AutoKML', 'AutoKML_Alt', $AutoKML_Alt) + IniWrite($settings, 'AutoKML', 'AutoKML_AltMode', $AutoKML_AltMode) + IniWrite($settings, 'AutoKML', 'AutoKML_Heading', $AutoKML_Heading) + IniWrite($settings, 'AutoKML', 'AutoKML_Range', $AutoKML_Range) + IniWrite($settings, 'AutoKML', 'AutoKML_Tilt', $AutoKML_Tilt) + IniWrite($settings, 'AutoKML', 'AutoKmlActiveTime', $AutoKmlActiveTime) + IniWrite($settings, 'AutoKML', 'AutoKmlDeadTime', $AutoKmlDeadTime) + IniWrite($settings, 'AutoKML', 'AutoKmlGpsTime', $AutoKmlGpsTime) + IniWrite($settings, 'AutoKML', 'AutoKmlTrackTime', $AutoKmlTrackTime) + IniWrite($settings, 'AutoKML', 'KmlFlyTo', $KmlFlyTo) + IniWrite($settings, 'AutoKML', 'OpenKmlNetLink', $OpenKmlNetLink) + If $GoogleEarthExe <> $defaultgooglepath Then IniWrite($settings, 'AutoKML', 'GoogleEarthExe', $GoogleEarthExe) + + IniWrite($settings, 'KmlSettings', 'MapPos', $MapPos) + IniWrite($settings, 'KmlSettings', 'MapSig', $MapSig) + IniWrite($settings, 'KmlSettings', 'MapSigUseRSSI', $MapSigUseRSSI) + IniWrite($settings, 'KmlSettings', 'MapSigType', $MapSigType) + IniWrite($settings, 'KmlSettings', 'MapRange', $MapRange) + IniWrite($settings, 'KmlSettings', 'ShowTrack', $ShowTrack) + IniWrite($settings, "KmlSettings", 'MapOpen', $MapOpen) + IniWrite($settings, 'KmlSettings', 'MapWEP', $MapWEP) + IniWrite($settings, 'KmlSettings', 'MapSec', $MapSec) + IniWrite($settings, 'KmlSettings', 'UseLocalKmlImagesOnExport', $UseLocalKmlImagesOnExport) + IniWrite($settings, 'KmlSettings', 'SigMapTimeBeforeMarkedDead', $SigMapTimeBeforeMarkedDead) + IniWrite($settings, 'KmlSettings', 'TrackColor', $TrackColor) + IniWrite($settings, 'KmlSettings', 'CirSigMapColor', $CirSigMapColor) + IniWrite($settings, 'KmlSettings', 'CirRangeMapColor', $CirRangeMapColor) + + IniWrite($settings, 'WifiDbWifiTools', 'WifiDb_User', $WifiDb_User) + IniWrite($settings, 'WifiDbWifiTools', 'WifiDb_ApiKey', $WifiDb_ApiKey) + IniWrite($settings, 'WifiDbWifiTools', 'WifiDb_OtherUsers', $WifiDb_OtherUsers) + IniWrite($settings, 'WifiDbWifiTools', 'WifiDb_UploadType', $WifiDb_UploadType) + IniWrite($settings, 'WifiDbWifiTools', 'WifiDb_UploadFiltered', $WifiDb_UploadFiltered) + IniWrite($settings, 'WifiDbWifiTools', 'WifiDb_GRAPH_URL', $WifiDbGraphURL) + IniWrite($settings, 'WifiDbWifiTools', 'WiFiDB_URL', $WifiDbWdbURL) + IniWrite($settings, 'WifiDbWifiTools', 'WifiDB_API_URL', $WifiDbApiURL) + IniWrite($settings, "WifiDbWifiTools", 'UseWiFiDbGpsLocate', $UseWiFiDbGpsLocate) + IniWrite($settings, 'WifiDbWifiTools', 'AutoUpApsToWifiDB', $AutoUpApsToWifiDB) + IniWrite($settings, 'WifiDbWifiTools', 'AutoUpApsToWifiDBTime', $AutoUpApsToWifiDBTime) + IniWrite($settings, "WifiDbWifiTools", "WiFiDbLocateRefreshTime", $WiFiDbLocateRefreshTime) + + If $VistumblerGuiOpen = 1 Then + ;Get Current column positions + $currentcolumn = StringSplit(_GUICtrlListView_GetColumnOrder($ListviewAPs), '|') + For $c = 1 To $currentcolumn[0] + If $column_Line = $currentcolumn[$c] Then $save_column_Line = $c - 1 + If $column_Active = $currentcolumn[$c] Then $save_column_Active = $c - 1 + If $column_BSSID = $currentcolumn[$c] Then $save_column_BSSID = $c - 1 + If $column_SSID = $currentcolumn[$c] Then $save_column_SSID = $c - 1 + If $column_Signal = $currentcolumn[$c] Then $save_column_Signal = $c - 1 + If $column_HighSignal = $currentcolumn[$c] Then $save_column_HighSignal = $c - 1 + If $column_RSSI = $currentcolumn[$c] Then $save_column_RSSI = $c - 1 + If $column_HighRSSI = $currentcolumn[$c] Then $save_column_HighRSSI = $c - 1 + If $column_Channel = $currentcolumn[$c] Then $save_column_Channel = $c - 1 + If $column_Authentication = $currentcolumn[$c] Then $save_column_Authentication = $c - 1 + If $column_Encryption = $currentcolumn[$c] Then $save_column_Encryption = $c - 1 + If $column_NetworkType = $currentcolumn[$c] Then $save_column_NetworkType = $c - 1 + If $column_Latitude = $currentcolumn[$c] Then $save_column_Latitude = $c - 1 + If $column_Longitude = $currentcolumn[$c] Then $save_column_Longitude = $c - 1 + If $column_MANUF = $currentcolumn[$c] Then $save_column_MANUF = $c - 1 + If $column_Label = $currentcolumn[$c] Then $save_column_Label = $c - 1 + If $column_RadioType = $currentcolumn[$c] Then $save_column_RadioType = $c - 1 + If $column_LatitudeDMS = $currentcolumn[$c] Then $save_column_LatitudeDMS = $c - 1 + If $column_LongitudeDMS = $currentcolumn[$c] Then $save_column_LongitudeDMS = $c - 1 + If $column_LatitudeDMM = $currentcolumn[$c] Then $save_column_LatitudeDMM = $c - 1 + If $column_LongitudeDMM = $currentcolumn[$c] Then $save_column_LongitudeDMM = $c - 1 + If $column_BasicTransferRates = $currentcolumn[$c] Then $save_column_BasicTransferRates = $c - 1 + If $column_OtherTransferRates = $currentcolumn[$c] Then $save_column_OtherTransferRates = $c - 1 + If $column_FirstActive = $currentcolumn[$c] Then $save_column_FirstActive = $c - 1 + If $column_LastActive = $currentcolumn[$c] Then $save_column_LastActive = $c - 1 + Next + + IniWrite($settings, "Columns", "Column_Line", $save_column_Line) + IniWrite($settings, "Columns", "Column_Active", $save_column_Active) + IniWrite($settings, "Columns", "Column_BSSID", $save_column_BSSID) + IniWrite($settings, "Columns", "Column_SSID", $save_column_SSID) + IniWrite($settings, "Columns", "Column_Signal", $save_column_Signal) + IniWrite($settings, "Columns", "Column_HighSignal", $save_column_HighSignal) + IniWrite($settings, "Columns", "Column_RSSI", $save_column_RSSI) + IniWrite($settings, "Columns", "Column_HighRSSI", $save_column_HighRSSI) + IniWrite($settings, "Columns", "Column_Channel", $save_column_Channel) + IniWrite($settings, "Columns", "Column_Authentication", $save_column_Authentication) + IniWrite($settings, "Columns", "Column_Encryption", $save_column_Encryption) + IniWrite($settings, "Columns", "Column_NetworkType", $save_column_NetworkType) + IniWrite($settings, "Columns", "Column_Latitude", $save_column_Latitude) + IniWrite($settings, "Columns", "Column_Longitude", $save_column_Longitude) + IniWrite($settings, "Columns", "Column_Manufacturer", $save_column_MANUF) + IniWrite($settings, "Columns", "Column_Label", $save_column_Label) + IniWrite($settings, "Columns", "Column_RadioType", $save_column_RadioType) + IniWrite($settings, "Columns", "Column_LatitudeDMS", $save_column_LatitudeDMS) + IniWrite($settings, "Columns", "Column_LongitudeDMS", $save_column_LongitudeDMS) + IniWrite($settings, "Columns", "Column_LatitudeDMM", $save_column_LatitudeDMM) + IniWrite($settings, "Columns", "Column_LongitudeDMM", $save_column_LongitudeDMM) + IniWrite($settings, "Columns", "Column_BasicTransferRates", $save_column_BasicTransferRates) + IniWrite($settings, "Columns", "Column_OtherTransferRates", $column_OtherTransferRates) + IniWrite($settings, "Columns", "Column_FirstActive", $save_column_FirstActive) + IniWrite($settings, "Columns", "Column_LastActive", $save_column_LastActive) + + IniWrite($settings, "Column_Width", "Column_Line", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Line - 0)) + IniWrite($settings, "Column_Width", "Column_Active", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Active - 0)) + IniWrite($settings, "Column_Width", "Column_BSSID", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_BSSID - 0)) + IniWrite($settings, "Column_Width", "Column_SSID", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_SSID - 0)) + IniWrite($settings, "Column_Width", "Column_Signal", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Signal - 0)) + IniWrite($settings, "Column_Width", "Column_HighSignal", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_HighSignal - 0)) + IniWrite($settings, "Column_Width", "Column_RSSI", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_RSSI - 0)) + IniWrite($settings, "Column_Width", "Column_HighRSSI", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_HighRSSI - 0)) + IniWrite($settings, "Column_Width", "Column_Channel", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Channel - 0)) + IniWrite($settings, "Column_Width", "Column_Authentication", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Authentication - 0)) + IniWrite($settings, "Column_Width", "Column_Encryption", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Encryption - 0)) + IniWrite($settings, "Column_Width", "Column_NetworkType", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_NetworkType - 0)) + IniWrite($settings, "Column_Width", "Column_Latitude", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Latitude - 0)) + IniWrite($settings, "Column_Width", "Column_Longitude", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Longitude - 0)) + IniWrite($settings, "Column_Width", "Column_Manufacturer", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_MANUF - 0)) + IniWrite($settings, "Column_Width", "Column_Label", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_Label - 0)) + IniWrite($settings, "Column_Width", "Column_RadioType", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_RadioType - 0)) + IniWrite($settings, "Column_Width", "Column_LatitudeDMS", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_LatitudeDMS - 0)) + IniWrite($settings, "Column_Width", "Column_LongitudeDMS", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_LongitudeDMS - 0)) + IniWrite($settings, "Column_Width", "Column_LatitudeDMM", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_LatitudeDMM - 0)) + IniWrite($settings, "Column_Width", "Column_LongitudeDMM", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_LongitudeDMM - 0)) + IniWrite($settings, "Column_Width", "Column_BasicTransferRates", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_BasicTransferRates - 0)) + IniWrite($settings, "Column_Width", "Column_OtherTransferRates", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_OtherTransferRates - 0)) + IniWrite($settings, "Column_Width", "Column_FirstActive", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_FirstActive - 0)) + IniWrite($settings, "Column_Width", "Column_LastActive", _GUICtrlListView_GetColumnWidth($ListviewAPs, $column_LastActive - 0)) + EndIf + + ;//Write Changes to Language File + IniWrite($DefaultLanguagePath, "Column_Names", "Column_Line", $Column_Names_Line) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_Active", $Column_Names_Active) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_SSID", $Column_Names_SSID) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_BSSID", $Column_Names_BSSID) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_Manufacturer", $Column_Names_MANUF) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_Signal", $Column_Names_Signal) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_HighSignal", $Column_Names_HighSignal) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_RSSI", $Column_Names_RSSI) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_HighRSSI", $Column_Names_HighRSSI) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_Authentication", $Column_Names_Authentication) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_Encryption", $Column_Names_Encryption) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_RadioType", $Column_Names_RadioType) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_Channel", $Column_Names_Channel) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_Latitude", $Column_Names_Latitude) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_Longitude", $Column_Names_Longitude) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_LatitudeDMS", $Column_Names_LatitudeDMS) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_LongitudeDMS", $Column_Names_LongitudeDMS) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_LatitudeDMM", $Column_Names_LatitudeDMM) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_LongitudeDMM", $Column_Names_LongitudeDMM) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_BasicTransferRates", $Column_Names_BasicTransferRates) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_OtherTransferRates", $Column_Names_OtherTransferRates) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_FirstActive", $Column_Names_FirstActive) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_LastActive", $Column_Names_LastActive) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_NetworkType", $Column_Names_NetworkType) + IniWrite($DefaultLanguagePath, "Column_Names", "Column_Label", $Column_Names_Label) + + IniWrite($DefaultLanguagePath, "SearchWords", "SSID", $SearchWord_SSID) + IniWrite($DefaultLanguagePath, "SearchWords", "BSSID", $SearchWord_BSSID) + IniWrite($DefaultLanguagePath, "SearchWords", "NetworkType", $SearchWord_NetworkType) + IniWrite($DefaultLanguagePath, "SearchWords", "Authentication", $SearchWord_Authentication) + IniWrite($DefaultLanguagePath, "SearchWords", "Encryption", $SearchWord_Encryption) + IniWrite($DefaultLanguagePath, "SearchWords", "Signal", $SearchWord_Signal) + IniWrite($DefaultLanguagePath, "SearchWords", "RSSI", $SearchWord_RSSI) + IniWrite($DefaultLanguagePath, "SearchWords", "RadioType", $SearchWord_RadioType) + IniWrite($DefaultLanguagePath, "SearchWords", "Channel", $SearchWord_Channel) + IniWrite($DefaultLanguagePath, "SearchWords", "BasicRates", $SearchWord_BasicRates) + IniWrite($DefaultLanguagePath, "SearchWords", "OtherRates", $SearchWord_OtherRates) + IniWrite($DefaultLanguagePath, "SearchWords", "Open", $SearchWord_Open) + IniWrite($DefaultLanguagePath, "SearchWords", "None", $SearchWord_None) + IniWrite($DefaultLanguagePath, "SearchWords", "WEP", $SearchWord_Wep) + IniWrite($DefaultLanguagePath, "SearchWords", "Infrastructure", $SearchWord_Infrastructure) + IniWrite($DefaultLanguagePath, "SearchWords", "Adhoc", $SearchWord_Adhoc) + IniWrite($DefaultLanguagePath, "SearchWords", "Cipher", $SearchWord_Cipher) + + IniWrite($DefaultLanguagePath, "GuiText", "Ok", $Text_Ok) + IniWrite($DefaultLanguagePath, "GuiText", "Cancel", $Text_Cancel) + IniWrite($DefaultLanguagePath, "GuiText", "Apply", $Text_Apply) + IniWrite($DefaultLanguagePath, "GuiText", "Browse", $Text_Browse) + IniWrite($DefaultLanguagePath, "GuiText", "File", $Text_File) + IniWrite($DefaultLanguagePath, "GuiText", "Import", $Text_Import) + IniWrite($DefaultLanguagePath, "GuiText", "SaveAsTXT", $Text_SaveAsTXT) + IniWrite($DefaultLanguagePath, "GuiText", "SaveAsVS1", $Text_SaveAsVS1) + IniWrite($DefaultLanguagePath, "GuiText", "SaveAsVSZ", $Text_SaveAsVSZ) + IniWrite($DefaultLanguagePath, "GuiText", "ImportFromTXT", $Text_ImportFromTXT) + IniWrite($DefaultLanguagePath, "GuiText", "ImportFromVSZ", $Text_ImportFromVSZ) + IniWrite($DefaultLanguagePath, "GuiText", "Exit", $Text_Exit) + IniWrite($DefaultLanguagePath, "GuiText", "ExitSaveDb", $Text_ExitSaveDb) + IniWrite($DefaultLanguagePath, "GuiText", "Edit", $Text_Edit) + IniWrite($DefaultLanguagePath, "GuiText", "ClearAll", $Text_ClearAll) + IniWrite($DefaultLanguagePath, "GuiText", "Cut", $Text_Cut) + IniWrite($DefaultLanguagePath, "GuiText", "Copy", $Text_Copy) + IniWrite($DefaultLanguagePath, "GuiText", "Paste", $Text_Paste) + IniWrite($DefaultLanguagePath, "GuiText", "Delete", $Text_Delete) + IniWrite($DefaultLanguagePath, "GuiText", "Select", $Text_Select) + IniWrite($DefaultLanguagePath, "GuiText", "SelectAll", $Text_SelectAll) + IniWrite($DefaultLanguagePath, "GuiText", "View", $Text_View) + IniWrite($DefaultLanguagePath, "GuiText", "Options", $Text_Options) + IniWrite($DefaultLanguagePath, "GuiText", "AutoSort", $Text_AutoSort) + IniWrite($DefaultLanguagePath, "GuiText", "SortTree", $Text_SortTree) + IniWrite($DefaultLanguagePath, "GuiText", "PlaySound", $Text_PlaySound) + IniWrite($DefaultLanguagePath, "GuiText", "PlayGpsSound", $Text_PlayGpsSound) + IniWrite($DefaultLanguagePath, "GuiText", "AddAPsToTop", $Text_AddAPsToTop) + IniWrite($DefaultLanguagePath, "GuiText", "Extra", $Text_Extra) + IniWrite($DefaultLanguagePath, "GuiText", "ScanAPs", $Text_ScanAPs) + IniWrite($DefaultLanguagePath, "GuiText", "StopScanAps", $Text_StopScanAps) + IniWrite($DefaultLanguagePath, "GuiText", "UseGPS", $Text_UseGPS) + IniWrite($DefaultLanguagePath, "GuiText", "StopGPS", $Text_StopGPS) + IniWrite($DefaultLanguagePath, "GuiText", "Settings", $Text_Settings) + IniWrite($DefaultLanguagePath, "GuiText", "MiscSettings", $Text_MiscSettings) + IniWrite($DefaultLanguagePath, "GuiText", "SaveSettings", $Text_SaveSettings) + IniWrite($DefaultLanguagePath, "GuiText", "GpsSettings", $Text_GpsSettings) + IniWrite($DefaultLanguagePath, "GuiText", "SetLanguage", $Text_SetLanguage) + IniWrite($DefaultLanguagePath, "GuiText", "SetSearchWords", $Text_SetSearchWords) + IniWrite($DefaultLanguagePath, "GuiText", "Export", $Text_Export) + IniWrite($DefaultLanguagePath, "GuiText", "ExportToKML", $Text_ExportToKML) + IniWrite($DefaultLanguagePath, "GuiText", "ExportToGPX", $Text_ExportToGPX) + IniWrite($DefaultLanguagePath, "GuiText", "ExportToTXT", $Text_ExportToTXT) + IniWrite($DefaultLanguagePath, "GuiText", "ExportToNS1", $Text_ExportToNS1) + IniWrite($DefaultLanguagePath, "GuiText", "ExportToVS1", $Text_ExportToVS1) + IniWrite($DefaultLanguagePath, "GuiText", "ExportToCSV", $Text_ExportToCSV) + IniWrite($DefaultLanguagePath, "GuiText", "ExportToVSZ", $Text_ExportToVSZ) + IniWrite($DefaultLanguagePath, "GuiText", "WifiDbPHPgraph", $Text_WifiDbPHPgraph) + IniWrite($DefaultLanguagePath, "GuiText", "WifiDbWDB", $Text_WifiDbWDB) + IniWrite($DefaultLanguagePath, "GuiText", "WifiDbWdbLocate", $Text_WifiDbWdbLocate) + IniWrite($DefaultLanguagePath, "GuiText", "UploadDataToWiFiDB", $Text_UploadDataToWifiDB) + IniWrite($DefaultLanguagePath, "GuiText", "RefreshLoopTime", $Text_RefreshLoopTime) + IniWrite($DefaultLanguagePath, "GuiText", "ActualLoopTime", $Text_ActualLoopTime) + IniWrite($DefaultLanguagePath, "GuiText", "Longitude", $Text_Longitude) + IniWrite($DefaultLanguagePath, "GuiText", "Latitude", $Text_Latitude) + IniWrite($DefaultLanguagePath, "GuiText", "ActiveAPs", $Text_ActiveAPs) + IniWrite($DefaultLanguagePath, "GuiText", "Graph", $Text_Graph) + IniWrite($DefaultLanguagePath, "GuiText", "Graph1", $Text_Graph1) + IniWrite($DefaultLanguagePath, "GuiText", "Graph2", $Text_Graph2) + IniWrite($DefaultLanguagePath, "GuiText", "NoGraph", $Text_NoGraph) + IniWrite($DefaultLanguagePath, 'GuiText', 'SetMacLabel', $Text_SetMacLabel) + IniWrite($DefaultLanguagePath, 'GuiText', 'SetMacManu', $Text_SetMacManu) + IniWrite($DefaultLanguagePath, 'GuiText', 'Active', $Text_Active) + IniWrite($DefaultLanguagePath, 'GuiText', 'Dead', $Text_Dead) + IniWrite($DefaultLanguagePath, 'GuiText', 'AddNewLabel', $Text_AddNewLabel) + IniWrite($DefaultLanguagePath, 'GuiText', 'RemoveLabel', $Text_RemoveLabel) + IniWrite($DefaultLanguagePath, 'GuiText', 'EditLabel', $Text_EditLabel) + IniWrite($DefaultLanguagePath, 'GuiText', 'AddNewMan', $Text_AddNewMan) + IniWrite($DefaultLanguagePath, 'GuiText', 'RemoveMan', $Text_RemoveMan) + IniWrite($DefaultLanguagePath, 'GuiText', 'EditMan', $Text_EditMan) + IniWrite($DefaultLanguagePath, 'GuiText', 'NewMac', $Text_NewMac) + IniWrite($DefaultLanguagePath, 'GuiText', 'NewMan', $Text_NewMan) + IniWrite($DefaultLanguagePath, 'GuiText', 'NewLabel', $Text_NewLabel) + IniWrite($DefaultLanguagePath, 'GuiText', 'Save', $Text_Save) + IniWrite($DefaultLanguagePath, 'GuiText', 'SaveQuestion', $Text_SaveQuestion) + IniWrite($DefaultLanguagePath, 'GuiText', 'GpsDetails', $Text_GpsDetails) + IniWrite($DefaultLanguagePath, 'GuiText', 'GpsCompass', $Text_GpsCompass) + IniWrite($DefaultLanguagePath, 'GuiText', 'Quality', $Text_Quality) + IniWrite($DefaultLanguagePath, 'GuiText', 'Time', $Text_Time) + IniWrite($DefaultLanguagePath, 'GuiText', 'NumberOfSatalites', $Text_NumberOfSatalites) + IniWrite($DefaultLanguagePath, 'GuiText', 'HorizontalDilutionPosition', $Text_HorizontalDilutionPosition) + IniWrite($DefaultLanguagePath, 'GuiText', 'Altitude', $Text_Altitude) + IniWrite($DefaultLanguagePath, 'GuiText', 'HeightOfGeoid', $Text_HeightOfGeoid) + IniWrite($DefaultLanguagePath, 'GuiText', 'Status', $Text_Status) + IniWrite($DefaultLanguagePath, 'GuiText', 'Date', $Text_Date) + IniWrite($DefaultLanguagePath, 'GuiText', 'SpeedInKnots', $Text_SpeedInKnots) + IniWrite($DefaultLanguagePath, 'GuiText', 'SpeedInMPH', $Text_SpeedInMPH) + IniWrite($DefaultLanguagePath, 'GuiText', 'SpeedInKmh', $Text_SpeedInKmh) + IniWrite($DefaultLanguagePath, 'GuiText', 'TrackAngle', $Text_TrackAngle) + IniWrite($DefaultLanguagePath, 'GuiText', 'Close', $Text_Close) + IniWrite($DefaultLanguagePath, 'GuiText', 'Start', $Text_Start) + IniWrite($DefaultLanguagePath, 'GuiText', 'Stop', $Text_Stop) + IniWrite($DefaultLanguagePath, 'GuiText', 'RefreshingNetworks', $Text_RefreshNetworks) + IniWrite($DefaultLanguagePath, 'GuiText', 'RefreshTime', $Text_RefreshTime) + IniWrite($DefaultLanguagePath, 'GuiText', 'SetColumnWidths', $Text_SetColumnWidths) + IniWrite($DefaultLanguagePath, 'GuiText', 'Enable', $Text_Enable) + IniWrite($DefaultLanguagePath, 'GuiText', 'Disable', $Text_Disable) + IniWrite($DefaultLanguagePath, 'GuiText', 'Checked', $Text_Checked) + IniWrite($DefaultLanguagePath, 'GuiText', 'UnChecked', $Text_UnChecked) + IniWrite($DefaultLanguagePath, 'GuiText', 'Unknown', $Text_Unknown) + IniWrite($DefaultLanguagePath, 'GuiText', 'Restart', $Text_Restart) + IniWrite($DefaultLanguagePath, 'GuiText', 'RestartMsg', $Text_RestartMsg) + IniWrite($DefaultLanguagePath, 'GuiText', 'Error', $Text_Error) + IniWrite($DefaultLanguagePath, 'GuiText', 'NoSignalHistory', $Text_NoSignalHistory) + IniWrite($DefaultLanguagePath, 'GuiText', 'NoApSelected', $Text_NoApSelected) + IniWrite($DefaultLanguagePath, 'GuiText', 'UseNetcomm', $Text_UseNetcomm) + IniWrite($DefaultLanguagePath, 'GuiText', 'UseCommMG', $Text_UseCommMG) + IniWrite($DefaultLanguagePath, 'GuiText', 'SignalHistory', $Text_SignalHistory) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoSortEvery', $Text_AutoSortEvery) + IniWrite($DefaultLanguagePath, 'GuiText', 'Seconds', $Text_Seconds) + IniWrite($DefaultLanguagePath, 'GuiText', 'Ascending', $Text_Ascending) + IniWrite($DefaultLanguagePath, 'GuiText', 'Decending', $Text_Decending) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoRecoveryVS1', $Text_AutoRecoveryVS1) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoSaveEvery', $Text_AutoSaveEvery) + IniWrite($DefaultLanguagePath, 'GuiText', 'DelAutoSaveOnExit', $Text_DelAutoSaveOnExit) + IniWrite($DefaultLanguagePath, 'GuiText', 'OpenSaveFolder', $Text_OpenSaveFolder) + IniWrite($DefaultLanguagePath, 'GuiText', 'SortBy', $Text_SortBy) + IniWrite($DefaultLanguagePath, 'GuiText', 'SortDirection', $Text_SortDirection) + IniWrite($DefaultLanguagePath, 'GuiText', 'Auto', $Text_Auto) + IniWrite($DefaultLanguagePath, 'GuiText', 'Misc', $Text_Misc) + IniWrite($DefaultLanguagePath, 'GuiText', 'GPS', $Text_Gps) + IniWrite($DefaultLanguagePath, 'GuiText', 'Labels', $Text_Labels) + IniWrite($DefaultLanguagePath, 'GuiText', 'Manufacturers', $Text_Manufacturers) + IniWrite($DefaultLanguagePath, 'GuiText', 'Columns', $Text_Columns) + IniWrite($DefaultLanguagePath, 'GuiText', 'Language', $Text_Language) + IniWrite($DefaultLanguagePath, 'GuiText', 'SearchWords', $Text_SearchWords) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerSettings', $Text_VistumblerSettings) + IniWrite($DefaultLanguagePath, 'GuiText', 'LanguageAuthor', $Text_LanguageAuthor) + IniWrite($DefaultLanguagePath, 'GuiText', 'LanguageDate', $Text_LanguageDate) + IniWrite($DefaultLanguagePath, 'GuiText', 'LanguageDescription', $Text_LanguageDescription) + IniWrite($DefaultLanguagePath, 'GuiText', 'Description', $Text_Description) + IniWrite($DefaultLanguagePath, 'GuiText', 'Progress', $Text_Progress) + IniWrite($DefaultLanguagePath, 'GuiText', 'LinesMin', $Text_LinesMin) + IniWrite($DefaultLanguagePath, 'GuiText', 'NewAPs', $Text_NewAPs) + IniWrite($DefaultLanguagePath, 'GuiText', 'NewGIDs', $Text_NewGIDs) + IniWrite($DefaultLanguagePath, 'GuiText', 'Minutes', $Text_Minutes) + IniWrite($DefaultLanguagePath, 'GuiText', 'LineTotal', $Text_LineTotal) + IniWrite($DefaultLanguagePath, 'GuiText', 'EstimatedTimeRemaining', $Text_EstimatedTimeRemaining) + IniWrite($DefaultLanguagePath, 'GuiText', 'Ready', $Text_Ready) + IniWrite($DefaultLanguagePath, 'GuiText', 'Done', $Text_Done) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerSaveDirectory', $Text_VistumblerSaveDirectory) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerAutoSaveDirectory', $Text_VistumblerAutoSaveDirectory) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerAutoRecoverySaveDirectory', $Text_VistumblerAutoRecoverySaveDirectory) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerKmlSaveDirectory', $Text_VistumblerKmlSaveDirectory) + IniWrite($DefaultLanguagePath, 'GuiText', 'BackgroundColor', $Text_BackgroundColor) + IniWrite($DefaultLanguagePath, 'GuiText', 'ControlColor', $Text_ControlColor) + IniWrite($DefaultLanguagePath, 'GuiText', 'BgFontColor', $Text_BgFontColor) + IniWrite($DefaultLanguagePath, 'GuiText', 'ConFontColor', $Text_ConFontColor) + IniWrite($DefaultLanguagePath, 'GuiText', 'NetshMsg', $Text_NetshMsg) + IniWrite($DefaultLanguagePath, 'GuiText', 'PHPgraphing', $Text_PHPgraphing) + IniWrite($DefaultLanguagePath, 'GuiText', 'ComInterface', $Text_ComInterface) + IniWrite($DefaultLanguagePath, 'GuiText', 'ComSettings', $Text_ComSettings) + IniWrite($DefaultLanguagePath, 'GuiText', 'Com', $Text_Com) + IniWrite($DefaultLanguagePath, 'GuiText', 'Baud', $Text_Baud) + IniWrite($DefaultLanguagePath, 'GuiText', 'GPSFormat', $Text_GPSFormat) + IniWrite($DefaultLanguagePath, 'GuiText', 'HideOtherGpsColumns', $Text_HideOtherGpsColumns) + IniWrite($DefaultLanguagePath, 'GuiText', 'ImportLanguageFile', $Text_ImportLanguageFile) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoKml', $Text_AutoKml) + IniWrite($DefaultLanguagePath, 'GuiText', 'GoogleEarthEXE', $Text_GoogleEarthEXE) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoSaveKmlEvery', $Text_AutoSaveKmlEvery) + IniWrite($DefaultLanguagePath, 'GuiText', 'SavedAs', $Text_SavedAs) + IniWrite($DefaultLanguagePath, 'GuiText', 'Overwrite', $Text_Overwrite) + IniWrite($DefaultLanguagePath, 'GuiText', 'InstallNetcommOCX', $Text_InstallNetcommOCX) + IniWrite($DefaultLanguagePath, 'GuiText', 'NoFileSaved', $Text_NoFileSaved) + IniWrite($DefaultLanguagePath, 'GuiText', 'NoApsWithGps', $Text_NoApsWithGps) + IniWrite($DefaultLanguagePath, 'GuiText', 'NoAps', $Text_NoAps) + IniWrite($DefaultLanguagePath, 'GuiText', 'MacExistsOverwriteIt', $Text_MacExistsOverwriteIt) + IniWrite($DefaultLanguagePath, 'GuiText', 'SavingLine', $Text_SavingLine) + IniWrite($DefaultLanguagePath, 'GuiText', 'Debug', $Text_Debug) + IniWrite($DefaultLanguagePath, 'GuiText', 'DisplayDebug', $Text_DisplayDebug) + IniWrite($DefaultLanguagePath, 'GuiText', 'DisplayDebugCom', $Text_DisplayComErrors) + IniWrite($DefaultLanguagePath, 'GuiText', 'GraphDeadTime', $Text_GraphDeadTime) + IniWrite($DefaultLanguagePath, 'GuiText', 'OpenKmlNetLink', $Text_OpenKmlNetLink) + IniWrite($DefaultLanguagePath, 'GuiText', 'ActiveRefreshTime', $Text_ActiveRefreshTime) + IniWrite($DefaultLanguagePath, 'GuiText', 'DeadRefreshTime', $Text_DeadRefreshTime) + IniWrite($DefaultLanguagePath, 'GuiText', 'GpsRefrshTime', $Text_GpsRefrshTime) + IniWrite($DefaultLanguagePath, 'GuiText', 'FlyToSettings', $Text_FlyToSettings) + IniWrite($DefaultLanguagePath, 'GuiText', 'FlyToCurrentGps', $Text_FlyToCurrentGps) + IniWrite($DefaultLanguagePath, 'GuiText', 'AltitudeMode', $Text_AltitudeMode) + IniWrite($DefaultLanguagePath, 'GuiText', 'Range', $Text_Range) + IniWrite($DefaultLanguagePath, 'GuiText', 'Heading', $Text_Heading) + IniWrite($DefaultLanguagePath, 'GuiText', 'Tilt', $Text_Tilt) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoOpenNetworkLink', $Text_AutoOpenNetworkLink) + IniWrite($DefaultLanguagePath, 'GuiText', 'SpeakSignal', $Text_SpeakSignal) + IniWrite($DefaultLanguagePath, 'GuiText', 'SpeakUseVisSounds', $Text_SpeakUseVisSounds) + IniWrite($DefaultLanguagePath, 'GuiText', 'SpeakUseSapi', $Text_SpeakUseSapi) + IniWrite($DefaultLanguagePath, 'GuiText', 'SpeakSayPercent', $Text_SpeakSayPercent) + IniWrite($DefaultLanguagePath, 'GuiText', 'GpsTrackTime', $Text_GpsTrackTime) + IniWrite($DefaultLanguagePath, 'GuiText', 'SaveAllGpsData', $Text_SaveAllGpsData) + IniWrite($DefaultLanguagePath, 'GuiText', 'None', $Text_None) + IniWrite($DefaultLanguagePath, 'GuiText', 'Even', $Text_Even) + IniWrite($DefaultLanguagePath, 'GuiText', 'Odd', $Text_Odd) + IniWrite($DefaultLanguagePath, 'GuiText', 'Mark', $Text_Mark) + IniWrite($DefaultLanguagePath, 'GuiText', 'Space', $Text_Space) + IniWrite($DefaultLanguagePath, 'GuiText', 'StopBit', $Text_StopBit) + IniWrite($DefaultLanguagePath, 'GuiText', 'Parity', $Text_Parity) + IniWrite($DefaultLanguagePath, 'GuiText', 'DataBit', $Text_DataBit) + IniWrite($DefaultLanguagePath, 'GuiText', 'Update', $Text_Update) + IniWrite($DefaultLanguagePath, 'GuiText', 'UpdateMsg', $Text_UpdateMsg) + IniWrite($DefaultLanguagePath, 'GuiText', 'Recover', $Text_Recover) + IniWrite($DefaultLanguagePath, 'GuiText', 'RecoverMsg', $Text_RecoverMsg) + IniWrite($DefaultLanguagePath, 'GuiText', 'SelectConnectedAP', $Text_SelectConnectedAP) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerHome', $Text_VistumblerHome) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerForum', $Text_VistumblerForum) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerWiki', $Text_VistumblerWiki) + IniWrite($DefaultLanguagePath, 'GuiText', 'CheckForUpdates', $Text_CheckForUpdates) + IniWrite($DefaultLanguagePath, 'GuiText', 'SelectWhatToCopy', $Text_SelectWhatToCopy) + IniWrite($DefaultLanguagePath, 'GuiText', 'Default', $Text_Default) + IniWrite($DefaultLanguagePath, 'GuiText', 'PlayMidiSounds', $Text_PlayMidiSounds) + IniWrite($DefaultLanguagePath, 'GuiText', 'Interface', $Text_Interface) + IniWrite($DefaultLanguagePath, 'GuiText', 'LanguageCode', $Text_LanguageCode) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoCheckUpdates', $Text_AutoCheckUpdates) + IniWrite($DefaultLanguagePath, 'GuiText', 'CheckBetaUpdates', $Text_CheckBetaUpdates) + IniWrite($DefaultLanguagePath, 'GuiText', 'GuessSearchwords', $Text_GuessSearchwords) + IniWrite($DefaultLanguagePath, 'GuiText', 'Help', $Text_Help) + IniWrite($DefaultLanguagePath, 'GuiText', 'ErrorScanningNetsh', $Text_ErrorScanningNetsh) + IniWrite($DefaultLanguagePath, 'GuiText', 'GpsErrorBufferEmpty', $Text_GpsErrorBufferEmpty) + IniWrite($DefaultLanguagePath, 'GuiText', 'GpsErrorStopped', $Text_GpsErrorStopped) + IniWrite($DefaultLanguagePath, 'GuiText', 'ShowSignalDB', $Text_ShowSignalDB) + IniWrite($DefaultLanguagePath, 'GuiText', 'SortingList', $Text_SortingList) + IniWrite($DefaultLanguagePath, 'GuiText', 'Loading', $Text_Loading) + IniWrite($DefaultLanguagePath, 'GuiText', 'MapOpenNetworks', $Text_MapOpenNetworks) + IniWrite($DefaultLanguagePath, 'GuiText', 'MapWepNetworks', $Text_MapWepNetworks) + IniWrite($DefaultLanguagePath, 'GuiText', 'MapSecureNetworks', $Text_MapSecureNetworks) + IniWrite($DefaultLanguagePath, 'GuiText', 'DrawTrack', $Text_DrawTrack) + IniWrite($DefaultLanguagePath, 'GuiText', 'UseLocalImages', $Text_UseLocalImages) + IniWrite($DefaultLanguagePath, 'GuiText', 'MIDI', $Text_MIDI) + IniWrite($DefaultLanguagePath, 'GuiText', 'MidiInstrumentNumber', $Text_MidiInstrumentNumber) + IniWrite($DefaultLanguagePath, 'GuiText', 'MidiPlayTime', $Text_MidiPlayTime) + IniWrite($DefaultLanguagePath, 'GuiText', 'SpeakRefreshTime', $Text_SpeakRefreshTime) + IniWrite($DefaultLanguagePath, 'GuiText', 'Information', $Text_Information) + IniWrite($DefaultLanguagePath, 'GuiText', 'AddedGuessedSearchwords', $Text_AddedGuessedSearchwords) + IniWrite($DefaultLanguagePath, 'GuiText', 'SortingTreeview', $Text_SortingTreeview) + IniWrite($DefaultLanguagePath, 'GuiText', 'Recovering', $Text_Recovering) + IniWrite($DefaultLanguagePath, 'GuiText', 'ErrorOpeningGpsPort', $Text_ErrorOpeningGpsPort) + IniWrite($DefaultLanguagePath, 'GuiText', 'SecondsSinceGpsUpdate', $Text_SecondsSinceGpsUpdate) + IniWrite($DefaultLanguagePath, 'GuiText', 'SavingGID', $Text_SavingGID) + IniWrite($DefaultLanguagePath, 'GuiText', 'SavingHistID', $Text_SavingHistID) + IniWrite($DefaultLanguagePath, 'GuiText', 'NoUpdates', $Text_NoUpdates) + IniWrite($DefaultLanguagePath, 'GuiText', 'NoActiveApFound', $Text_NoActiveApFound) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerDonate', $Text_VistumblerDonate) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerStore', $Text_VistumblerStore) + IniWrite($DefaultLanguagePath, 'GuiText', 'SupportVistumbler', $Text_SupportVistumbler) + IniWrite($DefaultLanguagePath, 'GuiText', 'UseNativeWifiMsg', $Text_UseNativeWifiMsg) + IniWrite($DefaultLanguagePath, 'GuiText', 'UseNativeWifiXpExtMsg', $Text_UseNativeWifiXpExtMsg) + IniWrite($DefaultLanguagePath, 'GuiText', 'FilterMsg', $Text_FilterMsg) + IniWrite($DefaultLanguagePath, 'GuiText', 'SetFilters', $Text_SetFilters) + IniWrite($DefaultLanguagePath, 'GuiText', 'Filtered', $Text_Filtered) + IniWrite($DefaultLanguagePath, 'GuiText', 'Filters', $Text_Filters) + IniWrite($DefaultLanguagePath, 'GuiText', 'FilterName', $Text_FilterName) + IniWrite($DefaultLanguagePath, 'GuiText', 'FilterDesc', $Text_FilterDesc) + IniWrite($DefaultLanguagePath, 'GuiText', 'FilterAddEdit', $Text_FilterAddEdit) + IniWrite($DefaultLanguagePath, 'GuiText', 'NoAdaptersFound', $Text_NoAdaptersFound) + IniWrite($DefaultLanguagePath, 'GuiText', 'RecoveringMDB', $Text_RecoveringMDB) + IniWrite($DefaultLanguagePath, 'GuiText', 'FixingGpsTableDates', $Text_FixingGpsTableDates) + IniWrite($DefaultLanguagePath, 'GuiText', 'FixingGpsTableTimes', $Text_FixingGpsTableTimes) + IniWrite($DefaultLanguagePath, 'GuiText', 'FixingHistTableDates', $Text_FixingHistTableDates) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerNeedsToRestart', $Text_VistumblerNeedsToRestart) + IniWrite($DefaultLanguagePath, 'GuiText', 'AddingApsIntoList', $Text_AddingApsIntoList) + IniWrite($DefaultLanguagePath, 'GuiText', 'GoogleEarthDoesNotExist', $Text_GoogleEarthDoesNotExist) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoKmlIsNotStarted', $Text_AutoKmlIsNotStarted) + IniWrite($DefaultLanguagePath, 'GuiText', 'UseKernel32', $Text_UseKernel32) + IniWrite($DefaultLanguagePath, 'GuiText', 'UnableToGuessSearchwords', $Text_UnableToGuessSearchwords) + IniWrite($DefaultLanguagePath, 'GuiText', 'SelectedAP', $Text_SelectedAP) + IniWrite($DefaultLanguagePath, 'GuiText', 'AllAPs', $Text_AllAPs) + IniWrite($DefaultLanguagePath, 'GuiText', 'FilteredAPs', $Text_FilteredAPs) + IniWrite($DefaultLanguagePath, 'GuiText', 'ImportFolder', $Text_ImportFolder) + IniWrite($DefaultLanguagePath, 'GuiText', 'DeleteSelected', $Text_DeleteSelected) + IniWrite($DefaultLanguagePath, 'GuiText', 'RecoverSelected', $Text_RecoverSelected) + IniWrite($DefaultLanguagePath, 'GuiText', 'NewSession', $Text_NewSession) + IniWrite($DefaultLanguagePath, 'GuiText', 'Size', $Text_Size) + IniWrite($DefaultLanguagePath, 'GuiText', 'NoMdbSelected', $Text_NoMdbSelected) + IniWrite($DefaultLanguagePath, 'GuiText', 'LocateInWiFiDB', $Text_LocateInWiFiDB) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoWiFiDbGpsLocate', $Text_AutoWiFiDbGpsLocate) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoWiFiDbUploadAps', $Text_AutoWiFiDbUploadAps) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoSelectConnectedAP', $Text_AutoSelectConnectedAP) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoSelectHighSigAP', $Text_AutoSelectHighSignal) + IniWrite($DefaultLanguagePath, 'GuiText', 'Experimental', $Text_Experimental) + IniWrite($DefaultLanguagePath, 'GuiText', 'Color', $Text_Color) + IniWrite($DefaultLanguagePath, 'GuiText', 'AddRemFilters', $Text_AddRemFilters) + IniWrite($DefaultLanguagePath, 'GuiText', 'NoFilterSelected', $Text_NoFilterSelected) + IniWrite($DefaultLanguagePath, 'GuiText', 'AddFilter', $Text_AddFilter) + IniWrite($DefaultLanguagePath, 'GuiText', 'EditFilter', $Text_EditFilter) + IniWrite($DefaultLanguagePath, 'GuiText', 'DeleteFilter', $Text_DeleteFilter) + IniWrite($DefaultLanguagePath, 'GuiText', 'TimeBeforeMarkedDead', $Text_TimeBeforeMarkedDead) + IniWrite($DefaultLanguagePath, 'GuiText', 'FilterNameRequired', $Text_FilterNameRequired) + IniWrite($DefaultLanguagePath, 'GuiText', 'UpdateManufacturers', $Text_UpdateManufacturers) + IniWrite($DefaultLanguagePath, 'GuiText', 'FixHistSignals', $Text_FixHistSignals) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerFile', $Text_VistumblerFile) + IniWrite($DefaultLanguagePath, 'GuiText', 'DetailedFile', $Text_DetailedCsvFile) + IniWrite($DefaultLanguagePath, 'GuiText', 'SummaryFile', $Text_SummaryCsvFile) + IniWrite($DefaultLanguagePath, 'GuiText', 'NetstumblerTxtFile', $Text_NetstumblerTxtFile) + IniWrite($DefaultLanguagePath, 'GuiText', 'WardriveDb3File', $Text_WardriveDb3File) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoScanApsOnLaunch', $Text_AutoScanApsOnLaunch) + IniWrite($DefaultLanguagePath, 'GuiText', 'RefreshInterfaces', $Text_RefreshInterfaces) + IniWrite($DefaultLanguagePath, 'GuiText', 'Sound', $Text_Sound) + IniWrite($DefaultLanguagePath, 'GuiText', 'OncePerLoop', $Text_OncePerLoop) + IniWrite($DefaultLanguagePath, 'GuiText', 'OncePerAP', $Text_OncePerAP) + IniWrite($DefaultLanguagePath, 'GuiText', 'OncePerAPwSound', $Text_OncePerAPwSound) + IniWrite($DefaultLanguagePath, 'GuiText', 'WifiDB', $Text_WifiDB) + IniWrite($DefaultLanguagePath, 'GuiText', 'Warning', $Text_Warning) + IniWrite($DefaultLanguagePath, 'GuiText', 'WifiDBLocateWarning', $Text_WifiDBLocateWarning) + IniWrite($DefaultLanguagePath, 'GuiText', 'WifiDBAutoUploadWarning', $Text_WifiDBAutoUploadWarning) + IniWrite($DefaultLanguagePath, 'GuiText', 'WifiDBOpenLiveAPWebpage', $Text_WifiDBOpenLiveAPWebpage) + IniWrite($DefaultLanguagePath, 'GuiText', 'WifiDBOpenMainWebpage', $Text_WifiDBOpenMainWebpage) + IniWrite($DefaultLanguagePath, 'GuiText', 'FilePath', $Text_FilePath) + IniWrite($DefaultLanguagePath, 'GuiText', 'CameraName', $Text_CameraName) + IniWrite($DefaultLanguagePath, 'GuiText', 'CameraURL', $Text_CameraURL) + IniWrite($DefaultLanguagePath, 'GuiText', 'Cameras', $Text_Cameras) + IniWrite($DefaultLanguagePath, 'GuiText', 'AddCamera', $Text_AddCamera) + IniWrite($DefaultLanguagePath, 'GuiText', 'RemoveCamera', $Text_RemoveCamera) + IniWrite($DefaultLanguagePath, 'GuiText', 'EditCamera', $Text_EditCamera) + IniWrite($DefaultLanguagePath, 'GuiText', 'DownloadImages', $Text_DownloadImages) + IniWrite($DefaultLanguagePath, 'GuiText', 'EnableCamTriggerScript', $Text_EnableCamTriggerScript) + IniWrite($DefaultLanguagePath, 'GuiText', 'PortableMode', $Text_PortableMode) + IniWrite($DefaultLanguagePath, 'GuiText', 'CameraTriggerScript', $Text_CameraTriggerScript) + IniWrite($DefaultLanguagePath, 'GuiText', 'CameraTriggerScriptTypes', $Text_CameraTriggerScriptTypes) + IniWrite($DefaultLanguagePath, 'GuiText', 'SetCameras', $Text_SetCameras) + IniWrite($DefaultLanguagePath, 'GuiText', 'UpdateUpdaterMsg', $Text_UpdateUpdaterMsg) + IniWrite($DefaultLanguagePath, 'GuiText', 'UseRssiInGraphs', $Text_UseRssiInGraphs) + IniWrite($DefaultLanguagePath, 'GuiText', '2400ChannelGraph', $Text_2400ChannelGraph) + IniWrite($DefaultLanguagePath, 'GuiText', '5000ChannelGraph', $Text_5000ChannelGraph) + IniWrite($DefaultLanguagePath, 'GuiText', 'UpdateGeolocations', $Text_UpdateGeolocations) + IniWrite($DefaultLanguagePath, 'GuiText', 'ShowGpsPositionMap', $Text_ShowGpsPositionMap) + IniWrite($DefaultLanguagePath, 'GuiText', 'ShowGpsSignalMap', $Text_ShowGpsSignalMap) + IniWrite($DefaultLanguagePath, 'GuiText', 'UseRssiSignalValue', $Text_UseRssiSignalValue) + IniWrite($DefaultLanguagePath, 'GuiText', 'UseCircleToShowSigStength', $Text_UseCircleToShowSigStength) + IniWrite($DefaultLanguagePath, 'GuiText', 'ShowGpsRangeMap', $Text_ShowGpsRangeMap) + IniWrite($DefaultLanguagePath, 'GuiText', 'ShowGpsTack', $Text_ShowGpsTack) + IniWrite($DefaultLanguagePath, 'GuiText', 'Line', $Text_Line) + IniWrite($DefaultLanguagePath, 'GuiText', 'Total', $Text_Total) + IniWrite($DefaultLanguagePath, 'GuiText', 'WifiDB_Upload_Discliamer', $Text_WifiDB_Upload_Discliamer) + IniWrite($DefaultLanguagePath, 'GuiText', 'UserInformation', $Text_UserInformation) + IniWrite($DefaultLanguagePath, 'GuiText', 'WifiDB_Username', $Text_WifiDB_Username) + IniWrite($DefaultLanguagePath, 'GuiText', 'WifiDB_Api_Key', $Text_WifiDB_Api_Key) + IniWrite($DefaultLanguagePath, 'GuiText', 'OtherUsers', $Text_OtherUsers) + IniWrite($DefaultLanguagePath, 'GuiText', 'FileType', $Text_FileType) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerVSZ', $Text_VistumblerVSZ) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerVS1', $Text_VistumblerVS1) + IniWrite($DefaultLanguagePath, 'GuiText', 'VistumblerCSV', $Text_VistumblerCSV) + IniWrite($DefaultLanguagePath, 'GuiText', 'UploadInformation', $Text_UploadInformation) + IniWrite($DefaultLanguagePath, 'GuiText', 'Title', $Text_Title) + IniWrite($DefaultLanguagePath, 'GuiText', 'Notes', $Text_Notes) + IniWrite($DefaultLanguagePath, 'GuiText', 'UploadApsToWifidb', $Text_UploadApsToWifidb) + IniWrite($DefaultLanguagePath, 'GuiText', 'UploadingApsToWifidb', $Text_UploadingApsToWifidb) + IniWrite($DefaultLanguagePath, 'GuiText', 'GeoNamesInfo', $Text_GeoNamesInfo) + IniWrite($DefaultLanguagePath, 'GuiText', 'FindApInWifidb', $Text_FindApInWifidb) + IniWrite($DefaultLanguagePath, 'GuiText', 'GpsDisconnect', $Text_GpsDisconnect) + IniWrite($DefaultLanguagePath, 'GuiText', 'GpsReset', $Text_GpsReset) + IniWrite($DefaultLanguagePath, 'GuiText', 'APs', $Text_APs) + IniWrite($DefaultLanguagePath, 'GuiText', 'MaxSignal', $Text_MaxSignal) + IniWrite($DefaultLanguagePath, 'GuiText', 'DisassociationSignal', $Text_DisassociationSignal) + IniWrite($DefaultLanguagePath, 'GuiText', 'SaveDirectories', $Text_SaveDirectories) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoSaveAndClearAfterNumberofAPs', $Text_AutoSaveAndClearAfterNumberofAPs) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoSaveandClearAfterTime', $Text_AutoSaveandClearAfterTime) + IniWrite($DefaultLanguagePath, 'GuiText', 'PlaySoundWhenSaving', $Text_PlaySoundWhenSaving) + IniWrite($DefaultLanguagePath, 'GuiText', 'MinimalGuiMode', $Text_MinimalGuiMode) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoScrollToBottom', $Text_AutoScrollToBottom) + IniWrite($DefaultLanguagePath, 'GuiText', 'ListviewBatchInsertMode', $Text_ListviewBatchInsertMode) + IniWrite($DefaultLanguagePath, 'GuiText', 'ExportVistumblerSettings', $Text_ExportVistumblerSettings) + IniWrite($DefaultLanguagePath, 'GuiText', 'ImportVistumblerSettings', $Text_ImportVistumblerSettings) + IniWrite($DefaultLanguagePath, 'GuiText', 'ErrorSavingFile', $Text_ErrorSavingFile) + IniWrite($DefaultLanguagePath, 'GuiText', 'ErrorImportingFile', $Text_ErrorImportingFile) + IniWrite($DefaultLanguagePath, 'GuiText', 'SettingsImportedSuccess', $Text_SettingsImportedSuccess) + IniWrite($DefaultLanguagePath, 'GuiText', 'ButtonActiveColor', $Text_ButtonActiveColor) + IniWrite($DefaultLanguagePath, 'GuiText', 'ButtonInactiveColor', $Text_ButtonInactiveColor) + IniWrite($DefaultLanguagePath, 'GuiText', 'Text', $Text_Text) + IniWrite($DefaultLanguagePath, 'GuiText', 'GUITextSize', $Text_GUITextSize) +EndFunc ;==>_WriteINI + +;------------------------------------------------------------------------------------------------------------------------------- +; VISTUMBLER OPEN FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func LoadList() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, 'LoadList()') ;#Debug Display + _LoadListGUI() +EndFunc ;==>LoadList + +Func _ExtractVSZ($vsz_file) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExtractVSZ()') ;#Debug Display + $vsz_temp_file = $TmpDir & 'data.zip' + $vs1_file = $TmpDir & 'data.vs1' + If FileExists($vsz_temp_file) Then FileDelete($vsz_temp_file) + If FileExists($vs1_file) Then FileDelete($vs1_file) + FileCopy($vsz_file, $vsz_temp_file) + _Zip_Unzip($vsz_temp_file, 'data.vs1', $TmpDir) + FileDelete($vsz_temp_file) + Return ($vs1_file) +EndFunc ;==>_ExtractVSZ + +Func _LoadFolder() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_LoadFolder()') ;#Debug Display + $FoundFiles = 0 + $LoadFolder = FileSelectFolder($Text_ImportFolder & "(VS1/VSZ)", "") + If Not @error Then + $vs1files = _FileListToArray($LoadFolder, '*.vs1', 1) ;Find all files in the folder that end in .vs1 + If IsArray($vs1files) Then + For $b = 1 To $vs1files[0] + GUICtrlSetData($msgdisplay, $Text_Loading & " - " & $b & "/" & $vs1files[0] & " (" & $LoadFolder & "\" & $vs1files[$b] & ")") + _LoadListGUI($LoadFolder & "\" & $vs1files[$b]) + _ImportClose() + Next + $FoundFiles = 1 + EndIf + $vszfiles = _FileListToArray($LoadFolder, '*.vsz', 1) ;Find all files in the folder that end in .vsz + If IsArray($vszfiles) Then + For $b = 1 To $vszfiles[0] + GUICtrlSetData($msgdisplay, $Text_Loading & " - " & $b & "/" & $vszfiles[0] & " (" & $LoadFolder & "\" & $vszfiles[$b] & ")") + _LoadListGUI($LoadFolder & "\" & $vszfiles[$b]) + _ImportClose() + Next + $FoundFiles = 1 + EndIf + EndIf + If $FoundFiles = 0 Then + MsgBox(0, $Text_Error, "No VS1 or VSZ files found") + Else + MsgBox(0, $Text_Information, $Text_Done) + EndIf +EndFunc ;==>_LoadFolder + +Func _LoadListGUI($imfile1 = "") + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_LoadListGUI()') ;#Debug Display + GUISetState(@SW_MINIMIZE, $Vistumbler) + + $GUI_Import = GUICreate(StringReplace($Text_Import, "&", ""), 501, 245, -1, -1) + GUISetBkColor($BackgroundColor) + $vistumblerfileinput = GUICtrlCreateInput($imfile1, 8, 10, 377, 21) + $browse1 = GUICtrlCreateButton($Text_Browse, 392, 8, 97, 25, $WS_GROUP) + $RadVis = GUICtrlCreateRadio($Text_VistumblerFile & ' (VS1, VSZ)', 10, 40, 240, 20) + GUICtrlSetState($RadVis, $GUI_CHECKED) + $RadCsv = GUICtrlCreateRadio($Text_DetailedCsvFile & ' (CSV)', 10, 60, 240, 20) + $RadNs = GUICtrlCreateRadio($Text_NetstumblerTxtFile & ' (TXT, NS1)', 255, 40, 240, 20) + $RadWD = GUICtrlCreateRadio($Text_WardriveDb3File & ' (DB3)', 255, 60, 240, 20) + $NsOk = GUICtrlCreateButton($Text_Ok, 95, 95, 150, 25, $WS_GROUP) + $NsCancel = GUICtrlCreateButton($Text_Close, 255, 95, 150, 25, $WS_GROUP) + $progressbar = GUICtrlCreateProgress(10, 135, 480, 20) + $percentlabel = GUICtrlCreateLabel($Text_Progress & ': ' & $Text_Ready, 10, 165, 230, 20) + $linetotal = GUICtrlCreateLabel($Text_LineTotal & ':', 10, 190, 250, 20) + $newlines = GUICtrlCreateLabel($Text_NewAPs & ':', 10, 215, 230, 20) + + $minutes = GUICtrlCreateLabel($Text_Minutes & ':', 230, 165, 270, 20) + $linemin = GUICtrlCreateLabel($Text_LinesMin & ':', 230, 190, 270, 35) + $estimatedtime = GUICtrlCreateLabel($Text_EstimatedTimeRemaining & ':', 230, 215, 270, 35) + GUISetState(@SW_SHOW) + + GUICtrlSetOnEvent($browse1, "_ImportFileBrowse") + GUICtrlSetOnEvent($NsOk, "_ImportOk") + GUICtrlSetOnEvent($NsCancel, "_ImportClose") + GUISetOnEvent($GUI_EVENT_CLOSE, '_ImportClose') + If $imfile1 <> '' Then _ImportOk() +EndFunc ;==>_LoadListGUI + +Func _ImportFileBrowse() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ImportFileBrowse()') ;#Debug Display + If GUICtrlRead($RadVis) = 1 Then + $file = FileOpenDialog($Text_VistumblerFile, $SaveDir, $Text_VistumblerFile & ' (*.vs1;*.vsz;*.txt)', 1) + If Not @error Then GUICtrlSetData($vistumblerfileinput, $file) + ElseIf GUICtrlRead($RadCsv) = 1 Then + $file = FileOpenDialog($Text_VistumblerFile, $SaveDir, $Text_DetailedCsvFile & ' (*.csv)', 1) + If Not @error Then GUICtrlSetData($vistumblerfileinput, $file) + ElseIf GUICtrlRead($RadNs) = 1 Then + $file = FileOpenDialog($Text_VistumblerFile, $SaveDir, $Text_NetstumblerTxtFile & ' (*.txt;*.ns1)', 1) + If Not @error Then GUICtrlSetData($vistumblerfileinput, $file) + ElseIf GUICtrlRead($RadWD) = 1 Then + $file = FileOpenDialog($Text_VistumblerFile, $SaveDir, "Wardrive-android file" & ' (*.db3)', 1) + If Not @error Then GUICtrlSetData($vistumblerfileinput, $file) + EndIf +EndFunc ;==>_ImportFileBrowse + +Func _ImportClose() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ImportClose()') ;#Debug Display + GUIDelete($GUI_Import) + GUISetState(@SW_RESTORE, $Vistumbler) +EndFunc ;==>_ImportClose + +Func _ImportOk() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ImportOk()') ;#Debug Display + GUICtrlSetData($percentlabel, $Text_Progress & ': ' & $Text_Loading) + $UpdateTimer = TimerInit() + $MemReleaseTimer = TimerInit() + $loadfile = GUICtrlRead($vistumblerfileinput) + $loadfileMD5 = _MD5ForFile($loadfile) + + $query = "SELECT MD5 FROM LoadedFiles WHERE MD5='" & $loadfileMD5 & "'" + $MD5MatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundMD5Match = UBound($MD5MatchArray) - 1 + + If $FoundMD5Match <> 0 Then + GUICtrlSetData($percentlabel, $Text_Progress & ': ' & 'This file has already been imported') + Else + GUICtrlSetState($NsOk, $GUI_DISABLE) + If GUICtrlRead($RadVis) = 1 Then + If StringUpper(StringRight($loadfile, 4)) = '.VSZ' Then + $TempVS1 = _ExtractVSZ($loadfile) + _ImportVS1($TempVS1) + FileDelete($TempVS1) + Else + _ImportVS1($loadfile) + EndIf + ElseIf GUICtrlRead($RadCsv) = 1 Then + _ImportCSV($loadfile) + ElseIf GUICtrlRead($RadNs) = 1 Then + _ImportNS1($loadfile) + ElseIf GUICtrlRead($RadWD) = 1 Then + _ImportWardriveDb3($loadfile) + EndIf + $min = (TimerDiff($begintime) / 60000) ;convert from miniseconds to minutes + GUICtrlSetData($minutes, $Text_Minutes & ': ' & Round($min, 1)) + If $MinimalGuiMode = 0 Then + GUICtrlSetData($percentlabel, $Text_Progress & ': ' & $Text_AddingApsIntoList) + _UpdateListview(1) + ;Update Labels and Manufacturers + _UpdateListMacLabels() + EndIf + $min = (TimerDiff($begintime) / 60000) ;convert from miniseconds to minutes + GUICtrlSetData($minutes, $Text_Minutes & ': ' & Round($min, 1)) + GUICtrlSetData($progressbar, 100) + GUICtrlSetState($NsOk, $GUI_ENABLE) + If Not BitAND($closebtn, $BST_PUSHED) = $BST_PUSHED Then _AddRecord($ManuDB, "LoadedFiles", $DB_OBJ, $loadfile & '|' & $loadfileMD5) + GUICtrlSetData($percentlabel, $Text_Progress & ': ' & $Text_Done) + EndIf +EndFunc ;==>_ImportOk + +Func _ImportVS1($VS1file) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ImportVS1()') ;#Debug Display + _CreateTable($VistumblerDB, 'TempGpsIDMatchTabel', $DB_OBJ) + _CreatMultipleFields($VistumblerDB, 'TempGpsIDMatchTabel', $DB_OBJ, 'OldGpsID INTEGER|NewGpsID INTEGER') + $vistumblerfile = FileOpen($VS1file, 0) + If $vistumblerfile <> -1 Then + $begintime = TimerInit() + $currentline = 1 + $AddAP = 0 + $AddGID = 0 + ;Get Total number of lines + $totallines = 0 + While 1 + FileReadLine($vistumblerfile) + If @error = -1 Then ExitLoop + $totallines += 1 + WEnd + ;Start Importing File + For $Load = 1 To $totallines + $linein = FileReadLine($vistumblerfile, $Load) ;Open Line in file + If @error = -1 Then ExitLoop + If StringTrimRight($linein, StringLen($linein) - 1) <> "#" Then + $loadlist = StringSplit($linein, '|') ;Split Infomation of AP on line + ConsoleWrite($loadlist[0] & @CRLF) + If $loadlist[0] = 6 Or $loadlist[0] = 12 Then ; If Line is GPS ID Line + If $loadlist[0] = 6 Then + $LoadGID = $loadlist[1] + $LoadLat = _Format_GPS_DMM($loadlist[2]) + $LoadLon = _Format_GPS_DMM($loadlist[3]) + $LoadSat = $loadlist[4] + $LoadHorDilPitch = 0 + $LoadAlt = 0 + $LoadGeo = 0 + $LoadSpeedKmh = 0 + $LoadSpeedMPH = 0 + $LoadTrackAngle = 0 + $LoadDate = $loadlist[5] + $ld = StringSplit($LoadDate, '-') + If StringLen($ld[1]) <> 4 Then $LoadDate = StringFormat("%04i", $ld[3]) & '-' & StringFormat("%02i", $ld[1]) & '-' & StringFormat("%02i", $ld[2]) + $LoadTime = $loadlist[6] + If StringInStr($LoadTime, '.') = 0 Then $LoadTime &= '.000' + ElseIf $loadlist[0] = 12 Then + $LoadGID = $loadlist[1] + $LoadLat = _Format_GPS_DMM($loadlist[2]) + $LoadLon = _Format_GPS_DMM($loadlist[3]) + $LoadSat = $loadlist[4] + $LoadHorDilPitch = $loadlist[5] + $LoadAlt = $loadlist[6] + $LoadGeo = $loadlist[7] + $LoadSpeedKmh = $loadlist[8] + $LoadSpeedMPH = $loadlist[9] + $LoadTrackAngle = $loadlist[10] + $LoadDate = $loadlist[11] + $ld = StringSplit($LoadDate, '-') + If StringLen($ld[1]) <> 4 Then $LoadDate = StringFormat("%04i", $ld[3]) & '-' & StringFormat("%02i", $ld[1]) & '-' & StringFormat("%02i", $ld[2]) + $LoadTime = $loadlist[12] + If StringInStr($LoadTime, '.') = 0 Then $LoadTime &= '.000' + EndIf + + $query = "SELECT TOP 1 OldGpsID FROM TempGpsIDMatchTabel WHERE OldGpsID=" & $LoadGID + $TempGidMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundTempGidMatch = UBound($TempGidMatchArray) - 1 + If $FoundTempGidMatch = 0 Then + $query = "SELECT TOP 1 GPSID FROM GPS WHERE Latitude = '" & $LoadLat & "' And Longitude = '" & $LoadLon & "' And NumOfSats = '" & $LoadSat & "' And Date1 = '" & $LoadDate & "' And Time1 = '" & $LoadTime & "'" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch = 0 Then + $AddGID += 1 + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $LoadLat & '|' & $LoadLon & '|' & $LoadSat & '|' & $LoadHorDilPitch & '|' & $LoadAlt & '|' & $LoadGeo & '|' & $LoadSpeedKmh & '|' & $LoadSpeedMPH & '|' & $LoadTrackAngle & '|' & $LoadDate & '|' & $LoadTime) + _AddRecord($VistumblerDB, "TempGpsIDMatchTabel", $DB_OBJ, $LoadGID & '|' & $GPS_ID) + ElseIf $FoundGpsMatch = 1 Then + $NewGpsId = $GpsMatchArray[1][1] + _AddRecord($VistumblerDB, "TempGpsIDMatchTabel", $DB_OBJ, $LoadGID & '|' & $NewGpsId) + EndIf + ElseIf $FoundTempGidMatch = 1 Then + $query = "SELECT TOP 1 GPSID FROM GPS WHERE Latitude = '" & $LoadLat & "' And Longitude = '" & $LoadLon & "' And NumOfSats = '" & $LoadSat & "' And Date1 = '" & $LoadDate & "' And Time1 = '" & $LoadTime & "'" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch = 0 Then + $AddGID += 1 + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $LoadLat & '|' & $LoadLon & '|' & $LoadSat & '|' & $LoadHorDilPitch & '|' & $LoadAlt & '|' & $LoadGeo & '|' & $LoadSpeedKmh & '|' & $LoadSpeedMPH & '|' & $LoadTrackAngle & '|' & $LoadDate & '|' & $LoadTime) + $query = "UPDATE TempGpsIDMatchTabel SET NewGpsID=" & $GPS_ID & " WHERE OldGpsID=" & $LoadGID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + ElseIf $FoundGpsMatch = 1 Then + $NewGpsId = $GpsMatchArray[1][1] + $query = "UPDATE TempGpsIDMatchTabel SET NewGpsID=" & $NewGpsId & " WHERE OldGpsID=" & $LoadGID + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + EndIf + EndIf + ElseIf $loadlist[0] = 13 Then ;If String is VS1 v3 data line + $Found = 0 + $SSID = StringStripWS($loadlist[1], 3) + $BSSID = StringStripWS($loadlist[2], 3) + $Authentication = StringStripWS($loadlist[4], 3) + $Encryption = StringStripWS($loadlist[5], 3) + $LoadSecType = StringStripWS($loadlist[6], 3) + $RadioType = StringStripWS($loadlist[7], 3) + $Channel = StringStripWS($loadlist[8], 3) + $BasicTransferRates = StringStripWS($loadlist[9], 3) + $OtherTransferRates = StringStripWS($loadlist[10], 3) + $NetworkType = StringStripWS($loadlist[11], 3) + $GigSigHist = StringStripWS($loadlist[13], 3) + ;Go through GID/Signal history and add information to DB + $GidSplit = StringSplit($GigSigHist, '-') + For $loaddat = 1 To $GidSplit[0] + $GidSigSplit = StringSplit($GidSplit[$loaddat], ',') + If $GidSigSplit[0] = 2 Then + $ImpGID = $GidSigSplit[1] + $ImpSig = StringReplace(StringStripWS($GidSigSplit[2], 3), '%', '') + If $ImpSig = '' Then $ImpSig = '0' ;Old VS1 file no signal fix + $ImpRSSI = _SignalPercentToDb($ImpSig) + $query = "SELECT TOP 1 NewGpsID FROM TempGpsIDMatchTabel WHERE OldGpsID=" & $ImpGID + $TempGidMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $TempGidMatchArrayMatch = UBound($TempGidMatchArray) - 1 + If $TempGidMatchArrayMatch <> 0 Then + $NewGID = $TempGidMatchArray[1][1] + ;Add AP Info to DB, Listview, and Treeview + $NewApAdded = _AddApData(0, $NewGID, $BSSID, $SSID, $Channel, $Authentication, $Encryption, $NetworkType, $RadioType, $BasicTransferRates, $OtherTransferRates, $ImpSig, $ImpRSSI) + If $NewApAdded <> 0 Then $AddAP += 1 + EndIf + EndIf + $closebtn = _GUICtrlButton_GetState($NsCancel) + If BitAND($closebtn, $BST_PUSHED) = $BST_PUSHED Then ExitLoop + Next + ElseIf $loadlist[0] = 15 Then ;If String is VS1 v4 data line + ;_ArrayDisplay($loadlist) + $Found = 0 + $SSID = StringStripWS($loadlist[1], 3) + $BSSID = StringStripWS($loadlist[2], 3) + ;$ImpManu = StringStripWS($loadlist[3], 3) + $Authentication = StringStripWS($loadlist[4], 3) + $Encryption = StringStripWS($loadlist[5], 3) + $LoadSecType = StringStripWS($loadlist[6], 3) + $RadioType = StringStripWS($loadlist[7], 3) + $Channel = StringStripWS($loadlist[8], 3) + $BasicTransferRates = StringStripWS($loadlist[9], 3) + $OtherTransferRates = StringStripWS($loadlist[10], 3) + $HighSignal = StringStripWS($loadlist[11], 3) + $HighRSS1 = StringStripWS($loadlist[12], 3) + $NetworkType = StringStripWS($loadlist[13], 3) + ;$ImpLabel = StringStripWS($loadlist[14], 3) + $GigSigHist = StringStripWS($loadlist[15], 3) + + ;Go through GID/Signal history and add information to DB + $GidSplit = StringSplit($GigSigHist, '\') + For $loaddat = 1 To $GidSplit[0] + $GidSigSplit = StringSplit($GidSplit[$loaddat], ',') + If $GidSigSplit[0] = 3 Then + $ImpGID = $GidSigSplit[1] + $ImpSig = StringReplace(StringStripWS($GidSigSplit[2], 3), '%', '') + $ImpRSSI = $GidSigSplit[3] + $query = "SELECT TOP 1 NewGpsID FROM TempGpsIDMatchTabel WHERE OldGpsID=" & $ImpGID + $TempGidMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $TempGidMatchArrayMatch = UBound($TempGidMatchArray) - 1 + If $TempGidMatchArrayMatch <> 0 Then + $NewGID = $TempGidMatchArray[1][1] + ;Add AP Info to DB, Listview, and Treeview + $NewApAdded = _AddApData(0, $NewGID, $BSSID, $SSID, $Channel, $Authentication, $Encryption, $NetworkType, $RadioType, $BasicTransferRates, $OtherTransferRates, $ImpSig, $ImpRSSI) + If $NewApAdded <> 0 Then $AddAP += 1 + EndIf + EndIf + $closebtn = _GUICtrlButton_GetState($NsCancel) + If BitAND($closebtn, $BST_PUSHED) = $BST_PUSHED Then ExitLoop + Next + ElseIf $loadlist[0] = 17 Then ; If string is TXT data line + $Found = 0 + $SSID = StringStripWS($loadlist[1], 3) + $BSSID = StringStripWS($loadlist[2], 3) + $HighGpsSignal = StringReplace(StringStripWS($loadlist[4], 3), '%', '') + $RSSI = _SignalPercentToDb($HighGpsSignal) + $Authentication = StringStripWS($loadlist[5], 3) + $Encryption = StringStripWS($loadlist[6], 3) + $RadioType = StringStripWS($loadlist[7], 3) + $Channel = StringStripWS($loadlist[8], 3) + $LoadLatitude = _Format_GPS_All_to_DMM(StringStripWS($loadlist[9], 3)) + $LoadLongitude = _Format_GPS_All_to_DMM(StringStripWS($loadlist[10], 3)) + $BasicTransferRates = StringStripWS($loadlist[11], 3) + $OtherTransferRates = StringStripWS($loadlist[12], 3) + $LoadFirstActive = StringStripWS($loadlist[13], 3) + $LoadLastActive = StringStripWS($loadlist[14], 3) + $NetworkType = StringStripWS($loadlist[15], 3) + $SignalHistory = StringStripWS($loadlist[17], 3) + $LoadSat = '00' + $tsplit = StringSplit($LoadFirstActive, ' ') + $LoadFirstActive_Time = $tsplit[2] + If StringInStr($LoadFirstActive_Time, '.') = 0 Then $LoadFirstActive_Time &= '.000' + $LoadFirstActive_Date = $tsplit[1] + $ld = StringSplit($LoadFirstActive_Date, '-') + If StringLen($ld[1]) <> 4 Then $LoadFirstActive_Date = StringFormat("%04i", $ld[3]) & '-' & StringFormat("%02i", $ld[1]) & '-' & StringFormat("%02i", $ld[2]) + $tsplit = StringSplit($LoadLastActive, ' ') + $LoadLastActive_Time = $tsplit[2] + If StringInStr($LoadLastActive_Time, '.') = 0 Then $LoadLastActive_Time &= '.000' + $LoadLastActive_Date = $tsplit[1] + $ld = StringSplit($LoadLastActive_Date, '-') + If StringLen($ld[1]) <> 4 Then $LoadLastActive_Date = StringFormat("%04i", $ld[3]) & '-' & StringFormat("%02i", $ld[1]) & '-' & StringFormat("%02i", $ld[2]) + + ;Check If First GPS Information is Already in DB, If it is get the GpsID, If not add it and get its GpsID + $query = "SELECT TOP 1 GPSID FROM GPS WHERE Latitude = '" & $LoadLatitude & "' And Longitude = '" & $LoadLongitude & "' And Date1 = '" & $LoadFirstActive_Date & "' And Time1 = '" & $LoadFirstActive_Time & "'" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch = 0 Then + $AddGID += 1 + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $LoadLatitude & '|' & $LoadLongitude & '|' & $LoadSat & '|0|0|0|0|0|0|' & $LoadFirstActive_Date & '|' & $LoadFirstActive_Time) + $LoadGID = $GPS_ID + Else + $LoadGID = $GpsMatchArray[1][1] + EndIf + ;Add First AP Info to DB, Listview, and Treeview + $NewApAdded = _AddApData(0, $LoadGID, $BSSID, $SSID, $Channel, $Authentication, $Encryption, $NetworkType, $RadioType, $BasicTransferRates, $OtherTransferRates, $HighGpsSignal, $RSSI) + If $NewApAdded <> 0 Then $AddAP += 1 + ;Check If Last GPS Information is Already in DB, If it is get the GpsID, If not add it and get its GpsID + $query = "SELECT TOP 1 GPSID FROM GPS WHERE Latitude = '" & $LoadLatitude & "' And Longitude = '" & $LoadLongitude & "' And Date1 = '" & $LoadLastActive_Date & "' And Time1 = '" & $LoadLastActive_Time & "'" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch = 0 Then + $AddGID += 1 + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $LoadLatitude & '|' & $LoadLongitude & '|' & $LoadSat & '|0|0|0|0|0|0|' & $LoadLastActive_Date & '|' & $LoadLastActive_Time) + $LoadGID = $GPS_ID + Else + $LoadGID = $GpsMatchArray[1][1] + EndIf + ;Add Last AP Info to DB, Listview, and Treeview + $NewApAdded = _AddApData(0, $LoadGID, $BSSID, $SSID, $Channel, $Authentication, $Encryption, $NetworkType, $RadioType, $BasicTransferRates, $OtherTransferRates, $HighGpsSignal, $RSSI) + If $NewApAdded <> 0 Then $AddAP += 1 + Else + ;ExitLoop + EndIf + EndIf + + If TimerDiff($UpdateTimer) > 600 Or ($currentline = $totallines) Then + $min = (TimerDiff($begintime) / 60000) ;convert from miniseconds to minutes + $percent = ($currentline / $totallines) * 100 + GUICtrlSetData($progressbar, $percent) + GUICtrlSetData($percentlabel, $Text_Progress & ': ' & Round($percent, 1)) + GUICtrlSetData($linemin, $Text_LinesMin & ': ' & Round($currentline / $min, 1)) + GUICtrlSetData($newlines, $Text_NewAPs & ': ' & $AddAP & ' - ' & $Text_NewGIDs & ':' & $AddGID) + GUICtrlSetData($minutes, $Text_Minutes & ': ' & Round($min, 1)) + GUICtrlSetData($linetotal, $Text_LineTotal & ': ' & $currentline & "/" & $totallines) + GUICtrlSetData($estimatedtime, $Text_EstimatedTimeRemaining & ': ' & _DecToMinSec(Round(($totallines / Round($currentline / $min, 1)) - $min, 1)) & "/" & _DecToMinSec(Round($totallines / Round($currentline / $min, 1), 1))) + $UpdateTimer = TimerInit() + EndIf + If TimerDiff($MemReleaseTimer) > 10000 Then + _ReduceMemory() + $MemReleaseTimer = TimerInit() + EndIf + $currentline += 1 + $closebtn = _GUICtrlButton_GetState($NsCancel) + If BitAND($closebtn, $BST_PUSHED) = $BST_PUSHED Then ExitLoop + Next + EndIf + FileClose($vistumblerfile) + $query = "DELETE * FROM TempGpsIDMatchTabel" + _ExecuteMDB($VistumblerDB, $DB_OBJ, $query) + _DropTable($VistumblerDB, 'TempGpsIDMatchTabel', $DB_OBJ) +EndFunc ;==>_ImportVS1 + +Func _ImportCSV($CSVfile) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ImportCSV()') ;#Debug Display + $vistumblerfile = FileOpen($CSVfile, 0) + If $vistumblerfile <> -1 Then + $begintime = TimerInit() + $currentline = 1 + $AddAP = 0 + $AddGID = 0 + ;Start Importing File + $CSVArray = _ParseCSV($CSVfile, ',|', '"') + $iSize = UBound($CSVArray) - 1 + $iCol = UBound($CSVArray, 2) + If $iCol = 23 Then ;Import Vistumbler Detailed CSV v1 + For $lc = 1 To $iSize + $s = $CSVArray[$lc][0] + $r = $CSVArray[$lc][1] + + $ImpSSID = $CSVArray[$lc][0] + If StringLeft($ImpSSID, 1) = '"' And StringRight($ImpSSID, 1) = '"' Then $ImpSSID = StringTrimLeft(StringTrimRight($ImpSSID, 1), 1) + $ImpBSSID = $CSVArray[$lc][1] + $ImpMANU = $CSVArray[$lc][2] + If StringLeft($ImpMANU, 1) = '"' And StringRight($ImpMANU, 1) = '"' Then $ImpMANU = StringTrimLeft(StringTrimRight($ImpMANU, 1), 1) + $ImpSig = $CSVArray[$lc][3] + $ImpRSSI = _SignalPercentToDb($ImpSig) + $ImpAUTH = $CSVArray[$lc][4] + $ImpENCR = $CSVArray[$lc][5] + $ImpRAD = $CSVArray[$lc][6] + $ImpCHAN = $CSVArray[$lc][7] + $ImpBTX = $CSVArray[$lc][8] + If StringLeft($ImpBTX, 1) = '"' And StringRight($ImpBTX, 1) = '"' Then $ImpBTX = StringTrimLeft(StringTrimRight($ImpBTX, 1), 1) + $ImpOTX = $CSVArray[$lc][9] + If StringLeft($ImpOTX, 1) = '"' And StringRight($ImpOTX, 1) = '"' Then $ImpOTX = StringTrimLeft(StringTrimRight($ImpOTX, 1), 1) + $ImpNET = $CSVArray[$lc][10] + $ImpLAB = $CSVArray[$lc][11] + If StringLeft($ImpLAB, 1) = '"' And StringRight($ImpLAB, 1) = '"' Then $ImpLAB = StringTrimLeft(StringTrimRight($ImpLAB, 1), 1) + $ImpLat = _Format_GPS_DDD_to_DMM($CSVArray[$lc][12], "N", "S") + $ImpLon = _Format_GPS_DDD_to_DMM($CSVArray[$lc][13], "E", "W") + $ImpSat = $CSVArray[$lc][14] + $ImpHDOP = $CSVArray[$lc][15] + $ImpAlt = $CSVArray[$lc][16] + $ImpGeo = $CSVArray[$lc][17] + $ImpSpeedKMH = $CSVArray[$lc][18] + $ImpSpeedMPH = $CSVArray[$lc][19] + $ImpTrackAngle = $CSVArray[$lc][20] + $ImpDate = $CSVArray[$lc][21] + $ImpTime = $CSVArray[$lc][22] + + + $query = "SELECT GPSID FROM GPS WHERE Latitude = '" & $ImpLat & "' And Longitude = '" & $ImpLon & "' And NumOfSats = '" & $ImpSat & "' And Date1 = '" & $ImpDate & "' And Time1 = '" & $ImpTime & "'" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch = 0 Then + $AddGID += 1 + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $ImpLat & '|' & $ImpLon & '|' & $ImpSat & '|' & $ImpHDOP & '|' & $ImpAlt & '|' & $ImpGeo & '|' & $ImpSpeedKMH & '|' & $ImpSpeedMPH & '|' & $ImpTrackAngle & '|' & $ImpDate & '|' & $ImpTime) + $ImpGID = $GPS_ID + ElseIf $FoundGpsMatch = 1 Then + $ImpGID = $GpsMatchArray[1][1] + EndIf + + $NewApAdded = _AddApData(0, $ImpGID, $ImpBSSID, $ImpSSID, $ImpCHAN, $ImpAUTH, $ImpENCR, $ImpNET, $ImpRAD, $ImpBTX, $ImpOTX, $ImpSig, $ImpRSSI) + If $NewApAdded <> 0 Then $AddAP += 1 + + If TimerDiff($UpdateTimer) > 600 Or ($currentline = $iSize) Then + $min = (TimerDiff($begintime) / 60000) ;convert from miniseconds to minutes + $percent = ($currentline / $iSize) * 100 + GUICtrlSetData($progressbar, $percent) + GUICtrlSetData($percentlabel, $Text_Progress & ': ' & Round($percent, 1)) + GUICtrlSetData($linemin, $Text_LinesMin & ': ' & Round($currentline / $min, 1)) + GUICtrlSetData($newlines, $Text_NewAPs & ': ' & $AddAP & ' - ' & $Text_NewGIDs & ':' & $AddGID) + GUICtrlSetData($minutes, $Text_Minutes & ': ' & Round($min, 1)) + GUICtrlSetData($linetotal, $Text_LineTotal & ': ' & $currentline & "/" & $iSize) + GUICtrlSetData($estimatedtime, $Text_EstimatedTimeRemaining & ': ' & Round(($iSize / Round($currentline / $min, 1)) - $min, 1) & "/" & Round($iSize / Round($currentline / $min, 1), 1)) + $UpdateTimer = TimerInit() + EndIf + If TimerDiff($MemReleaseTimer) > 10000 Then + _ReduceMemory() + $MemReleaseTimer = TimerInit() + EndIf + $currentline += 1 + $closebtn = _GUICtrlButton_GetState($NsCancel) + If BitAND($closebtn, $BST_PUSHED) = $BST_PUSHED Then ExitLoop + + Next + ElseIf $iCol = 26 Then ;Import Vistumbler Detailed CSV v2 + For $lc = 1 To $iSize + $s = $CSVArray[$lc][0] + $r = $CSVArray[$lc][1] + + $ImpSSID = $CSVArray[$lc][0] + If StringLeft($ImpSSID, 1) = '"' And StringRight($ImpSSID, 1) = '"' Then $ImpSSID = StringTrimLeft(StringTrimRight($ImpSSID, 1), 1) + $ImpBSSID = $CSVArray[$lc][1] + $ImpMANU = $CSVArray[$lc][2] + If StringLeft($ImpMANU, 1) = '"' And StringRight($ImpMANU, 1) = '"' Then $ImpMANU = StringTrimLeft(StringTrimRight($ImpMANU, 1), 1) + $ImpSig = $CSVArray[$lc][3] + ;$ImpHighSig = $CSVArray[$lc][4] + $ImpRSSI = $CSVArray[$lc][5] + ;$ImpHighRSSI = $CSVArray[$lc][6] + $ImpAUTH = $CSVArray[$lc][7] + $ImpENCR = $CSVArray[$lc][8] + $ImpRAD = $CSVArray[$lc][9] + $ImpCHAN = $CSVArray[$lc][10] + $ImpBTX = $CSVArray[$lc][11] + If StringLeft($ImpBTX, 1) = '"' And StringRight($ImpBTX, 1) = '"' Then $ImpBTX = StringTrimLeft(StringTrimRight($ImpBTX, 1), 1) + $ImpOTX = $CSVArray[$lc][12] + If StringLeft($ImpOTX, 1) = '"' And StringRight($ImpOTX, 1) = '"' Then $ImpOTX = StringTrimLeft(StringTrimRight($ImpOTX, 1), 1) + $ImpNET = $CSVArray[$lc][13] + $ImpLAB = $CSVArray[$lc][14] + If StringLeft($ImpLAB, 1) = '"' And StringRight($ImpLAB, 1) = '"' Then $ImpLAB = StringTrimLeft(StringTrimRight($ImpLAB, 1), 1) + $ImpLat = _Format_GPS_DDD_to_DMM($CSVArray[$lc][15], "N", "S") + $ImpLon = _Format_GPS_DDD_to_DMM($CSVArray[$lc][16], "E", "W") + $ImpSat = $CSVArray[$lc][17] + $ImpHDOP = $CSVArray[$lc][18] + $ImpAlt = $CSVArray[$lc][19] + $ImpGeo = $CSVArray[$lc][20] + $ImpSpeedKMH = $CSVArray[$lc][21] + $ImpSpeedMPH = $CSVArray[$lc][22] + $ImpTrackAngle = $CSVArray[$lc][23] + $ImpDate = $CSVArray[$lc][24] + $ImpTime = $CSVArray[$lc][25] + + $query = "SELECT GPSID FROM GPS WHERE Latitude = '" & $ImpLat & "' And Longitude = '" & $ImpLon & "' And NumOfSats = '" & $ImpSat & "' And Date1 = '" & $ImpDate & "' And Time1 = '" & $ImpTime & "'" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch = 0 Then + $AddGID += 1 + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $ImpLat & '|' & $ImpLon & '|' & $ImpSat & '|' & $ImpHDOP & '|' & $ImpAlt & '|' & $ImpGeo & '|' & $ImpSpeedKMH & '|' & $ImpSpeedMPH & '|' & $ImpTrackAngle & '|' & $ImpDate & '|' & $ImpTime) + $ImpGID = $GPS_ID + ElseIf $FoundGpsMatch = 1 Then + $ImpGID = $GpsMatchArray[1][1] + EndIf + + $NewApAdded = _AddApData(0, $ImpGID, $ImpBSSID, $ImpSSID, $ImpCHAN, $ImpAUTH, $ImpENCR, $ImpNET, $ImpRAD, $ImpBTX, $ImpOTX, $ImpSig, $ImpRSSI) + If $NewApAdded <> 0 Then $AddAP += 1 + + If TimerDiff($UpdateTimer) > 600 Or ($currentline = $iSize) Then + $min = (TimerDiff($begintime) / 60000) ;convert from miniseconds to minutes + $percent = ($currentline / $iSize) * 100 + GUICtrlSetData($progressbar, $percent) + GUICtrlSetData($percentlabel, $Text_Progress & ': ' & Round($percent, 1)) + GUICtrlSetData($linemin, $Text_LinesMin & ': ' & Round($currentline / $min, 1)) + GUICtrlSetData($newlines, $Text_NewAPs & ': ' & $AddAP & ' - ' & $Text_NewGIDs & ':' & $AddGID) + GUICtrlSetData($minutes, $Text_Minutes & ': ' & Round($min, 1)) + GUICtrlSetData($linetotal, $Text_LineTotal & ': ' & $currentline & "/" & $iSize) + GUICtrlSetData($estimatedtime, $Text_EstimatedTimeRemaining & ': ' & Round(($iSize / Round($currentline / $min, 1)) - $min, 1) & "/" & Round($iSize / Round($currentline / $min, 1), 1)) + $UpdateTimer = TimerInit() + EndIf + If TimerDiff($MemReleaseTimer) > 10000 Then + _ReduceMemory() + $MemReleaseTimer = TimerInit() + EndIf + $currentline += 1 + $closebtn = _GUICtrlButton_GetState($NsCancel) + If BitAND($closebtn, $BST_PUSHED) = $BST_PUSHED Then ExitLoop + + Next + ElseIf $iCol = 16 Or $iCol = 18 Then ;Import Vistumbler Summary CSV + For $lc = 1 To $iSize + $ImpSSID = $CSVArray[$lc][0] + If StringLeft($ImpSSID, 1) = '"' And StringRight($ImpSSID, 1) = '"' Then $ImpSSID = StringTrimLeft(StringTrimRight($ImpSSID, 1), 1) + $ImpBSSID = $CSVArray[$lc][1] + $ImpMANU = $CSVArray[$lc][2] + If StringLeft($ImpMANU, 1) = '"' And StringRight($ImpMANU, 1) = '"' Then $ImpMANU = StringTrimLeft(StringTrimRight($ImpMANU, 1), 1) + $ImpHighSig = $CSVArray[$lc][3] + $ImpRSSI = _SignalPercentToDb($ImpHighSig) + $ImpAUTH = $CSVArray[$lc][4] + $ImpENCR = $CSVArray[$lc][5] + $ImpRAD = $CSVArray[$lc][6] + $ImpCHAN = $CSVArray[$lc][7] + $ImpLat = _Format_GPS_DDD_to_DMM($CSVArray[$lc][8], "N", "S") + $ImpLon = _Format_GPS_DDD_to_DMM($CSVArray[$lc][9], "E", "W") + $ImpBTX = $CSVArray[$lc][10] + If StringLeft($ImpBTX, 1) = '"' And StringRight($ImpBTX, 1) = '"' Then $ImpBTX = StringTrimLeft(StringTrimRight($ImpBTX, 1), 1) + $ImpOTX = $CSVArray[$lc][11] + If StringLeft($ImpOTX, 1) = '"' And StringRight($ImpOTX, 1) = '"' Then $ImpOTX = StringTrimLeft(StringTrimRight($ImpOTX, 1), 1) + $ImpFirstDateTime = $CSVArray[$lc][12] + $ImpLastDateTime = $CSVArray[$lc][13] + $ImpNET = $CSVArray[$lc][14] + $ImpLAB = $CSVArray[$lc][15] + If StringLeft($ImpLAB, 1) = '"' And StringRight($ImpLAB, 1) = '"' Then $ImpLAB = StringTrimLeft(StringTrimRight($ImpLAB, 1), 1) + $ImpSat = "00" + If $iCol = 18 Then ;If this is a newer summery csv, use the new RSSI and Signal values + $ImpHighSig = $CSVArray[$lc][16] + $ImpRSSI = $CSVArray[$lc][17] + EndIf + + $tsplit = StringSplit($ImpFirstDateTime, ' ') + $LoadFirstActive_Date = $tsplit[1] + $LoadFirstActive_Time = $tsplit[2] + + $tsplit = StringSplit($ImpLastDateTime, ' ') + $LoadLastActive_Date = $tsplit[1] + $LoadLastActive_Time = $tsplit[2] + + ;Check If First GPS Information is Already in DB, If it is get the GpsID, If not add it and get its GpsID + $query = "SELECT GPSID FROM GPS WHERE Latitude = '" & $ImpLat & "' And Longitude = '" & $ImpLon & "' And Date1 = '" & $LoadFirstActive_Date & "' And Time1 = '" & $LoadFirstActive_Time & "'" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch = 0 Then + $AddGID += 1 + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $ImpLat & '|' & $ImpLon & '|' & $ImpSat & '|0|0|0|0|0|0|' & $LoadFirstActive_Date & '|' & $LoadFirstActive_Time) + $LoadGID = $GPS_ID + Else + $LoadGID = $GpsMatchArray[1][1] + EndIf + ;Add First AP Info to DB, Listview, and Treeview + $NewApAdded = _AddApData(0, $LoadGID, $ImpBSSID, $ImpSSID, $ImpCHAN, $ImpAUTH, $ImpENCR, $ImpNET, $ImpRAD, $ImpBTX, $ImpOTX, $ImpHighSig, $ImpRSSI) + If $NewApAdded <> 0 Then $AddAP += 1 + ;Check If Last GPS Information is Already in DB, If it is get the GpsID, If not add it and get its GpsID + $query = "SELECT GPSID FROM GPS WHERE Latitude = '" & $ImpLat & "' And Longitude = '" & $ImpLon & "' And Date1 = '" & $LoadLastActive_Date & "' And Time1 = '" & $LoadLastActive_Time & "'" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch = 0 Then + $AddGID += 1 + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $ImpLat & '|' & $ImpLon & '|' & $ImpSat & '|0|0|0|0|0|0|' & $LoadLastActive_Date & '|' & $LoadLastActive_Time) + $LoadGID = $GPS_ID + Else + $LoadGID = $GpsMatchArray[1][1] + EndIf + ;Add Last AP Info to DB, Listview, and Treeview + $NewApAdded = _AddApData(0, $LoadGID, $ImpBSSID, $ImpSSID, $ImpCHAN, $ImpAUTH, $ImpENCR, $ImpNET, $ImpRAD, $ImpBTX, $ImpOTX, $ImpHighSig, $ImpRSSI) + If $NewApAdded <> 0 Then $AddAP += 1 + + If TimerDiff($UpdateTimer) > 600 Or ($currentline = $iSize) Then + $min = (TimerDiff($begintime) / 60000) ;convert from miniseconds to minutes + $percent = ($currentline / $iSize) * 100 + GUICtrlSetData($progressbar, $percent) + GUICtrlSetData($percentlabel, $Text_Progress & ': ' & Round($percent, 1)) + GUICtrlSetData($linemin, $Text_LinesMin & ': ' & Round($currentline / $min, 1)) + GUICtrlSetData($newlines, $Text_NewAPs & ': ' & $AddAP & ' - ' & $Text_NewGIDs & ':' & $AddGID) + GUICtrlSetData($minutes, $Text_Minutes & ': ' & Round($min, 1)) + GUICtrlSetData($linetotal, $Text_LineTotal & ': ' & $currentline & "/" & $iSize) + GUICtrlSetData($estimatedtime, $Text_EstimatedTimeRemaining & ': ' & Round(($iSize / Round($currentline / $min, 1)) - $min, 1) & "/" & Round($iSize / Round($currentline / $min, 1), 1)) + $UpdateTimer = TimerInit() + EndIf + If TimerDiff($MemReleaseTimer) > 10000 Then + _ReduceMemory() + $MemReleaseTimer = TimerInit() + EndIf + $currentline += 1 + $closebtn = _GUICtrlButton_GetState($NsCancel) + If BitAND($closebtn, $BST_PUSHED) = $BST_PUSHED Then ExitLoop + Next + EndIf + EndIf +EndFunc ;==>_ImportCSV + +Func _ImportNS1($NS1file) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ImportNS1()') ;#Debug Display + $netstumblerfile = FileOpen($NS1file, 0) + + If $netstumblerfile <> -1 Then + ;Get Total number of lines + $totallines = 0 + While 1 + FileReadLine($netstumblerfile) + If @error = -1 Then ExitLoop + $totallines += 1 + WEnd + $begintime = TimerInit() + $currentline = 1 + $AddAP = 0 + $AddGID = 0 + For $Load = 1 To $totallines + $linein = FileReadLine($netstumblerfile, $Load) ;Open Line in file + If @error = -1 Then ExitLoop + ;ConsoleWrite($linein & @CRLF) + If StringInStr($linein, "# $DateGMT:") Then $Date = StringTrimLeft($linein, 12) ;If the date tag is found, set date + If StringLeft($linein, 1) <> "#" Then ;If the line is not commented out, get AP information + $array = StringSplit($linein, " ") ;Seperate AP information + If $array[0] = 13 Then + If $linein <> "" And IsArray($array) Then + ;Decode Flags + $HexIn = Number("0x" & $array[9]) + Global $ESS = False, $nsimploopBSS = False, $WEP = False, $ShortPreAm = False + If BitAND($HexIn, 0x1) Then $ESS = True + If BitAND($HexIn, 0x2) Then $nsimploopBSS = True + If BitAND($HexIn, 0x10) Then $WEP = True + ;Set AP Type based on flags + $Type = '' + If $HexIn Then + If $ESS = True Then $Type &= $SearchWord_Infrastructure + If $nsimploopBSS = True Then $Type &= $SearchWord_Adhoc + EndIf + If $WEP = True Then + $LoadSecType = 2 + If $UseNativeWifi = 1 Then + $Encryption = 'WEP' + $Authentication = 'Open' + Else + $Encryption = $SearchWord_Wep + $Authentication = $SearchWord_Open + EndIf + Else + $LoadSecType = 1 + If $UseNativeWifi = 1 Then + $Encryption = 'Unencrypted' + $Authentication = 'Open' + Else + $Encryption = $SearchWord_None + $Authentication = $SearchWord_Open + EndIf + EndIf + ;Set other information + $snrarray1 = StringSplit($array[7], " ") + $SSID = StringTrimLeft(StringTrimRight($array[3], 2), 2) + $BSSID = StringUpper(StringTrimLeft(StringTrimRight($array[5], 2), 2)) + $time = StringTrimRight($array[6], 6) + If StringInStr($time, '.') = 0 Then $time &= '.000' + $ImpNsSig = $snrarray1[2] + If $ImpNsSig <> "-32618" Then + $RSSI = $ImpNsSig - 95 ;Subtact 95 from the wi-scan export's "Sig" number to get the actual rssi (http://www.netstumbler.org/netstumbler/determining-rssi-t11729.html) + $Signal = _DbToSignalPercent($RSSI) + $LoadLatitude = _Format_GPS_All_to_DMM(StringReplace($array[1], "N 360.0000000", "N 0.0000000")) + $LoadLongitude = _Format_GPS_All_to_DMM(StringReplace($array[2], "E 720.0000000", "E 0.0000000")) + $Channel = $array[13] + + $query = "SELECT GPSID FROM GPS WHERE Latitude = '" & $LoadLatitude & "' And Longitude = '" & $LoadLongitude & "' And Date1 = '" & $Date & "' And Time1 = '" & $time & "'" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch = 0 Then + $AddGID += 1 + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $LoadLatitude & '|' & $LoadLongitude & '|00|0|0|0|0|0|0|' & $Date & '|' & $time) + $LoadGID = $GPS_ID + ElseIf $FoundGpsMatch = 1 Then + $LoadGID = $GpsMatchArray[1][1] + EndIf + ;Add Last AP Info to DB, Listview + $NewApAdded = _AddApData(0, $LoadGID, $BSSID, $SSID, $Channel, $Authentication, $Encryption, $Type, $Text_Unknown, $Text_Unknown, $Text_Unknown, $Signal, $RSSI) + If $NewApAdded <> 0 Then $AddAP += 1 + EndIf + EndIf + Else + ;ExitLoop + EndIf + EndIf + + If TimerDiff($UpdateTimer) > 600 Or ($currentline = $totallines) Then + $min = (TimerDiff($begintime) / 60000) ;convert from miniseconds to minutes + $percent = ($currentline / $totallines) * 100 + GUICtrlSetData($progressbar, $percent) + GUICtrlSetData($percentlabel, $Text_Progress & ': ' & Round($percent, 1)) + GUICtrlSetData($linemin, $Text_LinesMin & ': ' & Round($Load / $min, 1)) + GUICtrlSetData($newlines, $Text_NewAPs & ': ' & $AddAP & ' - ' & $Text_NewGIDs & ':' & $AddGID) + GUICtrlSetData($minutes, $Text_Minutes & ': ' & Round($min, 1)) + GUICtrlSetData($linetotal, $Text_LineTotal & ': ' & $Load & "/" & $totallines) + GUICtrlSetData($estimatedtime, $Text_EstimatedTimeRemaining & ': ' & Round(($totallines / Round($Load / $min, 1)) - $min, 1) & "/" & Round($totallines / Round($Load / $min, 1), 1)) + $UpdateTimer = TimerInit() + EndIf + If TimerDiff($MemReleaseTimer) > 10000 Then + _ReduceMemory() + $MemReleaseTimer = TimerInit() + EndIf + $currentline += 1 + $closebtn = _GUICtrlButton_GetState($NsCancel) + If BitAND($closebtn, $BST_PUSHED) = $BST_PUSHED Then ExitLoop + Next + EndIf + FileClose($netstumblerfile) +EndFunc ;==>_ImportNS1 + +Func _ImportWardriveDb3($DB3file) + _SQLite_Startup() + $WardriveImpDB = _SQLite_Open($DB3file, $SQLITE_OPEN_READWRITE + $SQLITE_OPEN_CREATE, $SQLITE_ENCODING_UTF16) + _SQLite_Exec($WardriveImpDB, "pragma integrity_check") ;Speed vs Data security. Speed Wins for now. + Local $NetworkMatchArray, $iRows, $iColumns, $iRval + $query = "SELECT bssid, ssid, capabilities, level, frequency, lat, lon, alt, timestamp FROM networks" + $iRval = _SQLite_GetTable2d($WardriveImpDB, $query, $NetworkMatchArray, $iRows, $iColumns) + $WardriveAPs = $iRows + + $UpdateTimer = TimerInit() + $begintime = TimerInit() + $AddAP = 0 + $AddGID = 0 + For $NewAP = 1 To $WardriveAPs + $Found_BSSID = StringUpper($NetworkMatchArray[$NewAP][0]) + $Found_SSID = $NetworkMatchArray[$NewAP][1] + $Found_Capabilities = $NetworkMatchArray[$NewAP][2] + $Found_RSSI = $NetworkMatchArray[$NewAP][3] + $Found_Signal = _DbToSignalPercent($Found_RSSI) + $Found_Frequency = $NetworkMatchArray[$NewAP][4] + $Found_Lat = _Format_GPS_DDD_to_DMM($NetworkMatchArray[$NewAP][5], "N", "S") + $Found_Lon = _Format_GPS_DDD_to_DMM($NetworkMatchArray[$NewAP][6], "E", "W") + $Found_Alt = $NetworkMatchArray[$NewAP][7] + $Found_TimeStamp = StringTrimRight($NetworkMatchArray[$NewAP][8], 3) + + ;Get Authentication and Encrytion from capabilities + If StringInStr($Found_Capabilities, "WPA2-PSK-CCMP") Or StringInStr($Found_Capabilities, "WPA2-PSK-TKIP+CCMP") Then + $Found_AUTH = "WPA2-Personal" + $Found_ENCR = "CCMP" + $Found_SecType = "3" + ElseIf StringInStr($Found_Capabilities, "WPA-PSK-CCMP") Or StringInStr($Found_Capabilities, "WPA-PSK-TKIP+CCMP") Then + $Found_AUTH = "WPA-Personal" + $Found_ENCR = "CCMP" + $Found_SecType = "3" + ElseIf StringInStr($Found_Capabilities, "WPA2-EAP-CCMP") Or StringInStr($Found_Capabilities, "WPA2-EAP-TKIP+CCMP") Then + $Found_AUTH = "WPA2-Enterprise" + $Found_ENCR = "CCMP" + $Found_SecType = "3" + ElseIf StringInStr($Found_Capabilities, "WPA-EAP-CCMP") Or StringInStr($Found_Capabilities, "WPA-EAP-TKIP+CCMP") Then + $Found_AUTH = "WPA-Enterprise" + $Found_ENCR = "CCMP" + $Found_SecType = "3" + ElseIf StringInStr($Found_Capabilities, "WPA2-PSK-TKIP") Then + $Found_AUTH = "WPA2-Personal" + $Found_ENCR = "TKIP" + $Found_SecType = "3" + ElseIf StringInStr($Found_Capabilities, "WPA-PSK-TKIP") Then + $Found_AUTH = "WPA-Personal" + $Found_ENCR = "TKIP" + $Found_SecType = "3" + ElseIf StringInStr($Found_Capabilities, "WPA2-EAP-TKIP") Then + $Found_AUTH = "WPA2-Enterprise" + $Found_ENCR = "TKIP" + $Found_SecType = "3" + ElseIf StringInStr($Found_Capabilities, "WPA-EAP-TKIP") Then + $Found_AUTH = "WPA-Enterprise" + $Found_ENCR = "TKIP" + $Found_SecType = "3" + ElseIf StringInStr($Found_Capabilities, "WEP") Then + $Found_AUTH = "Open" + $Found_ENCR = "WEP" + $Found_SecType = "2" + Else + $Found_AUTH = "Open" + $Found_ENCR = "None" + $Found_SecType = "1" + EndIf + + ;Get Network Type from capabilities + If StringInStr($Found_Capabilities, "[IBSS]") Then + $Found_NETTYPE = "Adhoc" + Else + $Found_NETTYPE = "Infrastructure" + EndIf + + ;Get Channel From Frequency + If $Found_Frequency = "2412" Then + $Found_CHAN = "001" + ElseIf $Found_Frequency = "2417" Then + $Found_CHAN = "002" + ElseIf $Found_Frequency = "2422" Then + $Found_CHAN = "003" + ElseIf $Found_Frequency = "2427" Then + $Found_CHAN = "004" + ElseIf $Found_Frequency = "2432" Then + $Found_CHAN = "005" + ElseIf $Found_Frequency = "2437" Then + $Found_CHAN = "006" + ElseIf $Found_Frequency = "2442" Then + $Found_CHAN = "007" + ElseIf $Found_Frequency = "2447" Then + $Found_CHAN = "008" + ElseIf $Found_Frequency = "2452" Then + $Found_CHAN = "009" + ElseIf $Found_Frequency = "2457" Then + $Found_CHAN = "010" + ElseIf $Found_Frequency = "2462" Then + $Found_CHAN = "011" + ElseIf $Found_Frequency = "2467" Then + $Found_CHAN = "012" + ElseIf $Found_Frequency = "2472" Then + $Found_CHAN = "013" + Else + $Found_CHAN = "Unknown" + EndIf + + $Found_Date = _StringFormatTime("%Y", $Found_TimeStamp) & "-" & _StringFormatTime("%m", $Found_TimeStamp) & "-" & _StringFormatTime("%d", $Found_TimeStamp) + $Found_Time = _StringFormatTime("%X", $Found_TimeStamp) & ".000" + + ;Add GPS data in Vistumbler DB + $query = "SELECT GPSID FROM GPS WHERE Latitude = '" & $Found_Lat & "' And Longitude = '" & $Found_Lon & "' And Date1 = '" & $Found_Date & "' And Time1 = '" & $Found_Time & "'" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch = 0 Then + $AddGID += 1 + $GPS_ID += 1 + ;Add GPS ID + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $Found_Lat & '|' & $Found_Lon & '|0|0|' & $Found_Alt & '|0|0|0|0|' & $Found_Date & '|' & $Found_Time) + $NewGpsId = $GPS_ID + ElseIf $FoundGpsMatch = 1 Then + $NewGpsId = $GpsMatchArray[1][1] + EndIf + + ;Add AP data into Vistumbler DB + $NewApAdded = _AddApData(0, $NewGpsId, $Found_BSSID, $Found_SSID, $Found_CHAN, $Found_AUTH, $Found_ENCR, $Found_NETTYPE, "802.11g", "Unknown", "Unknown", $Found_Signal, $Found_RSSI) + If $NewApAdded <> 0 Then $AddAP += 1 + + If TimerDiff($UpdateTimer) > 600 Or ($NewAP = $WardriveAPs) Then + $min = (TimerDiff($begintime) / 60000) ;convert from miniseconds to minutes + $percent = ($NewAP / $WardriveAPs) * 100 + GUICtrlSetData($progressbar, $percent) + GUICtrlSetData($percentlabel, $Text_Progress & ': ' & Round($percent, 1)) + GUICtrlSetData($linemin, $Text_LinesMin & ': ' & Round($Load / $min, 1)) + GUICtrlSetData($newlines, $Text_NewAPs & ': ' & $AddAP & ' - ' & $Text_NewGIDs & ':' & $AddGID) + GUICtrlSetData($minutes, $Text_Minutes & ': ' & Round($min, 1)) + GUICtrlSetData($linetotal, $Text_LineTotal & ': ' & $NewAP & " / " & $WardriveAPs) + GUICtrlSetData($estimatedtime, $Text_EstimatedTimeRemaining & ': ' & Round(($WardriveAPs / Round($NewAP / $min, 1)) - $min, 1) & "/" & Round($WardriveAPs / Round($NewAP / $min, 1), 1)) + $UpdateTimer = TimerInit() + EndIf + Next + _SQLite_Close($WardriveImpDB) + _SQLite_Shutdown() +EndFunc ;==>_ImportWardriveDb3 + +;------------------------------------------------------------------------------------------------------------------------------- +; GOOGLE EARTH SAVE FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func SaveToKML() + SaveToKmlGUI(0) +EndFunc ;==>SaveToKML + +Func _ExportFilteredKML() + SaveToKmlGUI(1) +EndFunc ;==>_ExportFilteredKML + +Func SaveToKmlGUI($Filter = 0, $SelectedApID = 0) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, 'SaveToKML()') ;#Debug Display + Opt("GUIOnEventMode", 0) + $ExportKMLGUI = GUICreate($Text_ExportToKML, 250, 305) + GUISetBkColor($BackgroundColor) + $GUI_ExportKML_PosMap = GUICtrlCreateCheckbox($Text_ShowGpsPositionMap, 15, 15, 240, 15) + If $MapPos = 1 Then GUICtrlSetState($GUI_ExportKML_PosMap, $GUI_CHECKED) + $GUI_ExportKML_SigMap = GUICtrlCreateCheckbox($Text_ShowGpsSignalMap, 15, 35, 240, 15) + If $MapSig = 1 Then GUICtrlSetState($GUI_ExportKML_SigMap, $GUI_CHECKED) + $GUI_ExportKML_SigUseRSSI = GUICtrlCreateCheckbox($Text_UseRssiSignalValue, 30, 55, 200, 15) + If $MapSigUseRSSI = 1 Then GUICtrlSetState($GUI_ExportKML_SigUseRSSI, $GUI_CHECKED) + $GUI_ExportKML_SigCir = GUICtrlCreateCheckbox($Text_UseCircleToShowSigStength, 30, 75, 200, 15) + GUICtrlCreateLabel($Text_Color & ":", 30, 95, 45, 15) + $GUI_CirSigMapColor = GUICtrlCreateInput($CirSigMapColor, 75, 95, 75, 15) + $GUI_CirSigMapColorBrowse = GUICtrlCreateButton($Text_Browse, 160, 92, 75, 20) + If $MapSigType = 1 Then + GUICtrlSetState($GUI_ExportKML_SigCir, $GUI_CHECKED) + Else + GUICtrlSetState($GUI_CirSigMapColor, $GUI_DISABLE) + GUICtrlSetState($GUI_CirSigMapColorBrowse, $GUI_DISABLE) + EndIf + $GUI_ExportKML_RangeMap = GUICtrlCreateCheckbox($Text_ShowGpsRangeMap, 15, 115, 240, 15) + GUICtrlCreateLabel($Text_Color & ":", 30, 135, 45, 15) + $GUI_CirRangeMapColor = GUICtrlCreateInput($CirRangeMapColor, 75, 135, 75, 15) + $GUI_CirRangeMapColorBrowse = GUICtrlCreateButton($Text_Browse, 160, 132, 75, 20) + If $MapRange = 1 Then + GUICtrlSetState($GUI_ExportKML_RangeMap, $GUI_CHECKED) + Else + GUICtrlSetState($GUI_CirRangeMapColor, $GUI_DISABLE) + GUICtrlSetState($GUI_CirRangeMapColorBrowse, $GUI_DISABLE) + EndIf + $GUI_ExportKML_DrawTrack = GUICtrlCreateCheckbox($Text_ShowGpsTack, 15, 155, 240, 15) + GUICtrlCreateLabel($Text_Color & ":", 30, 175, 45, 15) + $GUI_TrackColor = GUICtrlCreateInput($TrackColor, 75, 175, 75, 15) + $GUI_TrackColorBrowse = GUICtrlCreateButton($Text_Browse, 160, 172, 75, 20) + If $ShowTrack = 1 Then + GUICtrlSetState($GUI_ExportKML_DrawTrack, $GUI_CHECKED) + Else + GUICtrlSetState($GUI_TrackColor, $GUI_DISABLE) + GUICtrlSetState($GUI_TrackColorBrowse, $GUI_DISABLE) + EndIf + $GUI_ExportKML_MapOpen = GUICtrlCreateCheckbox($Text_MapOpenNetworks, 15, 195, 240, 15) + If $MapOpen = 1 Then GUICtrlSetState($GUI_ExportKML_MapOpen, $GUI_CHECKED) + $GUI_ExportKML_MapWEP = GUICtrlCreateCheckbox($Text_MapWepNetworks, 15, 215, 240, 15) + If $MapWEP = 1 Then GUICtrlSetState($GUI_ExportKML_MapWEP, $GUI_CHECKED) + $GUI_ExportKML_MapSec = GUICtrlCreateCheckbox($Text_MapSecureNetworks, 15, 235, 240, 15) + If $MapSec = 1 Then GUICtrlSetState($GUI_ExportKML_MapSec, $GUI_CHECKED) + + $GUI_ExportKML_UseLocalImages = GUICtrlCreateCheckbox($Text_UseLocalImages, 15, 255, 240, 15) + If $UseLocalKmlImagesOnExport = 1 Then GUICtrlSetState($GUI_ExportKML_UseLocalImages, $GUI_CHECKED) + $GUI_ExportKML_OK = GUICtrlCreateButton($Text_Ok, 40, 275, 81, 25, 0) + $GUI_ExportKML_Cancel = GUICtrlCreateButton($Text_Cancel, 139, 275, 81, 25, 0) + GUISetState(@SW_SHOW) + + While 1 + $nMsg = GUIGetMsg() + Switch $nMsg + Case $GUI_ExportKML_SigCir + If GUICtrlRead($GUI_ExportKML_SigCir) = 1 Then + GUICtrlSetState($GUI_CirSigMapColor, $GUI_ENABLE) + GUICtrlSetState($GUI_CirSigMapColorBrowse, $GUI_ENABLE) + Else + GUICtrlSetState($GUI_CirSigMapColor, $GUI_DISABLE) + GUICtrlSetState($GUI_CirSigMapColorBrowse, $GUI_DISABLE) + EndIf + Case $GUI_ExportKML_RangeMap + If GUICtrlRead($GUI_ExportKML_RangeMap) = 1 Then + GUICtrlSetState($GUI_CirRangeMapColor, $GUI_ENABLE) + GUICtrlSetState($GUI_CirRangeMapColorBrowse, $GUI_ENABLE) + Else + GUICtrlSetState($GUI_CirRangeMapColor, $GUI_DISABLE) + GUICtrlSetState($GUI_CirRangeMapColorBrowse, $GUI_DISABLE) + EndIf + Case $GUI_ExportKML_DrawTrack + If GUICtrlRead($GUI_ExportKML_DrawTrack) = 1 Then + GUICtrlSetState($GUI_TrackColor, $GUI_ENABLE) + GUICtrlSetState($GUI_TrackColorBrowse, $GUI_ENABLE) + Else + GUICtrlSetState($GUI_TrackColor, $GUI_DISABLE) + GUICtrlSetState($GUI_TrackColorBrowse, $GUI_DISABLE) + EndIf + Case $GUI_CirSigMapColorBrowse + $transparency = StringTrimRight(GUICtrlRead($GUI_CirSigMapColor), 6) + $color = _ChooseColor(1, '0x' & StringTrimLeft(GUICtrlRead($GUI_CirSigMapColor), 2), 1, $ExportKMLGUI) + If $color <> -1 Then GUICtrlSetData($GUI_CirSigMapColor, $transparency & StringReplace($color, "0x", "")) + Case $GUI_CirRangeMapColorBrowse + $transparency = StringTrimRight(GUICtrlRead($GUI_CirRangeMapColor), 6) + $color = _ChooseColor(1, '0x' & StringTrimLeft(GUICtrlRead($GUI_CirRangeMapColor), 2), 1, $ExportKMLGUI) + If $color <> -1 Then GUICtrlSetData($GUI_CirRangeMapColor, $transparency & StringReplace($color, "0x", "")) + Case $GUI_TrackColorBrowse + $transparency = StringTrimRight(GUICtrlRead($GUI_TrackColor), 6) + $color = _ChooseColor(1, '0x' & StringTrimLeft(GUICtrlRead($GUI_TrackColor), 2), 1, $ExportKMLGUI) + If $color <> -1 Then GUICtrlSetData($GUI_TrackColor, $transparency & StringReplace($color, "0x", "")) + Case $GUI_EVENT_CLOSE + GUIDelete($ExportKMLGUI) + ExitLoop + Case $GUI_ExportKML_Cancel + GUIDelete($ExportKMLGUI) + ExitLoop + Case $GUI_ExportKML_OK + Dim $MapPos = 0, $MapSig = 0, $MapRange = 0, $ShowTrack = 0, $MapSigUseRSSI = 0, $MapSigType = 0, $MapOpen = 0, $MapWEP = 0, $MapSec = 0, $UseLocalKmlImagesOnExport = 0 + If GUICtrlRead($GUI_ExportKML_PosMap) = 1 Then $MapPos = 1 + If GUICtrlRead($GUI_ExportKML_SigMap) = 1 Then $MapSig = 1 + If GUICtrlRead($GUI_ExportKML_RangeMap) = 1 Then $MapRange = 1 + If GUICtrlRead($GUI_ExportKML_DrawTrack) = 1 Then $ShowTrack = 1 + If GUICtrlRead($GUI_ExportKML_SigUseRSSI) = 1 Then $MapSigUseRSSI = 1 + If GUICtrlRead($GUI_ExportKML_SigCir) = 1 Then $MapSigType = 1 + If GUICtrlRead($GUI_ExportKML_MapOpen) = 1 Then $MapOpen = 1 + If GUICtrlRead($GUI_ExportKML_MapWEP) = 1 Then $MapWEP = 1 + If GUICtrlRead($GUI_ExportKML_MapSec) = 1 Then $MapSec = 1 + If GUICtrlRead($GUI_ExportKML_UseLocalImages) = 1 Then $UseLocalKmlImagesOnExport = 1 + $TrackColor = GUICtrlRead($GUI_TrackColor) + $CirSigMapColor = GUICtrlRead($GUI_CirSigMapColor) + $CirRangeMapColor = GUICtrlRead($GUI_CirRangeMapColor) + GUIDelete($ExportKMLGUI) + DirCreate($SaveDirKml) + $filename = FileSaveDialog("Google Earth Output File", $SaveDirKml, 'Google Earth (*.kml)', '', $ldatetimestamp & '.kml') + If Not @error Then + If StringInStr($filename, '.kml') = 0 Then $filename = $filename & '.kml' + $saved = SaveKML($filename, $UseLocalKmlImagesOnExport, $MapPos, $ShowTrack, $MapSig, $MapRange, $SelectedApID, $Filter, $MapSigType, $MapOpen, $MapWEP, $MapSec, $MapSigUseRSSI) + If $saved = 1 Then + MsgBox(0, $Text_Done, $Text_SavedAs & ': "' & $filename & '"') + Else + MsgBox(0, $Text_Done, $Text_NoApsWithGps & ' ' & $Text_NoFileSaved) + EndIf + EndIf + ExitLoop + EndSwitch + WEnd + Opt("GUIOnEventMode", 1) +EndFunc ;==>SaveToKmlGUI + +Func SaveKML($savefile, $KmlUseLocalImages = 1, $GpsPosMap = 0, $GpsTrack = 0, $GpsSigMap = 0, $GpsRangeMap = 0, $SelectedApID = 0, $Filter = 0, $SigMapType = 0, $MapOpenAPs = 1, $MapWepAps = 1, $MapSecAps = 1, $UseRSSI = 1) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, 'SaveKML()') ;#Debug Display + Local $file_header + Local $file_data + Local $file_posdata + Local $file_sigdata + Local $file_rangedata + Local $file_footer + Local $FoundApWithGps + Local $NewTimeString + + $file_header = '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF _ + & ' ' & $Script_Name & ' - By ' & $Script_Author & '' & @CRLF _ + & ' ' & $Script_Name & ' ' & $version & '' & @CRLF + + If $GpsPosMap = 1 Then ; Add GPS Position Icon Styles + $file_header &= ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF + EndIf + If $GpsSigMap = 1 Then ; Add GPS Signal Map Line Styles + $file_header &= $KmlSignalMapStyles + EndIf + If $GpsTrack = 1 Then ; Add GPS Track Line Style + $file_header &= ' ' & @CRLF + EndIf + If $SigMapType = 1 Then + $file_header &= ' ' & @CRLF + EndIf + If $GpsRangeMap = 1 Then + $file_header &= ' ' & @CRLF + EndIf + + If $GpsPosMap = 1 Or $GpsSigMap = 1 Or $GpsRangeMap = 1 Then + If $GpsPosMap = 1 Then $file_posdata &= ' ' & @CRLF & ' GPS Position Map' & @CRLF + If $GpsSigMap = 1 Then $file_sigdata &= ' ' & @CRLF & ' GPS Signal Map' & @CRLF + If $GpsRangeMap = 1 Then $file_rangedata &= ' ' & @CRLF & ' GPS Range Map' & @CRLF + If $MapOpenAPs = 1 Then + If $Filter = 1 Then + If StringInStr($AddQuery, "WHERE") Then + $query = $AddQuery & " And SECTYPE=1 And HighGpsHistId<>0 ORDER BY SSID" + Else + $query = $AddQuery & " WHERE SECTYPE=1 And HighGpsHistId<>0 ORDER BY SSID" + EndIf + ElseIf $SelectedApID <> 0 Then + $query = "SELECT ApID FROM AP WHERE ApID=" & $SelectedApID & " And SECTYPE=1 And HighGpsHistId<>0 ORDER BY SSID" + Else + $query = "SELECT ApID FROM AP WHERE SECTYPE=1 And HighGpsHistId<>0 ORDER BY SSID" + EndIf + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch <> 0 Then + $FoundApWithGps = 1 + If $GpsPosMap = 1 Then $file_posdata &= ' ' & @CRLF & ' Open Access Points' & @CRLF + If $GpsSigMap = 1 Then $file_sigdata &= ' ' & @CRLF & ' Open Access Points' & @CRLF + If $GpsRangeMap = 1 Then $file_rangedata &= ' ' & @CRLF & ' Open Access Points' & @CRLF + For $exp = 1 To $FoundApMatch + GUICtrlSetData($msgdisplay, 'Saving Open AP ' & $exp & '/' & $FoundApMatch) + $ExpApID = $ApMatchArray[$exp][1] + If $GpsPosMap = 1 Then $file_posdata &= _KmlPosMapAPID($ExpApID) + If $GpsSigMap = 1 And $SigMapType = 0 Then $file_sigdata &= _KmlSignalMapAPID($ExpApID, $UseRSSI) + If $GpsSigMap = 1 And $SigMapType = 1 Then $file_sigdata &= _KmlCircleSignalMapAPID($ExpApID, $UseRSSI) + If $GpsRangeMap = 1 Then $file_rangedata &= _KmlCircleDistanceMapAPID($ExpApID) + Next + If $GpsPosMap = 1 Then $file_posdata &= ' ' & @CRLF + If $GpsSigMap = 1 Then $file_sigdata &= ' ' & @CRLF + If $GpsRangeMap = 1 Then $file_rangedata &= ' ' & @CRLF + EndIf + EndIf + If $MapWepAps = 1 Then + If $Filter = 1 Then + If StringInStr($AddQuery, "WHERE") Then + $query = $AddQuery & " And SECTYPE=2 And HighGpsHistId<>0 ORDER BY SSID" + Else + $query = $AddQuery & " WHERE SECTYPE=2 And HighGpsHistId<>0 ORDER BY SSID" + EndIf + ElseIf $SelectedApID <> 0 Then + $query = "SELECT ApID FROM AP WHERE ApID=" & $SelectedApID & " And SECTYPE=2 And HighGpsHistId<>0 ORDER BY SSID" + Else + $query = "SELECT ApID FROM AP WHERE SECTYPE=2 And HighGpsHistId<>0 ORDER BY SSID" + EndIf + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch <> 0 Then + $FoundApWithGps = 1 + If $GpsPosMap = 1 Then $file_posdata &= ' ' & @CRLF & ' WEP Access Points' & @CRLF + If $GpsSigMap = 1 Then $file_sigdata &= ' ' & @CRLF & ' WEP Access Points' & @CRLF + If $GpsRangeMap = 1 Then $file_rangedata &= ' ' & @CRLF & ' WEP Access Points' & @CRLF + For $exp = 1 To $FoundApMatch + GUICtrlSetData($msgdisplay, 'Saving WEP AP ' & $exp & '/' & $FoundApMatch) + $ExpApID = $ApMatchArray[$exp][1] + If $GpsPosMap = 1 Then $file_posdata &= _KmlPosMapAPID($ExpApID) + If $GpsSigMap = 1 And $SigMapType = 0 Then $file_sigdata &= _KmlSignalMapAPID($ExpApID, $UseRSSI) + If $GpsSigMap = 1 And $SigMapType = 1 Then $file_sigdata &= _KmlCircleSignalMapAPID($ExpApID, $UseRSSI) + If $GpsRangeMap = 1 Then $file_rangedata &= _KmlCircleDistanceMapAPID($ExpApID) + Next + If $GpsPosMap = 1 Then $file_posdata &= ' ' & @CRLF + If $GpsSigMap = 1 Then $file_sigdata &= ' ' & @CRLF + If $GpsRangeMap = 1 Then $file_rangedata &= ' ' & @CRLF + EndIf + EndIf + If $MapSecAps = 1 Then + If $Filter = 1 Then + If StringInStr($AddQuery, "WHERE") Then + $query = $AddQuery & " And SECTYPE=3 And HighGpsHistId<>0 ORDER BY SSID" + Else + $query = $AddQuery & " WHERE SECTYPE=3 And HighGpsHistId<>0 ORDER BY SSID" + EndIf + ElseIf $SelectedApID <> 0 Then + $query = "SELECT ApID FROM AP WHERE ApID=" & $SelectedApID & " And SECTYPE=3 And HighGpsHistId<>0 ORDER BY SSID" + Else + $query = "SELECT ApID FROM AP WHERE SECTYPE=3 And HighGpsHistId<>0 ORDER BY SSID" + EndIf + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch <> 0 Then + $FoundApWithGps = 1 + If $GpsPosMap = 1 Then $file_posdata &= ' ' & @CRLF & ' Secure Access Points' & @CRLF + If $GpsSigMap = 1 Then $file_sigdata &= ' ' & @CRLF & ' Secure Access Points' & @CRLF + If $GpsRangeMap = 1 Then $file_rangedata &= ' ' & @CRLF & ' Secure Access Points' & @CRLF + For $exp = 1 To $FoundApMatch + GUICtrlSetData($msgdisplay, 'Saving Secure AP ' & $exp & '/' & $FoundApMatch) + $ExpApID = $ApMatchArray[$exp][1] + If $GpsPosMap = 1 Then $file_posdata &= _KmlPosMapAPID($ExpApID) + If $GpsSigMap = 1 And $SigMapType = 0 Then $file_sigdata &= _KmlSignalMapAPID($ExpApID, $UseRSSI) + If $GpsSigMap = 1 And $SigMapType = 1 Then $file_sigdata &= _KmlCircleSignalMapAPID($ExpApID, $UseRSSI) + If $GpsRangeMap = 1 Then $file_rangedata &= _KmlCircleDistanceMapAPID($ExpApID) + Next + If $GpsPosMap = 1 Then $file_posdata &= ' ' & @CRLF + If $GpsSigMap = 1 Then $file_sigdata &= ' ' & @CRLF + If $GpsRangeMap = 1 Then $file_rangedata &= ' ' & @CRLF + EndIf + EndIf + If $GpsPosMap = 1 Then $file_posdata &= ' ' & @CRLF + If $GpsSigMap = 1 Then $file_sigdata &= ' ' & @CRLF + If $GpsRangeMap = 1 Then $file_rangedata &= ' ' & @CRLF + If $GpsPosMap = 1 Then $file_data &= $file_posdata + If $GpsSigMap = 1 Then $file_data &= $file_sigdata + If $GpsRangeMap = 1 Then $file_data &= $file_rangedata + EndIf + + If $GpsTrack = 1 Then + $query = "SELECT Latitude, Longitude, Date1, Time1 FROM GPS WHERE Latitude <> 'N 0000.0000' And Longitude <> 'E 0000.0000' ORDER BY Date1, Time1" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch <> 0 Then + + $file_data &= ' ' & @CRLF _ + & ' GPS Track' & @CRLF _ + & ' ' & @CRLF _ + & ' GPS Track' & @CRLF _ + & ' #Location' & @CRLF _ + & ' ' & @CRLF _ + & ' 1' & @CRLF _ + & ' 1' & @CRLF _ + & ' ' & @CRLF + For $exp = 1 To $FoundGpsMatch + GUICtrlSetData($msgdisplay, 'Saving Gps Position ' & $exp & '/' & $FoundGpsMatch) + $ExpLat = _Format_GPS_DMM_to_DDD($GpsMatchArray[$exp][1]) + $ExpLon = _Format_GPS_DMM_to_DDD($GpsMatchArray[$exp][2]) + $ExpDate = StringReplace($GpsMatchArray[$exp][3], '-', '') + $ExpTime = $GpsMatchArray[$exp][4] + $dts = StringSplit($ExpTime, ":") ;Split time so it can be converted to seconds + $ExpTime = ($dts[1] * 3600) + ($dts[2] * 60) + $dts[3] ;In seconds + $LastTimeString = $NewTimeString + $NewTimeString = $ExpDate & StringFormat("%05i", $ExpTime) + If $LastTimeString = '' Then $LastTimeString = $NewTimeString + If ($NewTimeString - $LastTimeString) > 180 And $FoundApWithGps = 1 Then + $file_data &= ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' GPS Track' & @CRLF _ + & ' #Location' & @CRLF _ + & ' ' & @CRLF _ + & ' 1' & @CRLF _ + & ' 1' & @CRLF _ + & ' ' & @CRLF + EndIf + If $ExpLat <> 'N 0.0000000' And $ExpLon <> 'E 0.0000000' Then + $FoundApWithGps = 1 + $file_data &= ' ' & StringReplace(StringReplace(StringReplace($ExpLon, 'W', '-'), 'E', ''), ' ', '') & ',' & StringReplace(StringReplace(StringReplace($ExpLat, 'S', '-'), 'N', ''), ' ', '') & ',0' & @CRLF + EndIf + Next + $file_data &= ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF + EndIf + EndIf + $file_footer &= '' & @CRLF _ + & '' & @CRLF + + If $FoundApWithGps = 1 Then + $savefile = FileOpen($savefile, 128 + 2) ;Open in UTF-8 write mode + FileWrite($savefile, $file_header & $file_data & $file_footer) + FileClose($savefile) + Return (1) + Else + Return (0) + EndIf +EndFunc ;==>SaveKML + +Func _KmlSignalMapSelectedAP() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_KmlHeatmapSelected()') ;#Debug Display + Local $file_header + Local $file_data + Local $file_footer + $Selected = _GUICtrlListView_GetNextItem($ListviewAPs) ; find what AP is selected in the list. returns -1 is nothing is selected + If $Selected = -1 Then + MsgBox(0, $Text_Error, $Text_NoApSelected) + Else + $query = "SELECT ApID, SSID FROM AP WHERE ListRow=" & $Selected + $ListRowMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpApID = $ListRowMatchArray[1][1] + SaveToKmlGUI(0, $ExpApID) + EndIf +EndFunc ;==>_KmlSignalMapSelectedAP + +Func _KmlPosMapAPID($APID) + Local $file_data + $query = "SELECT SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, BTX, OTX, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, SecType FROM AP WHERE ApID=" & $APID + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpSSID = StringReplace(StringReplace(StringReplace($ApMatchArray[1][1], '&', ''), '>', ''), '<', '') + $ExpBSSID = $ApMatchArray[1][2] + $ExpNET = $ApMatchArray[1][3] + $ExpRAD = $ApMatchArray[1][4] + $ExpCHAN = $ApMatchArray[1][5] + $ExpAUTH = $ApMatchArray[1][6] + $ExpENCR = $ApMatchArray[1][7] + $ExpBTX = $ApMatchArray[1][8] + $ExpOTX = $ApMatchArray[1][9] + $ExpMANU = $ApMatchArray[1][10] + $ExpLAB = $ApMatchArray[1][11] + $ExpHighGpsHistID = $ApMatchArray[1][12] + $ExpFirstID = $ApMatchArray[1][13] + $ExpLastID = $ApMatchArray[1][14] + $ExpSECTYPE = $ApMatchArray[1][15] + + ;Get Gps ID of HighGpsHistId + $query = "SELECT GpsID FROM Hist Where HistID=" & $ExpHighGpsHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpGID = $HistMatchArray[1][1] + ;Get Latitude and Longitude + $query = "SELECT Latitude, Longitude FROM GPS WHERE GpsId=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLat = _Format_GPS_DMM_to_DDD($GpsMatchArray[1][1]) + $ExpLon = _Format_GPS_DMM_to_DDD($GpsMatchArray[1][2]) + If $ExpLat <> 'N 0.0000000' And $ExpLon <> 'E 0.0000000' Then + ;Get First Seen + $query = "SELECT GpsId FROM Hist Where HistID=" & $ExpFirstID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpGID = $HistMatchArray[1][1] + $query = "SELECT Date1, Time1 FROM GPS WHERE GpsId=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpFirstDateTime = $GpsMatchArray[1][1] & ' ' & $GpsMatchArray[1][2] + ;Get Last Seen + $query = "SELECT GpsId FROM Hist Where HistID=" & $ExpLastID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpGID = $HistMatchArray[1][1] + $query = "SELECT Date1, Time1 FROM GPS WHERE GpsId=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLastDateTime = $GpsMatchArray[1][1] & ' ' & $GpsMatchArray[1][2] + + $file_data &= ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & $Column_Names_SSID & ': ' & $ExpSSID & '
' & $Column_Names_BSSID & ': ' & $ExpBSSID & '
' & $Column_Names_NetworkType & ': ' & $ExpNET & '
' & $Column_Names_RadioType & ': ' & $ExpRAD & '
' & $Column_Names_Channel & ': ' & $ExpCHAN & '
' & $Column_Names_Authentication & ': ' & $ExpAUTH & '
' & $Column_Names_Encryption & ': ' & $ExpENCR & '
' & $Column_Names_BasicTransferRates & ': ' & $ExpBTX & '
' & $Column_Names_OtherTransferRates & ': ' & $ExpOTX & '
' & $Column_Names_FirstActive & ': ' & $ExpFirstDateTime & '
' & $Column_Names_LastActive & ': ' & $ExpLastDateTime & '
' & $Column_Names_Latitude & ': ' & $ExpLat & '
' & $Column_Names_Longitude & ': ' & $ExpLon & '
' & $Column_Names_MANUF & ': ' & $ExpMANU & '
]]>
' + If $ExpSECTYPE = 1 Then + $file_data &= ' #openStyle' & @CRLF + ElseIf $ExpSECTYPE = 2 Then + $file_data &= ' #wepStyle' & @CRLF + ElseIf $ExpSECTYPE = 3 Then + $file_data &= ' #secureStyle' & @CRLF + EndIf + $file_data &= ' ' & @CRLF _ + & ' ' & StringReplace(StringReplace(StringReplace($ExpLon, 'W', '-'), 'E', ''), ' ', '') & ',' & StringReplace(StringReplace(StringReplace($ExpLat, 'S', '-'), 'N', ''), ' ', '') & ',0' & @CRLF _ + & ' ' & @CRLF _ + & '
' & @CRLF + EndIf + Return ($file_data) +EndFunc ;==>_KmlPosMapAPID + +Func _KmlSignalMapAPID($APID, $UseRSSI = 1) + Local $file + Local $SigData = 0 + Local $SigStrengthLevel = 0 + Local $ExpString + Local $NewTimeString + $query = "SELECT SSID, BSSID FROM AP WHERE ApID=" & $APID + $ApIDMatch = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpSSID = StringReplace(StringReplace(StringReplace($ApIDMatch[1][1], '&', ''), '>', ''), '<', '') + $ExpBSSID = $ApIDMatch[1][2] + $query = "SELECT GpsID, Signal, RSSI, Date1, Time1 FROM Hist Where ApID=" & $APID & " And Signal<>0 ORDER BY Date1, Time1 ASC" + $GpsIDArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $GpsIDMatch = UBound($GpsIDArray) - 1 + If $GpsIDMatch <> 0 Then + For $e = 1 To $GpsIDMatch + $ExpGID = $GpsIDArray[$e][1] + $ExpSig = $GpsIDArray[$e][2] + $ExpRSSI = $GpsIDArray[$e][3] + $ExpDate = StringReplace($GpsIDArray[$e][4], '-', '') + $ExpTime = $GpsIDArray[$e][5] + $dts = StringSplit($ExpTime, ":") ;Split time so it can be converted to seconds + $ExpTime = ($dts[1] * 3600) + ($dts[2] * 60) + $dts[3] ;In seconds + $LastTimeString = $NewTimeString + $NewTimeString = $ExpDate & StringFormat("%05i", $ExpTime) + If $LastTimeString = '' Then $LastTimeString = $NewTimeString + ;Get Latidude and logitude + $query = "SELECT Longitude, Latitude, Alt FROM GPS Where GpsID=" & $ExpGID + $GpsArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLon = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsArray[1][1]), 'W', '-'), 'E', ''), ' ', '') + $ExpLat = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsArray[1][2]), 'S', '-'), 'N', ''), ' ', '') + $ExpAlt = $GpsArray[1][3] + If $ExpLon <> '0.0000000' And $ExpLat <> '0.0000000' Then + If $SigData = 0 Then + $file &= ' ' & @CRLF _ + & ' ' & $ExpSSID & ' - ' & $ExpBSSID & '' & @CRLF + EndIf + If $LastTimeString = '' Then $LastTimeString = $NewTimeString + $LastSigStrengthLevel = $SigStrengthLevel + $LastSigData = $SigData + $SigData = 1 + If $ExpSig >= 1 And $ExpSig <= 16 Then + $SigStrengthLevel = 1 + $SigCat = '#SigCat1' + ElseIf $ExpSig >= 17 And $ExpSig <= 32 Then + $SigStrengthLevel = 2 + $SigCat = '#SigCat2' + ElseIf $ExpSig >= 33 And $ExpSig <= 48 Then + $SigStrengthLevel = 3 + $SigCat = '#SigCat3' + ElseIf $ExpSig >= 49 And $ExpSig <= 64 Then + $SigStrengthLevel = 4 + $SigCat = '#SigCat4' + ElseIf $ExpSig >= 65 And $ExpSig <= 80 Then + $SigStrengthLevel = 5 + $SigCat = '#SigCat5' + ElseIf $ExpSig >= 80 And $ExpSig <= 100 Then + $SigStrengthLevel = 6 + $SigCat = '#SigCat6' + EndIf + If $LastSigStrengthLevel <> $SigStrengthLevel Or ($NewTimeString - $LastTimeString) > $SigMapTimeBeforeMarkedDead Or $LastSigData = 0 Then + If $LastSigData = 1 Then + $file &= ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF + EndIf + $file &= ' ' & @CRLF _ + & ' ' & $SigCat & '' & @CRLF _ + & ' ' & @CRLF _ + & ' 1' & @CRLF _ + & ' 0' & @CRLF _ + & ' relativeToGround' & @CRLF _ + & ' ' & @CRLF + If $ExpString <> '' And ($NewTimeString - $LastTimeString) <= $SigMapTimeBeforeMarkedDead Then $file &= $ExpString + EndIf + + If $UseRSSI = 1 Then + $ExpRSSIAlt = 100 + $ExpRSSI + $ExpString = ' ' & $ExpLon & ',' & $ExpLat & ',' & $ExpRSSIAlt & @CRLF + ;ConsoleWrite($ExpRSSI & ' - ' & $ExpRSSIAlt & @CRLF) + Else + $ExpString = ' ' & $ExpLon & ',' & $ExpLat & ',' & $ExpSig & @CRLF + EndIf + + $file &= $ExpString + EndIf + If $e = $GpsIDMatch And $SigData = 1 Then + $file &= ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF + EndIf + Next + EndIf + Return ($file) +EndFunc ;==>_KmlSignalMapAPID + +Func _KmlCircleSignalMapAPID($APID, $UseRSSI = 1) + Local $file + $query = "SELECT SSID, BSSID, HighGpsHistID FROM AP WHERE ApID=" & $APID + $ApIDMatch = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpSSID = StringReplace(StringReplace(StringReplace($ApIDMatch[1][1], '&', ''), '>', ''), '<', '') + $ExpBSSID = $ApIDMatch[1][2] + $ExpHighGpsHistID = $ApIDMatch[1][3] + If $ExpHighGpsHistID <> '0' Then + $query = "SELECT Signal, RSSI, GpsID FROM Hist WHERE HistID=" & $ExpHighGpsHistID + $HistIDArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpSig = $HistIDArray[1][1] + $ExpRSSI = $HistIDArray[1][2] + $ExpHighGpsID = $HistIDArray[1][3] + $query = "SELECT Longitude, Latitude FROM GPS Where GpsID=" & $ExpHighGpsID + $GpsIDArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLon = $GpsIDArray[1][1] + $ExpLat = $GpsIDArray[1][2] + $file &= ' ' & @CRLF _ + & ' ' & $ExpSSID & ' - ' & $ExpBSSID & '' & @CRLF + If $UseRSSI = 1 Then + $ExpRSSIAlt = 100 + $ExpRSSI + $file &= _KmlDrawCircle($ExpLat, $ExpLon, $ExpRSSIAlt, 'SigCircleColor') + Else + $file &= _KmlDrawCircle($ExpLat, $ExpLon, $ExpSig, 'SigCircleColor') + EndIf + $file &= ' ' & @CRLF + EndIf + Return ($file) +EndFunc ;==>_KmlCircleSignalMapAPID + +Func _KmlCircleDistanceMapAPID($APID) + Local $file + Local $ExpDist = 10 + $query = "SELECT SSID, BSSID, HighGpsHistID FROM AP WHERE ApID=" & $APID + $ApIDMatch = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpSSID = StringReplace(StringReplace(StringReplace($ApIDMatch[1][1], '&', ''), '>', ''), '<', '') + $ExpBSSID = $ApIDMatch[1][2] + $ExpHighGpsHistID = $ApIDMatch[1][3] + If $ExpHighGpsHistID <> '0' Then + $query = "SELECT Signal, GpsID FROM Hist WHERE HistID=" & $ExpHighGpsHistID + $HistIDArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpSig = $HistIDArray[1][1] + $ExpHighGpsID = $HistIDArray[1][2] + $query = "SELECT Longitude, Latitude FROM GPS Where GpsID=" & $ExpHighGpsID + $GpsIDArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLon = $GpsIDArray[1][1] + $ExpLat = $GpsIDArray[1][2] + ;Find Outside Gps Point + $query = "SELECT GpsID FROM Hist WHERE ApID=" & $APID + $HistIDArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $HistIDMatch = UBound($HistIDArray) - 1 + If $HistIDMatch <> 0 Then + For $gid = 1 To $HistIDMatch + $ExpGpsID = $HistIDArray[$gid][1] + $query = "SELECT Longitude, Latitude FROM GPS Where GpsID=" & $ExpGpsID + $GpsIDArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLon2 = $GpsIDArray[1][1] + $ExpLat2 = $GpsIDArray[1][2] + If $ExpLat2 <> 'N 0.0000' And $ExpLon2 <> 'E 0.0000' Then + If $ExpLat2 <> 'N 0000.0000' And $ExpLon2 <> 'E 0000.0000' Then + $Dist = _KmlDistanceBetweenPoints($ExpLat, $ExpLon, $ExpLat2, $ExpLon2) + If $Dist > $ExpDist Then $ExpDist = $Dist + EndIf + EndIf + Next + EndIf + $file &= ' ' & @CRLF _ + & ' ' & $ExpSSID & ' - ' & $ExpBSSID & '' & @CRLF + $file &= _KmlDrawCircle($ExpLat, $ExpLon, $ExpDist, 'RangeCircleColor') + $file &= ' ' & @CRLF + EndIf + Return ($file) +EndFunc ;==>_KmlCircleDistanceMapAPID + +Func _KmlDistanceBetweenPoints($Lat1, $Lon1, $Lat2, $Lon2) + $Lat1 = _deg2rad(StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($Lat1), 'S', '-'), 'N', ''), ' ', '')) + $Lon1 = _deg2rad(StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($Lon1), 'W', '-'), 'E', ''), ' ', '')) + $Lat2 = _deg2rad(StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($Lat2), 'S', '-'), 'N', ''), ' ', '')) + $Lon2 = _deg2rad(StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($Lon2), 'W', '-'), 'E', ''), ' ', '')) + $d = ACos(Sin($Lat1) * Sin($Lat2) + Cos($Lat1) * Cos($Lat2) * Cos($Lon2 - $Lon1)) * 6378137 + Return ($d) +EndFunc ;==>_KmlDistanceBetweenPoints + +Func _KmlDrawCircle($CenterLat, $CenterLon, $Radius, $CirStyle) + Local $PI = 3.14159265358979 + Local $viewdistance = 10000 + ; convert coordinates to radians + $Lat1 = _deg2rad(StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($CenterLat), 'S', '-'), 'N', ''), ' ', '')) + $long1 = _deg2rad(StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($CenterLon), 'W', '-'), 'E', ''), ' ', '')) + $d = $Radius + $d_rad = $d / 6378137 + ;create header + $file = '' & @CRLF _ + & 'Location' & @CRLF _ + & '#' & $CirStyle & '' & @CRLF _ + & '' & @CRLF _ + & '1' & @CRLF _ + & '1' & @CRLF _ + & '' & @CRLF + ; loop through the array and write path linestrings + For $i = 0 To 360 + $radial = _deg2rad($i) + $lat_rad = ASin(Sin($Lat1) * Cos($d_rad) + Cos($Lat1) * Sin($d_rad) * Cos($radial)) + $dlon_rad = ATan(Sin($radial) * Sin($d_rad) * Cos($Lat1)) / (Cos($d_rad) - Sin($Lat1) * Sin($lat_rad)) + $lon_rad = Mod(($long1 + $dlon_rad + $PI), 2 * $PI) - $PI ; origionally fmod(($long1 + $dlon_rad + $PI), 2 * $PI) - $PI + $file &= _rad2deg($lon_rad) & ',' & _rad2deg($lat_rad) & ',' & $viewdistance & @CRLF + Next + ; create footer + $file &= '' & @CRLF _ + & '' & @CRLF _ + & '' & @CRLF + Return ($file) +EndFunc ;==>_KmlDrawCircle + +Func _StartGoogleAutoKmlRefresh() + $kml = $GoogleEarth_OpenFile + FileDelete($kml) + If $AutoKML = 1 Then + If FileExists($GoogleEarthExe) Then + $RefAutoKmlGpsTime = Round($AutoKmlGpsTime / 2) + $RefAutoKmlActiveTime = Round($AutoKmlActiveTime / 2) + $RefAutoKmlDeadTime = Round($AutoKmlDeadTime / 2) + $RefAutoKmlTrackTime = Round($AutoKmlTrackTime / 2) + If $RefAutoKmlGpsTime < 1 Then $RefAutoKmlGpsTime = 1 + If $RefAutoKmlActiveTime < 1 Then $RefAutoKmlActiveTime = 1 + If $RefAutoKmlDeadTime < 1 Then $RefAutoKmlDeadTime = 1 + If $RefAutoKmlTrackTime < 1 Then $RefAutoKmlTrackTime = 1 + $file = '' & @CRLF _ + & '' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & $Script_Name & ' ' & $version & '' & @CRLF + If $AutoKmlGpsTime <> 0 Then + $file &= ' ' & @CRLF _ + & ' ' & $Script_Name & ' GPS Position' & @CRLF + If $KmlFlyTo = 1 Then $file &= ' 1' & @CRLF + $file &= ' ' & @CRLF _ ;GPS Position + & ' ' & $GoogleEarth_GpsFile & '' & @CRLF _ + & ' onInterval' & @CRLF _ + & ' ' & $RefAutoKmlGpsTime & '' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF + EndIf + If $AutoKmlActiveTime <> 0 Then + $file &= ' ' & @CRLF _ + & ' ' & $Script_Name & ' Active APs' & @CRLF _ + & ' ' & @CRLF _ ;AP List + & ' ' & $GoogleEarth_ActiveFile & '' & @CRLF _ + & ' onInterval' & @CRLF _ + & ' ' & $RefAutoKmlActiveTime & '' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF + EndIf + If $AutoKmlDeadTime <> 0 Then + $file &= ' ' & @CRLF _ + & ' ' & $Script_Name & ' Dead APs' & @CRLF _ + & ' ' & @CRLF _ ;AP List + & ' ' & $GoogleEarth_DeadFile & '' & @CRLF _ + & ' onInterval' & @CRLF _ + & ' ' & $RefAutoKmlDeadTime & '' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF + EndIf + If $AutoKmlTrackTime <> 0 Then + $file &= ' ' & @CRLF _ + & ' GPS Track' & @CRLF _ + & ' ' & @CRLF _ ;AP List + & ' ' & $GoogleEarth_TrackFile & '' & @CRLF _ + & ' onInterval' & @CRLF _ + & ' ' & $RefAutoKmlTrackTime & '' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF + EndIf + $file &= ' ' & @CRLF _ + & '' & @CRLF + FileWrite($kml, $file) + If Not @error Then + If $AutoKmlGpsTime <> 0 Then _AutoKmlGpsFile($GoogleEarth_GpsFile) + If $AutoKmlDeadTime <> 0 Then Run(@ComSpec & " /C " & FileGetShortName(@ScriptDir & '\Export.exe') & ' /db="' & $VistumblerDB & '" /t=k /f="' & $GoogleEarth_DeadFile & '" /d', '', @SW_HIDE) + If $AutoKmlActiveTime <> 0 Then Run(@ComSpec & " /C " & FileGetShortName(@ScriptDir & '\Export.exe') & ' /db="' & $VistumblerDB & '"/t=k /f="' & $GoogleEarth_ActiveFile & '" /a', '', @SW_HIDE) + If $AutoKmlTrackTime <> 0 Then Run(@ComSpec & " /C " & FileGetShortName(@ScriptDir & '\Export.exe') & ' /db="' & $VistumblerDB & '" /t=k /f="' & $GoogleEarth_TrackFile & '" /p', '', @SW_HIDE) + Run('"' & $GoogleEarthExe & '" "' & $kml & '"') + EndIf + Else + MsgBox(0, $Text_Error, $Text_GoogleEarthDoesNotExist) + EndIf + Else + $updatemsg = MsgBox(4, $Text_Error, $Text_AutoKmlIsNotStarted) + If $updatemsg = 6 Then + _AutoKmlToggle() + _StartGoogleAutoKmlRefresh() + EndIf + EndIf +EndFunc ;==>_StartGoogleAutoKmlRefresh + +Func _AutoKmlGpsFile($kml) + ;Write GPS KML + If StringInStr($kml, '.kml') = 0 Then $kml = $kml & '.kml' + $file = '' & @CRLF _ + & '' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & @CRLF + If $Latitude <> 'N 0000.0000' And $Longitude <> 'E 0000.0000' Then + $file &= ' ' & @CRLF _ + & ' ' & StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($Longitude), 'W', '-'), 'E', ''), ' ', '') & '' & @CRLF _ + & ' ' & StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($Latitude), 'S', '-'), 'N', ''), ' ', '') & '' & @CRLF _ + & ' ' & $AutoKML_Alt & '' & @CRLF _ + & ' ' & $AutoKML_Heading & '' & @CRLF _ + & ' ' & $AutoKML_Tilt & '' & @CRLF _ + & ' ' & $AutoKML_Range & '' & @CRLF _ + & ' ' & @CRLF + EndIf + $file &= ' ' & @CRLF _ + & ' GPS Position' & @CRLF + If $Latitude <> 'N 0000.0000' And $Longitude <> 'E 0000.0000' Then + $file &= ' ' & @CRLF _ + & ' Current Position' & @CRLF _ + & ' ' & $Column_Names_Latitude & ': ' & _GpsFormat($Latitude) & '
' & $Column_Names_Longitude & ': ' & _GpsFormat($Longitude) & '
]]>
' & @CRLF _ + & ' #gpsStyle' & @CRLF _ + & ' ' & @CRLF _ + & ' ' & $AutoKML_AltMode & '' & @CRLF _ + & ' ' & StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($Longitude), 'W', '-'), 'E', ''), ' ', '') & ',' & StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($Latitude), 'S', '-'), 'N', ''), ' ', '') & ',0' & @CRLF _ + & ' ' & @CRLF _ + & '
' & @CRLF + EndIf + $file &= '
' & @CRLF _ + & '
' & @CRLF _ + & '
' + FileDelete($kml) + FileWrite($kml, $file) +EndFunc ;==>_AutoKmlGpsFile + +;------------------------------------------------------------------------------------------------------------------------------- +; NETSTUMBLER SAVE/OPEN FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _ExportNS1() ;Saves netstumbler data to a netstumbler summary .ns1 + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportNS1()') ;#Debug Display + DirCreate($SaveDir) + $filename = FileSaveDialog($Text_SaveAsTXT, $SaveDir, $Text_NetstumblerTxtFile & ' (*.NS1)', '', $ldatetimestamp & '.NS1') + If @error <> 1 Then + If StringInStr($filename, '.NS1') = 0 Then $filename = $filename & '.NS1' + $APID1 = '' + $Date1 = '' + + $file = "# $Creator: " & $Script_Name & " " & $version & @CRLF & _ + "# $Format: wi-scan summary with extensions" & @CRLF & _ + "# Latitude Longitude ( SSID ) Type ( BSSID ) Time (GMT) [ SNR Sig Noise ] # ( Name ) Flags Channelbits BcnIntvl DataRate LastChannel" & @CRLF + + $query = "SELECT ApID, GpsID, Signal, Date1, Time1 FROM Hist ORDER BY Date1, Time1" + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundHistMatch = UBound($HistMatchArray) - 1 + If $FoundHistMatch > 0 Then + For $exns1 = 1 To $FoundHistMatch + GUICtrlSetData($msgdisplay, $Text_SavingHistID & ' ' & $exns1 & ' / ' & $FoundHistMatch) + $Found_APID = $HistMatchArray[$exns1][1] + If $Found_APID <> $APID1 Then + $Found_GpsID = $HistMatchArray[$exns1][2] + $Found_Sig = $HistMatchArray[$exns1][3] + $Found_Date = $HistMatchArray[$exns1][4] + $Found_Time = StringTrimRight($HistMatchArray[$exns1][5], 4) + $query = "SELECT Latitude, Longitude FROM GPS WHERE GpsID=" & $Found_GpsID + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_Lat = _Format_GPS_DMM_to_DDD($ApMatchArray[1][1]) + $Found_Lon = _Format_GPS_DMM_to_DDD($ApMatchArray[1][2]) + $query = "SELECT SSID, BSSID, SecType, NETTYPE, CHAN, BTX, OTX, LABEL, MANU FROM AP WHERE ApID=" & $Found_APID + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $Found_SSID = $ApMatchArray[1][1] + $Found_BSSID = $ApMatchArray[1][2] + $Found_SecType = $ApMatchArray[1][3] + $Found_NETTYPE = $ApMatchArray[1][4] + $Found_CHAN = $ApMatchArray[1][5] + $Found_BTX = $ApMatchArray[1][6] + $Found_OTX = $ApMatchArray[1][7] + $Found_LAB = $ApMatchArray[1][8] + $Found_MANU = $ApMatchArray[1][9] + + If $Found_Date <> $Date1 Then + $Date1 = $Found_Date + $file &= "# $DateGMT: " & $Date1 & @CRLF + EndIf + + $otxarray = StringSplit($Found_OTX, " ") + If IsArray($otxarray) Then + $radio = $otxarray[$otxarray[0]] * 10 + Else + $btxarray = StringSplit($Found_BTX, " ") + If IsArray($btxarray) Then + $radio = $btxarray[$btxarray[0]] * 10 + Else + $radio = 0 + EndIf + EndIf + + ;Channel Info - http://www.netstumbler.org/f4/channelbits-8849/ + $CHAN = '00000000' + If $Found_CHAN = 1 Then $CHAN = '00000002' + If $Found_CHAN = 2 Then $CHAN = '00000004' + If $Found_CHAN = 3 Then $CHAN = '00000008' + If $Found_CHAN = 4 Then $CHAN = '00000010' + If $Found_CHAN = 5 Then $CHAN = '00000020' + If $Found_CHAN = 6 Then $CHAN = '00000040' + If $Found_CHAN = 7 Then $CHAN = '00000080' + If $Found_CHAN = 8 Then $CHAN = '00000100' + If $Found_CHAN = 9 Then $CHAN = '00000200' + If $Found_CHAN = 10 Then $CHAN = '00000400' + If $Found_CHAN = 11 Then $CHAN = '00000800' + If $Found_CHAN = 12 Then $CHAN = '00001000' + If $Found_CHAN = 13 Then $CHAN = '00002000' + If $Found_CHAN = 14 Then $CHAN = '00004000' + If $Found_CHAN = 36 Then $CHAN = '00008000' + If $Found_CHAN = 40 Then $CHAN = '00010000' + If $Found_CHAN = 44 Then $CHAN = '00020000' + If $Found_CHAN = 48 Then $CHAN = '00040000' + If $Found_CHAN = 52 Then $CHAN = '00080000' + If $Found_CHAN = 56 Then $CHAN = '00100000' + If $Found_CHAN = 60 Then $CHAN = '00200000' + If $Found_CHAN = 64 Then $CHAN = '00400000' + If $Found_CHAN = 149 Then $CHAN = '00800000' + If $Found_CHAN = 153 Then $CHAN = '01000000' + If $Found_CHAN = 157 Then $CHAN = '02000000' + If $Found_CHAN = 161 Then $CHAN = '04000000' + If $Found_CHAN = 38 Then $CHAN = '08000000' + If $Found_CHAN = 46 Then $CHAN = '10000000' + If $Found_CHAN = 54 Then $CHAN = '20000000' + If $Found_CHAN = 62 Then $CHAN = '40000000' + If $Found_CHAN = 34 Then $CHAN = '80000000' + + $Flags = 0 + If $Found_NETTYPE = $SearchWord_Adhoc Then + $Flags += 2 ;Set IBSS (Ad hoc) flag + $BSS = 'ad-hoc' + Else + $Flags += 1 ;Set ESS (Infrastructure) flag + $BSS = 'BSS' + EndIf + + If $Found_SecType <> '1' Then + $Flags += 10 ;Set Privacy (WEP) flag + EndIf + + $Flags = StringFormat("%04i", $Flags) + EndIf + $file &= $Found_Lat & " " & $Found_Lon & " ( " & $Found_SSID & " ) " & $BSS & " ( " & $Found_BSSID & " ) " & $Found_Time & " (GMT) [ " & $Found_Sig & " " & $Found_Sig + 50 & " 50 ] # ( " & $Found_LAB & ' - ' & $Found_MANU & " ) " & $Flags & " " & $CHAN & " 1000 " & $radio & " " & $Found_CHAN & @CRLF + Next + $savefile = FileOpen($filename, 128 + 2) ;Open in UTF-8 write mode + FileWrite($savefile, $file) + FileClose($savefile) + MsgBox(0, $Text_Done, $Text_SavedAs & ': "' & $filename & '"') + Else + MsgBox(0, $Text_Done, $Text_NoAps & ' ' & $Text_NoFileSaved) + EndIf + Else + MsgBox(0, $Text_Error, $Text_NoFileSaved) + Return (0) + EndIf +EndFunc ;==>_ExportNS1 + +;------------------------------------------------------------------------------------------------------------------------------- +; SETTINGS WINDOW FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _SettingsGUI_Misc() ;Opens GUI to Misc tab + $Apply_Misc = 1 + _SettingsGUI(0) +EndFunc ;==>_SettingsGUI_Misc + +Func _SettingsGUI_Save() ;Opens GUI to Misc tab + $Apply_Save = 1 + _SettingsGUI(1) +EndFunc ;==>_SettingsGUI_Save + +Func _SettingsGUI_GPS() ;Opens GUI to GPS tab + $Apply_GPS = 1 + _SettingsGUI(2) +EndFunc ;==>_SettingsGUI_GPS + +Func _SettingsGUI_Lan() ;Opens GUI to Language tab + $Apply_Language = 1 + _SettingsGUI(3) +EndFunc ;==>_SettingsGUI_Lan + +Func _SettingsGUI_Manu() ;Opens GUI to Manufacturer tab + $Apply_Manu = 1 + _SettingsGUI(4) +EndFunc ;==>_SettingsGUI_Manu + +Func _SettingsGUI_Lab() ;Opens GUI to Label tab + $Apply_Lab = 1 + _SettingsGUI(5) +EndFunc ;==>_SettingsGUI_Lab + +Func _SettingsGUI_Col() ;Opens GUI to Column tab + $Apply_Column = 1 + _SettingsGUI(6) +EndFunc ;==>_SettingsGUI_Col + +Func _SettingsGUI_SW() ;Opens GUI to Searchword tab + $Apply_Searchword = 1 + _SettingsGUI(7) +EndFunc ;==>_SettingsGUI_SW + +Func _SettingsGUI_Auto() ;Opens GUI to Auto tab + $Apply_Auto = 1 + _SettingsGUI(8) +EndFunc ;==>_SettingsGUI_Auto + +Func _SettingsGUI_Sound() ;Opens GUI to Auto tab + $Apply_Sound = 1 + _SettingsGUI(9) +EndFunc ;==>_SettingsGUI_Sound + +Func _SettingsGUI_WifiDB() ;Opens GUI to Auto tab + $Apply_WifiDB = 1 + _SettingsGUI(10) +EndFunc ;==>_SettingsGUI_WifiDB + +Func _SettingsGUI_Cam() ;Opens GUI to Auto tab + $Apply_Cam = 1 + _SettingsGUI(11) +EndFunc ;==>_SettingsGUI_Cam + +Func _SettingsGUI($StartTab) ;Opens Settings GUI to specified tab + If $SettingsOpen = 1 Then + WinActivate($Text_VistumblerSettings) + Else + $SettingsOpen = 1 + $SetMisc = GUICreate($Text_VistumblerSettings, 680, 500, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) + GUISetBkColor($BackgroundColor) + $Settings_Tab = GUICtrlCreateTab(0, 0, 680, 470) + + ;Misc Tab + $Tab_Misc = GUICtrlCreateTabItem($Text_Misc) + _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) + GUICtrlCreateGroup($Text_Update, 40, 32, 275, 73) + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoCheckForUpdates = GUICtrlCreateCheckbox($Text_AutoCheckUpdates, 56, 56, 233, 17) + GUICtrlSetColor(-1, $TextColor) + If $AutoCheckForUpdates = 1 Then GUICtrlSetState($GUI_AutoCheckForUpdates, $GUI_CHECKED) + $GUI_CheckForBetaUpdates = GUICtrlCreateCheckbox($Text_CheckBetaUpdates, 56, 80, 241, 17) + GUICtrlSetColor(-1, $TextColor) + If $CheckForBetaUpdates = 1 Then GUICtrlSetState($GUI_CheckForBetaUpdates, $GUI_CHECKED) + + GUICtrlCreateGroup($Text_Misc, 40, 120, 275, 217) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_RefreshLoopTime, 54, 149, 250, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_RefreshLoop = GUICtrlCreateInput($RefreshLoopTime, 54, 169, 250, 21) + GUICtrlCreateLabel($Text_MaxSignal & " (dBm)", 54, 194, 250, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_dBmMaxSignal = GUICtrlCreateInput($dBmMaxSignal, 54, 214, 250, 21) + GUICtrlCreateLabel($Text_DisassociationSignal & " (dBm)", 54, 239, 250, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_dBmDisassociationSignal = GUICtrlCreateInput($dBmDissociationSignal, 54, 259, 250, 21) + GUICtrlCreateLabel($Text_TimeBeforeMarkedDead, 54, 284, 250, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_TimeBeforeMarkingDead = GUICtrlCreateInput($TimeBeforeMarkedDead, 54, 304, 250, 21) + + GUICtrlCreateGroup($Text_RefreshNetworks, 40, 344, 275, 105) + GUICtrlSetColor(-1, $TextColor) + $GUI_RefreshNetworks = GUICtrlCreateCheckbox($Text_RefreshNetworks, 56, 368, 249, 17) + GUICtrlSetColor(-1, $TextColor) + If $RefreshNetworks = 1 Then GUICtrlSetState($GUI_RefreshNetworks, $GUI_CHECKED) + GUICtrlCreateLabel($Text_RefreshTime & '(s)', 56, 392, 74, 17) + GUICtrlSetColor(-1, $TextColor) + $GUI_RefreshTime = GUICtrlCreateInput(($RefreshTime / 1000), 56, 416, 249, 21) + + + GUICtrlCreateGroup($Text_Color, 352, 32, 275, 265) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_BackgroundColor, 367, 57, 250, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_BKColor = GUICtrlCreateInput(StringReplace($BackgroundColor, '0x', ''), 367, 77, 170, 21) + $cbrowse1 = GUICtrlCreateButton($Text_Browse, 544, 77, 73, 21) + GUICtrlCreateLabel($Text_ControlColor, 367, 102, 250, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_CBKColor = GUICtrlCreateInput(StringReplace($ControlBackgroundColor, '0x', ''), 367, 122, 170, 21) + $cbrowse2 = GUICtrlCreateButton($Text_Browse, 544, 122, 73, 21) + GUICtrlCreateLabel($Text_BgFontColor, 367, 147, 250, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_TextColor = GUICtrlCreateInput(StringReplace($TextColor, '0x', ''), 367, 167, 170, 21) + $cbrowse3 = GUICtrlCreateButton($Text_Browse, 544, 167, 73, 21) + GUICtrlCreateLabel($Text_ButtonActiveColor, 367, 192, 250, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_CBAColor = GUICtrlCreateInput(StringReplace($ButtonActiveColor, '0x', ''), 367, 212, 170, 21) + $cbrowse4 = GUICtrlCreateButton($Text_Browse, 544, 212, 73, 21) + GUICtrlCreateLabel($Text_ButtonInactiveColor, 367, 237, 250, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_CBIColor = GUICtrlCreateInput(StringReplace($ButtonInactiveColor, '0x', ''), 367, 257, 170, 21) + $cbrowse5 = GUICtrlCreateButton($Text_Browse, 544, 257, 73, 21) + GUICtrlCreateGroup($Text_Text, 352, 312, 275, 81) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_GUITextSize, 366, 338, 250, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_TextSize = GUICtrlCreateInput($TextSize, 366, 358, 250, 21) + + ;Save Tab + $Tab_Save = GUICtrlCreateTabItem($Text_Save) + _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) + GUICtrlSetColor(-1, $TextColor) + $GroupSaveDirs = GUICtrlCreateGroup($Text_SaveDirectories, 15, 50, 650, 180) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_VistumblerSaveDirectory, 30, 70, 580, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Set_SaveDir = GUICtrlCreateInput($SaveDir, 30, 85, 515, 21) + $browse1 = GUICtrlCreateButton($Text_Browse, 555, 85, 97, 20, 0) + GUICtrlCreateLabel($Text_VistumblerAutoSaveDirectory, 30, 110, 580, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Set_SaveDirAuto = GUICtrlCreateInput($SaveDirAuto, 30, 125, 515, 21) + $Browse2 = GUICtrlCreateButton($Text_Browse, 555, 125, 97, 20, 0) + GUICtrlCreateLabel($Text_VistumblerAutoRecoverySaveDirectory, 30, 150, 580, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Set_SaveDirAutoRecovery = GUICtrlCreateInput($SaveDirAutoRecovery, 30, 165, 515, 21) + $Browse3 = GUICtrlCreateButton($Text_Browse, 555, 165, 97, 20, 0) + GUICtrlCreateLabel($Text_VistumblerKmlSaveDirectory, 30, 190, 580, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Set_SaveDirKml = GUICtrlCreateInput($SaveDirKml, 30, 205, 515, 21) + $Browse4 = GUICtrlCreateButton($Text_Browse, 555, 205, 97, 20, 0) + + ;Auto Save and Clear + GUICtrlCreateGroup($Text_AutoSaveAndClear, 15, 240, 320, 170) + GUICtrlSetColor(-1, $TextColor) + $AutoSaveAndClearBox = GUICtrlCreateCheckbox($Text_AutoSaveAndClear, 25, 265, 300, 15) + GUICtrlSetColor(-1, $TextColor) + If $AutoSaveAndClear = 1 Then GUICtrlSetState($AutoSaveAndClearBox, $GUI_CHECKED) + $AutoSaveAndClearRadioAP = GUICtrlCreateRadio($Text_AutoSaveAndClearAfterNumberofAPs, 40, 285, 280, 15) + If $AutoSaveAndClearOnAPs = 1 Then GUICtrlSetState($AutoSaveAndClearRadioAP, $GUI_CHECKED) + GUICtrlSetColor(-1, $TextColor) + $AutoSaveAndClearAPsGUI = GUICtrlCreateInput($AutoSaveAndClearAPs, 55, 305, 50, 20) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_APs, 107, 308, 100, 15) + GUICtrlSetColor(-1, $TextColor) + $AutoSaveAndClearRadioTime = GUICtrlCreateRadio($Text_AutoSaveandClearAfterTime, 40, 330, 280, 15) + If $AutoSaveAndClearOnTime = 1 Then GUICtrlSetState($AutoSaveAndClearRadioTime, $GUI_CHECKED) + GUICtrlSetColor(-1, $TextColor) + $AutoSaveAndClearTimeGUI = GUICtrlCreateInput($AutoSaveAndClearTime, 55, 350, 50, 20) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_Minutes, 107, 353, 100, 15) + GUICtrlSetColor(-1, $TextColor) + $AutoSaveAndClearPlaySoundGUI = GUICtrlCreateCheckbox($Text_PlaySoundWhenSaving, 40, 380, 280, 15) + If $AutoSaveAndClearPlaySound = 1 Then GUICtrlSetState($AutoSaveAndClearPlaySoundGUI, $GUI_CHECKED) + + ;Auto Recovery + GUICtrlCreateGroup($Text_AutoRecoveryVS1, 345, 240, 320, 170) + GUICtrlSetColor(-1, $TextColor) + $AutoRecoveryBox = GUICtrlCreateCheckbox($Text_AutoRecoveryVS1, 360, 265, 300, 15) + If $AutoRecoveryVS1 = 1 Then GUICtrlSetState($AutoRecoveryBox, $GUI_CHECKED) + GUICtrlSetColor(-1, $TextColor) + $AutoRecoveryDelBox = GUICtrlCreateCheckbox($Text_DelAutoSaveOnExit, 360, 290, 300, 15) + GUICtrlSetColor(-1, $TextColor) + If $AutoRecoveryVS1Del = 1 Then GUICtrlSetState($AutoRecoveryDelBox, $GUI_CHECKED) + GUICtrlCreateLabel($Text_AutoSaveEvery, 360, 315, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $AutoRecoveryTimeGUI = GUICtrlCreateInput($AutoRecoveryTime, 360, 335, 50, 21) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_Minutes, 412, 338, 100, 15) + GUICtrlSetColor(-1, $TextColor) + + ;GPS Tab + $Tab_Gps = GUICtrlCreateTabItem($Text_Gps) + _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) + $GroupComInt = GUICtrlCreateGroup($Text_ComInterface, 24, 48, 633, 105) + GUICtrlSetColor(-1, $TextColor) + $Rad_UseNetcomm = GUICtrlCreateRadio($Text_UseNetcomm, 40, 70, 361, 20) + GUICtrlSetColor(-1, $TextColor) + $Rad_UseCommMG = GUICtrlCreateRadio($Text_UseCommMG, 40, 95, 361, 20) + GUICtrlSetColor(-1, $TextColor) + $Rad_UseKernel32 = GUICtrlCreateRadio($Text_UseKernel32, 40, 120, 361, 20) + GUICtrlSetColor(-1, $TextColor) + If $GpsType = 0 Then + GUICtrlSetState($Rad_UseCommMG, $GUI_CHECKED) + ElseIf $GpsType = 1 Then + GUICtrlSetState($Rad_UseNetcomm, $GUI_CHECKED) + ElseIf $GpsType = 2 Then + GUICtrlSetState($Rad_UseKernel32, $GUI_CHECKED) + EndIf + $GroupComSet = GUICtrlCreateGroup($Text_ComSettings, 24, 160, 633, 185) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_Com, 44, 180, 275, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Comport = GUICtrlCreateCombo("1", 44, 195, 275, 25) + GUICtrlSetData(-1, "2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20", $ComPort) + GUICtrlCreateLabel($Text_Baud, 44, 235, 275, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Baud = GUICtrlCreateCombo("4800", 44, 250, 275, 25) + GUICtrlSetData(-1, "9600|14400|19200|38400|57600|115200", $BAUD) + GUICtrlCreateLabel($Text_StopBit, 44, 290, 275, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_StopBit = GUICtrlCreateCombo("1", 44, 305, 275, 25) + GUICtrlSetData(-1, "1.5|2", $STOPBIT) + + If $PARITY = 'E' Then + $l_PARITY = $Text_Even + ElseIf $PARITY = 'M' Then + $l_PARITY = $Text_Mark + ElseIf $PARITY = 'O' Then + $l_PARITY = $Text_Odd + ElseIf $PARITY = 'S' Then + $l_PARITY = $Text_Space + Else + $l_PARITY = $Text_None + EndIf + GUICtrlCreateLabel($Text_Parity, 364, 180, 275, 15) + $GUI_Parity = GUICtrlCreateCombo($Text_None, 364, 195, 275, 25) + GUICtrlSetData(-1, $Text_Even & '|' & $Text_Mark & '|' & $Text_Odd & '|' & $Text_Space, $l_PARITY) + GUICtrlCreateLabel($Text_DataBit, 364, 235, 275, 15) + $GUI_DataBit = GUICtrlCreateCombo("4", 364, 250, 275, 25) + GUICtrlSetData(-1, "5|6|7|8", $DATABIT) + $GroupGpsOptions = GUICtrlCreateGroup($Text_GpsSettings, 24, 360, 633, 100) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_GPSFormat, 44, 380, 100, 15) + If $GPSformat = 1 Then $DefForm = "dd.dddd" + If $GPSformat = 2 Then $DefForm = "dd mm ss" + If $GPSformat = 3 Then $DefForm = "ddmm.mmmm" + $GUI_Format = GUICtrlCreateCombo("dd.dddd", 44, 395, 275, 25) + GUICtrlSetData(-1, "ddmm.mmmm|dd mm ss", $DefForm) + GUICtrlSetColor($GUI_Format, $TextColor) + $GUI_GpsDisconnect = GUICtrlCreateCheckbox($Text_GpsDisconnect, 44, 420, 400, 15) + If $GpsDisconnect = 1 Then GUICtrlSetState($GUI_GpsDisconnect, $GUI_CHECKED) + GUICtrlSetColor(-1, $TextColor) + $GUI_GpsReset = GUICtrlCreateCheckbox($Text_GpsReset, 44, 440, 400, 15) + If $GpsReset = 1 Then GUICtrlSetState($GUI_GpsReset, $GUI_CHECKED) + GUICtrlSetColor(-1, $TextColor) + ;Language Tab + $Tab_Lan = GUICtrlCreateTabItem($Text_Language) + _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) + $GroupLan = GUICtrlCreateGroup($Text_SetLanguage, 16, 40, 641, 297) + GUICtrlSetColor(-1, $TextColor) + Dim $Languages1 = '', $Languages2 = '' + $languagefiles = _FileListToArray($LanguageDir, '*.ini', 1) ;Find all files in the folder that end in .ini . These are automatically assumed to a language file + For $b = 1 To $languagefiles[0] ;Set Languages into proper format for the combo box + If $b = 1 Then + $Languages1 = StringTrimRight($languagefiles[$b], 4) + ElseIf $b > 1 Then + $Languages2 &= StringTrimRight($languagefiles[$b], 4) + If $b < $languagefiles[0] Then $Languages2 &= '|' + EndIf + Next + + $LanguageBox = GUICtrlCreateCombo($Languages1, 32, 64, 601, 25) + GUICtrlSetData($LanguageBox, $Languages2, $DefaultLanguage) + GUICtrlCreateGroup($Text_LanguageAuthor, 32, 96, 601, 41) + GUICtrlSetColor(-1, $TextColor) + $LabAuth = GUICtrlCreateLabel(IniRead($DefaultLanguagePath, 'Info', 'Author', ''), 40, 112, 580, 17) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateGroup($Text_LanguageDate, 32, 150, 300, 41) + GUICtrlSetColor(-1, $TextColor) + $LabDate = GUICtrlCreateLabel(_DateLocalFormat(IniRead($DefaultLanguagePath, 'Info', 'Date', '')), 40, 166, 280, 17) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateGroup($Text_LanguageCode, 340, 150, 293, 41) + GUICtrlSetColor(-1, $TextColor) + $LabWinCode = GUICtrlCreateLabel(IniRead($DefaultLanguagePath, 'Info', 'WindowsLanguageCode', ''), 350, 166, 280, 17) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateGroup($Text_LanguageDescription, 34, 200, 601, 121) + GUICtrlSetColor(-1, $TextColor) + $LabDesc = GUICtrlCreateLabel(IniRead($DefaultLanguagePath, 'Info', 'Description', ''), 42, 216, 580, 97) + GUICtrlSetColor(-1, $TextColor) + + $GroupLanImp = GUICtrlCreateGroup($Text_ImportLanguageFile, 16, 352, 641, 97) + GUICtrlSetColor(-1, $TextColor) + $ImpLanFile = GUICtrlCreateInput("", 32, 376, 505, 21) + GUICtrlSetColor(-1, $TextColor) + $ImpLanBrowse = GUICtrlCreateButton($Text_Browse, 552, 376, 81, 20, 0) + $ImpLanButton = GUICtrlCreateButton($Text_ImportLanguageFile, 264, 408, 161, 25, 0) + ;Manufactures tab + $Tab_Manu = GUICtrlCreateTabItem($Text_Manufacturers) + _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) + GUICtrlCreateLabel($Text_NewMac, 34, 39, 195, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Manu_NewMac = GUICtrlCreateInput("", 34, 56, 195, 21) + GUICtrlCreateLabel($Text_NewMan, 244, 39, 410, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Manu_NewManu = GUICtrlCreateInput("", 244, 56, 410, 21) + GUICtrlSetColor(-1, $TextColor) + $Add_MANU = GUICtrlCreateButton($Text_AddNewMan, 24, 90, 201, 25, 0) + $Remove_MANU = GUICtrlCreateButton($Text_RemoveMan, 239, 90, 201, 25, 0) + $Edit_MANU = GUICtrlCreateButton($Text_EditMan, 456, 90, 201, 25, 0) + $GUI_Manu_List = GUICtrlCreateListView($Column_Names_BSSID & "|" & $Column_Names_MANUF, 24, 125, 634, 326, $LVS_REPORT, $LVS_EX_HEADERDRAGDROP + $LVS_EX_GRIDLINES + $LVS_EX_FULLROWSELECT) + GUICtrlSetBkColor(-1, $ControlBackgroundColor) + _GUICtrlListView_SetColumnWidth($GUI_Manu_List, 0, 160) + _GUICtrlListView_SetColumnWidth($GUI_Manu_List, 1, 450) + ;Add Manufacturers to list + $query = "SELECT BSSID, Manufacturer FROM Manufacturers" + $ManuMatchArray = _RecordSearch($ManuDB, $query, $ManuDB_OBJ) + $FoundManuMatch = UBound($ManuMatchArray) - 1 + GUICtrlSetData($msgdisplay, $Text_VistumblerSettings & ' - Loading ' & $FoundManuMatch & ' Manufacturer(s)') + For $m = 1 To $FoundManuMatch + $manumac = $ManuMatchArray[$m][1] + $manumanu = $ManuMatchArray[$m][2] + GUICtrlCreateListViewItem('"' & $manumac & '"|' & $manumanu, $GUI_Manu_List) + Next + GUICtrlSetData($msgdisplay, '') + ;Labels Tab + $Tab_Lab = GUICtrlCreateTabItem($Text_Labels) + _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) + GUICtrlCreateLabel($Text_NewMac, 34, 39, 195, 15) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_NewLabel, 244, 39, 410, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Lab_NewMac = GUICtrlCreateInput("", 34, 56, 195, 21) + GUICtrlSetColor(-1, $TextColor) + $GUI_Lab_NewLabel = GUICtrlCreateInput("", 244, 56, 410, 21) + GUICtrlSetColor(-1, $TextColor) + $Add_Lab = GUICtrlCreateButton($Text_AddNewLabel, 24, 90, 201, 25, 0) + $Remove_Lab = GUICtrlCreateButton($Text_RemoveLabel, 239, 90, 201, 25, 0) + $Edit_Lab = GUICtrlCreateButton($Text_EditLabel, 454, 90, 201, 25, 0) + $GUI_Lab_List = GUICtrlCreateListView($Column_Names_BSSID & "|" & $Column_Names_Label, 24, 125, 634, 326, $LVS_REPORT, $LVS_EX_HEADERDRAGDROP + $LVS_EX_GRIDLINES + $LVS_EX_FULLROWSELECT) + GUICtrlSetBkColor(-1, $ControlBackgroundColor) + _GUICtrlListView_SetColumnWidth($GUI_Lab_List, 0, 160) + _GUICtrlListView_SetColumnWidth($GUI_Lab_List, 1, 450) + ;Add Labels to list + $query = "SELECT BSSID, Label FROM Labels" + $LabMatchArray = _RecordSearch($LabDB, $query, $LabDB_OBJ) + $FoundLabMatch = UBound($LabMatchArray) - 1 + GUICtrlSetData($msgdisplay, $Text_VistumblerSettings & ' - Loading ' & $FoundLabMatch & ' Label(s)') + For $l = 1 To $FoundLabMatch + $labmac = $LabMatchArray[$l][1] + $lablab = $LabMatchArray[$l][2] + GUICtrlCreateListViewItem('"' & $labmac & '"|' & $lablab, $GUI_Lab_List) + Next + GUICtrlSetData($msgdisplay, '') + ;Columns Tabs + $Tab_Col = GUICtrlCreateTabItem($Text_Columns) + ;Get Current GUI widths from listview + _GetListviewWidths() + ;Start Column tab gui + _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) + $GroupColumns = GUICtrlCreateGroup($Text_Columns, 16, 25, 657, 435) + GUICtrlSetColor(-1, $TextColor) + $CWCB_Line = GUICtrlCreateCheckbox($Column_Names_Line, 34, 65, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_Line = GUICtrlCreateInput($column_Width_Line, 224, 65, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_Active = GUICtrlCreateCheckbox($Column_Names_Active, 34, 95, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_Active = GUICtrlCreateInput($column_Width_Active, 224, 95, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_SSID = GUICtrlCreateCheckbox($Column_Names_SSID, 34, 125, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_SSID = GUICtrlCreateInput($column_Width_SSID, 224, 125, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_BSSID = GUICtrlCreateCheckbox($Column_Names_BSSID, 34, 155, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_BSSID = GUICtrlCreateInput($column_Width_BSSID, 224, 155, 113, 21) + GUICtrlSetColor(-1, $TextColor) + + $CWCB_Signal = GUICtrlCreateCheckbox($Column_Names_Signal, 34, 185, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_Signal = GUICtrlCreateInput($column_Width_Signal, 224, 185, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_HighSignal = GUICtrlCreateCheckbox($Column_Names_HighSignal, 34, 215, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_HighSignal = GUICtrlCreateInput($column_Width_HighSignal, 224, 215, 113, 21) + GUICtrlSetColor(-1, $TextColor) + + $CWCB_RSSI = GUICtrlCreateCheckbox($Column_Names_RSSI, 34, 245, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_RSSI = GUICtrlCreateInput($column_Width_RSSI, 224, 245, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_HighRSSI = GUICtrlCreateCheckbox($Column_Names_HighRSSI, 34, 275, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_HighRSSI = GUICtrlCreateInput($column_Width_HighRSSI, 224, 275, 113, 21) + GUICtrlSetColor(-1, $TextColor) + + $CWCB_Authentication = GUICtrlCreateCheckbox($Column_Names_Authentication, 34, 305, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_Authentication = GUICtrlCreateInput($column_Width_Authentication, 224, 305, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_Encryption = GUICtrlCreateCheckbox($Column_Names_Encryption, 34, 335, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_Encryption = GUICtrlCreateInput($column_Width_Encryption, 224, 335, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_RadioType = GUICtrlCreateCheckbox($Column_Names_RadioType, 34, 365, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_RadioType = GUICtrlCreateInput($column_Width_RadioType, 224, 365, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_NetType = GUICtrlCreateCheckbox($Column_Names_NetworkType, 34, 395, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_NetType = GUICtrlCreateInput($column_Width_NetworkType, 224, 395, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_Channel = GUICtrlCreateCheckbox($Column_Names_Channel, 34, 425, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_Channel = GUICtrlCreateInput($column_Width_Channel, 224, 425, 113, 21) + GUICtrlSetColor(-1, $TextColor) + + $CWCB_Manu = GUICtrlCreateCheckbox($Column_Names_MANUF, 364, 65, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_Manu = GUICtrlCreateInput($column_Width_MANUF, 549, 65, 112, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_Label = GUICtrlCreateCheckbox($Column_Names_Label, 364, 95, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_Label = GUICtrlCreateInput($column_Width_Label, 549, 95, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_Latitude = GUICtrlCreateCheckbox($Column_Names_Latitude, 364, 125, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_Latitude = GUICtrlCreateInput($column_Width_Latitude, 549, 125, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_Longitude = GUICtrlCreateCheckbox($Column_Names_Longitude, 364, 155, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_Longitude = GUICtrlCreateInput($column_Width_Longitude, 549, 155, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_LatitudeDMS = GUICtrlCreateCheckbox($Column_Names_LatitudeDMS, 364, 185, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_LatitudeDMS = GUICtrlCreateInput($column_Width_LatitudeDMS, 549, 185, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_LongitudeDMS = GUICtrlCreateCheckbox($Column_Names_LongitudeDMS, 364, 215, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_LongitudeDMS = GUICtrlCreateInput($column_Width_LatitudeDMS, 549, 215, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_LatitudeDMM = GUICtrlCreateCheckbox($Column_Names_LatitudeDMM, 364, 245, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_LatitudeDMM = GUICtrlCreateInput($column_Width_LatitudeDMM, 549, 245, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_LongitudeDMM = GUICtrlCreateCheckbox($Column_Names_LongitudeDMM, 364, 275, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_LongitudeDMM = GUICtrlCreateInput($column_Width_LongitudeDMM, 549, 275, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_BtX = GUICtrlCreateCheckbox($Column_Names_BasicTransferRates, 364, 305, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_BtX = GUICtrlCreateInput($column_Width_BasicTransferRates, 549, 305, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_OtX = GUICtrlCreateCheckbox($Column_Names_OtherTransferRates, 364, 335, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_OtX = GUICtrlCreateInput($column_Width_OtherTransferRates, 549, 335, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_FirstActive = GUICtrlCreateCheckbox($Column_Names_FirstActive, 364, 365, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_FirstActive = GUICtrlCreateInput($column_Width_FirstActive, 549, 365, 113, 21) + GUICtrlSetColor(-1, $TextColor) + $CWCB_LastActive = GUICtrlCreateCheckbox($Column_Names_LastActive, 364, 395, 185, 17) + GUICtrlSetColor(-1, $TextColor) + $CWIB_LastActive = GUICtrlCreateInput($column_Width_LastActive, 549, 395, 113, 21) + GUICtrlSetColor(-1, $TextColor) + _SetCwState() + GUICtrlCreateLabel($Text_Enable & " / " & $Text_Disable, 32, 45, 175, 15) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_SetColumnWidths, 224, 45, 118, 15) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_Enable & " / " & $Text_Disable, 356, 45, 175, 15) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_SetColumnWidths, 548, 45, 118, 15) + GUICtrlSetColor(-1, $TextColor) + ;Searchwords Tab + $Tab_SW = GUICtrlCreateTabItem($Text_SearchWords) + _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) + GUICtrlCreateGroup($Text_SetSearchWords, 8, 32, 665, 425) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($SearchWord_SSID, 28, 125, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_SSID_GUI = GUICtrlCreateInput($SearchWord_SSID, 28, 140, 300, 20) + GUICtrlCreateLabel($SearchWord_BSSID, 28, 165, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_BSSID_GUI = GUICtrlCreateInput($SearchWord_BSSID, 28, 180, 300, 20) + GUICtrlCreateLabel($SearchWord_Channel, 28, 205, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_Channel_GUI = GUICtrlCreateInput($SearchWord_Channel, 28, 220, 300, 20) + GUICtrlCreateLabel($SearchWord_Authentication, 28, 245, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_Authentication_GUI = GUICtrlCreateInput($SearchWord_Authentication, 28, 260, 300, 20) + GUICtrlCreateLabel($SearchWord_Encryption, 28, 285, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_Encryption_GUI = GUICtrlCreateInput($SearchWord_Encryption, 28, 300, 300, 20) + GUICtrlCreateLabel($SearchWord_RadioType, 28, 325, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_RadioType_GUI = GUICtrlCreateInput($SearchWord_RadioType, 28, 340, 300, 20) + GUICtrlCreateLabel($SearchWord_NetworkType, 28, 365, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_NetType_GUI = GUICtrlCreateInput($SearchWord_NetworkType, 28, 380, 300, 20) + GUICtrlCreateLabel($SearchWord_Signal, 28, 405, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_Signal_GUI = GUICtrlCreateInput($SearchWord_Signal, 28, 420, 300, 20) + GUICtrlCreateLabel($SearchWord_BasicRates, 353, 125, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_BasicRates_GUI = GUICtrlCreateInput($SearchWord_BasicRates, 353, 140, 300, 20) + GUICtrlCreateLabel($SearchWord_OtherRates, 353, 165, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_OtherRates_GUI = GUICtrlCreateInput($SearchWord_OtherRates, 353, 180, 300, 20) + GUICtrlCreateLabel($SearchWord_Open, 353, 205, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_Open_GUI = GUICtrlCreateInput($SearchWord_Open, 353, 220, 300, 20) + GUICtrlCreateLabel($SearchWord_None, 353, 245, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_None_GUI = GUICtrlCreateInput($SearchWord_None, 353, 260, 300, 20) + GUICtrlCreateLabel($SearchWord_Wep, 353, 285, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_Wep_GUI = GUICtrlCreateInput($SearchWord_Wep, 353, 300, 300, 20) + GUICtrlCreateLabel($SearchWord_Infrastructure, 353, 325, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_Infrastructure_GUI = GUICtrlCreateInput($SearchWord_Infrastructure, 353, 340, 300, 20) + GUICtrlCreateLabel($SearchWord_Adhoc, 353, 365, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $SearchWord_Adhoc_GUI = GUICtrlCreateInput($SearchWord_Adhoc, 353, 380, 300, 20) + $GuiGuessSearchwords = GUICtrlCreateButton($Text_GuessSearchwords, 353, 420, 300, 20) + $swdesc = GUICtrlCreateGroup($Text_Description, 24, 56, 633, 65) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_NetshMsg, 32, 72, 618, 41) + GUICtrlSetColor(-1, $TextColor) + ;---------------------------- + ;Auto Tab + ;---------------------------- + $Tab_Auto = GUICtrlCreateTabItem($Text_Auto) + _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) + GUICtrlCreateGroup($Text_AutoKml, 16, 40, 650, 240) ;Auto Save Group + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoSaveKml = GUICtrlCreateCheckbox($Text_AutoKml, 30, 60, 625, 15) + GUICtrlSetColor(-1, $TextColor) + If $AutoKML = 1 Then GUICtrlSetState($GUI_AutoSaveKml, $GUI_CHECKED) + $GUI_OpenKmlNetLink = GUICtrlCreateCheckbox($Text_AutoOpenNetworkLink, 30, 80, 625, 15) + GUICtrlSetColor(-1, $TextColor) + If $OpenKmlNetLink = 1 Then GUICtrlSetState($GUI_OpenKmlNetLink, $GUI_CHECKED) + GUICtrlCreateLabel($Text_GoogleEarthEXE, 30, 100, 62, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_GoogleEXE = GUICtrlCreateInput($GoogleEarthExe, 30, 115, 515, 20) + $browsege = GUICtrlCreateButton($Text_Browse, 555, 115, 97, 20, 0) + GUICtrlCreateLabel($Text_ActiveRefreshTime & '(s)', 30, 140, 115, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoKmlActiveTime = GUICtrlCreateInput($AutoKmlActiveTime, 30, 155, 115, 20) + GUICtrlCreateLabel($Text_DeadRefreshTime & '(s)', 155, 140, 115, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoKmlDeadTime = GUICtrlCreateInput($AutoKmlDeadTime, 155, 155, 115, 20) + GUICtrlCreateLabel($Text_GpsRefrshTime & '(s)', 280, 140, 115, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoKmlGpsTime = GUICtrlCreateInput($AutoKmlGpsTime, 280, 155, 115, 20) + GUICtrlCreateLabel($Text_GpsTrackTime & '(s)', 405, 140, 115, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoKmlTrackTime = GUICtrlCreateInput($AutoKmlTrackTime, 405, 155, 115, 20) + ;Fly To Settings + GUICtrlCreateGroup($Text_FlyToSettings, 30, 180, 620, 90) + $GUI_KmlFlyTo = GUICtrlCreateCheckbox($Text_FlyToCurrentGps, 45, 200, 570, 15) + GUICtrlSetColor(-1, $TextColor) + If $KmlFlyTo = 1 Then GUICtrlSetState($GUI_KmlFlyTo, $GUI_CHECKED) + GUICtrlCreateLabel($Text_Altitude & '(m)', 45, 220, 110, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoKml_Alt = GUICtrlCreateInput($AutoKML_Alt, 45, 235, 110, 20) + GUICtrlCreateLabel($Text_AltitudeMode, 165, 220, 110, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoKml_AltMode = GUICtrlCreateCombo('clampToGround', 165, 235, 110, 20) + GUICtrlSetData(-1, "relativeToGround|absolute", $AutoKML_AltMode) + GUICtrlCreateLabel($Text_Range & '(m)', 285, 220, 110, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoKml_Range = GUICtrlCreateInput($AutoKML_Range, 285, 235, 110, 20) + GUICtrlCreateLabel($Text_Heading & '(0-360)', 405, 220, 110, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoKml_Heading = GUICtrlCreateInput($AutoKML_Heading, 405, 235, 110, 20) + GUICtrlCreateLabel($Text_Tilt & '(0-90)', 525, 220, 110, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoKml_Tilt = GUICtrlCreateInput($AutoKML_Tilt, 525, 235, 110, 20) + ;Auto Sort Group + GUICtrlCreateGroup($Text_AutoSort, 15, 285, 650, 169) + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoSort = GUICtrlCreateCheckbox($Text_AutoSort, 30, 310, 625, 15) + GUICtrlSetColor(-1, $TextColor) + If $AutoSort = 1 Then GUICtrlSetState($GUI_AutoSort, $GUI_CHECKED) + GUICtrlCreateLabel($Text_SortBy, 30, 330, 625, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_SortBy = GUICtrlCreateCombo($Column_Names_SSID, 30, 345, 615, 21) + GUICtrlSetData(-1, $Column_Names_NetworkType & "|" & $Column_Names_Authentication & "|" & $Column_Names_Encryption & "|" & $Column_Names_BSSID & "|" & $Column_Names_Signal & "|" & $Column_Names_HighSignal & "|" & $Column_Names_RSSI & "|" & $Column_Names_HighRSSI & "|" & $Column_Names_RadioType & "|" & $Column_Names_Channel & "|" & $Column_Names_BasicTransferRates & "|" & $Column_Names_OtherTransferRates & "|" & $Column_Names_Latitude & "|" & $Column_Names_Longitude & "|" & $Column_Names_LatitudeDMM & "|" & $Column_Names_LongitudeDMM & "|" & $Column_Names_LatitudeDMS & "|" & $Column_Names_LongitudeDMS & "|" & $Column_Names_FirstActive & "|" & $Column_Names_LastActive & "|" & $Column_Names_Active & "|" & $Column_Names_MANUF, $SortBy) + If $SortDirection = 1 Then + $SortDirectionDefault = $Text_Decending + Else + $SortDirectionDefault = $Text_Ascending + EndIf + GUICtrlCreateLabel($Text_SortDirection, 30, 370, 625, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_SortDirection = GUICtrlCreateCombo($Text_Ascending, 30, 385, 615, 21) + GUICtrlSetData(-1, $Text_Decending, $SortDirectionDefault) + GUICtrlCreateLabel($Text_AutoSortEvery & '(s)', 30, 410, 625, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_SortTime = GUICtrlCreateInput($SortTime, 30, 425, 115, 20) + ;---------------------------- + ;Sound Tab + ;---------------------------- + $Tab_Sound = GUICtrlCreateTabItem($Text_Sound) + _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) + GUICtrlCreateGroup($Text_PlaySound, 16, 40, 650, 105) + $GUI_NewApSound = GUICtrlCreateCheckbox($Text_PlaySound, 30, 60, 300, 15) + GUICtrlSetColor(-1, $TextColor) + If $SoundOnAP = 1 Then GUICtrlSetState($GUI_NewApSound, $GUI_CHECKED) + $GUI_ASperloop = GUICtrlCreateRadio($Text_OncePerLoop, 30, 80, 300, 15) + If $SoundPerAP = 0 Then GUICtrlSetState($GUI_ASperloop, $GUI_CHECKED) + $GUI_ASperap = GUICtrlCreateRadio($Text_OncePerAP, 30, 100, 300, 15) + If $SoundPerAP = 1 And $NewSoundSigBased = 0 Then GUICtrlSetState($GUI_ASperap, $GUI_CHECKED) + $GUI_ASperapwsound = GUICtrlCreateRadio($Text_OncePerAPwSound, 30, 120, 300, 15) + If $SoundPerAP = 1 And $NewSoundSigBased = 1 Then GUICtrlSetState($GUI_ASperapwsound, $GUI_CHECKED) + ;Speak Signal Options + GUICtrlCreateGroup($Text_SpeakSignal, 16, 155, 650, 145) + $GUI_SpeakSignal = GUICtrlCreateCheckbox($Text_SpeakSignal, 30, 175, 200, 15) + GUICtrlSetColor(-1, $TextColor) + If $SpeakSignal = 1 Then GUICtrlSetState($GUI_SpeakSignal, $GUI_CHECKED) + $GUI_SpeakSoundsVis = GUICtrlCreateRadio($Text_SpeakUseVisSounds, 30, 195, 200, 15) + $GUI_SpeakSoundsSapi = GUICtrlCreateRadio($Text_SpeakUseSapi, 30, 215, 200, 15) + $GUI_SpeakSoundsMidi = GUICtrlCreateRadio($Text_MIDI, 30, 235, 200, 15) + GUICtrlSetColor($GUI_SpeakSoundsVis, $TextColor) + GUICtrlSetColor($GUI_SpeakSoundsSapi, $TextColor) + GUICtrlSetColor($GUI_SpeakSoundsMidi, $TextColor) + If $SpeakType = 1 Then + GUICtrlSetState($GUI_SpeakSoundsVis, $GUI_CHECKED) + ElseIf $SpeakType = 2 Then + GUICtrlSetState($GUI_SpeakSoundsSapi, $GUI_CHECKED) + ElseIf $SpeakType = 3 Then + GUICtrlSetState($GUI_SpeakSoundsMidi, $GUI_CHECKED) + EndIf + GUICtrlCreateLabel($Text_SpeakRefreshTime & '(ms)', 30, 255, 150, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_SpeakSigTime = GUICtrlCreateInput($SpeakSigTime, 30, 270, 150, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_SpeakPercent = GUICtrlCreateCheckbox($Text_SpeakSayPercent, 200, 270, 150, 15) + GUICtrlSetColor(-1, $TextColor) + If $SpeakSigSayPecent = 1 Then GUICtrlSetState($GUI_SpeakPercent, $GUI_CHECKED) + + GUICtrlCreateGroup($Text_MIDI, 16, 310, 650, 135) + $GUI_PlayMidiSounds = GUICtrlCreateCheckbox($Text_PlayMidiSounds, 30, 330, 200, 15) + If $Midi_PlayForActiveAps = 1 Then GUICtrlSetState($GUI_PlayMidiSounds, $GUI_CHECKED) + GUICtrlCreateLabel($Text_MidiInstrumentNumber, 30, 350, 150, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Midi_Instument = GUICtrlCreateCombo('', 30, 365, 310, 20) + $query = "SELECT INSTNUM, INSTTEXT FROM Instruments" + $InstMatchArray = _RecordSearch($InstDB, $query, $InstDB_OBJ) + $FoundInstMatch = UBound($InstMatchArray) - 1 + GUICtrlSetData($msgdisplay, $Text_VistumblerSettings & ' - Loading ' & $FoundInstMatch & ' Instrument(s)') + For $m = 1 To $FoundInstMatch + $INSTNUM = $InstMatchArray[$m][1] + $INSTTEXT = $InstMatchArray[$m][2] + If $INSTNUM = $Midi_Instument Then + GUICtrlSetData($GUI_Midi_Instument, $INSTNUM & ' - ' & $INSTTEXT, $INSTNUM & ' - ' & $INSTTEXT) + Else + GUICtrlSetData($GUI_Midi_Instument, $INSTNUM & ' - ' & $INSTTEXT) + EndIf + Next + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_MidiPlayTime & '(ms)', 30, 390, 150, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Midi_PlayTime = GUICtrlCreateInput($Midi_PlayTime, 30, 405, 310, 20) + GUICtrlSetColor(-1, $TextColor) + ;---------------------------- + ;WifiDB Tab + ;---------------------------- + $Tab_WifiDB = GUICtrlCreateTabItem($Text_WifiDB) + _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) + GUICtrlCreateGroup($Text_WifiDB, 15, 40, 650, 250) + GUICtrlCreateLabel("WifiDB Username", 28, 77, 88, 15) + $GUI_WifiDB_User = GUICtrlCreateInput($WifiDb_User, 123, 75, 185, 20) + GUICtrlCreateLabel("WifiDB API Key", 328, 77, 78, 15) + $GUI_WifiDB_ApiKey = GUICtrlCreateInput($WifiDb_ApiKey, 411, 75, 185, 20) + GUICtrlCreateLabel($Text_PHPgraphing, 31, 110, 620, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_WifiDbGraphURL = GUICtrlCreateInput($WifiDbGraphURL, 31, 125, 620, 20) + GUICtrlCreateLabel($Text_WifiDbWDB, 32, 150, 620, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_WifiDbWdbURL = GUICtrlCreateInput($WifiDbWdbURL, 32, 165, 620, 20) + GUICtrlCreateLabel("WifiDB API URL", 32, 190, 620, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_WifiDbApiURL = GUICtrlCreateInput($WifiDbApiURL, 32, 205, 620, 20) + + GUICtrlCreateGroup($Text_AutoWiFiDbGpsLocate, 15, 300, 320, 85) + $GUI_WifidbLocate = GUICtrlCreateCheckbox($Text_AutoWiFiDbGpsLocate, 30, 320, 300, 15) + GUICtrlSetColor(-1, $TextColor) + If $UseWiFiDbGpsLocate = 1 Then GUICtrlSetState($GUI_WifidbLocate, $GUI_CHECKED) + GUICtrlCreateLabel($Text_RefreshTime & '(s)', 30, 340, 615, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_WiFiDbLocateRefreshTime = GUICtrlCreateInput(($WiFiDbLocateRefreshTime / 1000), 30, 355, 115, 20) + GUICtrlSetColor(-1, $TextColor) + + GUICtrlCreateGroup($Text_AutoWiFiDbUploadAps, 346, 300, 320, 85) + $GUI_WifidbUploadAps = GUICtrlCreateCheckbox($Text_AutoWiFiDbUploadAps, 360, 320, 300, 15) + GUICtrlSetColor(-1, $TextColor) + If $AutoUpApsToWifiDB = 1 Then GUICtrlSetState($GUI_WifidbUploadAps, $GUI_CHECKED) + ;GUICtrlSetState($GUI_WifidbUploadAps, $GUI_DISABLE); Upload to WifiDB is not ready yet. The checkbox will be disabled untill it is available + GUICtrlCreateLabel($Text_RefreshTime & '(s)', 360, 340, 615, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_AutoUpApsToWifiDBTime = GUICtrlCreateInput($AutoUpApsToWifiDBTime, 360, 355, 115, 20) + GUICtrlSetColor(-1, $TextColor) + + ;Camera tab + $Tab_Cam = GUICtrlCreateTabItem($Text_Cameras) + _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) + GUICtrlCreateLabel($Text_CameraName, 34, 39, 195, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Cam_NewID = GUICtrlCreateInput("", 34, 56, 195, 21) + GUICtrlCreateLabel($Text_CameraURL, 244, 39, 410, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_Cam_NewLOC = GUICtrlCreateInput("", 244, 56, 410, 21) + GUICtrlSetColor(-1, $TextColor) + $Add_Cam = GUICtrlCreateButton($Text_AddCamera, 24, 90, 201, 25, 0) + $Remove_Cam = GUICtrlCreateButton($Text_RemoveCamera, 239, 90, 201, 25, 0) + $Edit_Cam = GUICtrlCreateButton($Text_EditCamera, 456, 90, 201, 25, 0) + $GUI_Cam_List = GUICtrlCreateListView($Text_CameraName & "|" & $Text_CameraURL, 24, 125, 634, 150, $LVS_REPORT, $LVS_EX_HEADERDRAGDROP + $LVS_EX_GRIDLINES + $LVS_EX_FULLROWSELECT) + GUICtrlSetBkColor(-1, $ControlBackgroundColor) + _GUICtrlListView_SetColumnWidth($GUI_Cam_List, 0, 160) + _GUICtrlListView_SetColumnWidth($GUI_Cam_List, 1, 450) + ;Add cameras to list + $query = "SELECT CamName, CamUrl FROM Cameras" + $CamMatchArray = _RecordSearch($CamDB, $query, $CamDB_OBJ) + $FoundCamMatch = UBound($CamMatchArray) - 1 + GUICtrlSetData($msgdisplay, $Text_VistumblerSettings & ' - Loading ' & $FoundCamMatch & ' ' & $Text_Cameras) + For $c = 1 To $FoundCamMatch + $camname = $CamMatchArray[$c][1] + $camurl = $CamMatchArray[$c][2] + GUICtrlCreateListViewItem('"' & $camname & '"|' & $camurl, $GUI_Cam_List) + Next + GUICtrlSetData($msgdisplay, '') + GUICtrlCreateGroup($Text_CameraTriggerScript, 15, 300, 650, 150) + $Gui_CamTrigger = GUICtrlCreateCheckbox($Text_EnableCamTriggerScript, 31, 320, 185, 17) + If $CamTrigger = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) + GUICtrlSetColor(-1, $TextColor) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Text_CameraTriggerScriptTypes, 31, 345, 620, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_CamTriggerScript = GUICtrlCreateInput($CamTriggerScript, 31, 360, 515, 21) + GUICtrlCreateLabel($Text_RefreshTime, 31, 385, 620, 15) + GUICtrlSetColor(-1, $TextColor) + $GUI_CamTriggerTime = GUICtrlCreateInput($CamTriggerTime, 31, 400, 515, 21) + $csbrowse1 = GUICtrlCreateButton($Text_Browse, 556, 360, 97, 20, 0) + GUICtrlCreateTabItem("") ;END OF TABS + + $GUI_Set_Ok = GUICtrlCreateButton($Text_Ok, 455, 472, 75, 25, 0) + $GUI_Set_Can = GUICtrlCreateButton($Text_Cancel, 530, 472, 75, 25, 0) + $GUI_Set_Apply = GUICtrlCreateButton($Text_Apply, 605, 472, 73, 25, 0) + + If $StartTab = 0 Then GUICtrlSetState($Tab_Misc, $GUI_SHOW) + If $StartTab = 1 Then GUICtrlSetState($Tab_Save, $GUI_SHOW) + If $StartTab = 2 Then GUICtrlSetState($Tab_Gps, $GUI_SHOW) + If $StartTab = 3 Then GUICtrlSetState($Tab_Lan, $GUI_SHOW) + If $StartTab = 4 Then GUICtrlSetState($Tab_Manu, $GUI_SHOW) + If $StartTab = 5 Then GUICtrlSetState($Tab_Lab, $GUI_SHOW) + If $StartTab = 6 Then GUICtrlSetState($Tab_Col, $GUI_SHOW) + If $StartTab = 7 Then GUICtrlSetState($Tab_SW, $GUI_SHOW) + If $StartTab = 8 Then GUICtrlSetState($Tab_Auto, $GUI_SHOW) + If $StartTab = 9 Then GUICtrlSetState($Tab_Sound, $GUI_SHOW) + If $StartTab = 10 Then GUICtrlSetState($Tab_WifiDB, $GUI_SHOW) + If $StartTab = 11 Then GUICtrlSetState($Tab_Cam, $GUI_SHOW) + + GUICtrlSetOnEvent($Add_MANU, '_AddManu') + GUICtrlSetOnEvent($Edit_MANU, '_EditManu') + GUICtrlSetOnEvent($Remove_MANU, '_RemoveManu') + GUICtrlSetOnEvent($Add_Lab, '_AddLabel') + GUICtrlSetOnEvent($Edit_Lab, '_EditLabel') + GUICtrlSetOnEvent($Remove_Lab, '_RemoveLabel') + GUICtrlSetOnEvent($Add_Cam, '_AddCam') + GUICtrlSetOnEvent($Edit_Cam, '_EditCam') + GUICtrlSetOnEvent($Remove_Cam, '_RemoveCam') + + GUICtrlSetOnEvent($browse1, '_BrowseSave') + GUICtrlSetOnEvent($Browse2, '_BrowseAutoSave') + GUICtrlSetOnEvent($Browse3, '_BrowseAutoSaveRecovery') + GUICtrlSetOnEvent($Browse4, '_BrowseKmlSave') + + GUICtrlSetOnEvent($browsege, '_BrowseGoogleEarth') + + GUICtrlSetOnEvent($cbrowse1, '_ColorBrowse1') + GUICtrlSetOnEvent($cbrowse2, '_ColorBrowse2') + GUICtrlSetOnEvent($cbrowse3, '_ColorBrowse3') + GUICtrlSetOnEvent($cbrowse4, '_ColorBrowse4') + GUICtrlSetOnEvent($cbrowse5, '_ColorBrowse5') + + GUICtrlSetOnEvent($csbrowse1, '_CamScriptBrowse') + + GUISetOnEvent($GUI_EVENT_CLOSE, '_CloseSettingsGUI') + GUICtrlSetOnEvent($GUI_Set_Can, '_CloseSettingsGUI') + GUICtrlSetOnEvent($GUI_Set_Apply, '_ApplySettingsGUI') + GUICtrlSetOnEvent($ImpLanBrowse, '_ImportLanguageBrowse') + GUICtrlSetOnEvent($ImpLanButton, '_ImportLanguage') + GUICtrlSetOnEvent($GUI_Set_Ok, '_OkSettingsGUI') + GUICtrlSetOnEvent($CWCB_Line, '_SetWidthValue_Line') + GUICtrlSetOnEvent($CWCB_Active, '_SetWidthValue_Active') + GUICtrlSetOnEvent($CWCB_SSID, '_SetWidthValue_SSID') + GUICtrlSetOnEvent($CWCB_BSSID, '_SetWidthValue_BSSID') + GUICtrlSetOnEvent($CWCB_Signal, '_SetWidthValue_Signal') + GUICtrlSetOnEvent($CWCB_HighSignal, '_SetWidthValue_HighSignal') + GUICtrlSetOnEvent($CWCB_RSSI, '_SetWidthValue_RSSI') + GUICtrlSetOnEvent($CWCB_HighRSSI, '_SetWidthValue_HighRSSI') + GUICtrlSetOnEvent($CWCB_Authentication, '_SetWidthValue_Authentication') + GUICtrlSetOnEvent($CWCB_Encryption, '_SetWidthValue_Encryption') + GUICtrlSetOnEvent($CWCB_RadioType, '_SetWidthValue_RadioType') + GUICtrlSetOnEvent($CWCB_NetType, '_SetWidthValue_NetType') + GUICtrlSetOnEvent($CWCB_Manu, '_SetWidthValue_Manu') + GUICtrlSetOnEvent($CWCB_Channel, '_SetWidthValue_Channel') + GUICtrlSetOnEvent($CWCB_Label, '_SetWidthValue_Label') + GUICtrlSetOnEvent($CWCB_Latitude, '_SetWidthValue_Latitude') + GUICtrlSetOnEvent($CWCB_Longitude, '_SetWidthValue_Longitude') + GUICtrlSetOnEvent($CWCB_LatitudeDMS, '_SetWidthValue_LatitudeDMS') + GUICtrlSetOnEvent($CWCB_LongitudeDMS, '_SetWidthValue_LongitudeDMS') + GUICtrlSetOnEvent($CWCB_LatitudeDMM, '_SetWidthValue_LatitudeDMM') + GUICtrlSetOnEvent($CWCB_LongitudeDMM, '_SetWidthValue_LongitudeDMM') + GUICtrlSetOnEvent($CWCB_BtX, '_SetWidthValue_Btx') + GUICtrlSetOnEvent($CWCB_OtX, '_SetWidthValue_Otx') + GUICtrlSetOnEvent($CWCB_FirstActive, '_SetWidthValue_FirstActive') + GUICtrlSetOnEvent($CWCB_LastActive, '_SetWidthValue_LastActive') + GUICtrlSetOnEvent($LanguageBox, '_LanguageChanged') + GUICtrlSetOnEvent($GuiGuessSearchwords, '_GuessNetshSearchwords') + GUICtrlSetOnEvent($GUI_Manu_List, '_ManufacturerSort') + GUICtrlSetOnEvent($GUI_Lab_List, '_LabelSort') + + GUISetState(@SW_SHOW) + EndIf +EndFunc ;==>_SettingsGUI + +Func _CamScriptBrowse() + $camscriptfile = FileOpenDialog("Select camera script file", @ScriptDir, "Cam Script File (*.exe;*.bat)", 1 + 4) + If Not @error Then + GUICtrlSetData($GUI_CamTriggerScript, $camscriptfile) + EndIf +EndFunc ;==>_CamScriptBrowse + +Func _ColorBrowse1() + $color = _ChooseColor(2, $BackgroundColor, 2, $SetMisc) + If $color <> -1 Then GUICtrlSetData($GUI_BKColor, StringReplace($color, "0x", "")) +EndFunc ;==>_ColorBrowse1 + +Func _ColorBrowse2() + $color = _ChooseColor(2, $ControlBackgroundColor, 2, $SetMisc) + If $color <> -1 Then GUICtrlSetData($GUI_CBKColor, StringReplace($color, "0x", "")) +EndFunc ;==>_ColorBrowse2 + +Func _ColorBrowse3() + $color = _ChooseColor(2, $TextColor, 2, $SetMisc) + If $color <> -1 Then GUICtrlSetData($GUI_TextColor, StringReplace($color, "0x", "")) +EndFunc ;==>_ColorBrowse3 + +Func _ColorBrowse4() + $color = _ChooseColor(2, $ButtonActiveColor, 2, $SetMisc) + If $color <> -1 Then GUICtrlSetData($GUI_CBAColor, StringReplace($color, "0x", "")) +EndFunc ;==>_ColorBrowse4 + +Func _ColorBrowse5() + $color = _ChooseColor(2, $ButtonInactiveColor, 2, $SetMisc) + If $color <> -1 Then GUICtrlSetData($GUI_CBIColor, StringReplace($color, "0x", "")) +EndFunc ;==>_ColorBrowse5 + +Func _BrowseGoogleEarth() + $file = FileOpenDialog($Text_GoogleEarthEXE, "C:\Program Files (x86)\Google\Google Earth\client\", "Google Earth (googleearth.exe)", $FD_FILEMUSTEXIST) + If Not @error Then + GUICtrlSetData($GUI_GoogleEXE, $file) + EndIf +EndFunc ;==>_BrowseGoogleEarth + +Func _BrowseSave() + $folder = FileSelectFolder($Text_VistumblerSaveDirectory, '', 1, GUICtrlRead($GUI_Set_SaveDir)) + If Not @error Then + If StringTrimLeft($folder, StringLen($folder) - 1) <> "\" Then $folder = $folder & "\" ;If directory does not have training \ then add it + GUICtrlSetData($GUI_Set_SaveDir, $folder) + EndIf +EndFunc ;==>_BrowseSave + +Func _BrowseAutoSave() + $folder = FileSelectFolder($Text_VistumblerAutoSaveDirectory, '', 1, GUICtrlRead($GUI_Set_SaveDirAuto)) + If Not @error Then + If StringTrimLeft($folder, StringLen($folder) - 1) <> "\" Then $folder = $folder & "\" ;If directory does not have training \ then add it + GUICtrlSetData($GUI_Set_SaveDirAuto, $folder) + EndIf +EndFunc ;==>_BrowseAutoSave + +Func _BrowseAutoSaveRecovery() + $folder = FileSelectFolder($Text_VistumblerAutoRecoverySaveDirectory, '', 1, GUICtrlRead($GUI_Set_SaveDirAutoRecovery)) + If Not @error Then + If StringTrimLeft($folder, StringLen($folder) - 1) <> "\" Then $folder = $folder & "\" ;If directory does not have training \ then add it + GUICtrlSetData($GUI_Set_SaveDirAutoRecovery, $folder) + EndIf +EndFunc ;==>_BrowseAutoSaveRecovery + +Func _BrowseKmlSave() + $folder = FileSelectFolder($Text_VistumblerKmlSaveDirectory, '', 1, GUICtrlRead($GUI_Set_SaveDirKml)) + If Not @error Then + If StringTrimLeft($folder, StringLen($folder) - 1) <> "\" Then $folder = $folder & "\" ;If directory does not have training \ then add it + GUICtrlSetData($GUI_Set_SaveDirKml, $folder) + EndIf +EndFunc ;==>_BrowseKmlSave + +Func _ImportLanguageBrowse() ;opens a browse window to import a language file + $languagefile = FileOpenDialog("Select Language File", $SaveDir, "Vistumbler Language File (*.ini)", 1) + If Not @error Then + GUICtrlSetData($ImpLanFile, $languagefile) + EndIf +EndFunc ;==>_ImportLanguageBrowse + +Func _ImportLanguage() ;Copies language file to the languages directory + $imfile = GUICtrlRead($ImpLanFile) + If $imfile <> '' Then + $lastslash = StringInStr($imfile, "\", 0, -1) + $filename = StringTrimLeft($imfile, $lastslash) + FileDelete($LanguageDir & $filename) + FileCopy($imfile, $LanguageDir & $filename) + EndIf +EndFunc ;==>_ImportLanguage + +Func _LanguageChanged() ;Sets language information in gui if language changed + $Apply_Language = 1 + $Apply_Searchword = 1 + $Language = GUICtrlRead($LanguageBox) + $languagefile = $LanguageDir & $Language & ".ini" + GUICtrlSetData($LabAuth, IniRead($languagefile, 'Info', 'Author', '')) + GUICtrlSetData($LabDate, _DateLocalFormat(IniRead($languagefile, 'Info', 'Date', ''))) + GUICtrlSetData($LabWinCode, IniRead($languagefile, 'Info', 'WindowsLanguageCode', '')) + GUICtrlSetData($LabDesc, IniRead($languagefile, 'Info', 'Description', '')) + GUICtrlSetData($SearchWord_SSID_GUI, IniRead($languagefile, 'SearchWords', 'SSID', 'SSID')) + GUICtrlSetData($SearchWord_BSSID_GUI, IniRead($languagefile, 'SearchWords', 'BSSID', 'BSSID')) + GUICtrlSetData($SearchWord_Channel_GUI, IniRead($languagefile, 'SearchWords', 'Channel', 'Channel')) + GUICtrlSetData($SearchWord_Authentication_GUI, IniRead($languagefile, 'SearchWords', 'Authentication', 'Authentication')) + GUICtrlSetData($SearchWord_Encryption_GUI, IniRead($languagefile, 'SearchWords', 'Encryption', 'Encryption')) + GUICtrlSetData($SearchWord_RadioType_GUI, IniRead($languagefile, 'SearchWords', 'RadioType', 'Radio Type')) + GUICtrlSetData($SearchWord_NetType_GUI, IniRead($languagefile, 'SearchWords', 'NetworkType', 'Network type')) + GUICtrlSetData($SearchWord_Signal_GUI, IniRead($languagefile, 'SearchWords', 'Signal', 'Signal')) + ;GUICtrlSetData($SearchWord_RSSI_GUI, IniRead($languagefile, 'SearchWords', 'RSSI', 'RSSI')) + GUICtrlSetData($SearchWord_BasicRates_GUI, IniRead($languagefile, 'SearchWords', 'BasicRates', 'Basic Rates')) + GUICtrlSetData($SearchWord_OtherRates_GUI, IniRead($languagefile, 'SearchWords', 'OtherRates', 'Other Rates')) + GUICtrlSetData($SearchWord_Open_GUI, IniRead($languagefile, 'SearchWords', 'Open', 'Open')) + GUICtrlSetData($SearchWord_None_GUI, IniRead($languagefile, 'SearchWords', 'None', 'None')) + GUICtrlSetData($SearchWord_Wep_GUI, IniRead($languagefile, 'SearchWords', 'Wep', 'WEP')) + GUICtrlSetData($SearchWord_Infrastructure_GUI, IniRead($languagefile, 'SearchWords', 'Infrastructure', 'Infrastructure')) + GUICtrlSetData($SearchWord_Adhoc_GUI, IniRead($languagefile, 'SearchWords', 'Adhoc', 'Adhoc')) +EndFunc ;==>_LanguageChanged + +Func _CloseSettingsGUI() ;closes settings gui + GUIDelete($SetMisc) + $SettingsOpen = 0 +EndFunc ;==>_CloseSettingsGUI + +Func _OkSettingsGUI() ;Applys settings and closes settings gui + _ApplySettingsGUI() + _CloseSettingsGUI() + _WriteINI() +EndFunc ;==>_OkSettingsGUI + +Func _ApplySettingsGUI() ;Applys settings + $RestartVistumbler = 0 + If $Apply_Misc = 1 Then + + If GUICtrlRead($GUI_AutoCheckForUpdates) = 1 Then + $AutoCheckForUpdates = 1 + Else + $AutoCheckForUpdates = 0 + EndIf + If GUICtrlRead($GUI_CheckForBetaUpdates) = 1 Then + $CheckForBetaUpdates = 1 + Else + $CheckForBetaUpdates = 0 + EndIf + + $dBmMaxSignal = GUICtrlRead($GUI_dBmMaxSignal) + $dBmDissociationSignal = GUICtrlRead($GUI_dBmDisassociationSignal) + $RefreshLoopTime = GUICtrlRead($GUI_RefreshLoop) + $TimeBeforeMarkedDead = GUICtrlRead($GUI_TimeBeforeMarkingDead) + If $TimeBeforeMarkedDead > 86400 Then $TimeBeforeMarkedDead = 86400 + + ;Auto Refresh + If GUICtrlRead($GUI_RefreshNetworks) = 4 And $RefreshNetworks = 1 Then _AutoRefreshToggle() + If GUICtrlRead($GUI_RefreshNetworks) = 1 And $RefreshNetworks = 0 Then _AutoRefreshToggle() + $RefreshTime = (GUICtrlRead($GUI_RefreshTime) * 1000) + + $BackgroundColor = '0x' & StringUpper(GUICtrlRead($GUI_BKColor)) + $ControlBackgroundColor = '0x' & StringUpper(GUICtrlRead($GUI_CBKColor)) + $TextColor = '0x' & StringUpper(GUICtrlRead($GUI_TextColor)) + $ButtonActiveColor = '0x' & StringUpper(GUICtrlRead($GUI_CBAColor)) + $ButtonInactiveColor = '0x' & StringUpper(GUICtrlRead($GUI_CBIColor)) + + $TextSize = GUICtrlRead($GUI_TextSize) + + EndIf + If $Apply_Save = 1 Then + $Tmp_SaveDir = GUICtrlRead($GUI_Set_SaveDir) + $Tmp_SaveDirAuto = GUICtrlRead($GUI_Set_SaveDirAuto) + $Tmp_SaveDirAutoRecovery = GUICtrlRead($GUI_Set_SaveDirAutoRecovery) + $Tmp_SaveDirKml = GUICtrlRead($GUI_Set_SaveDirKml) + If StringTrimLeft($Tmp_SaveDir, StringLen($Tmp_SaveDir) - 1) <> "\" Then $Tmp_SaveDir = $Tmp_SaveDir & "\" ;If directory does not have trailing \ then add it + If StringTrimLeft($Tmp_SaveDirAuto, StringLen($Tmp_SaveDirAuto) - 1) <> "\" Then $Tmp_SaveDirAuto = $Tmp_SaveDirAuto & "\" ;If directory does not have trailing \ then add it + If StringTrimLeft($Tmp_SaveDirAutoRecovery, StringLen($Tmp_SaveDirAutoRecovery) - 1) <> "\" Then $Tmp_SaveDirAutoRecovery = $Tmp_SaveDirAutoRecovery & "\" ;If directory does not have trailing \ then add it + If StringTrimLeft($Tmp_SaveDirKml, StringLen($Tmp_SaveDirKml) - 1) <> "\" Then $Tmp_SaveDirKml = $Tmp_SaveDirKml & "\" ;If directory does not have trailing \ then add it + $SaveDir = $Tmp_SaveDir + $SaveDirAuto = $Tmp_SaveDirAuto + $SaveDirAutoRecovery = $Tmp_SaveDirAutoRecovery + $SaveDirKml = $Tmp_SaveDirKml + + ;Auto Save and Clear + If GUICtrlRead($AutoSaveAndClearBox) = 4 And $AutoSaveAndClear = 1 Then _AutoSaveAndClearToggle() + If GUICtrlRead($AutoSaveAndClearBox) = 1 And $AutoSaveAndClear = 0 Then _AutoSaveAndClearToggle() + + If GUICtrlRead($AutoSaveAndClearRadioAP) = 1 Then + $AutoSaveAndClearOnAPs = 1 + $AutoSaveAndClearOnTime = 0 + Else + $AutoSaveAndClearOnAPs = 0 + $AutoSaveAndClearOnTime = 1 + EndIf + $AutoSaveAndClearAPs = GUICtrlRead($AutoSaveAndClearAPsGUI) + $AutoSaveAndClearTime = GUICtrlRead($AutoSaveAndClearTimeGUI) + + ;Auto Recovery VS1 + If GUICtrlRead($AutoRecoveryBox) = 4 And $AutoRecoveryVS1 = 1 Then _AutoRecoveryVS1Toggle() + If GUICtrlRead($AutoRecoveryBox) = 1 And $AutoRecoveryVS1 = 0 Then _AutoRecoveryVS1Toggle() + If GUICtrlRead($AutoRecoveryDelBox) = 1 Then + $AutoRecoveryVS1Del = 1 + Else + $AutoRecoveryVS1Del = 0 + EndIf + $AutoRecoveryTime = GUICtrlRead($AutoRecoveryTimeGUI) + If GUICtrlRead($AutoSaveAndClearPlaySoundGUI) = 1 Then + $AutoSaveAndClearPlaySound = 1 + Else + $AutoSaveAndClearPlaySound = 0 + EndIf + EndIf + If $Apply_GPS = 1 Then + If GUICtrlRead($GUI_Comport) <> $ComPort And $UseGPS = 1 Then _GpsToggle() ;If the port has changed and gps is turned on then turn off the gps (it will be re-enabled with the new port) + If GUICtrlRead($Rad_UseCommMG) = 1 Then $GpsType = 0 ;Set CommMG as default comm interface + If GUICtrlRead($Rad_UseNetcomm) = 1 Then $GpsType = 1 ;Set Netcomm as default comm interface + If GUICtrlRead($Rad_UseKernel32) = 1 Then $GpsType = 2 ;Set Kernel32 as default comm interface + $ComPort = GUICtrlRead($GUI_Comport) + $BAUD = GUICtrlRead($GUI_Baud) + $STOPBIT = GUICtrlRead($GUI_StopBit) + $DATABIT = GUICtrlRead($GUI_DataBit) + If GUICtrlRead($GUI_Parity) = $Text_Even Then + $PARITY = 'E' + ElseIf GUICtrlRead($GUI_Parity) = $Text_Mark Then + $PARITY = 'M' + ElseIf GUICtrlRead($GUI_Parity) = $Text_Odd Then + $PARITY = 'O' + ElseIf GUICtrlRead($GUI_Parity) = $Text_Space Then + $PARITY = 'S' + Else ;GUICtrlRead($GUI_Parity) = 'None' Then + $PARITY = 'N' + EndIf + If GUICtrlRead($GUI_Format) = "dd.dddd" Then $GPSformat = 1 + If GUICtrlRead($GUI_Format) = "dd mm ss" Then $GPSformat = 2 + If GUICtrlRead($GUI_Format) = "ddmm.mmmm" Then $GPSformat = 3 + GUICtrlSetData($GuiLat, $Text_Latitude & ': ' & _GpsFormat($Latitude)) ;Set GPS Latitude in GUI + GUICtrlSetData($GuiLon, $Text_Longitude & ': ' & _GpsFormat($Longitude)) ;Set GPS Longitude in GUI + If GUICtrlRead($GUI_GpsDisconnect) = 1 Then + $GpsDisconnect = 1 + Else + $GpsDisconnect = 0 + EndIf + If GUICtrlRead($GUI_GpsReset) = 1 Then + $GpsReset = 1 + Else + $GpsReset = 0 + EndIf + EndIf + If $Apply_Language = 1 Then + $DefaultLanguage = GUICtrlRead($LanguageBox) + $DefaultLanguageFile = $DefaultLanguage & '.ini' + $DefaultLanguagePath = $LanguageDir & $DefaultLanguageFile + $Column_Names_Line = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Line', '#') + $Column_Names_Active = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Active', 'Active') + $Column_Names_SSID = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_SSID', 'SSID') + $Column_Names_BSSID = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_BSSID', 'Mac Address') + $Column_Names_MANUF = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Manufacturer', 'Manufacturer') + $Column_Names_Signal = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Signal', 'Signal') + $Column_Names_HighSignal = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_HighSignal', 'High Signal') + $Column_Names_RSSI = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_RSSI', 'RSSI') + $Column_Names_HighRSSI = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_HighRSSI', 'High RSSI') + $Column_Names_Authentication = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Authentication', 'Authentication') + $Column_Names_Encryption = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Encryption', 'Encryption') + $Column_Names_RadioType = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_RadioType', 'Radio Type') + $Column_Names_Channel = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Channel', 'Channel') + $Column_Names_Latitude = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Latitude', 'Latitude') + $Column_Names_Longitude = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Longitude', 'Longitude') + $Column_Names_BasicTransferRates = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_BasicTransferRates', 'Basic Transfer Rates') + $Column_Names_OtherTransferRates = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_OtherTransferRates', 'Other Transfer Rates') + $Column_Names_FirstActive = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_FirstActive', 'First Active') + $Column_Names_LastActive = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_LastActive', 'Last Active') + $Column_Names_NetworkType = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_NetworkType', 'Network Type') + $Column_Names_Label = IniRead($DefaultLanguagePath, 'Column_Names', 'Column_Label', 'Label') + + $Text_Ok = IniRead($DefaultLanguagePath, 'GuiText', 'Ok', '&Ok') + $Text_Cancel = IniRead($DefaultLanguagePath, 'GuiText', 'Cancel', 'C&ancel') + $Text_Apply = IniRead($DefaultLanguagePath, 'GuiText', 'Apply', '&Apply') + $Text_Browse = IniRead($DefaultLanguagePath, 'GuiText', 'Browse', '&Browse') + $Text_File = IniRead($DefaultLanguagePath, 'GuiText', 'File', '&File') + $Text_Import = IniRead($DefaultLanguagePath, 'GuiText', 'Import', '&Import') + $Text_SaveAsTXT = IniRead($DefaultLanguagePath, 'GuiText', 'SaveAsTXT', 'Save As TXT') + $Text_SaveAsVS1 = IniRead($DefaultLanguagePath, 'GuiText', 'SaveAsVS1', 'Save As VS1') + $Text_SaveAsVSZ = IniRead($DefaultLanguagePath, 'GuiText', 'SaveAsVSZ', 'Save As VSZ') + $Text_ImportFromTXT = IniRead($DefaultLanguagePath, 'GuiText', 'ImportFromTXT', 'Import From TXT / VS1') + $Text_ImportFromVSZ = IniRead($DefaultLanguagePath, 'GuiText', 'ImportFromVSZ', 'Import From VSZ') + $Text_Exit = IniRead($DefaultLanguagePath, 'GuiText', 'Exit', 'E&xit') + $Text_ExitSaveDb = IniRead($DefaultLanguagePath, 'GuiText', 'ExitSaveDb', 'Exit (Save DB)') + $Text_Edit = IniRead($DefaultLanguagePath, 'GuiText', 'Edit', 'E&dit') + $Text_ClearAll = IniRead($DefaultLanguagePath, 'GuiText', 'ClearAll', 'Clear All') + $Text_Cut = IniRead($DefaultLanguagePath, 'GuiText', 'Cut', 'Cut') + $Text_Copy = IniRead($DefaultLanguagePath, 'GuiText', 'Copy', 'Copy') + $Text_Paste = IniRead($DefaultLanguagePath, 'GuiText', 'Paste', 'Paste') + $Text_Delete = IniRead($DefaultLanguagePath, 'GuiText', 'Delete', 'Delete') + $Text_Select = IniRead($DefaultLanguagePath, 'GuiText', 'Select', 'Select') + $Text_SelectAll = IniRead($DefaultLanguagePath, 'GuiText', 'SelectAll', 'Select All') + $Text_View = IniRead($DefaultLanguagePath, 'GuiText', 'View', '&View') + $Text_Options = IniRead($DefaultLanguagePath, 'GuiText', 'Options', '&Options') + $Text_AutoSort = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSort', 'AutoSort') + $Text_SortTree = IniRead($DefaultLanguagePath, 'GuiText', 'SortTree', 'Sort Tree(slow)') + $Text_PlaySound = IniRead($DefaultLanguagePath, 'GuiText', 'PlaySound', 'Play sound on new AP') + $Text_PlayGpsSound = IniRead($DefaultLanguagePath, 'GuiText', 'PlayGpsSound', 'Play sound on new GPS') + $Text_AddAPsToTop = IniRead($DefaultLanguagePath, 'GuiText', 'AddAPsToTop', 'Add new APs to top') + $Text_Extra = IniRead($DefaultLanguagePath, 'GuiText', 'Extra', 'Ex&tra') + $Text_ScanAPs = IniRead($DefaultLanguagePath, 'GuiText', 'ScanAPs', '&Scan APs') + $Text_StopScanAps = IniRead($DefaultLanguagePath, 'GuiText', 'StopScanAps', '&Stop') + $Text_UseGPS = IniRead($DefaultLanguagePath, 'GuiText', 'UseGPS', 'Use &GPS') + $Text_StopGPS = IniRead($DefaultLanguagePath, 'GuiText', 'StopGPS', 'Stop &GPS') + $Text_Settings = IniRead($DefaultLanguagePath, 'GuiText', 'Settings', 'Settings') + $Text_MiscSettings = IniRead($DefaultLanguagePath, 'GuiText', 'MiscSettings', 'Misc Settings') + $Text_SaveSettings = IniRead($DefaultLanguagePath, 'GuiText', 'SaveSettings', 'Save Settings') + $Text_GpsSettings = IniRead($DefaultLanguagePath, 'GuiText', 'GpsSettings', 'GPS Settings') + $Text_SetLanguage = IniRead($DefaultLanguagePath, 'GuiText', 'SetLanguage', 'Set Language') + $Text_SetSearchWords = IniRead($DefaultLanguagePath, 'GuiText', 'SetSearchWords', 'Set Search Words') + $Text_SetMacLabel = IniRead($DefaultLanguagePath, 'GuiText', 'SetMacLabel', 'Set Labels by Mac') + $Text_SetMacManu = IniRead($DefaultLanguagePath, 'GuiText', 'SetMacManu', 'Set Manufactures by Mac') + $Text_Export = IniRead($DefaultLanguagePath, 'GuiText', 'Export', 'Ex&port') + $Text_ExportToKML = IniRead($DefaultLanguagePath, 'GuiText', 'ExportToKML', 'Export To KML') + $Text_ExportToGPX = IniRead($DefaultLanguagePath, 'GuiText', 'ExportToGPX', 'Export To GPX') + $Text_ExportToTXT = IniRead($DefaultLanguagePath, 'GuiText', 'ExportToTXT', 'Export To TXT') + $Text_ExportToNS1 = IniRead($DefaultLanguagePath, 'GuiText', 'ExportToNS1', 'Export To NS1') + $Text_ExportToVS1 = IniRead($DefaultLanguagePath, 'GuiText', 'ExportToVS1', 'Export To VS1') + $Text_ExportToCSV = IniRead($DefaultLanguagePath, 'GuiText', 'ExportToCSV', 'Export To CSV') + $Text_ExportToVSZ = IniRead($DefaultLanguagePath, "GuiText", "ExportToVSZ", "Export To VSZ") + $Text_WifiDbPHPgraph = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDbPHPgraph', 'Graph Selected AP Signal to Image') + $Text_WifiDbWDB = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDbWDB', 'WiFiDB URL') + $Text_WifiDbWdbLocate = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDbWdbLocate', 'WifiDB Locate URL') + $Text_UploadDataToWifiDB = IniRead($DefaultLanguagePath, 'GuiText', 'UploadDataToWiFiDB', 'Upload Data to WiFiDB') + $Text_RefreshLoopTime = IniRead($DefaultLanguagePath, 'GuiText', 'RefreshLoopTime', 'Refresh loop time(ms):') + $Text_ActualLoopTime = IniRead($DefaultLanguagePath, 'GuiText', 'ActualLoopTime', 'Actual loop time:') + $Text_Longitude = IniRead($DefaultLanguagePath, 'GuiText', 'Longitude', 'Longitude:') + $Text_Latitude = IniRead($DefaultLanguagePath, 'GuiText', 'Latitude', 'Latitude:') + $Text_ActiveAPs = IniRead($DefaultLanguagePath, 'GuiText', 'ActiveAPs', 'Active APs:') + $Text_Graph = IniRead($DefaultLanguagePath, 'GuiText', 'Graph', 'Graph') + $Text_Graph1 = IniRead($DefaultLanguagePath, 'GuiText', 'Graph1', 'Graph1') + $Text_Graph2 = IniRead($DefaultLanguagePath, 'GuiText', 'Graph2', 'Graph2') + $Text_NoGraph = IniRead($DefaultLanguagePath, 'GuiText', 'NoGraph', 'No Graph') + $Text_Active = IniRead($DefaultLanguagePath, 'GuiText', 'Active', 'Active') + $Text_Dead = IniRead($DefaultLanguagePath, 'GuiText', 'Dead', 'Dead') + $Text_AddNewLabel = IniRead($DefaultLanguagePath, 'GuiText', 'AddNewLabel', 'Add New Label') + $Text_RemoveLabel = IniRead($DefaultLanguagePath, 'GuiText', 'RemoveLabel', 'Remove Selected Label') + $Text_EditLabel = IniRead($DefaultLanguagePath, 'GuiText', 'EditLabel', 'Edit Selected Label') + $Text_AddNewMan = IniRead($DefaultLanguagePath, 'GuiText', 'AddNewMan', 'Add New Manufacturer') + $Text_RemoveMan = IniRead($DefaultLanguagePath, 'GuiText', 'RemoveMan', 'Remove Selected Manufacturer') + $Text_EditMan = IniRead($DefaultLanguagePath, 'GuiText', 'EditMan', 'Edit Selected Manufacturer') + $Text_NewMac = IniRead($DefaultLanguagePath, 'GuiText', 'NewMac', 'New Mac Address:') + $Text_NewMan = IniRead($DefaultLanguagePath, 'GuiText', 'NewMan', 'New Manufacturer:') + $Text_NewLabel = IniRead($DefaultLanguagePath, 'GuiText', 'NewLabel', 'New label:') + $Text_Save = IniRead($DefaultLanguagePath, 'GuiText', 'Save', 'Save?') + $Text_SaveQuestion = IniRead($DefaultLanguagePath, 'GuiText', 'SaveQuestion', 'Data has changed. Would you like to save?') + $Text_GpsDetails = IniRead($DefaultLanguagePath, 'GuiText', 'GpsDetails', 'GPS Details') + $Text_GpsCompass = IniRead($DefaultLanguagePath, 'GuiText', 'GpsCompass', 'Gps Compass') + $Text_Quality = IniRead($DefaultLanguagePath, 'GuiText', 'Quality', 'Quality') + $Text_Time = IniRead($DefaultLanguagePath, 'GuiText', 'Time', 'Time') + $Text_NumberOfSatalites = IniRead($DefaultLanguagePath, 'GuiText', 'NumberOfSatalites', 'Number of Satalites') + $Text_HorizontalDilutionPosition = IniRead($DefaultLanguagePath, 'GuiText', 'HorizontalDilutionPosition', 'Horizontal Dilution') + $Text_Altitude = IniRead($DefaultLanguagePath, 'GuiText', 'Altitude', 'Altitude') + $Text_HeightOfGeoid = IniRead($DefaultLanguagePath, 'GuiText', 'HeightOfGeoid', 'Height of Geoid') + $Text_Status = IniRead($DefaultLanguagePath, 'GuiText', 'Status', 'Status') + $Text_Date = IniRead($DefaultLanguagePath, 'GuiText', 'Date', 'Date') + $Text_SpeedInKnots = IniRead($DefaultLanguagePath, 'GuiText', 'SpeedInKnots', 'Speed(knots)') + $Text_SpeedInMPH = IniRead($DefaultLanguagePath, 'GuiText', 'SpeedInMPH', 'Speed(MPH)') + $Text_SpeedInKmh = IniRead($DefaultLanguagePath, 'GuiText', 'SpeedInKmh', 'Speed(km/h)') + $Text_TrackAngle = IniRead($DefaultLanguagePath, 'GuiText', 'TrackAngle', 'Track Angle') + $Text_Close = IniRead($DefaultLanguagePath, 'GuiText', 'Close', 'Track Close') + $Text_RefreshNetworks = IniRead($DefaultLanguagePath, 'GuiText', 'RefreshingNetworks', 'Auto Refresh Networks') + $Text_Start = IniRead($DefaultLanguagePath, 'GuiText', 'Start', 'Start') + $Text_Stop = IniRead($DefaultLanguagePath, 'GuiText', 'Stop', 'Stop') + $Text_RefreshTime = IniRead($DefaultLanguagePath, 'GuiText', 'RefreshTime', 'Refresh time') + $Text_SetColumnWidths = IniRead($DefaultLanguagePath, 'GuiText', 'SetColumnWidths', 'Set Column Widths') + $Text_Enable = IniRead($DefaultLanguagePath, 'GuiText', 'Enable', 'Enable') + $Text_Disable = IniRead($DefaultLanguagePath, 'GuiText', 'Disable', 'Disable') + $Text_Checked = IniRead($DefaultLanguagePath, 'GuiText', 'Checked', 'Checked') + $Text_UnChecked = IniRead($DefaultLanguagePath, 'GuiText', 'UnChecked', 'UnChecked') + $Text_Unknown = IniRead($DefaultLanguagePath, 'GuiText', 'Unknown', 'Unknown') + $Text_Restart = IniRead($DefaultLanguagePath, 'GuiText', 'Restart', 'Restart') + $Text_RestartMsg = IniRead($DefaultLanguagePath, 'GuiText', 'RestartMsg', 'Please restart Vistumbler for the change to take effect') + $Text_Error = IniRead($DefaultLanguagePath, 'GuiText', 'Error', 'Error') + $Text_NoSignalHistory = IniRead($DefaultLanguagePath, 'GuiText', 'NoSignalHistory', 'No signal history found, check to make sure your netsh search words are correct') + $Text_NoApSelected = IniRead($DefaultLanguagePath, 'GuiText', 'NoApSelected', 'You did not select an access point') + $Text_UseNetcomm = IniRead($DefaultLanguagePath, 'GuiText', 'UseNetcomm', 'Use Netcomm OCX (more stable) - x32') + $Text_UseCommMG = IniRead($DefaultLanguagePath, 'GuiText', 'UseCommMG', 'Use CommMG (less stable) - x32 - x64') + $Text_SignalHistory = IniRead($DefaultLanguagePath, 'GuiText', 'SignalHistory', 'Signal History') + $Text_AutoSortEvery = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSortEvery', 'Auto Sort Every') + $Text_Seconds = IniRead($DefaultLanguagePath, 'GuiText', 'Seconds', 'Seconds') + $Text_Ascending = IniRead($DefaultLanguagePath, 'GuiText', 'Ascending', 'Ascending') + $Text_Decending = IniRead($DefaultLanguagePath, 'GuiText', 'Decending', 'Decending') + $Text_AutoSave = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSave', 'AutoSave') + $Text_AutoSaveEvery = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveEvery', 'AutoSave Every') + $Text_DelAutoSaveOnExit = IniRead($DefaultLanguagePath, 'GuiText', 'DelAutoSaveOnExit', 'Delete Autosave file on exit') + $Text_OpenSaveFolder = IniRead($DefaultLanguagePath, 'GuiText', 'OpenSaveFolder', 'Open Save Folder') + $Text_SortBy = IniRead($DefaultLanguagePath, 'GuiText', 'SortBy', 'Sort By') + $Text_SortDirection = IniRead($DefaultLanguagePath, 'GuiText', 'SortDirection', 'Sort Direction') + $Text_Auto = IniRead($DefaultLanguagePath, 'GuiText', 'Auto', 'Auto') + $Text_Misc = IniRead($DefaultLanguagePath, 'GuiText', 'Misc', 'Misc') + $Text_Gps = IniRead($DefaultLanguagePath, 'GuiText', 'GPS', 'GPS') + $Text_Labels = IniRead($DefaultLanguagePath, 'GuiText', 'Labels', 'Labels') + $Text_Manufacturers = IniRead($DefaultLanguagePath, 'GuiText', 'Manufacturers', 'Manufacturers') + $Text_Columns = IniRead($DefaultLanguagePath, 'GuiText', 'Columns', 'Columns') + $Text_Language = IniRead($DefaultLanguagePath, 'GuiText', 'Language', 'Language') + $Text_SearchWords = IniRead($DefaultLanguagePath, 'GuiText', 'SearchWords', 'SearchWords') + $Text_VistumblerSettings = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerSettings', 'Vistumbler Settings') + $Text_LanguageAuthor = IniRead($DefaultLanguagePath, 'GuiText', 'LanguageAuthor', 'Language Author') + $Text_LanguageDate = IniRead($DefaultLanguagePath, 'GuiText', 'LanguageDate', 'Language Date') + $Text_LanguageDescription = IniRead($DefaultLanguagePath, 'GuiText', 'LanguageDescription', 'Language Description') + $Text_Description = IniRead($DefaultLanguagePath, 'GuiText', 'Description', 'Description') + $Text_Progress = IniRead($DefaultLanguagePath, 'GuiText', 'Progress', 'Progress') + $Text_LinesMin = IniRead($DefaultLanguagePath, 'GuiText', 'LinesMin', 'Lines/Min') + $Text_NewAPs = IniRead($DefaultLanguagePath, 'GuiText', 'NewAPs', 'New APs') + $Text_NewGIDs = IniRead($DefaultLanguagePath, 'GuiText', 'NewGIDs', 'New GIDs') + $Text_Minutes = IniRead($DefaultLanguagePath, 'GuiText', 'Minutes', 'Minutes') + $Text_LineTotal = IniRead($DefaultLanguagePath, 'GuiText', 'LineTotal', 'Line/Total') + $Text_EstimatedTimeRemaining = IniRead($DefaultLanguagePath, 'GuiText', 'EstimatedTimeRemaining', 'Estimated Time Remaining') + $Text_Ready = IniRead($DefaultLanguagePath, 'GuiText', 'Ready', 'Ready') + $Text_Done = IniRead($DefaultLanguagePath, 'GuiText', 'Done', 'Done') + $Text_VistumblerSaveDirectory = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerSaveDirectory', 'Vistumbler Save Directory') + $Text_VistumblerAutoSaveDirectory = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerAutoSaveDirectory', 'Vistumbler Auto Save Directory') + $Text_VistumblerAutoRecoverySaveDirectory = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerAutoRecoverySaveDirectory', 'Vistumbler Auto Recovery Save Directory') + $Text_VistumblerKmlSaveDirectory = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerKmlSaveDirectory', 'Vistumbler KML Save Directory') + $Text_BackgroundColor = IniRead($DefaultLanguagePath, 'GuiText', 'BackgroundColor', 'Background Color') + $Text_ControlColor = IniRead($DefaultLanguagePath, 'GuiText', 'ControlColor', 'Control Color') + $Text_BgFontColor = IniRead($DefaultLanguagePath, 'GuiText', 'BgFontColor', 'Font Color') + $Text_ConFontColor = IniRead($DefaultLanguagePath, 'GuiText', 'ConFontColor', 'Control Font Color') + $Text_NetshMsg = IniRead($DefaultLanguagePath, 'GuiText', 'NetshMsg', 'This section allows you to change the words Vistumbler uses to search netsh. Change to the proper words for you version of windows. Run "netsh wlan show networks mode = bssid" to find the proper words.') + $Text_PHPgraphing = IniRead($DefaultLanguagePath, 'GuiText', 'PHPgraphing', 'PHP Graphing') + $Text_ComInterface = IniRead($DefaultLanguagePath, 'GuiText', 'ComInterface', 'Com Interface') + $Text_ComSettings = IniRead($DefaultLanguagePath, 'GuiText', 'ComSettings', 'Com Settings') + $Text_Com = IniRead($DefaultLanguagePath, 'GuiText', 'Com', 'Com') + $Text_Baud = IniRead($DefaultLanguagePath, 'GuiText', 'Baud', 'Baud') + $Text_GPSFormat = IniRead($DefaultLanguagePath, 'GuiText', 'GPSFormat', 'GPS Format') + $Text_HideOtherGpsColumns = IniRead($DefaultLanguagePath, 'GuiText', 'HideOtherGpsColumns', 'Hide Other GPS Columns') + $Text_ImportLanguageFile = IniRead($DefaultLanguagePath, 'GuiText', 'ImportLanguageFile', 'Import Language File') + $Text_AutoKml = IniRead($DefaultLanguagePath, 'GuiText', 'AutoKml', 'Auto KML') + $Text_GoogleEarthEXE = IniRead($DefaultLanguagePath, 'GuiText', 'GoogleEarthEXE', 'Google Earth EXE') + $Text_AutoSaveKmlEvery = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveKmlEvery', 'Auto Save KML Every') + $Text_SavedAs = IniRead($DefaultLanguagePath, 'GuiText', 'SavedAs', 'Saved As') + $Text_Overwrite = IniRead($DefaultLanguagePath, 'GuiText', 'Overwrite', 'Overwrite') + $Text_InstallNetcommOCX = IniRead($DefaultLanguagePath, 'GuiText', 'InstallNetcommOCX', 'Install Netcomm OCX') + $Text_NoFileSaved = IniRead($DefaultLanguagePath, 'GuiText', 'NoFileSaved', 'No file has been saved') + $Text_NoApsWithGps = IniRead($DefaultLanguagePath, 'GuiText', 'NoApsWithGps', 'No access points found with gps coordinates.') + $Text_NoAps = IniRead($DefaultLanguagePath, 'GuiText', 'NoAps', 'No access points.') + $Text_MacExistsOverwriteIt = IniRead($DefaultLanguagePath, 'GuiText', 'MacExistsOverwriteIt', 'A entry for this mac address already exists. would you like to overwrite it?') + $Text_SavingLine = IniRead($DefaultLanguagePath, 'GuiText', 'SavingLine', 'Saving Line') + $Text_Debug = IniRead($DefaultLanguagePath, 'GuiText', 'Debug', 'Debug') + $Text_DisplayDebug = IniRead($DefaultLanguagePath, 'GuiText', 'DisplayDebug', 'Display Functions') + $Text_DisplayComErrors = IniRead($DefaultLanguagePath, 'GuiText', 'DisplayDebugCom', 'Display COM Errors') + $Text_GraphDeadTime = IniRead($DefaultLanguagePath, 'GuiText', 'GraphDeadTime', 'Graph Dead Time') + $Text_OpenKmlNetLink = IniRead($DefaultLanguagePath, 'GuiText', 'OpenKmlNetLink', 'Open KML NetworkLink') + $Text_ActiveRefreshTime = IniRead($DefaultLanguagePath, 'GuiText', 'ActiveRefreshTime', 'Active Refresh Time') + $Text_DeadRefreshTime = IniRead($DefaultLanguagePath, 'GuiText', 'DeadRefreshTime', 'Dead Refresh Time') + $Text_GpsRefrshTime = IniRead($DefaultLanguagePath, 'GuiText', 'GpsRefrshTime', 'Gps Refrsh Time') + $Text_FlyToSettings = IniRead($DefaultLanguagePath, 'GuiText', 'FlyToSettings', 'Fly To Settings') + $Text_FlyToCurrentGps = IniRead($DefaultLanguagePath, 'GuiText', 'FlyToCurrentGps', 'Fly to current gps position') + $Text_AltitudeMode = IniRead($DefaultLanguagePath, 'GuiText', 'AltitudeMode', 'Altitude Mode') + $Text_Range = IniRead($DefaultLanguagePath, 'GuiText', 'Range', 'Range') + $Text_Heading = IniRead($DefaultLanguagePath, 'GuiText', 'Heading', 'Heading') + $Text_Tilt = IniRead($DefaultLanguagePath, 'GuiText', 'Tilt', 'Tilt') + $Text_AutoOpenNetworkLink = IniRead($DefaultLanguagePath, 'GuiText', 'AutoOpenNetworkLink', 'Automatically Open KML Network Link') + $Text_SpeakSignal = IniRead($DefaultLanguagePath, 'GuiText', 'SpeakSignal', 'Speak Signal') + $Text_SpeakUseVisSounds = IniRead($DefaultLanguagePath, 'GuiText', 'SpeakUseVisSounds', 'Use Vistumbler Sound Files') + $Text_SpeakUseSapi = IniRead($DefaultLanguagePath, 'GuiText', 'SpeakUseSapi', 'Use Microsoft Sound API') + $Text_SpeakSayPercent = IniRead($DefaultLanguagePath, 'GuiText', 'SpeakSayPercent', 'Say "Percent" after signal') + $Text_GpsTrackTime = IniRead($DefaultLanguagePath, 'GuiText', 'GpsTrackTime', 'Track Refresh Time') + $Text_SaveAllGpsData = IniRead($DefaultLanguagePath, 'GuiText', 'SaveAllGpsData', 'Save GPS data when no APs are active') + $Text_None = IniRead($DefaultLanguagePath, 'GuiText', 'None', 'None') + $Text_Even = IniRead($DefaultLanguagePath, 'GuiText', 'Even', 'Even') + $Text_Odd = IniRead($DefaultLanguagePath, 'GuiText', 'Odd', 'Odd') + $Text_Mark = IniRead($DefaultLanguagePath, 'GuiText', 'Mark', 'Mark') + $Text_Space = IniRead($DefaultLanguagePath, 'GuiText', 'Space', 'Space') + $Text_StopBit = IniRead($DefaultLanguagePath, 'GuiText', 'StopBit', 'Stop Bit') + $Text_Parity = IniRead($DefaultLanguagePath, 'GuiText', 'Parity', 'Parity') + $Text_DataBit = IniRead($DefaultLanguagePath, 'GuiText', 'DataBit', 'Data Bit') + $Text_Update = IniRead($DefaultLanguagePath, 'GuiText', 'Update', 'Update') + $Text_UpdateMsg = IniRead($DefaultLanguagePath, 'GuiText', 'UpdateMsg', 'Update Found. Would you like to update vistumbler?') + $Text_Recover = IniRead($DefaultLanguagePath, 'GuiText', 'Recover', 'Recover') + $Text_RecoverMsg = IniRead($DefaultLanguagePath, 'GuiText', 'RecoverMsg', 'Old DB Found. Would you like to recover it?') + $Text_SelectConnectedAP = IniRead($DefaultLanguagePath, 'GuiText', 'SelectConnectedAP', 'Select Connected AP') + $Text_VistumblerHome = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerHome', 'Vistumbler Home') + $Text_VistumblerForum = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerForum', 'Vistumbler Forum') + $Text_VistumblerWiki = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerWiki', 'Vistumbler Wiki') + $Text_CheckForUpdates = IniRead($DefaultLanguagePath, 'GuiText', 'CheckForUpdates', 'Check For Updates') + $Text_SelectWhatToCopy = IniRead($DefaultLanguagePath, 'GuiText', 'SelectWhatToCopy', 'Select what you want to copy') + $Text_Default = IniRead($DefaultLanguagePath, 'GuiText', 'Default', 'Default') + $Text_PlayMidiSounds = IniRead($DefaultLanguagePath, 'GuiText', 'PlayMidiSounds', 'Play MIDI sounds for all active APs') + $Text_Interface = IniRead($DefaultLanguagePath, 'GuiText', 'Interface', 'Interface') + $Text_LanguageCode = IniRead($DefaultLanguagePath, 'GuiText', 'LanguageCode', 'Language Code') + $Text_AutoCheckUpdates = IniRead($DefaultLanguagePath, 'GuiText', 'AutoCheckUpdates', 'Automatically Check For Updates') + $Text_CheckBetaUpdates = IniRead($DefaultLanguagePath, 'GuiText', 'CheckBetaUpdates', 'Check For Beta Updates') + $Text_GuessSearchwords = IniRead($DefaultLanguagePath, 'GuiText', 'GuessSearchwords', 'Guess Netsh Searchwords') + $Text_Help = IniRead($DefaultLanguagePath, 'GuiText', 'Help', 'Help') + $Text_ErrorScanningNetsh = IniRead($DefaultLanguagePath, 'GuiText', 'ErrorScanningNetsh', 'Error scanning netsh') + $Text_GpsErrorBufferEmpty = IniRead($DefaultLanguagePath, 'GuiText', 'GpsErrorBufferEmpty', 'GPS Error. Buffer Empty for more than 10 seconds. GPS was probrably disconnected. GPS has been stopped') + $Text_GpsErrorStopped = IniRead($DefaultLanguagePath, 'GuiText', 'GpsErrorStopped', 'GPS Error. GPS has been stopped') + $Text_ShowSignalDB = IniRead($DefaultLanguagePath, 'GuiText', 'ShowSignalDB', 'Show Signal dB (Estimated)') + $Text_SortingList = IniRead($DefaultLanguagePath, 'GuiText', 'SortingList', 'Sorting List') + $Text_Loading = IniRead($DefaultLanguagePath, 'GuiText', 'Loading', 'Loading') + $Text_MapOpenNetworks = IniRead($DefaultLanguagePath, 'GuiText', 'MapOpenNetworks', 'Map Open Networks') + $Text_MapWepNetworks = IniRead($DefaultLanguagePath, 'GuiText', 'MapWepNetworks', 'Map WEP Networks') + $Text_MapSecureNetworks = IniRead($DefaultLanguagePath, 'GuiText', 'MapSecureNetworks', 'Map Secure Networks') + $Text_DrawTrack = IniRead($DefaultLanguagePath, 'GuiText', 'DrawTrack', 'Draw Track') + $Text_UseLocalImages = IniRead($DefaultLanguagePath, 'GuiText', 'UseLocalImages', 'Use Local Images') + $Text_MIDI = IniRead($DefaultLanguagePath, 'GuiText', 'MIDI', 'MIDI') + $Text_MidiInstrumentNumber = IniRead($DefaultLanguagePath, 'GuiText', 'MidiInstrumentNumber', 'MIDI Instrument #') + $Text_MidiPlayTime = IniRead($DefaultLanguagePath, 'GuiText', 'MidiPlayTime', 'MIDI Play Time') + $Text_SpeakRefreshTime = IniRead($DefaultLanguagePath, 'GuiText', 'SpeakRefreshTime', 'Speak Refresh Time') + $Text_Information = IniRead($DefaultLanguagePath, 'GuiText', 'Information', 'Information') + $Text_AddedGuessedSearchwords = IniRead($DefaultLanguagePath, 'GuiText', 'AddedGuessedSearchwords', 'Added guessed netsh searchwords. Searchwords for Open, None, WEP, Infrustructure, and Adhoc will still need to be done manually') + $Text_SortingTreeview = IniRead($DefaultLanguagePath, 'GuiText', 'SortingTreeview', 'Sorting Treeview') + $Text_Recovering = IniRead($DefaultLanguagePath, 'GuiText', 'Recovering', 'Recovering') + $Text_ErrorOpeningGpsPort = IniRead($DefaultLanguagePath, 'GuiText', 'ErrorOpeningGpsPort', 'Error opening GPS port') + $Text_SecondsSinceGpsUpdate = IniRead($DefaultLanguagePath, 'GuiText', 'SecondsSinceGpsUpdate', 'Seconds Since GPS Update') + $Text_SavingGID = IniRead($DefaultLanguagePath, 'GuiText', 'SavingGID', 'Saving GID') + $Text_SavingHistID = IniRead($DefaultLanguagePath, 'GuiText', 'SavingHistID', 'Saving HistID') + $Text_NoUpdates = IniRead($DefaultLanguagePath, 'GuiText', 'NoUpdates', 'No Updates Avalible') + $Text_NoActiveApFound = IniRead($DefaultLanguagePath, 'GuiText', 'NoActiveApFound', 'No Active AP found') + $Text_VistumblerDonate = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerDonate', 'Donate') + $Text_VistumblerStore = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerStore', 'Store') + $Text_SupportVistumbler = IniRead($DefaultLanguagePath, 'GuiText', 'SupportVistumbler', '*Support Vistumbler*') + $Text_UseNativeWifiMsg = IniRead($DefaultLanguagePath, 'GuiText', 'UseNativeWifiMsg', 'Use Native Wifi') + $Text_UseNativeWifiXpExtMsg = IniRead($DefaultLanguagePath, 'GuiText', 'UseNativeWifiXpExtMsg', '(No BSSID, CHAN, OTX, BTX)') + $Text_FilterMsg = IniRead($DefaultLanguagePath, 'GuiText', 'FilterMsg', 'Use asterik(*)" as a wildcard. Seperate multiple filters with a comma(,). Use a dash(-) for ranges.') + $Text_SetFilters = IniRead($DefaultLanguagePath, 'GuiText', 'SetFilters', 'Set Filters') + $Text_Filtered = IniRead($DefaultLanguagePath, 'GuiText', 'Filtered', 'Filtered') + $Text_Filters = IniRead($DefaultLanguagePath, 'GuiText', 'Filters', 'Filters') + $Text_FilterName = IniRead($DefaultLanguagePath, 'GuiText', 'FilterName', 'Filter Name') + $Text_FilterDesc = IniRead($DefaultLanguagePath, 'GuiText', 'FilterDesc', 'Filter Description') + $Text_FilterAddEdit = IniRead($DefaultLanguagePath, 'GuiText', 'FilterAddEdit', 'Add/Edit Filter') + $Text_NoAdaptersFound = IniRead($DefaultLanguagePath, 'GuiText', 'NoAdaptersFound', 'No Adapters Found') + $Text_RecoveringMDB = IniRead($DefaultLanguagePath, 'GuiText', 'RecoveringMDB', 'Recovering MDB') + $Text_FixingGpsTableDates = IniRead($DefaultLanguagePath, 'GuiText', 'FixingGpsTableDates', 'Fixing GPS table date(s)') + $Text_FixingGpsTableTimes = IniRead($DefaultLanguagePath, 'GuiText', 'FixingGpsTableTimes', 'Fixing GPS table time(s)') + $Text_FixingHistTableDates = IniRead($DefaultLanguagePath, 'GuiText', 'FixingHistTableDates', 'Fixing HIST table date(s)') + $Text_VistumblerNeedsToRestart = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerNeedsToRestart', 'Vistumbler needs to be restarted. Vistumbler will now close') + $Text_AddingApsIntoList = IniRead($DefaultLanguagePath, 'GuiText', 'AddingApsIntoList', 'Adding new APs into list') + $Text_GoogleEarthDoesNotExist = IniRead($DefaultLanguagePath, 'GuiText', 'GoogleEarthDoesNotExist', 'Google earth file does not exist or is set wrong in the AutoKML settings') + $Text_AutoKmlIsNotStarted = IniRead($DefaultLanguagePath, 'GuiText', 'AutoKmlIsNotStarted', 'AutoKML is not yet started. Would you like to turn it on now?') + $Text_UseKernel32 = IniRead($DefaultLanguagePath, 'GuiText', 'UseKernel32', 'Use Kernel32 - x32 - x64') + $Text_UnableToGuessSearchwords = IniRead($DefaultLanguagePath, 'GuiText', 'UnableToGuessSearchwords', 'Vistumbler was unable to guess searchwords') + $Text_SelectedAP = IniRead($DefaultLanguagePath, 'GuiText', 'SelectedAP', 'Selected AP') + $Text_AllAPs = IniRead($DefaultLanguagePath, 'GuiText', 'AllAPs', 'All APs') + $Text_FilteredAPs = IniRead($DefaultLanguagePath, 'GuiText', 'FilteredAPs', 'Filtered APs') + $Text_ImportFolder = IniRead($DefaultLanguagePath, 'GuiText', 'ImportFolder', 'Import Folder') + $Text_DeleteSelected = IniRead($DefaultLanguagePath, 'GuiText', 'DeleteSelected', 'Delete Selected') + $Text_RecoverSelected = IniRead($DefaultLanguagePath, 'GuiText', 'RecoverSelected', 'Recover Selected') + $Text_NewSession = IniRead($DefaultLanguagePath, 'GuiText', 'NewSession', 'New Session') + $Text_Size = IniRead($DefaultLanguagePath, 'GuiText', 'Size', 'Size') + $Text_NoMdbSelected = IniRead($DefaultLanguagePath, 'GuiText', 'NoMdbSelected', 'No MDB Selected') + $Text_LocateInWiFiDB = IniRead($DefaultLanguagePath, 'GuiText', 'LocateInWiFiDB', 'Locate Position in WiFiDB') + $Text_AutoWiFiDbGpsLocate = IniRead($DefaultLanguagePath, 'GuiText', 'AutoWiFiDbGpsLocate', 'Auto WiFiDB Gps Locate') + $Text_AutoWiFiDbUploadAps = IniRead($DefaultLanguagePath, 'GuiText', 'AutoWiFiDbUploadAps', 'Auto WiFiDB Upload Active AP') + $Text_AutoSelectConnectedAP = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSelectConnectedAP', 'Auto Select Connected AP') + $Text_AutoSelectHighSignal = IniRead($DefaultLanguagePath, "GuiText", 'AutoSelectHighSigAP', 'Auto Select Highest Signal AP') + $Text_Experimental = IniRead($DefaultLanguagePath, 'GuiText', 'Experimental', 'Experimental') + $Text_Color = IniRead($DefaultLanguagePath, 'GuiText', 'Color', 'Color') + $Text_AddRemFilters = IniRead($DefaultLanguagePath, "GuiText", "AddRemFilters", "Add/Remove Filters") + $Text_NoFilterSelected = IniRead($DefaultLanguagePath, "GuiText", "NoFilterSelected", "No filter selected.") + $Text_AddFilter = IniRead($DefaultLanguagePath, "GuiText", "AddFilter", "Add Filter") + $Text_EditFilter = IniRead($DefaultLanguagePath, "GuiText", "EditFilter ", "Edit Filter ") + $Text_DeleteFilter = IniRead($DefaultLanguagePath, "GuiText", "DeleteFilter", "Delete Filter") + $Text_TimeBeforeMarkedDead = IniRead($DefaultLanguagePath, "GuiText", "TimeBeforeMarkedDead", "Time to wait before marking AP dead (s)") + $Text_FilterNameRequired = IniRead($DefaultLanguagePath, "GuiText", "FilterNameRequired", "Filter Name is required") + $Text_UpdateManufacturers = IniRead($DefaultLanguagePath, "GuiText", "UpdateManufacturers", "Update Manufacturers") + $Text_FixHistSignals = IniRead($DefaultLanguagePath, "GuiText", "FixHistSignals", "Fixing Missing Hist Table Signal(s)") + $Text_VistumblerFile = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerFile', 'Vistumbler file') + $Text_DetailedCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'DetailedFile', 'Detailed Comma Delimited file') + $Text_SummaryCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'SummaryFile', 'Summary Comma Delimited file') + $Text_NetstumblerTxtFile = IniRead($DefaultLanguagePath, 'GuiText', 'NetstumblerTxtFile', 'Netstumbler wi-scan file') + $Text_WardriveDb3File = IniRead($DefaultLanguagePath, 'GuiText', 'WardriveDb3File', 'Wardrive-android file') + $Text_AutoScanApsOnLaunch = IniRead($DefaultLanguagePath, "GuiText", "AutoScanApsOnLaunch", "Auto Scan APs on launch") + $Text_RefreshInterfaces = IniRead($DefaultLanguagePath, "GuiText", "RefreshInterfaces", "Refresh Interfaces") + $Text_Sound = IniRead($DefaultLanguagePath, 'GuiText', 'Sound', 'Sound') + $Text_OncePerLoop = IniRead($DefaultLanguagePath, 'GuiText', 'OncePerLoop', 'Once per loop') + $Text_OncePerAP = IniRead($DefaultLanguagePath, 'GuiText', 'OncePerAP', 'Once per ap') + $Text_OncePerAPwSound = IniRead($DefaultLanguagePath, 'GuiText', 'OncePerAPwSound', 'Once per ap with volume based on signal') + $Text_WifiDB = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDB', 'WifiDB') + $Text_Warning = IniRead($DefaultLanguagePath, 'GuiText', 'Warning', 'Warning') + $Text_WifiDBLocateWarning = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDBLocateWarning', 'This feature sends active access point information to the WifiDB API URL specified in the Vistumbler WifiDB Settings. If you do not want to send data to the wifidb, do not enable this feature. Do you want to continue to enable this feature?') + $Text_WifiDBAutoUploadWarning = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDBAutoUploadWarning', 'This feature sends active access point information to the WifiDB URL specified in the Vistumbler WifiDB Settings. If you do not want to send data to the wifidb, do not enable this feature. Do you want to continue to enable this feature?') + $Text_WifiDBOpenLiveAPWebpage = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDBOpenLiveAPWebpage', 'Open WifiDB Live AP Webpage') + $Text_WifiDBOpenMainWebpage = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDBOpenMainWebpage', 'Open WifiDB Main Webpage') + $Text_FilePath = IniRead($DefaultLanguagePath, 'GuiText', 'FilePath', 'File Path') + $Text_CameraName = IniRead($DefaultLanguagePath, 'GuiText', 'CameraName', 'Camera Name') + $Text_CameraURL = IniRead($DefaultLanguagePath, 'GuiText', 'CameraURL', 'Camera URL') + $Text_Cameras = IniRead($DefaultLanguagePath, 'GuiText', 'Cameras', 'Cameras') + $Text_AddCamera = IniRead($DefaultLanguagePath, 'GuiText', 'AddCamera', 'Add Camera') + $Text_RemoveCamera = IniRead($DefaultLanguagePath, 'GuiText', 'RemoveCamera', 'Remove Camera') + $Text_EditCamera = IniRead($DefaultLanguagePath, 'GuiText', 'EditCamera', 'Edit Camera') + $Text_DownloadImages = IniRead($DefaultLanguagePath, 'GuiText', 'DownloadImages', 'Download Images') + $Text_EnableCamTriggerScript = IniRead($DefaultLanguagePath, 'GuiText', 'EnableCamTriggerScript', 'Enable camera trigger script') + $Text_PortableMode = IniRead($DefaultLanguagePath, 'GuiText', 'PortableMode', 'Portable Mode') + $Text_CameraTriggerScript = IniRead($DefaultLanguagePath, 'GuiText', 'CameraTriggerScript', 'Camera Trigger Script') + $Text_CameraTriggerScriptTypes = IniRead($DefaultLanguagePath, 'GuiText', 'CameraTriggerScriptTypes', 'Camera Trigger Script (exe,bat)') + $Text_SetCameras = IniRead($DefaultLanguagePath, 'GuiText', 'SetCameras', 'Set Cameras') + $Text_UpdateUpdaterMsg = IniRead($DefaultLanguagePath, 'GuiText', 'UpdateUpdaterMsg', 'There is an update to the vistumbler updater. Would you like to download and update it now?') + $Text_UseRssiInGraphs = IniRead($DefaultLanguagePath, 'GuiText', 'UseRssiInGraphs', 'Use RSSI in graphs') + $Text_2400ChannelGraph = IniRead($DefaultLanguagePath, 'GuiText', '2400ChannelGraph', '2.4Ghz Channel Graph') + $Text_5000ChannelGraph = IniRead($DefaultLanguagePath, 'GuiText', '5000ChannelGraph', '5Ghz Channel Graph') + $Text_UpdateGeolocations = IniRead($DefaultLanguagePath, 'GuiText', 'UpdateGeolocations', 'Update Geolocations') + $Text_ShowGpsPositionMap = IniRead($DefaultLanguagePath, 'GuiText', 'ShowGpsPositionMap', 'Show GPS Position Map') + $Text_ShowGpsSignalMap = IniRead($DefaultLanguagePath, 'GuiText', 'ShowGpsSignalMap', 'Show GPS Signal Map') + $Text_UseRssiSignalValue = IniRead($DefaultLanguagePath, 'GuiText', 'UseRssiSignalValue', 'Use RSSI signal values') + $Text_UseCircleToShowSigStength = IniRead($DefaultLanguagePath, 'GuiText', 'UseCircleToShowSigStength', 'Use circle to show signal strength') + $Text_ShowGpsRangeMap = IniRead($DefaultLanguagePath, 'GuiText', 'ShowGpsRangeMap', 'Show GPS Range Map') + $Text_ShowGpsTack = IniRead($DefaultLanguagePath, 'GuiText', 'ShowGpsTack', 'Show GPS Track') + $Text_Line = IniRead($DefaultLanguagePath, 'GuiText', 'Line', 'Line') + $Text_Total = IniRead($DefaultLanguagePath, 'GuiText', 'Total', 'Total') + $Text_WifiDB_Upload_Discliamer = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDB_Upload_Discliamer', 'This feature uploads access points to the WifiDB. a file will be generated and uploaded to the WifiDB API URL specified in the Vistumbler WifiDB Settings.') + $Text_UserInformation = IniRead($DefaultLanguagePath, 'GuiText', 'UserInformation', 'User Information') + $Text_WifiDB_Username = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDB_Username', 'WifiDB Username') + $Text_WifiDB_Api_Key = IniRead($DefaultLanguagePath, 'GuiText', 'WifiDB_Api_Key', 'WifiDB Api Key') + $Text_OtherUsers = IniRead($DefaultLanguagePath, 'GuiText', 'OtherUsers', 'Other users') + $Text_FileType = IniRead($DefaultLanguagePath, 'GuiText', 'FileType', 'File Type') + $Text_VistumblerVSZ = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerVSZ', 'Vistumbler VSZ') + $Text_VistumblerVS1 = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerVS1', 'Vistumbler VS1') + $Text_VistumblerCSV = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerCSV', 'Vistumbler Detailed CSV') + $Text_UploadInformation = IniRead($DefaultLanguagePath, 'GuiText', 'UploadInformation', 'Upload Information') + $Text_Title = IniRead($DefaultLanguagePath, 'GuiText', 'Title', 'Title') + $Text_Notes = IniRead($DefaultLanguagePath, 'GuiText', 'Notes', 'Notes') + $Text_UploadApsToWifidb = IniRead($DefaultLanguagePath, 'GuiText', 'UploadApsToWifidb', 'Upload APs to WifiDB') + $Text_UploadingApsToWifidb = IniRead($DefaultLanguagePath, 'GuiText', 'UploadingApsToWifidb', 'Uploading APs to WifiDB') + $Text_GeoNamesInfo = IniRead($DefaultLanguagePath, 'GuiText', 'GeoNamesInfo', 'Geonames Info') + $Text_FindApInWifidb = IniRead($DefaultLanguagePath, 'GuiText', 'FindApInWifidb', 'Find AP in WifiDB') + $Text_GpsDisconnect = IniRead($DefaultLanguagePath, 'GuiText', 'GpsDisconnect', 'Disconnect GPS when no data is received in over 10 seconds') + $Text_GpsReset = IniRead($DefaultLanguagePath, 'GuiText', 'GpsReset', 'Reset GPS position when no GPGGA data is received in over 30 seconds') + $Text_APs = IniRead($DefaultLanguagePath, 'GuiText', 'APs', 'APs') + $Text_MaxSignal = IniRead($DefaultLanguagePath, 'GuiText', 'MaxSignal', 'Max Signal') + $Text_DisassociationSignal = IniRead($DefaultLanguagePath, 'GuiText', 'DisassociationSignal', 'Disassociation Signal') + $Text_SaveDirectories = IniRead($DefaultLanguagePath, 'GuiText', 'SaveDirectories', 'Save Directories') + $Text_AutoSaveAndClearAfterNumberofAPs = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveAndClearAfterNumberofAPs', 'Auto Save And Clear After Number of APs') + $Text_AutoSaveandClearAfterTime = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveandClearAfterTime', 'Auto Save and Clear After Time') + $Text_PlaySoundWhenSaving = IniRead($DefaultLanguagePath, 'GuiText', 'PlaySoundWhenSaving', 'Play Sound When Saving') + $Text_MinimalGuiMode = IniRead($DefaultLanguagePath, 'GuiText', 'MinimalGuiMode', 'Minimal GUI Mode') + $Text_AutoScrollToBottom = IniRead($DefaultLanguagePath, 'GuiText', 'AutoScrollToBottom', 'Auto Scroll to Bottom of List') + $Text_ListviewBatchInsertMode = IniRead($DefaultLanguagePath, 'GuiText', 'ListviewBatchInsertMode', 'Listview Batch Insert Mode') + $Text_ExportVistumblerSettings = IniRead($DefaultLanguagePath, 'GuiText', 'ExportVistumblerSettings', 'Export Vistumbler Settings') + $Text_ImportVistumblerSettings = IniRead($DefaultLanguagePath, 'GuiText', 'ImportVistumblerSettings', 'Import Vistumbler Settings') + $Text_ErrorSavingFile = IniRead($DefaultLanguagePath, 'GuiText', 'ErrorSavingFile', 'Error Saving File') + $Text_ErrorImportingFile = IniRead($DefaultLanguagePath, 'GuiText', 'ErrorImportingFile', 'Error Importing File') + $Text_SettingsImportedSuccess = IniRead($DefaultLanguagePath, 'GuiText', 'SettingsImportedSuccess', 'Settings Imported Successfully. Please restart Vistumbler to apply the new settings.') + $Text_ButtonActiveColor = IniRead($DefaultLanguagePath, 'GuiText', 'ButtonActiveColor', 'Button Active Color') + $Text_ButtonInactiveColor = IniRead($DefaultLanguagePath, 'GuiText', 'ButtonInactiveColor', 'Button Inactive Color') + $Text_Text = IniRead($DefaultLanguagePath, 'GuiText', 'Text', 'Text') + $Text_GUITextSize = IniRead($DefaultLanguagePath, 'GuiText', 'GUITextSize', 'GUI Text Size (Restart Required)') + + $RestartVistumbler = 1 + EndIf + If $Apply_Manu = 1 Then + ;Remove all current Mac address/manus in the array + $query = "DELETE * FROM Manufacturers" + _ExecuteMDB($ManuDB, $ManuDB_OBJ, $query) + ;Rewrite Mac address/labels from listview into the array + $itemcount = _GUICtrlListView_GetItemCount($GUI_Manu_List) - 1 ; Get List Size + For $findloop = 0 To $itemcount + $o_manu_mac = StringUpper(StringReplace(_GUICtrlListView_GetItemText($GUI_Manu_List, $findloop, 0), '"', '')) + $o_manu = _GUICtrlListView_GetItemText($GUI_Manu_List, $findloop, 1) + _AddRecord($ManuDB, "Manufacturers", $ManuDB_OBJ, $o_manu_mac & '|' & $o_manu) + Next + ;Reset Labels In List + _UpdateListMacLabels() + EndIf + If $Apply_Lab = 1 Then + ;Remove all current Mac address/labels in the array + $query = "DELETE * FROM Labels" + _ExecuteMDB($LabDB, $LabDB_OBJ, $query) + ;Rewrite Mac address/labels from listview into the array + $itemcount = _GUICtrlListView_GetItemCount($GUI_Lab_List) - 1 ; Get List Size + For $findloop = 0 To $itemcount + $o_lab_mac = StringUpper(StringReplace(_GUICtrlListView_GetItemText($GUI_Lab_List, $findloop, 0), '"', '')) + $o_lab = _GUICtrlListView_GetItemText($GUI_Lab_List, $findloop, 1) + _AddRecord($LabDB, "Labels", $LabDB_OBJ, $o_lab_mac & '|' & $o_lab) + Next + ;Reset Labels In List + _UpdateListMacLabels() + EndIf + If $Apply_Column = 1 Then + $column_Width_Line = GUICtrlRead($CWIB_Line) + $column_Width_Active = GUICtrlRead($CWIB_Active) + $column_Width_SSID = GUICtrlRead($CWIB_SSID) + $column_Width_BSSID = GUICtrlRead($CWIB_BSSID) + $column_Width_MANUF = GUICtrlRead($CWIB_Manu) + $column_Width_Signal = GUICtrlRead($CWIB_Signal) + $column_Width_HighSignal = GUICtrlRead($CWIB_HighSignal) + $column_Width_RSSI = GUICtrlRead($CWIB_RSSI) + $column_Width_HighRSSI = GUICtrlRead($CWIB_HighRSSI) + $column_Width_Authentication = GUICtrlRead($CWIB_Authentication) + $column_Width_Encryption = GUICtrlRead($CWIB_Encryption) + $column_Width_RadioType = GUICtrlRead($CWIB_RadioType) + $column_Width_Channel = GUICtrlRead($CWIB_Channel) + $column_Width_Latitude = GUICtrlRead($CWIB_Latitude) + $column_Width_Longitude = GUICtrlRead($CWIB_Longitude) + $column_Width_LatitudeDMS = GUICtrlRead($CWIB_LatitudeDMS) + $column_Width_LongitudeDMS = GUICtrlRead($CWIB_LongitudeDMS) + $column_Width_LatitudeDMM = GUICtrlRead($CWIB_LatitudeDMM) + $column_Width_LongitudeDMM = GUICtrlRead($CWIB_LongitudeDMM) + $column_Width_BasicTransferRates = GUICtrlRead($CWIB_BtX) + $column_Width_OtherTransferRates = GUICtrlRead($CWIB_OtX) + $column_Width_FirstActive = GUICtrlRead($CWIB_FirstActive) + $column_Width_LastActive = GUICtrlRead($CWIB_LastActive) + $column_Width_NetworkType = GUICtrlRead($CWIB_NetType) + $column_Width_Label = GUICtrlRead($CWIB_Label) + _SetListviewWidths() + EndIf + If $Apply_Searchword = 1 Then + $SearchWord_SSID = GUICtrlRead($SearchWord_SSID_GUI) + $SearchWord_BSSID = GUICtrlRead($SearchWord_BSSID_GUI) + $SearchWord_NetworkType = GUICtrlRead($SearchWord_NetType_GUI) + $SearchWord_Authentication = GUICtrlRead($SearchWord_Authentication_GUI) + $SearchWord_Signal = GUICtrlRead($SearchWord_Signal_GUI) + ;$SearchWord_RSSI = GUICtrlRead($SearchWord_RSSI_GUI) + $SearchWord_RadioType = GUICtrlRead($SearchWord_RadioType_GUI) + $SearchWord_Channel = GUICtrlRead($SearchWord_Channel_GUI) + $SearchWord_BasicRates = GUICtrlRead($SearchWord_BasicRates_GUI) + $SearchWord_OtherRates = GUICtrlRead($SearchWord_OtherRates_GUI) + $SearchWord_Encryption = GUICtrlRead($SearchWord_Encryption_GUI) + $SearchWord_Open = GUICtrlRead($SearchWord_Open_GUI) + $SearchWord_None = GUICtrlRead($SearchWord_None_GUI) + $SearchWord_Wep = GUICtrlRead($SearchWord_Wep_GUI) + $SearchWord_Infrastructure = GUICtrlRead($SearchWord_Infrastructure_GUI) + $SearchWord_Adhoc = GUICtrlRead($SearchWord_Adhoc_GUI) + EndIf + If $Apply_Auto = 1 Then + ;Auto KML + If GUICtrlRead($AutoSaveKML) = 4 And $AutoKML = 1 Then _AutoKmlToggle() + If GUICtrlRead($AutoSaveKML) = 1 And $AutoKML = 0 Then _AutoKmlToggle() + + $GoogleEarthExe = GUICtrlRead($GUI_GoogleEXE) + $AutoKmlActiveTime = GUICtrlRead($GUI_AutoKmlActiveTime) + $AutoKmlDeadTime = GUICtrlRead($GUI_AutoKmlDeadTime) + $AutoKmlGpsTime = GUICtrlRead($GUI_AutoKmlGpsTime) + $AutoKmlTrackTime = GUICtrlRead($GUI_AutoKmlTrackTime) + + If GUICtrlRead($GUI_KmlFlyTo) = 1 Then + $KmlFlyTo = 1 + Else + $KmlFlyTo = 0 + EndIf + $AutoKML_Alt = GUICtrlRead($GUI_AutoKml_Alt) + $AutoKML_AltMode = GUICtrlRead($GUI_AutoKml_AltMode) + $AutoKML_Heading = GUICtrlRead($GUI_AutoKml_Heading) + $AutoKML_Range = GUICtrlRead($GUI_AutoKml_Range) + $AutoKML_Tilt = GUICtrlRead($GUI_AutoKml_Tilt) + + If GUICtrlRead($GUI_OpenKmlNetLink) = 1 Then + $OpenKmlNetLink = 1 + If $AutoKML = 1 Then _StartGoogleAutoKmlRefresh() + Else + $OpenKmlNetLink = 0 + EndIf + + ;AutoSort + If GUICtrlRead($GUI_SortDirection) = $Text_Ascending Then + $SortDirection = 0 + Else + $SortDirection = 1 + EndIf + + $SortBy = GUICtrlRead($GUI_SortBy) + $SortTime = GUICtrlRead($GUI_SortTime) + If GUICtrlRead($GUI_AutoSort) = 4 And $AutoSort = 1 Then _AutoSortToggle() + If GUICtrlRead($GUI_AutoSort) = 1 And $AutoSort = 0 Then _AutoSortToggle() + EndIf + If $Apply_Sound = 1 Then + ;New AP Sound Settings + If GUICtrlRead($GUI_NewApSound) = 4 And $SoundOnAP = 1 Then _SoundToggle() ;Turn off new ap sound + If GUICtrlRead($GUI_NewApSound) = 1 And $SoundOnAP = 0 Then _SoundToggle() ;Turn on new ap sound + If GUICtrlRead($GUI_ASperloop) = 1 Then + $SoundPerAP = 0 + ElseIf GUICtrlRead($GUI_ASperap) = 1 Then + $SoundPerAP = 1 + $NewSoundSigBased = 0 + ElseIf GUICtrlRead($GUI_ASperapwsound) = 1 Then + $SoundPerAP = 1 + $NewSoundSigBased = 1 + EndIf + ;Save Speak Settings + If GUICtrlRead($GUI_SpeakSignal) = 4 And $SpeakSignal = 1 Then _SpeakSigToggle() ;Turn off speak signal + If GUICtrlRead($GUI_SpeakSignal) = 1 And $SpeakSignal = 0 Then _SpeakSigToggle() ;Turn on speak signal + If GUICtrlRead($GUI_SpeakSoundsVis) = 1 Then + $SpeakType = 1 ;Set Vistumbler Sounds as default speak signal interface + ElseIf GUICtrlRead($GUI_SpeakSoundsSapi) = 1 Then + $SpeakType = 2 ;Set SAPI as default speak signal interface + ElseIf GUICtrlRead($GUI_SpeakSoundsMidi) = 1 Then + $SpeakType = 3 ;Set MIDI as default speak signal interface + EndIf + If GUICtrlRead($GUI_SpeakPercent) = 1 Then + $SpeakSigSayPecent = 1 ;Say Percent + Else + $SpeakSigSayPecent = 0 ;Don't say percent + EndIf + $SpeakSigTime = GUICtrlRead($GUI_SpeakSigTime) + If GUICtrlRead($GUI_PlayMidiSounds) = 4 And $Midi_PlayForActiveAps = 1 Then _ActiveApMidiToggle() ;Turn off MIDI signal + If GUICtrlRead($GUI_PlayMidiSounds) = 1 And $Midi_PlayForActiveAps = 0 Then _ActiveApMidiToggle() ;Turn on MIDI signal + $MidiInstSplit = StringSplit(GUICtrlRead($GUI_Midi_Instument), ' - ', 1) + $Midi_Instument = $MidiInstSplit[1] + $Midi_PlayTime = GUICtrlRead($GUI_Midi_PlayTime) + EndIf + If $Apply_WifiDB = 1 Then + $WifiDb_User = GUICtrlRead($GUI_WifiDB_User) + $WifiDb_ApiKey = GUICtrlRead($GUI_WifiDB_ApiKey) + $WifiDbGraphURL = GUICtrlRead($GUI_WifiDbGraphURL) + $WifiDbWdbURL = GUICtrlRead($GUI_WifiDbWdbURL) + $WifiDbApiURL = GUICtrlRead($GUI_WifiDbApiURL) + ;Auto WiFiDB Locate + If GUICtrlRead($GUI_WifidbLocate) = 4 And $UseWiFiDbGpsLocate = 1 Then _WifiDbLocateToggle() + If GUICtrlRead($GUI_WifidbLocate) = 1 And $UseWiFiDbGpsLocate = 0 Then _WifiDbLocateToggle() + $WiFiDbLocateRefreshTime = (GUICtrlRead($GUI_WiFiDbLocateRefreshTime) * 1000) + ;Auto WiFiDB Update + If GUICtrlRead($GUI_WifidbUploadAps) = 4 And $AutoUpApsToWifiDB = 1 Then _WifiDbAutoUploadToggle() + If GUICtrlRead($GUI_WifidbUploadAps) = 1 And $AutoUpApsToWifiDB = 0 Then _WifiDbAutoUploadToggle() + $AutoUpApsToWifiDBTime = GUICtrlRead($GUI_AutoUpApsToWifiDBTime) + EndIf + If $Apply_Cam = 1 Then + ;Remove all current cameras in the array + $query = "DELETE * FROM Cameras" + _ExecuteMDB($CamDB, $CamDB_OBJ, $query) + ;Rewrite cameras from listview into the array + $itemcount = _GUICtrlListView_GetItemCount($GUI_Cam_List) - 1 ; Get List Size + For $findloop = 0 To $itemcount + $o_camname = StringReplace(_GUICtrlListView_GetItemText($GUI_Cam_List, $findloop, 0), '"', '') + $o_camurl = _GUICtrlListView_GetItemText($GUI_Cam_List, $findloop, 1) + _AddRecord($CamDB, "Cameras", $CamDB_OBJ, $o_camname & '|' & $o_camurl) + Next + ;Set Cam Script + If GUICtrlRead($Gui_CamTrigger) = 4 And $CamTrigger = 1 Then _CamTriggerToggle() + If GUICtrlRead($Gui_CamTrigger) = 1 And $CamTrigger = 0 Then _CamTriggerToggle() + $CamTriggerScript = GUICtrlRead($GUI_CamTriggerScript) + $CamTriggerTime = GUICtrlRead($GUI_CamTriggerTime) + EndIf + Dim $Apply_Misc = 1, $Apply_Save = 1, $Apply_GPS = 1, $Apply_Language = 0, $Apply_Manu = 0, $Apply_Lab = 0, $Apply_Column = 1, $Apply_Searchword = 1, $Apply_Auto = 1, $Apply_Sound = 1, $Apply_WifiDB = 1, $Apply_Cam = 0 + If $RestartVistumbler = 1 Then MsgBox(0, $Text_Restart, $Text_RestartMsg) +EndFunc ;==>_ApplySettingsGUI + +Func _SetWidthValue_RadioType() + _SetWidthValue($CWCB_RadioType, $CWIB_RadioType, $column_Width_RadioType, $settings, 'Column_Width', 'Column_RadioType', 100) +EndFunc ;==>_SetWidthValue_RadioType +Func _SetWidthValue_Channel() + _SetWidthValue($CWCB_Channel, $CWIB_Channel, $column_Width_Channel, $settings, 'Column_Width', 'Column_Channel', 55) +EndFunc ;==>_SetWidthValue_Channel +Func _SetWidthValue_Latitude() + _SetWidthValue($CWCB_Latitude, $CWIB_Latitude, $column_Width_Latitude, $settings, 'Column_Width', 'Column_Latitude', 100) +EndFunc ;==>_SetWidthValue_Latitude +Func _SetWidthValue_Longitude() + _SetWidthValue($CWCB_Longitude, $CWIB_Longitude, $column_Width_Longitude, $settings, 'Column_Width', 'Column_Longitude', 100) +EndFunc ;==>_SetWidthValue_Longitude +Func _SetWidthValue_LatitudeDMS() + _SetWidthValue($CWCB_LatitudeDMS, $CWIB_LatitudeDMS, $column_Width_LatitudeDMS, $settings, 'Column_Width', 'Column_LatitudeDMS', 100) +EndFunc ;==>_SetWidthValue_LatitudeDMS +Func _SetWidthValue_LongitudeDMS() + _SetWidthValue($CWCB_LongitudeDMS, $CWIB_LongitudeDMS, $column_Width_LongitudeDMS, $settings, 'Column_Width', 'Column_LongitudeDMS', 100) +EndFunc ;==>_SetWidthValue_LongitudeDMS +Func _SetWidthValue_LatitudeDMM() + _SetWidthValue($CWCB_LatitudeDMM, $CWIB_LatitudeDMM, $column_Width_LatitudeDMM, $settings, 'Column_Width', 'Column_LatitudeDMM', 100) +EndFunc ;==>_SetWidthValue_LatitudeDMM +Func _SetWidthValue_LongitudeDMM() + _SetWidthValue($CWCB_LongitudeDMM, $CWIB_LongitudeDMM, $column_Width_LongitudeDMM, $settings, 'Column_Width', 'Column_LongitudeDMM', 100) +EndFunc ;==>_SetWidthValue_LongitudeDMM +Func _SetWidthValue_BtX() + _SetWidthValue($CWCB_BtX, $CWIB_BtX, $column_Width_BasicTransferRates, $settings, 'Column_Width', 'Column_BasicTransferRates', 140) +EndFunc ;==>_SetWidthValue_BtX +Func _SetWidthValue_OtX() + _SetWidthValue($CWCB_OtX, $CWIB_OtX, $column_Width_OtherTransferRates, $settings, 'Column_Width', 'Column_OtherTransferRates', 140) +EndFunc ;==>_SetWidthValue_OtX +Func _SetWidthValue_FirstActive() + _SetWidthValue($CWCB_FirstActive, $CWIB_FirstActive, $column_Width_FirstActive, $settings, 'Column_Width', 'Column_FirstActive', 165) +EndFunc ;==>_SetWidthValue_FirstActive +Func _SetWidthValue_LastActive() + _SetWidthValue($CWCB_LastActive, $CWIB_LastActive, $column_Width_LastActive, $settings, 'Column_Width', 'Column_LastActive', 150) +EndFunc ;==>_SetWidthValue_LastActive +Func _SetWidthValue_Line() + _SetWidthValue($CWCB_Line, $CWIB_Line, $column_Width_Line, $settings, 'Column_Width', 'Column_Line', 60) +EndFunc ;==>_SetWidthValue_Line +Func _SetWidthValue_Active() + _SetWidthValue($CWCB_Active, $CWIB_Active, $column_Width_Active, $settings, 'Column_Width', 'Column_Active', 60) +EndFunc ;==>_SetWidthValue_Active +Func _SetWidthValue_SSID() + _SetWidthValue($CWCB_SSID, $CWIB_SSID, $column_Width_SSID, $settings, 'Column_Width', 'Column_SSID', 115) +EndFunc ;==>_SetWidthValue_SSID +Func _SetWidthValue_BSSID() + _SetWidthValue($CWCB_BSSID, $CWIB_BSSID, $column_Width_BSSID, $settings, 'Column_Width', 'Column_BSSID', 135) +EndFunc ;==>_SetWidthValue_BSSID +Func _SetWidthValue_Manu() + _SetWidthValue($CWCB_Manu, $CWIB_Manu, $column_Width_MANUF, $settings, 'Column_Width', 'Column_Manufacturer', 100) +EndFunc ;==>_SetWidthValue_Manu +Func _SetWidthValue_Signal() + _SetWidthValue($CWCB_Signal, $CWIB_Signal, $column_Width_Signal, $settings, 'Column_Width', 'Column_Signal', 75) +EndFunc ;==>_SetWidthValue_Signal +Func _SetWidthValue_HighSignal() + _SetWidthValue($CWCB_HighSignal, $CWIB_HighSignal, $column_Width_HighSignal, $settings, 'Column_Width', 'Column_HighSignal', 75) +EndFunc ;==>_SetWidthValue_HighSignal +Func _SetWidthValue_RSSI() + _SetWidthValue($CWCB_RSSI, $CWIB_RSSI, $column_Width_RSSI, $settings, 'Column_Width', 'Column_RSSI', 75) +EndFunc ;==>_SetWidthValue_RSSI +Func _SetWidthValue_HighRSSI() + _SetWidthValue($CWCB_HighRSSI, $CWIB_HighRSSI, $column_Width_HighRSSI, $settings, 'Column_Width', 'Column_HighRSSI', 75) +EndFunc ;==>_SetWidthValue_HighRSSI +Func _SetWidthValue_Authentication() + _SetWidthValue($CWCB_Authentication, $CWIB_Authentication, $column_Width_Authentication, $settings, 'Column_Width', 'Column_Authentication', 100) +EndFunc ;==>_SetWidthValue_Authentication +Func _SetWidthValue_Encryption() + _SetWidthValue($CWCB_Encryption, $CWIB_Encryption, $column_Width_Encryption, $settings, 'Column_Width', 'Column_Encryption', 100) +EndFunc ;==>_SetWidthValue_Encryption +Func _SetWidthValue_NetType() + _SetWidthValue($CWCB_NetType, $CWIB_NetType, $column_Width_NetworkType, $settings, 'Column_Width', 'Column_NetworkType', 100) +EndFunc ;==>_SetWidthValue_NetType +Func _SetWidthValue_Label() + _SetWidthValue($CWCB_Label, $CWIB_Label, $column_Width_Label, $settings, 'Column_Width', 'Column_Label', 100) +EndFunc ;==>_SetWidthValue_Label + +Func _AddManu() ;Adds new manucaturer to settings gui manufacturer list + $Apply_Manu = 1 + $StrippedMac = StringUpper(StringReplace(StringReplace(StringReplace(StringReplace(GUICtrlRead($GUI_Manu_NewMac), ':', ''), '-', ''), '"', ''), ' ', '')) + $AddMac = '"' & StringTrimRight($StrippedMac, StringLen($StrippedMac) - 6) & '"' + $AddLM = GUICtrlRead($GUI_Manu_NewManu) + $arraysearch = -1 + $itemcount = _GUICtrlListView_GetItemCount($GUI_Manu_List) - 1 ; Get List Size + For $findloop = 0 To $itemcount ; Find BSSID list; If found, set $arraysearch with position + If _GUICtrlListView_GetItemText($GUI_Manu_List, $findloop, 0) = $AddMac Then + $arraysearch = $findloop + ExitLoop + EndIf + Next + If $arraysearch = -1 Then + $arraysearch = _GUICtrlListView_InsertItem($GUI_Manu_List, 0, '') + _GUICtrlListView_SetItemText($GUI_Manu_List, $arraysearch, $AddMac, 0) + _GUICtrlListView_SetItemText($GUI_Manu_List, $arraysearch, $AddLM, 1) + Else + $overwrite_entry = MsgBox(4, $Text_Overwrite & '?', $Text_MacExistsOverwriteIt) + If $overwrite_entry = 6 Then + _GUICtrlListView_SetItemText($GUI_Manu_List, $arraysearch, $AddMac, 0) + _GUICtrlListView_SetItemText($GUI_Manu_List, $arraysearch, $AddLM, 1) + EndIf + EndIf +EndFunc ;==>_AddManu + +Func _EditManu() ;Opens edit manufacturer window + $EditLine = _GUICtrlListView_GetNextItem($GUI_Manu_List) + If $EditLine <> $LV_ERR Then + $EditMac = StringTrimRight(StringTrimLeft(_GUICtrlListView_GetItemText($GUI_Manu_List, $EditLine, 0), 1), 1) + $EditLab = _GUICtrlListView_GetItemText($GUI_Manu_List, $EditLine, 1) + $EditMacGUIForm = GUICreate($Text_EditMan, 625, 86, -1, -1) + GUISetBkColor($BackgroundColor) + GUICtrlCreateLabel($Column_Names_BSSID, 16, 16, 69, 17) + $EditMac_Mac = GUICtrlCreateInput($EditMac, 88, 16, 137, 21) + GUICtrlCreateLabel($Column_Names_MANUF, 230, 16, 70, 17) + $EditMac_GUI = GUICtrlCreateInput($EditLab, 305, 16, 300, 21) + $EditMac_OK = GUICtrlCreateButton($Text_Ok, 200, 48, 97, 25, 0) + $EditMac_Can = GUICtrlCreateButton($Text_Cancel, 312, 48, 97, 25, 0) + GUISetState(@SW_SHOW) + GUICtrlSetOnEvent($EditMac_OK, "_EditManu_Ok") + GUICtrlSetOnEvent($EditMac_Can, "_EditManu_Close") + EndIf +EndFunc ;==>_EditManu + +Func _RemoveManu() ;Removed manufactuer from list + $Apply_Manu = 1 + $EditLine = _GUICtrlListView_GetNextItem($GUI_Manu_List) + If $EditLine <> $LV_ERR Then _GUICtrlListView_DeleteItem($GUI_Manu_List, $EditLine) +EndFunc ;==>_RemoveManu + +Func _EditManu_Close() ;Close edit manufacturer window + GUIDelete($EditMacGUIForm) +EndFunc ;==>_EditManu_Close + +Func _EditManu_Ok() ;Apply edit manufacture window settings and close it + $Apply_Manu = 1 + $StrippedMac = StringUpper(StringReplace(StringReplace(StringReplace(StringReplace(GUICtrlRead($EditMac_Mac), ':', ''), '-', ''), '"', ''), ' ', '')) + _GUICtrlListView_SetItemText($GUI_Manu_List, $EditLine, '"' & StringTrimRight($StrippedMac, StringLen($StrippedMac) - 6) & '"', 0) + _GUICtrlListView_SetItemText($GUI_Manu_List, $EditLine, GUICtrlRead($EditMac_GUI), 1) + GUIDelete($EditMacGUIForm) +EndFunc ;==>_EditManu_Ok + +Func _AddLabel() ;Adds new label to settings gui label list + $Apply_Lab = 1 + $StrippedMac = StringUpper(StringReplace(StringReplace(StringReplace(StringReplace(GUICtrlRead($GUI_Lab_NewMac), ':', ''), '-', ''), '"', ''), ' ', '')) + $AddMac = '"' & StringTrimRight($StrippedMac, StringLen($StrippedMac) - 12) & '"' + $AddLM = GUICtrlRead($GUI_Lab_NewLabel) + $arraysearch = -1 + $itemcount = _GUICtrlListView_GetItemCount($GUI_Lab_List) - 1 ; Get List Size + For $findloop = 0 To $itemcount ; Find BSSID list; If found, set $arraysearch with position + If _GUICtrlListView_GetItemText($GUI_Lab_List, $findloop, 0) = $AddMac Then + $arraysearch = $findloop + ExitLoop + EndIf + Next + If $arraysearch = -1 Then + $arraysearch = _GUICtrlListView_InsertItem($GUI_Lab_List, 0, '') + _GUICtrlListView_SetItemText($GUI_Lab_List, $arraysearch, $AddMac, 0) + _GUICtrlListView_SetItemText($GUI_Lab_List, $arraysearch, $AddLM, 1) + Else + $overwrite_entry = MsgBox(4, $Text_Overwrite & '?', $Text_MacExistsOverwriteIt) + If $overwrite_entry = 6 Then + _GUICtrlListView_SetItemText($GUI_Lab_List, $arraysearch, $AddMac, 0) + _GUICtrlListView_SetItemText($GUI_Lab_List, $arraysearch, $AddLM, 1) + EndIf + EndIf +EndFunc ;==>_AddLabel + +Func _EditLabel() ;Opens edit label window + $EditLine = _GUICtrlListView_GetNextItem($GUI_Lab_List) + If $EditLine <> $LV_ERR Then + $EditMac = StringTrimRight(StringTrimLeft(_GUICtrlListView_GetItemText($GUI_Lab_List, $EditLine, 0), 1), 1) + $EditLab = _GUICtrlListView_GetItemText($GUI_Lab_List, $EditLine, 1) + $EditMacGUIForm = GUICreate($Text_EditLabel, 625, 86, -1, -1) + GUISetBkColor($BackgroundColor) + GUICtrlCreateLabel($Column_Names_BSSID, 16, 16, 69, 17) + $EditMac_Mac = GUICtrlCreateInput($EditMac, 88, 16, 137, 21) + GUICtrlCreateLabel($Column_Names_Label, 230, 16, 70, 17) + $EditMac_GUI = GUICtrlCreateInput($EditLab, 305, 16, 300, 21) + $EditMac_OK = GUICtrlCreateButton($Text_Ok, 200, 48, 97, 25, 0) + $EditMac_Can = GUICtrlCreateButton($Text_Cancel, 312, 48, 97, 25, 0) + GUISetState(@SW_SHOW) + GUICtrlSetOnEvent($EditMac_OK, "_EditLabel_Ok") + GUICtrlSetOnEvent($EditMac_Can, "_EditLabel_Close") + EndIf +EndFunc ;==>_EditLabel + +Func _RemoveLabel() ;Close edit label window + $Apply_Lab = 1 + $EditLine = _GUICtrlListView_GetNextItem($GUI_Lab_List) + ;ConsoleWrite($EditLine & ' - ' & $LV_ERR & @CRLF) + If $EditLine <> $LV_ERR Then _GUICtrlListView_DeleteItem($GUI_Lab_List, $EditLine) +EndFunc ;==>_RemoveLabel + + +Func _EditLabel_Close() ;Close edit label window + GUIDelete($EditMacGUIForm) +EndFunc ;==>_EditLabel_Close + +Func _EditLabel_Ok() ;Apply edit label window settings and close it + $Apply_Lab = 1 + $StrippedMac = StringUpper(StringReplace(StringReplace(StringReplace(StringReplace(GUICtrlRead($EditMac_Mac), ':', ''), '-', ''), '"', ''), ' ', '')) + _GUICtrlListView_SetItemText($GUI_Lab_List, $EditLine, '"' & StringTrimRight($StrippedMac, StringLen($StrippedMac) - 12) & '"', 0) + _GUICtrlListView_SetItemText($GUI_Lab_List, $EditLine, GUICtrlRead($EditMac_GUI), 1) + GUIDelete($EditMacGUIForm) +EndFunc ;==>_EditLabel_Ok + +Func _AddCam() ;Adds new Camcaturer to settings gui Camfacturer list + $Apply_Cam = 1 + $AddID = '"' & GUICtrlRead($GUI_Cam_NewID) & '"' + $AddLOC = GUICtrlRead($GUI_Cam_NewLOC) + $arraysearch = -1 + $itemcount = _GUICtrlListView_GetItemCount($GUI_Cam_List) - 1 ; Get List Size + For $findloop = 0 To $itemcount ; Find cam in list; If found, set $arraysearch with position + If _GUICtrlListView_GetItemText($GUI_Cam_List, $findloop, 0) = $AddID Then + $arraysearch = $findloop + ExitLoop + EndIf + Next + If $arraysearch = -1 Then + $arraysearch = _GUICtrlListView_InsertItem($GUI_Cam_List, 0, '') + _GUICtrlListView_SetItemText($GUI_Cam_List, $arraysearch, $AddID, 0) + _GUICtrlListView_SetItemText($GUI_Cam_List, $arraysearch, $AddLOC, 1) + Else + $overwrite_entry = MsgBox(4, $Text_Overwrite & '?', "Camera Already Exists. Do you want to overwrite it.") + If $overwrite_entry = 6 Then + _GUICtrlListView_SetItemText($GUI_Cam_List, $arraysearch, $AddID, 0) + _GUICtrlListView_SetItemText($GUI_Cam_List, $arraysearch, $AddLOC, 1) + EndIf + EndIf +EndFunc ;==>_AddCam + +Func _EditCam() ;Opens edit Camfacturer window + $EditLine = _GUICtrlListView_GetNextItem($GUI_Cam_List) + If $EditLine <> $LV_ERR Then + $EditCamID = StringTrimRight(StringTrimLeft(_GUICtrlListView_GetItemText($GUI_Cam_List, $EditLine, 0), 1), 1) + $EditCamLoc = _GUICtrlListView_GetItemText($GUI_Cam_List, $EditLine, 1) + $EditCamGUIForm = GUICreate($Text_AddCamera, 625, 86, -1, -1) + GUISetBkColor($BackgroundColor) + GUICtrlCreateLabel($Text_CameraName, 16, 16, 69, 17) + $GUI_Edit_CamID = GUICtrlCreateInput($EditCamID, 88, 16, 137, 21) + GUICtrlCreateLabel($Text_CameraURL, 230, 16, 70, 17) + $GUI_Edit_CamLOC = GUICtrlCreateInput($EditCamLoc, 305, 16, 300, 21) + $EditCam_OK = GUICtrlCreateButton($Text_Ok, 200, 48, 97, 25, 0) + $EditCam_Can = GUICtrlCreateButton($Text_Cancel, 312, 48, 97, 25, 0) + GUISetState(@SW_SHOW) + GUICtrlSetOnEvent($EditCam_OK, "_EditCam_Ok") + GUICtrlSetOnEvent($EditCam_Can, "_EditCam_Close") + EndIf +EndFunc ;==>_EditCam + +Func _EditCam_Close() ;Close edit Camfacturer window + GUIDelete($EditCamGUIForm) +EndFunc ;==>_EditCam_Close + +Func _EditCam_Ok() ;Apply edit Camfacture window settings and close it + $Apply_Cam = 1 + $AddID = '"' & GUICtrlRead($GUI_Edit_CamID) & '"' + $AddLOC = GUICtrlRead($GUI_Edit_CamLOC) + _GUICtrlListView_SetItemText($GUI_Cam_List, $EditLine, $AddID, 0) + _GUICtrlListView_SetItemText($GUI_Cam_List, $EditLine, $AddLOC, 1) + GUIDelete($EditMacGUIForm) +EndFunc ;==>_EditCam_Ok + +Func _RemoveCam() ;Removed Camfactuer from list + $Apply_Cam = 1 + $EditLine = _GUICtrlListView_GetNextItem($GUI_Cam_List) + ;ConsoleWrite($EditLine & ' - ' & $LV_ERR & @CRLF) + If $EditLine <> $LV_ERR Then _GUICtrlListView_DeleteItem(GUICtrlGetHandle($GUI_Cam_List), $EditLine) +EndFunc ;==>_RemoveCam + +Func _SetWidthValue(ByRef $wcheckbox, ByRef $winput, $wcurrentwidth, $wsettings, $wsection, $wvalue, $wdef) ;Enable or disable a column in settings gui. reset width + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SetWidthValue()') ;#Debug Display + If GUICtrlRead($wcheckbox) = $GUI_UNCHECKED Then + GUICtrlSetData($winput, 0) + GUICtrlSetState($winput, $GUI_DISABLE) + Else + If $wcurrentwidth <> 0 Then + GUICtrlSetData($winput, $wcurrentwidth) + Else + $wcolumnwidth = IniRead($wsettings, $wsection, $wvalue, $wdef) + If $wcolumnwidth <> 0 Then + GUICtrlSetData($winput, $wcolumnwidth) + Else + GUICtrlSetData($winput, $wdef) + EndIf + EndIf + GUICtrlSetState($winput, $GUI_ENABLE) + EndIf +EndFunc ;==>_SetWidthValue + +Func _SetCWCBIB(ByRef $CWIB, ByRef $CWCB) ;Sets column enabled or disabled based on width + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SetCWCBIB()') ;#Debug Display + If GUICtrlRead($CWIB) = 0 Then + GUICtrlSetState($CWIB, $GUI_DISABLE) + GUICtrlSetState($CWCB, $GUI_UNCHECKED) + Else + GUICtrlSetState($CWIB, $GUI_ENABLE) + GUICtrlSetState($CWCB, $GUI_CHECKED) + EndIf +EndFunc ;==>_SetCWCBIB + +Func _SetCwState() ; Set All columns in settings gui enabled or disabled + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SetCwState()') ;#Debug Display + _SetCWCBIB($CWIB_Line, $CWCB_Line) + _SetCWCBIB($CWIB_Active, $CWCB_Active) + _SetCWCBIB($CWIB_SSID, $CWCB_SSID) + _SetCWCBIB($CWIB_BSSID, $CWCB_BSSID) + _SetCWCBIB($CWIB_Signal, $CWCB_Signal) + _SetCWCBIB($CWIB_HighSignal, $CWCB_HighSignal) + _SetCWCBIB($CWIB_RSSI, $CWCB_RSSI) + _SetCWCBIB($CWIB_HighRSSI, $CWCB_HighRSSI) + _SetCWCBIB($CWIB_Authentication, $CWCB_Authentication) + _SetCWCBIB($CWIB_Encryption, $CWCB_Encryption) + _SetCWCBIB($CWIB_NetType, $CWCB_NetType) + _SetCWCBIB($CWIB_RadioType, $CWCB_RadioType) + + + _SetCWCBIB($CWIB_Manu, $CWCB_Manu) + _SetCWCBIB($CWIB_Label, $CWCB_Label) + + _SetCWCBIB($CWIB_Channel, $CWCB_Channel) + _SetCWCBIB($CWIB_Latitude, $CWCB_Latitude) + _SetCWCBIB($CWIB_Longitude, $CWCB_Longitude) + _SetCWCBIB($CWIB_LatitudeDMS, $CWCB_LatitudeDMS) + _SetCWCBIB($CWIB_LongitudeDMS, $CWCB_LongitudeDMS) + _SetCWCBIB($CWIB_LatitudeDMM, $CWCB_LatitudeDMM) + _SetCWCBIB($CWIB_LongitudeDMM, $CWCB_LongitudeDMM) + _SetCWCBIB($CWIB_BtX, $CWCB_BtX) + _SetCWCBIB($CWIB_OtX, $CWCB_OtX) + _SetCWCBIB($CWIB_FirstActive, $CWCB_FirstActive) + _SetCWCBIB($CWIB_LastActive, $CWCB_LastActive) + +EndFunc ;==>_SetCwState + +Func _GuessNetshSearchwords() + Local $GSearchWord_SSID = '', $GSearchWord_NetworkType = '', $GSearchWord_Authentication = '', $GSearchWord_Encryption = '', $GSearchWord_BSSID = '', $GSearchWord_Signal = '', $GSearchWord_RadioType = '', $GSearchWord_Channel = '', $GSearchWord_BasicRates = '', $GSearchWord_OtherRates = '' + $count = 0 + FileDelete($tempfile) + If $DefaultApapter = $Text_Default Then + _RunDos('netsh wlan show networks mode=bssid > ' & '"' & $tempfile & '"') ;copy the output of the 'netsh wlan show networks mode=bssid' command to the temp file + Else + _RunDos($netsh & ' wlan show networks interface="' & $DefaultApapter & '" mode=bssid > ' & '"' & $tempfile & '"') ;copy the output of the 'netsh wlan show networks mode=bssid' command to the temp file + EndIf + + $arrayadded = _FileReadToArray($tempfile, $TempFileArray) ;read the tempfile into the '$TempFileArray' Araay + If $arrayadded = 1 Then + ;Strip out whitespace before and after text on each line + For $stripws = 1 To $TempFileArray[0] + $TempFileArray[$stripws] = StringStripWS($TempFileArray[$stripws], 3) + Next + + For $loop = 1 To $TempFileArray[0] + $temp = StringSplit(StringStripWS($TempFileArray[$loop], 3), ":") + If IsArray($temp) Then + If $temp[0] = 2 Or $temp[0] = 7 Then + $count += 1 + If $count = 1 Then + $GSearchword_Adapter = StringStripWS($temp[1], 3) + ElseIf $count = 2 Then + $GSearchWord_SSID = StringStripWS($temp[1], 3) + If StringInStr($GSearchWord_SSID, ' ') Then + $SSID_Split = StringSplit($GSearchWord_SSID, ' ') + If $SSID_Split[0] = 2 Then $GSearchWord_SSID = $SSID_Split[1] + EndIf + ElseIf $count = 3 Then + $GSearchWord_NetworkType = StringStripWS($temp[1], 3) + ElseIf $count = 4 Then + $GSearchWord_Authentication = StringStripWS($temp[1], 3) + ElseIf $count = 5 Then + $GSearchWord_Encryption = StringStripWS($temp[1], 3) + ElseIf $count = 6 Then + $GSearchWord_BSSID = StringStripWS($temp[1], 3) + If StringInStr($GSearchWord_BSSID, ' ') Then + $BSSID_Split = StringSplit($GSearchWord_BSSID, ' ') + If $BSSID_Split[0] = 2 Then $GSearchWord_BSSID = $BSSID_Split[1] + EndIf + ElseIf $count = 7 Then + $GSearchWord_Signal = StringStripWS($temp[1], 3) + ElseIf $count = 8 Then + $GSearchWord_RadioType = StringStripWS($temp[1], 3) + ElseIf $count = 9 Then + $GSearchWord_Channel = StringStripWS($temp[1], 3) + ElseIf $count = 10 Then + $GSearchWord_BasicRates = StringStripWS($temp[1], 3) + ElseIf $count = 11 Then + $GSearchWord_OtherRates = StringStripWS($temp[1], 3) + EndIf + EndIf + EndIf + Next + ;Update Data In GUI + If $GSearchWord_SSID <> '' And $GSearchWord_NetworkType <> '' And $GSearchWord_Authentication <> '' And $GSearchWord_Encryption <> '' And $GSearchWord_BSSID <> '' And $GSearchWord_Signal <> '' And $GSearchWord_RadioType <> '' And $GSearchWord_Channel <> '' And $GSearchWord_BasicRates <> '' And $GSearchWord_OtherRates <> '' Then + GUICtrlSetData($SearchWord_SSID_GUI, $GSearchWord_SSID) + GUICtrlSetData($SearchWord_NetType_GUI, $GSearchWord_NetworkType) + GUICtrlSetData($SearchWord_Authentication_GUI, $GSearchWord_Authentication) + GUICtrlSetData($SearchWord_Encryption_GUI, $GSearchWord_Encryption) + GUICtrlSetData($SearchWord_BSSID_GUI, $GSearchWord_BSSID) + GUICtrlSetData($SearchWord_Signal_GUI, $GSearchWord_Signal) + GUICtrlSetData($SearchWord_RadioType_GUI, $GSearchWord_RadioType) + GUICtrlSetData($SearchWord_Channel_GUI, $GSearchWord_Channel) + GUICtrlSetData($SearchWord_BasicRates_GUI, $GSearchWord_BasicRates) + GUICtrlSetData($SearchWord_OtherRates_GUI, $GSearchWord_OtherRates) + ;Show Done Message + MsgBox(0, $Text_Information, $Text_AddedGuessedSearchwords) + Else + MsgBox(0, $Text_Error, $Text_UnableToGuessSearchwords) + EndIf + EndIf +EndFunc ;==>_GuessNetshSearchwords + +Func _GUICtrlTab_SetBkColor($hWnd, $hSysTab32, $sBkColor) ;Function used to set the background color in a tab --> http://www.autoitscript.com/forum/index.php?showtopic=40659&view=findpost&p=497705 + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GUICtrlTab_SetBkColor()') ;#Debug Display + Local $aTabPos = ControlGetPos($hWnd, "", $hSysTab32) + Local $aTab_Rect = _GUICtrlTab_GetItemRect($hSysTab32, -1) + GUICtrlCreateLabel("", $aTabPos[0] + 2, $aTabPos[1] + $aTab_Rect[3] + 4, $aTabPos[2] - 4, $aTabPos[3] - $aTab_Rect[3] - 7) + GUICtrlSetBkColor(-1, $sBkColor) + GUICtrlSetState(-1, $GUI_DISABLE) +EndFunc ;==>_GUICtrlTab_SetBkColor + +;------------------------------------------------------------------------------------------------------------------------------- +; SAY SIGNAL / MIDI FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _SpeakSelectedSignal() ;Finds the slected access point and speaks its signal strenth + $ErrorFlag = 0 + If $SpeakSignal = 1 Then ; If the signal speaking is turned on + $Selected = _GUICtrlListView_GetNextItem($ListviewAPs) ; find what AP is selected in the list. returns -1 is nothing is selected + If $Selected <> -1 Then ;If a access point is selected in the listview, play its signal strenth + $query = "SELECT LastHistID, Active, SSID FROM AP WHERE ListRow=" & $Selected + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch <> 0 Then + $PlayHistID = $ApMatchArray[1][1] + $ApIsActive = $ApMatchArray[1][2] + $ApSSID = $ApMatchArray[1][3] + $query = "SELECT Signal FROM Hist WHERE HistID=" & $PlayHistID + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundHistMatch = UBound($HistMatchArray) - 1 + If $FoundHistMatch <> 0 Then + If $ApIsActive = 1 Then + $say = $HistMatchArray[1][1] + Else + $say = '0' + EndIf + If ProcessExists($SayProcess) = 0 Then ;If Say.exe is still running, skip opening it again + If $SpeakType = 1 Then ;Use Sound Files + $run = FileGetShortName(@ScriptDir & '\say.exe') & ' /s="' & $say & '" /t=1' + If $SpeakSigSayPecent = 1 Then $run &= ' /p' + $SayProcess = Run(@ComSpec & " /C " & $run, '', @SW_HIDE) + If @error Then $ErrorFlag = 1 + ElseIf $SpeakType = 2 Then ;Use Microsoft Sound API + $SayNameBefore = 0 + If $SayNameBefore = 1 Then $say = $ApSSID & ' ' & $say + $run = FileGetShortName(@ScriptDir & '\say.exe') & ' /s="' & $say & '" /t=2' + If $SpeakSigSayPecent = 1 Then $run &= ' /p' + $SayProcess = Run(@ComSpec & " /C " & $run, '', @SW_HIDE) + If @error Then $ErrorFlag = 1 + ElseIf $SpeakType = 3 Then ;Use midi files + $run = FileGetShortName(@ScriptDir & '\say.exe') & ' /s="' & $say & '" /t=3 /i=' & $Midi_Instument & ' /w=' & $Midi_PlayTime + $SayProcess = Run(@ComSpec & " /C " & $run, '', @SW_HIDE) + If @error Then $ErrorFlag = 1 + EndIf + Else + $ErrorFlag = 1 + EndIf + EndIf + EndIf + EndIf + EndIf + If $ErrorFlag = 0 Then + Return (1) + Else + Return (0) + EndIf +EndFunc ;==>_SpeakSelectedSignal + +Func _PlayMidiForActiveAPs() + If $Midi_PlayForActiveAps = 1 And ProcessExists($MidiProcess) = 0 Then + $query = "SELECT Signal FROM Hist WHERE GpsID=" & $GPS_ID + $TempHistArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundTempHist = UBound($TempHistArray) - 1 + If $FoundTempHist <> 0 Then + $PlaySignals = '' + For $mp = 1 To $FoundTempHist + If $mp <> 1 Then $PlaySignals &= '-' + $PlaySignals &= $TempHistArray[$mp][1] + Next + If $PlaySignals <> '' Then + $run = FileGetShortName(@ScriptDir & '\say.exe') & ' /ms=' & $PlaySignals & ' /t=4 /i=' & $Midi_Instument & ' /w=' & $Midi_PlayTime + $MidiProcess = Run(@ComSpec & " /C " & $run, '', @SW_HIDE) + EndIf + EndIf + EndIf +EndFunc ;==>_PlayMidiForActiveAPs + +;------------------------------------------------------------------------------------------------------------------------------- +; UPDATE FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _MenuUpdate() + If _CheckForUpdates() = 1 Then + $updatemsg = MsgBox(4, $Text_Update & '?', $Text_UpdateMsg) + If $updatemsg = 6 Then _StartUpdate() + Else + MsgBox(0, $Text_Information, $Text_NoUpdates) + EndIf +EndFunc ;==>_MenuUpdate + +Func _StartUpdate() + _WriteINI() + $command = @ScriptDir & '\vistumbler_updater.exe' + Run(@ComSpec & ' /c start "" "' & $command & '"') + Exit +EndFunc ;==>_StartUpdate + +Func _CheckForUpdates() + $UpdatesAvalible = 0 + FileDelete($NewVersionFile) + If $CheckForBetaUpdates = 1 Then + $get = InetGet($GIT_ROOT & 'beta/VistumblerMDB/versions.ini', $NewVersionFile, 1) + If $get = 0 Then FileDelete($NewVersionFile) + Else + $get = InetGet($GIT_ROOT & 'master/VistumblerMDB/versions.ini', $NewVersionFile, 1) + If $get = 0 Then FileDelete($NewVersionFile) + EndIf + If FileExists($NewVersionFile) Then + $fv = IniReadSection($NewVersionFile, "FileVersions") + If Not @error Then + For $i = 1 To $fv[0][0] + $filename = $fv[$i][0] + $fversion = $fv[$i][1] + If IniRead($CurrentVersionFile, "FileVersions", $filename, '0') <> $fversion Or FileExists(@ScriptDir & '\' & $filename) = 0 Then + $UpdatesAvalible = 1 + EndIf + Next + EndIf + EndIf + Return ($UpdatesAvalible) +EndFunc ;==>_CheckForUpdates + +Func _ManufacturerUpdate() + $command = @ScriptDir & '\UpdateManufactures.exe' + Run(@ComSpec & ' /c start "" "' & $command & '"') + Exit +EndFunc ;==>_ManufacturerUpdate + +;------------------------------------------------------------------------------------------------------------------------------- +; FILTER FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _ModifyFilters() + $GUI_ModifyFilters = GUICreate($Text_AddRemFilters, 620, 330) + GUISetBkColor($BackgroundColor) + $FilterLV = GUICtrlCreateListView("ID|Name|Description", 10, 8, 600, 254, $LVS_REPORT + $LVS_SINGLESEL, $LVS_EX_HEADERDRAGDROP + $LVS_EX_GRIDLINES + $LVS_EX_FULLROWSELECT) + GUICtrlSetBkColor(-1, $ControlBackgroundColor) + _GUICtrlListView_SetColumnWidth($FilterLV, 0, 30) + _GUICtrlListView_SetColumnWidth($FilterLV, 1, 160) + _GUICtrlListView_SetColumnWidth($FilterLV, 2, 400) + $query = "SELECT FiltID, FiltName, FiltDesc FROM Filters" + $FiltMatchArray = _RecordSearch($FiltDB, $query, $FiltDB_OBJ) + $FoundFiltMatch = UBound($FiltMatchArray) - 1 + If $FoundFiltMatch <> 0 Then + For $ffm = 1 To $FoundFiltMatch + $Filter_ID = $FiltMatchArray[$ffm][1] + $Filter_Name = $FiltMatchArray[$ffm][2] + $Filter_Desc = $FiltMatchArray[$ffm][3] + GUICtrlCreateListViewItem($Filter_ID & '|' & $Filter_Name & '|' & $Filter_Desc, $FilterLV) + Next + EndIf + $GUI_AddFilter = GUICtrlCreateButton($Text_AddFilter, 10, 265, 200, 25, $WS_GROUP) + $GUI_EditFilter = GUICtrlCreateButton($Text_EditFilter, 210, 265, 200, 25, $WS_GROUP) + $GUI_DelFilter = GUICtrlCreateButton($Text_DeleteFilter, 410, 265, 200, 25, $WS_GROUP) + $GUI_Filter_Close = GUICtrlCreateButton($Text_Close, 250, 296, 113, 25, $WS_GROUP) + GUISetState(@SW_SHOW) + GUISetOnEvent($GUI_EVENT_CLOSE, '_ModifyFilters_Close') + GUICtrlSetOnEvent($GUI_Filter_Close, "_ModifyFilters_Close") + GUICtrlSetOnEvent($GUI_AddFilter, "_AddFilter") + GUICtrlSetOnEvent($GUI_EditFilter, "_EditFilter") + GUICtrlSetOnEvent($GUI_DelFilter, "_DeleteFilter") +EndFunc ;==>_ModifyFilters + +Func _DeleteFilter() + Local $menuid = '-1' + Local $ArrayID = '-1' + Local $Selected = _GUICtrlListView_GetNextItem($FilterLV) + If $Selected <> -1 Then + $FilterID = _GUICtrlListView_GetItemText($FilterLV, $Selected, 0) + ;Get MenuID based on Filter ID + For $fl = 1 To $FilterID_Array[0] + If $FilterID_Array[$fl] = $FilterID Then + $menuid = $FilterMenuID_Array[$fl] + $ArrayID = $fl + ExitLoop + EndIf + Next + ;Delete Filter from DB + $query = "DELETE FROM Filters WHERE FiltID='" & $FilterID & "'" + _ExecuteMDB($FiltDB, $FiltDB_OBJ, $query) + $FiltID -= 1 + $query = "UPDATE Filters SET FiltID = FiltID - 1 WHERE FiltID > '" & $FilterID & "'" + _ExecuteMDB($FiltDB, $FiltDB_OBJ, $query) + ;Delete Menu Item + If $menuid <> '-1' Then GUICtrlDelete($menuid) + If $ArrayID <> '-1' Then + _ArrayDelete($FilterID_Array, $ArrayID) + _ArrayDelete($FilterMenuID_Array, $ArrayID) + $FilterID_Array[0] = UBound($FilterID_Array) - 1 + $FilterMenuID_Array[0] = UBound($FilterMenuID_Array) - 1 + EndIf + For $fl = 1 To $FilterID_Array[0] + If $FilterID_Array[$fl] > $FilterID Then $FilterID_Array[$fl] = $FilterID_Array[$fl] - 1 + Next + ;Create new filter string if this is the default filter + If $DefFiltID = $FilterID Then + $DefFiltID = '-1' + _CreateFilterQuerys() + EndIf + ;Refresh GUI + _ModifyFilters_Close() + _ModifyFilters() + Else + MsgBox(0, $Text_Error, $Text_NoFilterSelected) + EndIf +EndFunc ;==>_DeleteFilter + +Func _ModifyFilters_Close() + GUIDelete($GUI_ModifyFilters) +EndFunc ;==>_ModifyFilters_Close + +Func _AddFilter() + _AddEditFilter() + _ModifyFilters_Close() +EndFunc ;==>_AddFilter + +Func _EditFilter() + $Selected = _GUICtrlListView_GetNextItem($FilterLV) + If $Selected <> -1 Then + $FilterID = _GUICtrlListView_GetItemText($FilterLV, $Selected, 0) + _AddEditFilter($FilterID) + _ModifyFilters_Close() + Else + MsgBox(0, $Text_Error, $Text_NoFilterSelected) + EndIf +EndFunc ;==>_EditFilter + +Func _AddEditFilter($Filter_ID = '-1') + Local $Filter_Name, $Filter_Desc, $Filter_SSID = "*", $Filter_BSSID = "*", $Filter_CHAN = "*", $Filter_AUTH = "*", $Filter_ENCR = "*", $Filter_RADTYPE = "*", $Filter_NETTYPE = "*", $Filter_SIG = "*", $Filter_HighSig = "*", $Filter_RSSI = "*", $Filter_HighRSSI = "*", $Filter_BTX = "*", $Filter_OTX = "*", $Filter_Line = "*", $Filter_Active = "*" + If $Filter_ID <> '-1' Then + $query = "SELECT FiltName, FiltDesc, SSID, BSSID, CHAN, AUTH, ENCR, RADTYPE, NETTYPE, Signal, HighSig, RSSI, HighRSSI, BTX, OTX, ApID, Active FROM Filters WHERE FiltID='" & $Filter_ID & "'" + $FiltMatchArray = _RecordSearch($FiltDB, $query, $FiltDB_OBJ) + $Filter_Name = $FiltMatchArray[1][1] + $Filter_Desc = $FiltMatchArray[1][2] + $Filter_SSID = $FiltMatchArray[1][3] + $Filter_BSSID = $FiltMatchArray[1][4] + $Filter_CHAN = $FiltMatchArray[1][5] + $Filter_AUTH = $FiltMatchArray[1][6] + $Filter_ENCR = $FiltMatchArray[1][7] + $Filter_RADTYPE = $FiltMatchArray[1][8] + $Filter_NETTYPE = $FiltMatchArray[1][9] + $Filter_SIG = $FiltMatchArray[1][10] + $Filter_HighSig = $FiltMatchArray[1][11] + $Filter_RSSI = $FiltMatchArray[1][12] + $Filter_HighRSSI = $FiltMatchArray[1][13] + $Filter_BTX = $FiltMatchArray[1][14] + $Filter_OTX = $FiltMatchArray[1][15] + $Filter_Line = $FiltMatchArray[1][16] + $Filter_Active = $FiltMatchArray[1][17] + EndIf + $Filter_ID_GUI = $Filter_ID + + $AddEditFilt_GUI = GUICreate($Text_FilterAddEdit, 690, 500, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) + + GUICtrlCreateLabel($Text_FilterName, 28, 15, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_Name_GUI = GUICtrlCreateInput($Filter_Name, 28, 30, 300, 20) + GUICtrlCreateLabel($Text_FilterDesc, 353, 15, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_Desc_GUI = GUICtrlCreateInput($Filter_Desc, 353, 30, 300, 20) + GUISetBkColor($BackgroundColor) + GUICtrlCreateGroup($Text_Filters, 8, 75, 665, 390) + GUICtrlCreateLabel($Text_FilterMsg, 32, 90, 618, 40) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Column_Names_SSID, 28, 125, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_SSID_GUI = GUICtrlCreateInput($Filter_SSID, 28, 140, 300, 20) + GUICtrlCreateLabel($Column_Names_BSSID, 28, 165, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_BSSID_GUI = GUICtrlCreateInput($Filter_BSSID, 28, 180, 300, 20) + GUICtrlCreateLabel($Column_Names_Channel, 28, 205, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_CHAN_GUI = GUICtrlCreateInput($Filter_CHAN, 28, 220, 300, 20) + GUICtrlCreateLabel($Column_Names_Authentication, 28, 245, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_AUTH_GUI = GUICtrlCreateInput($Filter_AUTH, 28, 260, 300, 20) + GUICtrlCreateLabel($Column_Names_Encryption, 28, 285, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_ENCR_GUI = GUICtrlCreateInput($Filter_ENCR, 28, 300, 300, 20) + GUICtrlCreateLabel($Column_Names_RadioType, 28, 325, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_RADTYPE_GUI = GUICtrlCreateInput($Filter_RADTYPE, 28, 340, 300, 20) + GUICtrlCreateLabel($Column_Names_NetworkType, 28, 365, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_NETTYPE_GUI = GUICtrlCreateInput($Filter_NETTYPE, 28, 380, 300, 20) + GUICtrlCreateLabel($Column_Names_Active, 28, 405, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_Active_GUI = GUICtrlCreateInput($Filter_Active, 28, 420, 300, 20) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Column_Names_BasicTransferRates, 353, 125, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_BTX_GUI = GUICtrlCreateInput($Filter_BTX, 353, 140, 300, 20) + GUICtrlCreateLabel($Column_Names_OtherTransferRates, 353, 165, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_OTX_GUI = GUICtrlCreateInput($Filter_OTX, 353, 180, 300, 20) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Column_Names_Line, 353, 205, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_Line_GUI = GUICtrlCreateInput($Filter_Line, 353, 220, 300, 20) + GUICtrlCreateLabel($Column_Names_Signal, 353, 245, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_SIG_GUI = GUICtrlCreateInput($Filter_SIG, 353, 260, 300, 20) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Column_Names_HighSignal, 353, 285, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_HighSig_GUI = GUICtrlCreateInput($Filter_HighSig, 353, 300, 300, 20) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Column_Names_RSSI, 353, 325, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_RSSI_GUI = GUICtrlCreateInput($Filter_RSSI, 353, 340, 300, 20) + GUICtrlSetColor(-1, $TextColor) + GUICtrlCreateLabel($Column_Names_HighRSSI, 353, 365, 300, 15) + GUICtrlSetColor(-1, $TextColor) + $Filter_HighRSSI_GUI = GUICtrlCreateInput($Filter_HighRSSI, 353, 380, 300, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_AddEditFilt_Can = GUICtrlCreateButton($Text_Cancel, 600, 470, 75, 25, 0) + $GUI_AddEditFilt_Ok = GUICtrlCreateButton($Text_Ok, 525, 470, 75, 25, 0) + + GUICtrlSetOnEvent($GUI_AddEditFilt_Can, "_AddEditFilter_Close") + GUICtrlSetOnEvent($GUI_AddEditFilt_Ok, "_AddEditFilter_Ok") + GUISetState(@SW_SHOW) +EndFunc ;==>_AddEditFilter + +Func _AddEditFilter_Close() + GUIDelete($AddEditFilt_GUI) + _ModifyFilters() +EndFunc ;==>_AddEditFilter_Close + +Func _AddEditFilter_Ok() + $Filter_Name = GUICtrlRead($Filter_Name_GUI) + If $Filter_Name = "" Then + MsgBox(0, $Text_Error, $Text_FilterNameRequired) + Else + $Filter_Desc = GUICtrlRead($Filter_Desc_GUI) + $Filter_SSID = GUICtrlRead($Filter_SSID_GUI) + $Filter_BSSID = GUICtrlRead($Filter_BSSID_GUI) + $Filter_CHAN = GUICtrlRead($Filter_CHAN_GUI) + $Filter_AUTH = GUICtrlRead($Filter_AUTH_GUI) + $Filter_ENCR = GUICtrlRead($Filter_ENCR_GUI) + $Filter_RADTYPE = GUICtrlRead($Filter_RADTYPE_GUI) + $Filter_NETTYPE = GUICtrlRead($Filter_NETTYPE_GUI) + $Filter_SIG = GUICtrlRead($Filter_SIG_GUI) + $Filter_HighSig = GUICtrlRead($Filter_HighSig_GUI) + $Filter_RSSI = GUICtrlRead($Filter_RSSI_GUI) + $Filter_HighRSSI = GUICtrlRead($Filter_HighRSSI_GUI) + $Filter_BTX = GUICtrlRead($Filter_BTX_GUI) + $Filter_OTX = GUICtrlRead($Filter_OTX_GUI) + $Filter_Line = GUICtrlRead($Filter_Line_GUI) + $Filter_Active = StringReplace(StringReplace(GUICtrlRead($Filter_Active_GUI), $Text_Active, '1'), $Text_Dead, '0') + + ;If $Filter_SSID = '' Then $Filter_SSID = '*' + If $Filter_BSSID = '' Then $Filter_BSSID = '*' + If $Filter_CHAN = '' Then $Filter_CHAN = '*' + If $Filter_AUTH = '' Then $Filter_AUTH = '*' + If $Filter_ENCR = '' Then $Filter_ENCR = '*' + If $Filter_RADTYPE = '' Then $Filter_RADTYPE = '*' + If $Filter_NETTYPE = '' Then $Filter_NETTYPE = '*' + If $Filter_SIG = '' Then $Filter_SIG = '*' + If $Filter_HighSig = '' Then $Filter_HighSig = '*' + If $Filter_RSSI = '' Then $Filter_RSSI = '*' + If $Filter_HighRSSI = '' Then $Filter_HighRSSI = '*' + If $Filter_BTX = '' Then $Filter_BTX = '*' + If $Filter_OTX = '' Then $Filter_OTX = '*' + If $Filter_Line = '' Then $Filter_Line = '*' + If $Filter_Active = '' Then $Filter_Active = '*' + + If $Filter_ID_GUI = '-1' Then + $FiltID += 1 + _AddRecord($FiltDB, "Filters", $FiltDB_OBJ, $FiltID & '|' & $Filter_Name & '|' & $Filter_Desc & '|' & $Filter_SSID & '|' & $Filter_BSSID & '|' & $Filter_CHAN & '|' & $Filter_AUTH & '|' & $Filter_ENCR & '|' & $Filter_RADTYPE & '|' & $Filter_NETTYPE & '|' & $Filter_SIG & '|' & $Filter_HighSig & '|' & $Filter_RSSI & '|' & $Filter_HighRSSI & '|' & $Filter_BTX & '|' & $Filter_OTX & '|' & $Filter_Line & '|' & $Filter_Active) + $menuid = GUICtrlCreateMenuItem($Filter_Name, $FilterMenu) + GUICtrlSetOnEvent($menuid, '_FilterChanged') + _ArrayAdd($FilterMenuID_Array, $menuid) + _ArrayAdd($FilterID_Array, $FiltID) + $FilterMenuID_Array[0] = UBound($FilterMenuID_Array) - 1 + $FilterID_Array[0] = UBound($FilterID_Array) - 1 + Else + $Filter_ID = $Filter_ID_GUI + $query = "UPDATE Filters SET FiltName='" & $Filter_Name & "', FiltDesc='" & $Filter_Desc & "', SSID='" & $Filter_SSID & "', BSSID='" & $Filter_BSSID & "', CHAN='" & $Filter_CHAN & "', AUTH='" & $Filter_AUTH & "', ENCR='" & $Filter_ENCR & "', RADTYPE='" & $Filter_RADTYPE & "', NETTYPE='" & $Filter_NETTYPE & "', Signal='" & $Filter_SIG & "', HighSig='" & $Filter_HighSig & "', RSSI='" & $Filter_RSSI & "', HighRSSI='" & $Filter_HighRSSI & "', BTX='" & $Filter_BTX & "', OTX='" & $Filter_OTX & "', ApID='" & $Filter_Line & "', Active='" & $Filter_Active & "' WHERE FiltID='" & $Filter_ID & "'" + _ExecuteMDB($FiltDB, $FiltDB_OBJ, $query) + For $fi = 1 To $FilterID_Array[0] + If $FilterID_Array[$fi] = $Filter_ID Then + $Filter_MenuID = $FilterMenuID_Array[$fi] + GUICtrlSetData($Filter_MenuID, $Filter_Name) + ExitLoop + EndIf + Next + + EndIf + GUIDelete($AddEditFilt_GUI) + _CreateFilterQuerys() + _ModifyFilters() + EndIf +EndFunc ;==>_AddEditFilter_Ok + +Func _FilterChanged() + $menuid = @GUI_CtrlId + For $fs = 1 To $FilterMenuID_Array[0] + If $FilterMenuID_Array[$fs] = $menuid Then + $Filter_ID = $FilterID_Array[$fs] + If $Filter_ID <> $DefFiltID Then + ;Check to see if another filter is selected, deselect it if it exists + If $DefFiltID <> '-1' Then + For $fm = 1 To $FilterID_Array[0] + If $FilterID_Array[$fm] = $DefFiltID Then + $Filter_MenuID = $FilterMenuID_Array[$fm] + GUICtrlSetState($Filter_MenuID, $GUI_UNCHECKED) + ExitLoop + EndIf + Next + EndIf + For $fm = 1 To $FilterMenuID_Array[0] + If $FilterMenuID_Array[$fm] = $menuid Then + $DefFiltID = $FilterID_Array[$fm] + GUICtrlSetState($menuid, $GUI_CHECKED) + ExitLoop + EndIf + Next + Else + For $fm = 1 To $FilterMenuID_Array[0] + If $FilterMenuID_Array[$fm] = $menuid Then + $Filter_ID = $FilterID_Array[$fm] + $DefFiltID = '-1' + GUICtrlSetState($menuid, $GUI_UNCHECKED) + EndIf + Next + EndIf + ExitLoop + EndIf + Next + _CreateFilterQuerys() + $TempBatchListviewInsert = 1 + $TempBatchListviewDelete = 1 +EndFunc ;==>_FilterChanged + +Func _CreateFilterQuerys() + $AddQuery = "SELECT ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active, HighSignal, HighRSSI, ListRow FROM AP" + $RemoveQuery = "SELECT ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active FROM AP" + $CountQuery = "Select COUNT(ApID) FROM AP" + + If $DefFiltID <> '-1' Then + $query = "SELECT SSID, BSSID, CHAN, AUTH, ENCR, RADTYPE, NETTYPE, Signal, HighSig, RSSI, HighRSSI, BTX, OTX, ApID, Active FROM Filters WHERE FiltID='" & $DefFiltID & "'" + $FiltMatchArray = _RecordSearch($FiltDB, $query, $FiltDB_OBJ) + $Filter_SSID = $FiltMatchArray[1][1] + $Filter_BSSID = $FiltMatchArray[1][2] + $Filter_CHAN = $FiltMatchArray[1][3] + $Filter_AUTH = $FiltMatchArray[1][4] + $Filter_ENCR = $FiltMatchArray[1][5] + $Filter_RADTYPE = $FiltMatchArray[1][6] + $Filter_NETTYPE = $FiltMatchArray[1][7] + $Filter_SIG = $FiltMatchArray[1][8] + $Filter_HighSig = $FiltMatchArray[1][9] + $Filter_RSSI = $FiltMatchArray[1][10] + $Filter_HighRSSI = $FiltMatchArray[1][11] + $Filter_BTX = $FiltMatchArray[1][12] + $Filter_OTX = $FiltMatchArray[1][13] + $Filter_Line = $FiltMatchArray[1][14] + $Filter_Active = $FiltMatchArray[1][15] + + $aquery = '' + $aquery = _AddFilerString($aquery, 'SSID', $Filter_SSID) + $aquery = _AddFilerString($aquery, 'BSSID', $Filter_BSSID) + $aquery = _AddFilerString($aquery, 'CHAN', $Filter_CHAN) + $aquery = _AddFilerString($aquery, 'AUTH', $Filter_AUTH) + $aquery = _AddFilerString($aquery, 'ENCR', $Filter_ENCR) + $aquery = _AddFilerString($aquery, 'RADTYPE', $Filter_RADTYPE) + $aquery = _AddFilerString($aquery, 'NETTYPE', $Filter_NETTYPE) + $aquery = _AddFilerString($aquery, 'Signal', $Filter_SIG) + $aquery = _AddFilerString($aquery, 'HighSignal', $Filter_HighSig) + $aquery = _AddFilerString($aquery, 'RSSI', $Filter_RSSI) + $aquery = _AddFilerString($aquery, 'HighRSSI', $Filter_HighRSSI) + $aquery = _AddFilerString($aquery, 'BTX', $Filter_BTX) + $aquery = _AddFilerString($aquery, 'OTX', $Filter_OTX) + $aquery = _AddFilerString($aquery, 'ApID', $Filter_Line) + $aquery = _AddFilerString($aquery, 'Active', $Filter_Active) + If $aquery <> '' Then $AddQuery &= ' WHERE (' & $aquery & ')' + If $aquery <> '' Then $CountQuery &= ' WHERE (' & $aquery & ')' + + ConsoleWrite($AddQuery & @CRLF) + ConsoleWrite($CountQuery & @CRLF) + + $rquery = '' + $rquery = _RemoveFilterString($rquery, 'SSID', $Filter_SSID) + $rquery = _RemoveFilterString($rquery, 'BSSID', $Filter_BSSID) + $rquery = _RemoveFilterString($rquery, 'CHAN', $Filter_CHAN) + $rquery = _RemoveFilterString($rquery, 'AUTH', $Filter_AUTH) + $rquery = _RemoveFilterString($rquery, 'ENCR', $Filter_ENCR) + $rquery = _RemoveFilterString($rquery, 'RADTYPE', $Filter_RADTYPE) + $rquery = _RemoveFilterString($rquery, 'NETTYPE', $Filter_NETTYPE) + $rquery = _RemoveFilterString($rquery, 'Signal', $Filter_SIG) + $rquery = _RemoveFilterString($rquery, 'HighSignal', $Filter_HighSig) + $rquery = _RemoveFilterString($rquery, 'RSSI', $Filter_RSSI) + $rquery = _RemoveFilterString($rquery, 'HighRSSI', $Filter_HighRSSI) + $rquery = _RemoveFilterString($rquery, 'BTX', $Filter_BTX) + $rquery = _RemoveFilterString($rquery, 'OTX', $Filter_OTX) + $rquery = _RemoveFilterString($rquery, 'ApID', $Filter_Line) + $rquery = _RemoveFilterString($rquery, 'Active', $Filter_Active) + If $rquery <> '' Then $RemoveQuery &= ' WHERE (' & $rquery & ')' + + ConsoleWrite($RemoveQuery & @CRLF) + EndIf +EndFunc ;==>_CreateFilterQuerys + +Func _AddFilerString($q_query, $q_field, $FilterValues) + $FilterValues = StringReplace(StringReplace($FilterValues, '"', ''), "'", "") + Local $ret + Local $ret2 + If $FilterValues = '*' Then + Return ($q_query) + Else + If $q_query <> '' Then $q_query &= ' AND ' + ;$FilterValues = StringReplace($FilterValues, "|", ",") + ;Get values to seperate filter sysmbols from escaped filter symbols + StringReplace($FilterValues, "%", "%") + $filter_pcount = @extended ; Number of percent signs in filter + StringReplace($FilterValues, "\%", "\%") + $filter_epcount = @extended ; Number of escaped percent signs in filter + StringReplace($FilterValues, "-", "-") + $filter_dcount = @extended ; Number of dashes in filter + StringReplace($FilterValues, "\-", "\-") + $filter_edcount = @extended ; Number of escaped dashes in filter + StringReplace($FilterValues, ",", ",") + $filter_ccount = @extended ; Number of commas in filter + StringReplace($FilterValues, "\,", "\,") + $filter_eccount = @extended ; Number of escaped commas signs in filter + $filter_enecount = @extended ; Number of escaped not equals in filter + $FilterValues = StringReplace(StringReplace(StringReplace($FilterValues, "\%", "%"), "\-", "-"), "\,", ",") + + If $q_field = "Signal" Or $q_field = "HighSignal" Or $q_field = "RSSI" Or $q_field = "HighRSSI" Or $q_field = "CHAN" Then ;These are integer fields and need to be treated differently (no quotes or the query fails) + If (UBound(StringSplit($FilterValues, "-")) - 2) = 3 Then ;If there are 3 dashes, treat this as a range of RSSI values + $RRS = StringSplit($FilterValues, "-") + If $RRS[0] = 4 Then + $Rnum1 = $RRS[1] & '-' & $RRS[2] + $Rnum2 = $RRS[3] & '-' & $RRS[4] + ConsoleWrite('Range: ' & $Rnum1 & ' - ' & $Rnum2 & @CRLF) + If StringInStr($FilterValues, '<>') Then + $q_query &= "(" & $q_field & " NOT BETWEEN " & StringReplace($Rnum1, '<>', '') & " AND " & StringReplace($Rnum2, '<>', '') & ")" + Else + $q_query &= "(" & $q_field & " BETWEEN " & $Rnum1 & " AND " & $Rnum2 & ")" + EndIf + EndIf + ElseIf StringInStr($FilterValues, ",") Then + $q_splitstring = StringSplit($FilterValues, ",") + For $q = 1 To $q_splitstring[0] + If StringInStr($q_splitstring[$q], '<>') Then + If $ret <> '' Then $ret &= ',' + $ret &= StringReplace($q_splitstring[$q], '<>', '') + Else + If $ret2 <> '' Then $ret2 &= ',' + $ret2 &= $q_splitstring[$q] + EndIf + Next + If $ret <> '' Or $ret2 <> '' Then $q_query &= "(" + If $ret <> '' Then $q_query &= $q_field & " NOT IN (" & $ret & ")" + If $ret <> '' And $ret2 <> '' Then $q_query &= " And " + If $ret2 <> '' Then $q_query &= $q_field & " IN (" & $ret2 & ")" + If $ret <> '' Or $ret2 <> '' Then $q_query &= ")" + ElseIf StringInStr($FilterValues, "-") Then + $q_splitstring = StringSplit($FilterValues, "-") + If StringInStr($FilterValues, '<>') Then + $q_query &= "(" & $q_field & " NOT BETWEEN " & StringReplace($q_splitstring[1], '<>', '') & " AND " & StringReplace($q_splitstring[2], '<>', '') & ")" + Else + $q_query &= "(" & $q_field & " BETWEEN " & $q_splitstring[1] & " AND " & $q_splitstring[2] & ")" + EndIf + Else + If StringInStr($FilterValues, '<>') Then + $q_query &= "(" & $q_field & " <> " & StringReplace($FilterValues, '<>', '') & ")" + Else + If StringInStr($FilterValues, '%') And ($filter_pcount > $filter_epcount) Then ;If has "%" and there are more "%"s then "\%"s, treat as a like statement + $q_query &= "(" & $q_field & " like '" & $FilterValues & "')" + Else + $q_query &= "(" & $q_field & " = '" & $FilterValues & "')" + EndIf + EndIf + EndIf + Return ($q_query) + ElseIf StringInStr($FilterValues, ",") And ($filter_ccount > $filter_eccount) Then + $q_splitstring = StringSplit($FilterValues, ",") + For $q = 1 To $q_splitstring[0] + If StringInStr($q_splitstring[$q], '<>') Then + If $ret <> '' Then $ret &= ',' + $ret &= "'" & StringReplace($q_splitstring[$q], '<>', '') & "'" + Else + If $ret2 <> '' Then $ret2 &= ',' + $ret2 &= "'" & $q_splitstring[$q] & "'" + EndIf + Next + If $ret <> '' Or $ret2 <> '' Then $q_query &= "(" + If $ret <> '' Then $q_query &= $q_field & " NOT IN (" & $ret & ")" + If $ret <> '' And $ret2 <> '' Then $q_query &= " And " + If $ret2 <> '' Then $q_query &= $q_field & " IN (" & $ret2 & ")" + If $ret <> '' Or $ret2 <> '' Then $q_query &= ")" + Return ($q_query) + ElseIf StringInStr($FilterValues, "-") And ($filter_dcount > $filter_edcount) Then + $filtopnum = (($filter_dcount - 1) / 2) + 1 ;Find center dash, which should be the filter operator + $splitdashpos = StringInStr($FilterValues, "-", 1, $filtopnum) ;Find center dash location + $ri1 = StringTrimRight($FilterValues, (StringLen($FilterValues) - $splitdashpos) + 1) ;Get first range value + $ri2 = StringTrimLeft($FilterValues, $splitdashpos) ;Get second range value + If StringInStr($FilterValues, '<>') Then + $q_query &= "(" & $q_field & " NOT BETWEEN '" & StringReplace($ri1, '<>', '') & "' AND '" & StringReplace($ri2, '<>', '') & "')" + Else + $q_query &= "(" & $q_field & " BETWEEN '" & $ri1 & "' AND '" & $ri2 & "')" + EndIf + Return ($q_query) + Else + If StringInStr($FilterValues, '<>') Then + $q_query &= "(" & $q_field & " <> '" & StringReplace($FilterValues, '<>', '') & "')" + Else + If StringInStr($FilterValues, '%') And ($filter_pcount > $filter_epcount) Then ;If has "%" and there are more "%"s then "\%"s, treat as a like statement + $q_query &= "(" & $q_field & " like '" & $FilterValues & "')" + Else + $q_query &= "(" & $q_field & " = '" & $FilterValues & "')" + EndIf + EndIf + Return ($q_query) + EndIf + EndIf +EndFunc ;==>_AddFilerString + +Func _RemoveFilterString($q_query, $q_field, $FilterValues) + $FilterValues = StringReplace(StringReplace($FilterValues, '"', ''), "'", "") + Local $ret + Local $ret2 + If $FilterValues = '*' Then + Return ($q_query) + Else + If $q_query <> '' Then $q_query &= ' OR ' + ;$FilterValues = StringReplace($FilterValues, "|", ",") + ;Get values to seperate filter sysmbols from escaped filter symbols + StringReplace($FilterValues, "%", "%") + $filter_pcount = @extended ; Number of percent signs in filter + StringReplace($FilterValues, "\%", "\%") + $filter_epcount = @extended ; Number of escaped percent signs in filter + StringReplace($FilterValues, "-", "-") + $filter_dcount = @extended ; Number of dashes in filter + StringReplace($FilterValues, "\-", "\-") + $filter_edcount = @extended ; Number of escaped dashes in filter + StringReplace($FilterValues, ",", ",") + $filter_ccount = @extended ; Number of commas in filter + StringReplace($FilterValues, "\,", "\,") + $filter_eccount = @extended ; Number of escaped commas signs in filter + $FilterValues = StringReplace(StringReplace(StringReplace($FilterValues, "\%", "%"), "\-", "-"), "\,", ",") + ;Create query + If $q_field = "Signal" Or $q_field = "HighSignal" Or $q_field = "RSSI" Or $q_field = "HighRSSI" Or $q_field = "CHAN" Then ;These are integer fields and need to be treated differently (no quotes or the query fails) + If (UBound(StringSplit($FilterValues, "-")) - 2) = 3 Then ;If there are 3 dashes, treat this as a range of RSSI values + $RRS = StringSplit($FilterValues, "-") + If $RRS[0] = 4 Then + $Rnum1 = $RRS[1] & '-' & $RRS[2] + $Rnum2 = $RRS[3] & '-' & $RRS[4] + ConsoleWrite('Range: ' & $Rnum1 & ' - ' & $Rnum2 & @CRLF) + If StringInStr($FilterValues, '<>') Then + $q_query &= "(" & $q_field & " BETWEEN " & StringReplace($Rnum1, '<>', '') & " AND " & $Rnum2 & ")" + Else + $q_query &= "(" & $q_field & " NOT BETWEEN " & $Rnum1 & " AND " & $Rnum2 & ")" + EndIf + EndIf + ElseIf StringInStr($FilterValues, ",") Then + $q_splitstring = StringSplit($FilterValues, ",") + For $q = 1 To $q_splitstring[0] + If StringInStr($q_splitstring[$q], '<>') Then + If $ret <> '' Then $ret &= ',' + $ret &= StringReplace($q_splitstring[$q], '<>', '') + Else + If $ret2 <> '' Then $ret2 &= ',' + $ret2 &= $q_splitstring[$q] + EndIf + Next + If $ret <> '' Or $ret2 <> '' Then $q_query &= "(" + If $ret <> '' Then $q_query &= $q_field & " IN (" & $ret & ")" + If $ret <> '' And $ret2 <> '' Then $q_query &= " Or " + If $ret2 <> '' Then $q_query &= $q_field & " NOT IN (" & $ret2 & ")" + If $ret <> '' Or $ret2 <> '' Then $q_query &= ")" + ElseIf StringInStr($FilterValues, "-") Then + $q_splitstring = StringSplit($FilterValues, "-") + If StringInStr($FilterValues, '<>') Then + $q_query &= "(" & $q_field & " BETWEEN " & StringReplace($q_splitstring[1], '<>', '') & " AND " & StringReplace($q_splitstring[2], '<>', '') & ")" + Else + $q_query &= "(" & $q_field & " NOT BETWEEN " & $q_splitstring[1] & " AND " & $q_splitstring[2] & ")" + EndIf + Else + If StringInStr($FilterValues, '<>') Then + $q_query &= "(" & $q_field & " = " & StringReplace($FilterValues, '<>', '') & ")" + Else + If StringInStr($FilterValues, '%') And ($filter_pcount > $filter_epcount) Then ;If has "%" and there are more "%"s then "\%"s, treat as a like statement + $q_query &= "(" & $q_field & " not like '" & $FilterValues & "')" + Else + $q_query &= "(" & $q_field & " <> '" & $FilterValues & "')" + EndIf + EndIf + EndIf + Return ($q_query) + ElseIf StringInStr($FilterValues, ",") And ($filter_ccount > $filter_eccount) Then + $q_splitstring = StringSplit($FilterValues, ",") + For $q = 1 To $q_splitstring[0] + If StringInStr($q_splitstring[$q], '<>') Then + If $ret <> '' Then $ret &= ',' + $ret &= "'" & StringReplace($q_splitstring[$q], '<>', '') & "'" + Else + If $ret2 <> '' Then $ret2 &= ',' + $ret2 &= "'" & $q_splitstring[$q] & "'" + EndIf + Next + If $ret <> '' Or $ret2 <> '' Then $q_query &= "(" + If $ret <> '' Then $q_query &= $q_field & " IN (" & $ret & ")" + If $ret <> '' And $ret2 <> '' Then $q_query &= " Or " + If $ret2 <> '' Then $q_query &= $q_field & " NOT IN (" & $ret2 & ")" + If $ret <> '' Or $ret2 <> '' Then $q_query &= ")" + Return ($q_query) + ElseIf StringInStr($FilterValues, "-") And ($filter_dcount > $filter_edcount) Then + $filtopnum = (($filter_dcount - 1) / 2) + 1 ;Find center dash, which should be the filter operator + $splitdashpos = StringInStr($FilterValues, "-", 1, $filtopnum) ;Find center dash location + $ri1 = StringTrimRight($FilterValues, (StringLen($FilterValues) - $splitdashpos) + 1) ;Get first range value + $ri2 = StringTrimLeft($FilterValues, $splitdashpos) ;Get second range value + If StringInStr($FilterValues, '<>') Then + $q_query &= "(" & $q_field & " BETWEEN '" & StringReplace($ri1, '<>', '') & "' AND '" & StringReplace($ri2, '<>', '') & "')" + Else + $q_query &= "(" & $q_field & " NOT BETWEEN '" & $ri1 & "' AND '" & $ri2 & "')" + EndIf + Return ($q_query) + Else + If StringInStr($FilterValues, '<>') Then + $q_query &= "(" & $q_field & " = '" & StringReplace($FilterValues, '<>', '') & "')" + Else + If StringInStr($FilterValues, '%') And ($filter_pcount > $filter_epcount) Then ;If has "%" and there are more "%"s then "\%"s, treat as a like statement + $q_query &= "(" & $q_field & " not like '" & $FilterValues & "')" + Else + $q_query &= "(" & $q_field & " <> '" & $FilterValues & "')" + EndIf + EndIf + Return ($q_query) + EndIf + EndIf +EndFunc ;==>_RemoveFilterString + +;------------------------------------------------------------------------------------------------------------------------------- +; WIRELESS INTERFACE FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _AddInterfaces() + Dim $NetworkAdapters[1] + Local $found_adapter = 0 + Local $menuid = 0 + If $UseNativeWifi = 1 Then + $wlaninterfaces = _Wlan_EnumInterfaces() + $numofint = UBound($wlaninterfaces) - 1 + For $antm = 0 To $numofint + $adapterid = $wlaninterfaces[$antm][0] + $adapterdesc = $wlaninterfaces[$antm][1] + $adaptername = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\' & $adapterid & '\Connection', 'Name') + $menuid = GUICtrlCreateMenuItem($adaptername & ' (' & $adapterdesc & ')', $Interfaces) + _ArrayAdd($NetworkAdapters, $menuid) + GUICtrlSetOnEvent($menuid, '_InterfaceChanged') + If $DefaultApapter = $adaptername Then + $found_adapter = 1 + $DefaultApapterID = $adapterid + _Wlan_SelectInterface($DefaultApapterID) + GUICtrlSetState($menuid, $GUI_CHECKED) + EndIf + Next + If $menuid <> 0 And $found_adapter = 0 Then + $DefaultApapter = $adaptername + $DefaultApapterID = $adapterid + _Wlan_SelectInterface($DefaultApapterID) + GUICtrlSetState($menuid, $GUI_CHECKED) + EndIf + If $menuid = 0 Then $noadaptersid = GUICtrlCreateMenuItem($Text_NoAdaptersFound, $Interfaces) + $NetworkAdapters[0] = UBound($NetworkAdapters) - 1 + Else + ;Get network interfaces and add the to the interface menu + Local $DefaultApapterDesc + $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") + $colNIC = $objWMIService.ExecQuery("Select * from Win32_NetworkAdapter WHERE AdapterTypeID = 0 And NetConnectionID <> NULL") + For $object In $colNIC + $adaptername = $object.NetConnectionID + $adapterdesc = $object.Description + $menuid = GUICtrlCreateMenuItem($adaptername & ' (' & $adapterdesc & ')', $Interfaces) + _ArrayAdd($NetworkAdapters, $menuid) + GUICtrlSetOnEvent($menuid, '_InterfaceChanged') + If $DefaultApapter = $adaptername Then + $DefaultApapterDesc = $adapterdesc + $found_adapter = 1 + GUICtrlSetState($menuid, $GUI_CHECKED) + EndIf + Next + If $menuid <> 0 And $found_adapter = 0 Then + $DefaultApapter = $adaptername + $DefaultApapterDesc = $adapterdesc + GUICtrlSetState($menuid, $GUI_CHECKED) + EndIf + If $menuid = 0 Then $noadaptersid = GUICtrlCreateMenuItem($Text_NoAdaptersFound, $Interfaces) + $NetworkAdapters[0] = UBound($NetworkAdapters) - 1 + ;Find adapterid + $wlaninterfaces = _Wlan_EnumInterfaces() + $numofint = UBound($wlaninterfaces) - 1 + For $antm = 0 To $numofint + If $DefaultApapterDesc = $wlaninterfaces[$antm][1] Then $DefaultApapterID = $wlaninterfaces[$antm][0] + _Wlan_SelectInterface($DefaultApapterID) + Next + EndIf +EndFunc ;==>_AddInterfaces + +Func _InterfaceChanged() + $menuid = @GUI_CtrlId + For $uc = 1 To $NetworkAdapters[0] + If $NetworkAdapters[$uc] = $menuid Then + GUICtrlSetState($NetworkAdapters[$uc], $GUI_CHECKED) + Else + GUICtrlSetState($NetworkAdapters[$uc], $GUI_UNCHECKED) + EndIf + Next + $das = StringSplit(GUICtrlRead(@GUI_CtrlId, 1), ' (', 1) + $DefaultApapter = $das[1] + ;If Using Native Wifi, Find DefaultAdapterId + If $UseNativeWifi = 1 Then + $wlaninterfaces = _Wlan_EnumInterfaces() + $numofint = UBound($wlaninterfaces) - 1 + For $antm = 0 To $numofint + $adapterid = $wlaninterfaces[$antm][0] + $adapterdesc = $wlaninterfaces[$antm][1] + $adaptername = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\' & $adapterid & '\Connection', 'Name') + If $DefaultApapter = $adaptername Then $DefaultApapterID = $adapterid + _Wlan_SelectInterface($DefaultApapterID) + Next + Else + Dim $DefaultApapterID = '', $DefaultApapterDesc = '' + $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") + $colNIC = $objWMIService.ExecQuery("Select * from Win32_NetworkAdapter WHERE AdapterTypeID = 0 And NetConnectionID <> NULL") + For $object In $colNIC + $adaptername = $object.NetConnectionID + $adapterdesc = $object.Description + If $DefaultApapter = $adaptername Then $DefaultApapterDesc = $adapterdesc + Next + ;Find adapterid + ;$wlanhandle = _Wlan_OpenHandle() + $wlaninterfaces = _Wlan_EnumInterfaces() + $numofint = UBound($wlaninterfaces) - 1 + For $antm = 0 To $numofint + If $DefaultApapterDesc = $wlaninterfaces[$antm][1] Then $DefaultApapterID = $wlaninterfaces[$antm][0] + _Wlan_SelectInterface($DefaultApapterID) + Next + EndIf +EndFunc ;==>_InterfaceChanged + +Func _RefreshInterfaces() + ;Delete all old menu items + For $ri = 1 To $NetworkAdapters[0] + $menuid = $NetworkAdapters[$ri] + GUICtrlDelete($menuid) + Next + GUICtrlDelete($noadaptersid) + ;Add updated interfaces + _AddInterfaces() +EndFunc ;==>_RefreshInterfaces + +;------------------------------------------------------------------------------------------------------------------------------- +; CAMERA FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _ImageDownloader() + $query = "SELECT CamName, CamUrl FROM Cameras" + $CamMatchArray = _RecordSearch($CamDB, $query, $CamDB_OBJ) + $FoundCamMatch = UBound($CamMatchArray) - 1 + If $FoundCamMatch > 0 Then + $dtfilebase = StringFormat("%04i", @YEAR) & '-' & StringFormat("%02i", @MON) & '-' & StringFormat("%02i", @MDAY) & ' ' & @HOUR & '-' & @MIN & '-' & @SEC + For $c = 1 To $FoundCamMatch + $camname = $CamMatchArray[$c][1] + $camurl = $CamMatchArray[$c][2] + $filename = $dtfilebase & '_' & 'gpsid-' & $GPS_ID & '_' & $camname & '.jpg' + $tmpfile = $TmpDir & $filename + $destfile = $VistumblerCamFolder & $filename + ;ConsoleWrite($camname & ' - ' & $camurl & ' - ' & $tmpfile & @CRLF) + $get = InetGet($camurl, $tmpfile, 0) + ;ConsoleWrite($get & @CRLF) + If $get <> 0 Then + ;ConsoleWrite($GPS_ID & @CRLF) + $imgmd5 = _MD5ForFile($destfile) + $query = "SELECT TOP 1 CamID FROM Cam WHERE ImgMD5='" & $imgmd5 & "'" + ;ConsoleWrite($query & @CRLF) + $ImgMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundImgMatch = UBound($ImgMatchArray) - 1 + If $FoundImgMatch = 0 Then ;If Img is not found, add it + $CamID += 1 + _AddRecord($VistumblerDB, "Cam", $DB_OBJ, $CamID & '|' & $GPS_ID & '|' & $camname & '|' & $filename & '|' & $datestamp & '|' & $timestamp) + FileMove($tmpfile, $destfile) + EndIf + EndIf + If FileExists($tmpfile) Then FileDelete($tmpfile) + Next + EndIf +EndFunc ;==>_ImageDownloader + +Func _ExportCamFile() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportToCSV()') ;#Debug Display + $file = "CamID,CamGroup,CamGpsID,CamName,CamFile,Date,Time,Latitude,Longitude,NumberOfSats,ExpHorDilPitch,Altitude,HeightOfGeoid,SpeedKmh,SpeedMPH,Track" & @CRLF + $filename = FileSaveDialog('Save Camera File', $SaveDir, 'Vistumbler Camera File (*.VSCZ)', '', $ldatetimestamp & '.VSCZ') + $query = "SELECT CamID, CamGroup, GpsID, CamName, CamFile, Date1, Time1 FROM CAM" + $CamMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundCamMatch = UBound($CamMatchArray) - 1 + If $FoundCamMatch > 0 Then + $datafiletmp = $TmpDir & 'Data.csv' + $exporttmp = $TmpDir & 'Export.zip' + _Zip_Create($exporttmp, 1) + For $exp = 1 To $FoundCamMatch + GUICtrlSetData($msgdisplay, $Text_SavingLine & ' ' & $exp & ' / ' & $FoundCamMatch) + ;Ap Info + $ExpCamID = $CamMatchArray[$exp][1] + $ExpCamGroup = $CamMatchArray[$exp][2] + $ExpGpsID = $CamMatchArray[$exp][3] + $ExpCamName = $CamMatchArray[$exp][4] + $ExpCamFile = $CamMatchArray[$exp][5] + $ExpCamDate = $CamMatchArray[$exp][6] + $ExpCamTime = $CamMatchArray[$exp][7] + ;GPS Information + If $ExpGpsID <> 0 Then + $query = "SELECT Latitude, Longitude, NumOfSats, HorDilPitch, Alt, Geo, SpeedInMPH, SpeedInKmH, TrackAngle, Date1, Time1 FROM GPS WHERE GpsID=" & $ExpGpsID + ;ConsoleWrite($query & @CRLF) + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLat = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][1]), 'S', '-'), 'N', ''), ' ', '') + $ExpLon = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][2]), 'W', '-'), 'E', ''), ' ', '') + $ExpSat = $GpsMatchArray[1][3] + $ExpHorDilPitch = $GpsMatchArray[1][4] + $ExpAlt = $GpsMatchArray[1][5] + $ExpGeo = $GpsMatchArray[1][6] + $ExpSpeedMPH = $GpsMatchArray[1][7] + $ExpSpeedKmh = $GpsMatchArray[1][8] + $ExpTrack = $GpsMatchArray[1][9] + Else + Dim $ExpLat = "0.0000000", $ExpLon = "0.0000000", $ExpSat = "00", $ExpHorDilPitch = "0", $ExpAlt = "0", $ExpGeo = "0", $ExpSpeedMPH = "0", $ExpSpeedKmh = "0", $ExpTrack = "0" + EndIf + ;ConsoleWrite($ExpCamID & ',' & $ExpCamGroup & ',' & $ExpGpsID & ',' & $ExpCamName & ',' & $ExpCamFile & ',' & $ExpCamDate & ',' & $ExpCamTime & ',' & $ExpLat & ',' & $ExpLon & ',' & $ExpSat & ',' & $ExpHorDilPitch & ',' & $ExpAlt & ',' & $ExpGeo & ',' & $ExpSpeedKmh & ',' & $ExpSpeedMPH & ',' & $ExpTrack & @CRLF) + $file &= $ExpCamID & ',' & $ExpCamGroup & ',' & $ExpGpsID & ',' & $ExpCamName & ',' & $ExpCamFile & ',' & $ExpCamDate & ',' & $ExpCamTime & ',' & $ExpLat & ',' & $ExpLon & ',' & $ExpSat & ',' & $ExpHorDilPitch & ',' & $ExpAlt & ',' & $ExpGeo & ',' & $ExpSpeedKmh & ',' & $ExpSpeedMPH & ',' & $ExpTrack & @CRLF + Next + ;Add cam data to zip + $filetmp = FileOpen($datafiletmp, 128 + 2) ;Open in UTF-8 write mode + FileWrite($filetmp, $file) + FileClose($filetmp) + ;ConsoleWrite($datafiletmp & @CRLF) + ;ConsoleWrite(_Zip_AddItem($exporttmp, $datafiletmp) & '-' & @error & @CRLF) + ;Add cam images folder to zip + _Zip_AddItem($exporttmp, $VistumblerCamFolder) + ;Save tmp export + FileMove($exporttmp, $filename) + FileDelete($datafiletmp) + FileDelete($exporttmp) + Return (1) + Else + Return (0) + EndIf +EndFunc ;==>_ExportCamFile + +Func _CamTrigger() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CamTrigger()') ;#Debug Display + ;ConsoleWrite($CamTriggerScript & @CRLF) + If FileExists($CamTriggerScript) Then + Run($CamTriggerScript) + EndIf +EndFunc ;==>_CamTrigger + +Func _GUI_ImportImageFiles() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GUI_ImportImageFiles()') ;#Debug Display + $GUI_ImportImageFiles = GUICreate("Import Images from folder", 401, 224, 192, 114) + GUICtrlCreateGroup("Import Images from folder", 8, 8, 385, 209) + GUICtrlCreateLabel("Image Group Name", 23, 38, 344, 15) + $GUI_ImgGroupName = GUICtrlCreateInput("", 23, 53, 353, 21) + GUICtrlCreateLabel("Image Directory", 23, 78, 344, 15) + $GUI_ImpImgDir = GUICtrlCreateInput("", 23, 93, 265, 21) + $GUI_ImpBrowse = GUICtrlCreateButton("Browse", 296, 93, 81, 20) + GUICtrlCreateLabel("Skew Image time (in Seconds)", 23, 118, 344, 15) + $GUI_ImpImgSkewTime = GUICtrlCreateInput("0", 23, 133, 353, 21) + + $Button_ImgImp = GUICtrlCreateButton("Import", 88, 168, 97, 33) + $Button_ImgCan = GUICtrlCreateButton("Cancel", 194, 168, 97, 33) + GUICtrlCreateGroup("", -99, -99, 1, 1) + GUICtrlSetOnEvent($Button_ImgImp, '_ImportImageFiles') + GUICtrlSetOnEvent($Button_ImgCan, '_GUI_ImportImageFiles_Close') + GUISetState(@SW_SHOW) +EndFunc ;==>_GUI_ImportImageFiles + +Func _ImportImageFiles() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ImportImageFiles()') ;#Debug Display + $ImgGroupName = GUICtrlRead($GUI_ImgGroupName) + $ImgDir = GUICtrlRead($GUI_ImpImgDir) + $ImgSkewTime = GUICtrlRead($GUI_ImpImgSkewTime) + If FileExists($ImgDir) Then + If StringTrimLeft($ImgDir, StringLen($ImgDir) - 1) <> "\" Then $ImgDir = $ImgDir & "\" ;If directory does not have training \ then add it + $ImgArray = _FileListToArray($ImgDir) + If Not @error Then + $query = "Select COUNT(CamID) FROM Cam WHERE CamName = '" & $ImgGroupName & "'" + $CamCountArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $CamCount = $CamCountArray[1][1] + ;ConsoleWrite($CamCount & @CRLF) + For $ii = 1 To $ImgArray[0] + $imgpath = $ImgDir & $ImgArray[$ii] + $imgmd5 = _MD5ForFile($imgpath) + ;Check if image already exists + $query = "SELECT TOP 1 CamID FROM Cam WHERE ImgMD5='" & $imgmd5 & "'" + ;ConsoleWrite($query & @CRLF) + $ImgMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundImgMatch = UBound($ImgMatchArray) - 1 + If $FoundImgMatch = 0 Then ;If Img is not found, add it + $imgtimearr = FileGetTime($imgpath, 0) + ;ConsoleWrite($imgpath & " " & FileGetTime($imgpath, 1, 1) & @CRLF) + If IsArray($imgtimearr) Then ;Use time to match image up with gps point + ;Convert Time from local time to UTC and into the format vistumbler uses + ;ConsoleWrite($imgtimearr[1] & '-' & $imgtimearr[2] & '-' & $imgtimearr[0] & ' ' & $imgtimearr[3] & ':' & $imgtimearr[4] & ':' & $imgtimearr[5] & @CRLF) + $tSystem = _Date_Time_EncodeSystemTime($imgtimearr[1], $imgtimearr[2], $imgtimearr[0], $imgtimearr[3], $imgtimearr[4], $imgtimearr[5]) + $rTime = _Date_Time_TzSpecificLocalTimeToSystemTime(DllStructGetPtr($tSystem)) + $dts1 = StringSplit(_Date_Time_SystemTimeToDateTimeStr($rTime), ' ') + $dts2 = StringSplit($dts1[1], '/') + $mon = $dts2[1] + $day = $dts2[2] + $year = $dts2[3] + $ImgDateUTC = $year & '-' & $mon & '-' & $day ;Image Date in UTC year-month-day format + $ImgTimeUTC = $dts1[2] ;Image time in UTC Hour:minute:second + ;ConsoleWrite($ImgDateUTC & ' ' & $ImgTimeUTC & @CRLF) + ;Find matching GPS point + $query = "SELECT TOP 1 GPSID FROM GPS WHERE Date1 = '" & $ImgDateUTC & "' And Time1 like '" & $ImgTimeUTC & "%'" + ;ConsoleWrite($query & @CRLF) + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch <> 0 Then ;If a gps id match was found, import the image + $ImgGpsId = $GpsMatchArray[1][1] + $dtfilebase = $ImgDateUTC & ' ' & StringReplace($ImgTimeUTC, ":", "-") + $filename = $dtfilebase & '_' & 'gpsid-' & $ImgGpsId & '_' & $ImgGroupName & '.jpg' + $destfile = $VistumblerCamFolder & $filename + If FileCopy($imgpath, $destfile, 1) = 1 Then + $CamID += 1 + $CamCount += 1 + _AddRecord($VistumblerDB, "Cam", $DB_OBJ, $CamID & '|' & $CamCount & '|' & $ImgGpsId & '|' & $ImgGroupName & '|' & $filename & '|' & $imgmd5 & '|' & $ImgDateUTC & '|' & $ImgTimeUTC) + EndIf + Else ; just echo it out for now + ;ConsoleWrite("No gps match found for image " & $imgpath & @CRLF) + EndIf + EndIf + EndIf + Next + EndIf + EndIf +EndFunc ;==>_ImportImageFiles + +Func _GUI_ImportImageFiles_Close() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GUI_ImportImageFiles_Close()') ;#Debug Display + GUIDelete($GUI_ImportImageFiles) +EndFunc ;==>_GUI_ImportImageFiles_Close + +Func _RemoveNonMatchingImages() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_RemoveNonMatchingImages()') ;#Debug Display + $query = "SELECT CamName FROM Cam" + ;ConsoleWrite($query & @CRLF) + $CamNameArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $CamNameMatch = UBound($CamNameArray) - 1 + If $CamNameMatch = 0 Then ;If Img is not found, add it + EndIf +EndFunc ;==>_RemoveNonMatchingImages + +;------------------------------------------------------------------------------------------------------------------------------- +; MATH FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func Log10($x) + Return Log($x) / Log(10) ;10 is the base +EndFunc ;==>Log10 + +Func _MetersToFeet($meters) + $feet = $meters / 3.28 + Return ($feet) +EndFunc ;==>_MetersToFeet + +Func _deg2rad($Degree) ;convert degrees to radians + Local $PI = 3.14159265358979 + Return ($Degree * ($PI / 180)) +EndFunc ;==>_deg2rad + +Func _rad2deg($radian) ;convert radians to degrees + Local $PI = 3.14159265358979 + Return ($radian * (180 / $PI)) +EndFunc ;==>_rad2deg + +Func _SignalPercentToDb($InSig) ;Estimated value + $dBm = ((($dBmMaxSignal - $dBmDissociationSignal) * $InSig) - (20 * $dBmMaxSignal) + (100 * $dBmDissociationSignal)) / 80 + Return (Round($dBm)) +EndFunc ;==>_SignalPercentToDb + +Func _DbToSignalPercent($InDB) ;Estimated value + $SIG = 100 - 80 * ($dBmMaxSignal - $InDB) / ($dBmMaxSignal - $dBmDissociationSignal) + If $SIG < 0 Then $SIG = 0 + Return (Round($SIG)) +EndFunc ;==>_DbToSignalPercent + +;------------------------------------------------------------------------------------------------------------------------------- +; DATE / TIME FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func _DateTimeUtcConvert($Date, $time, $ConvertToUTC) + Local $mon, $d, $y, $h, $m, $s, $ms + $DateSplit = StringSplit($Date, '-') + $TimeSplit = StringSplit($time, ':') + If $DateSplit[0] = 3 And $TimeSplit[0] = 3 Then + If StringInStr($TimeSplit[3], '.') Then + $SecMsSplit = StringSplit($TimeSplit[3], '.') + $s = $SecMsSplit[1] + $ms = $SecMsSplit[2] + Else + $s = $TimeSplit[3] + $ms = '000' + EndIf + $tSystem = _Date_Time_EncodeSystemTime($DateSplit[2], $DateSplit[3], $DateSplit[1], $TimeSplit[1], $TimeSplit[2], $s) + If $ConvertToUTC = 1 Then + $rTime = _Date_Time_TzSpecificLocalTimeToSystemTime(DllStructGetPtr($tSystem)) + Else + $rTime = _Date_Time_SystemTimeToTzSpecificLocalTime(DllStructGetPtr($tSystem)) + EndIf + $dts1 = StringSplit(_Date_Time_SystemTimeToDateTimeStr($rTime), ' ') + $dts2 = StringSplit($dts1[1], '/') + $dts3 = StringSplit($dts1[2], ':') + $mon = $dts2[1] + $d = $dts2[2] + $y = $dts2[3] + $h = $dts3[1] + $m = $dts3[2] + $s = $dts3[3] + Return ($y & '-' & $mon & '-' & $d & ' ' & $h & ':' & $m & ':' & $s & '.' & $ms) + Else + Return ('0000-00-00 00:00:00.000') + EndIf +EndFunc ;==>_DateTimeUtcConvert + +Func _DateTimeLocalFormat($DateTimeString) + $dta = StringSplit($DateTimeString, ' ') + $ds = _DateLocalFormat($dta[1]) + Return ($ds & ' ' & $dta[2]) +EndFunc ;==>_DateTimeLocalFormat + +Func _DateLocalFormat($DateString) + If StringInStr($DateString, '/') Then + $da = StringSplit($DateString, '/') + $y = $da[1] + $m = $da[2] + $d = $da[3] + Return (StringReplace(StringReplace(StringReplace($DateFormat, 'M', $m), 'd', $d), 'yyyy', $y)) + ElseIf StringInStr($DateString, '-') Then + $da = StringSplit($DateString, '-') + $y = $da[1] + $m = $da[2] + $d = $da[3] + Return (StringReplace(StringReplace(StringReplace(StringReplace($DateFormat, 'M', $m), 'd', $d), 'yyyy', $y), '/', '-')) + EndIf +EndFunc ;==>_DateLocalFormat + +Func _CompareDate($d1, $d2) ;If $d1 is greater than $d2, return 1 ELSE return 2 + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_CompareDate()') ;#Debug Display + + $d1 = StringReplace(StringReplace(StringReplace(StringReplace(StringReplace($d1, '-', ''), '/', ''), ':', ''), ':', ''), ' ', '') + $d2 = StringReplace(StringReplace(StringReplace(StringReplace(StringReplace($d2, '-', ''), '/', ''), ':', ''), ':', ''), ' ', '') + If $d1 = $d2 Then + Return (0) + ElseIf $d1 > $d2 Then + Return (1) + ElseIf $d1 < $d2 Then + Return (2) + Else + Return (-1) + EndIf + +EndFunc ;==>_CompareDate + +Func _TimeToSeconds($iTime) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_TimeToSeconds()') ;#Debug Display + $dts = StringSplit($iTime, ":") ;Split time so it can be converted to seconds + $rTime = ($dts[1] * 3600) + ($dts[2] * 60) + $dts[3] ;In seconds + Return ($rTime) +EndFunc ;==>_TimeToSeconds + +Func _DecToMinSec($dec) ;Convert a decimal value of time to "(XX)XXm XXsec" format + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_DecToMinSec()') ;#Debug Display + $Mins = Int($dec) + $Secs = ($dec - $Mins) * 60 + $rettime = Round($Mins) & "m " & Round($Secs) & "s" + Return ($rettime) +EndFunc ;==>_DecToMinSec + +Func RGB2BGR($iColor) + If StringLen($iColor) = 8 Then + $r = StringMid($iColor, 3, 2) + $g = StringMid($iColor, 5, 2) + $b = StringMid($iColor, 7, 2) + Return ('0x' & $b & $g & $r) + Else + SetError(1) + Return ('0xFFFFFF') + EndIf +EndFunc ;==>RGB2BGR +;------------------------------------------------------------------------------------------------------------------------------- +; OTHER FUNCTIONS +;------------------------------------------------------------------------------------------------------------------------------- + +Func MyErrFunc() + $ComError = 1 + If $DebugCom = 1 Then + MsgBox(0, $Text_Error, "We intercepted a COM Error !" & @CRLF & @CRLF & _ + "err.description is: " & @TAB & $oMyError.description & @CRLF & _ + "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ + "err.number is: " & @TAB & Hex($oMyError.number, 8) & @CRLF & _ + "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ + "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ + "err.source is: " & @TAB & $oMyError.source & @CRLF & _ + "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ + "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ + ) + EndIf +EndFunc ;==>MyErrFunc + +Func _ReduceMemory() ;http://www.autoitscript.com/forum/index.php?showtopic=14070&view=findpost&p=96101 + DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) +EndFunc ;==>_ReduceMemory + +Func _NewSession() + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_NewSession()') ;#Debug Display + Run(@ScriptDir & "\Vistumbler.exe") +EndFunc ;==>_NewSession + +Func _CleanupFiles($cDIR, $cTYPE) + $Tmpfiles = _FileListToArray($cDIR, $cTYPE, 1) ;Find all files in the folder that end in .tmp + If IsArray($Tmpfiles) Then + For $FoundTmp = 1 To $Tmpfiles[0] + $tmpname = $TmpDir & $Tmpfiles[$FoundTmp] + If _FileInUse($tmpname) = 0 Then FileDelete($tmpname) + Next + EndIf +EndFunc ;==>_CleanupFiles + +Func _ExportSettings() + $file = FileSaveDialog($Text_ExportVistumblerSettings, $SaveDir, $Text_VistumblerSettings & ' (*.ini)', $FD_PATHMUSTEXIST + $FD_PROMPTOVERWRITE, "vistumbler_settings.ini") + If Not @error Then + $Copy = FileCopy($settings, $file, 1) + If $Copy = 1 And FileExists($file) Then + MsgBox(0, $Text_Information, $Text_SavedAs & ' "' & $file & '"') + Else + MsgBox(0, $Text_Error, $Text_ErrorSavingFile) + EndIf + EndIf +EndFunc ;==>_ExportSettings + +Func _ImportSettings() + $file = FileOpenDialog($Text_ImportVistumblerSettings, $SaveDir, $Text_VistumblerSettings & ' (*.ini)', 1) + If Not @error Then + $Copy = FileCopy($file, $settings, 1) + If $Copy = 1 And FileExists($settings) Then + MsgBox(0, $Text_Information, $Text_SettingsImportedSuccess) + _Exit(0) + Else + MsgBox(0, $Text_Error, $Text_ErrorImportingFile) + EndIf + EndIf +EndFunc ;==>_ImportSettings diff --git a/Installer/vi_files/Vistumbler.exe b/Installer/vi_files/Vistumbler.exe new file mode 100644 index 00000000..1e6e01ef Binary files /dev/null and b/Installer/vi_files/Vistumbler.exe differ diff --git a/Installer/vi_files/commg.dll b/Installer/vi_files/commg.dll new file mode 100644 index 00000000..8b6ed322 Binary files /dev/null and b/Installer/vi_files/commg.dll differ diff --git a/Installer/vi_files/macmanuf.exe b/Installer/vi_files/macmanuf.exe new file mode 100644 index 00000000..b3e841e1 Binary files /dev/null and b/Installer/vi_files/macmanuf.exe differ diff --git a/Installer/vi_files/say.au3 b/Installer/vi_files/say.au3 new file mode 100644 index 00000000..970fbdbf --- /dev/null +++ b/Installer/vi_files/say.au3 @@ -0,0 +1,387 @@ +#NoTrayIcon +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Icon=Icons\icon.ico +#AutoIt3Wrapper_Run_Tidy=y +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** +;License Information------------------------------------ +;Copyright (C) 2019 Andrew Calcutt +;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; Version 2 of the License. +;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +;You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +;-------------------------------------------------------- +;AutoIt Version: v3.3.15.1 +$Script_Author = 'Andrew Calcutt' +$Script_Start_Date = '07/19/2008' +$Script_Name = 'SayText' +$Script_Website = 'http://www.Vistumbler.net' +$Script_Function = 'Uses Sound files, Microsoft SAPI, or MIDI sounds to say a number from 0 - 100' +$version = 'v5.1' +$last_modified = '2016/03/06' +;-------------------------------------------------------- +#include +#include "UDFs\MIDIFunctions.au3" +#include "UDFs\MIDIConstants.au3" + +Dim $Default_settings = @ScriptDir & '\Settings\vistumbler_settings.ini' +Dim $Profile_settings = @AppDataDir & '\Vistumbler\vistumbler_settings.ini' +Dim $PortableMode = IniRead($Default_settings, 'Vistumbler', 'PortableMode', 0) +If $PortableMode = 1 Then + $settings = $Default_settings +Else + $settings = $Profile_settings + If FileExists($Default_settings) And FileExists($settings) = 0 Then FileCopy($Default_settings, $settings, 1) +EndIf + +Dim $SoundDir = @ScriptDir & '\Sounds\' +Dim $new_AP_sound = IniRead($settings, 'Sound', 'NewAP_Sound', 'new_ap.wav') +Dim $say = 'test' +Dim $midistring = '' +Dim $type = 2 +Dim $SayPercent = 0 +Dim $Instrument = 0 +Dim $MidiWaitTime = 500 + + +;<-- Start Command Line Input --> +For $loop = 1 To $CmdLine[0] + If StringInStr($CmdLine[$loop], '/s') Then + $saysplit = StringSplit($CmdLine[$loop], '=') + $say = $saysplit[2] + EndIf + If StringInStr($CmdLine[$loop], '/ms') Then + $midistringsplit = StringSplit($CmdLine[$loop], '=') + $midistring = $midistringsplit[2] + EndIf + If StringInStr($CmdLine[$loop], '/t') Then + $typesplit = StringSplit($CmdLine[$loop], '=') + $type = $typesplit[2] + EndIf + If StringInStr($CmdLine[$loop], '/p') Then + $SayPercent = 1 + EndIf + If StringInStr($CmdLine[$loop], '/i') Then + $instumentsplit = StringSplit($CmdLine[$loop], '=') + $Instrument = $instumentsplit[2] + EndIf + If StringInStr($CmdLine[$loop], '/w') Then + $waitsplit = StringSplit($CmdLine[$loop], '=') + $MidiWaitTime = $waitsplit[2] + EndIf + If StringInStr($CmdLine[$loop], '/?') Then + MsgBox(0, '', '/s="thing to say"' & @CRLF & @CRLF & '/t=1 Vistumbler Sounds' & @CRLF & '/t=2 Microsoft SAPI' & @CRLF & '/t=3 Midi' & @CRLF & @CRLF & '/i= Midi Instrument number' & @CRLF & @CRLF & '/w= Midi Instrument play time' & @CRLF & @CRLF & '/p say percent') + Exit + EndIf +Next +;<-- End Command Line Input --> + +If $say <> '' Or $midistring <> '' Then + If $type = 1 Then + If StringIsInt($say) = 1 And StringLen($say) <= 3 Then _SpeakSignal($say) + ElseIf $type = 2 Then + If $SayPercent = 1 Then $say &= '%' + ConsoleWrite($say & @CRLF) + _TalkOBJ($say) + ElseIf $type = 3 Then + _PlayMidi($Instrument, $say, $MidiWaitTime) + ElseIf $type = 4 Then + $midistringarray = StringSplit($midistring, '-') + For $l = 1 To $midistringarray[0] + _PlayMidi($Instrument, $midistringarray[$l], $MidiWaitTime) + Next + ElseIf $type = 5 Then + _SigBasedSound($say) + EndIf +EndIf +Exit + +Func _TalkOBJ($s_text) + Local $o_speech = ObjCreate("SAPI.SpVoice") + $o_speech.Speak($s_text) + $o_speech = "" +EndFunc ;==>_TalkOBJ + +Func _SpeakSignal($SpeakNum) ;Says then signal given + $SpeakSplit = StringSplit(StringReverse($SpeakNum), '') + $OnesPlayed = 0 + If $SpeakSplit[0] = 3 Then + If $SpeakSplit[3] = 1 Then SoundPlay($SoundDir & 'one.wav', 1) + SoundPlay($SoundDir & 'hundred.wav', 1) + EndIf + If $SpeakSplit[0] >= 2 Then + If $SpeakSplit[2] = 1 Then + If $SpeakSplit[2] & $SpeakSplit[1] = 10 Then + SoundPlay($SoundDir & 'ten.wav', 1) + ElseIf $SpeakSplit[2] & $SpeakSplit[1] = 11 Then + SoundPlay($SoundDir & 'eleven.wav', 1) + ElseIf $SpeakSplit[2] & $SpeakSplit[1] = 12 Then + SoundPlay($SoundDir & 'twelve.wav', 1) + ElseIf $SpeakSplit[2] & $SpeakSplit[1] = 13 Then + SoundPlay($SoundDir & 'thirteen.wav', 1) + ElseIf $SpeakSplit[2] & $SpeakSplit[1] = 14 Then + SoundPlay($SoundDir & 'fourteen.wav', 1) + ElseIf $SpeakSplit[2] & $SpeakSplit[1] = 15 Then + SoundPlay($SoundDir & 'fifteen.wav', 1) + ElseIf $SpeakSplit[2] & $SpeakSplit[1] = 16 Then + SoundPlay($SoundDir & 'sixteen.wav', 1) + ElseIf $SpeakSplit[2] & $SpeakSplit[1] = 17 Then + SoundPlay($SoundDir & 'seventeen.wav', 1) + ElseIf $SpeakSplit[2] & $SpeakSplit[1] = 18 Then + SoundPlay($SoundDir & 'eightteen.wav', 1) + ElseIf $SpeakSplit[2] & $SpeakSplit[1] = 19 Then + SoundPlay($SoundDir & 'nineteen.wav', 1) + EndIf + $OnesPlayed = 1 + ElseIf $SpeakSplit[2] = 2 Then + SoundPlay($SoundDir & 'twenty.wav', 1) + ElseIf $SpeakSplit[2] = 3 Then + SoundPlay($SoundDir & 'thirty.wav', 1) + ElseIf $SpeakSplit[2] = 4 Then + SoundPlay($SoundDir & 'fourty.wav', 1) + ElseIf $SpeakSplit[2] = 5 Then + SoundPlay($SoundDir & 'fifty.wav', 1) + ElseIf $SpeakSplit[2] = 6 Then + SoundPlay($SoundDir & 'sixty.wav', 1) + ElseIf $SpeakSplit[2] = 7 Then + SoundPlay($SoundDir & 'seventy.wav', 1) + ElseIf $SpeakSplit[2] = 8 Then + SoundPlay($SoundDir & 'eighty.wav', 1) + ElseIf $SpeakSplit[2] = 9 Then + SoundPlay($SoundDir & 'ninety.wav', 1) + EndIf + EndIf + If $SpeakSplit[0] >= 1 Then + If $OnesPlayed = 0 Then + If $SpeakSplit[1] = 0 And $SpeakSplit[0] = 1 Then + SoundPlay($SoundDir & 'zero.wav', 1) + ElseIf $SpeakSplit[1] = 1 Then + SoundPlay($SoundDir & 'one.wav', 1) + ElseIf $SpeakSplit[1] = 2 Then + SoundPlay($SoundDir & 'two.wav', 1) + ElseIf $SpeakSplit[1] = 3 Then + SoundPlay($SoundDir & 'three.wav', 1) + ElseIf $SpeakSplit[1] = 4 Then + SoundPlay($SoundDir & 'four.wav', 1) + ElseIf $SpeakSplit[1] = 5 Then + SoundPlay($SoundDir & 'five.wav', 1) + ElseIf $SpeakSplit[1] = 6 Then + SoundPlay($SoundDir & 'six.wav', 1) + ElseIf $SpeakSplit[1] = 7 Then + SoundPlay($SoundDir & 'seven.wav', 1) + ElseIf $SpeakSplit[1] = 8 Then + SoundPlay($SoundDir & 'eight.wav', 1) + ElseIf $SpeakSplit[1] = 9 Then + SoundPlay($SoundDir & 'nine.wav', 1) + EndIf + EndIf + EndIf + If $SayPercent = 1 Then SoundPlay($SoundDir & 'percent.wav', 1) +EndFunc ;==>_SpeakSignal + +Func _PlayMidi($Instrument = 0, $Signal = 0, $Sleeptime = 500) + $Pitch = '' + ;Pick Start/Stop Varialbles based on signal + If $Signal > 0 And $Signal < 10 Then + $Pitch = $NOTE_A0 + ElseIf $Signal >= 10 And $Signal < 15 Then + $Pitch = $NOTE_A0SHARP + ElseIf $Signal = 15 Then + $Pitch = $NOTE_B0 + ElseIf $Signal = 16 Then + $Pitch = $NOTE_C1 + ElseIf $Signal = 17 Then + $Pitch = $NOTE_C1SHARP + ElseIf $Signal = 18 Then + $Pitch = $NOTE_D1 + ElseIf $Signal = 19 Then + $Pitch = $NOTE_D1SHARP + ElseIf $Signal = 20 Then + $Pitch = $NOTE_E1 + ElseIf $Signal = 21 Then + $Pitch = $NOTE_F1 + ElseIf $Signal = 22 Then + $Pitch = $NOTE_F1SHARP + ElseIf $Signal = 23 Then + $Pitch = $NOTE_G1 + ElseIf $Signal = 24 Then + $Pitch = $NOTE_G1SHARP + ElseIf $Signal = 25 Then + $Pitch = $NOTE_A1 + ElseIf $Signal = 26 Then + $Pitch = $NOTE_A1SHARP + ElseIf $Signal = 27 Then + $Pitch = $NOTE_B1 + ElseIf $Signal = 28 Then + $Pitch = $NOTE_C2 + ElseIf $Signal = 29 Then + $Pitch = $NOTE_C2SHARP + ElseIf $Signal = 30 Then + $Pitch = $NOTE_D2 + ElseIf $Signal = 31 Then + $Pitch = $NOTE_D2SHARP + ElseIf $Signal = 32 Then + $Pitch = $NOTE_E2 + ElseIf $Signal = 33 Then + $Pitch = $NOTE_F2 + ElseIf $Signal = 34 Then + $Pitch = $NOTE_F2SHARP + ElseIf $Signal = 35 Then + $Pitch = $NOTE_G2 + ElseIf $Signal = 36 Then + $Pitch = $NOTE_G2SHARP + ElseIf $Signal = 37 Then + $Pitch = $NOTE_A2 + ElseIf $Signal = 38 Then + $Pitch = $NOTE_A2SHARP + ElseIf $Signal = 39 Then + $Pitch = $NOTE_B2 + ElseIf $Signal = 40 Then + $Pitch = $NOTE_C3 + ElseIf $Signal = 41 Then + $Pitch = $NOTE_C3SHARP + ElseIf $Signal = 42 Then + $Pitch = $NOTE_D3 + ElseIf $Signal = 43 Then + $Pitch = $NOTE_D3SHARP + ElseIf $Signal = 44 Then + $Pitch = $NOTE_E3 + ElseIf $Signal = 45 Then + $Pitch = $NOTE_F3 + ElseIf $Signal = 46 Then + $Pitch = $NOTE_F3SHARP + ElseIf $Signal = 47 Then + $Pitch = $NOTE_G3 + ElseIf $Signal = 48 Then + $Pitch = $NOTE_G3SHARP + ElseIf $Signal = 49 Then + $Pitch = $NOTE_A3 + ElseIf $Signal = 50 Then + $Pitch = $NOTE_A3SHARP + ElseIf $Signal = 51 Then + $Pitch = $NOTE_B3 + ElseIf $Signal = 52 Then + $Pitch = $NOTE_C4 + ElseIf $Signal = 53 Then + $Pitch = $NOTE_C4SHARP + ElseIf $Signal = 54 Then + $Pitch = $NOTE_D4 + ElseIf $Signal = 55 Then + $Pitch = $NOTE_D4SHARP + ElseIf $Signal = 56 Then + $Pitch = $NOTE_E4 + ElseIf $Signal = 57 Then + $Pitch = $NOTE_F4 + ElseIf $Signal = 58 Then + $Pitch = $NOTE_F4SHARP + ElseIf $Signal = 59 Then + $Pitch = $NOTE_G4 + ElseIf $Signal = 60 Then + $Pitch = $NOTE_G4SHARP + ElseIf $Signal = 61 Then + $Pitch = $NOTE_A4 + ElseIf $Signal = 62 Then + $Pitch = $NOTE_A4SHARP + ElseIf $Signal = 63 Then + $Pitch = $NOTE_B4 + ElseIf $Signal = 64 Then + $Pitch = $NOTE_C5 + ElseIf $Signal = 65 Then + $Pitch = $NOTE_C5SHARP + ElseIf $Signal = 66 Then + $Pitch = $NOTE_D5 + ElseIf $Signal = 67 Then + $Pitch = $NOTE_D5SHARP + ElseIf $Signal = 68 Then + $Pitch = $NOTE_E5 + ElseIf $Signal = 69 Then + $Pitch = $NOTE_F5 + ElseIf $Signal = 70 Then + $Pitch = $NOTE_F5SHARP + ElseIf $Signal = 71 Then + $Pitch = $NOTE_G5 + ElseIf $Signal = 72 Then + $Pitch = $NOTE_G5SHARP + ElseIf $Signal = 73 Then + $Pitch = $NOTE_A5 + ElseIf $Signal = 74 Then + $Pitch = $NOTE_A5SHARP + ElseIf $Signal = 75 Then + $Pitch = $NOTE_B5 + ElseIf $Signal = 76 Then + $Pitch = $NOTE_C6 + ElseIf $Signal = 77 Then + $Pitch = $NOTE_C6SHARP + ElseIf $Signal = 78 Then + $Pitch = $NOTE_D6 + ElseIf $Signal = 79 Then + $Pitch = $NOTE_D6SHARP + ElseIf $Signal = 80 Then + $Pitch = $NOTE_E6 + ElseIf $Signal = 81 Then + $Pitch = $NOTE_F6 + ElseIf $Signal = 82 Then + $Pitch = $NOTE_F6SHARP + ElseIf $Signal = 83 Then + $Pitch = $NOTE_G6 + ElseIf $Signal = 84 Then + $Pitch = $NOTE_G6SHARP + ElseIf $Signal = 85 Then + $Pitch = $NOTE_A6 + ElseIf $Signal = 86 Then + $Pitch = $NOTE_A6SHARP + ElseIf $Signal = 87 Then + $Pitch = $NOTE_B6 + ElseIf $Signal = 88 Then + $Pitch = $NOTE_C7 + ElseIf $Signal = 89 Then + $Pitch = $NOTE_C7SHARP + ElseIf $Signal = 90 Then + $Pitch = $NOTE_D7 + ElseIf $Signal = 91 Then + $Pitch = $NOTE_D7SHARP + ElseIf $Signal = 92 Then + $Pitch = $NOTE_E7 + ElseIf $Signal = 93 Then + $Pitch = $NOTE_F7 + ElseIf $Signal = 94 Then + $Pitch = $NOTE_F7SHARP + ElseIf $Signal = 95 Then + $Pitch = $NOTE_G7 + ElseIf $Signal = 96 Then + $Pitch = $NOTE_G7SHARP + ElseIf $Signal = 97 Then + $Pitch = $NOTE_A7 + ElseIf $Signal = 98 Then + $Pitch = $NOTE_A7SHARP + ElseIf $Signal = 99 Then + $Pitch = $NOTE_B7 + ElseIf $Signal = 100 Then + $Pitch = $NOTE_C8 + EndIf + If $Pitch <> '' Then + $open = _midiOutOpen() + MidiSetInstrument($open, $Instrument) ;Select Instrument + NoteOn($open, $Pitch, 1, $MIDI_MAX_VALUE) ;Start playing Instrument + Sleep($Sleeptime) + NoteOff($open, $Pitch, 1, $MIDI_MAX_VALUE) ;Stop playing Instrument + _MidiOutClose($open) + EndIf +EndFunc ;==>_PlayMidi + +Func _SigBasedSound($volume) + If $volume >= 1 And $volume <= 20 Then + SoundSetWaveVolume(20) + SoundPlay($SoundDir & $new_AP_sound, 1) + ElseIf $volume >= 21 And $volume <= 40 Then + SoundSetWaveVolume(40) + SoundPlay($SoundDir & $new_AP_sound, 1) + ElseIf $volume >= 41 And $volume <= 60 Then + SoundSetWaveVolume(60) + SoundPlay($SoundDir & $new_AP_sound, 1) + ElseIf $volume >= 61 And $volume <= 80 Then + SoundSetWaveVolume(80) + SoundPlay($SoundDir & $new_AP_sound, 1) + ElseIf $volume >= 81 And $volume <= 100 Then + SoundSetWaveVolume(100) + SoundPlay($SoundDir & $new_AP_sound, 1) + EndIf +EndFunc ;==>_SigBasedSound diff --git a/Installer/vi_files/say.exe b/Installer/vi_files/say.exe new file mode 100644 index 00000000..013ed715 Binary files /dev/null and b/Installer/vi_files/say.exe differ diff --git a/Installer/vi_files/sqlite3.dll b/Installer/vi_files/sqlite3.dll new file mode 100644 index 00000000..82af1696 Binary files /dev/null and b/Installer/vi_files/sqlite3.dll differ diff --git a/Installer/vi_files/update.au3 b/Installer/vi_files/update.au3 new file mode 100644 index 00000000..0f5e01c6 --- /dev/null +++ b/Installer/vi_files/update.au3 @@ -0,0 +1,272 @@ +#RequireAdmin +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Icon=Icons\icon.ico +#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator +#AutoIt3Wrapper_Run_Tidy=y +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** +;License Information------------------------------------ +;Copyright (C) 2019 Andrew Calcutt +;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; Version 2 of the License. +;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +;You should have received a copy of the GNU General Public License along with this program; If not, see . +;-------------------------------------------------------- +;AutoIt Version: v3.3.15.1 +$Script_Author = 'Andrew Calcutt' +$Script_Name = 'Vistumbler Updater' +$Script_Website = 'http://www.Vistumbler.net' +$Script_Function = 'Updates Vistumbler from git based on version.ini' +$version = 'v10' +$origional_date = '2010/09/01' +$last_modified = '2015/03/05' +HttpSetUserAgent($Script_Name & ' ' & $version) +;-------------------------------------------------------- +#include +#include +#include +#include + +Dim $TmpDir = @TempDir & '\Vistumbler\' +DirCreate($TmpDir) + +Dim $Default_settings = @ScriptDir & '\Settings\vistumbler_settings.ini' +Dim $Profile_settings = @AppDataDir & '\Vistumbler\vistumbler_settings.ini' +Dim $PortableMode = IniRead($Default_settings, 'Vistumbler', 'PortableMode', 0) +If $PortableMode = 1 Then + $settings = $Default_settings +Else + $settings = $Profile_settings + If FileExists($Default_settings) And FileExists($settings) = 0 Then FileCopy($Default_settings, $settings, 1) +EndIf + +Dim $Errors +Dim $NewFiles +Dim $NewVersionFile = $TmpDir & 'versions.ini' +Dim $CurrentVersionFile = @ScriptDir & '\versions.ini' +Dim $GIT_ROOT = 'https://raw.github.com/acalcutt/Vistumbler/' +Dim $CheckForBetaUpdates = IniRead($settings, 'Vistumbler', 'CheckForBetaUpdates', 0) +Dim $TextColor = IniRead($settings, 'Vistumbler', 'TextColor', "0x000000") +Dim $BackgroundColor = IniRead($settings, 'Vistumbler', 'BackgroundColor', "0x99B4A1") +Dim $ControlBackgroundColor = IniRead($settings, 'Vistumbler', 'ControlBackgroundColor', "0xD7E4C2") + +;Set GUI text based on default language +Dim $LanguageDir = @ScriptDir & '\Languages\' +Dim $DefaultLanguageFile = IniRead($settings, 'Vistumbler', 'LanguageFile', 'English.ini') +Dim $DefaultLanguagePath = $LanguageDir & $DefaultLanguageFile +If FileExists($DefaultLanguagePath) = 0 Then + $DefaultLanguageFile = 'English.ini' + $DefaultLanguagePath = $LanguageDir & $DefaultLanguageFile +EndIf +Dim $Text_Done = IniRead($DefaultLanguagePath, 'GuiText', 'Done', 'Done') +Dim $Text_Error = IniRead($DefaultLanguagePath, 'GuiText', 'Error', 'Error') +Dim $Text_Updating = IniRead($DefaultLanguagePath, 'GuiText', 'Updating', 'Updating') +Dim $Text_Downloaded = IniRead($DefaultLanguagePath, 'GuiText', 'Downloaded', 'Downloaded') +Dim $Text_Retry = IniRead($DefaultLanguagePath, 'GuiText', 'Retry', 'Retry') +Dim $Text_Ignore = IniRead($DefaultLanguagePath, 'GuiText', 'Ignore', 'Ignore') +Dim $Text_Yes = IniRead($DefaultLanguagePath, 'GuiText', 'Yes', 'Yes') +Dim $Text_No = IniRead($DefaultLanguagePath, 'GuiText', 'No', 'No') +Dim $Text_LoadingVersionsFile = IniRead($DefaultLanguagePath, 'GuiText', 'LoadingVersionsFile', 'Loading Versions File') +Dim $Text_UsingLocalFile = IniRead($DefaultLanguagePath, 'GuiText', 'UsingLocalFile', 'Using local file') +Dim $Text_DownloadingBetaVerFile = IniRead($DefaultLanguagePath, 'GuiText', 'DownloadingBetaVerFile', 'Downloading beta versions file') +Dim $Text_DownloadingVerFile = IniRead($DefaultLanguagePath, 'GuiText', 'DownloadingVerFile', 'Downloading versions file') +Dim $Text_VerFileDownloaded = IniRead($DefaultLanguagePath, 'GuiText', 'VerFileDownloaded', 'Versions file downloaded') +Dim $Text_ErrDownloadVerFile = IniRead($DefaultLanguagePath, 'GuiText', 'ErrDownloadVerFile', 'Error downloading versions file') +Dim $Text_NewFile = IniRead($DefaultLanguagePath, 'GuiText', 'NewFile', 'New file') +Dim $Text_UpdatedFile = IniRead($DefaultLanguagePath, 'GuiText', 'UpdatedFile', 'Updated File') +Dim $Text_ErrCopyingFile = IniRead($DefaultLanguagePath, 'GuiText', 'ErrCopyingFile', 'Error copying file') +Dim $Text_ErrReplacaingOldFile = IniRead($DefaultLanguagePath, 'GuiText', 'ErrReplacaingOldFile', 'Error replacing old file (Possibly in use)') +Dim $Text_ErrDownloadingNewFile = IniRead($DefaultLanguagePath, 'GuiText', 'ErrDownloadingNewFile', 'Error downloading new file') +Dim $Text_NoChangeInFile = IniRead($DefaultLanguagePath, 'GuiText', 'NoChangeInFile', 'No change in file') +Dim $Text_DeletedFile = IniRead($DefaultLanguagePath, 'GuiText', 'DeletedFile', 'Deleted file') +Dim $Text_ErrDeletingFile = IniRead($DefaultLanguagePath, 'GuiText', 'ErrDeletingFile', 'Error deleting file') +Dim $Text_ErrWouldYouLikeToRetryUpdate = IniRead($DefaultLanguagePath, 'GuiText', 'ErrWouldYouLikeToRetryUpdate', 'Error. Would you like to retry the update?') +Dim $Text_DoneWouldYouLikeToLoadVistumbler = IniRead($DefaultLanguagePath, 'GuiText', 'DoneWouldYouLikeToLoadVistumbler', 'Done. Would you like to load vistumbler?') + +$UpdateGUI = GUICreate($Script_Name & ' ' & $version, 350, 300, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) +$data = $Text_LoadingVersionsFile +GUISetBkColor($BackgroundColor) +$datalabel = GUICtrlCreateLabel("", 10, 10, 330, 15) +GUICtrlSetColor(-1, $TextColor) +$UpdateEdit = GUICtrlCreateEdit($data, 10, 30, 330, 260) +GUICtrlSetBkColor(-1, $ControlBackgroundColor) +GUISetState(@SW_SHOW) + +FileDelete($NewVersionFile) +If $CheckForBetaUpdates = 1 Then + $data = $Text_DownloadingBetaVerFile & @CRLF & $data + GUICtrlSetData($UpdateEdit, $data) + $get = InetGet($GIT_ROOT & 'beta/VistumblerMDB/versions.ini', $NewVersionFile, 1) + If $get = 0 Then FileDelete($NewVersionFile) +Else + $data = $Text_DownloadingVerFile & @CRLF & $data + GUICtrlSetData($UpdateEdit, $data) + $get = InetGet($GIT_ROOT & 'master/VistumblerMDB/versions.ini', $NewVersionFile, 1) + If $get = 0 Then FileDelete($NewVersionFile) +EndIf +If FileExists($NewVersionFile) Then + $data = $Text_VerFileDownloaded & @CRLF & $data + GUICtrlSetData($UpdateEdit, $data) +Else + $data = $Text_ErrDownloadVerFile & @CRLF & $data + GUICtrlSetData($UpdateEdit, $data) +EndIf + +If FileExists($NewVersionFile) Then + $fv = IniReadSection($NewVersionFile, "FileVersions") + If Not @error Then + For $i = 1 To $fv[0][0] + $filename = $fv[$i][0] + $filename_web = StringReplace($filename, '\', '/') + $version = $fv[$i][1] + If $filename <> 'update.exe' Then + If IniRead($CurrentVersionFile, "FileVersions", $filename, '0') <> $version Or FileExists(@ScriptDir & '\' & $filename) = 0 Then + If StringInStr($filename, '\') Then + $struct = StringSplit($filename, '\') + For $cp = 1 To $struct[0] - 1 + If $cp = 1 Then + $dirstruct = $struct[$cp] + Else + $dirstruct &= '\' & $struct[$cp] + EndIf + DirCreate(@ScriptDir & '\' & $dirstruct) + DirCreate($TmpDir & $dirstruct) + Next + EndIf + $sourcefile = $GIT_ROOT & $version & '/VistumblerMDB/' & $filename_web + ;ConsoleWrite($sourcefile & @CRLF) + $desttmpfile = $TmpDir & $filename & '.tmp' + $destfile = @ScriptDir & '\' & $filename + GUICtrlSetData($datalabel, 'Downloading ' & $filename) + $get = InetGet($sourcefile, $desttmpfile, 1) + If $get = 0 Then ;Download Failed + GUICtrlSetData($datalabel, 'Downloading ' & $filename & ' failed') + $data = $Text_ErrDownloadingNewFile & ':' & $filename & @CRLF & $data + $Errors &= $Text_ErrDownloadingNewFile & ':' & $filename & @CRLF + GUICtrlSetData($UpdateEdit, $data) + FileDelete($NewVersionFile) + Else ;Download Succesful + GUICtrlSetData($datalabel, 'Downloading ' & $filename & ' successful') + $ExistingFile = 0 + If FileExists($destfile) Then + $ExistingFile = 1 + FileDelete($destfile) + EndIf + If FileMove($desttmpfile, $destfile, 9) = 1 Then + If $ExistingFile = 0 Then + $data = $Text_NewFile & ':' & $filename & @CRLF & $data + $NewFiles &= $Text_NewFile & ':' & $filename & @CRLF + Else + $data = $Text_UpdatedFile & ':' & $filename & @CRLF & $data + $NewFiles &= $Text_UpdatedFile & ':' & $filename & @CRLF + EndIf + IniWrite($CurrentVersionFile, "FileVersions", $filename, $version) + Else + If $ExistingFile = 0 Then + $data = $Text_ErrCopyingFile & ':' & $filename & @CRLF & $data + $Errors &= $Text_ErrCopyingFile & ':' & $filename & @CRLF + Else + $data = $Text_ErrReplacaingOldFile & ':' & $filename & @CRLF & $data + $Errors &= $Text_ErrReplacaingOldFile & ':' & $filename & @CRLF + EndIf + EndIf + GUICtrlSetData($UpdateEdit, $data) + EndIf + If FileExists($desttmpfile) Then FileDelete($desttmpfile) + GUICtrlSetData($datalabel, '') + Else + $data = $Text_NoChangeInFile & ':' & $filename & @CRLF & $data + GUICtrlSetData($UpdateEdit, $data) + EndIf + EndIf + Next + EndIf + $rm = IniReadSection($NewVersionFile, "RemovedFiles") + If Not @error Then + For $i = 1 To $rm[0][0] + $filename = $rm[$i][0] + $filefullpath = @ScriptDir & '\' & $filename + If FileExists($filefullpath) Then + If FileDelete($filefullpath) = 1 Then + $data = $Text_DeletedFile & ':' & $filename & @CRLF & $data + $NewFiles &= $Text_DeletedFile & ':' & $filename & @CRLF + GUICtrlSetData($UpdateEdit, $data) + IniDelete($CurrentVersionFile, 'FileVersions', $filename) + Else + $data = $Text_ErrDeletingFile & ':' & $filename & @CRLF & $data + $Errors &= $Text_ErrDeletingFile & ':' & $filename & @CRLF + GUICtrlSetData($UpdateEdit, $data) + EndIf + EndIf + Next + EndIf + FileDelete($NewVersionFile) +EndIf + +GUIDelete($UpdateGUI) + +If $Errors <> '' Then + $errormsg = _MsgBox($Text_Error, $Text_ErrWouldYouLikeToRetryUpdate & @CRLF & @CRLF & $Errors, $Text_Retry, $Text_Ignore) + If $errormsg = 1 Then + Run(@ScriptDir & '\update.exe') + Exit + EndIf +EndIf + +_WriteINI() + +$updatemsg = _MsgBox($Text_Done, $Text_DoneWouldYouLikeToLoadVistumbler & @CRLF & @CRLF & $NewFiles, $Text_Yes, $Text_No) +If $updatemsg = 1 Then Run(@ScriptDir & '\Vistumbler.exe') + +Exit + +Func _MsgBox($title, $msg, $But1txt, $But2txt) + $MsgBoxGUI = GUICreate($title, 442, 234, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) + GUISetBkColor($BackgroundColor) + $MsgBox = GUICtrlCreateEdit($msg, 8, 8, 425, 185, $ES_READONLY + $WS_VSCROLL + $WS_HSCROLL) + GUICtrlSetBkColor(-1, $ControlBackgroundColor) + $But1 = GUICtrlCreateButton($But1txt, 120, 200, 81, 25) + $But2 = GUICtrlCreateButton($But2txt, 223, 200, 81, 25) + GUISetState(@SW_SHOW) + While 1 + $nMsg = GUIGetMsg() + Switch $nMsg + Case $GUI_EVENT_CLOSE + GUIDelete($MsgBoxGUI) + Return (0) + Case $But1 + GUIDelete($MsgBoxGUI) + Return (1) + Case $But2 + GUIDelete($MsgBoxGUI) + Return (2) + EndSwitch + WEnd +EndFunc ;==>_MsgBox + +Func _WriteINI() + If FileExists($Default_settings) Then IniWrite($Default_settings, 'Vistumbler', 'CheckForBetaUpdates', $CheckForBetaUpdates) + If FileExists($Profile_settings) Then IniWrite($Profile_settings, 'Vistumbler', 'CheckForBetaUpdates', $CheckForBetaUpdates) + IniWrite($DefaultLanguagePath, "GuiText", "Done", $Text_Done) + IniWrite($DefaultLanguagePath, "GuiText", "Error", $Text_Error) + IniWrite($DefaultLanguagePath, "GuiText", "Updating", $Text_Updating) + IniWrite($DefaultLanguagePath, "GuiText", "Downloaded", $Text_Downloaded) + IniWrite($DefaultLanguagePath, "GuiText", "Retry", $Text_Retry) + IniWrite($DefaultLanguagePath, "GuiText", "Ignore", $Text_Ignore) + IniWrite($DefaultLanguagePath, "GuiText", "Yes", $Text_Yes) + IniWrite($DefaultLanguagePath, "GuiText", "No", $Text_No) + IniWrite($DefaultLanguagePath, "GuiText", "LoadingVersionsFile", $Text_LoadingVersionsFile) + IniWrite($DefaultLanguagePath, 'GuiText', 'UsingLocalFile', $Text_UsingLocalFile) + IniWrite($DefaultLanguagePath, 'GuiText', 'DownloadingBetaVerFile', $Text_DownloadingBetaVerFile) + IniWrite($DefaultLanguagePath, "GuiText", "DownloadingVerFile", $Text_DownloadingVerFile) + IniWrite($DefaultLanguagePath, "GuiText", "VerFileDownloaded", $Text_VerFileDownloaded) + IniWrite($DefaultLanguagePath, "GuiText", "ErrDownloadVerFile", $Text_ErrDownloadVerFile) + IniWrite($DefaultLanguagePath, "GuiText", "NewFile", $Text_NewFile) + IniWrite($DefaultLanguagePath, "GuiText", "UpdatedFile", $Text_UpdatedFile) + IniWrite($DefaultLanguagePath, "GuiText", "ErrCopyingFile", $Text_ErrCopyingFile) + IniWrite($DefaultLanguagePath, "GuiText", "ErrReplacaingOldFile", $Text_ErrReplacaingOldFile) + IniWrite($DefaultLanguagePath, "GuiText", "ErrDownloadingNewFile", $Text_ErrDownloadingNewFile) + IniWrite($DefaultLanguagePath, "GuiText", "NoChangeInFile", $Text_NoChangeInFile) + IniWrite($DefaultLanguagePath, 'GuiText', 'DeletedFile', $Text_DeletedFile) + IniWrite($DefaultLanguagePath, 'GuiText', 'ErrDeletingFile', $Text_ErrDeletingFile) + IniWrite($DefaultLanguagePath, "GuiText", "ErrWouldYouLikeToRetryUpdate", $Text_ErrWouldYouLikeToRetryUpdate) + IniWrite($DefaultLanguagePath, 'GuiText', 'DoneWouldYouLikeToLoadVistumbler', $Text_DoneWouldYouLikeToLoadVistumbler) +EndFunc ;==>_WriteINI diff --git a/Installer/vi_files/update.exe b/Installer/vi_files/update.exe new file mode 100644 index 00000000..0b5fdd74 Binary files /dev/null and b/Installer/vi_files/update.exe differ diff --git a/Installer/vi_files/versions.ini b/Installer/vi_files/versions.ini new file mode 100644 index 00000000..eca43e7b --- /dev/null +++ b/Installer/vi_files/versions.ini @@ -0,0 +1,120 @@ +[FileVersions] +commg.dll=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Export.au3=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +Export.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +License.txt=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +macmanuf.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +say.au3=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +say.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +sqlite3.dll=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +update.au3=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +update.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +UpdateManufactures.au3=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +UpdateManufactures.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +Vistumbler.au3=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +Vistumbler.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +vistumbler_updater.au3=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +vistumbler_updater.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +Uninstall.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +Icons\icon.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\vsfile_icon.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\Signal\open-green.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\Signal\open-grey.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\Signal\open-light-green.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\Signal\open-orange.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\Signal\open-red.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\Signal\open-yellow.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\Signal\sec-green.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\Signal\sec-grey.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\Signal\sec-light-green.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\Signal\sec-orange.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\Signal\sec-red.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Icons\Signal\sec-yellow.ico=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Images\gpspos.png=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Images\open.png=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Images\open_dead.png=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Images\secure.png=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Images\secure_dead.png=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Images\secure-wep.png=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Images\secure-wep_dead.png=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Brazilian_Portuguese.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Bulgarian.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Czech.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Danish.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Deutsch.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Dutch.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\English.ini=d871f8c809a99c6a508e266ad7ee16d37f65bf8f +Languages\French.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Italiano.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Japanese.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Norwegian.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Polish.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Russian.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Spanish.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Spanish2.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Swedish.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Greek.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Chinese_Traditional.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Languages\Turkish.ini=7923d0385374493515e69e58fdcb45ffee09c465 +Settings\Instruments.mdb=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Settings\Labels.mdb=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Settings\Filters.mdb=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Settings\Manufacturers.mdb=aec28f8ce5c846d5d654211de70f4b4c31c74fee +Settings\vistumbler_settings.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\eight.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\eightteen.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\eighty.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\eleven.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\error.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\fifteen.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\fifty.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\five.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\four.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\fourteen.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\fourty.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\hundred.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\new_ap.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\new_gps.wav=4a495451f4ce3c0ffe0e8d85f191fe441576a51b +Sounds\nine.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\nineteen.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\ninety.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\one.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\percent.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\seven.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\seventeen.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\seventy.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\six.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\sixteen.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\sixty.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\ten.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\thirteen.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\thirty.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\three.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\twelve.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\twenty.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\two.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\zero.wav=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Sounds\autosave.wav=02e45e8f01c69f6cc6d2522c180eccaafd6cc8e1 +UDFs\AccessCom.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +UDFs\CommMG.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +UDFs\CompareFileTimeEx.au3=18a92cffd1a751bd3e282cd95e5eedeb7ae40aea +UDFs\cfxUDF.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +UDFs\HTTP.au3=aecd2257886b6bc605635ce97b9329c9a8d22c0b +UDFs\JSON.au3=aecd2257886b6bc605635ce97b9329c9a8d22c0b +UDFs\MD5.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +UDFs\NativeWifi.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +UDFs\ParseCSV.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +UDFs\Zip.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +UDFs\FileInUse.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +UDFs\UnixTime.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d +UDFs\MIDIConstants.au3=6585e27ea8361e2e8444af15c227e44739fe8431 +UDFs\MIDIFunctions.au3=6585e27ea8361e2e8444af15c227e44739fe8431 + +[RemovedFiles] +UDFs\Midiudf.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +UDFs\sounder.exe=aecd2257886b6bc605635ce97b9329c9a8d22c0b +manufmac.exe=474ce1b300d5526457cc1f73b7c9cbc693864840 +manufmac.php=474ce1b300d5526457cc1f73b7c9cbc693864840 +update_updater.au3=4ed5b9cb5c8dbaba07d1ca93f74ef78e9548ceb6 +update_updater.exe=4ed5b9cb5c8dbaba07d1ca93f74ef78e9548ceb6 +Interop.ADOX.dll=477dfabf0b7c1720af5c83026df9d92800d56329 diff --git a/Installer/vi_files/vistumbler_updater.au3 b/Installer/vi_files/vistumbler_updater.au3 new file mode 100644 index 00000000..4d31c8f3 --- /dev/null +++ b/Installer/vi_files/vistumbler_updater.au3 @@ -0,0 +1,74 @@ +#RequireAdmin +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Icon=Icons\icon.ico +#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator +#AutoIt3Wrapper_Run_Tidy=y +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** +;License Information------------------------------------ +;Copyright (C) 2019 Andrew Calcutt +;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; Version 2 of the License. +;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +;You should have received a copy of the GNU General Public License along with this program; If not, see . +;-------------------------------------------------------- +;AutoIt Version: v3.3.15.1 +$Script_Author = 'Andrew Calcutt' +$Script_Name = 'Vistumbler Update Updater' +$Script_Website = 'http://www.Vistumbler.net' +$Script_Function = 'Updates the vistumbler update.exe file from git based on version.ini' +$version = 'v1' +$origional_date = '2015/03/05' +$last_modified = '2015/03/06' +HttpSetUserAgent($Script_Name & ' ' & $version) +;-------------------------------------------------------- +Dim $TmpDir = @TempDir & '\Vistumbler\' +DirCreate($TmpDir) + +Dim $Default_settings = @ScriptDir & '\Settings\vistumbler_settings.ini' +Dim $Profile_settings = @AppDataDir & '\Vistumbler\vistumbler_settings.ini' +Dim $PortableMode = IniRead($Default_settings, 'Vistumbler', 'PortableMode', 0) +If $PortableMode = 1 Then + $settings = $Default_settings +Else + $settings = $Profile_settings + If FileExists($Default_settings) And FileExists($settings) = 0 Then FileCopy($Default_settings, $settings, 1) +EndIf + +Dim $NewVersionFile = $TmpDir & 'versions.ini' +Dim $CurrentVersionFile = @ScriptDir & '\versions.ini' +Dim $GIT_ROOT = 'https://raw.github.com/acalcutt/Vistumbler/' +Dim $CheckForBetaUpdates = IniRead($settings, 'Vistumbler', 'CheckForBetaUpdates', 0) +If FileExists($Default_settings) Then IniWrite($Default_settings, 'Vistumbler', 'CheckForBetaUpdates', $CheckForBetaUpdates) +If FileExists($Profile_settings) Then IniWrite($Profile_settings, 'Vistumbler', 'CheckForBetaUpdates', $CheckForBetaUpdates) + +FileDelete($NewVersionFile) +If $CheckForBetaUpdates = 1 Then + $get = InetGet($GIT_ROOT & 'beta/VistumblerMDB/versions.ini', $NewVersionFile, 1) + If $get = 0 Then FileDelete($NewVersionFile) +Else + $get = InetGet($GIT_ROOT & 'master/VistumblerMDB/versions.ini', $NewVersionFile, 1) + If $get = 0 Then FileDelete($NewVersionFile) +EndIf + +If FileExists($NewVersionFile) Then + $fv = IniReadSection($NewVersionFile, "FileVersions") + If Not @error Then + For $i = 1 To $fv[0][0] + $filename = $fv[$i][0] + $version = $fv[$i][1] + If $filename = 'update.exe' Then + $sourcefile = $GIT_ROOT & $version & '/VistumblerMDB/' & $filename + $desttmpfile = $TmpDir & $filename & '.tmp' + $destfile = @ScriptDir & '\' & $filename + $get = InetGet($sourcefile, $desttmpfile, 1) + If $get <> 0 And FileGetSize($desttmpfile) <> 0 Then ;Download Successful + If FileMove($desttmpfile, $destfile, 9) = 1 Then IniWrite($CurrentVersionFile, "FileVersions", $filename, $version) + EndIf + FileDelete($desttmpfile) + EndIf + Next + EndIf + FileDelete($NewVersionFile) +EndIf + +$command = @ScriptDir & '\update.exe' +Run(@ComSpec & ' /c start "" "' & $command & '"') diff --git a/Installer/vi_files/vistumbler_updater.exe b/Installer/vi_files/vistumbler_updater.exe new file mode 100644 index 00000000..2b459e13 Binary files /dev/null and b/Installer/vi_files/vistumbler_updater.exe differ diff --git a/Installer/vistumbler_NSIS.nsi b/Installer/vistumbler_NSIS.nsi new file mode 100644 index 00000000..03b2ebb0 --- /dev/null +++ b/Installer/vistumbler_NSIS.nsi @@ -0,0 +1,88 @@ +; Vistumbler.nsi +; +; This script is based on example1.nsi, but it remember the directory, +; has uninstall support and (optionally) installs start menu shortcuts. +; +; It will install example2.nsi into a directory that the user selects, + +;-------------------------------- +; The name of the installer +Name "Vistumbler" + +; The file to write +OutFile "Vistumbler_v10.6.5.exe" + +; The default installation directory +InstallDir $PROGRAMFILES\Vistumbler + +; Registry key to check for directory (so if you install again, it will +; overwrite the old one automatically) +InstallDirRegKey HKLM "Software\Vistumbler" "Install_Dir" + +; Request application privileges for Windows Vista +RequestExecutionLevel admin + +;-------------------------------- + +; Pages + +Page components +Page directory +Page instfiles + +UninstPage uninstConfirm +UninstPage instfiles + +;-------------------------------- + +; The stuff to install +Section "Vistumbler (required)" + + SectionIn RO + + ; Set output path to the installation directory. + SetOutPath $INSTDIR + + ; Put file there + File /r vi_files\*.* + + ; Write the installation path into the registry + WriteRegStr HKLM SOFTWARE\Vistumbler "Install_Dir" "$INSTDIR" + + ; Write the uninstall keys for Windows + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler" "DisplayName" "Vistumbler" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler" "DisplayVersion" "10.6.5" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler" "Publisher" "Vistumbler.net" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler" "UninstallString" '"$INSTDIR\uninstall.exe"' + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler" "DisplayIcon" '"$INSTDIR\uninstall.exe"' + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler" "NoModify" 1 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler" "NoRepair" 1 + WriteUninstaller "$INSTDIR\uninstall.exe" + +SectionEnd + +; Optional section (can be disabled by the user) +Section "Start Menu Shortcuts" + + CreateDirectory "$SMPROGRAMS\Vistumbler" + CreateShortcut "$SMPROGRAMS\Vistumbler\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 + CreateShortcut "$SMPROGRAMS\Vistumbler\Vistumbler.lnk" "$INSTDIR\Vistumbler.exe" "" "$INSTDIR\Vistumbler.exe" 0 + +SectionEnd + +;-------------------------------- + +; Uninstaller + +Section "Uninstall" + + ; Remove registry keys + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler" + DeleteRegKey HKLM SOFTWARE\Vistumbler + + ; Remove directories used + RMDir /r $SMPROGRAMS\Vistumbler + RMDir /r /REBOOTOK $INSTDIR + RMDir /r /REBOOTOK $APPDATA\Vistumbler + +SectionEnd diff --git a/VistumblerMDB/Images/bar_graph.PSD b/VistumblerMDB/Images/bar_graph.PSD new file mode 100644 index 00000000..b66f5d52 Binary files /dev/null and b/VistumblerMDB/Images/bar_graph.PSD differ diff --git a/VistumblerMDB/Images/bar_graph.jpg b/VistumblerMDB/Images/bar_graph.jpg new file mode 100644 index 00000000..4dc64f26 Binary files /dev/null and b/VistumblerMDB/Images/bar_graph.jpg differ diff --git a/VistumblerMDB/Images/bar_graph_disabled.jpg b/VistumblerMDB/Images/bar_graph_disabled.jpg new file mode 100644 index 00000000..a150dcfe Binary files /dev/null and b/VistumblerMDB/Images/bar_graph_disabled.jpg differ diff --git a/VistumblerMDB/Images/line_graph.jpg b/VistumblerMDB/Images/line_graph.jpg new file mode 100644 index 00000000..21672b90 Binary files /dev/null and b/VistumblerMDB/Images/line_graph.jpg differ diff --git a/VistumblerMDB/Images/line_graph.psd b/VistumblerMDB/Images/line_graph.psd new file mode 100644 index 00000000..43b930b7 Binary files /dev/null and b/VistumblerMDB/Images/line_graph.psd differ diff --git a/VistumblerMDB/Images/line_graph_disabled.jpg b/VistumblerMDB/Images/line_graph_disabled.jpg new file mode 100644 index 00000000..03a3add7 Binary files /dev/null and b/VistumblerMDB/Images/line_graph_disabled.jpg differ diff --git a/VistumblerMDB/Images/list-view.jpg b/VistumblerMDB/Images/list-view.jpg new file mode 100644 index 00000000..58cd5e25 Binary files /dev/null and b/VistumblerMDB/Images/list-view.jpg differ diff --git a/VistumblerMDB/Languages/English.ini b/VistumblerMDB/Languages/English.ini index 376a4b47..21a1a5e3 100644 --- a/VistumblerMDB/Languages/English.ini +++ b/VistumblerMDB/Languages/English.ini @@ -1,6 +1,6 @@ [Info] Author=Andrew Calcutt -Date=2015/03/07 +Date=2020/09/06 Description=English SearchWords. English Text. Default Language. WindowsLanguageCode=en_US @@ -11,6 +11,7 @@ NetworkType=Network type Authentication=Authentication Encryption=Encryption Signal=Signal +RSSI=RSSI RadioType=Radio Type Channel=Channel BasicRates=Basic Rates @@ -21,7 +22,6 @@ WEP=WEP Infrastructure=Infrastructure Adhoc=Adhoc Cipher=Cipher -RSSI=RSSI [Column_Names] Column_Line=# @@ -30,25 +30,25 @@ Column_SSID=SSID Column_BSSID=Mac Address Column_Manufacturer=Manufacturer Column_Signal=Signal +Column_HighSignal=High Signal +Column_RSSI=RSSI +Column_HighRSSI=High RSSI Column_Authentication=Authentication Column_Encryption=Encryption Column_RadioType=Radio Type Column_Channel=Channel Column_Latitude=Latitude Column_Longitude=Longitude -Column_LatitudeDMS=Lat (dd mm ss) -Column_LongitudeDMS=Lon (dd mm ss) -Column_LatitudeDMM=Lat (ddmm.mmmm) -Column_LongitudeDMM=Lon (ddmm.mmmm) +Column_LatitudeDMS=Latitude (DDMMSS) +Column_LongitudeDMS=Longitude (DDMMSS) +Column_LatitudeDMM=Latitude (DDMMMM) +Column_LongitudeDMM=Longitude (DDMMMM) Column_BasicTransferRates=Basic Transfer Rates Column_OtherTransferRates=Other Transfer Rates Column_FirstActive=First Active -Column_LastActive=Last Updated +Column_LastActive=Last Active Column_NetworkType=Network Type Column_Label=Label -Column_HighSignal=High Signal -Column_RSSI=RSSI -Column_HighRSSI=High RSSI [GuiText] Ok=&Ok @@ -156,14 +156,17 @@ RestartMsg=Please restart Vistumbler for the change to take effect Error=Error NoSignalHistory=No signal history found, check to make sure your netsh search words are correct NoApSelected=You did not select an access point -UseNetcomm=Use Netcomm OCX (more stable) - x32 -UseCommMG=Use CommMG (less stable) - x32 - x64 +UseKernel32=Kernel32 +UseNetcomm=Netcomm OCX (Needs http://www.hardandsoftware.net/NETCommOCX.htm) +UseCommMG=CommMG (included, but will crash if gps is disconnected improperly) SignalHistory=Signal History AutoSortEvery=Auto Sort Every Seconds=Seconds Ascending=Ascending Decending=Decending AutoRecoveryVS1=Auto Recovery VS1 +AutoSaveAndClear=Auto Save And Clear +SaveAndClear=Sav&e && Clear AutoSaveEvery=Auto Save Every DelAutoSaveOnExit=Delete Auto Save file on exit OpenSaveFolder=Open Save Folder @@ -312,7 +315,6 @@ VistumblerNeedsToRestart=Vistumbler needs to be restarted. Vistumbler will now c AddingApsIntoList=Adding new APs into list GoogleEarthDoesNotExist=Google earth file does not exist or is set wrong in the AutoKML settings AutoKmlIsNotStarted=AutoKML is not yet started. Would you like to turn it on now? -UseKernel32=Use Kernel32 - x32 - x64 UnableToGuessSearchwords=Vistumbler was unable to guess searchwords SelectedAP=Selected AP AllAPs=All APs @@ -340,8 +342,8 @@ FilterNameRequired=Filter Name is required UpdateManufacturers=Update Manufacturers FixHistSignals=Fixing Missing Hist Table Signal(s) VistumblerFile=Vistumbler file -DetailedFile=Detailed Comma Delimited file -SummaryFile=Summary Comma Delimited file +DetailedFile=Vistumbler Detailed CSV +SummaryFile=Vistumbler Summary CSV NetstumblerTxtFile=Netstumbler wi-scan file WardriveDb3File=Wardrive-android file AutoScanApsOnLaunch=Auto Scan APs on launch @@ -419,3 +421,8 @@ ButtonActiveColor=Button Active Color ButtonInactiveColor=Button Inactive Color Text=Text GUITextSize=GUI Text Size +GPSLogging=GPS Logging +SaveNMEAData=Save NMEA Data to log file +DeleteNMEAlog=Delete NMEA Data log file on exit +LogFileLocation=Log file location +NMEALogError=Error opening NMEA log file diff --git a/VistumblerMDB/UDFs/cfxUDF.au3 b/VistumblerMDB/UDFs/cfxUDF.au3 index 185e5041..458d4948 100644 --- a/VistumblerMDB/UDFs/cfxUDF.au3 +++ b/VistumblerMDB/UDFs/cfxUDF.au3 @@ -8,6 +8,10 @@ Andrew Calcutt 05/16/2009 - Started converting to UDF V2.1 Mikko Keski-Heroja 02/23/2011 - UDF is now compatible with Opt("MustDeclareVars",1) and Date.au3. Global variable $dll is renamed to $commDll. + V2.2 + Andrew Calcutt - Fixed COM10 + Support + V2.3 + Andrew Calcutt - Merged Changes by Dmitri Ranfft 07/10/2013 - Added _rxwaitarray() function that returns the result as an array rather than string, allowing easier handling of 0x00 bytes. #ce Global $commDll @@ -52,16 +56,12 @@ Func _OpenComm($CommPort, $CommBaud = '4800', $CommBits = '8', $CommParity = '0' local const $GENERIC_READ_WRITE=0xC0000000 local const $OPEN_EXISTING=3 local const $FILE_ATTRIBUTE_NORMAL =0x80 - local const $NOPARITY=0 - local const $ONESTOPBIT=0 $dcb_Struct=DllStructCreate($dcbs) if @error Then errpr() - $commtimeout_Struct=DllStructCreate($commtimeouts) if @error Then errpr() - - $hSerialPort = DllCall($commDll, "hwnd", "CreateFile", "str", "COM" & $CommPort, _ + $hSerialPort = DllCall($commDll, "hwnd", "CreateFile", "str", "\\.\COM" & $CommPort, _ "int", $GENERIC_READ_WRITE, _ "int", 0, _ "ptr", 0, _ @@ -101,6 +101,7 @@ Func _OpenComm($CommPort, $CommBaud = '4800', $CommBits = '8', $CommParity = '0' DllStructSetData( $commtimeout_Struct,"ReadIntervalTimeout",-1) $commtimeout=dllcall($commDll,"long","SetCommTimeouts","hwnd",$hSerialPort[0],"ptr",DllStructGetPtr($commtimeout_Struct)) if @error Then errpr() + _setrts(4) return number($hSerialPort[0]) EndFunc @@ -169,6 +170,44 @@ Func _rxwait($CommSerialPort, $MinBufferSize, $MaxWaitTime, $DEBUG = 0) Return($rxbuf) EndFunc + ;==================================================================================== +; Function Name: _rxwaitarray($CommSerialPort, $MinBufferSize, $MaxWaitTime, $DEBUG = 0) +; Description: Recieves data +; Parameters: $CommSerialPort - value returned by _OpenComm +; $MinBufferSize - Buffer size to wait for +; $MaxWaitTime - Maximum time to wait before failing +; $DEBUG - Show debug messages +; Returns: on success, returns 1 +; on failure returns -1 and sets @error to 1 +; Note: Modified _rxwait() to return an array instead of a string for easier handling of 0x00 bytes. +;==================================================================================== + Func _rxwaitarray($CommSerialPort, $MinBufferSize, $MaxWaitTime, $DEBUG = 0) + if $DEBUG=1 then ConsoleWrite("Wait " & $MinBufferSize & " " & $MaxWaitTime & @CRLF) + Local $rxbuf[$MinBufferSize] + local $jetza=TimerInit() + local $lptr0=dllstructcreate("long_ptr") + + local $rxr, $rxl, $to, $i=0; $i added + Do + $rxr=dllcall($commDll,"int","ReadFile","hwnd",$CommSerialPort, _ + "str"," ", _ + "int",1, _ + "long_ptr", DllStructGetPtr($lptr0), _ + "ptr", 0) + if @error Then errpr() + $rxl=DllStructGetData($lptr0,1) + if $DEBUG=1 then ConsoleWrite("R0:" & $rxr[0] & " |R1:" & $rxr[1] & " |R2:" & $rxr[2] & " |rxl:" & $rxl & " |R4:" & $rxr[4] & @CRLF) + if $rxl>=1 then + ;$rxbuf&=$rxr[2] ;replaced + $rxbuf[$i]=$rxr[2] ;added + $i += 1 ;added + EndIf + $to=TimerDiff($jetza) + ;Until stringlen($rxbuf) >= $MinBufferSize OR $to > $MaxWaitTime ;replaced + Until $i >= $MinBufferSize OR $to > $MaxWaitTime ;added + Return($rxbuf) +EndFunc + Func _rx($rxbuf, $n=0, $DEBUG = 0) local $r if StringLen($rxbuf)<$n then @@ -208,4 +247,12 @@ EndFunc func errpr() consolewrite ("Error " & @error & @CRLF) -EndFunc + EndFunc + +Func _setrts($x) + $escr=dllcall($commDll,"long","EscapeCommFunction","hwnd",($hSerialPort[0]),"int",$x) + if @error Then + errpr() + Exit + EndIf +EndFunc \ No newline at end of file diff --git a/VistumblerMDB/Vistumbler.au3 b/VistumblerMDB/Vistumbler.au3 index 871e2926..1bba662d 100644 --- a/VistumblerMDB/Vistumbler.au3 +++ b/VistumblerMDB/Vistumbler.au3 @@ -1,7 +1,8 @@ #Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Version=Beta #AutoIt3Wrapper_Icon=Icons\icon.ico #AutoIt3Wrapper_Outfile=Vistumbler.exe -#AutoIt3Wrapper_Res_Fileversion=10.6.5.4 +#AutoIt3Wrapper_Res_Fileversion=10.7.0.0 #AutoIt3Wrapper_Res_ProductName=Vistumbler #AutoIt3Wrapper_Res_CompanyName=Vistumbler.net #AutoIt3Wrapper_Res_Language=1033 @@ -9,19 +10,19 @@ #AutoIt3Wrapper_Run_Tidy=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;License Information------------------------------------ -;Copyright (C) 2019 Andrew Calcutt +;Copyright (C) 2020 Andrew Calcutt ;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; Version 2 of the License. ;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ;You should have received a copy of the GNU General Public License along with this program; If not, see . ;-------------------------------------------------------- -;AutoIt Version: v3.3.15.1 +;AutoIt Version: v3.3.15.3 $Script_Author = 'Andrew Calcutt' $Script_Name = 'Vistumbler' $Script_Website = 'http://www.Vistumbler.net' $Script_Function = 'A wireless network scanner for Windows 10, Windows 8, Windows 7, and Vista.' -$version = 'v10.6.5' +$version = 'v10.7' $Script_Start_Date = '2007/07/10' -$last_modified = '2019/06/28' +$last_modified = '2021/02/15' HttpSetUserAgent($Script_Name & ' ' & $version) ;Includes------------------------------------------------ #include @@ -289,6 +290,7 @@ Dim $AutoKmlDeadProcess Dim $AutoKmlTrackProcess Dim $NsCancel Dim $DefaultApapterID +Dim $DefaultApapterDesc Dim $OpenedPort Dim $LastGpsString Dim $WifiDbSessionID @@ -325,7 +327,7 @@ Dim $GpsCurrentDataGUI, $GPGGA_Time, $GPGGA_Lat, $GPGGA_Lon, $GPGGA_Quality, $GP Dim $GUI_AutoSaveKml, $GUI_GoogleEXE, $GUI_AutoKmlActiveTime, $GUI_AutoKmlDeadTime, $GUI_AutoKmlGpsTime, $GUI_AutoKmlTrackTime, $GUI_KmlFlyTo, $AutoKmlActiveHeader, $GUI_OpenKmlNetLink, $GUI_AutoKml_Alt, $GUI_AutoKml_AltMode, $GUI_AutoKml_Heading, $GUI_AutoKml_Range, $GUI_AutoKml_Tilt Dim $GUI_NewApSound, $GUI_ASperloop, $GUI_ASperap, $GUI_ASperapwsound, $GUI_SpeakSignal, $GUI_PlayMidiSounds, $GUI_SpeakSoundsVis, $GUI_SpeakSoundsSapi, $GUI_SpeakPercent, $GUI_SpeakSigTime, $GUI_SpeakSoundsMidi, $GUI_Midi_Instument, $GUI_Midi_PlayTime -Dim $GUI_Import, $vistumblerfileinput, $progressbar, $percentlabel, $linemin, $newlines, $minutes, $linetotal, $estimatedtime, $RadVis, $RadCsv, $RadNs, $RadWD +Dim $GUI_Import, $vistumblerfileinput, $progressbar, $percentlabel, $linemin, $newlines, $minutes, $linetotal, $estimatedtime, $RadVis, $RadCsv, $RadNs, $RadWD, $RadWigle Dim $ExportKMLGUI, $GUI_TrackColor Dim $GUI_ImportImageFiles @@ -338,10 +340,11 @@ Dim $SearchWord_Authentication_GUI, $SearchWord_Signal_GUI, $SearchWord_RadioTyp Dim $SearchWord_None_GUI, $SearchWord_Wep_GUI, $SearchWord_Infrastructure_GUI, $SearchWord_Adhoc_GUI Dim $LabAuth, $LabDate, $LabWinCode, $LabDesc, $GUI_Set_SaveDir, $GUI_Set_SaveDirAuto, $GUI_Set_SaveDirAutoRecovery, $GUI_Set_SaveDirKml, $GUI_BKColor, $GUI_CBKColor, $GUI_TextColor, $GUI_CBAColor, $GUI_CBIColor, $GUI_TextSize, $GUI_dBmMaxSignal, $GUI_dBmDisassociationSignal, $GUI_TimeBeforeMarkingDead, $GUI_RefreshLoop, $GUI_AutoCheckForUpdates, $GUI_CheckForBetaUpdates, $GUI_CamTriggerScript +Dim $GUI_GpsLogFileLocation, $GUI_GpsLogEnabled, $GUI_GpsLogDeleteOnExit Dim $Gui_Csv, $GUI_Manu_List, $GUI_Lab_List, $GUI_Cam_List, $ImpLanFile Dim $EditMacGUIForm, $GUI_Manu_NewManu, $GUI_Manu_NewMac, $EditMac_Mac, $EditMac_GUI, $EditLine, $GUI_Lab_NewMac, $GUI_Lab_NewLabel, $EditCamGUIForm, $GUI_Cam_NewID, $GUI_Cam_NewLOC, $GUI_Edit_CamID, $GUI_Edit_CamLOC, $Gui_CamTrigger, $GUI_CamTriggerTime, $GUI_ImgGroupName, $GUI_ImgGroupName, $GUI_ImpImgSkewTime, $GUI_ImpImgDir Dim $AutoSaveAndClearBox, $AutoSaveAndClearRadioAP, $AutoSaveAndClearRadioTime, $AutoSaveAndClearAPsGUI, $AutoSaveAndClearTimeGUI, $AutoRecoveryBox, $AutoRecoveryDelBox, $AutoSaveAndClearPlaySoundGUI, $AutoRecoveryTimeGUI, $GUI_SortDirection, $GUI_RefreshNetworks, $GUI_RefreshTime, $GUI_WifidbLocate, $GUI_WiFiDbLocateRefreshTime, $GUI_SortBy, $GUI_SortTime, $GUI_AutoSort, $GUI_SortTime, $GUI_WifiDB_User, $GUI_WifiDB_ApiKey, $GUI_WifiDbGraphURL, $GUI_WifiDbWdbURL, $GUI_WifiDbApiURL, $GUI_WifidbUploadAps, $GUI_AutoUpApsToWifiDBTime -Dim $Gui_CsvFile, $Gui_CsvRadSummary, $Gui_CsvRadDetailed, $Gui_CsvFiltered +Dim $Gui_CsvFile, $Gui_CsvRadSummary, $Gui_CsvRadDetailed, $Gui_CsvRadWigle, $Gui_CsvFiltered Dim $GUI_ModifyFilters, $FilterLV, $AddEditFilt_GUI, $Filter_ID_GUI, $Filter_Name_GUI, $Filter_Desc_GUI Dim $MacAdd_GUI, $MacAdd_GUI_BSSID, $MacAdd_GUI_MANU, $LabelAdd_GUI, $LabelAdd_GUI_BSSID, $LabelAdd_GUI_LABEL @@ -473,7 +476,7 @@ Dim $RefreshTime = IniRead($settings, 'Vistumbler', 'AutoRefreshTime', 1000) Dim $Debug = IniRead($settings, 'Vistumbler', 'Debug', 0) Dim $DebugCom = IniRead($settings, 'Vistumbler', 'DebugCom', 0) Dim $UseRssiInGraphs = IniRead($settings, 'Vistumbler', 'UseRssiInGraphs', 1) -Dim $GraphDeadTime = IniRead($settings, 'Vistumbler', 'GraphDeadTime', 0) +Dim $GraphDeadTime = IniRead($settings, 'Vistumbler', 'GraphDeadTime', 1) Dim $SaveGpsWithNoAps = IniRead($settings, 'Vistumbler', 'SaveGpsWithNoAps', 1) Dim $TimeBeforeMarkedDead = IniRead($settings, 'Vistumbler', 'TimeBeforeMarkedDead', 2) Dim $AutoSelect = IniRead($settings, 'Vistumbler', 'AutoSelect', 0) @@ -504,6 +507,9 @@ Dim $GPSformat = IniRead($settings, 'GpsSettings', 'GPSformat', 3) Dim $GpsTimeout = IniRead($settings, 'GpsSettings', 'GpsTimeout', 30000) Dim $GpsDisconnect = IniRead($settings, 'GpsSettings', 'GpsDisconnect', 1) Dim $GpsReset = IniRead($settings, 'GpsSettings', 'GpsReset', 1) +Dim $GpsLogLocation = IniRead($settings, 'AutoKML', 'GpsLogLocation', $SaveDir & "gps_nmea_log.txt") +Dim $GpsLogEnabled = IniRead($settings, 'GpsSettings', 'GpsLogEnabled', 0) +Dim $GpsLogDeleteOnExit = IniRead($settings, 'GpsSettings', 'GpsLogDeleteOnExit', 1) Dim $SortTime = IniRead($settings, 'AutoSort', 'AutoSortTime', 60) Dim $AutoSort = IniRead($settings, 'AutoSort', 'AutoSort', 0) @@ -811,8 +817,9 @@ Dim $Text_RestartMsg = IniRead($DefaultLanguagePath, 'GuiText', 'RestartMsg', 'P Dim $Text_Error = IniRead($DefaultLanguagePath, 'GuiText', 'Error', 'Error') Dim $Text_NoSignalHistory = IniRead($DefaultLanguagePath, 'GuiText', 'NoSignalHistory', 'No signal history found, check to make sure your netsh search words are correct') Dim $Text_NoApSelected = IniRead($DefaultLanguagePath, 'GuiText', 'NoApSelected', 'You did not select an access point') -Dim $Text_UseNetcomm = IniRead($DefaultLanguagePath, 'GuiText', 'UseNetcomm', 'Use Netcomm OCX (more stable) - x32') -Dim $Text_UseCommMG = IniRead($DefaultLanguagePath, 'GuiText', 'UseCommMG', 'Use CommMG (less stable) - x32 - x64') +Dim $Text_UseKernel32 = IniRead($DefaultLanguagePath, 'GuiText', 'UseKernel32', 'Kernel32') +Dim $Text_UseNetcomm = IniRead($DefaultLanguagePath, 'GuiText', 'UseNetcomm', 'Netcomm OCX (Needs http://www.hardandsoftware.net/NETCommOCX.htm)') +Dim $Text_UseCommMG = IniRead($DefaultLanguagePath, 'GuiText', 'UseCommMG', 'CommMG (included, but will crash if gps is disconnected improperly)') Dim $Text_SignalHistory = IniRead($DefaultLanguagePath, 'GuiText', 'SignalHistory', 'Signal History') Dim $Text_AutoSortEvery = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSortEvery', 'Auto Sort Every') Dim $Text_Seconds = IniRead($DefaultLanguagePath, 'GuiText', 'Seconds', 'Seconds') @@ -820,6 +827,7 @@ Dim $Text_Ascending = IniRead($DefaultLanguagePath, 'GuiText', 'Ascending', 'Asc Dim $Text_Decending = IniRead($DefaultLanguagePath, 'GuiText', 'Decending', 'Decending') Dim $Text_AutoRecoveryVS1 = IniRead($DefaultLanguagePath, 'GuiText', 'AutoRecoveryVS1', 'Auto Recovery VS1') Dim $Text_AutoSaveAndClear = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveAndClear', 'Auto Save And Clear') +Dim $Text_SaveAndClear = IniRead($DefaultLanguagePath, 'GuiText', 'SaveAndClear', 'Sav&e && Clear') Dim $Text_AutoSaveEvery = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveEvery', 'Auto Save Every') Dim $Text_DelAutoSaveOnExit = IniRead($DefaultLanguagePath, 'GuiText', 'DelAutoSaveOnExit', 'Delete Auto Save file on exit') Dim $Text_OpenSaveFolder = IniRead($DefaultLanguagePath, 'GuiText', 'OpenSaveFolder', 'Open Save Folder') @@ -971,7 +979,6 @@ Dim $Text_VistumblerNeedsToRestart = IniRead($DefaultLanguagePath, 'GuiText', 'V Dim $Text_AddingApsIntoList = IniRead($DefaultLanguagePath, 'GuiText', 'AddingApsIntoList', 'Adding new APs into list') Dim $Text_GoogleEarthDoesNotExist = IniRead($DefaultLanguagePath, 'GuiText', 'GoogleEarthDoesNotExist', 'Google earth file does not exist or is set wrong in the AutoKML settings') Dim $Text_AutoKmlIsNotStarted = IniRead($DefaultLanguagePath, 'GuiText', 'AutoKmlIsNotStarted', 'AutoKML is not yet started. Would you like to turn it on now?') -Dim $Text_UseKernel32 = IniRead($DefaultLanguagePath, 'GuiText', 'UseKernel32', 'Use Kernel32 - x32 - x64') Dim $Text_UnableToGuessSearchwords = IniRead($DefaultLanguagePath, 'GuiText', 'UnableToGuessSearchwords', 'Vistumbler was unable to guess searchwords') Dim $Text_SelectedAP = IniRead($DefaultLanguagePath, 'GuiText', 'SelectedAP', 'Selected AP') Dim $Text_AllAPs = IniRead($DefaultLanguagePath, 'GuiText', 'AllAPs', 'All APs') @@ -999,8 +1006,9 @@ Dim $Text_FilterNameRequired = IniRead($DefaultLanguagePath, "GuiText", "FilterN Dim $Text_UpdateManufacturers = IniRead($DefaultLanguagePath, "GuiText", "UpdateManufacturers", "Update Manufacturers") Dim $Text_FixHistSignals = IniRead($DefaultLanguagePath, "GuiText", "FixHistSignals", "Fixing Missing Hist Table Signal(s)") Dim $Text_VistumblerFile = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerFile', 'Vistumbler file') -Dim $Text_DetailedCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'DetailedFile', 'Detailed Comma Delimited file') -Dim $Text_SummaryCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'SummaryFile', 'Summary Comma Delimited file') +Dim $Text_DetailedCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'DetailedFile', 'Vistumbler Detailed CSV') +Dim $Text_SummaryCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'SummaryFile', 'Vistumbler Summary CSV') +Dim $Text_WigleCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'WigleCsvFile', 'WigleWifi 1.4 Compatible CSV') Dim $Text_NetstumblerTxtFile = IniRead($DefaultLanguagePath, 'GuiText', 'NetstumblerTxtFile', 'Netstumbler wi-scan file') Dim $Text_WardriveDb3File = IniRead($DefaultLanguagePath, "GuiText", "WardriveDb3File", "Wardrive-android file") Dim $Text_AutoScanApsOnLaunch = IniRead($DefaultLanguagePath, "GuiText", "AutoScanApsOnLaunch", "Auto Scan APs on launch") @@ -1078,6 +1086,11 @@ Dim $Text_ButtonActiveColor = IniRead($DefaultLanguagePath, 'GuiText', 'ButtonAc Dim $Text_ButtonInactiveColor = IniRead($DefaultLanguagePath, 'GuiText', 'ButtonInactiveColor', 'Button Inactive Color') Dim $Text_Text = IniRead($DefaultLanguagePath, 'GuiText', 'Text', 'Text') Dim $Text_GUITextSize = IniRead($DefaultLanguagePath, 'GuiText', 'GUITextSize', 'GUI Text Size') +Dim $Text_GPSLogging = IniRead($DefaultLanguagePath, 'GuiText', 'GPSLogging', 'GPS Logging') +Dim $Text_SaveNMEAData = IniRead($DefaultLanguagePath, 'GuiText', 'SaveNMEAData', 'Save NMEA Data to log file') +Dim $Text_DeleteNMEAlog = IniRead($DefaultLanguagePath, 'GuiText', 'DeleteNMEAlog', 'Delete NMEA Data log file on exit') +Dim $Text_LogFileLocation = IniRead($DefaultLanguagePath, 'GuiText', 'LogFileLocation', 'Log file location') +Dim $Text_NMEALogError = IniRead($DefaultLanguagePath, 'GuiText', 'NMEALogError', 'Error opening NMEA log file') If $AutoCheckForUpdates = 1 Then If _CheckForUpdates() = 1 Then @@ -1291,7 +1304,7 @@ $FontFamily_Arial = _GDIPlus_FontFamilyCreate("Arial") ; GUI ;------------------------------------------------------------------------------------------------------------------------------- Dim $title = $Script_Name & ' ' & $version & ' - By ' & $Script_Author & ' - ' & _DateLocalFormat($last_modified) & ' - (' & $VistumblerDbName & ')' -$Vistumbler = GUICreate($title, 980, 692, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) +$Vistumbler = GUICreate($title, 700, 600, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) GUISetBkColor($BackgroundColor) GUISetFont($TextSize) @@ -1416,6 +1429,11 @@ _CreateFilterQuerys() ;View Menu $GraphViewOptions = GUICtrlCreateMenu($Text_Graph, $ViewMenu) +$ShowGraph1 = GUICtrlCreateMenuItem($Text_Graph1, $GraphViewOptions) +$ShowGraph2 = GUICtrlCreateMenuItem($Text_Graph2, $GraphViewOptions) +If $MinimalGuiMode = 1 Then + GUICtrlSetState($GraphViewOptions, $GUI_DISABLE) +EndIf $UseRssiInGraphsGUI = GUICtrlCreateMenuItem($Text_UseRssiInGraphs, $GraphViewOptions) If $UseRssiInGraphs = 1 Then GUICtrlSetState(-1, $GUI_CHECKED) $GraphDeadTimeGUI = GUICtrlCreateMenuItem($Text_GraphDeadTime, $GraphViewOptions) @@ -1499,7 +1517,7 @@ $Graph_bitmap = _GDIPlus_BitmapCreateFromGraphics(900, 400, $Graphic) $Graph_backbuffer = _GDIPlus_ImageGetGraphicsContext($Graph_bitmap) GUISwitch($Vistumbler) -$ListviewAPs = _GUICtrlListView_Create($Vistumbler, $headers, 260, 65, 725, 585, BitOR($LVS_REPORT, $LVS_SINGLESEL)) +$ListviewAPs = _GUICtrlListView_Create($Vistumbler, $headers, 260, 67, 725, 585, BitOR($LVS_REPORT, $LVS_SINGLESEL)) _GUICtrlListView_SetExtendedListViewStyle($ListviewAPs, BitOR($LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER)) _GUICtrlListView_SetBkColor($ListviewAPs, RGB2BGR($ControlBackgroundColor)) _GUICtrlListView_SetTextBkColor($ListviewAPs, RGB2BGR($ControlBackgroundColor)) @@ -1520,38 +1538,44 @@ _GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-light-green.ico") _GUIImageList_AddIcon($hImage, $IconDir & "Signal\sec-green.ico") _GUICtrlListView_SetImageList($ListviewAPs, $hImage, 1) -$TreeviewAPs = _GUICtrlTreeView_Create($Vistumbler, 5, 65, 150, 585) +$TreeviewAPs = _GUICtrlTreeView_Create($Vistumbler, 5735, 67, 150, 585) _GUICtrlTreeView_SetBkColor($TreeviewAPs, $ControlBackgroundColor) WinSetState($TreeviewAPs, "", @SW_HIDE) -$ScanButton = GUICtrlCreateButton($Text_ScanAPs, 10, 8, 70, 22) +$ScanButton = GUICtrlCreateButton($Text_ScanAPs, 5, 5, 90, 45) GUICtrlSetBkColor($ScanButton, $ButtonInactiveColor) If $AutoScan = 1 Then ScanToggle() -$GpsButton = GUICtrlCreateButton($Text_UseGPS, 80, 8, 70, 22) +$GpsButton = GUICtrlCreateButton($Text_UseGPS, 95, 5, 90, 45) GUICtrlSetBkColor($GpsButton, $ButtonInactiveColor) -$GraphButton1 = GUICtrlCreateButton($Text_Graph1, 10, 35, 70, 22) -GUICtrlSetBkColor($GraphButton1, $ButtonInactiveColor) -$GraphButton2 = GUICtrlCreateButton($Text_Graph2, 80, 35, 70, 22) -GUICtrlSetBkColor($GraphButton2, $ButtonInactiveColor) -$SaveAndClearButton = GUICtrlCreateButton($Text_AutoSaveAndClear, 10, 35, 140, 22) -If $MinimalGuiMode = 1 Then - GUICtrlSetState($GraphButton1, $GUI_HIDE) - GUICtrlSetState($GraphButton2, $GUI_HIDE) -Else - GUICtrlSetState($SaveAndClearButton, $GUI_HIDE) -EndIf +$SaveAndClearButton = GUICtrlCreateButton($Text_SaveAndClear, 185, 5, 90, 45, BitOR($BS_MULTILINE, $BS_VCENTER)) -$ActiveAPs = GUICtrlCreateLabel($Text_ActiveAPs & ': ' & '0 / 0', 155, 10, 300, 15) +$GuiLat = GUICtrlCreateLabel($Text_Latitude & ': ' & _GpsFormat($Latitude), 285, 10, 200, 20) GUICtrlSetColor(-1, $TextColor) -$timediff = GUICtrlCreateLabel($Text_ActualLoopTime & ': 0 ms', 155, 25, 300, 15) +$GuiLon = GUICtrlCreateLabel($Text_Longitude & ': ' & _GpsFormat($Longitude), 285, 30, 200, 20) GUICtrlSetColor(-1, $TextColor) -$GuiLat = GUICtrlCreateLabel($Text_Latitude & ': ' & _GpsFormat($Latitude), 460, 10, 300, 15) + +$ActiveAPs = GUICtrlCreateLabel($Text_ActiveAPs & ': ' & '0 / 0', 485, 10, 300, 20) GUICtrlSetColor(-1, $TextColor) -$GuiLon = GUICtrlCreateLabel($Text_Longitude & ': ' & _GpsFormat($Longitude), 460, 25, 300, 15) +$timediff = GUICtrlCreateLabel($Text_ActualLoopTime & ': 0 ms', 485, 30, 300, 20) GUICtrlSetColor(-1, $TextColor) -$debugdisplay = GUICtrlCreateLabel('', 765, 10, 200, 15) + + +$line_graph_Image = GUICtrlCreatePic($ImageDir & "line_graph.jpg", 7, 50, 20, 20) +If $MinimalGuiMode = 1 Then GUICtrlSetState($line_graph_Image, $GUI_HIDE) +$line_graph_Image_disabled = GUICtrlCreatePic($ImageDir & "line_graph_disabled.jpg", 7, 50, 20, 20) +If $MinimalGuiMode <> 1 Then GUICtrlSetState($line_graph_Image_disabled, $GUI_HIDE) +$line_graph_Image_alt = GUICtrlCreatePic($ImageDir & "list-view.jpg", 7, 50, 20, 20) +GUICtrlSetState($line_graph_Image_alt, $GUI_HIDE) +$bar_graph_Image = GUICtrlCreatePic($ImageDir & "bar_graph.jpg", 29, 50, 20, 20) +If $MinimalGuiMode = 1 Then GUICtrlSetState($bar_graph_Image, $GUI_HIDE) +$bar_graph_Image_disabled = GUICtrlCreatePic($ImageDir & "bar_graph_disabled.jpg", 29, 50, 20, 20) +If $MinimalGuiMode <> 1 Then GUICtrlSetState($bar_graph_Image_disabled, $GUI_HIDE) +$bar_graph_Image_alt = GUICtrlCreatePic($ImageDir & "list-view.jpg", 29, 50, 20, 20) +GUICtrlSetState($bar_graph_Image_alt, $GUI_HIDE) + +$msgdisplay = GUICtrlCreateLabel('', 51, 50, 434, 20) GUICtrlSetColor(-1, $TextColor) -$msgdisplay = GUICtrlCreateLabel('', 155, 40, 610, 15) +$debugdisplay = GUICtrlCreateLabel('', 485, 50, 300, 20) GUICtrlSetColor(-1, $TextColor) GUISwitch($Vistumbler) @@ -1569,8 +1593,6 @@ GUISetOnEvent($GUI_EVENT_MAXIMIZE, '_ResetSizes') ;Buttons GUICtrlSetOnEvent($ScanButton, 'ScanToggle') GUICtrlSetOnEvent($GpsButton, '_GpsToggle') -GUICtrlSetOnEvent($GraphButton1, '_GraphToggle') -GUICtrlSetOnEvent($GraphButton2, '_GraphToggle2') GUICtrlSetOnEvent($SaveAndClearButton, '_AutoSaveAndClear') ;File Menu GUICtrlSetOnEvent($NewSession, '_NewSession') @@ -1614,6 +1636,8 @@ GUICtrlSetOnEvent($GUI_DownloadImages, '_DownloadImagesToggle') GUICtrlSetOnEvent($GUI_CamTriggerMenu, '_CamTriggerToggle') GUICtrlSetOnEvent($GUI_PortableMode, '_PortableModeToggle') ;View Menu +GUICtrlSetOnEvent($ShowGraph1, '_GraphToggle') +GUICtrlSetOnEvent($ShowGraph2, '_GraphToggle2') GUICtrlSetOnEvent($AddRemoveFilters, '_ModifyFilters') GUICtrlSetOnEvent($AutoSortGUI, '_AutoSortToggle') GUICtrlSetOnEvent($AutoSelectMenuButton, '_AutoConnectToggle') @@ -1666,6 +1690,11 @@ GUICtrlSetOnEvent($UpdateVistumbler, '_MenuUpdate') ;Support Vistumbler GUICtrlSetOnEvent($VistumblerDonate, '_OpenVistumblerDonate') GUICtrlSetOnEvent($VistumblerStore, '_OpenVistumblerStore') +;Images +GUICtrlSetOnEvent($line_graph_Image, '_GraphToggle') +GUICtrlSetOnEvent($line_graph_Image_alt, '_GraphToggle') +GUICtrlSetOnEvent($bar_graph_Image, '_GraphToggle2') +GUICtrlSetOnEvent($bar_graph_Image_alt, '_GraphToggle2') ;Set Listview Widths _SetListviewWidths() @@ -1974,7 +2003,8 @@ Func _ScanAccessPoints() $Encryption = $aplist[$add][8] $RadioType = "802.11" & $aplist[$add][12] $Signal = $aplist[$add][5] - If $Signal <> 0 Then + $UDFFlag = $aplist[$add][13] + If $Signal <> 0 And $UDFFlag = "" Then $FoundAPs += 1 ;Add new GPS ID If $FoundAPs = 1 Then @@ -2860,27 +2890,49 @@ Func _UpdateListview($Batch = 0) Else $query = "SELECT GpsID FROM Hist WHERE HistID=" & $ImpHighGpsHistID $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) - $ImpGID = $HistMatchArray[1][1] - $query = "SELECT Latitude, Longitude FROM GPS WHERE GpsID=" & $ImpGID - $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) - $FoundGpsMatch = UBound($GpsMatchArray) - 1 - $ImpLat = $GpsMatchArray[1][1] - $ImpLon = $GpsMatchArray[1][2] + If IsArray($HistMatchArray) Then + $ImpGID = $HistMatchArray[1][1] + $query = "SELECT Latitude, Longitude FROM GPS WHERE GpsID=" & $ImpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + If IsArray($GpsMatchArray) Then + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + $ImpLat = $GpsMatchArray[1][1] + $ImpLon = $GpsMatchArray[1][2] + Else + GUICtrlSetData($msgdisplay, 'Error getting lat lon') + ExitLoop + EndIf + Else + GUICtrlSetData($msgdisplay, 'Error getting gps id') + ExitLoop + EndIf EndIf ;Get First Time $query = "SELECT Date1, Time1 FROM Hist WHERE HistID=" & $ImpFirstHistID $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) - $ImpDate = $HistMatchArray[1][1] - $ImpTime = $HistMatchArray[1][2] - $ImpFirstDateTime = $ImpDate & ' ' & $ImpTime + If IsArray($HistMatchArray) Then + $ImpDate = $HistMatchArray[1][1] + $ImpTime = $HistMatchArray[1][2] + $ImpFirstDateTime = $ImpDate & ' ' & $ImpTime + Else + GUICtrlSetData($msgdisplay, 'Error getting first time') + ExitLoop + EndIf ;Get Last Time $query = "SELECT Date1, Time1, Signal, RSSI FROM Hist WHERE HistID=" & $ImpLastHistID $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) - $ImpDate = $HistMatchArray[1][1] - $ImpTime = $HistMatchArray[1][2] - $ImpSig = $HistMatchArray[1][3] - $ImpRSSI = $HistMatchArray[1][4] - $ImpLastDateTime = $ImpDate & ' ' & $ImpTime + If IsArray($HistMatchArray) Then + $ImpDate = $HistMatchArray[1][1] + $ImpTime = $HistMatchArray[1][2] + $ImpSig = $HistMatchArray[1][3] + $ImpRSSI = $HistMatchArray[1][4] + $ImpLastDateTime = $ImpDate & ' ' & $ImpTime + Else + GUICtrlSetData($msgdisplay, 'Error getting last time') + ExitLoop + EndIf + + ;If AP is not active, mark as dead and set signal to 0 If $ImpActive <> 0 And $ImpSig <> 0 Then $LActive = $Text_Active @@ -3070,6 +3122,7 @@ Func _ClearAllAp() $APID = 0 $CamID = 0 $GPS_ID = 0 + $GPS_ID = 0 $HISTID = 0 ;Clear DB $query = "DELETE * FROM AP" @@ -3385,6 +3438,7 @@ Func _Exit($SaveSettings = 1) ProcessClose($PID) If TimerDiff($CloseTimer) >= 10000 Then ExitLoop WEnd + If $GpsLogDeleteOnExit = 1 And FileExists($GpsLogLocation) Then FileDelete($GpsLogLocation) FileDelete($GoogleEarth_ActiveFile) FileDelete($GoogleEarth_DeadFile) FileDelete($GoogleEarth_GpsFile) @@ -3547,19 +3601,17 @@ Func _GraphToggle() ; Graph1 Button GUISetState(@SW_LOCK, $Vistumbler) ;lock gui - will be unlocked by _SetControlSizes If $Graph = 1 Then $Graph = 0 - GUICtrlSetData($GraphButton1, $Text_Graph1) - GUICtrlSetBkColor($GraphButton1, $ButtonInactiveColor) - ElseIf $Graph = 2 Then - $Graph = 1 - GUISwitch($Vistumbler) - GUICtrlSetData($GraphButton1, $Text_NoGraph) - GUICtrlSetBkColor($GraphButton1, $ButtonActiveColor) - GUICtrlSetData($GraphButton2, $Text_Graph2) - GUICtrlSetBkColor($GraphButton2, $ButtonInactiveColor) - ElseIf $Graph = 0 Then + GUICtrlSetState($ShowGraph1, $GUI_UNCHECKED) + GUICtrlSetState($line_graph_Image, $GUI_SHOW) + GUICtrlSetState($line_graph_Image_alt, $GUI_HIDE) + Else $Graph = 1 - GUICtrlSetData($GraphButton1, $Text_NoGraph) - GUICtrlSetBkColor($GraphButton1, $ButtonActiveColor) + GUICtrlSetState($ShowGraph1, $GUI_CHECKED) + GUICtrlSetState($ShowGraph2, $GUI_UNCHECKED) + GUICtrlSetState($line_graph_Image_alt, $GUI_SHOW) + GUICtrlSetState($bar_graph_Image, $GUI_SHOW) + GUICtrlSetState($line_graph_Image, $GUI_HIDE) + GUICtrlSetState($bar_graph_Image_alt, $GUI_HIDE) EndIf _SetControlSizes() EndFunc ;==>_GraphToggle @@ -3568,18 +3620,17 @@ Func _GraphToggle2() ; Graph2 Button If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_GraphToggle2()') ;#Debug Display If $Graph = 2 Then $Graph = 0 - GUICtrlSetData($GraphButton2, $Text_Graph2) - GUICtrlSetBkColor($GraphButton2, $ButtonInactiveColor) - ElseIf $Graph = 1 Then - $Graph = 2 - GUICtrlSetData($GraphButton2, $Text_NoGraph) - GUICtrlSetBkColor($GraphButton2, $ButtonActiveColor) - GUICtrlSetData($GraphButton1, $Text_Graph1) - GUICtrlSetBkColor($GraphButton1, $ButtonInactiveColor) - ElseIf $Graph = 0 Then + GUICtrlSetState($ShowGraph2, $GUI_UNCHECKED) + GUICtrlSetState($bar_graph_Image, $GUI_SHOW) + GUICtrlSetState($bar_graph_Image_alt, $GUI_HIDE) + Else $Graph = 2 - GUICtrlSetData($GraphButton2, $Text_NoGraph) - GUICtrlSetBkColor($GraphButton2, $ButtonActiveColor) + GUICtrlSetState($ShowGraph2, $GUI_CHECKED) + GUICtrlSetState($ShowGraph1, $GUI_UNCHECKED) + GUICtrlSetState($bar_graph_Image_alt, $GUI_SHOW) + GUICtrlSetState($line_graph_Image, $GUI_SHOW) + GUICtrlSetState($bar_graph_Image, $GUI_HIDE) + GUICtrlSetState($line_graph_Image_alt, $GUI_HIDE) EndIf _SetControlSizes() EndFunc ;==>_GraphToggle2 @@ -3588,15 +3639,24 @@ Func _MinimalGuiModeToggle() If $MinimalGuiMode = 1 Then $MinimalGuiMode = 0 GUICtrlSetState($GuiMinimalGuiMode, $GUI_UNCHECKED) + GUICtrlSetState($GraphViewOptions, $GUI_ENABLE) GUICtrlSetData($msgdisplay, "Restoring GUI") _UpdateListview(1) $a = WinGetPos($Vistumbler) - WinMove($title, "", $a[0], $a[1], $a[2], $MinimalGuiExitHeight) ;Resize window to Minimal GUI Height + WinMove($title, "", $a[0], $a[1], $a[2], $MinimalGuiExitHeight) ;Resize window to Full GUI Height GUICtrlSetData($msgdisplay, "") + ;re-enable graph buttons + GUICtrlSetState($line_graph_Image, $GUI_SHOW) + GUICtrlSetState($line_graph_Image_alt, $GUI_HIDE) + GUICtrlSetState($line_graph_Image_disabled, $GUI_HIDE) + GUICtrlSetState($bar_graph_Image, $GUI_SHOW) + GUICtrlSetState($bar_graph_Image_alt, $GUI_HIDE) + GUICtrlSetState($bar_graph_Image_disabled, $GUI_HIDE) Else $MinimalGuiMode = 1 $ClearListAndTree = 1 GUICtrlSetState($GuiMinimalGuiMode, $GUI_CHECKED) + GUICtrlSetState($GraphViewOptions, $GUI_DISABLE) If $VistumblerState = "Maximized" Then WinSetState($title, "", @SW_RESTORE) $VistumblerState = "Window" @@ -3605,7 +3665,14 @@ Func _MinimalGuiModeToggle() $MinimalGuiExitHeight = $a[3] $b = _WinAPI_GetClientRect($Vistumbler) $titlebar_height = $a[3] - (DllStructGetData($b, "Bottom") - DllStructGetData($b, "Top")) - WinMove($title, "", $a[0], $a[1], $a[2], $titlebar_height + 65) ;Resize window to Minimal GUI Height + WinMove($title, "", $a[0], $a[1], $a[2], $titlebar_height + 72) ;Resize window to Minimal GUI Height + ;re-enable graph buttons + GUICtrlSetState($line_graph_Image, $GUI_HIDE) + GUICtrlSetState($line_graph_Image_alt, $GUI_HIDE) + GUICtrlSetState($line_graph_Image_disabled, $GUI_SHOW) + GUICtrlSetState($bar_graph_Image, $GUI_HIDE) + GUICtrlSetState($bar_graph_Image_alt, $GUI_HIDE) + GUICtrlSetState($bar_graph_Image_disabled, $GUI_SHOW) EndIf EndFunc ;==>_MinimalGuiModeToggle @@ -4038,11 +4105,12 @@ Func _GetGPS() ; Recieves data from gps device While 1 ;Loop to extract gps data untill location is found or timout time is reached If $UseGPS = 0 Then ExitLoop If $GpsType = 0 Then ;Use CommMG - $dataline = StringStripWS(_CommGetLine(@CR, 500, $maxtime), 8) ;Read data line from GPS + $dataline = StringStripWS(_CommGetLine(@CR, 768, $maxtime), 8) ;Read data line from GPS + If $GpsLogEnabled = 1 Then _LogGpsToFile($dataline) If $GpsDetailsOpen = 1 Then GUICtrlSetData($GpsCurrentDataGUI, $dataline) ;Show data line in "GPS Details" GUI if it is open If StringInStr($dataline, '$') And StringInStr($dataline, '*') Then ;Check if string containts start character ($) and checsum character (*). If it does not have them, ignore the data $FoundData = 1 - If StringInStr($dataline, "$GPGGA") Then + If StringInStr($dataline, "$GPGGA") Or StringInStr($dataline, "$GNGGA") Then _GPGGA($dataline) ;Split GPGGA data from data string $disconnected_time = -1 ElseIf StringInStr($dataline, "$GPRMC") Then @@ -4060,9 +4128,10 @@ Func _GetGPS() ; Recieves data from gps device $gps = StringSplit($inputdata, @CR) ;Split data string by CR and put data into the $gps array For $readloop = 1 To $gps[0] ;go through array $gpsline = StringStripWS($gps[$readloop], 3) + If $GpsLogEnabled = 1 Then _LogGpsToFile($gpsline) If $GpsDetailsOpen = 1 Then GUICtrlSetData($GpsCurrentDataGUI, $gpsline) ;Show data line in "GPS Details" GUI if it is open If StringInStr($gpsline, '$') And StringInStr($gpsline, '*') Then ;Check if string containts start character ($) and checsum character (*). If it does not have them, ignore the data - If StringInStr($gpsline, "$GPGGA") Then + If StringInStr($gpsline, "$GPGGA") Or StringInStr($gpsline, "$GNGGA") Then _GPGGA($gpsline) ;Split GPGGA data from data string ElseIf StringInStr($gpsline, "$GPRMC") Then _GPRMC($gpsline) ;Split GPRMC data from data string @@ -4075,16 +4144,17 @@ Func _GetGPS() ; Recieves data from gps device EndIf EndIf ElseIf $GpsType = 2 Then ;Use Kernel32 - $gstring = StringStripWS(_rxwait($OpenedPort, '500', $maxtime), 8) ;Read data line from GPS + $gstring = StringStripWS(_rxwait($OpenedPort, '768', $maxtime), 8) ;Read data line from GPS $dataline = $gstring ; & $LastGpsString $LastGpsString = $gstring If StringInStr($dataline, '$') And StringInStr($dataline, '*') Then $FoundData = 1 $dlsplit = StringSplit($dataline, '$') For $gda = 1 To $dlsplit[0] + If $GpsLogEnabled = 1 Then _LogGpsToFile('$' & $dlsplit[$gda]) If $GpsDetailsOpen = 1 Then GUICtrlSetData($GpsCurrentDataGUI, $dlsplit[$gda]) ;Show data line in "GPS Details" GUI if it is open If StringInStr($dlsplit[$gda], '*') Then ;Check if string containts start character ($) and checsum character (*). If it does not have them, ignore the data - If StringInStr($dlsplit[$gda], "GPGGA") Then + If StringInStr($dlsplit[$gda], "GPGGA") Or StringInStr($dlsplit[$gda], "GNGGA") Then _GPGGA($dlsplit[$gda]) ;Split GPGGA data from data string $disconnected_time = -1 ElseIf StringInStr($dlsplit[$gda], "GPRMC") Then @@ -4346,6 +4416,17 @@ Func _GpsFormat($gps) ;Converts ddmm.mmmm to the users set gps format Return ($return) EndFunc ;==>_GpsFormat +Func _LogGpsToFile($data) + Local $hFileOpen = FileOpen($GpsLogLocation, $FO_APPEND) + If $hFileOpen = -1 Then + GUICtrlSetData($msgdisplay, $Text_NMEALogError) + Else + FileWriteLine($hFileOpen, $data & @CRLF) + FileClose($hFileOpen) + EndIf + +EndFunc ;==>_LogGpsToFile + ;------------------------------------------------------------------------------------------------------------------------------- ; GPS COMPASS GUI FUNCTIONS ;------------------------------------------------------------------------------------------------------------------------------- @@ -4865,16 +4946,13 @@ Func _SetControlSizes() ;Sets control positions in GUI based on the windows curr If $sizes <> $sizes_old Or $Graph <> $Graph_old Or $MinimalGuiMode <> $MinimalGuiMode_old Then $DataChild_Left = 2 $DataChild_Width = DllStructGetData($a, "Right") - $DataChild_Top = 65 + $DataChild_Top = 72 $DataChild_Height = DllStructGetData($a, "Bottom") - $DataChild_Top If $MinimalGuiMode = 1 Then GUISetState(@SW_LOCK, $Vistumbler) WinSetState($TreeviewAPs, "", @SW_HIDE) WinSetState($ListviewAPs, "", @SW_HIDE) GUISetState(@SW_HIDE, $GraphicGUI) - GUICtrlSetState($GraphButton1, $GUI_HIDE) - GUICtrlSetState($GraphButton2, $GUI_HIDE) - GUICtrlSetState($SaveAndClearButton, $GUI_SHOW) GUISetState(@SW_UNLOCK, $Vistumbler) ElseIf $Graph <> 0 Then $Graphic_left = $DataChild_Left @@ -4896,9 +4974,6 @@ Func _SetControlSizes() ;Sets control positions in GUI based on the windows curr WinSetState($TreeviewAPs, "", @SW_HIDE) WinSetState($ListviewAPs, "", @SW_SHOW) GUISetState(@SW_SHOW, $GraphicGUI) - GUICtrlSetState($GraphButton1, $GUI_SHOW) - GUICtrlSetState($GraphButton2, $GUI_SHOW) - GUICtrlSetState($SaveAndClearButton, $GUI_HIDE) GUISetState(@SW_UNLOCK, $Vistumbler) $Graphic = _GDIPlus_GraphicsCreateFromHWND($GraphicGUI) @@ -4921,8 +4996,6 @@ Func _SetControlSizes() ;Sets control positions in GUI based on the windows curr WinSetState($TreeviewAPs, "", @SW_SHOW) WinSetState($ListviewAPs, "", @SW_SHOW) GUISetState(@SW_HIDE, $GraphicGUI) - GUICtrlSetState($GraphButton1, $GUI_SHOW) - GUICtrlSetState($GraphButton2, $GUI_SHOW) GUISetState(@SW_UNLOCK, $Vistumbler) EndIf $sizes_old = $sizes @@ -5225,87 +5298,104 @@ Func _GraphDraw() $ListRowMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) $GraphApID = $ListRowMatchArray[1][1] If $Graph = 1 Then - $max_graph_points = '125' + $max_graph_points = '50' $query = "SELECT TOP " & $max_graph_points & " Signal, RSSI, ApID, Date1, Time1 FROM Hist WHERE ApID=" & $GraphApID & " And Signal<>0 ORDER BY Date1, Time1 Desc" $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) $HistSize = UBound($HistMatchArray) - 1 If $HistSize <> 0 Then - If $HistSize < $max_graph_points Then $max_graph_points = $HistSize ;Fix to prevent graph from drawing outside its region when the are 0% marks - Local $graph_point_center_y, $graph_point_center_x, $Found_dts, $gloop - Local $GraphWidthSpacing = $Graph_width / ($HistSize - 1) + ;If $HistSize < $max_graph_points Then $max_graph_points = $HistSize ;Fix to prevent graph from drawing outside its region when the are 0% marks + Local $graph_point_center_y, $graph_point_center_x, $Found_dts, $gloop, $Exp_Datetime + Local $GraphWidthSpacing = $Graph_width / ($max_graph_points - 1) + ConsoleWrite($GraphWidthSpacing & @CRLF) Local $GraphHeightSpacing = $Graph_height / 100 For $gs = 1 To $HistSize - $gloop += 1 - If $gloop > $max_graph_points Then ExitLoop $ExpSig = $HistMatchArray[$gs][1] - 0 $ExpRSSI = $HistMatchArray[$gs][2] $ExpApID = $HistMatchArray[$gs][3] - $ExpDate = $HistMatchArray[$gs][4] - - $Last_dts = $Found_dts - $ts = StringSplit($HistMatchArray[$gs][5], ":") - $ExpTime = ($ts[1] * 3600) + ($ts[2] * 60) + StringTrimRight($ts[3], 4) ;In seconds - $Found_dts = StringReplace($ExpDate & $ExpTime, '-', '') - - - $old_graph_point_center_x = $graph_point_center_x - $old_graph_point_center_y = $graph_point_center_y - $graph_point_center_x = ($Graph_leftborder + $Graph_width) - ($GraphWidthSpacing * ($gloop - 1)) - If $UseRssiInGraphs = 1 Then - $graph_point_center_y = $Graph_topborder + ($Graph_height - ($GraphHeightSpacing * (100 + $ExpRSSI))) - ;ConsoleWrite($graph_point_center_y & @CRLF) - Else - $graph_point_center_y = $Graph_topborder + ($Graph_height - ($GraphHeightSpacing * $ExpSig)) - EndIf - - ;Draw Point - _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y - 1, $graph_point_center_x + 1, $graph_point_center_y - 1, $Pen_Red) - _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y, $graph_point_center_x + 1, $graph_point_center_y, $Pen_Red) - _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y + 1, $graph_point_center_x + 1, $graph_point_center_y + 1, $Pen_Red) - - ;Draw Connecting line - If $gs <> 1 Then - ;Draw Connecting line - _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $old_graph_point_center_x, $old_graph_point_center_y, $graph_point_center_x, $graph_point_center_y, $Pen_Red) - ;Draw any gaps that may exist (AP at 0%) - If ($Last_dts - $Found_dts) > $TimeBeforeMarkedDead Then - If $GraphDeadTime = 1 Then - $numofzeros = ($Last_dts - $Found_dts) - $TimeBeforeMarkedDead - For $wz = 1 To $numofzeros - $gloop += 1 - If $gloop > $max_graph_points Then ExitLoop + $Last_Datetime = $Exp_Datetime + $Exp_Datetime = StringTrimRight($HistMatchArray[$gs][4] & ' ' & $HistMatchArray[$gs][5], 4) + If $gs = 1 Then + $Cur_Datetime = StringTrimRight($datestamp & ' ' & $timestamp, 4) + $DateDiffInSecondsFromNow = _DateDiff('s', $Exp_Datetime, $Cur_Datetime) + ConsoleWrite("$DateDiffInSecondsFromNow:" & $DateDiffInSecondsFromNow & " - " & $Exp_Datetime & " - " & $Cur_Datetime & @CRLF) + If $DateDiffInSecondsFromNow >= 1 And $GraphDeadTime = 1 Then + For $az = 1 To $DateDiffInSecondsFromNow + If $gloop = 0 Then + $graph_point_center_x = $Graph_leftborder + $Graph_width + $graph_point_center_y = $Graph_topborder + $Graph_height + ;Draw Point + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y - 1, $graph_point_center_x + 1, $graph_point_center_y - 1, $Pen_Red) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y, $graph_point_center_x + 1, $graph_point_center_y, $Pen_Red) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y + 1, $graph_point_center_x + 1, $graph_point_center_y + 1, $Pen_Red) + Else $old_graph_point_center_x = $graph_point_center_x $old_graph_point_center_y = $graph_point_center_y - $graph_point_center_x = ($Graph_leftborder + $Graph_width) - ($GraphWidthSpacing * ($gloop - 1)) + $graph_point_center_x = ($Graph_leftborder + $Graph_width) - ($GraphWidthSpacing * $gloop) $graph_point_center_y = $Graph_topborder + $Graph_height - ;Draw Point _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y - 1, $graph_point_center_x + 1, $graph_point_center_y - 1, $Pen_Red) _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y, $graph_point_center_x + 1, $graph_point_center_y, $Pen_Red) _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y + 1, $graph_point_center_x + 1, $graph_point_center_y + 1, $Pen_Red) - ;Draw Line _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $old_graph_point_center_x, $old_graph_point_center_y, $graph_point_center_x, $graph_point_center_y, $Pen_Red) - Next - Else + EndIf $gloop += 1 - If $gloop > $max_graph_points Then ExitLoop - + If $gloop = $max_graph_points Then ExitLoop + Next + If $gloop = $max_graph_points Then ExitLoop + Else + $graph_point_center_x = ($Graph_leftborder + $Graph_width) - ($GraphWidthSpacing * $gloop) + If $UseRssiInGraphs = 1 Then + $graph_point_center_y = $Graph_topborder + ($Graph_height - ($GraphHeightSpacing * (100 + $ExpRSSI))) + Else + $graph_point_center_y = $Graph_topborder + ($Graph_height - ($GraphHeightSpacing * $ExpSig)) + EndIf + ;Draw Point + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y - 1, $graph_point_center_x + 1, $graph_point_center_y - 1, $Pen_Red) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y, $graph_point_center_x + 1, $graph_point_center_y, $Pen_Red) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y + 1, $graph_point_center_x + 1, $graph_point_center_y + 1, $Pen_Red) + $gloop += 1 + If $gloop = $max_graph_points Then ExitLoop + EndIf + Else + $DateDiffInSeconds = _DateDiff('s', $Exp_Datetime, $Last_Datetime) + ;Add in blank values for dead time, if the option is selected + If $DateDiffInSeconds >= $TimeBeforeMarkedDead And $GraphDeadTime = 1 Then + For $az = 1 To $DateDiffInSeconds $old_graph_point_center_x = $graph_point_center_x $old_graph_point_center_y = $graph_point_center_y - $graph_point_center_x = ($Graph_leftborder + $Graph_width) - ($GraphWidthSpacing * ($gloop - 1)) + $graph_point_center_x = ($Graph_leftborder + $Graph_width) - ($GraphWidthSpacing * $gloop) $graph_point_center_y = $Graph_topborder + $Graph_height - ;Draw Point _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y - 1, $graph_point_center_x + 1, $graph_point_center_y - 1, $Pen_Red) _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y, $graph_point_center_x + 1, $graph_point_center_y, $Pen_Red) _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y + 1, $graph_point_center_x + 1, $graph_point_center_y + 1, $Pen_Red) - ;Draw Line _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $old_graph_point_center_x, $old_graph_point_center_y, $graph_point_center_x, $graph_point_center_y, $Pen_Red) - EndIf + $gloop += 1 + If $gloop = $max_graph_points Then ExitLoop + Next + If $gloop = $max_graph_points Then ExitLoop EndIf + + $old_graph_point_center_x = $graph_point_center_x + $old_graph_point_center_y = $graph_point_center_y + $graph_point_center_x = ($Graph_leftborder + $Graph_width) - ($GraphWidthSpacing * $gloop) + If $UseRssiInGraphs = 1 Then + $graph_point_center_y = $Graph_topborder + ($Graph_height - ($GraphHeightSpacing * (100 + $ExpRSSI))) + Else + $graph_point_center_y = $Graph_topborder + ($Graph_height - ($GraphHeightSpacing * $ExpSig)) + EndIf + ;Draw Point + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y - 1, $graph_point_center_x + 1, $graph_point_center_y - 1, $Pen_Red) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y, $graph_point_center_x + 1, $graph_point_center_y, $Pen_Red) + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_point_center_x - 1, $graph_point_center_y + 1, $graph_point_center_x + 1, $graph_point_center_y + 1, $Pen_Red) + ;Draw Line + _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $old_graph_point_center_x, $old_graph_point_center_y, $graph_point_center_x, $graph_point_center_y, $Pen_Red) + + $gloop += 1 + If $gloop = $max_graph_points Then ExitLoop EndIf Next EndIf @@ -5315,7 +5405,7 @@ Func _GraphDraw() $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) $HistSize = UBound($HistMatchArray) - 1 If $HistSize <> 0 Then - Local $Found_dts, $gloop + Local $Found_dts, $gloop, $Exp_Datetime Local $GraphWidthSpacing = $Graph_width / $max_graph_points Local $GraphHeightSpacing = $Graph_height / 100 For $gs = 1 To $HistSize @@ -5324,12 +5414,21 @@ Func _GraphDraw() $ExpSig = $HistMatchArray[$gs][1] - 0 $ExpRSSI = $HistMatchArray[$gs][2] $ExpApID = $HistMatchArray[$gs][3] - $ExpDate = $HistMatchArray[$gs][4] - - $Last_dts = $Found_dts - $ts = StringSplit($HistMatchArray[$gs][5], ":") - $ExpTime = ($ts[1] * 3600) + ($ts[2] * 60) + StringTrimRight($ts[3], 4) ;In seconds - $Found_dts = StringReplace($ExpDate & $ExpTime, '-', '') + $Last_Datetime = $Exp_Datetime + $Exp_Datetime = StringTrimRight($HistMatchArray[$gs][4] & ' ' & $HistMatchArray[$gs][5], 4) + + If $gs = 1 And $GraphDeadTime = 1 Then + $Cur_Datetime = StringTrimRight($datestamp & ' ' & $timestamp, 4) + $DateDiffInSecondsFromNow = _DateDiff('s', $Exp_Datetime, $Cur_Datetime) + ConsoleWrite("$DateDiffInSecondsFromNow:" & $DateDiffInSecondsFromNow & " - " & $Exp_Datetime & " - " & $Cur_Datetime & @CRLF) + If $DateDiffInSecondsFromNow >= $TimeBeforeMarkedDead Then + For $az = 1 To $DateDiffInSecondsFromNow + $gloop += 1 + If $gloop > $max_graph_points Then ExitLoop + Next + If $gloop > $max_graph_points Then ExitLoop + EndIf + EndIf ;Draw line for signal strength If $UseRssiInGraphs = 1 Then @@ -5343,21 +5442,16 @@ Func _GraphDraw() _GDIPlus_GraphicsDrawLine($Graph_backbuffer, $graph_line_top_x, $graph_line_top_y, $graph_line_bottom_x, $graph_line_bottom_y, $Pen_Red) ;increment $gloop for any gaps that may exist (AP at 0%) - If $gs <> 1 Then - If ($Last_dts - $Found_dts) > $TimeBeforeMarkedDead Then - If $GraphDeadTime = 1 Then - $numofzeros = ($Last_dts - $Found_dts) - $TimeBeforeMarkedDead - For $wz = 1 To $numofzeros - $gloop += 1 - If $gloop > $max_graph_points Then ExitLoop - Next - Else + If $gs <> 1 And $GraphDeadTime = 1 Then + $DateDiffInSeconds = _DateDiff('s', $Exp_Datetime, $Last_Datetime) + If $DateDiffInSeconds >= $TimeBeforeMarkedDead Then + For $az = 1 To $DateDiffInSeconds $gloop += 1 If $gloop > $max_graph_points Then ExitLoop - EndIf + Next + If $gloop = $max_graph_points Then ExitLoop EndIf EndIf - Next EndIf EndIf @@ -6972,6 +7066,7 @@ Func _AutoSaveAndClear() ;Autosaves data to a file name based on current time If $expvs1 = 1 Then GUICtrlSetData($msgdisplay, "File Exported Successfully. Clearing List") _ClearAll() + $newdata = 0 Else GUICtrlSetData($msgdisplay, "Error Saving File. List will not be cleared.") EndIf @@ -7137,17 +7232,18 @@ EndFunc ;==>_ExportCsvFilteredData Func _ExportCsvDataGui($Gui_CsvFilter = 0) ;Saves data to a selected file If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportCsvDataGui()') ;#Debug Display - $Gui_Csv = GUICreate($Text_ExportToCSV, 543, 132) + $Gui_Csv = GUICreate($Text_ExportToCSV, 543, 150) GUISetBkColor($BackgroundColor) $Gui_CsvFile = GUICtrlCreateInput($SaveDir & $ldatetimestamp & '.csv', 20, 20, 409, 21) $GUI_CsvSaveAs = GUICtrlCreateButton($Text_Browse, 440, 20, 81, 22, $WS_GROUP) $Gui_CsvRadDetailed = GUICtrlCreateRadio($Text_DetailedCsvFile, 20, 50, 250, 20) GUICtrlSetState($Gui_CsvRadDetailed, $GUI_CHECKED) $Gui_CsvRadSummary = GUICtrlCreateRadio($Text_SummaryCsvFile, 20, 70, 250, 20) + $Gui_CsvRadWigle = GUICtrlCreateRadio($Text_WigleCsvFile, 20, 90, 250, 20) $Gui_CsvFiltered = GUICtrlCreateCheckbox($Text_Filtered, 300, 50, 250, 20) If $Gui_CsvFilter = 1 Then GUICtrlSetState($Gui_CsvFiltered, $GUI_CHECKED) - $Gui_CsvOk = GUICtrlCreateButton($Text_Ok, 128, 95, 97, 25, $WS_GROUP) - $Gui_CsvCancel = GUICtrlCreateButton($Text_Cancel, 290, 95, 97, 25, $WS_GROUP) + $Gui_CsvOk = GUICtrlCreateButton($Text_Ok, 128, 115, 97, 25, $WS_GROUP) + $Gui_CsvCancel = GUICtrlCreateButton($Text_Cancel, 290, 115, 97, 25, $WS_GROUP) GUISetState(@SW_SHOW) GUICtrlSetOnEvent($GUI_CsvSaveAs, "_ExportCsvDataGui_SaveAs") GUICtrlSetOnEvent($Gui_CsvOk, "_ExportCsvDataGui_Ok") @@ -7158,20 +7254,33 @@ EndFunc ;==>_ExportCsvDataGui Func _ExportCsvDataGui_Ok() If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportCsvDataGui_Ok()') ;#Debug Display $filename = GUICtrlRead($Gui_CsvFile) - If GUICtrlRead($Gui_CsvRadSummary) = 1 Then - $CsvDetailed = 0 + $CsvWigleWifi = 0 + $CsvDetailed = 0 + $CsvFiltered = 0 + If GUICtrlRead($Gui_CsvRadWigle) = 1 Then + $CsvWigleWifi = 1 Else + $CsvWigleWifi = 0 + EndIf + If GUICtrlRead($Gui_CsvRadDetailed) = 1 Then $CsvDetailed = 1 + Else + $CsvDetailed = 0 EndIf If GUICtrlRead($Gui_CsvFiltered) = 1 Then $CsvFiltered = 1 Else $CsvFiltered = 0 EndIf + _ExportCsvDataGui_Close() If StringInStr($filename, '.csv') = 0 Then $filename = $filename & '.csv' - $saved = _ExportToCSV($filename, $CsvFiltered, $CsvDetailed) + If $CsvWigleWifi = 1 Then + $saved = _ExportToWigleCSV($filename, $CsvFiltered) + Else + $saved = _ExportToCSV($filename, $CsvFiltered, $CsvDetailed) + EndIf If $saved = 1 Then MsgBox(0, $Text_Done, $Text_SavedAs & ': "' & $filename & '"') Else @@ -7298,6 +7407,114 @@ Func _ExportToCSV($savefile, $Filter = 0, $Detailed = 0) ;writes vistumbler data EndIf EndFunc ;==>_ExportToCSV +Func _ExportToWigleCSV($savefile, $Filter = 0) ;writes vistumbler data to a csv file + ConsoleWrite("$Filter:" & $Filter & @CRLF) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ExportToCSV()') ;#Debug Display + If $Filter = 1 Then + $query = $AddQuery + Else + $query = "SELECT ApID, SSID, BSSID, NETTYPE, RADTYPE, CHAN, AUTH, ENCR, SecType, BTX, OTX, HighSignal, HighRSSI, MANU, LABEL, HighGpsHistID, FirstHistID, LastHistID, LastGpsID, Active FROM AP" + EndIf + + $dev_model = "" + $dev_brand = "" + $dev_version = "" + $wbemFlagReturnImmediately = 0x10 + $wbemFlagForwardOnly = 0x20 + $objWMIService = ObjGet("winmgmts:\\.\root\CIMV2") + $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystemProduct", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) + If IsObj($colItems) Then + For $objItem In $colItems + $dev_model = $objItem.Name + $dev_brand = $objItem.Vendor + $dev_version = $objItem.Version + Next + EndIf + + $file = "WigleWifi-1.4,appRelease=" & StringReplace($Script_Name, ",", "") & " " & StringReplace($version, ",", "") & ",model=" & StringReplace($DefaultApapterDesc, ",", "") & ",release=" & StringReplace($dev_version, ",", "") & ",device=" & StringReplace($dev_model, ",", "") & ",display=,board=,brand=" & StringReplace($dev_brand, ",", "") & @LF + $file &= "MAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type" & @LF + $ApMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundApMatch = UBound($ApMatchArray) - 1 + If $FoundApMatch > 0 Then + For $exp = 1 To $FoundApMatch + GUICtrlSetData($msgdisplay, $Text_SavingLine & ' ' & $exp & ' / ' & $FoundApMatch) + $ExpApID = $ApMatchArray[$exp][1] + $ExpSSID = $ApMatchArray[$exp][2] + $ExpBSSID = StringLower($ApMatchArray[$exp][3]) + $ExpNET = $ApMatchArray[$exp][4] + $ExpRAD = $ApMatchArray[$exp][5] + $ExpCHAN = $ApMatchArray[$exp][6] + $ExpAUTH = $ApMatchArray[$exp][7] + $ExpENCR = $ApMatchArray[$exp][8] + $ExpSECTYPE = $ApMatchArray[$exp][9] + $ExpBTX = $ApMatchArray[$exp][10] + $ExpOTX = $ApMatchArray[$exp][11] + $ExpHighSig = $ApMatchArray[$exp][12] + $ExpHighRSSI = $ApMatchArray[$exp][13] + $ExpMANU = $ApMatchArray[$exp][14] + $ExpLAB = $ApMatchArray[$exp][15] + $ExpHighGpsID = $ApMatchArray[$exp][16] + $ExpFirstID = $ApMatchArray[$exp][17] + $ExpLastID = $ApMatchArray[$exp][18] + + ;Get All Signals and GpsIDs for current ApID + $query = "SELECT GpsID, Signal, RSSI FROM Hist WHERE ApID=" & $ExpApID & " And Signal<>0 ORDER BY Date1, Time1" + $HistMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundHistMatch = UBound($HistMatchArray) - 1 + For $exph = 1 To $FoundHistMatch + $ExpGID = $HistMatchArray[$exph][1] + $ExpSig = $HistMatchArray[$exph][2] + $ExpRSSI = $HistMatchArray[$exph][3] + ;Get GPS Data Based on GpsID + $query = "SELECT Latitude, Longitude, HorDilPitch, Alt, TrackAngle, Date1, Time1 FROM GPS WHERE GpsID=" & $ExpGID + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $ExpLat = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][1]), 'S', '-'), 'N', ''), ' ', '') + $ExpLon = StringReplace(StringReplace(StringReplace(_Format_GPS_DMM_to_DDD($GpsMatchArray[1][2]), 'W', '-'), 'E', ''), ' ', '') + $ExpHDOP = $GpsMatchArray[1][3] + $ExpAlt = $GpsMatchArray[1][4] + $ExpTrack = $GpsMatchArray[1][5] + $ExpDate = $GpsMatchArray[1][6] + $ExpTime = StringTrimRight($GpsMatchArray[1][7], 4) + $Exp_Accuracy = $ExpHDOP * 5 + + $ExpFlags = "" + If $ExpAUTH = "WPA2-Enterprise" And $ExpENCR = "CCMP" Then + $ExpFlags &= "[WPA2-EAP-CCMP]" + ElseIf $ExpAUTH = "WPA-Enterprise" And $ExpENCR = "CCMP" Then + $ExpFlags &= "[WPA-EAP-CCMP]" + ElseIf $ExpAUTH = "WPA2-Personal" And $ExpENCR = "CCMP" Then + $ExpFlags &= "[WPA2-PSK-CCMP]" + ElseIf $ExpAUTH = "WPA-Personal" And $ExpENCR = "CCMP" Then + $ExpFlags &= "[WPA-PSK-CCMP]" + ElseIf $ExpAUTH = "WPA2-Enterprise" And $ExpENCR = "TKIP" Then + $ExpFlags &= "[WPA2-EAP-TKIP]" + ElseIf $ExpAUTH = "WPA-Enterprise" And $ExpENCR = "TKIP" Then + $ExpFlags &= "[WPA-EAP-TKIP]" + ElseIf $ExpAUTH = "WPA2-Personal" And $ExpENCR = "TKIP" Then + $ExpFlags &= "[WPA2-PSK-TKIP]" + ElseIf $ExpAUTH = "WPA-Personal" And $ExpENCR = "TKIP" Then + $ExpFlags &= "[WPA-PSK-TKIP]" + ElseIf $ExpAUTH = "Open" And $ExpENCR = "WEP" Then + $ExpFlags &= "[WEP]" + EndIf + + If $ExpNET = $SearchWord_Adhoc Or $ExpNET = "Ad Hoc" Then + $ExpFlags += "[IBSS]" + EndIf + ;Write wigle wifi csv line + $file &= $ExpBSSID & "," & StringReplace($ExpSSID, ",", "") & "," & $ExpFlags & "," & $ExpDate & " " & $ExpTime & "," & $ExpCHAN & "," & $ExpRSSI & "," & $ExpLat & "," & $ExpLon & "," & $ExpAlt & "," & $Exp_Accuracy & ",WIFI" & @LF + + Next + Next + $savefile = FileOpen($savefile, 128 + 2) ;Open in UTF-8 write mode + FileWrite($savefile, $file) + FileClose($savefile) + Return (1) + Else + Return (0) + EndIf +EndFunc ;==>_ExportToWigleCSV + Func _SaveToGPX() If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_SaveToGPX()') ;#Debug Display Opt("GUIOnEventMode", 0) @@ -7630,6 +7847,9 @@ Func _WriteINI() IniWrite($settings, 'GpsSettings', 'GpsTimeout', $GpsTimeout) IniWrite($settings, 'GpsSettings', 'GpsDisconnect', $GpsDisconnect) IniWrite($settings, 'GpsSettings', 'GpsReset', $GpsReset) + IniWrite($settings, 'GpsSettings', 'GpsLogLocation', $GpsLogLocation) + IniWrite($settings, 'GpsSettings', 'GpsLogEnabled', $GpsLogEnabled) + IniWrite($settings, 'GpsSettings', 'GpsLogDeleteOnExit', $GpsLogDeleteOnExit) IniWrite($settings, "AutoSort", "AutoSortTime", $SortTime) IniWrite($settings, "AutoSort", "AutoSort", $AutoSort) @@ -7945,6 +8165,7 @@ Func _WriteINI() IniWrite($DefaultLanguagePath, 'GuiText', 'Error', $Text_Error) IniWrite($DefaultLanguagePath, 'GuiText', 'NoSignalHistory', $Text_NoSignalHistory) IniWrite($DefaultLanguagePath, 'GuiText', 'NoApSelected', $Text_NoApSelected) + IniWrite($DefaultLanguagePath, 'GuiText', 'UseKernel32', $Text_UseKernel32) IniWrite($DefaultLanguagePath, 'GuiText', 'UseNetcomm', $Text_UseNetcomm) IniWrite($DefaultLanguagePath, 'GuiText', 'UseCommMG', $Text_UseCommMG) IniWrite($DefaultLanguagePath, 'GuiText', 'SignalHistory', $Text_SignalHistory) @@ -7953,6 +8174,8 @@ Func _WriteINI() IniWrite($DefaultLanguagePath, 'GuiText', 'Ascending', $Text_Ascending) IniWrite($DefaultLanguagePath, 'GuiText', 'Decending', $Text_Decending) IniWrite($DefaultLanguagePath, 'GuiText', 'AutoRecoveryVS1', $Text_AutoRecoveryVS1) + IniWrite($DefaultLanguagePath, 'GuiText', 'AutoSaveAndClear', $Text_AutoSaveAndClear) + IniWrite($DefaultLanguagePath, 'GuiText', 'SaveAndClear', $Text_SaveAndClear) IniWrite($DefaultLanguagePath, 'GuiText', 'AutoSaveEvery', $Text_AutoSaveEvery) IniWrite($DefaultLanguagePath, 'GuiText', 'DelAutoSaveOnExit', $Text_DelAutoSaveOnExit) IniWrite($DefaultLanguagePath, 'GuiText', 'OpenSaveFolder', $Text_OpenSaveFolder) @@ -8101,7 +8324,6 @@ Func _WriteINI() IniWrite($DefaultLanguagePath, 'GuiText', 'AddingApsIntoList', $Text_AddingApsIntoList) IniWrite($DefaultLanguagePath, 'GuiText', 'GoogleEarthDoesNotExist', $Text_GoogleEarthDoesNotExist) IniWrite($DefaultLanguagePath, 'GuiText', 'AutoKmlIsNotStarted', $Text_AutoKmlIsNotStarted) - IniWrite($DefaultLanguagePath, 'GuiText', 'UseKernel32', $Text_UseKernel32) IniWrite($DefaultLanguagePath, 'GuiText', 'UnableToGuessSearchwords', $Text_UnableToGuessSearchwords) IniWrite($DefaultLanguagePath, 'GuiText', 'SelectedAP', $Text_SelectedAP) IniWrite($DefaultLanguagePath, 'GuiText', 'AllAPs', $Text_AllAPs) @@ -8208,6 +8430,11 @@ Func _WriteINI() IniWrite($DefaultLanguagePath, 'GuiText', 'ButtonInactiveColor', $Text_ButtonInactiveColor) IniWrite($DefaultLanguagePath, 'GuiText', 'Text', $Text_Text) IniWrite($DefaultLanguagePath, 'GuiText', 'GUITextSize', $Text_GUITextSize) + IniWrite($DefaultLanguagePath, 'GuiText', 'GPSLogging', $Text_GPSLogging) + IniWrite($DefaultLanguagePath, 'GuiText', 'SaveNMEAData', $Text_SaveNMEAData) + IniWrite($DefaultLanguagePath, 'GuiText', 'DeleteNMEAlog', $Text_DeleteNMEAlog) + IniWrite($DefaultLanguagePath, 'GuiText', 'LogFileLocation', $Text_LogFileLocation) + IniWrite($DefaultLanguagePath, 'GuiText', 'NMEALogError', $Text_NMEALogError) EndFunc ;==>_WriteINI ;------------------------------------------------------------------------------------------------------------------------------- @@ -8275,8 +8502,9 @@ Func _LoadListGUI($imfile1 = "") $RadCsv = GUICtrlCreateRadio($Text_DetailedCsvFile & ' (CSV)', 10, 60, 240, 20) $RadNs = GUICtrlCreateRadio($Text_NetstumblerTxtFile & ' (TXT, NS1)', 255, 40, 240, 20) $RadWD = GUICtrlCreateRadio($Text_WardriveDb3File & ' (DB3)', 255, 60, 240, 20) - $NsOk = GUICtrlCreateButton($Text_Ok, 95, 95, 150, 25, $WS_GROUP) - $NsCancel = GUICtrlCreateButton($Text_Close, 255, 95, 150, 25, $WS_GROUP) + $RadWigle = GUICtrlCreateRadio($Text_WigleCsvFile & ' (CSV)', 255, 80, 240, 20) + $NsOk = GUICtrlCreateButton($Text_Ok, 95, 105, 150, 25, $WS_GROUP) + $NsCancel = GUICtrlCreateButton($Text_Close, 255, 105, 150, 25, $WS_GROUP) $progressbar = GUICtrlCreateProgress(10, 135, 480, 20) $percentlabel = GUICtrlCreateLabel($Text_Progress & ': ' & $Text_Ready, 10, 165, 230, 20) $linetotal = GUICtrlCreateLabel($Text_LineTotal & ':', 10, 190, 250, 20) @@ -8306,7 +8534,10 @@ Func _ImportFileBrowse() $file = FileOpenDialog($Text_VistumblerFile, $SaveDir, $Text_NetstumblerTxtFile & ' (*.txt;*.ns1)', 1) If Not @error Then GUICtrlSetData($vistumblerfileinput, $file) ElseIf GUICtrlRead($RadWD) = 1 Then - $file = FileOpenDialog($Text_VistumblerFile, $SaveDir, "Wardrive-android file" & ' (*.db3)', 1) + $file = FileOpenDialog($Text_VistumblerFile, $SaveDir, $Text_WardriveDb3File & ' (*.db3)', 1) + If Not @error Then GUICtrlSetData($vistumblerfileinput, $file) + ElseIf GUICtrlRead($RadWigle) = 1 Then + $file = FileOpenDialog($Text_VistumblerFile, $SaveDir, $Text_WigleCsvFile & ' (*.csv)', 1) If Not @error Then GUICtrlSetData($vistumblerfileinput, $file) EndIf EndFunc ;==>_ImportFileBrowse @@ -8347,6 +8578,8 @@ Func _ImportOk() _ImportNS1($loadfile) ElseIf GUICtrlRead($RadWD) = 1 Then _ImportWardriveDb3($loadfile) + ElseIf GUICtrlRead($RadWigle) = 1 Then + _ImportWigleCSV($loadfile) EndIf $min = (TimerDiff($begintime) / 60000) ;convert from miniseconds to minutes GUICtrlSetData($minutes, $Text_Minutes & ': ' & Round($min, 1)) @@ -8875,6 +9108,138 @@ Func _ImportCSV($CSVfile) EndIf EndFunc ;==>_ImportCSV +Func _ImportWigleCSV($CSVfile) + If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ImportWigleCSV()') ;#Debug Display + $vistumblerfile = FileOpen($CSVfile, 0) + If $vistumblerfile <> -1 Then + $begintime = TimerInit() + $currentline = 1 + $AddAP = 0 + $AddGID = 0 + ;Start Importing File + $CSVArray = _ParseCSV($CSVfile, ',|', '"') + $iSize = UBound($CSVArray) - 1 + $iCol = UBound($CSVArray, 2) + ConsoleWrite($iCol) + If $iCol = 11 Then ;Import Wigle Wifi Line + For $lc = 2 To $iSize + $currentline = $lc + $ImpBSSID = StringUpper($CSVArray[$lc][0]) + $ImpSSID = $CSVArray[$lc][1] + If StringLeft($ImpSSID, 1) = '"' And StringRight($ImpSSID, 1) = '"' Then $ImpSSID = StringTrimLeft(StringTrimRight($ImpSSID, 1), 1) + $ImpAuthMode = $CSVArray[$lc][2] + $ImpDateTime = $CSVArray[$lc][3] + $ImpCHAN = $CSVArray[$lc][4] + $ImpRSSI = $CSVArray[$lc][5] + $ImpSig = _DbToSignalPercent($ImpRSSI) + $ImpLat = _Format_GPS_DDD_to_DMM($CSVArray[$lc][6], "N", "S") + $ImpLon = _Format_GPS_DDD_to_DMM($CSVArray[$lc][7], "E", "W") + $ImpAlt = $CSVArray[$lc][8] + $ImpAccuracy = $CSVArray[$lc][9] + $ImpHDOP = $ImpAccuracy / 5 + $ImpType = $CSVArray[$lc][10] + + If $ImpType = "WIFI" And StringLeft($ImpDateTime, 4) <> "1969" Then + If StringInStr($ImpAuthMode, "WPA2") And StringInStr($ImpAuthMode, "CCMP") And StringInStr($ImpAuthMode, "EAP") Then + $ImpAUTH = "WPA2-Enterprise" + $ImpENCR = "CCMP" + $Found_SecType = 3 + ElseIf StringInStr($ImpAuthMode, "WPA") And StringInStr($ImpAuthMode, "CCMP") And StringInStr($ImpAuthMode, "EAP") Then + $ImpAUTH = "WPA-Enterprise" + $ImpENCR = "CCMP" + $Found_SecType = 3 + ElseIf StringInStr($ImpAuthMode, "WPA2") And StringInStr($ImpAuthMode, "CCMP") Then + $ImpAUTH = "WPA2-Personal" + $ImpENCR = "CCMP" + $Found_SecType = 3 + ElseIf StringInStr($ImpAuthMode, "WPA") And StringInStr($ImpAuthMode, "CCMP") Then + $ImpAUTH = "WPA-Personal" + $ImpENCR = "CCMP" + $Found_SecType = 3 + ElseIf StringInStr($ImpAuthMode, "WPA2") And StringInStr($ImpAuthMode, "TKIP") And StringInStr($ImpAuthMode, "EAP") Then + $ImpAUTH = "WPA2-Enterprise" + $ImpENCR = "TKIP" + $Found_SecType = 3 + ElseIf StringInStr($ImpAuthMode, "WPA") And StringInStr($ImpAuthMode, "TKIP") And StringInStr($ImpAuthMode, "EAP") Then + $ImpAUTH = "WPA-Enterprise" + $ImpENCR = "TKIP" + $Found_SecType = 3 + ElseIf StringInStr($ImpAuthMode, "WPA2") And StringInStr($ImpAuthMode, "TKIP") Then + $ImpAUTH = "WPA2-Personal" + $ImpENCR = "TKIP" + $Found_SecType = 3 + ElseIf StringInStr($ImpAuthMode, "WPA") And StringInStr($ImpAuthMode, "TKIP") Then + $ImpAUTH = "WPA-Personal" + $ImpENCR = "TKIP" + $Found_SecType = 3 + ElseIf StringInStr($ImpAuthMode, "WEP") Then + $ImpAUTH = "Open" + $ImpENCR = "WEP" + $Found_SecType = 2 + Else + $ImpAUTH = "Open" + $ImpENCR = "None" + $Found_SecType = 1 + EndIf + + If StringInStr($ImpAuthMode, "IBSS") Then + $ImpNET = "Ad Hoc" ; + Else + $ImpNET = "Infrastructure" ; + EndIf + + If $ImpCHAN >= 1 And $ImpCHAN <= 14 Then + $ImpRAD = "802.11g" + ElseIf $ImpCHAN > 14 Then + $ImpRAD = "802.11n" + Else + $ImpRAD = "802.11" + EndIf + + $tsplit = StringSplit($ImpDateTime, ' ') + $LoadFirstActive_Date = $tsplit[1] + $LoadFirstActive_Time = $tsplit[2] + + ;Check If First GPS Information is Already in DB, If it is get the GpsID, If not add it and get its GpsID + $query = "SELECT GPSID FROM GPS WHERE Latitude = '" & $ImpLat & "' And Longitude = '" & $ImpLon & "' And Date1 = '" & $LoadFirstActive_Date & "' And Time1 = '" & $LoadFirstActive_Time & "'" + $GpsMatchArray = _RecordSearch($VistumblerDB, $query, $DB_OBJ) + $FoundGpsMatch = UBound($GpsMatchArray) - 1 + If $FoundGpsMatch = 0 Then + $AddGID += 1 + $GPS_ID += 1 + _AddRecord($VistumblerDB, "GPS", $DB_OBJ, $GPS_ID & '|' & $ImpLat & '|' & $ImpLon & '|0|' & $ImpHDOP & '|' & $ImpAlt & '|0|0|0|0|' & $LoadFirstActive_Date & '|' & $LoadFirstActive_Time) + $LoadGID = $GPS_ID + Else + $LoadGID = $GpsMatchArray[1][1] + EndIf + ;Add First AP Info to DB, Listview, and Treeview + $NewApAdded = _AddApData(0, $LoadGID, $ImpBSSID, $ImpSSID, $ImpCHAN, $ImpAUTH, $ImpENCR, $ImpNET, $ImpRAD, "", "", $ImpSig, $ImpRSSI) + If $NewApAdded <> 0 Then $AddAP += 1 + EndIf + + If TimerDiff($UpdateTimer) > 600 Or ($currentline = $iSize) Then + $min = (TimerDiff($begintime) / 60000) ;convert from miniseconds to minutes + $percent = ($currentline / $iSize) * 100 + GUICtrlSetData($progressbar, $percent) + GUICtrlSetData($percentlabel, $Text_Progress & ': ' & Round($percent, 1)) + GUICtrlSetData($linemin, $Text_LinesMin & ': ' & Round($currentline / $min, 1)) + GUICtrlSetData($newlines, $Text_NewAPs & ': ' & $AddAP & ' - ' & $Text_NewGIDs & ':' & $AddGID) + GUICtrlSetData($minutes, $Text_Minutes & ': ' & Round($min, 1)) + GUICtrlSetData($linetotal, $Text_LineTotal & ': ' & $currentline + 1 & "/" & $iSize + 1) + GUICtrlSetData($estimatedtime, $Text_EstimatedTimeRemaining & ': ' & Round(($iSize / Round($currentline / $min, 1)) - $min, 1) & "/" & Round($iSize / Round($currentline / $min, 1), 1)) + $UpdateTimer = TimerInit() + EndIf + If TimerDiff($MemReleaseTimer) > 10000 Then + _ReduceMemory() + $MemReleaseTimer = TimerInit() + EndIf + $closebtn = _GUICtrlButton_GetState($NsCancel) + If BitAND($closebtn, $BST_PUSHED) = $BST_PUSHED Then ExitLoop + Next + EndIf + EndIf +EndFunc ;==>_ImportWigleCSV + Func _ImportNS1($NS1file) If $Debug = 1 Then GUICtrlSetData($debugdisplay, '_ImportNS1()') ;#Debug Display $netstumblerfile = FileOpen($NS1file, 0) @@ -8996,7 +9361,7 @@ Func _ImportWardriveDb3($DB3file) _SQLite_Exec($WardriveImpDB, "pragma integrity_check") ;Speed vs Data security. Speed Wins for now. Local $NetworkMatchArray, $iRows, $iColumns, $iRval $query = "SELECT bssid, ssid, capabilities, level, frequency, lat, lon, alt, timestamp FROM networks" - $iRval = _SQLite_GetTable2d($WardriveImpDB, $query, $NetworkMatchArray, $iRows, $iColumns) + $iRval = _SQLite_GetTable2D($WardriveImpDB, $query, $NetworkMatchArray, $iRows, $iColumns) $WardriveAPs = $iRows $UpdateTimer = TimerInit() @@ -9060,7 +9425,7 @@ Func _ImportWardriveDb3($DB3file) ;Get Network Type from capabilities If StringInStr($Found_Capabilities, "[IBSS]") Then - $Found_NETTYPE = "Adhoc" + $Found_NETTYPE = "Ad Hoc" Else $Found_NETTYPE = "Infrastructure" EndIf @@ -10047,7 +10412,7 @@ Func _ExportNS1() ;Saves netstumbler data to a netstumbler summary .ns1 If $Found_CHAN = 34 Then $CHAN = '80000000' $Flags = 0 - If $Found_NETTYPE = $SearchWord_Adhoc Then + If $Found_NETTYPE = $SearchWord_Adhoc Or $Found_NETTYPE = "Ad Hoc" Then $Flags += 2 ;Set IBSS (Ad hoc) flag $BSS = 'ad-hoc' Else @@ -10279,14 +10644,16 @@ Func _SettingsGUI($StartTab) ;Opens Settings GUI to specified tab ;GPS Tab $Tab_Gps = GUICtrlCreateTabItem($Text_Gps) _GUICtrlTab_SetBkColor($SetMisc, $Settings_Tab, $BackgroundColor) - $GroupComInt = GUICtrlCreateGroup($Text_ComInterface, 24, 48, 633, 105) + $GroupComInt = GUICtrlCreateGroup($Text_ComInterface, 24, 35, 633, 100) GUICtrlSetColor(-1, $TextColor) - $Rad_UseNetcomm = GUICtrlCreateRadio($Text_UseNetcomm, 40, 70, 361, 20) + + $Rad_UseKernel32 = GUICtrlCreateRadio($Text_UseKernel32, 40, 55, 580, 20) GUICtrlSetColor(-1, $TextColor) - $Rad_UseCommMG = GUICtrlCreateRadio($Text_UseCommMG, 40, 95, 361, 20) + $Rad_UseNetcomm = GUICtrlCreateRadio($Text_UseNetcomm, 40, 80, 580, 20) GUICtrlSetColor(-1, $TextColor) - $Rad_UseKernel32 = GUICtrlCreateRadio($Text_UseKernel32, 40, 120, 361, 20) + $Rad_UseCommMG = GUICtrlCreateRadio($Text_UseCommMG, 40, 105, 580, 20) GUICtrlSetColor(-1, $TextColor) + If $GpsType = 0 Then GUICtrlSetState($Rad_UseCommMG, $GUI_CHECKED) ElseIf $GpsType = 1 Then @@ -10294,19 +10661,19 @@ Func _SettingsGUI($StartTab) ;Opens Settings GUI to specified tab ElseIf $GpsType = 2 Then GUICtrlSetState($Rad_UseKernel32, $GUI_CHECKED) EndIf - $GroupComSet = GUICtrlCreateGroup($Text_ComSettings, 24, 160, 633, 185) + $GroupComSet = GUICtrlCreateGroup($Text_ComSettings, 24, 140, 633, 100) GUICtrlSetColor(-1, $TextColor) - GUICtrlCreateLabel($Text_Com, 44, 180, 275, 15) + GUICtrlCreateLabel($Text_Com, 40, 160, 75, 20) GUICtrlSetColor(-1, $TextColor) - $GUI_Comport = GUICtrlCreateCombo("1", 44, 195, 275, 25) - GUICtrlSetData(-1, "2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20", $ComPort) - GUICtrlCreateLabel($Text_Baud, 44, 235, 275, 15) + $GUI_Comport = GUICtrlCreateCombo("1", 115, 160, 150, 20) + GUICtrlSetData(-1, "2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25", $ComPort) + GUICtrlCreateLabel($Text_Baud, 40, 185, 75, 20) GUICtrlSetColor(-1, $TextColor) - $GUI_Baud = GUICtrlCreateCombo("4800", 44, 250, 275, 25) + $GUI_Baud = GUICtrlCreateCombo("4800", 115, 185, 150, 20) GUICtrlSetData(-1, "9600|14400|19200|38400|57600|115200", $BAUD) - GUICtrlCreateLabel($Text_StopBit, 44, 290, 275, 15) + GUICtrlCreateLabel($Text_StopBit, 40, 210, 75, 20) GUICtrlSetColor(-1, $TextColor) - $GUI_StopBit = GUICtrlCreateCombo("1", 44, 305, 275, 25) + $GUI_StopBit = GUICtrlCreateCombo("1", 115, 210, 150, 20) GUICtrlSetData(-1, "1.5|2", $STOPBIT) If $PARITY = 'E' Then @@ -10320,12 +10687,26 @@ Func _SettingsGUI($StartTab) ;Opens Settings GUI to specified tab Else $l_PARITY = $Text_None EndIf - GUICtrlCreateLabel($Text_Parity, 364, 180, 275, 15) - $GUI_Parity = GUICtrlCreateCombo($Text_None, 364, 195, 275, 25) + GUICtrlCreateLabel($Text_Parity, 360, 160, 75, 20) + $GUI_Parity = GUICtrlCreateCombo($Text_None, 435, 160, 150, 20) GUICtrlSetData(-1, $Text_Even & '|' & $Text_Mark & '|' & $Text_Odd & '|' & $Text_Space, $l_PARITY) - GUICtrlCreateLabel($Text_DataBit, 364, 235, 275, 15) - $GUI_DataBit = GUICtrlCreateCombo("4", 364, 250, 275, 25) + GUICtrlCreateLabel($Text_DataBit, 360, 185, 75, 20) + $GUI_DataBit = GUICtrlCreateCombo("4", 435, 185, 150, 20) GUICtrlSetData(-1, "5|6|7|8", $DATABIT) + + $GroupGpsLogging = GUICtrlCreateGroup($Text_GPSLogging, 24, 245, 633, 100) + $GUI_GpsLogEnabled = GUICtrlCreateCheckbox($Text_SaveNMEAData, 40, 265, 400, 20) + GUICtrlSetColor(-1, $TextColor) + If $GpsLogEnabled = 1 Then GUICtrlSetState($GUI_GpsLogEnabled, $GUI_CHECKED) + $GUI_GpsLogDeleteOnExit = GUICtrlCreateCheckbox($Text_DeleteNMEAlog, 40, 285, 400, 20) + GUICtrlSetColor(-1, $TextColor) + If $GpsLogDeleteOnExit = 1 Then GUICtrlSetState($GUI_GpsLogDeleteOnExit, $GUI_CHECKED) + GUICtrlCreateLabel($Text_LogFileLocation, 40, 315, 110, 20) + GUICtrlSetColor(-1, $TextColor) + $GUI_GpsLogFileLocation = GUICtrlCreateInput($GpsLogLocation, 150, 315, 400, 20) + $glbrowse1 = GUICtrlCreateButton($Text_Browse, 556, 315, 97, 20, 0) + + $GroupGpsOptions = GUICtrlCreateGroup($Text_GpsSettings, 24, 360, 633, 100) GUICtrlSetColor(-1, $TextColor) GUICtrlCreateLabel($Text_GPSFormat, 44, 380, 100, 15) @@ -10875,6 +11256,8 @@ Func _SettingsGUI($StartTab) ;Opens Settings GUI to specified tab GUICtrlSetOnEvent($csbrowse1, '_CamScriptBrowse') + GUICtrlSetOnEvent($glbrowse1, '_GpsLogBrowse') + GUISetOnEvent($GUI_EVENT_CLOSE, '_CloseSettingsGUI') GUICtrlSetOnEvent($GUI_Set_Can, '_CloseSettingsGUI') GUICtrlSetOnEvent($GUI_Set_Apply, '_ApplySettingsGUI') @@ -10922,6 +11305,13 @@ Func _CamScriptBrowse() EndIf EndFunc ;==>_CamScriptBrowse +Func _GpsLogBrowse() + $gpslogfile = FileSaveDialog("Select gps log save location", GUICtrlRead($GUI_Set_SaveDir), "Text files (*.txt)|All (*.*)", BitOR($FD_PROMPTOVERWRITE, $FD_PATHMUSTEXIST)) + If Not @error Then + GUICtrlSetData($GUI_GpsLogFileLocation, $gpslogfile) + EndIf +EndFunc ;==>_GpsLogBrowse + Func _ColorBrowse1() $color = _ChooseColor(2, $BackgroundColor, 2, $SetMisc) If $color <> -1 Then GUICtrlSetData($GUI_BKColor, StringReplace($color, "0x", "")) @@ -11139,6 +11529,19 @@ Func _ApplySettingsGUI() ;Applys settings Else ;GUICtrlRead($GUI_Parity) = 'None' Then $PARITY = 'N' EndIf + + If GUICtrlRead($GUI_GpsLogEnabled) = 1 Then + $GpsLogEnabled = 1 + Else + $GpsLogEnabled = 0 + EndIf + If GUICtrlRead($GUI_GpsLogDeleteOnExit) = 1 Then + $GpsLogDeleteOnExit = 1 + Else + $GpsLogDeleteOnExit = 0 + EndIf + $GpsLogLocation = GUICtrlRead($GUI_GpsLogFileLocation) + If GUICtrlRead($GUI_Format) = "dd.dddd" Then $GPSformat = 1 If GUICtrlRead($GUI_Format) = "dd mm ss" Then $GPSformat = 2 If GUICtrlRead($GUI_Format) = "ddmm.mmmm" Then $GPSformat = 3 @@ -11286,13 +11689,17 @@ Func _ApplySettingsGUI() ;Applys settings $Text_Error = IniRead($DefaultLanguagePath, 'GuiText', 'Error', 'Error') $Text_NoSignalHistory = IniRead($DefaultLanguagePath, 'GuiText', 'NoSignalHistory', 'No signal history found, check to make sure your netsh search words are correct') $Text_NoApSelected = IniRead($DefaultLanguagePath, 'GuiText', 'NoApSelected', 'You did not select an access point') - $Text_UseNetcomm = IniRead($DefaultLanguagePath, 'GuiText', 'UseNetcomm', 'Use Netcomm OCX (more stable) - x32') - $Text_UseCommMG = IniRead($DefaultLanguagePath, 'GuiText', 'UseCommMG', 'Use CommMG (less stable) - x32 - x64') + $Text_UseKernel32 = IniRead($DefaultLanguagePath, 'GuiText', 'UseKernel32', 'Kernel32') + $Text_UseNetcomm = IniRead($DefaultLanguagePath, 'GuiText', 'UseNetcomm', 'Netcomm OCX (Needs http://www.hardandsoftware.net/NETCommOCX.htm)') + $Text_UseCommMG = IniRead($DefaultLanguagePath, 'GuiText', 'UseCommMG', 'CommMG (included, but will crash if gps is disconnected improperly)') $Text_SignalHistory = IniRead($DefaultLanguagePath, 'GuiText', 'SignalHistory', 'Signal History') $Text_AutoSortEvery = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSortEvery', 'Auto Sort Every') $Text_Seconds = IniRead($DefaultLanguagePath, 'GuiText', 'Seconds', 'Seconds') $Text_Ascending = IniRead($DefaultLanguagePath, 'GuiText', 'Ascending', 'Ascending') $Text_Decending = IniRead($DefaultLanguagePath, 'GuiText', 'Decending', 'Decending') + $Text_AutoRecoveryVS1 = IniRead($DefaultLanguagePath, 'GuiText', 'AutoRecoveryVS1', 'Auto Recovery VS1') + $Text_AutoSaveAndClear = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveAndClear', 'Auto Save And Clear') + $Text_SaveAndClear = IniRead($DefaultLanguagePath, 'GuiText', 'SaveAndClear', 'Sav&e && Clear') $Text_AutoSave = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSave', 'AutoSave') $Text_AutoSaveEvery = IniRead($DefaultLanguagePath, 'GuiText', 'AutoSaveEvery', 'AutoSave Every') $Text_DelAutoSaveOnExit = IniRead($DefaultLanguagePath, 'GuiText', 'DelAutoSaveOnExit', 'Delete Autosave file on exit') @@ -11442,7 +11849,6 @@ Func _ApplySettingsGUI() ;Applys settings $Text_AddingApsIntoList = IniRead($DefaultLanguagePath, 'GuiText', 'AddingApsIntoList', 'Adding new APs into list') $Text_GoogleEarthDoesNotExist = IniRead($DefaultLanguagePath, 'GuiText', 'GoogleEarthDoesNotExist', 'Google earth file does not exist or is set wrong in the AutoKML settings') $Text_AutoKmlIsNotStarted = IniRead($DefaultLanguagePath, 'GuiText', 'AutoKmlIsNotStarted', 'AutoKML is not yet started. Would you like to turn it on now?') - $Text_UseKernel32 = IniRead($DefaultLanguagePath, 'GuiText', 'UseKernel32', 'Use Kernel32 - x32 - x64') $Text_UnableToGuessSearchwords = IniRead($DefaultLanguagePath, 'GuiText', 'UnableToGuessSearchwords', 'Vistumbler was unable to guess searchwords') $Text_SelectedAP = IniRead($DefaultLanguagePath, 'GuiText', 'SelectedAP', 'Selected AP') $Text_AllAPs = IniRead($DefaultLanguagePath, 'GuiText', 'AllAPs', 'All APs') @@ -11470,8 +11876,9 @@ Func _ApplySettingsGUI() ;Applys settings $Text_UpdateManufacturers = IniRead($DefaultLanguagePath, "GuiText", "UpdateManufacturers", "Update Manufacturers") $Text_FixHistSignals = IniRead($DefaultLanguagePath, "GuiText", "FixHistSignals", "Fixing Missing Hist Table Signal(s)") $Text_VistumblerFile = IniRead($DefaultLanguagePath, 'GuiText', 'VistumblerFile', 'Vistumbler file') - $Text_DetailedCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'DetailedFile', 'Detailed Comma Delimited file') - $Text_SummaryCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'SummaryFile', 'Summary Comma Delimited file') + $Text_DetailedCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'DetailedFile', 'Vistumbler Detailed CSV') + $Text_SummaryCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'SummaryFile', 'Vistumbler Summary CSV') + $Text_WigleCsvFile = IniRead($DefaultLanguagePath, 'GuiText', 'WigleCsvFile', 'WigleWifi 1.4 Compatible CSV') $Text_NetstumblerTxtFile = IniRead($DefaultLanguagePath, 'GuiText', 'NetstumblerTxtFile', 'Netstumbler wi-scan file') $Text_WardriveDb3File = IniRead($DefaultLanguagePath, 'GuiText', 'WardriveDb3File', 'Wardrive-android file') $Text_AutoScanApsOnLaunch = IniRead($DefaultLanguagePath, "GuiText", "AutoScanApsOnLaunch", "Auto Scan APs on launch") @@ -11549,6 +11956,11 @@ Func _ApplySettingsGUI() ;Applys settings $Text_ButtonInactiveColor = IniRead($DefaultLanguagePath, 'GuiText', 'ButtonInactiveColor', 'Button Inactive Color') $Text_Text = IniRead($DefaultLanguagePath, 'GuiText', 'Text', 'Text') $Text_GUITextSize = IniRead($DefaultLanguagePath, 'GuiText', 'GUITextSize', 'GUI Text Size (Restart Required)') + $Text_GPSLogging = IniRead($DefaultLanguagePath, 'GuiText', 'GPSLogging', 'GPS Logging') + $Text_SaveNMEAData = IniRead($DefaultLanguagePath, 'GuiText', 'SaveNMEAData', 'Save NMEA Data to log file') + $Text_DeleteNMEAlog = IniRead($DefaultLanguagePath, 'GuiText', 'DeleteNMEAlog', 'Delete NMEA Data log file on exit') + $Text_LogFileLocation = IniRead($DefaultLanguagePath, 'GuiText', 'LogFileLocation', 'Log file location') + $Text_NMEALogError = IniRead($DefaultLanguagePath, 'GuiText', 'NMEALogError', 'Error opening NMEA log file') $RestartVistumbler = 1 EndIf @@ -12908,6 +13320,7 @@ Func _AddInterfaces() If $DefaultApapter = $adaptername Then $found_adapter = 1 $DefaultApapterID = $adapterid + $DefaultApapterDesc = $adapterdesc _Wlan_SelectInterface($DefaultApapterID) GUICtrlSetState($menuid, $GUI_CHECKED) EndIf @@ -12915,6 +13328,7 @@ Func _AddInterfaces() If $menuid <> 0 And $found_adapter = 0 Then $DefaultApapter = $adaptername $DefaultApapterID = $adapterid + $DefaultApapterDesc = $adapterdesc _Wlan_SelectInterface($DefaultApapterID) GUICtrlSetState($menuid, $GUI_CHECKED) EndIf @@ -12922,7 +13336,6 @@ Func _AddInterfaces() $NetworkAdapters[0] = UBound($NetworkAdapters) - 1 Else ;Get network interfaces and add the to the interface menu - Local $DefaultApapterDesc $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") $colNIC = $objWMIService.ExecQuery("Select * from Win32_NetworkAdapter WHERE AdapterTypeID = 0 And NetConnectionID <> NULL") For $object In $colNIC diff --git a/VistumblerMDB/Vistumbler.exe b/VistumblerMDB/Vistumbler.exe index 1e6e01ef..17e23267 100644 Binary files a/VistumblerMDB/Vistumbler.exe and b/VistumblerMDB/Vistumbler.exe differ diff --git a/VistumblerMDB/versions.ini b/VistumblerMDB/versions.ini index cfc6e6b1..449ce88a 100644 --- a/VistumblerMDB/versions.ini +++ b/VistumblerMDB/versions.ini @@ -11,8 +11,8 @@ update.au3=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 update.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 UpdateManufactures.au3=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 UpdateManufactures.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 -Vistumbler.au3=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 -Vistumbler.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 +Vistumbler.au3=096bdb24cb11384f77ce2cdb579892d653c2503a +Vistumbler.exe=096bdb24cb11384f77ce2cdb579892d653c2503a vistumbler_updater.au3=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 vistumbler_updater.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 Uninstall.exe=3ac4107e52c97e695f912eaa1e88d9524c5e2ca0 @@ -37,13 +37,18 @@ Images\secure.png=9b4e523de98f4fb162ffe8d787cd87944744e9d6 Images\secure_dead.png=9b4e523de98f4fb162ffe8d787cd87944744e9d6 Images\secure-wep.png=9b4e523de98f4fb162ffe8d787cd87944744e9d6 Images\secure-wep_dead.png=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +Images\bar_graph.jpg=d57724a9e1609f7fcc3018299ac50d818eac6c5e +Images\bar_graph_disabled.jpg=d57724a9e1609f7fcc3018299ac50d818eac6c5e +Images\line_graph.jpg=d57724a9e1609f7fcc3018299ac50d818eac6c5e +Images\line_graph_disabled.jpg=d57724a9e1609f7fcc3018299ac50d818eac6c5e +Images\list-view.jpg=d57724a9e1609f7fcc3018299ac50d818eac6c5e Languages\Brazilian_Portuguese.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 Languages\Bulgarian.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 Languages\Czech.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 Languages\Danish.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 Languages\Deutsch.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 Languages\Dutch.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 -Languages\English.ini=d871f8c809a99c6a508e266ad7ee16d37f65bf8f +Languages\English.ini=066b51f13e6cad3bbaa568e5e037aac7a480e630 Languages\French.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 Languages\Italiano.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 Languages\Japanese.ini=9b4e523de98f4fb162ffe8d787cd87944744e9d6 @@ -98,7 +103,7 @@ Sounds\autosave.wav=02e45e8f01c69f6cc6d2522c180eccaafd6cc8e1 UDFs\AccessCom.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 UDFs\CommMG.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 UDFs\CompareFileTimeEx.au3=18a92cffd1a751bd3e282cd95e5eedeb7ae40aea -UDFs\cfxUDF.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 +UDFs\cfxUDF.au3=066b51f13e6cad3bbaa568e5e037aac7a480e630 UDFs\HTTP.au3=aecd2257886b6bc605635ce97b9329c9a8d22c0b UDFs\JSON.au3=aecd2257886b6bc605635ce97b9329c9a8d22c0b UDFs\MD5.au3=9b4e523de98f4fb162ffe8d787cd87944744e9d6 diff --git a/Website/Vistumbler.net/verhist.html b/Website/Vistumbler.net/Downloads/index.htm similarity index 97% rename from Website/Vistumbler.net/verhist.html rename to Website/Vistumbler.net/Downloads/index.htm index 6a555a0a..d9ef0f4d 100644 --- a/Website/Vistumbler.net/verhist.html +++ b/Website/Vistumbler.net/Downloads/index.htm @@ -1,7 +1,7 @@ - + - + @@ -9,7 +9,7 @@ Vistumbler - Version History - + - + - + + + + + + +
@@ -71,13 +92,12 @@ @@ -1174,31 +1194,21 @@
- - - - -
- - + - - - + diff --git a/Website/Vistumbler.net/Downloads/index.php b/Website/Vistumbler.net/Downloads/index.php deleted file mode 100644 index 352a06e5..00000000 --- a/Website/Vistumbler.net/Downloads/index.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/Website/Vistumbler.net/index.html b/Website/Vistumbler.net/index.html index 38207d8a..d3a00e5a 100644 --- a/Website/Vistumbler.net/index.html +++ b/Website/Vistumbler.net/index.html @@ -257,7 +257,7 @@ stable). There is also Netcomm OCX, which requires the - + NETCommOCX ActiveX control to be installed first (Netcomm