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 C/C++ (Moderadores: Eternal Idol, Littlehorse, K-YreX)
| | |-+  problemas listando procesos
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: problemas listando procesos  (Leído 1,361 veces)
x64core


Desconectado Desconectado

Mensajes: 1.908


Ver Perfil
problemas listando procesos
« en: 5 Junio 2012, 09:28 am »

Hola a todos, bueno tengo unos problemas para listar los procesos:
no sé si estoy declarando mal las definiciones pero el retorno de la API me devuelve 0 ( osea exito ) pero como pueden ver
en el mensajebox no muestra los nombres, luego revise la memoria pero como cien bytes abajo encontraba los nombres : P


por cierto si encontrase ya la primera informacion correcta, para encontrar el siguiente puntero estaria bien hacer esto;

Código:
PointerStruct = PointerStruct + PointerStruct->NextEntryOffset;

Código
  1. #include <windows.h>
  2. #include <stdio.h>
  3.  
  4. #define SystemProcessInformation 5
  5.  
  6. typedef NTSTATUS (NTAPI* DefZwQuerySystemInformation)(IN ULONG SystemInformationClass,
  7.                        IN PVOID SystemInformation,IN ULONG SystemInformationLength,
  8.    OUT PULONG ReturnLength);
  9.  
  10. typedef struct _LSA_UNICODE_STRING {
  11.  USHORT Length;
  12.  USHORT MaximumLength;
  13.  PWSTR  Buffer;
  14. } LSA_UNICODE_STRING, *PLSA_UNICODE_STRING, UNICODE_STRING, *PUNICODE_STRING;
  15.  
  16. typedef struct _SYSTEM_THREAD {
  17. LARGE_INTEGER KernelTime;
  18. LARGE_INTEGER UserTime;
  19. LARGE_INTEGER CreateTime;
  20. ULONG WaitTime;
  21. PVOID StartAddress;
  22. LONG ClientId;
  23. LONG Priority;
  24. LONG BasePriority;
  25. ULONG ContextSwitchCount;
  26. ULONG State;
  27. LONG WaitReason;
  28. } SYSTEM_THREAD, *PSYSTEM_THREAD;
  29.  
  30. typedef struct _SYSTEM_PROCESS_INFORMATION {
  31.  
  32.  ULONG                   NextEntryOffset;
  33.  ULONG                   NumberOfThreads;
  34.  LARGE_INTEGER           Reserved[3];
  35.  LARGE_INTEGER           CreateTime;
  36.  LARGE_INTEGER           UserTime;
  37.  LARGE_INTEGER           KernelTime;
  38.  UNICODE_STRING          ImageName;
  39.  LONG                BasePriority;
  40.  HANDLE                  ProcessId;
  41.  HANDLE                  InheritedFromProcessId;
  42.  ULONG                   HandleCount;
  43.  ULONG                   Reserved2[2];
  44.  ULONG                   PrivatePageCount;
  45.  LONG                VirtualMemoryCounters;
  46.  IO_COUNTERS             IoCounters;
  47.  SYSTEM_THREAD           Threads[0];
  48. } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
  49.  
  50.  
  51. int main()
  52. {
  53. HMODULE NTDLL = GetModuleHandle("NTDLL");
  54. DefZwQuerySystemInformation ZwQuerySystemInformation = (DefZwQuerySystemInformation) GetProcAddress(NTDLL,"NtQuerySystemInformation");
  55. DWORD Ret;
  56.  
  57. ZwQuerySystemInformation(SystemProcessInformation,0,0,&Ret);
  58.  
  59. unsigned char* lp = (unsigned char*) malloc(Ret);
  60.  
  61. DWORD RZ = ZwQuerySystemInformation(SystemProcessInformation,lp,Ret,&Ret);
  62.  
  63. PSYSTEM_PROCESS_INFORMATION tmp =(PSYSTEM_PROCESS_INFORMATION)lp;
  64.  
  65. MessageBoxW(NULL,tmp->ImageName.Buffer ,NULL,MB_OK);
  66.  
  67. return 0;
  68. }


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Source] Listando directorios y archivos en C/C++
Programación C/C++
~~ 7 28,787 Último mensaje 6 Agosto 2010, 18:43 pm
por Eternal Idol
Problema listando archivos
Java
byebye 6 3,585 Último mensaje 11 Enero 2008, 21:52 pm
por Casidiablo
Problema listando proceso en win32
Programación C/C++
Uknow 3 2,414 Último mensaje 20 Noviembre 2011, 06:06 am
por naderST
Problemas Listando datos con Hibernate
Java
jackgris 0 1,613 Último mensaje 2 Octubre 2012, 18:13 pm
por jackgris
Problemas con procesos
Programación Visual Basic
ShadowHoc 3 2,242 Último mensaje 23 Julio 2013, 23:48 pm
por ShadowHoc
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines