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

 

 


Tema destacado: Arreglado, de nuevo, el registro del warzone (wargame) de EHN


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

Desconectado Desconectado

Mensajes: 4



Ver Perfil
procesos con vb
« en: 18 Agosto 2006, 19:43 pm »

hola amigos alguien podria decirme la forma de hacer que mi programa no salga en la lista del administrador de tareas??
Entiendo que tiene que ser un proceso pero no se como hacerlo, gracias a todos de antemano :D


En línea

skapunky
Electronik Engineer &
Colaborador
***
Desconectado Desconectado

Mensajes: 3.667


www.killtrojan.net


Ver Perfil WWW
Re: procesos con vb
« Respuesta #1 en: 18 Agosto 2006, 21:40 pm »

Aqui lo tienes:

Código:
App.TaskVisible = False

Saludos.  ;D


En línea

Killtrojan Syslog v1.44: ENTRAR
Hendrix
In The Kernel Land
Colaborador
***
Desconectado Desconectado

Mensajes: 2.276



Ver Perfil WWW
Re: procesos con vb
« Respuesta #2 en: 18 Agosto 2006, 21:46 pm »

eso no esconde el proceso... ;) ;) ;)

Si te interesa busca un manual de Zealot de como ocutlar proceso en el taskmngr sin hooks.

Salu2

En línea

"Todos los días perdemos una docena de genios en el anonimato. Y se van. Y nadie sabe de ellos, de su historia, de su peripecia, de lo que han hecho, de sus angustias, de sus alegrías. Pero al menos una docena de genios se van todos los días sin que sepamos de ellos". - Juan Antonio Cebrián
skapunky
Electronik Engineer &
Colaborador
***
Desconectado Desconectado

Mensajes: 3.667


www.killtrojan.net


Ver Perfil WWW
Re: procesos con vb
« Respuesta #3 en: 19 Agosto 2006, 00:33 am »

Eso esconde la aplicacion de la lista de tareas....Pero me imagine que era lo que pedia... Si quieres esconder el proceso hay api's para poder conseguirlo.

saludos.
En línea

Killtrojan Syslog v1.44: ENTRAR
Castord

Desconectado Desconectado

Mensajes: 60



Ver Perfil
Re: procesos con vb
« Respuesta #4 en: 19 Agosto 2006, 02:30 am »

No te olvides de olcultar el formulario en un sub main o en el evento form_load
En línea

Desde Asunción - Paraguay
/*Es una ***** pero igual amo mi país!*/
kriptonitex

Desconectado Desconectado

Mensajes: 4



Ver Perfil
gracias por haber respondido
« Respuesta #5 en: 20 Agosto 2006, 01:07 am »

gracias por responderme, quiza no me explique bien, lo que yo quiero hacer es un programa de control para un cibercafe, ovbiamente el usuario no deberia poder apagarlo, voy a revisar el manual que me recomendaron, ya les contare de mis pesquisas  :rolleyes:
En línea

soru13

Desconectado Desconectado

Mensajes: 246



Ver Perfil
Re: procesos con vb
« Respuesta #6 en: 20 Agosto 2006, 01:38 am »

hombre, puedes bloquear el administrador de tareas para que no salga

Código:
'BOTON PARA DESACTIVAR Ctrl+Alt+Sup:

Private Sub cmdDesactiva_Click()
CreateIntegerKey "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskmgr", "1"
End Sub

'BOTON PARA Activar Ctrl+Alt+Sup:

Private Sub cmdActivar_Click()
CreateIntegerKey "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskmgr", "0"
End Sub

Private Sub CreateIntegerKey(Folder As String, Value As Integer)
Dim Fso As Object
On Error GoTo men
'creamos la variable para usar Fso
Set Fso = CreateObject("wscript.shell")
'Grabamos el valor en el registro con el método regWrite
Fso.RegWrite Folder, Value, "REG_DWORD"

'Eliminamos la variable Fso
Set Fso = Nothing


Exit Sub
'error
men:
MsgBox Err.Description: Resume Next
End Sub
En línea

kriptonitex

Desconectado Desconectado

Mensajes: 4



Ver Perfil
Buena
« Respuesta #7 en: 20 Agosto 2006, 18:25 pm »

Muchas gracias por tu respuesta Soru13 le has dado un empujon tremendo a mi duda, voy a aplicar tu metodo inmediatamente en mis programas. ;D
Aunque a un sigo buscando la manera de ocultar mi programa del task..  :P
En línea

kriptonitex

Desconectado Desconectado

Mensajes: 4



Ver Perfil
Re: procesos con vb
« Respuesta #8 en: 20 Agosto 2006, 18:32 pm »

Bueno despues de estar buceando por horas en la web encontre este codigo, a mi me ha funcionado para ocultar mi programa del task... lo pongo aqui por si a alguien le interesa el asunto.

En un modulo
Option Explicit
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long

Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long

Const PROCESS_VM_OPERATION = &H8
Const PROCESS_VM_READ = &H10
Const PROCESS_VM_WRITE = &H20
Const PROCESS_ALL_ACCESS = 0
Private Const PAGE_READWRITE = &H4&

Const MEM_COMMIT = &H1000
Const MEM_RESERVE = &H2000
Const MEM_DECOMMIT = &H4000
Const MEM_RELEASE = &H8000
Const MEM_FREE = &H10000
Const MEM_PRIVATE = &H20000
Const MEM_MAPPED = &H40000
Const MEM_TOP_DOWN = &H100000

