Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Cabinet(DLL As String, Offset As Long, Value As Byte())
- Try
- Dim fs As New FileStream(DLL, FileMode.Open)
- Dim reader As New BinaryReader(fs)
- fs.Position = Offset
- For Each num As Byte In Value
- If num.ToString() = String.Empty Then
- Exit For
- End If
- reader.BaseStream.WriteByte(num)
- Next
- reader.Close()
- Catch exception1 As Exception
- ProjectData.SetProjectError(exception1)
- ProjectData.ClearProjectError()
- End Try
- End Sub
- If (Me.CabinetSel.SelectedIndex = 0) Then
- Me.Cabinet((Environment.GetFolderPath(SpecialFolder.ApplicationData) & "\TeknoParrot\SBUU_e2prom.bin"), CLng(Math.Round(Conversion.Val("&H0"))), New Byte() { 130, &H79, &H59, 9 })
- Dim buffer1 As Byte() = New Byte() { 1 }
- Me.Cabinet((Environment.GetFolderPath(SpecialFolder.ApplicationData) & "\TeknoParrot\SBUU_e2prom.bin"), CLng(Math.Round(Conversion.Val("&H2B"))), buffer1)
- Me.Cabinet((Environment.GetFolderPath(SpecialFolder.ApplicationData) & "\TeknoParrot\SBUU_e2prom.bin"), CLng(Math.Round(Conversion.Val("&H74"))), New Byte() { 130, &H79, &H59, 9 })
- Dim buffer2 As Byte() = New Byte() { 1 }
- Me.Cabinet((Environment.GetFolderPath(SpecialFolder.ApplicationData) & "\TeknoParrot\SBUU_e2prom.bin"), CLng(Math.Round(Conversion.Val("&H9F"))), buffer2)
- Else
- Me.Cabinet((Environment.GetFolderPath(SpecialFolder.ApplicationData) & "\TeknoParrot\SBUU_e2prom.bin"), CLng(Math.Round(Conversion.Val("&H0"))), New Byte() { &HD1, &H9B, &H7C, &HCA })
- Dim buffer3 As Byte() = New Byte() { 2 }
- Me.Cabinet((Environment.GetFolderPath(SpecialFolder.ApplicationData) & "\TeknoParrot\SBUU_e2prom.bin"), CLng(Math.Round(Conversion.Val("&H2B"))), buffer3)
- Me.Cabinet((Environment.GetFolderPath(SpecialFolder.ApplicationData) & "\TeknoParrot\SBUU_e2prom.bin"), CLng(Math.Round(Conversion.Val("&H74"))), New Byte() { &HD1, &H9B, &H7C, &HCA })
- Dim buffer4 As Byte() = New Byte() { 2 }
- Me.Cabinet((Environment.GetFolderPath(SpecialFolder.ApplicationData) & "\TeknoParrot\SBUU_e2prom.bin"), CLng(Math.Round(Conversion.Val("&H9F"))), buffer4)
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement