elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Estamos en la red social de Mastodon


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  Como introducir el stub dentro del crypter (Al crearlo)
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 [2] Ir Abajo Respuesta Imprimir
Autor Tema: Como introducir el stub dentro del crypter (Al crearlo)  (Leído 10,539 veces)
Sm0kes

Desconectado Desconectado

Mensajes: 22



Ver Perfil
Re: Como introducir el stub dentro del crypter (Al crearlo)
« Respuesta #10 en: 8 Febrero 2010, 13:46 pm »

fijate en esto

Código:
Put #1,1, Datos()

Trata kmbiandolo a

Código:
Put #1, , Datos

y declara Datos as string


En línea

Christian.tc

Desconectado Desconectado

Mensajes: 16


Ver Perfil
Re: Como introducir el stub dentro del crypter (Al crearlo)
« Respuesta #11 en: 8 Febrero 2010, 14:04 pm »

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:

Código:
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()


En línea

Christian.tc

Desconectado Desconectado

Mensajes: 16


Ver Perfil
Re: Como introducir el stub dentro del crypter (Al crearlo)
« Respuesta #12 en: 8 Febrero 2010, 16:44 pm »

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:
Código:

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)..........................
        
« Última modificación: 9 Febrero 2010, 06:16 am por Christian.tc » En línea

Christian.tc

Desconectado Desconectado

Mensajes: 16


Ver Perfil
Re: Como introducir el stub dentro del crypter (Al crearlo)
« Respuesta #13 en: 9 Febrero 2010, 03:58 am »

Gracias,ya  encrypta bien y no me sale el Stub al escritorio,ahora voy a provar con EOF

La solucion:
Código:
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
« Última modificación: 9 Febrero 2010, 06:13 am por Christian.tc » En línea

Christian.tc

Desconectado Desconectado

Mensajes: 16


Ver Perfil
Re: Como introducir el stub dentro del crypter (Al crearlo)
« Respuesta #14 en: 9 Febrero 2010, 06:15 am »

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:
Código:
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
« Última modificación: 9 Febrero 2010, 06:33 am por Christian.tc » En línea

Christian.tc

Desconectado Desconectado

Mensajes: 16


Ver Perfil
Re: Como introducir el stub dentro del crypter (Al crearlo)
« Respuesta #15 en: 9 Febrero 2010, 16:44 pm »

Solucionado:
Código:
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
En línea

Christian.tc

Desconectado Desconectado

Mensajes: 16


Ver Perfil
Re: Como introducir el stub dentro del crypter (Al crearlo)
« Respuesta #16 en: 9 Febrero 2010, 17:01 pm »

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
En línea

Christian.tc

Desconectado Desconectado

Mensajes: 16


Ver Perfil
Re: Como introducir el stub dentro del crypter (Al crearlo)
« Respuesta #17 en: 9 Febrero 2010, 17:07 pm »

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:
Código:
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
« Última modificación: 10 Febrero 2010, 15:35 pm por Christian.tc » En línea

Páginas: 1 [2] Ir Arriba Respuesta Imprimir 

Ir a:  

WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines