PDA

View Full Version : سورس افزایش دهنده حجم فایلهای اجرایی تا 200 مگابایت



Nima NT
دوشنبه 20 خرداد 1387, 19:05 عصر
با سلام ، یه برنامه نوشتم که می شه با اون حجم فایل اجرائی رو تا 200 مگابایت بالا ببری ، این کار معمولا" تو کار های امنیتی کاربرد داره گفتم سورس بذارم همه ( ان شاالله ) حال کنن.
اگه چرت و پرت بود خواهش می کنم فهشم ندین.

سورس برنامه
در قسمت T1.encryptfile می تونین از هرگونه رمزنگاری استفاده کنید فرقی نمی کنه.
اصل کد مال Button 2 هست .





Public Class Form1
Public i, j, k, l As Boolean
Public overwrite As String

Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
Application.Exit()
End Sub


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ReflectionImage1.Select()


End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim file As String
OpenFileDialog1.Filter = "Packed / Protected Exe Files (*.exe)|*.exe"
If OpenFileDialog1.ShowDialog <> Windows.Forms.DialogResult.Cancel Then
file = OpenFileDialog1.FileName
Else
' do nothing
End If
End Sub

Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim file As String
Dim filebytes As String
Dim encrypted As String
file = OpenFileDialog1.FileName
If OpenFileDialog1.FileName = "" Then
MsgBox("کاربر گرامی لطفا ابتدا فایلی را فراخوانی نمائید ", MsgBoxStyle.Critical, "توجه")
Else
Dim fileSize As Long
fileSize = My.Computer.FileSystem.GetFileInfo(OpenFileDialog1 .FileName).Length
If fileSize >= 50282416 Then
MsgBox("این حجم فایلی پشتیبانی نمی شود", MsgBoxStyle.Critical, "توجه")
Else
Try
filebytes = My.Computer.FileSystem.ReadAllText(file)
My.Computer.FileSystem.OpenTextFileWriter(file, True)
encrypted = T1.EncryptString(filebytes)
My.Computer.FileSystem.WriteAllText(file, encrypted, True)
Dim Overwrite1 As Byte() = My.Computer.FileSystem.ReadAllBytes(file)
My.Computer.FileSystem.WriteAllBytes(file, Overwrite1, True)
MsgBox("عملیات با موفقیت انجام شد ", MsgBoxStyle.Information, "توجه")
GoTo NULL
Catch ex As Exception
MsgBox("خطای نامشخص", MsgBoxStyle.Critical)
End Try

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''
End If
End If
NULL:
' nothing to do

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Timer3.Enabled = True
Timer3.Start()
Timer4.Enabled = True
Timer4.Start()



End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form3.Show()
Me.Hide()
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Me.Opacity = 0.1 Then
Timer1.Enabled = False
Timer1.Stop()
Else
Me.Opacity = Me.Opacity + 0.01
End If
End Sub

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Timer1.Enabled = False
Timer1.Stop()
End Sub

Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
If Me.Opacity = 0.0 Then
Timer1.Enabled = False
Timer1.Stop()
Else
Me.Opacity = Me.Opacity - 0.01
End If
End Sub

Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
Timer3.Enabled = False
Timer3.Stop()
End

End Sub
End Class

barnamejoo
دوشنبه 20 خرداد 1387, 19:41 عصر
دوست عزیز بهتر بود سورس رو اتچ میکردید.

Nima NT
دوشنبه 20 خرداد 1387, 19:43 عصر
باشه بهتون لینک میدم ولی حجمش حدود 4 مگ می شه ، چون تو ظاهر برنامه خیلی کار شده.
یه کم بهم فرصت بدین تا آپلود کنم.