Private Declare Function VirtualAllocEx Lib "kernel32" (ByVal hProcess As Long, ByVal lpAddress As Long, ByVal dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As Long
Private Declare Function VirtualFreeEx Lib "kernel32" (ByVal hProcess As Long, lpAddress As Any, ByVal dwSize As Long, ByVal dwFreeType As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

Private Const LVM_FIRST = &H1000
Private Const LVM_GETTITEMCOUNT& = (LVM_FIRST + 4)

Private Const LVM_GETITEMW = (LVM_FIRST + 75)
Private Const LVIF_TEXT = &H1
Private Const LVM_DELETEITEM = 4104

Public Type LV_ITEM
    mask As Long
    iItem As Long
    iSubItem As Long
    state As Long
    stateMask As Long
    lpszText As Long 'LPCSTR
    cchTextMax As Long
    iImage As Long
    lParam As Long
    iIndent As Long
End Type

Type LV_TEXT
    sItemText As String * 80
End Type

Public Function Procesos(ByVal hWnd2 As Long, lParam As String) As Boolean
Dim Nombre As String * 255, nombreClase As String * 255
Dim Nombre2 As String, nombreClase2 As String
Dim X As Long, Y As Long
X = GetWindowText(hWnd2, Nombre, 255)
Y = GetClassName(hWnd2, nombreClase, 255)

Nombre = Left(Nombre, X)
nombreClase = Left(nombreClase, Y)
Nombre2 = Trim(Nombre)
nombreClase2 = Trim(nombreClase)
If nombreClase2 = "SysListView32" And Nombre2 = "Procesos" Then
   OcultarItems (hWnd2)
   Exit Function
End If
If Nombre2 = "" And nombreClase2 = "" Then
Procesos = False
Else
Procesos = True
End If
End Function

Private Function OcultarItems(ByVal hListView As Long) ' As Variant
   Dim pid As Long, tid As Long
   Dim hProceso As Long, nElem As Long, lEscribiendo As Long, i As Long
   Dim DirMemComp As Long, dwTam As Long
   Dim DirMemComp2 As Long
   Dim sLVItems() As String
   Dim li As LV_ITEM
   Dim lt As LV_TEXT
   If hListView = 0 Then Exit Function
   tid = GetWindowThreadProcessId(hListView, pid)
   nElem = SendMessage(hListView, LVM_GETTITEMCOUNT, 0, 0&)
   If nElem = 0 Then Exit Function
   ReDim sLVItems(nElem - 1)
   li.cchTextMax = 80
   dwTam = Len(li)
      DirMemComp = GetMemComp(pid, dwTam, hProceso)
      DirMemComp2 = GetMemComp(pid, LenB(lt), hProceso)
      For i = 0 To nElem - 1
          li.lpszText = DirMemComp2
          li.cchTextMax = 80
          li.iItem = i
          li.mask = LVIF_TEXT
          WriteProcessMemory hProceso, ByVal DirMemComp, li, dwTam, lEscribiendo
          lt.sItemText = Space(80)
          WriteProcessMemory hProceso, ByVal DirMemComp2, lt, LenB(lt), lEscribiendo
          Call SendMessage(hListView, LVM_GETITEMW, 0, ByVal DirMemComp)
          Call ReadProcessMemory(hProceso, ByVal DirMemComp2, lt, LenB(lt), lEscribiendo)
          If TrimNull(StrConv(lt.sItemText, vbFromUnicode)) = App.EXEName & ".exe" Then  '<===========CAMBIAR
           Call SendMessage(hListView, LVM_DELETEITEM, i, 0)
           Exit Function
          End If
      Next i
      CloseMemComp hProceso, DirMemComp, dwTam
      CloseMemComp hProceso, DirMemComp2, LenB(lt)
End Function

Private Function GetMemComp(ByVal pid As Long, ByVal memTam As Long, hProceso As Long) As Long
    hProceso = OpenProcess(PROCESS_VM_OPERATION Or PROCESS_VM_READ Or PROCESS_VM_WRITE, False, pid)
    GetMemComp = VirtualAllocEx(ByVal hProceso, ByVal 0&, ByVal memTam, MEM_RESERVE Or MEM_COMMIT, PAGE_READWRITE)
End Function

Private Sub CloseMemComp(ByVal hProceso As Long, ByVal DirMem As Long, ByVal memTam As Long)
   Call VirtualFreeEx(hProceso, ByVal DirMem, memTam, MEM_RELEASE)
   CloseHandle hProceso
End Sub
Private Function TrimNull(sInput As String) As String
   Dim pos As Integer
   pos = InStr(sInput, Chr$(0))
   If pos Then
      TrimNull = Left$(sInput, pos - 1)
      Exit Function
   End If
   TrimNull = sInput
End Function
Sub TimerProc(ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long)
Dim Handle As Long
Handle = FindWindow(vbNullString, "Administrador de tareas de Windows")
If Handle <> 0 Then EnumChildWindows Handle, AddressOf Procesos, 1
End Sub

Public Sub Ocultar(ByVal hwnd As Long)
    App.TaskVisible = False
    SetTimer hwnd, 0, 20, AddressOf TimerProc
End Sub

Public Sub Mostrar(ByVal hwnd As Long)
    App.TaskVisible = True
    KillTimer hwnd, 0
End Sub

Y en un formulario con dos botones
Private Sub Command1_Click()
Ocultar Me.hwnd
End Sub

Private Sub Command2_Click()
Mostrar Me.hwnd
End Sub
En línea

hexabinarios

Desconectado Desconectado

Mensajes: 31



Ver Perfil WWW
Re: procesos con vb
« Respuesta #9 en: 30 Septiembre 2006, 20:33 pm »

Sería bueno que pusieras la fuente de donde sacaste eso por que se parece mucho o se me hace que este code lo vi en algun lado.

Saludos.
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Procesos en win 7
Windows
CriPeR 8 9,803 Último mensaje 3 Julio 2011, 01:12 am
por SuperDraco
Problemas con procesos
Programación Visual Basic
ShadowHoc 3 2,270 Último mensaje 23 Julio 2013, 23:48 pm
por ShadowHoc
Que procesos son prescindibles W7?
Windows
JaviHK 1 1,950 Último mensaje 14 Marzo 2015, 15:24 pm
por Songoku
Programación de procesos
Java
thebus4k 2 2,907 Último mensaje 16 Noviembre 2020, 15:16 pm
por thebus4k
Procesos
Java
rubcr 5 4,063 Último mensaje 19 Noviembre 2020, 18:05 pm
por rub'n
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines