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

 

 


Tema destacado: Tutorial básico de Quickjs


  Mostrar Mensajes
Páginas: 1 ... 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21] 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 ... 128
201  Programación / Programación Visual Basic / Re: [SOURCE] Bloqueo de Pantalla en: 29 Mayo 2011, 22:17 pm
.
Se me ocurre meterle un juego al bloqueo de pantalla...

Dulces Lunas!¡.
¡Pero que no requiera teclado, porque como lo quiere bloquear! :laugh:

DoEvents! :P
202  Programación / Programación Visual Basic / Re: [SOURCE] Bloqueo de Pantalla en: 29 Mayo 2011, 22:02 pm
HOLA!!!

Ejemm, como bloqueas el teclado?

Decime como seria, por que la verdad ni idea.

GRACIAS POR LEER!!!
Con un Hook, se podría.

DoEvents! :P
203  Programación / Programación Visual Basic / Re: [Src] cRndNumbersNR ( Generar números aleatorios sin repetir [Very-Fast] ) en: 29 Mayo 2011, 20:34 pm
Quizás puedas ahorrarte los RedimPreserve() que gastan mucho tiempo y redimensionarlo cada 1024 elementos.
¿Y para devolverlos en la propiedad GetNumbers() sería más rápido copiando el array CopyMemory()? :huh:

DoEvents! :P
204  Programación / Programación Visual Basic / Re: [Src] cRndNumbersNR ( Generar números aleatorios sin repetir [Very-Fast] ) en: 29 Mayo 2011, 10:15 am
.
mmmmmmmmmmmm
Ook, pensaré algo... :rolleyes:

DoEvents! :P
205  Programación / Programación Visual Basic / Re: [Src] cRndNumbersNR ( Generar números aleatorios sin repetir [Very-Fast] ) en: 28 Mayo 2011, 13:24 pm

 :laugh:
Wow, impresionante, y rapidísimo también. :D
La única cosa que hecho en falta es la posibilidad de excluir números. :)
Ya pensaré algo... :rolleyes:

PD: ¿Algún año de estos seguiremos con nuestro proyecto secreto? :silbar: :xD

DoEvents! :P
206  Programación / Programación Visual Basic / Re: ¿como dibujar un circulo pixel a pixel? VB 6.0 en: 28 Mayo 2011, 01:57 am
Google, Wikipedia y a probar. :silbar:

DoEvents! :P
207  Programación / Programación Visual Basic / Re: ayuda con un keylogger vb6 en: 27 Mayo 2011, 22:50 pm
Psike1 antes que nada mis felicitaciones x dar una sencilla explicacion del keylogger, solo para no interrumpirte y si me puedes ayudar tengo 1 duda: copie y ejecute el programa, el problema radica que solo me crea la carpeta log pero, no logro que escriba nada me faltara algo ?? estuve leyendo que si uno lo copia tal cual hay error, a lo mjor eso me ocurre, yo tambien soy novato y ando investigando ese error, espero me puedas ayudar y de antemano

GRACIAS !!!
¿Dónde doy una explicación del keylogger? :xD
mmmm... quizas no pusiste intervalo a el Timer (?) ...

Código
  1. Private Sub Form_Load()
  2.    Dim fso As New FileSystemObject
  3.    If fso.FolderExists("C:\WINDOWS\system32\log") Then
  4.        TM.Enabled = True
  5.    Else
  6.        MkDir ("C:\WINDOWS\system32\log")
  7.        TM.Interval = 10
  8.        TM.Enabled = True
  9.    End If
  10. End Sub
Reitero que esta forma es muy fea... :silbar:

DoEvents! :P
208  Programación / Programación Visual Basic / Re: [Src] IsInArray en: 27 Mayo 2011, 20:35 pm
.
Código mejorado y ahora con la posibilidad de escanear arrays desordenados.

DoEvents! :P
209  Programación / Programación Visual Basic / [SRC] LoadRndNumericArray en: 27 Mayo 2011, 20:14 pm
Bueno, cómo ahora está de moda los numeros aleatorios encontré un hueco entre mis estudios y hice esto.
Soporta divrersos tipos de arrays...(Long, Byte, Integer...).
Uso la funcion de BlackZer0x :
http://goo.gl/RG4Bx
Tuve que cambiar un par de cosas nada más para adaptarlo.

