Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.2 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. dlls.c
  5. Abstract:
  6. WinDbg Extension Api
  7. Author:
  8. Ramon J San Andres (ramonsa) 5-Nov-1993
  9. Environment:
  10. User Mode.
  11. Revision History:
  12. --*/
  13. #include "precomp.h"
  14. #pragma hdrstop
  15. VOID
  16. DllsExtension(
  17. PCSTR lpArgumentString,
  18. PPEB ProcessPeb
  19. );
  20. DECLARE_API( dlls )
  21. /*++
  22. Routine Description:
  23. Dump user mode dlls (Kernel debugging)
  24. Arguments:
  25. args - [address [detail]]
  26. Return Value:
  27. None
  28. --*/
  29. {
  30. PVOID Process;
  31. EPROCESS ProcessContents;
  32. PEB ThePeb;
  33. Process = GetCurrentProcessAddress( dwProcessor, hCurrentThread, NULL );
  34. if ( !ReadMemory( (DWORD)Process,
  35. &ProcessContents,
  36. sizeof(EPROCESS),
  37. NULL) ) {
  38. dprintf("%08lx: Unable to read _EPROCESS\n", Process );
  39. memset( &ThePeb, 0, sizeof( ThePeb ) );
  40. }
  41. else
  42. if ( !ReadMemory( (DWORD)ProcessContents.Peb,
  43. &ThePeb,
  44. sizeof(ThePeb),
  45. NULL) ) {
  46. dprintf(" Unabled to read Process PEB\n" );
  47. memset( &ThePeb, 0, sizeof( ThePeb ) );
  48. }
  49. DllsExtension( args, &ThePeb );
  50. }
  51. #include "..\\ntsdexts\\dllsext.c"