Advertisement
rakanturki12222

Signer File

Aug 18th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.73 KB | None | 0 0
  1. Public Shared Function smethod_0(ByVal byte_0 As Byte(), ByVal bool_0 As Boolean) As Byte()
  2. Dim buffer As Byte()
  3. Try
  4. Dim buffer2 As Byte() = New Byte(4 - 1) {}
  5. Dim stream As New MemoryStream(byte_0, 0, byte_0.Length)
  6. stream.Seek(60, SeekOrigin.Begin)
  7. stream.Read(buffer2, 0, 2)
  8. Dim num2 As Integer = BitConverter.ToInt16(buffer2, 0)
  9. If bool_0 Then
  10. stream.Seek(CLng((num2 + &HA8)), SeekOrigin.Begin)
  11. stream.Read(buffer2, 0, 4)
  12. Dim num4 As Integer = BitConverter.ToInt32(buffer2, 0)
  13. stream.Read(buffer2, 0, 4)
  14. Dim num5 As Integer = BitConverter.ToInt32(buffer2, 0)
  15. Dim buffer4 As Byte() = New Byte(((num5 - 1) + 1) - 1) {}
  16. stream.Seek(CLng(num4), SeekOrigin.Begin)
  17. stream.Read(buffer4, 0, num5)
  18. stream.Close()
  19. 'MessageBox.Show("Certificate got successfully!", "Get Certificate", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
  20. Return buffer4
  21. End If
  22. stream.Seek(CLng((num2 + &H98)), SeekOrigin.Begin)
  23. stream.Read(buffer2, 0, 4)
  24. Dim num3 As Integer = BitConverter.ToInt32(buffer2, 0)
  25. stream.Read(buffer2, 0, 4)
  26. Dim count As Integer = BitConverter.ToInt32(buffer2, 0)
  27. Dim buffer3 As Byte() = New Byte(((count - 1) + 1) - 1) {}
  28. stream.Seek(CLng(num3), SeekOrigin.Begin)
  29. stream.Read(buffer3, 0, count)
  30. stream.Close()
  31. MessageBox.Show("Certificate got successfully!", "Get Certificate", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
  32. buffer = buffer3
  33. Catch exception1 As Exception
  34. MessageBox.Show(("ERROR: " & exception1.ToString), "Get Certificate", MessageBoxButtons.OK, MessageBoxIcon.Hand)
  35. MessageBox.Show(String.Concat(New String() {"Note that you have to run this Digital Signature as Admin for ", Environment.NewLine, Environment.GetEnvironmentVariable("windir"), Environment.NewLine, Environment.GetEnvironmentVariable("ProgramFiles")}), "Get Certificate", MessageBoxButtons.OK, MessageBoxIcon.Hand)
  36. buffer = Nothing
  37. Return buffer
  38. End Try
  39. Return buffer
  40. End Function
  41. Public Shared Function smethod_2(ByVal byte_0 As Byte(), ByVal byte_1 As Byte(), ByVal bool_0 As Boolean) As Byte()
  42. Dim buffer As Byte()
  43. Try
  44. Dim stream As New MemoryStream(byte_1, 0, byte_1.Length)
  45. Dim buffer2 As Byte() = New Byte((CInt((stream.Length - 1)) + 1) - 1) {}
  46. stream.Read(buffer2, 0, Convert.ToInt32(stream.Length))
  47. stream.Close()
  48. Dim stream2 As New MemoryStream(byte_0, 0, byte_0.Length)
  49. Dim buffer3 As Byte() = New Byte((CInt((stream2.Length - 1)) + 1) - 1) {}
  50. stream2.Read(buffer3, 0, Convert.ToInt32(stream2.Length))
  51. stream.Close()
  52. Dim count As Integer = (buffer3.Length + buffer2.Length)
  53. Dim stream3 As New MemoryStream(New Byte(((count - 1) + 1) - 1) {}, 0, count, True, True)
  54. stream3.Write(buffer3, 0, buffer3.Length)
  55. stream3.Write(buffer2, 0, buffer2.Length)
  56. Dim buffer4 As Byte() = stream3.GetBuffer
  57. 'MessageBox.Show("Digital Signature successfully signed!", "Digital Signature signer", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
  58. buffer = smethod_1(buffer4, buffer2.Length, buffer3.Length, bool_0)
  59. Catch exception1 As Exception
  60. MessageBox.Show(("ERROR: " & exception1.ToString), "Digital Signature signer", MessageBoxButtons.OK, MessageBoxIcon.Hand)
  61. buffer = New Byte(0 - 1) {}
  62. Return buffer
  63. End Try
  64. Return buffer
  65. End Function
  66. Public Shared Function smethod_1(ByVal byte_0 As Byte(), ByVal int_0 As Integer, ByVal int_1 As Integer, ByVal bool_0 As Boolean) As Byte()
  67. Dim buffer As Byte() = New Byte(4 - 1) {}
  68. Dim stream As New MemoryStream(byte_0, 0, byte_0.Length)
  69. If bool_0 Then
  70. stream.Seek(60, SeekOrigin.Begin)
  71. stream.Read(buffer, 0, 2)
  72. Dim num As Integer = BitConverter.ToInt16(buffer, 0)
  73. stream.Seek(CLng((num + 160)), SeekOrigin.Begin)
  74. Else
  75. stream.Seek(60, SeekOrigin.Begin)
  76. stream.Read(buffer, 0, 2)
  77. Dim num2 As Integer = BitConverter.ToInt16(buffer, 0)
  78. stream.Seek(CLng((num2 + &H98)), SeekOrigin.Begin)
  79. End If
  80. stream.Write(BitConverter.GetBytes(int_1), 0, 4)
  81. stream.Write(BitConverter.GetBytes(int_0), 0, 4)
  82. Return stream.ToArray
  83. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement