Few Important Functions For Mig33 Soft Developing

Here I will Provide Few Major Mig33 Packets.

For Loging with Mig33 v 4.2

Public Function SendUname42(Username As String)
SendUname42 = HextoAscii(“2 0 C8 0 1 0 0 0 ” & DecToHexStr(Len(Username) + 123) & ” 0 13 0 0 0 1 0 0 10 0 0 0 4 0 0 0 15 0 0F 0 0 0 5 65 6E 2D 55 53 0 0D 0 0 0 04 0 0 0 A9 0 0C 0 0 0 04 0 0 0 AA 0 0B 0 0 0 04 0 0 0 0E 0 9 0 0 0 1 1 0 8 0 0 0 4 6A 32 6D 65 0 7 0 0 0 D 4A 32 4D 45 76 34 2E 32 30 2E 32 38 36 0 5 0 0 0 ” & DecToHexStr(Len(Username)) & ” ” & Asciitohex(Username) & ” 0 3 0 0 0 2 1 A4 0 2 0 0 0 1 2 0 1 0 0 0 2 0 1″)
End Function

For Loging with Mig33 v 4.5

Public Function SendUname45(uname As String)
SendUname45 = HextoAscii(“02 00 C8 00 02 00 00 00 ” & DecToHexStr(Len(uname) + 172) & ” 00 16 00 00 00 00 00 15 00 00 00 00 00 14 00 00 00 00 00 13 00 00 00 01 00 00 11 00 00 00 00 00 10 00 00 00 04 00 00 00 15 00 0F 00 00 00 05 65 6E 2D 55 53 00 0D 00 00 00 04 00 00 01 18 00 0C 00 00 00 04 00 00 00 EA 00 0B 00 00 00 04 00 00 00 0E 00 09 00 00 00 01 01 00 08 00 00 00 1D 6D 69 67 33 33 2F 34 2E 35 30 20 28 55 6E 6B 6E 6F 77 6E 29 20 6B 42 72 6F 77 73 65 72 00 07 00 00 00 0D 4A 32 4D 45 76 34 2E 35 30 2E 30 30 30 00 05 00 00 00 ” & DecToHexStr(Len(uname)) & ” ” & Asciitohex(uname) & ” 00 03 00 00 00 02 01 C2 00 02 00 00 00 01 02 00 01 00 00 00 02 00 01″)
End Function

For Loging with Mig33 v 4.6

Public Function SendUname46(uname As String)
SendUname46 = HextoAscii(“02 00 C8 00 02 00 00 00 ” & DecToHexStr(Len(uname) + 172) & ” 00 16 00 00 00 00 00 15 00 00 00 00 00 14 00 00 00 00 00 13 00 00 00 01 00 00 11 00 00 00 00 00 10 00 00 00 04 00 00 00 15 00 0F 00 00 00 05 65 6E 2D 55 53 00 0D 00 00 00 04 00 00 00 A9 00 0C 00 00 00 04 00 00 00 AA 00 0B 00 00 00 04 00 00 00 0E 00 09 00 00 00 01 01 00 08 00 00 00 1D 6D 69 67 33 33 2F 34 2E 36 32 20 28 55 6E 6B 6E 6F 77 6E 29 20 6B 42 72 6F 77 73 65 72 00 07 00 00 00 0D 4A 32 4D 45 76 34 2E 36 32 2E 30 30 30 00 05 00 00 00 ” & DecToHexStr(Len(uname)) & ” ” & Asciitohex(uname) & ” 00 03 00 00 00 02 01 CE 00 02 00 00 00 01 02 00 01 00 00 00 02 00 01″)
End Function

Few Converters For Mig33

————————————————————————————

Public Function DecToHexStr(ByVal inVal As Integer) As String
Dim S As String
S$ = Trim(Hex(inVal))
If Len(S) < 2 Then
S$ = “0” & S
End If
DecToHexStr$ = S
End Function

————————————————————————————

Public Function HextoAscii(inputstr As String) As String
Dim spilter As Variant, I As Integer, finnal As String
If InStr(1, inputstr$, ” “) <> 0 Then
spilter = Split(inputstr$, ” “)
For I = 0 To UBound(spilter)
finnal = finnal & Chr(Val(“&H” & spilter(I)))
Next I
HextoAscii = finnal$
ElseIf Len(inputstr) = 2 Then
finnal$ = Chr$(Val(“&H” & inputstr$))
HextoAscii = finnal
End If
End Function

————————————————————————————

Public Function DecToHexFull(strAsc) As String
strAsc = Hex(strAsc)
If Len(strAsc) < 8 Then Do Until Len(strAsc) = 8 strAsc = “0” & strAsc Loop End If Dim lonLen As Long lonLen = Len(strAsc) Dim I As Integer For I = 1 To Len(strAsc) strAsc = strAsc & Mid(strAsc, I, 2) & ” ” I = I + 1 DoEvents Next I DecToHexFull = Mid(strAsc, lonLen + 1) DecToHexFull = Mid(DecToHexFull, 1, Len(DecToHexFull) – 1) End Function Public Function Asciitohex(inputstr As String) As String On Error Resume Next Dim spilter As Variant, I As Integer, finnal As String For I = 1 To Len(inputstr) finnal$ = finnal & Hex(Asc(Mid(inputstr, I, 1))) & ” ” Next I Asciitohex = Mid(finnal, 1, Len(finnal$) – 1) End Function Function hashCode(Value) Dim I As Integer Const maxInt = 4294967295# Const maxPostInt = 2147483647 Dim h As Currency Dim div As Long h = 0 For I = 1 To Len(Value) h = h * 31 + Asc(Mid(Value, I, 1)) If (h > maxInt) Then
div = Int(h / (maxInt + 1))
h = h – (div * (maxInt + 1))
End If
Next I
If h > maxPostInt Then
h = h – maxInt – 1
End If
hashCode = h
End Function

————————————————————————————

Public Function GenerateHasCode(packet As String) As String
Dim aLong As Long
Dim TempPacket As String
aLong = hashCode(packet)
TempPacket$ = Right(“00000000″ & Hex(aLong), 8 )
GenerateHasCode$ = Left$(TempPacket, 2) & ” ” & Mid$(TempPacket, 3, 2) & ” ” & Mid(TempPacket, 5, 2) & ” ” & Right(TempPacket, 2)
End Function

————————————————————————————

I hope you Can Use these. 🙂

2 thoughts on “Few Important Functions For Mig33 Soft Developing”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.