Page 1 of 1

Vistumbler crashes with this error msg

Posted: Mon Jul 28, 2008 8:03 pm
by Guido
I installed Vistumbler over and over again on my Sony VGN-FZ21Z laptop with Vista premium
After a short while I receive this error message:
----------------------------
Line-1
Error: Array variable has incorrect number of subscripts or subscript
dimension rage exceeded.
----------------------------

The Vistumbler interface turnes black/white and doesn't work anymore.
Wen I reinstall it works again for a while.

Wen I try to change any of the settings like add a mac/manufactor then it stops working
If i restart Vistumbler it gives the above error again.

Re: Vistumbler crashes with this error msg

Posted: Thu Jul 31, 2008 1:28 pm
by 73n5h1
I get the same error when I try to clear all of the fields... program crashes with that message but when I restart the program, all the data is indeed cleared out.

Re: Vistumbler crashes with this error msg

Posted: Thu Oct 02, 2008 7:46 am
by pesti
Hi All!

I have got same error too but I have solved this problem.
This problem comes from the Vista nationality language and the "searchwords" settings.

The problem is briefly:
The vistumbler catch a "searchwords" from the "netsh wlan show networks mode=BSSID" but this line does not contain the colon ":" which causes the "Line-1 array.." error.

In my case the result of "netsh wlan ..." is :

1 Kapcsolat neve: Vezet‚k n‚lkli h l˘zati kapcsolat
2 Jelenleg 4 h l˘zat l that˘.
3
4 H l˘zatn‚v 1 : SECRET
5 H l˘zattˇpus : InfrastruktŁra
6 Hitelesˇt‚s : WPA-Personal
7 Titkosˇt s : TKIP
8 1 alapazonosˇt˘ : 00:5c:10:91:4e:1a
9 Jel : 45%
10 R di˘ tˇpusa: 802.11g
11 Csatorna : 6
12 Alap  tviteli sebess‚gek (Mb/s) : 1 2 5.5 11
13 Egy‚b  tviteli sebess‚gek (Mb/s) : 6 9 12 18 24 36 48 54

I set the "Signal" searchwords to "Jel" and have got the "Array" error. You can see the errors in the lines 2! and 9 . These lines are containing the "Jel" but the 2 line does not contain the colon. ":"

I do a small modify in the source code to fix this problem.
Another solution : find the duplicate words and set a non exist word to skip it. It will not cause the array error but the skipped value will not appear in the table.

Best Regard
Janos

Re: Vistumbler crashes with this error msg

Posted: Thu Oct 02, 2008 6:35 pm
by ACalcutt
Hmm...interesting

Thanks for your research on this. What did you do to fix it in the code... I assume you also check if the line has a ":". I will try to get this fixed in the next release now that i know what is causing this problem

Thanks again,
Andrew

Re: Vistumbler crashes with this error msg

Posted: Thu Oct 02, 2008 7:37 pm
by ACalcutt
I think i am going to change the _ScanAccessPoints() function to this. I think checking array sizes will stop that error from occuring

Code: Select all

Func _ScanAccessPoints()
	If $Debug = 1 Then GUICtrlSetData($debugdisplay, ' _ScanAccessPoints()') ;#Debug Display
	$ScanDate = @MON & '-' & @MDAY & '-' & @YEAR
	$ScanTime = @HOUR & ':' & @MIN & ':' & @SEC
	$NewAP = 0
	$FoundAPs = 0
	;RunWait("net restart Wlansvc", '', @SW_HIDE)
	FileDelete($tempfile)
	_RunDOS($netsh & ' wlan show networks mode=bssid > ' & '"' & $tempfile & '"') ;copy the output of the 'netsh wlan show networks mode=bssid' command to the temp file
	$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
		;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 = '', $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
			
			$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
			
			If $Update = 1 And $NewAP = 1 And $BSSID <> '' Then
				$NewAP = 0
				If $BSSID <> "" Then
					$FoundAPs += 1
					_AddRecord($VistumblerDB, "Temp", $DB_OBJ, $BSSID & '|' & $SSID & '|' & $Channel & '|' & $Authentication & '|' & $Encryption & '|' & $NetworkType & '|' & $RadioType & '|' & $BasicTransferRates & '|' & $OtherTransferRates & '|' & $Signal & '|' & $ScanDate & '|' & $ScanTime)
				EndIf
			EndIf
		Next
		Return ($FoundAPs)
	Else
		Return ('-1')
	EndIf
EndFunc   ;==>_ScanAccessPoints

Re: Vistumbler crashes with this error msg

Posted: Tue Oct 07, 2008 10:54 pm
by pesti
Hello Andrew,

Exactly I have done this :
(Sorry if these patch not perfectly but I don't invest time to have deep knowledge about this script language) But this is working ... :))
I will very happy if you built in these functionality because basically this problem does not come up under the native english language only in others.

Best regards,

Janos


(Please see my solution : )

Func _ScanAccessPoints()
If $Debug = 1 Then GUICtrlSetData($debugdisplay, ' _ScanAccessPoints()') ;#Debug Display
$NewAP = 0
$FoundAPs = 0
FileDelete($tempfile)
_RunDOS($netsh & ' wlan show networks mode=bssid > ' & '"' & $tempfile & '"') ;copy the output of the 'netsh wlan show networks mode=bssid' command to the temp file
$arrayadded = _FileReadToArray($tempfile, $TempFileArray);read the tempfile into the '$TempFileArray' Araay
If $arrayadded = 1 Then
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), ":")
;_ArrayDisplay($temp)

If IsArray($temp) 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 $temp[0]>="2" then
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_BSSID) Then
Dim $Signal = '', $RadioType = '', $Channel = '', $BasicTransferRates = '', $OtherTransferRates = '', $MANUF
$NewAP = 1
$BSSID = StringStripWS(StringUpper($temp[2] & ':' & $temp[3] & ':' & $temp[4] & ':' & $temp[5] & ':' & $temp[6] & ':' & $temp[7]), 3)
EndIf

If StringInStr($TempFileArray[$loop], $SearchWord_Signal) Then $Signal = StringStripWS($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)
EndIf

$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

If $Update = 1 And $NewAP = 1 And $BSSID <> '' Then
$NewAP = 0
If $BSSID <> "" Then
$FoundAPs += 1
_ArrayInsert($TmpArray_BSSID, 1, $BSSID)
_ArrayInsert($TmpArray_SSID, 1, $SSID)
_ArrayInsert($TmpArray_Auth, 1, $Authentication)
_ArrayInsert($TmpArray_Encr, 1, $Encryption)
_ArrayInsert($TmpArray_Sig, 1, $Signal)
_ArrayInsert($TmpArray_Chan, 1, $Channel)
_ArrayInsert($TmpArray_Rad, 1, $RadioType)
_ArrayInsert($TmpArray_BtX, 1, $BasicTransferRates)
_ArrayInsert($TmpArray_OtX, 1, $OtherTransferRates)
_ArrayInsert($TmpArray_NetType, 1, $NetworkType)
_SetTmpArraySizes()
EndIf
EndIf

EndIf
Next
Return ($FoundAPs)
Else
Return ('-1')
EndIf
EndFunc ;==>_ScanAccessPoints

Re: Vistumbler crashes with this error msg

Posted: Wed Oct 08, 2008 8:55 am
by ACalcutt
ok so you basically did the same thing i did. I made this change in the latest Vistumbler 9.0 beta update, so hopefully you won't have this problem anymore

-Andrew