-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathModule1.bas
More file actions
79 lines (70 loc) · 2.53 KB
/
Module1.bas
File metadata and controls
79 lines (70 loc) · 2.53 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Attribute VB_Name = "Module1"
Option Explicit
Public Declare Function InitCommonControlsEx Lib "comctl32.dll" (iccex As tagInitCommonControlsEx) As Boolean
Public Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Public Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Public Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Type tagInitCommonControlsEx
lngSize As Long
lngICC As Long
End Type
Public Type hccap_record
ESSID As String
BSSID As String
STATION_MAC As String
SNONCE As String
ANONCE As String
EAPOL As String
EAPOL_SIZE As String
KEY_VERSION As String
KEY_MIC As String
End Type
Public last_path As String
Public num_hccap_records As Long
Public tmp_hccap_records() As hccap_record
Public current_index As Long
Public current_file As String
Public Sub Main()
On Error Resume Next
Dim iccex As tagInitCommonControlsEx
iccex.lngSize = LenB(iccex)
iccex.lngICC = &H200
InitCommonControlsEx iccex
Load Form1
Form1.Show
'Load Form2
'Form2.Show
End Sub
Public Function hex_digits_only(input_str As String) As String
Dim output_str As String
Dim c As String
If Len(input_str) > 0 Then
Dim i As Integer
For i = 1 To Len(input_str)
c = UCase$(Mid$(input_str, i, 1))
If c = "0" Or c = "1" Or c = "2" Or c = "3" Or c = "4" Or c = "5" Or c = "6" Or c = "7" Or c = "8" Or c = "9" Or c = "A" Or c = "B" Or c = "C" Or c = "D" Or c = "E" Or c = "F" Then
output_str = output_str & c
End If
Next
End If
hex_digits_only = output_str
End Function
Public Function dec2hex(d As Byte) As String
dec2hex = Right$("0" & Hex$(d), 2)
End Function
Public Function hex2dec(h As String) As Byte
hex2dec = IIf(Len(h) > 0, CByte("&H" & h), 0)
End Function
Public Function hex2dec_lng(h As String) As Long
hex2dec_lng = IIf(Len(h) > 0, CLng("&H" & h), 0)
End Function
Public Function bytes2num(LoByte As Byte, HiByte As Byte) As Long
If HiByte And &H80 Then
bytes2num = ((HiByte * &H100&) Or LoByte) Or &HFFFF0000
Else
bytes2num = (HiByte * &H100) Or LoByte
End If
'bytes2num = CLng("&H" & Right$("0" & Hex$(LoByte), 2) & Right$("0" & Hex$(HiByte), 2))
End Function