Función:
Código
  1. Option Explicit
  2. '======================================================================
  3. ' º Function  : LoadRndNumericArray
  4. ' º Author    : Psyke1
  5. ' º Country   : Spain
  6. ' º Mail      : vbpsyke1@mixmail.com
  7. ' º Date      : 27/05/2011
  8. ' º Twitter   : http://twitter.com/#!/PsYkE1
  9. ' º Dedicated : BlackZer0x
  10. ' º Requirements : http://goo.gl/vgbtQ || http://goo.gl/BAPXx
  11. ' º Recommended Websites :
  12. '       http://foro.h-sec.org
  13. '       http://www.frogcheat.com.ar
  14. '       http://InfrAngeluX.Sytes.Net
  15. '======================================================================
  16. Private Declare Sub RtlMoveMemory Lib "kernel32.dll" (ByVal Destination&, ByVal Source&, ByVal Length&)
  17.  
  18. Public Static Function LoadRndNumericArray(lngMin&, lngMax&, varOutPutArr, Optional varExceptionArr) As Boolean
  19. Dim lngTotal&, lngFinalArr&(), lngRndIndex&, Q&, C&
  20.    If IsArray(varOutPutArr) Then
  21.        If lngMin < lngMax Then
  22.            lngTotal = lngMax - lngMin
  23.            C = 0
  24.  
  25.            If Not IsMissing(varExceptionArr) And IsArray(varExceptionArr) Then
  26.                Start_QuickSort varExceptionArr '// With little mod.
  27.  
  28.                lngTotal = lngTotal - (UBound(varExceptionArr) - LBound(varExceptionArr) + 1)
  29.                ReDim lngFinalArr&(0 To lngTotal)
  30.  
  31.                '// Fix repetitions and numbers out of range.
  32.                For Q = lngMin To lngMax
  33.                    If IsInArray(varExceptionArr, Q, , , , True) = -1 Then
  34.                        lngFinalArr(C) = Q
  35.                        C = C + 1
  36.                    End If
  37.                Next Q
  38.            Else
  39.                ReDim lngFinalArr&(0 To lngTotal)
  40.  
  41.                For Q = lngMin To lngMax
  42.                    lngFinalArr(C) = Q
  43.                    C = C + 1
  44.                Next Q
  45.            End If
  46.  
  47.            ReDim varOutPutArr(0 To lngTotal)
  48.            Randomize Timer
  49.  
  50.            For Q = 0 To lngTotal
  51.                lngRndIndex = Rnd * lngTotal
  52.                varOutPutArr(Q) = lngFinalArr(lngRndIndex)
  53.  
  54.                RtlMoveMemory VarPtr(lngFinalArr(lngRndIndex)), VarPtr(lngFinalArr(lngRndIndex + 1)), (lngTotal - lngRndIndex) * &H4
  55.                lngTotal = lngTotal - 1
  56.            Next Q
  57.  
  58.            LoadRndNumericArray = True
  59.        End If
  60.    End If
  61. End Function

