Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - Danyfirex

#451
Cita de: Karcrack en  9 Octubre 2012, 00:32 AM
Paste the ROTxEncrypt() function please.

Es esta:

Código (vb) [Seleccionar]
Private Sub Form_Load()
Dim str As String
Dim str2 As String


str = ROTXEncrypt("-978ç___#{~#{~#'é(-è", "pass")
MsgBox (str)
MsgBox (ROTXDecrypt(str, "pass"))
End Sub

Public Function AltStrConv(Temp As Variant, Conversion As VbStrConv) As Variant
Dim i As Long, lLen As Long, bvHack(0) As Byte, lHackDelta As Long
Dim bArr() As Byte, sString As String

lHackDelta = VarPtr(bvHack(0))

If Conversion = vbFromUnicode Then
    sString = Temp
    lLen = Len(sString)
    ReDim bArr(0 To lLen - 1)
    For i = 0 To lLen - 1
        bvHack(VarPtr(bArr(0)) - lHackDelta + i) = bvHack(StrPtr(sString) - lHackDelta + (i * 2))
    Next i
    AltStrConv = bArr
ElseIf Conversion = vbUnicode Then
    bArr = Temp
    lLen = UBound(Temp) + 1
    sString = Space$(lLen)
    For i = 0 To lLen - 1
        bvHack(StrPtr(sString) - lHackDelta + (i * 2)) = bvHack(VarPtr(bArr(0)) - lHackDelta + i)
    Next i
    AltStrConv = sString
End If

End Function

Function ROTXDecrypt(ByVal strData As String, ByVal strKey As String)
    On Error Resume Next
    Dim bData() As Byte, bKey() As Byte
    bData = AltStrConv(strData, vbFromUnicode)
    bKey = AltStrConv(strKey, vbFromUnicode)
    For i = 0 To UBound(bData)
        If i <= UBound(bKey) Then
            bData(i) = bData(i) - bKey(i)
        Else
            bData(i) = bData(i) - bKey(i Mod UBound(bKey))
        End If
    Next i
    ROTXDecrypt = AltStrConv(bData, vbUnicode)
End Function

Function ROTXEncrypt(ByVal strData As String, ByVal strKey As String)
    On Error Resume Next
    Dim bData() As Byte
    Dim bKey() As Byte
    bData = StrConv(strData, vbFromUnicode)
    bKey = StrConv(strKey, vbFromUnicode)
    For i = 0 To UBound(bData)
        If i <= UBound(bKey) Then
            bData(i) = bData(i) + bKey(i)
        Else
            bData(i) = bData(i) + bKey(i Mod UBound(bKey))
        End If
    Next i
    ROTXEncrypt = StrConv(bData, vbUnicode)
End Function


#452
for me it doesn't work with alternative "AltStrConv" neither StrConv.

now I have to go out. I'll come back later.
#453
Put some example that doesn't work to you, I don't got  it :huh:

I'm trying this and work correctly

Código (vb) [Seleccionar]
Dim str As String
Dim str2 As String
'Dim str3() As Byte


str = ROTXEncrypt("Work", "pass")
MsgBox (str)
MsgBox (ROTXDecrypt(str, "pass"))

#454
Maybe you're trying before compiling. because If you're running into vb IDE doesn't work. but if you compile work correctly. at least for me work correclty.
#455
well before reading about Karcrack says , I notice that is necesary to remove array bounds checks and try out of Visual Basic IDE, it means Compiled, And work Correctly.

try it.



#456
Cita de: Karcrack en  8 Octubre 2012, 13:51 PM
I made a post in HH time ago where I put all the different methods I found... Ofc HH is down so I can't paste them here... Anyway I throw some ideas: MultiByteToWideChar() and __vbaStrToUnicode()...



@Danyfirex: Working with memory is the same as using the "bvHack()" thingy.

si ya veo, es que no recordaba ese tema.

voy a mirar con bvHack().
#457
maybe using copymemory. Tomorrow I'll try to make something.  :)
#458
aquí te la dejo como se me ocurrió.  ;D

Código (vb) [Seleccionar]
Private Function AltStrConv(Temp As Variant, Conversion As VbStrConv) As Variant
Dim i As Long, lLen As Long
Dim bArr() As Byte, sString As String



If Conversion = vbFromUnicode Then
    sString = Temp
    lLen = Len(sString) - 1
    ReDim bArr(lLen)
    For i = 0 To lLen
       bArr(i) = Asc(Mid(Temp, (i + 1), 1))
       Next i
    AltStrConv = bArr
   
ElseIf Conversion = vbUnicode Then
    bArr = Temp
    lLen = UBound(Temp)
    sString = Space$(lLen + 1)
    For i = 0 To lLen
    sString = sString & Chr(bArr(i))
    Next i
    AltStrConv = sString
End If

End Function



saludos
#459
lo que podrías hacer seria esto para poner tu formulario en toda la pantalla.


Código (vb) [Seleccionar]
Private Sub Form_Load()

    Me.Height = Screen.Height
    Me.Width = Screen.Width

End Sub


y los demás componentes seria proporcionales.
#460
Te quedo super STARZ. hace tiempito lo hice en Autoit. es casi igual.


Karcrack buena MOD.