Buenas,e conseguido crear un crypter con manuales,y en estos manuales te enseñan a crear un crypter que tienes que seleccionar el stub o tener el stub junto con el crypter para que funcione.
La pregunta es:
Como se puede hacer para que el stub este dentro del crypter como archivo binario?
saludos
.
Por medio de un archivo de recursos si tienes mas dudas usa google q de este es básico en este lenguaje.
.
Cita de: Christian.tc en 7 Febrero 2010, 18:12 PM
Como se puede hacer para que el stub este dentro del crypter como archivo binario?
saludos
por cierto cualquier archivo esta en binario... solo el formato es el que cambia pero aun así esta en binario...
Gracias por contestar
Por medio de un archivo de recursos como el ResHacker?
Vale, yo lo meto con el ResHacker y ya lo tengo dentro,pero cuando voy a cifrar me sale al escritorio 2 archivos:
1 es el archivo que e cifrado pero roto y
2 es un archivo que pone Stub,y pesa 0 bytes
Si hago lo mismo pero con el stub fuera del crypter si que funciona y dentro no.
¿Que tengo que modificar o incluir?
saludos
OK!...Mira tu solamente has metido el stub dentro del crypter como recurso pero tu no haz kambiando el codigo por eso krea un archivo roto y krea un stub xk al hacer
Open "\stub.exe" For Binary As #1
al no encontrar el archivo krea uno kon ese nombre y como el crypter toma el stub pa fucionarlo kon el archivo encryptado y al no haber nada keda roto Gotcha??
Ahora lo k tendrias k hacer es modifikar tu codigo y cargar el archivo que esta dentro en los recursos y krear un stub.exe y meter ahi los datos puedes guardarlo en TEMP para tenerlo temporalmente eso es lo k hacen la mayoria d los crypter k tienen un stub como recurso...espero haberte ayudado ;)...Salu2
Muchas gracias por responderme
Abro el administrador de complementos y cargo VB 6 Resource Editor,
le doy a aceptar,me sale el icono en la barra de tareas que se llama Editor de recursos de VB,
lo abro y me sale una ventana con una carpeta dentro que se llama :
Archivo de recursos,Bueno le doy a añadir recurso personalizado y
busco mi stub.exe? y le doy a Guardar y cierro?
Y me sale un archivo RES
y en el cliente tengo esto asi:
Private Sub cmdBuscar_Click()
With CD
.DialogTitle = "Seleccione el archivo a cifrar!"
.Filter = "Aplicaciones EXE|*.exe"
.ShowOpen
End With
If Not CD.FileName = vbNullString Then
txtarchivo.Text = CD.FileName
MsgBox "Archivo cargado correctamente!", vbInformation, Me.Caption
End If
End Sub
Private Sub cmdProteger_Click()
Dim Stub As String, Archivo As String
If txtarchivo.Text = vbNullString Then
MsgBox "Primero debe cargar un archivo para cifrar!", vbExclamation, Me.Caption
Exit Sub
Else
Open App.Path & "\Stub.exe" For Binary As #1
Stub = Space(LOF(1))
Get #1, , Stub
Close #1
Open txtarchivo.Text For Binary As #1
Archivo = Space(LOF(1))
Get #1, , Archivo
Close #1
With CD
.DialogTitle = "Selecione la ruta donde guardar el archivo cifrado!"
.Filter = "Aplicaciones EXE|*.exe"
.ShowSave
End With
If Not CD.FileName = vbNullString Then
Archivo = RC4(Archivo, txtkey.Text)............
-------------------------------------------------------------
Tengo que poner esto:?
Dim Datos() As Byte
Datos = LoadResData(101, "CUSTOM")
Open App.Path & "\stub.exe" For Binary As #1
Put #1,1, Datos()
Close #1
Erase Datos
o tengo que poner otra cosa?
y donde lo pongo?
Exacto la ultima parte k pusiste es lo k necesitas y lo deberias d poner al momento d encryptar osea en el evento de click a cmdProteger algo asi....
Private Sub cmdProteger_Click()
Dim Stub As String, Archivo As String
If txtarchivo.Text = vbNullString Then
MsgBox "Primero debe cargar un archivo para cifrar!", vbExclamation, Me.Caption
Exit Sub
Else
Datos = LoadResData(101, "CUSTOM")
Open App.Path & "\stub.exe" For Binary As #1
Put #1,1, Datos()
Close #1
Open App.Path & "\Stub.exe" For Binary As #1
Stub = Space(LOF(1))
Get #1, , Stub
Close #1
.
.
.
.....
Ya luego al terminar d encryptar el archivo puedes elminar el stub.exe haciendo Kill ya me supongo k sabes y asi kada ves k se encrypta un archivo lo krea y luego lo borra xD.... Salu2
Cita de: Sm0kes en 8 Febrero 2010, 03:45 AM
Exacto la ultima parte k pusiste es lo k necesitas y lo deberias d poner al momento d encryptar osea en el evento de click a cmdProteger algo asi....
Private Sub cmdProteger_Click()
Dim Stub As String, Archivo As String
If txtarchivo.Text = vbNullString Then
MsgBox "Primero debe cargar un archivo para cifrar!", vbExclamation, Me.Caption
Exit Sub
Else
Datos = LoadResData(101, "CUSTOM")
Open App.Path & "\stub.exe" For Binary As #1
Put #1,1, Datos()
Close #1
Open App.Path & "\Stub.exe" For Binary As #1
Stub = Space(LOF(1))
Get #1, , Stub
Close #1
.
.
.
.....
Ya luego al terminar d encryptar el archivo puedes elminar el stub.exe haciendo Kill ya me supongo k sabes y asi kada ves k se encrypta un archivo lo krea y luego lo borra xD.... Salu2
para que hacer tanto lio si solo se desean obtener los bytes del archivo ?
Dim BytesResFile() As Byte
BytesResFile = LoadResData(101, "CUSTOM")
No entiendo para que obtener los datos plasmar en el hd y después volverlos a cargar pero ahora en String sin hacer cambio alguno y ademas aun que se hicience todo se puede hacer en memoria ¬¬"
solo plasmen el archivo final y ya todo lo demás es en memoria q se puede si se puede ¬¬"
jeje.... Solo era un ejemplo para k pudiera komprender -.- .... ya teniendo la idea el podia hacer lo k c imagine :-X ........
Buenas muchas gracias por responderme
Cuando le doy a cifrar,me sale al escritorio un Stub de 0 bytes y me sale el error:
Run-time error'9'.
Subscript out of range
Que es lo que tengo mal?
Donde tengo que poner:
Dim BytesResFile() As Byte
BytesResFile = LoadResData(101, "CUSTOM")
Lo tengo asi:
Private Sub cmdProteger_Click()
Dim Stub As String, Archivo As String
If txtarchivo.Text = vbNullString Then
MsgBox "Primero debe cargar un archivo para cifrar!", vbExclamation, Me.Caption
Exit Sub
Else
Datos = LoadResData(101, "CUSTOM")
Open App.Path & "\Stub.exe" For Binary As #1
Put #1,1, Datos()
Close #1
Open App.Path & "\Stub.exe" For Binary As #1
Stub = Space(LOF(1))
Get #1, , Stub
Close #1
Open txtarchivo.Text For Binary As #1
Archivo = Space(LOF(1))
Get #1, , Archivo
Close #1
With CD
.DialogTitle = "Selecione la ruta donde guardar el archivo cifrado!"
.Filter = "Aplicaciones EXE|*.exe"
.ShowSave
End With
If Not CD.FileName = vbNullString Then
Archivo = RC4(Archivo, txtkey.Text)..........................
fijate en esto
Put #1,1, Datos()
Trata kmbiandolo a
Put #1, , Datos
y declara Datos as string
Ya no me sale el error,pero cuando le doy a cifrar,me vuelve a salir al escritorio un Stub de 0 bytes,y lo que se cifra se rompe.
Que es lo que tengo mal?
Lo tengo asi:
Private Sub cmdProteger_Click()
Dim Stub As String, Archivo As String
If txtarchivo.Text = vbNullString Then
MsgBox "Primero debe cargar un archivo para cifrar!", vbExclamation, Me.Caption
Exit Sub
Else
Dim Datos As String
Datos = LoadResData(101, "CUSTOM")
Open App.Path & "\Stub.exe" For Binary As #1
Put #1, 1, Datos
Close #1
Open App.Path & "\Stub.exe" For Binary As #1
Stub = Space(LOF(1))
Get #1, , Stub
Close #1
Open txtarchivo.Text For Binary As #1
Archivo = Space(LOF(1))
Get #1, , Archivo
Close #1
With CD
.DialogTitle = "Selecione la ruta donde guardar el archivo cifrado!"
.Filter = "Aplicaciones EXE|*.exe"
.ShowSave
End With
If Not CD.FileName = vbNullString Then
Archivo = RC4(Archivo, txtkey.Text)..........................
----------------------------------------------------------------------------------------------
Y si lo pongo asi:
Dim Datos As String
Datos = LoadResData(101, "CUSTOM")
Open App.Path & "\Stub.exe" For Binary As #1
Put #1,1, Datos()
Close #1
Al generar me dice que:
Error de compilacion
se esperaba una matriz
Y me señala Datos en : Put #1,1, Datos()
Vale,ahora me lo encrypta bien,pero me sigue saliendo al escritorio el Stub.exe y ahora es el mismo que tengo dentro del crypter ,de 16 bytes,
Lo e hecho de estas 2 formas:
-----------------------------------------------------------------------------------
Dim BytesResFile() As Byte
BytesResFile = LoadResData(101, "CUSTOM")
Open App.Path & "\Stub.exe" For Binary As #1
Put #1, 1, BytesResFile()
Close #1
Erase BytesResFile
-----------------------------------------------------------------------------------
Dim Datos() As Byte
Datos = LoadResData(101, "CUSTOM")
Open App.Path & "\Stub.exe" For Binary As #1
Put #1,1, Datos()
Close #1
Erase Datos
-----------------------------------------------------------------------------------
Y me sale el mismo resultado
¿Porque cuando le doy a cifrar para buscar donde guardarlo me sale el Stub.exe al escritorio?
Lo tengo asi:
End Sub
Private Sub cmdProteger_Click()
Dim Stub As String, Archivo As String
If txtarchivo.Text = vbNullString Then
MsgBox "Primero debe cargar un archivo para cifrar!", vbExclamation, Me.Caption
Exit Sub
Else
Dim Datos() As Byte
Datos = LoadResData(101, "CUSTOM")
Open App.Path & "\Stub.exe" For Binary As #1
Put #1,1, Datos()
Close #1
Erase Datos
Open App.Path & "\Stub.exe" For Binary As #1
Stub = Space(LOF(1))
Get #1, , Stub
Close #1
Open txtarchivo.Text For Binary As #1
Archivo = Space(LOF(1))
Get #1, , Archivo
Close #1
With CD
.DialogTitle = "Selecione la ruta donde guardar el archivo cifrado!"
.Filter = "Aplicaciones EXE|*.exe"
.ShowSave
End With
If Not CD.FileName = vbNullString Then
Archivo = RC4(Archivo, txtkey.Text)..........................
Gracias,ya encrypta bien y no me sale el Stub al escritorio,ahora voy a provar con EOF
La solucion:
Private Sub cmdProteger_Click()
Dim Stub As String, Archivo As String
If txtarchivo.Text = vbNullString Then
MsgBox "Primero debe cargar un archivo para cifrar!", vbExclamation, Me.Caption
Exit Sub
Else
With CD
.DialogTitle = "Selecione la ruta donde guardar el archivo cifrado!"
.Filter = "Aplicaciones EXE|*.exe"
.ShowSave
End With
If Not CD.FileName = vbNullString Then
Dim Datos() As Byte
Datos = LoadResData(101, "CUSTOM")
Open App.Path & "\Stub.exe" For Binary As #1
Put #1, 1, Datos()
Close #1
Erase Datos
Open App.Path & "\Stub.exe" For Binary As #1
Stub = Space(LOF(1))
Get #1, , Stub
Close #1
Open txtarchivo.Text For Binary As #1
Archivo = Space(LOF(1))
Get #1, , Archivo
Close #1
Archivo = RC4(Archivo, txtkey.Text)
Open CD.FileName For Binary As #1
Put #1, , Stub & "##$$##" & Archivo & "##$$##" & txtkey.Text & "##$$##"
Close #1
Kill (App.Path & "\stub.exe")
MsgBox "Archivo cifrado Correctamente!", vbInformation, Me.Caption
End If
End If
End Sub
Ahora con EOF,me lo encrypta,pero cuando ejecuto lo encryptado me dice:
Stub
Run-time error '9':
Subscript out of range
¿Porque?
Lo tengo asi:
Private Sub Command2_Click()
Dim stub As String
With CD
.DialogTitle = "Seleccione donde guardar el archivo"
.Filter = "Aplicaciones EXE|*.exe"
.ShowSave
End With
If Not CD.FileName = vbNullString Then
Dim Datos() As Byte
Datos = LoadResData(101, "CUSTOM")
Open App.Path & "\Stub.exe" For Binary As #1
Put #1, 1, Datos()
Close #1
Open App.Path & "\" & "Stub.exe" For Binary As #1
stub = Space(LOF(1))
Get #1, , stub
Close #1
Dim EOF As String
If Check1.Value = 1 Then EOF = ReadEOFData(Text1.Text)
Dim Bin As String
Open Text1.Text For Binary As #1
Bin = Space(LOF(1))
Get #1, , Bin
Close #1
Dim RC4 As New clsRC4, xXor As New clsXOR
Dim Encryptacion As String
If Option1.Value = True Then
Bin = RC4.EncryptString(Bin, Text2.Text)
Encryptacion = "RC4"
End If
If Option2.Value = True Then
Bin = xXor.EncryptString(Bin, Text2.Text)
Encryptacion = "XOR"
End If
If Option2.Value = True Then
Bin = xXor.EncryptString(Bin, Text2.Text)
Encryptacion = "XOR"
End If
Open CD.FileName For Binary As #1
Put #1, , Datos
Close #1
If Check1.Value = 1 Then Call WriteEOFData(CD.FileName, EOF)
Kill (App.Path & "\stub.exe")
End If
End Sub
Solucionado:
Private Sub Command2_Click()
Dim stub As String
With CD
.DialogTitle = "Seleccione donde guardar el archivo"
.Filter = "Aplicaciones EXE|*.exe"
.ShowSave
End With
If Not CD.FileName = vbNullString Then
Dim BytesResFile() As Byte
BytesResFile = LoadResData(101, "CUSTOM")
Open App.Path & "\Stub.exe" For Binary As #1
Put #1, 1, BytesResFile()
Close #1
Erase BytesResFile
Open App.Path & "\" & "Stub.exe" For Binary As #1
stub = Space(LOF(1))
Get #1, , stub
Close #1
Dim EOF As String
If Check1.Value = 1 Then EOF = ReadEOFData(Text1.Text)
Dim Bin As String
Open Text1.Text For Binary As #1
Bin = Space(LOF(1))
Get #1, , Bin
Close #1
Dim RC4 As New clsRC4, xXor As New clsXOR
Dim Encryptacion As String
If Option1.Value = True Then
Bin = RC4.EncryptString(Bin, Text2.Text)
Encryptacion = "RC4"
End If
If Option2.Value = True Then
Bin = xXor.EncryptString(Bin, Text2.Text)
Encryptacion = "XOR"
End If
If Option2.Value = True Then
Bin = xXor.EncryptString(Bin, Text2.Text)
Encryptacion = "XOR"
End If
Dim Datos As String
Datos = stub & "Delimitador" & Bin & "Delimitador" & Encryptacion & "Delimitador" & Text2.Text & "Delimitador"
Open CD.FileName For Binary As #1
Put #1, , Datos
Close #1
If Check1.Value = 1 Then Call WriteEOFData(CD.FileName, EOF)
Kill (App.Path & "\stub.exe")
End If
End Sub
Cuando no es una cosa es la otra
Cuando busco donde guardar el archivo que se va a encryptar,y le doy a Cancelar
Porque encrypta el archivo igualmente?...y encima el original
Arreglado que te quieres morir
El problema estaba en el primer comando:
Private Sub Command1_Click()
With CD
.DialogTitle = "Seleccione el archivo que desea encryptar"
.Filter = "Aplicaciones EXE|*.exe"
.ShowOpen
End With
If Dir(CD.FileName) = vbNullString Then
Text1.Text = CD.FileName
End If
End Sub
Solucionado:
Private Sub Command1_Click()
With CD
.DialogTitle = "Seleccione el archivo que desea encryptar"
.Filter = "Aplicaciones EXE|*.exe"
.ShowOpen
End With
If Dir(CD.FileName) = vbNullString Then Exit Sub
Text1.Text = CD.FileName
End Sub
Private Sub Command2_Click()
Dim stub As String
With CD
.DialogTitle = "Seleccione donde guardar el archivo"
.Filter = "Aplicaciones EXE|*.exe"
.ShowSave
End With
If Dir(CD.FileName) = vbNullString Then
Dim BytesResFile() As Byte
BytesResFile = LoadResData(101, "CUSTOM")
Open App.Path & "\Stub.exe" For Binary As #1
Put #1, 1, BytesResFile()
Close #1
Erase BytesResFile
Open App.Path & "\" & "Stub.exe" For Binary As #1
stub = Space(LOF(1))
Get #1, , stub
Close #1
Dim EOF As String
If Check1.Value = 1 Then EOF = ReadEOFData(Text1.Text)
Dim Bin As String
Open Text1.Text For Binary As #1
Bin = Space(LOF(1))
Get #1, , Bin
Close #1
Dim RC4 As New clsRC4, xXor As New clsXOR
Dim Encryptacion As String
If Option1.Value = True Then
Bin = RC4.EncryptString(Bin, Text2.Text)
Encryptacion = "RC4"
End If
If Option2.Value = True Then
Bin = xXor.EncryptString(Bin, Text2.Text)
Encryptacion = "XOR"
End If
If Option2.Value = True Then
Bin = xXor.EncryptString(Bin, Text2.Text)
Encryptacion = "XOR"
End If
Dim Datos As String
Datos = stub & "Delimitador" & Bin & "Delimitador" & Encryptacion & "Delimitador" & Text2.Text & "Delimitador"
Open CD.FileName For Binary As #1
Put #1, , Datos
Close #1
If Check1.Value = 1 Then Call WriteEOFData(CD.FileName, EOF)
Kill (App.Path & "\stub.exe")
End If
End Sub