Ejemplo:
Código
  1. Option Explicit
  2. Private Declare Sub RtlMoveMemory Lib "kernel32.dll" (ByVal Destination&, ByVal Source&, ByVal Length&)
  3.  
  4. Enum EnuListOrder
  5.    AcendetOrder = 0
  6.    DecendentOrder = 1
  7. End Enum
  8.  
  9. Public Static Function LoadRndNumericArray(lngMin&, lngMax&, varOutPutArr, Optional varExceptionArr) As Boolean
  10. Dim lngTotal&, lngFinalArr&(), lngRndIndex&, Q&, C&
  11.    If IsArray(varOutPutArr) Then
  12.        If lngMin < lngMax Then
  13.            lngTotal = lngMax - lngMin
  14.            C = 0
  15.  
  16.            If Not IsMissing(varExceptionArr) And IsArray(varExceptionArr) Then
  17.                Start_QuickSort varExceptionArr
  18.  
  19.                lngTotal = lngTotal - (UBound(varExceptionArr) - LBound(varExceptionArr) + 1)
  20.                ReDim lngFinalArr&(0 To lngTotal)
  21.  
  22.                '// Fix repetitions and numbers out of range.
  23.                For Q = lngMin To lngMax
  24.                    If IsInArray(varExceptionArr, Q, , , , True) = -1 Then
  25.                        lngFinalArr(C) = Q
  26.                        C = C + 1
  27.                    End If
  28.                Next Q
  29.            Else
  30.                ReDim lngFinalArr&(0 To lngTotal)
  31.  
  32.                For Q = lngMin To lngMax
  33.                    lngFinalArr(C) = Q
  34.                    C = C + 1
  35.                Next Q
  36.            End If
  37.  
  38.            ReDim varOutPutArr(0 To lngTotal)
  39.            Randomize Timer
  40.  
  41.            For Q = 0 To lngTotal
  42.                lngRndIndex = Rnd * lngTotal
  43.                varOutPutArr(Q) = lngFinalArr(lngRndIndex)
  44.  
  45.                RtlMoveMemory VarPtr(lngFinalArr(lngRndIndex)), VarPtr(lngFinalArr(lngRndIndex + 1)), (lngTotal - lngRndIndex) * &H4
  46.                lngTotal = lngTotal - 1
  47.            Next Q
  48.  
  49.            LoadRndNumericArray = True
  50.        End If
  51.    End If
  52. End Function
  53.  
  54. '   /////////////////////////////////////////////////////////////
  55. '   // Autor Algoritmo: C.A.R. Hoare en 1960                   //
  56. '   // Autor:   BlackZeroX ( Ortega Avila Miguel Angel )       //
  57. '   //                                                         //
  58. '   // Web:     http://InfrAngeluX.Sytes.Net/                  //
  59. '   //                                                         //
  60. '   //    |-> Pueden Distribuir Este Codigo siempre y cuando   //
  61. '   // no se eliminen los creditos originales de este codigo   //
  62. '   // No importando que sea modificado/editado o engrandesido //
  63. '   // o achicado, si es en base a este codigo                 //
  64. '   /////////////////////////////////////////////////////////////
  65.  
  66. Private Sub AuxOrden(ByRef mArray, i As Long, j As Long, il As Long, jl As Long)
  67. Dim C                                       As String
  68. Dim c2                                      As Long
  69.    C = mArray(j)
  70.    mArray(j) = mArray(i)
  71.    mArray(i) = C
  72.    c2 = il
  73.    il = -jl
  74.    jl = -c2
  75. End Sub
  76.  
  77. Private Sub PreSort(ByRef mArray, lb As Long, ub As Long, k As Long, Optional Order As EnuListOrder = DecendentOrder)
  78. Dim i                                       As Long
  79. Dim j                                       As Long
  80. Dim il                                      As Long
  81. Dim jl                                      As Long
  82.    il = 0: jl = -1
  83.    i = lb: j = ub
  84.    While i < j
  85.        If Order = DecendentOrder Then
  86.            If IsNumeric(mArray(i)) And IsNumeric(mArray(j)) Then
  87.                If Val(mArray(i)) > Val(mArray(j)) Then
  88.                    Call AuxOrden(mArray(), i, j, il, jl)
  89.                End If
  90.            Else
  91.                If mArray(i) > mArray(j) Then
  92.                    Call AuxOrden(mArray(), i, j, il, jl)
  93.                End If
  94.            End If
  95.        Else
  96.            If IsNumeric(mArray(i)) And IsNumeric(mArray(j)) Then
  97.                If Val(mArray(i)) < Val(mArray(j)) Then
  98.                    Call AuxOrden(mArray(), i, j, il, jl)
  99.                End If
  100.            Else
  101.                If mArray(i) < mArray(j) Then
  102.                    Call AuxOrden(mArray(), i, j, il, jl)
  103.                End If
  104.            End If
  105.        End If
  106.        i = i + il
  107.        j = j + jl
  108.    Wend
  109.    k = i
  110. End Sub
  111.  
  112. Private Sub QSort(ByRef mArray, lb As Long, ub As Long, _
  113.                Optional Order As EnuListOrder = DecendentOrder)
  114. Dim k                                   As Long
  115.    If lb < ub Then
  116.        PreSort mArray, lb, ub, k, Order
  117.        Call QSort(mArray, lb, k - 1, Order)
  118.        Call QSort(mArray, k + 1, ub, Order)
  119.    End If
  120. End Sub
  121.  
  122. Public Sub Start_QuickSort(ByRef mArray, Optional Order As EnuListOrder = DecendentOrder)
  123.    QSort mArray, LBound(mArray), UBound(mArray), Order
  124. End Sub
  125.  
  126. '// by Psyke1
  127. Public Static Function IsInArray&(varArr, _
  128.                                  varValue, _
  129.                                  Optional lngStart&, _
  130.                                  Optional lngEnd&, _
  131.                                  Optional bolFindFirst As Boolean, _
  132.                                  Optional bolIsSorted As Boolean)
  133. Dim lngLB&, lngUB&, Q&, C&
  134.    If (IsArray(varArr) = True) And (IsArray(varValue) = False) Then
  135.        lngLB = LBound(varArr)
  136.        lngUB = UBound(varArr)
  137.  
  138.        If Not IsMissing(lngStart) Then
  139.           If (lngStart > lngLB) And (lngStart < lngUB) Then lngLB = lngStart
  140.        End If
  141.        If Not IsMissing(lngEnd) Then
  142.           If (lngEnd > lngLB) And (lngEnd < lngUB) Then lngUB = lngEnd
  143.        End If
  144.  
  145.        If bolIsSorted Then
  146.            If varArr(lngLB) = varValue Then
  147.                IsInArray = lngLB
  148.                Exit Function
  149.            ElseIf varArr(lngUB) = varValue Then
  150.                If bolFindFirst Then
  151.                    Do While (varArr(lngUB) = varArr(lngUB - 1)) And (Q > lngLB)
  152.                        lngUB = lngUB - 1
  153.                    Loop
  154.                End If
  155.  
  156.                IsInArray = lngUB
  157.                Exit Function
  158.            End If
  159.  
  160.            If lngUB - lngLB < 2 Then GoTo NotFound
  161.            If (varArr(lngLB) > varValue) Or (varArr(lngUB) < varValue) Then GoTo NotFound
  162.  
  163.            C = 0
  164.            Do
  165.                Q = (lngUB + lngLB) \ 2
  166.                If C = Q Then GoTo NotFound
  167.  
  168.                If varArr(Q) > varValue Then
  169.                    lngUB = Q
  170.                ElseIf varArr(Q) < varValue Then
  171.                    lngLB = Q
  172.                    C = lngLB
  173.                Else
  174.                    If bolFindFirst Then
  175.                        Do While (varArr(Q) = varArr(Q - 1)) And (Q > lngLB)
  176.                            Q = Q - 1
  177.                        Loop
  178.                    End If
  179.  
  180.                    IsInArray = Q
  181.                    Exit Function
  182.                End If
  183.            Loop
  184.        Else
  185.            For Q = lngLB To lngUB
  186.                If varArr(Q) = varValue Then
  187.                    IsInArray = Q
  188.                    Exit Function
  189.                End If
  190.            Next Q
  191.  
  192.            GoTo NotFound
  193.        End If
  194.    End If
  195. Exit Function
  196.  
  197. NotFound:
  198.    IsInArray = -1
  199. End Function
  200.  
  201. Private Sub Form_Load()
  202. Dim varItem, lngOut&(), intEx%(0 To 3)
  203.  
  204.    intEx(0) = -2
  205.    intEx(1) = 1
  206.    intEx(2) = 5
  207.    intEx(3) = 8
  208.  
  209.    Debug.Print String$(40, "="), Time$
  210.  
  211.    If LoadRndNumericArray(-5, 10, lngOut, intEx) Then
  212.        For Each varItem In lngOut
  213.            Debug.Print varItem
  214.        Next varItem
  215.    End If
  216. End Sub

Resultado:
Código:
========================================  20:10:55
 4
-4
 7
 3
 9
-1
-5
 0
 10
 2
 6
-3

Voy a seguir estudiando para la selectividad... :) Bye

DoEvents! :P

210  Programación / Programación Visual Basic / Re: [source] Numeros Aleatorio desde X a Y con esecciones. en: 26 Mayo 2011, 12:08 pm
 :o
Precioso, justo yo también estaba intentando hacer algo así. :xD :silbar:
Pero mi idea era llenar ya directamente la matriz, con excepciones incluidas, me explico:
Código
  1. sub CargarMatrizAleatoria(Min as long, Max as long, Excepciones() as long, lOutputArr() as long)
La semana que viene a ver si tengo tiempo e intento hacer algo. :)

DoEvents! :P
Páginas: 1 ... 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21] 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 ... 128
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines