1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Imports System.IO
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim choisir As String = TextBox4.Text
Dim tuc_lecture As Byte()
Dim adressStart As Integer = 9
Dim longeur As Integer = 4
Dim sb As New System.Text.StringBuilder()
tuc_lecture = File.ReadAllBytes(choisir)
Dim hexstr = BitConverter.ToString(tuc_lecture, adressStart, longeur).Replace("-", "")
Dim xorhex As String = TextBox2.Text
Dim xornum As Integer = Integer.Parse(xorhex, Globalization.NumberStyles.HexNumber)
For Each numhex As String In hexstr.Split(" "c)
Dim num As Integer = Integer.Parse(numhex, Globalization.NumberStyles.HexNumber)
sb.Append((num Xor xornum).ToString("X2"))
Next
TextBox3.Text = sb.ToString()
End Sub |
Partager