Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Shared Function smethod_0(ByVal byte_0 As Byte(), ByVal bool_0 As Boolean) As Byte()
- Dim buffer As Byte()
- Try
- Dim buffer2 As Byte() = New Byte(4 - 1) {}
- Dim stream As New MemoryStream(byte_0, 0, byte_0.Length)
- stream.Seek(60, SeekOrigin.Begin)
- stream.Read(buffer2, 0, 2)
- Dim num2 As Integer = BitConverter.ToInt16(buffer2, 0)
- If bool_0 Then
- stream.Seek(CLng((num2 + &HA8)), SeekOrigin.Begin)
- stream.Read(buffer2, 0, 4)
- Dim num4 As Integer = BitConverter.ToInt32(buffer2, 0)
- stream.Read(buffer2, 0, 4)
- Dim num5 As Integer = BitConverter.ToInt32(buffer2, 0)
- Dim buffer4 As Byte() = New Byte(((num5 - 1) + 1) - 1) {}
- stream.Seek(CLng(num4), SeekOrigin.Begin)
- stream.Read(buffer4, 0, num5)
- stream.Close()
- 'MessageBox.Show("Certificate got successfully!", "Get Certificate", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
- Return buffer4
- End If
- stream.Seek(CLng((num2 + &H98)), SeekOrigin.Begin)
- stream.Read(buffer2, 0, 4)
- Dim num3 As Integer = BitConverter.ToInt32(buffer2, 0)
- stream.Read(buffer2, 0, 4)
- Dim count As Integer = BitConverter.ToInt32(buffer2, 0)
- Dim buffer3 As Byte() = New Byte(((count - 1) + 1) - 1) {}
- stream.Seek(CLng(num3), SeekOrigin.Begin)
- stream.Read(buffer3, 0, count)
- stream.Close()
- MessageBox.Show("Certificate got successfully!", "Get Certificate", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
- buffer = buffer3
- Catch exception1 As Exception
- MessageBox.Show(("ERROR: " & exception1.ToString), "Get Certificate", MessageBoxButtons.OK, MessageBoxIcon.Hand)
- 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)
- buffer = Nothing
- Return buffer
- End Try
- Return buffer
- End Function
- Public Shared Function smethod_2(ByVal byte_0 As Byte(), ByVal byte_1 As Byte(), ByVal bool_0 As Boolean) As Byte()
- Dim buffer As Byte()
- Try
- Dim stream As New MemoryStream(byte_1, 0, byte_1.Length)
- Dim buffer2 As Byte() = New Byte((CInt((stream.Length - 1)) + 1) - 1) {}
- stream.Read(buffer2, 0, Convert.ToInt32(stream.Length))
- stream.Close()
- Dim stream2 As New MemoryStream(byte_0, 0, byte_0.Length)
- Dim buffer3 As Byte() = New Byte((CInt((stream2.Length - 1)) + 1) - 1) {}
- stream2.Read(buffer3, 0, Convert.ToInt32(stream2.Length))
- stream.Close()
- Dim count As Integer = (buffer3.Length + buffer2.Length)
- Dim stream3 As New MemoryStream(New Byte(((count - 1) + 1) - 1) {}, 0, count, True, True)
- stream3.Write(buffer3, 0, buffer3.Length)
- stream3.Write(buffer2, 0, buffer2.Length)
- Dim buffer4 As Byte() = stream3.GetBuffer
- 'MessageBox.Show("Digital Signature successfully signed!", "Digital Signature signer", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
- buffer = smethod_1(buffer4, buffer2.Length, buffer3.Length, bool_0)
- Catch exception1 As Exception
- MessageBox.Show(("ERROR: " & exception1.ToString), "Digital Signature signer", MessageBoxButtons.OK, MessageBoxIcon.Hand)
- buffer = New Byte(0 - 1) {}
- Return buffer
- End Try
- Return buffer
- End Function
- 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()
- Dim buffer As Byte() = New Byte(4 - 1) {}
- Dim stream As New MemoryStream(byte_0, 0, byte_0.Length)
- If bool_0 Then
- stream.Seek(60, SeekOrigin.Begin)
- stream.Read(buffer, 0, 2)
- Dim num As Integer = BitConverter.ToInt16(buffer, 0)
- stream.Seek(CLng((num + 160)), SeekOrigin.Begin)
- Else
- stream.Seek(60, SeekOrigin.Begin)
- stream.Read(buffer, 0, 2)
- Dim num2 As Integer = BitConverter.ToInt16(buffer, 0)
- stream.Seek(CLng((num2 + &H98)), SeekOrigin.Begin)
- End If
- stream.Write(BitConverter.GetBytes(int_1), 0, 4)
- stream.Write(BitConverter.GetBytes(int_0), 0, 4)
- Return stream.ToArray
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement