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

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


  Mostrar Mensajes
Páginas: 1 ... 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 37 38 39 40 ... 73
241  Programación / Programación Visual Basic / Re: Api de winsock en: 27 Marzo 2006, 02:11 am
Citar
pero eso q tiene q ver si es de conexion inversa :S ?? corrigeme si me equivoco

Te corrijo. Ahora la mayoria de los firewalls (menos el del WinXP SP2, segun tengo entendido) controlan la entrada y SALIDA de datos. Si tenes el firewall del SP2 o algun otro desactivalo, porque acordate que el programa esta tratando de conectarse a tu pc. Lo mismo con la victima.

Saludos.-
242  Programación / Programación Visual Basic / Re: Abrir solo dos instancias de mi programa en: 26 Marzo 2006, 19:38 pm
Podes usar la API FindWindow y si se encuentran 2 ventanas con el titulo de tu form que no se ejecute nuevamente el programa.

Saludos.-
243  Programación / Programación Visual Basic / Re: controlar el winamp desde VB en: 26 Marzo 2006, 19:28 pm
Por favor pone las etiquetas de codigo () asi se puede leer mas facil el codigo.
244  Programación / Programación Visual Basic / Re: Como captar una ventana activa de X programa desde VB en: 24 Marzo 2006, 02:29 am
Busca info sobre las APIs GetActiveWindow y GetWindowText.

Saludos.-
245  Programación / Programación Visual Basic / Re: Interprete de Dos en: 23 Marzo 2006, 23:53 pm
En un módulo:
Código:
Public Declare Function CreatePipe Lib "kernel32" ( _
          phReadPipe As Long, _
          phWritePipe As Long, _
          lpPipeAttributes As Any, _
          ByVal nSize As Long) As Long
     
      'Leer Tunel
      Public Declare Function ReadFile Lib "kernel32" ( _
          ByVal hFile As Long, _
          ByVal lpBuffer As String, _
          ByVal nNumberOfBytesToRead As Long, _
          lpNumberOfBytesRead As Long, _
          ByVal lpOverlapped As Any) As Long
     
      'Esto lo usa la funcion CreateProcessA
      Public Type SECURITY_ATTRIBUTES
          nLength As Long
          lpSecurityDescriptor As Long
          bInheritHandle As Long
      End Type
     
      'Esto lo usa la funcion CreateProcessA
      Public Type STARTUPINFO
          cb As Long
          lpReserved As Long
          lpDesktop As Long
          lpTitle As Long
          dwX As Long
          dwY As Long
          dwXSize As Long
          dwYSize As Long
          dwXCountChars As Long
          dwYCountChars As Long
          dwFillAttribute As Long
          dwFlags As Long
          wShowWindow As Integer
          cbReserved2 As Integer
          lpReserved2 As Long
          hStdInput As Long
          hStdOutput As Long
          hStdError As Long
      End Type
     
      'Esto lo usa la funcion CreateProcessA
      Public Type PROCESS_INFORMATION
          hProcess As Long
          hThread As Long
          dwProcessId As Long
          dwThreadID As Long
      End Type
     
      'Esta funcion lanza el proceso y
      'devuelve sus datos a traves de PROCESS_INFORMATION
      Public Declare Function CreateProcessA Lib "kernel32" ( _
          ByVal lpApplicationName As Long, _
          ByVal lpCommandLine As String, _
          lpProcessAttributes As SECURITY_ATTRIBUTES, _
          lpThreadAttributes As SECURITY_ATTRIBUTES, _
          ByVal bInheritHandles As Long, _
          ByVal dwCreationFlags As Long, _
          ByVal lpEnvironment As Long, _
          ByVal lpCurrentDirectory As Long, _
          lpStartupInfo As STARTUPINFO, _
          lpProcessInformation As PROCESS_INFORMATION) As Long
     
      'Cierra el tunel
      Public Declare Function CloseHandle Lib "kernel32" ( _
          ByVal hHandle As Long) As Long
     
      'Constantes necesarias para lo de antes
      Public Const NORMAL_PRIORITY_CLASS = &H20&
      Public Const STARTF_USESTDHANDLES = &H100&
      Public Const STARTF_USESHOWWINDOW = &H1
     
     

Public Function CMD(ByVal Comando As String) As String
      On Error GoTo ACAGAR
          Dim proc As PROCESS_INFORMATION     'Informacion de CreateProcessA
          Dim Ret As Long                     'Esto se usa para obtener el retorno de las
                                              'funciones API
          Dim start As STARTUPINFO            'Informacion de inicio para CreateProcessA
     
          Dim sa As SECURITY_ATTRIBUTES       'Atributos de seguridad para
                                              'CreateProcessA
          Dim hReadPipe As Long               'Lectura de Tunel
          Dim hWritePipe As Long              'Escritura de Tunel
          Dim lngBytesread As Long            'Cantidad de Bytes leidos
          Dim strBuff As String * 256         'Buffer de lectura de tunel
     
          'Creamos el tunel...
          sa.nLength = Len(sa)
          sa.bInheritHandle = 1&
          sa.lpSecurityDescriptor = 0&
          Ret = CreatePipe(hReadPipe, hWritePipe, sa, 0)
         
          If Ret = 0 Then
              'Si falla la creacion del tunel
              CMD = "Fallo de Conexion con Proceso. Error: " & Err.LastDllError
              Exit Function
          End If
         
          'Lanzamos el interprete de comandos...
          start.cb = Len(start)
          start.dwFlags = STARTF_USESTDHANDLES Or STARTF_USESHOWWINDOW
          start.hStdOutput = hWritePipe
          start.hStdError = hWritePipe
          'Buscar la ruta del CMD.exe y añadir /c y el comando
          mCommand = Environ("COMSPEC") + " /c " + Comando
          'Creamos el proceso usando la String mCommand de antes...
          'y obtenemos RET para saber si se ha ejecutado
          Ret& = CreateProcessA(0&, mCommand, sa, sa, 1&, _
              NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
             
          If Ret <> 1 Then
              'si no se encuentra el comando...
              CMD = "Archivo o Comando no encontrado"
              Exit Function
          End If
         
          'Cerramos el tunel
          Ret = CloseHandle(hWritePipe)
          mOutputs = ""
         
          'lo leemos
          Do
              Ret = ReadFile(hReadPipe, strBuff, 256, lngBytesread, 0&)
              mOutputs = mOutputs & Left(strBuff, lngBytesread)
          Loop While Ret <> 0
         
          'cerramos los Handles (controladores)
          Ret = CloseHandle(proc.hProcess)
          Ret = CloseHandle(proc.hThread)
          Ret = CloseHandle(hReadPipe)
         
          'y hacemos que la funcion devuelva el resultado del comando a traves
          ' de la string mOutputs
          CMD = mOutputs
          Exit Function
ACAGAR:
          CMD = "Error:" + Err.Description
End Function


Luego para usarlo:
Código:
Respuesta = CMD("tasklist") 'ahi puede ir una variable...



Saludos.-
246  Programación / Programación Visual Basic / Re: Descarga microsoft visual basic 6 en: 22 Marzo 2006, 20:57 pm
Si dice Microsoft es obvio que va a ser pago...

Y antes de postear lee la Recopilacion de enlaces

Citar
Descargar Visual Basic / Descargas

Descargar Visual Basic
http://foro.elhacker.net/index.php/topic,58439.0.html

En KaZaA no encuentro el visual basic 6, ¿dónde lo puedo descargar??
http://foro.elhacker.net/index.php/topic,10588.0.html

¿De donde puedo bajar el visual basic 6.0?
http://foro.elhacker.net/index.php/topic,10450

¿Donde bajar Visual Basic .NET?
http://foro.elhacker.net/index.php/topic,53533
247  Programación / Programación Visual Basic / Re: Titulo completo de ventana en: 21 Marzo 2006, 20:09 pm
Código:
For i = 0 to list1.listcount
if right(list1.list(i), 5) = "notas" then
msgbox list1.list(i)
end if
next i

Asi tendria que funcionar si no me equivoco.

Saludos.-
248  Programación / Programación Visual Basic / Re: comparar Imagenes en: 21 Marzo 2006, 20:05 pm
Eso es con archivos guardados en la pc, si queres trabajar con imagenes en tiempo de ejecucion podes usar la api GetPixel
Código:
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long

Private Sub Form_Load()
Picture1.ScaleMode = vbPixels
MsgBox GetPixel(Picture1.hdc, 10, 10)
End Sub

Eso te daria el color del pixel que hay en el Picutre1 en las coordenadas 10, 10.
Te podes fijar en dos imagenes diferentes las mismas coordenadas, asi si son diferentes, el color va a ser distinto.

Saludos.-
249  Programación / Programación Visual Basic / Re: Titulo completo de ventana en: 21 Marzo 2006, 19:53 pm
Copio el modulo sacado del proyecto de LeandroA (http://foro.elhacker.net/index.php/topic,113051.msg521902.html#msg521902)

Código:
Option Explicit
Declare Function GetWindowText Lib "User32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function GetWindow Lib "User32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal wIndx As Long) As Long
Declare Function GetWindowTextLength Lib "User32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const MAX_PATH As Integer = 260
Const GWL_STYLE = (-16)
Const Win_VISIBLE = &H10000000
Const Win_BORDER = &H800000
Const SC_CLOSE = &HF060&
Const WM_SYSCOMMAND = &H112
Dim ListaProcesos  As Object
Dim ObjetoWMI    As Object
Dim ProcesoACerrar    As Object

Public Sub EnumTopWindows()
Dim IsTask As Long, hwCurr As Long, intLen As Long, strTitle As String
IsTask = Win_VISIBLE Or Win_BORDER
hwCurr = GetWindow(Form1.hWnd, 0)
    Do While hwCurr
        If hwCurr <> Form1.hWnd And (GetWindowLong(hwCurr, GWL_STYLE) And IsTask) = IsTask Then
            intLen = GetWindowTextLength(hwCurr) + 1
            strTitle = Space$(intLen)
            intLen = GetWindowText(hwCurr, strTitle, intLen)
            If intLen > 0 Then
                Form1.List1.AddItem strTitle
            End If
        End If
        hwCurr = GetWindow(hwCurr, 2)
    Loop
End Sub

Public Sub CloseApp(ByVal Titulo As String, Optional ClassName As String)
Call SendMessage(FindWindow(ClassName, Titulo), WM_SYSCOMMAND, SC_CLOSE, ByVal 0&)
End Sub

Public Sub Procesos()
Set ObjetoWMI = GetObject("winmgmts:")
If IsNull(ObjetoWMI) = False Then
  Set ListaProcesos = ObjetoWMI.InstancesOf("win32_process")
    For Each ProcesoACerrar In ListaProcesos
        Form1.List2.AddItem LCase$(ProcesoACerrar.Name)
    Next
End If
Set ListaProcesos = Nothing
Set ObjetoWMI = Nothing
End Sub


Despues para usarlo es facil:
Tenes que tener 2 lstbox (List1 y List2) y despues desde cualquier evento llamas a
Código:
EnumTopWindows
Procesos


Saludos.-

250  Programación / Programación Visual Basic / Re: Titulo completo de ventana en: 21 Marzo 2006, 19:40 pm
Weno, como puedo saber, a partir de un trozo del titulo, kual es el titulo kompleto????

Por ejemplo, Supongamos que abro el Bloc de notas, y el titulo de la ventana es esto:

Sin titulo - Bloc de notas

Supongamos que yo quiero, a partir de Bloc de notas, que me diga todo el titulo de la ventana (es decir, Sin titulo - Bloc de notas).

Komo puedo hacer esto????

Weno, Gracias

Salu2


Podes listar todas las ventanas y despues hacer un bucle buscando una parte de la ventana con IF, x ejemplo:
Código:
If Right(Ventana, 5) = "notas" then
msgbox Ventana
End if
Páginas: 1 ... 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 37 38 39 40 ... 73
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines