Peb64 wrong output

Тема в разделе "WASM.ENGLISH", создана пользователем dabennos, 5 ноя 2011.

  1. dabennos

    dabennos New Member

    Публикаций:
    0
    Регистрация:
    30 окт 2011
    Сообщения:
    1
    Nice board. To my question: I try to build a debugger(x86), which is able to debug x64 processes. I need to get ProcessBasicInformation of target process, by using NtWow64QueryInformationProcess64, for peb64 i use this structure, thats giving me false output. Maybe someone can help.

    Код (Text):
    1.     typedef struct _PEB64 {
    2.         BYTE Reserved1[2];
    3.         BYTE BeingDebugged;
    4.         BYTE Reserved2[21];
    5.         PPEB_LDR_DATA Ldr;
    6.         PPROCESS_PARAMETERS ProcessParameters;
    7.         BYTE Reserved3[520];
    8.         ULONG PostProcessInitRoutine;
    9.         BYTE Reserved4[136];
    10.         ULONG SessionId;
    11.     } PEB64;
     
  2. sn0w

    sn0w Active Member

    Публикаций:
    0
    Регистрация:
    27 фев 2010
    Сообщения:
    956
    any time u can verify your struct through windbg's dt command:

    Код (Text):
    1. 0:000> dt nt!_PEB
    2. ntdll!_PEB
    3.    +0x000 InheritedAddressSpace : UChar
    4.    +0x001 ReadImageFileExecOptions : UChar
    5.    +0x002 BeingDebugged    : UChar
    6.    +0x003 BitField         : UChar
    7.    +0x003 ImageUsesLargePages : Pos 0, 1 Bit
    8.    +0x003 IsProtectedProcess : Pos 1, 1 Bit
    9.    +0x003 IsLegacyProcess  : Pos 2, 1 Bit
    10.    +0x003 IsImageDynamicallyRelocated : Pos 3, 1 Bit
    11.    +0x003 SkipPatchingUser32Forwarders : Pos 4, 1 Bit
    12.    +0x003 SpareBits        : Pos 5, 3 Bits
    13.    +0x008 Mutant           : Ptr64 Void
    14.    +0x010 ImageBaseAddress : Ptr64 Void
    15.    +0x018 Ldr              : Ptr64 _PEB_LDR_DATA
    16.    +0x020 ProcessParameters : Ptr64 _RTL_USER_PROCESS_PARAMETERS
    17.    +0x028 SubSystemData    : Ptr64 Void
    18.    +0x030 ProcessHeap      : Ptr64 Void
    19.    +0x038 FastPebLock      : Ptr64 _RTL_CRITICAL_SECTION
    20.    +0x040 AtlThunkSListPtr : Ptr64 Void
    21.    +0x048 IFEOKey          : Ptr64 Void
    22.    +0x050 CrossProcessFlags : Uint4B
    23.    +0x050 ProcessInJob     : Pos 0, 1 Bit
    24.    +0x050 ProcessInitializing : Pos 1, 1 Bit
    25.    +0x050 ProcessUsingVEH  : Pos 2, 1 Bit
    26.    +0x050 ProcessUsingVCH  : Pos 3, 1 Bit
    27.    +0x050 ProcessUsingFTH  : Pos 4, 1 Bit
    28.    +0x050 ReservedBits0    : Pos 5, 27 Bits
    29.    +0x058 KernelCallbackTable : Ptr64 Void
    30.    +0x058 UserSharedInfoPtr : Ptr64 Void
    31.    +0x060 SystemReserved   : [1] Uint4B
    32.    +0x064 AtlThunkSListPtr32 : Uint4B
    33.    +0x068 ApiSetMap        : Ptr64 Void
    34.    +0x070 TlsExpansionCounter : Uint4B
    35.    +0x078 TlsBitmap        : Ptr64 Void
    36.    +0x080 TlsBitmapBits    : [2] Uint4B
    37.    +0x088 ReadOnlySharedMemoryBase : Ptr64 Void
    38.    +0x090 HotpatchInformation : Ptr64 Void
    39.    +0x098 ReadOnlyStaticServerData : Ptr64 Ptr64 Void
    40.    +0x0a0 AnsiCodePageData : Ptr64 Void
    41.    +0x0a8 OemCodePageData  : Ptr64 Void
    42.    +0x0b0 UnicodeCaseTableData : Ptr64 Void
    43.    +0x0b8 NumberOfProcessors : Uint4B
    44.    +0x0bc NtGlobalFlag     : Uint4B
    45.    +0x0c0 CriticalSectionTimeout : _LARGE_INTEGER
    46.    +0x0c8 HeapSegmentReserve : Uint8B
    47.    +0x0d0 HeapSegmentCommit : Uint8B
    48.    +0x0d8 HeapDeCommitTotalFreeThreshold : Uint8B
    49.    +0x0e0 HeapDeCommitFreeBlockThreshold : Uint8B
    50.    +0x0e8 NumberOfHeaps    : Uint4B
    51.    +0x0ec MaximumNumberOfHeaps : Uint4B
    52.    +0x0f0 ProcessHeaps     : Ptr64 Ptr64 Void
    53.    +0x0f8 GdiSharedHandleTable : Ptr64 Void
    54.    +0x100 ProcessStarterHelper : Ptr64 Void
    55.    +0x108 GdiDCAttributeList : Uint4B
    56.    +0x110 LoaderLock       : Ptr64 _RTL_CRITICAL_SECTION
    57.    +0x118 OSMajorVersion   : Uint4B
    58.    +0x11c OSMinorVersion   : Uint4B
    59.    +0x120 OSBuildNumber    : Uint2B
    60.    +0x122 OSCSDVersion     : Uint2B
    61.    +0x124 OSPlatformId     : Uint4B
    62.    +0x128 ImageSubsystem   : Uint4B
    63.    +0x12c ImageSubsystemMajorVersion : Uint4B
    64.    +0x130 ImageSubsystemMinorVersion : Uint4B
    65.    +0x138 ActiveProcessAffinityMask : Uint8B
    66.    +0x140 GdiHandleBuffer  : [60] Uint4B
    67.    +0x230 PostProcessInitRoutine : Ptr64     void
    68.    +0x238 TlsExpansionBitmap : Ptr64 Void
    69.    +0x240 TlsExpansionBitmapBits : [32] Uint4B
    70.    +0x2c0 SessionId        : Uint4B
    71.    +0x2c8 AppCompatFlags   : _ULARGE_INTEGER
    72.    +0x2d0 AppCompatFlagsUser : _ULARGE_INTEGER
    73.    +0x2d8 pShimData        : Ptr64 Void
    74.    +0x2e0 AppCompatInfo    : Ptr64 Void
    75.    +0x2e8 CSDVersion       : _UNICODE_STRING
    76.    +0x2f8 ActivationContextData : Ptr64 _ACTIVATION_CONTEXT_DATA
    77.    +0x300 ProcessAssemblyStorageMap : Ptr64 _ASSEMBLY_STORAGE_MAP
    78.    +0x308 SystemDefaultActivationContextData : Ptr64 _ACTIVATION_CONTEXT_DATA
    79.    +0x310 SystemAssemblyStorageMap : Ptr64 _ASSEMBLY_STORAGE_MAP
    80.    +0x318 MinimumStackCommit : Uint8B
    81.    +0x320 FlsCallback      : Ptr64 _FLS_CALLBACK_INFO
    82.    +0x328 FlsListHead      : _LIST_ENTRY
    83.    +0x338 FlsBitmap        : Ptr64 Void
    84.    +0x340 FlsBitmapBits    : [4] Uint4B
    85.    +0x350 FlsHighIndex     : Uint4B
    86.    +0x358 WerRegistrationData : Ptr64 Void
    87.    +0x360 WerShipAssertPtr : Ptr64 Void
    88.    +0x368 pContextData     : Ptr64 Void
    89.    +0x370 pImageHeaderHash : Ptr64 Void
    90.    +0x378 TracingFlags     : Uint4B
    91.    +0x378 HeapTracingEnabled : Pos 0, 1 Bit
    92.    +0x378 CritSecTracingEnabled : Pos 1, 1 Bit
    93.    +0x378 SpareTracingBits : Pos 2, 30 Bits
    and dont forget to check the NTSTATUS of ur request