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

 

 


Tema destacado: Tutorial básico de Quickjs


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  [APORTE] Ocultar Aplicación en Administrador de Tareas
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [APORTE] Ocultar Aplicación en Administrador de Tareas  (Leído 10,595 veces)
kub0x
Enlightenment Seeker
Moderador
***
Desconectado Desconectado

Mensajes: 1.486


S3C M4NI4C


Ver Perfil
[APORTE] Ocultar Aplicación en Administrador de Tareas
« en: 16 Abril 2012, 03:59 am »

Que pasa .Net(eros) ...

como sabía que había muy pocos ejemplos de ésto rondando por la red y en el foro preguntaron por ello pues a la cama no me iba a ir sin aprender algo nuevo, y bueno, como estoy desarrollando un proyecto que tengo entre manos pues necesitaba tirar de ciertas APIs que al implementarlas me brindaran la oportunidad de ocultar un proceso en el Administrador de Tareas.

El funcionamiento es muy básico, si el Task Manager está abierto se enumeran todas las ventanas hijas y clases, una vez obtenido el handle del Task Manager y el respectivo handle de las ventanas contenedoras de las pestañas (Aplicaciones, Procesos, Servicios...) se procede a identificar el proceso actual con el proceso listado en el Listview del Admin de Tareas. Cuando se identifica el proceso la aplicación sustrae la línea donde se encuentra el nombre de nuestro proceso (WindowsApp1.exe).

Funciona bajo Windows XP y 7. El código anterior que programé solo lo hacia bajo Win XP , buenas noticias :D. Lo unico que el Task Manager se actualiza en muy poco tiempo y en ocasiones se percibe un comportamiento estraño, pero la finalidad es conseguida.

Disfrutadlo!

Source:

Código
  1. Imports System
  2. Imports Microsoft.Win32.SafeHandles
  3. Imports System.Runtime.InteropServices
  4. Imports System.Text
  5. Imports System.ComponentModel
  6. Class form1
  7.    WithEvents time1 As New Timer
  8.    Private Sub form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  9.        Running = True
  10.    End Sub
  11. End Class
  12. #Region " TMListViewDelete "
  13.  
  14. Module TMListViewDelete
  15.    Dim t As New Timer
  16. #Region " Declaraciones/Funciones/Constantes "
  17.  
  18.    Public Const LVM_FIRST = &H1000
  19.    Public Const LVM_DELETECOLUMN = LVM_FIRST + 28
  20.  
  21.    Public Const LVM_GETITEMCOUNT = (LVM_FIRST + 4)
  22.    Public Const LVM_SORTITEMS = (LVM_FIRST + 48)
  23.    Public Const LVM_DELETEITEM = (LVM_FIRST + 8)
  24.    Public Const LVM_GETNEXTITEM = (LVM_FIRST + 12)
  25.    Public Const LVM_GETITEM = (LVM_FIRST + 75)
  26.  
  27.    Public Delegate Function EnumDelegate(ByVal lngHwnd As IntPtr, ByVal lngLParam As Integer) As Integer
  28.    Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal Hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
  29.    Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
  30.    Public Declare Function EnumChildWindows Lib "user32.dll" (ByVal hWndParent As IntPtr, ByVal lpEnumFunc As EnumDelegate, ByVal lParam As Integer) As Integer
  31.    <DllImport("user32.dll", CharSet:=CharSet.Auto)> _
  32.    Private Sub GetClassName(ByVal hWnd As System.IntPtr, _
  33.   ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer)
  34.    End Sub
  35.    Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As IntPtr, ByVal lpString As System.Text.StringBuilder, ByVal cch As Integer) As Integer
  36.    Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As IntPtr) As Integer
  37.    Dim hwnd As IntPtr
  38.    Dim controls As String
  39.    Public MyProc As String
  40.  
  41.    Dim ProcLV As IntPtr = IntPtr.Zero
  42. #End Region
  43.  
  44. #Region " Evento Tick Timer"
  45.    Public Sub t_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
  46.        If ProcLV = IntPtr.Zero Then
  47.            hwnd = FindWindow(vbNullString, "Administrador de tareas de Windows")
  48.            If hwnd <> 0 Then
  49.                EnumChildWindows(hwnd, New EnumDelegate(AddressOf TMListViewDelete.EnumChildWindows), 0)
  50.            End If
  51.        Else
  52.            GetListView(hwnd, ProcLV)
  53.        End If
  54.    End Sub
  55. #End Region
  56.  
  57. #Region " Propiedad e inicialización"
  58.    Public Property Running() As Boolean
  59.        Get
  60.            If t.Enabled = True Then
  61.                Return True
  62.            Else
  63.                Return False
  64.            End If
  65.        End Get
  66.        Set(ByVal value As Boolean)
  67.            If value = True Then
  68.                MyProc = Process.GetCurrentProcess.ProcessName 'Esto controla el archivo a ocultar. Cambiad "Processname" por el nombre del archivo a ocultar
  69.                If Not t.Interval = 20 Then
  70.                    With t
  71.                        AddHandler t.Tick, AddressOf t_Tick
  72.                        .Interval = 20
  73.                        .Enabled = True
  74.                        .Start()
  75.                    End With
  76.                Else
  77.                    t.Enabled = True
  78.                    t.Start()
  79.                End If
  80.            Else
  81.                t.Enabled = False
  82.                t.Stop()
  83.                ProcLV = IntPtr.Zero
  84.            End If
  85.        End Set
  86.    End Property
  87.  
  88. #End Region
  89.  
  90. #Region " Obteniendo ListViews"
  91.    Public Function EnumChildWindows(ByVal lngHwnd As IntPtr, ByVal lngLParam As Integer) As Integer
  92.        Dim strClassName As String = ObtenerClase(lngHwnd)
  93.        Dim strText As String = ObtenerTextoVentana(lngHwnd)
  94.        If InStr(strClassName, "SysListView32") Then
  95.            GetListView(hwnd, lngHwnd)
  96.            If InStr(strText, "Procesos") Then
  97.                ProcLV = lngHwnd
  98.            End If
  99.        End If
  100.        Dim Classes As String = lngHwnd.ToString & ", " & strClassName & ", " & strText
  101.        Return 1
  102.    End Function
  103.    Public Function ObtenerClase(ByVal handle As IntPtr) As String
  104.        Dim strClassName As New System.Text.StringBuilder()
  105.        strClassName.Length = 255
  106.        GetClassName(handle, strClassName, strClassName.Length)
  107.        Return strClassName.ToString
  108.    End Function
  109.    Public Function ObtenerTextoVentana(ByVal handle As IntPtr) As String
  110.        Dim titleText As New System.Text.StringBuilder()
  111.        titleText.Length = GetWindowTextLength(handle) + 1
  112.        GetWindowText(handle, titleText, titleText.Length)
  113.        Return titleText.ToString
  114.    End Function
  115.  
  116. #End Region
  117. End Module
  118.  
  119. #End Region
  120. #Region " Obtener Objetos "
  121. Module GetItems
  122.    Dim listViewHandle As IntPtr
  123. #Region " Funciones "
  124.    <DllImport(kernel32, SetLastError:=True)> _
  125.    Public Function OpenProcess( _
  126.        ByVal dwDesiredAccess As UInteger, _
  127.        ByVal bInheritHandle As Boolean, _
  128.        ByVal dwProcessId As Integer) As SafeProcessHandle
  129.    End Function
  130.  
  131.  
  132. #Region " ReadProcessMemory "
  133.    <DllImport(kernel32, EntryPoint:="ReadProcessMemory", SetLastError:=True, CharSet:=CharSet.Unicode)> _
  134.    Public Function ReadProcessMemoryW( _
  135.        ByVal hProcess As SafeProcessHandle, _
  136.        ByVal lpBaseAddress As IntPtr, _
  137.        ByVal lpBuffer As StringBuilder, _
  138.        ByVal nSize As Integer, _
  139.        ByRef bytesRead As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
  140.    End Function
  141.  
  142.    <DllImport(kernel32, SetLastError:=True, CharSet:=CharSet.Ansi)> _
  143.    Public Function ReadProcessMemory( _
  144.        ByVal hProcess As SafeProcessHandle, _
  145.        ByVal lpBaseAddress As IntPtr, _
  146.        ByVal lpBuffer As StringBuilder, _
  147.        ByVal nSize As Integer, _
  148.        ByRef bytesRead As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
  149.    End Function
  150.  
  151.    <DllImport(kernel32, SetLastError:=True)> _
  152.    Public Function ReadProcessMemory( _
  153.        ByVal hProcess As SafeProcessHandle, _
  154.        ByVal lpBaseAddress As IntPtr, _
  155.        ByRef lpBuffer As LV_ITEM, _
  156.        ByVal nSize As Integer, _
  157.        ByRef bytesRead As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
  158.    End Function
  159.  
  160.    <DllImport(kernel32, SetLastError:=True)> _
  161.    Public Function ReadProcessMemory( _
  162.        ByVal hProcess As SafeProcessHandle, _
  163.        ByVal lpBaseAddress As IntPtr, _
  164.        ByRef lpBuffer As HDITEM, _
  165.        ByVal nSize As Integer, _
  166.        ByRef bytesRead As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
  167.    End Function
  168.  
  169.    <DllImport(kernel32, SetLastError:=True)> _
  170.    Public Function ReadProcessMemory( _
  171.        ByVal hProcess As SafeProcessHandle, _
  172.        ByVal lpBaseAddress As IntPtr, _
  173.        ByVal lpBuffer As IntPtr, _
  174.        ByVal nSize As Integer, _
  175.        ByRef bytesRead As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
  176.    End Function
  177. #End Region
  178.  
  179. #Region " SendMessage "
  180.    <DllImport(user32, SetLastError:=True)> _
  181.    Public Function SendMessage( _
  182.        ByVal hWnd As IntPtr, _
  183.        ByVal message As UInteger, _
  184.        ByVal wParam As IntPtr, _
  185.        ByVal lParam As IntPtr) As Integer
  186.    End Function
  187.  
  188.    ' Has a different return type, so can't overload.
  189.    <DllImport(user32, SetLastError:=True, EntryPoint:="SendMessageA")> _
  190.    Public Function GetHeaderSendMessage( _
  191.        ByVal hWnd As IntPtr, _
  192.        ByVal message As UInteger, _
  193.        ByVal wParam As IntPtr, _
  194.        ByVal lParam As IntPtr) As IntPtr
  195.    End Function
  196.  
  197.    <DllImport(user32, SetLastError:=True)> _
  198.    Public Function SendMessage( _
  199.        ByVal hWnd As IntPtr, _
  200.        ByVal message As UInteger, _
  201.        ByVal wParam As Integer, _
  202.        ByVal lParam As StringBuilder) As Integer
  203.    End Function
  204.  
  205.    <DllImport(user32, SetLastError:=True)> _
  206.    Public Function SendMessage( _
  207.        ByVal hWnd As IntPtr, _
  208.        ByVal message As UInteger, _
  209.        ByVal wParam As Integer, _
  210.        ByVal lParam As IntPtr) As Integer
  211.    End Function
  212. #End Region
  213.  
  214. #Region " VirtualAllocEx "
  215.    <DllImport(kernel32, SetLastError:=True)> _
  216.    Public Function VirtualAllocEx( _
  217.        ByVal hProcess As SafeProcessHandle, _
  218.        ByVal lpAddress As IntPtr, _
  219.        ByVal dwSize As Integer, _
  220.        ByVal flAllocationType As UInteger, _
  221.        ByVal flProtect As UInteger) As IntPtr
  222.    End Function
  223. #End Region
  224.  
  225. #Region " VirtualFreeEx "
  226.    <DllImport(kernel32, SetLastError:=True)> _
  227.    Public Function VirtualFreeEx( _
  228.        ByVal hProcess As SafeProcessHandle, _
  229.        ByVal lpAddress As IntPtr, _
  230.        ByVal dwSize As Integer, _
  231.        ByVal dwFreeType As UInteger) As <MarshalAs(UnmanagedType.Bool)> Boolean
  232.    End Function
  233. #End Region
  234.  
  235. #Region " WriteProcessMemory "
  236.    <DllImport(kernel32, SetLastError:=True)> _
  237.    Public Function WriteProcessMemory( _
  238.        ByVal hProcess As SafeProcessHandle, _
  239.        ByVal lpBaseAddress As IntPtr, _
  240.        ByRef lpBuffer As LV_ITEM, _
  241.        ByVal nSize As Integer, _
  242.        ByRef lpNumberOfBytesWritten As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
  243.    End Function
  244.  
  245.    <DllImport(kernel32, SetLastError:=True)> _
  246.    Public Function WriteProcessMemory( _
  247.        ByVal hProcess As SafeProcessHandle, _
  248.        ByVal lpBaseAddress As IntPtr, _
  249.        ByRef lpBuffer As HDITEM, _
  250.        ByVal nSize As Integer, _
  251.        ByRef lpNumberOfBytesWritten As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
  252.    End Function
  253. #End Region
  254. #End Region
  255. #Region " Constantes "
  256.    Public Const LVM_FIRST As UInteger = &H1000
  257.    Public Const LVM_DELETEITEM As UInteger = (LVM_FIRST + 8)
  258.  
  259.    Public Const kernel32 As String = "kernel32"
  260.    Public Const user32 As String = "user32"
  261.    Public Const LVM_GETITEMCOUNT As UInteger = &H1004
  262.    Public Const LVM_GETITEMTEXT As UInteger = &H102D
  263.    Public Const LVM_GETHEADER As UInteger = &H101F
  264.    Public Const HDM_GETIEMA As UInteger = &H1203
  265.    Public Const HDM_GETITEMW As UInteger = &H120B
  266.    Public Const HDM_GETITEMCOUNT As UInteger = &H1200
  267.    Public Const HDM_GETUNICODEFORMAT As UInteger = &H2006
  268.    Public Const HDI_TEXT As UInteger = 2
  269.    Public Const MEM_COMMIT As UInteger = &H1000
  270.    Public Const MEM_RELEASE As UInteger = &H8000
  271.    Public Const PAGE_READWRITE As UInteger = 4
  272.    Public Const PROCESS_VM_READ As UInteger = &H10
  273.    Public Const PROCESS_VM_WRITE As UInteger = &H20
  274.    Public Const PROCESS_VM_OPERATION As UInteger = &H8
  275.    Public Const WM_GETTEXT As UInteger = &HD
  276.    Public Const WM_GETTEXTLENGTH As UInteger = &HE
  277. #End Region
  278. #Region " Structures "
  279. #Region " LV_ITEM "
  280.    <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
  281.    Public Structure LV_ITEM
  282.        Public mask As UInteger
  283.        Public iItem As Integer
  284.        Public iSubItem As Integer
  285.        Public state As UInteger
  286.        Public stateMask As UInteger
  287.        Public pszText As IntPtr
  288.        Public cchTextMax As Integer
  289.        Public iImage As Integer
  290.        Public lParam As IntPtr
  291.        Public iIndent As Integer
  292.        Public iGroupId As Integer
  293.        Public cColumns As Integer
  294.        Public puColumns As IntPtr
  295.        Public piColFmt As IntPtr
  296.        Public iGroup As Integer
  297.        Public Function Size() As Integer
  298.            Return Marshal.SizeOf(Me)
  299.        End Function
  300.    End Structure
  301. #End Region
  302.  
  303. #Region " HDITEM "
  304.    <StructLayout(LayoutKind.Sequential)> _
  305.    Public Structure HDITEM
  306.        Public mask As UInteger
  307.        Public cxy As Integer
  308.        Public pszText As IntPtr
  309.        Public hbm As IntPtr
  310.        Public cchTextMax As Integer
  311.        Public fmt As Integer
  312.        Public lParam As IntPtr
  313.        Public iImage As Integer
  314.        Public iOrder As Integer
  315.        Public Function Size() As Integer
  316.            Return Marshal.SizeOf(Me)
  317.        End Function
  318.    End Structure
  319. #End Region
  320. #End Region
  321. #Region "Obtener objetos Listview "
  322.    Public Function GetListView(ByVal handle As IntPtr, ByVal lvhandle As IntPtr) As Boolean
  323.        listViewHandle = lvhandle
  324.        Dim hParent As IntPtr = handle
  325.  
  326.        Dim id As Integer = -1
  327.        Try
  328.            For Each p In Process.GetProcessesByName("taskmgr")
  329.                If p.MainWindowTitle = "Administrador de tareas de Windows" Then
  330.                    id = p.Id
  331.                End If
  332.            Next
  333.            If id = -1 Then
  334.                Throw New ArgumentException("No se encontró el proceso", "processName")
  335.            End If
  336.        Catch : Return False : End Try
  337.  
  338.        Dim hprocess As SafeProcessHandle = Nothing
  339.        Try
  340.            hprocess = OpenProcess(PROCESS_VM_OPERATION Or PROCESS_VM_READ Or PROCESS_VM_WRITE, False, id)
  341.  
  342.            If hprocess Is Nothing Then
  343.                If Marshal.GetLastWin32Error = 0 Then
  344.                    Throw New System.ComponentModel.Win32Exception
  345.                End If
  346.            End If
  347.  
  348.            Dim itemCount As Integer = SendMessage(listViewHandle, LVM_GETITEMCOUNT, IntPtr.Zero, IntPtr.Zero)
  349.  
  350.            For row As Integer = 0 To itemCount - 1
  351.  
  352.                Dim lvi As New ListViewItem(GetItem(row, 0, hprocess))
  353.                If lvi.Text.Contains(TMListViewDelete.MyProc) Then SendMessage(listViewHandle, LVM_DELETEITEM, row, IntPtr.Zero)
  354.            Next
  355.        Catch : Return False
  356.        Finally
  357.            If hprocess IsNot Nothing Then
  358.                hprocess.Close()
  359.                hprocess.Dispose()
  360.            End If
  361.  
  362.        End Try
  363.        Return True
  364.    End Function
  365. #End Region
  366. #Region " SafeProcessHandle "
  367.    Friend NotInheritable Class SafeProcessHandle
  368.        Inherits SafeHandleZeroOrMinusOneIsInvalid
  369.        Declare Auto Function CloseHandle Lib "kernel32.dll" (ByVal hObject As IntPtr) As Boolean
  370.  
  371.        Public Sub New()
  372.            MyBase.New(True)
  373.        End Sub
  374.  
  375.        Public Sub New(ByVal handle As IntPtr)
  376.            MyBase.New(True)
  377.            MyBase.SetHandle(handle)
  378.        End Sub
  379.  
  380.        Protected Overrides Function ReleaseHandle() As Boolean
  381.            Return CloseHandle(MyBase.handle)
  382.        End Function
  383.  
  384.    End Class
  385. #End Region
  386. #Region " ObtenerObjeto "
  387.    Public Function GetItem(ByVal row As Integer, ByVal subitem As Integer, _
  388.                                ByVal hProcess As SafeProcessHandle) As String
  389.  
  390.        Dim lvitem As New LV_ITEM
  391.        lvitem.cchTextMax = 260
  392.        lvitem.mask = 1
  393.        lvitem.iItem = row
  394.        lvitem.iSubItem = subitem
  395.        Dim pString As IntPtr
  396.        Dim s As New StringBuilder(260)
  397.        Try
  398.  
  399.            pString = VirtualAllocEx(hProcess, IntPtr.Zero, 260, MEM_COMMIT, PAGE_READWRITE)
  400.            lvitem.pszText = pString
  401.            Dim pLvItem As IntPtr
  402.            Try
  403.                pLvItem = VirtualAllocEx(hProcess, IntPtr.Zero, lvitem.Size, MEM_COMMIT, PAGE_READWRITE)
  404.                Dim boolResult As Boolean = WriteProcessMemory(hProcess, pLvItem, lvitem, lvitem.Size, 0)
  405.                If boolResult = False Then Throw New Win32Exception
  406.  
  407.                SendMessage(listViewHandle, LVM_GETITEMTEXT, row, pLvItem)
  408.                boolResult = ReadProcessMemory(hProcess, pString, s, 260, 0)
  409.                If boolResult = False Then Throw New Win32Exception
  410.                boolResult = ReadProcessMemory(hProcess, pLvItem, lvitem, Marshal.SizeOf(lvitem), 0)
  411.                If boolResult = False Then Throw New Win32Exception
  412.            Finally
  413.                If pLvItem.Equals(IntPtr.Zero) = False Then
  414.                    Dim freeResult As Boolean = VirtualFreeEx(hProcess, pLvItem, 0, MEM_RELEASE)
  415.                    If freeResult = False Then Throw New Win32Exception
  416.                End If
  417.            End Try
  418.        Finally
  419.            If pString.Equals(IntPtr.Zero) = False Then
  420.                Dim freeResult As Boolean = VirtualFreeEx(hProcess, pString, 0, MEM_RELEASE)
  421.                If freeResult = False Then Throw New Win32Exception
  422.            End If
  423.        End Try
  424.  
  425.        Return s.ToString
  426.    End Function
  427. #End Region
  428. End Module
  429.  
  430. #End Region
  431.  

Un saludo!


« Última modificación: 16 Abril 2012, 04:25 am por kub0x » En línea

Viejos siempre viejos,
Ellos tienen el poder,
Y la juventud,
¡En el ataúd! Criaturas Al poder.

Visita mi perfil en ResearchGate

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.810



Ver Perfil
Re: [APORTE] Ocultar Aplicación en Administrador de Tareas
« Respuesta #1 en: 5 Junio 2013, 17:35 pm »

No me puedo creer que nadie haya agradecido esto en 1 año.

¡ Gracias por el aporte KuBox !

¿Alguna instrucción de como usarlo? :-/

¿Por ejemplo si quiero ocultar el proceso "notepad.exe", como se haría?

Según tenia entendido el TMListView no funcionaba para Windows 7, me gustaría saber usar esta class para comprobarlo, pero ni idea.

Un saludo!


En línea

kub0x
Enlightenment Seeker
Moderador
***
Desconectado Desconectado

Mensajes: 1.486


S3C M4NI4C


Ver Perfil
Re: [APORTE] Ocultar Aplicación en Administrador de Tareas
« Respuesta #2 en: 5 Junio 2013, 22:12 pm »

En la línea 68 tienes la siguiente asignación:

Código
  1. MyProc = Process.GetCurrentProcess.ProcessName 'Esto controla el archivo a ocultar. Cambiad "Processname" por el nombre del archivo a ocultar

Si quieres apuntar hacia el Bloc de notas pues tendrás que apuntar hacia su proceso (2 maneras que se me ocurren):

Código
  1. MyProc= Process.GetProcessByName("Notepad")(0).ProcessName
  2. MyProc= "notepad.exe"

Estaba hecho para ocultar del TaskManager la aplicación que ejecute dicho código.

Saludos!
En línea

Viejos siempre viejos,
Ellos tienen el poder,
Y la juventud,
¡En el ataúd! Criaturas Al poder.

Visita mi perfil en ResearchGate

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.810



Ver Perfil
Re: [APORTE] Ocultar Aplicación en Administrador de Tareas
« Respuesta #3 en: 6 Junio 2013, 06:49 am »

Reconozco que el código era tán extenso que pregunté sin buscar lo suficiente entre las líneas (demasiada lectura).

Muy bueno, ¡ Funciona en win 7 x64 !, pero es muy "bruto", no es un método muy sutil, la lista de procesos se vuelve loca, se muestra el proceso por un instante y de repente "se elimina", así cada 1 o 2 segundos, se produce un efecto de parpadeo que a ojos de cualquiera se ve cláramente que resulta más que sospechoso xD, pero weno, como algo educativo está muy bien!

un saludo

EDITO:
Dicho efecto se elimina por completo si modificamos el intervalo del Timer a un valor extremo (entre 1-5), ahora si que es perfecto! gracias de nuevo.

EDITO 2:
Código
  1.     WithEvents time1 As New Timer
  2.    Private Sub form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  3.        Running = True
  4.    End Sub

Ese "time1" con eventos no se usa en la class!, se puede eliminar.

Cabe mencionar que el code sólamente funcionará con Windows en castellano, porque usa un Findwindow "Administrador de tareas",
como tengo varios windows en inglés en una máquina virtual me aseguraré del nombre exacto en inglés (imagino que será "Task Manager") para hacerlo más compatible.

Saludos!
« Última modificación: 6 Junio 2013, 07:54 am por EleKtro H@cker » En línea

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.810



Ver Perfil
Re: [APORTE] Ocultar Aplicación en Administrador de Tareas
« Respuesta #4 en: 6 Junio 2013, 10:24 am »

Me he tomado la libertad de modificar un poco el código.

· Añadida compatibilidad para Windows en el lenguaje Inglés y Alemán, y con posibilidad de añadir fácilmente más soporte para otros lenguajes.

· Ahora se puede ocultar varios procesos al mismo tiempo.

· Añadida opción para poder especificar el/los proceso(s) que queremos ocultar.

· Añadida opción para controlar el intervalo de tiempo en el que se procesa la lista del TaskManager (Por defecto 3 ms, para evitar efectos visuales sospechosos en el TaskManager).

· Reorganización de la estructura del código original (Contenía demasiadas regiones para mi gusto y me dificultaba la lectura).

NOTAS: Si se ocultan varios procesos al mismo tiempo, aunque se use 1 ms para el intervalo del timer puede dar esos efectos visuales extraños en la lista del task manager, así que no excederse si se requiere perfección xD.

Lo he testeado en:
Código:
WinXP x86 Inglés
WinXP x86 Español
Win7 x86 Inglés
Win7 x64 Español
Win7 x64 Inglés
Win7 x64 Español

En Windows 8 No funciona.
A menos que se utilice el replacamiento NO oficial del TaskManager por el TaskManager de Windows 7 (como hago yo) porque el TaskManager de windows 8 no me gusta)


Ejemplos de uso:

Código
  1. Hide_Process_From_TaskManager.Processes_Names = _
  2. {Process.GetCurrentProcess.ProcessName, "cmd", "notepad.exe"} ' Processes to hide.
  3.  
  4. Hide_Process_From_TaskManager.Task_Manager_Window_Titles = _
  5. {"Administrador de tareas de Windows", "Windows Task Manager"} ' Support for unknown TaskManager Window Titles.
  6.  
  7. Hide_Process_From_TaskManager.Hide_Interval = 3 ' Hidding Interval.
  8.  
  9. Hide_Process_From_TaskManager.Running = True ' Start hidding processes.
  10.  
  11. Hide_Process_From_TaskManager.Running = False ' Stop hidding processes.

Los créditos son por orden para el creador de la Class TMListViewDelete que ronda por internet,
luego para las modificaciones de Kub0x y por tener la generosidad de haber compartido el código,
y por último para mis modificaciones y compartirlo con vosotros.    :)


Aquí tienen:

-> http://foro.elhacker.net/net/libreria_de_snippets_posteen_aqui_sus_snippets-t378770.0.html;msg1858690#msg1858690

Un saludo!
En línea

CHINNOBv

Desconectado Desconectado

Mensajes: 1


Ver Perfil
Re: [APORTE] Ocultar Aplicación en Administrador de Tareas
« Respuesta #5 en: 18 Marzo 2019, 07:02 am »

En que lenguaje esta escrito? Hay manera de usarlo en windows 8 y 10?
En línea

kub0x
Enlightenment Seeker
Moderador
***
Desconectado Desconectado

Mensajes: 1.486


S3C M4NI4C


Ver Perfil
Re: [APORTE] Ocultar Aplicación en Administrador de Tareas
« Respuesta #6 en: 20 Marzo 2019, 15:46 pm »

En que lenguaje esta escrito? Hay manera de usarlo en windows 8 y 10?

Es Visual Basic .NET el código es de 2012, y ese fue el primer lenguaje que aprendí. Con esto quiero decir que en aquel entonces funcionaba en Win XP y Win 7. Desconozco si aplica a Windows 8 o 10. No debería de ser complicado reajustarlo para su funcionamiento, además de portarlo a C++ por ejemplo.

Saludos.
En línea

Viejos siempre viejos,
Ellos tienen el poder,
Y la juventud,
¡En el ataúd! Criaturas Al poder.

Visita mi perfil en ResearchGate

eotinianor

Desconectado Desconectado

Mensajes: 5


Ver Perfil
Re: [APORTE] Ocultar Aplicación en Administrador de Tareas
« Respuesta #7 en: 3 Diciembre 2020, 21:11 pm »

Alguien encontró cómo usarlo en win10?

Gracias
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines