CreateMutex
까보면 다나와~
유용한 지식 자료들 (89)

윈도우 버전 정보 (GetVersion)

http://www.codeguru.com/cpp/misc/misc/system/article.php/c8973/Determine-Windows-Version-and-Edition.htm

-----

The first difference is made by the major version:

  • 3 is for Windows NT 3.5
  • 4 is for the Windows NT 4
  • 5 is for Windows 2000, Windows XP, Windows Server 2003 and Windows Home Server
  • 6 is for Windows Vista, Windows Server 2008 and Windows 7

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724833(v=vs.85).aspx

'유용한 지식 자료들 > 기타' 카테고리의 다른 글

Windows7 update 관련 프로세스  (0) 2013.05.15
중국에서 사용하는 메신저 프로그램  (0) 2013.02.25
PEB structure  (0) 2012.08.09
TEB structure  (0) 2012.08.09
Win32 Thread Information Block (TIB), TEB  (0) 2012.08.08
  Comments,     Trackbacks

SYSTEM_INFORMATION_CLASS Enumeration


SystemInformationClass Hex값까지 추가해서 올립니다. 


Name

Value

Hex Value

SystemInformationClassMin

0

0

SystemBasicInformation

0

0

SystemProcessorInformation

1

1

SystemPerformanceInformation

2

2

SystemTimeOfDayInformation

3

3

SystemPathInformation

4

4

SystemNotImplemented1

4

4

SystemProcessInformation

5

5

SystemProcessesAndThreadsInformation

5

5

SystemCallCountInfoInformation

6

6

SystemCallCounts

6

6

SystemDeviceInformation

7

7

SystemConfigurationInformation

7

7

SystemProcessorPerformanceInformation

8

8

SystemProcessorTimes

8

8

SystemFlagsInformation

9

9

SystemGlobalFlag

9

9

SystemCallTimeInformation

10

A

SystemNotImplemented2

10

A

SystemModuleInformation

11

B

SystemLocksInformation

12

C

SystemLockInformation

12

C

SystemStackTraceInformation

13

D

SystemNotImplemented3

13

D

SystemPagedPoolInformation

14

E

SystemNotImplemented4

14

E

SystemNonPagedPoolInformation

15

F

SystemNotImplemented5

15

F

SystemHandleInformation

16

10

SystemObjectInformation

17

11

SystemPageFileInformation

18

12

SystemPagefileInformation

18

12

SystemVdmInstemulInformation

19

13

SystemInstructionEmulationCounts

19

13

SystemVdmBopInformation

20

14

SystemInvalidInfoClass1

20

14

SystemFileCacheInformation

21

15

SystemCacheInformation

21

15

SystemPoolTagInformation

22

16

SystemInterruptInformation

23

17

SystemProcessorStatistics

23

17

SystemDpcBehaviourInformation

24

18

SystemDpcInformation

24

18

SystemFullMemoryInformation

25

19

SystemNotImplemented6

25

19

SystemLoadImage

26

1A

SystemUnloadImage

27

1B

SystemTimeAdjustmentInformation

28

1C

SystemTimeAdjustment

28

1C

SystemSummaryMemoryInformation

29

1D

SystemNotImplemented7

29

1D

SystemNextEventIdInformation

30

1E

SystemNotImplemented8

30

1E

SystemEventIdsInformation

31

1F

SystemNotImplemented9

31

1F

SystemCrashDumpInformation

32

20

SystemExceptionInformation

33

21

SystemCrashDumpStateInformation

34

22

SystemKernelDebuggerInformation

35

23

SystemContextSwitchInformation

36

24

SystemRegistryQuotaInformation

37

25

SystemLoadAndCallImage

38

26

SystemPrioritySeparation

39

27

SystemPlugPlayBusInformation

40

28

SystemNotImplemented10

40

28

SystemDockInformation

41

29

SystemNotImplemented11

41

29

SystemInvalidInfoClass2

42

2A

SystemProcessorSpeedInformation

43

2B

SystemInvalidInfoClass3

43

2B

SystemCurrentTimeZoneInformation

44

2C

SystemTimeZoneInformation

44

2C

SystemLookasideInformation

45

2D

SystemSetTimeSlipEvent

46

2E

SystemCreateSession

47

2F

SystemDeleteSession

48

30

SystemInvalidInfoClass4

49

31

SystemRangeStartInformation

50

32

SystemVerifierInformation

51

33

SystemAddVerifier

52

34

SystemSessionProcessesInformation

53

35

SystemInformationClassMax

54

36


  Comments,     Trackbacks

NtQuerySystemInformation (SystemModuleInformation) 정보

먼저 NtQuerySystemInformation은 첫번째 인자인 SystemInformationClass를 참조하여 어떤 정보를 보여줄 것인지 판단하고 두번째 인자인 SystemInformation 버퍼를 통해 결과를 보여준다.

(또 NtQuerySystemInformation은 두번의 호출로 값을 얻어오기도 하는데 방식은 4번째 인자가 있고 없고의 차이가 있다. 있으면 Information 크기를 얻어오고, 없으면 Information 크기로 값을 얻어오는 것 같다. 더 확인이 필요함....그러니깐 4번쩌 인자가 들어갔을 때 그 크기를 구해오는 거고 크기를 바탕으로 다시한번 함수를 호출하는 방식으로 정보를 얻는 것..)


NtQuerySystemInformation으로 SystemModuleInformation정보를 얻고자 할 때, 로드되는 메모리 구조는 다음과 같다.



typedef struct _SYSTEM_MODULE_INFORMATION {

  ULONG                ModulesCount; 0000006f

  SYSTEM_MODULE        Modules[0];

} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;

 

typedef struct _SYSTEM_MODULE { 

 ULONG Reserved[2];     00000000 00000000

 PVOID Base;                 804d9000

 ULONG Size;                 001f8c80

 ULONG Flags;                0c004000

 USHORT Index;              0000

 USHORT Unknown;        0000

 USHORT LoadCount;      0001

 USHORT ModuleNameOffset; 0012

 CHAR ImageName[256];

} SYSTEM_MODULE , *PSYSTEM_MODULE 


위의 이미지를 예로 들면 ntkrnlpa.exe의 IMG_BASE는 '804d9000'이 되겠다.

활용하자면 NtQuerySystemInformation의 SYSTEM_MODULE_INFORMATION으로 로드된 모듈과 img base, 또는 로드된 모듈 개수, 또는 커널 이미지 정보를 확인 가능하다.


  Comments,     Trackbacks

악성코드 'PlugX Dropper'의 설치 방식

#PlugX Malware


보통의 경우 최초 드럽퍼가 실행되면 exe, dll, data 파일(확장자는 제작자 마음) 이렇게 3종류의 파일이 특정 폴더에 설치가 된다. 최초 드럽퍼가 어떻게 실행되는 지 확인하지 못 했지만, 방법이야 다양하니 생략,,


예) 

C:\Program Files\Common Files\Nv.exe

C:\Program Files\Common Files\NvSmartMax.dll

C:\Program Files\Common Files\NvSmart.mp3


같은 폴더에 나란히 3가지 파일이 설치되면 먼저 exe파일이 실행되고 DLL이 로드되며 해당 DLL이 다시 남은 data 파일(위의 NvSmart.mp3)을 로드하는 방식이다. 설치를 위해 각각의 파일이 반드시 존재해야하는 것이다.


그런데 3가지 파일이 반드시 필요한 이유가 더 있다. 자세히 살펴보면...


일단 DLL 파일의 Main코드를 살펴보면 다음과 같은 코드들을 볼 수 있다.

처음부터 '20120101'을 현재 실행되고 있는 PC의 System시간과 비교한다. 이 부분은 상기 언급한 반드시 필요한 부분에 포함되지 않지만, 구지 비교하는 이유가 궁금해서.. 이유가 뭘까. 



위 그림을 보면 Module EP를 찾아서 EP의 Page를 R/W하게 변경한다. 그리고 다음과 같이 하드 코딩된 주소(_DataLoad_Routine_)와 EP의 거리를 계산해서 Module EP부분에 덮어쓴다. 해당 어셈코드는 "E8 A6 18 00 00"에서 "E8 8A F8 8F 0F"로 변경되면서 점프되는 곳이 _DataLoad_Routine_ 주소로 바뀌는 것이다.


[Dll Main 코드에 삽입된 EP 수정 코드]

(귀찮게...)


어쨌건 정리하면, exe는 쓰고자하는 DLL을 import하고..

[exe의 import table중 일부]


DLL이 로드되면 DLL Main코드가 실행되면서 exe의 EP가 수정되며(exe 시작전) 다시 DLL의 특정 주소로 점프가 된다(exe 시작 직후). exe는 dll 실행히켜주고 dll은 exe 수정해주고 다시 exe는 dll을 통해 data 파일을 호출하는...완벽한 호흡을 자랑한다..;;


[exe의 원래 EP 코드]


그리고 첨부해서.. exe 원래 EP 코드를 보면 CRTStartup 보다 먼저 어떤 Call이 실행 되는 것을 볼 수 있다. 그래서 exe를 그냥 메인코드 먼저 디버깅하거나 IDA같은 Disassembler로만 보면 놓치는게 있을 수도..


  Comments,     Trackbacks

64비트인지 아닌지 확인하기x2




Private Const PROCESSOR_ARCHITECTURE_INTEL = 0
Private Const PROCESSOR_ARCHITECTURE_IA64 = 6
Private Const PROCESSOR_ARCHITECTURE_AMD64 = 9
Private Const PROCESSOR_ARCHITECTURE_UNKNOWN = &HFFFF


GetCurrentProcess -> IsWow64Process


return cmp 0 

0 이면 64bit아님


or


GetNativeSystemInfo

위의 그램을 보면 파라메터로 들어가는 push eax값이 lpSystemInfo로 해당 주소값에 ProcessorArchitecture 결과값이 저장된다. 따라서 cmp ax, 9와 같이 해당 주소의 값을 찾아와서 비교를 하면 64bit 여부를 알아낼 수 있다.

return cmp 9, 6 이면 64bit

0 이면 32bit




  Comments,     Trackbacks

Active Setup이란

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components


위에 있는게 레지스트리 경로이고 다음은 관련된 설명이다.


Active Setup is a mechanism for executing commands once per user early during logon. Active Setup is used by some operating system components like Internet Explorer to set up an initial configuration for new users logging on for the first time. Active Setup is also used in some corporation’s software distribution systems to create an initial customized user environment. To understand why such a mechanism is necessary we need to take a step back.


중략..


Active Setup runs before the shell is started, i.e. before the Desktop appears. Commands started by Active Setup run synchronously, blocking the logon while they are executing. Active Setup is executed before any Run or RunOnce registry entries are evaluated because Run(Once) is handled by the shell, Explorer.exe, which is started only after Active Setup is finished.



더 자세한 설명은 아래 사이트에서 확인!.. 정말 잘 나와있네요.

http://www.sepago.de/helge/2010/04/22/active-setup-explained/



  Comments,     Trackbacks

hosts파일 변조 악성코드의 배짱(?)

MoveFileExA

lpExistingFileName "C:\WINDOWS\system32\drivers\etc\5Uiue"

lpNewFileName (null)

dwFlags "MOVEFILE_DELAY_UNTIL_REBOOT"


최근 주말에 유포되는 악성코드에서 사용하는 행위.

별거 아닌거 같지만 여러 이유가 있는 거 같군. ㅎ

  Comments,     Trackbacks

User-mode Inline Patch를 위한 함수 주소 찾는 방법

*NGRBOT에서 사용하는 방법

 

다음은 패치하는 코드.(Native 함수 LdrEnumerateLoadedModules를 통해 모든 모듈에 CallBack함수를 실행, CallBack 함수 및 _Inline_Patch_Routine에서 Inline Patch 행위를 한다.)

 

주소 찾는 방식.(메모리상 Header, Export Table 정보를 이용한다.)

 

'유용한 지식 자료들 > 악성코드 기법' 카테고리의 다른 글

64비트인지 아닌지 확인하기x2  (0) 2012.11.05
hosts파일 변조 악성코드의 배짱(?)  (0) 2012.08.22
ntdll.bsearch  (2) 2012.08.01
Security Service Disable  (0) 2012.06.25
keylogging 기법  (0) 2011.05.24
  Comments,     Trackbacks

PEB structure
kd> !strct _PEB
struct _PEB (sizeof=488)
+000 byte InheritedAddressSpace
+001 byte ReadImageFileExecOptions
+002 byte BeingDebugged
+003 byte SpareBool
+004 void *Mutant
+008 void *ImageBaseAddress
+00c struct _PEB_LDR_DATA *Ldr
+010 struct _RTL_USER_PROCESS_PARAMETERS *ProcessParameters
+014 void *SubSystemData
+018 void *ProcessHeap
+01c void *FastPebLock
+020 void *FastPebLockRoutine
+024 void *FastPebUnlockRoutine
+028 uint32 EnvironmentUpdateCount
+02c void *KernelCallbackTable
+030 uint32 SystemReserved[2]
+038 struct _PEB_FREE_BLOCK *FreeList
+03c uint32 TlsExpansionCounter
+040 void *TlsBitmap
+044 uint32 TlsBitmapBits[2]
+04c void *ReadOnlySharedMemoryBase
+050 void *ReadOnlySharedMemoryHeap
+054 void **ReadOnlyStaticServerData
+058 void *AnsiCodePageData
+05c void *OemCodePageData
+060 void *UnicodeCaseTableData
+064 uint32 NumberOfProcessors
+068 uint32 NtGlobalFlag
+070 union _LARGE_INTEGER CriticalSectionTimeout
+070 uint32 LowPart
+074 int32 HighPart
+070 struct __unnamed3 u
+070 uint32 LowPart
+074 int32 HighPart
+070 int64 QuadPart
+078 uint32 HeapSegmentReserve
+07c uint32 HeapSegmentCommit
+080 uint32 HeapDeCommitTotalFreeThreshold
+084 uint32 HeapDeCommitFreeBlockThreshold
+088 uint32 NumberOfHeaps
+08c uint32 MaximumNumberOfHeaps
+090 void **ProcessHeaps
+094 void *GdiSharedHandleTable
+098 void *ProcessStarterHelper
+09c uint32 GdiDCAttributeList
+0a0 void *LoaderLock
+0a4 uint32 OSMajorVersion
+0a8 uint32 OSMinorVersion
+0ac uint16 OSBuildNumber
+0ae uint16 OSCSDVersion
+0b0 uint32 OSPlatformId
+0b4 uint32 ImageSubsystem
+0b8 uint32 ImageSubsystemMajorVersion
+0bc uint32 ImageSubsystemMinorVersion
+0c0 uint32 ImageProcessAffinityMask
+0c4 uint32 GdiHandleBuffer[34]
+14c function *PostProcessInitRoutine
+150 void *TlsExpansionBitmap
+154 uint32 TlsExpansionBitmapBits[32]
+1d4 uint32 SessionId
+1d8 void *AppCompatInfo
+1dc struct _UNICODE_STRING CSDVersion
+1dc uint16 Length
+1de uint16 MaximumLength
+1e0 uint16 *Buffer





========kernel32.dll???================

1. fs레지스터 => teb 를 가르키고 있다.

2. teb+0x30 위치에 peb 구조체를 가르키는 offset이 위치해 있다.

3. peb+0x0c의 위치에 PEB_LDR_DATA 구조체를 가르키는 포인터가 있다.

4. PEB_LDR_DATA+0x1c에 InInitializationOnderModuleList에 있고,
그 곳의 1번째가 ntdll.dll 2번째가 kernel32.dll 주소이다. **

InInitializationOnderModuleList 구조체 정보

0x000 Flink : LIST_ENTRY
0x004 Blink : LIST_ENTRY
0x008 DllBase : Ptr32
0x00C EntryPoint : Ptr32
0x010 SizeOfImage : Uint4B
0x014 FullDllName : UNICODE_STRING
0x014 (0x000) Length : Uint2B
0x016 (0x002) MaximumLength : Uint2B
0x018 (0x004) Buffer : Ptr32
0x01C BaseDllName : UNICODE_STRING
0x01C (0x000) Length : Uint2B
0x01E (0x002) MaximumLength : Uint2B
0x020 (0x004) Buffer : Ptr32


============find function=====================

5. kernel32.dll base address + 0x3c

6. exports directory offset =kernel32.dll base address+PE header offset+120(0x78)

7. exports directory table=kernel32.dll base address+exports directory offset

8. name pointers table =exports directory table+32

9. name pointers table (함수 이름이나 hash사용)

10. exports directory table+36
ordinals table 함수의 주소를 가르킨다. ordinals table의 서수의 순서에 근거하여 함수의 주소를 찾아낸다.


============heap overflow 에서 peb 이용방법================

FastPebLockRoutine 이 함수를 덮어쓴다 (undocumented 오프셋 위치는 PEB + 0x20
메모리:0x7ffdf020 0x7ffdf024)

(정의)Address of fast-locking routine for PEB. Definition of routine is:

typedef void (*PPEBLOCKROUTINE)(

PVOID PebLock

);

Peb->FastPebLockRoutine =>&RtlEnterCriticalSection (0xC0000005) overwrite
잘못된 메모리참조

=====================================================================================
undocumented peb source code

#define LDRP_STATIC_LINK 0x00000002 // dll은 과정까지 정적 링크한다
#define LDRP_IMAGE_DLL 0x00000004
#define LDRP_LOAD_IN_PROGRESS 0x00001000 //모듈 로드
#define LDRP_UNLOAD_IN_PROGRESS 0x00002000 //모듈 언로드
#define LDRP_ENTRY_PROCESSED 0x00004000 //
#define LDRP_ENTRY_INSERTED 0x00008000
#define LDRP_CURRENT_LOAD 0x00010000
#define LDRP_FAILED_BUILTIN_LOAD 0x00020000
#define LDRP_DONT_CALL_FOR_THREAD 0x00040000
#define LDRP_PROCESS_ATTACH_CALLED 0x00080000 // (DllMain)
#define LDRP_DEBUG_SYMBOLS_LOADED 0x00100000
#define LDRP_IMAGE_NOT_AT_BASE 0x00200000
#define LDRP_WX86_IGNORE_MACHINETYPE 0x00400000 // 사용한다! kdex2x86.strct _PEB_LDR_DATA

다음은 peb를 이용해 현재의 디렉토리 정보 얻을때 사용할 수 있는 peb에 속해있는 구조체------------
_RTL_USER_PROCESS_PARAMETERS (peb + 0x10)

typedef struct _RTL_USER_PROCESS_PARAMETERS
{
ULONG MaximumLength; // 00h
ULONG Length; // 04h
ULONG Flags; // 08h
ULONG DebugFlags; // 0Ch
PVOID ConsoleHandle; // 10h
ULONG ConsoleFlags; // 14h
HANDLE InputHandle; // 18h
HANDLE OutputHandle; // 1Ch
HANDLE ErrorHandle; // 20h
CURDIR CurrentDirectory; // 24h ********현재의 디렉토리 정보 ************
UNICODE_STRING DllPath; // 30h
UNICODE_STRING ImagePathName; // 38h
UNICODE_STRING CommandLine; // 40h
PWSTR Environment; // 48h
ULONG StartingX; // 4Ch
ULONG StartingY; // 50h
ULONG CountX; // 54h
ULONG CountY; // 58h
ULONG CountCharsX; // 5Ch
ULONG CountCharsY; // 60h
ULONG FillAttribute; // 64h
ULONG WindowFlags; // 68h
ULONG ShowWindowFlags; // 6Ch
UNICODE_STRING WindowTitle; // 70h
UNICODE_STRING DesktopInfo; // 78h
UNICODE_STRING ShellInfo; // 80h
UNICODE_STRING RuntimeInfo; // 88h
RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory[0x20]; // 90h
} RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;

vxmag-ex)
mov eax, dword ptr fs:[30h] ; goto PEB
mov eax, dword ptr [eax+10h] ; goto RTL_USER_PROCESS_PARAMETERS
add eax, 24h ; goto CurrentDirectory
mov eax, dword ptr [eax+4] ; gimme unicode_buffer


typedef struct _PEB_LDR_DATA {

unsigned int Length ; // 0x00
int Initialized ; // 0x04
PVOID SsHandle ; // 0x08
LIST_ENTRY InLoadOrderModuleList ; // 0x0c
LIST_ENTRY InMemoryOrderModuleList ; // 0x14
LIST_ENTRY InInitializationOrderModuleList ;// 0x1c

} PEB_LDR_DATA, *PPEB_LDR_DATA ; // Windows 2000 SourceCode의 속에 LDR DATA TABLE ENTRY의 정의가 없다, 그러나 그것은 가장 중요한 구조이다.

typedef struct _LDR_DATA_TABLE_ENTRY // offset
{

LIST_ENTRY InLoadOrderLinks; // 0x00
LIST_ENTRY InMemoryOrderLinks; // 0x08
LIST_ENTRY InInitializationOrderLinks; // 0x10
ULONG DllBase; // 0x18
ULONG EntryPoint; // 0x1C
ULONG SizeOfImage; // 0x20
UNICODE_STRING FullDllName; // 0x24
UNICODE_STRING BaseDllName; // 0x2C
ULONG Flags; // 0x34
SHORT LoadCount; // 0x38
WORD Fill; // 0x3A
LIST_ENTRY HashLinks ; // 0x3C
ULONG TimeDateStamp; // 0x44
} LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY; // 0x48 bytes


#define LDRP_HASH_TABLE_SIZE 32
#define LDRP_HASH_MASK (LDRP_HASH_TABLE_SIZE-1)
#define LDRP_COMPUTE_HASH_INDEX(ch) (((ch) - 'a') & LDRP_HASH_MASK) // 사용한다! kdex2x86.strct PEB

PEB2를 바꾼다
typedef struct _PEB2 { BYTE Reserved[12] ; PPEB_LDR_DATA Ldr ; // 0x0C
} PEB2, *PPEB2 ;

** PEB의 필드 debug **

kd> !strct _PEB

--------------------------------------------------

 

http://leony.egloos.com/369899

  Comments,     Trackbacks

TEB structure

TEB structure 

03.
// Instead of using the Tls fields, use the Win32 TLS APIs
04.//     TlsAlloc, TlsGetValue, TlsSetValue, TlsFree
05.//
06.// Instead of using the ReservedForOle field, use the COM API
07.//     CoGetContextToken
08.//
09.typedef struct _TEB {
10.    union {
11.        struct {
12.            BYTE Reserved1[1952];
13.            PVOID Reserved2[412];
14.            PVOID TlsSlots[64];
15.            BYTE Reserved3[8];
16.            PVOID Reserved4[26];
17.            PVOID ReservedForOle;  // Windows 2000 only
18.            PVOID Reserved5[4];
19.            PVOID TlsExpansionSlots;
20.        };
21.        struct {
22.            NT_TIB          Tib;                        /* 000 */
23.            PVOID           EnvironmentPointer;         /* 01c */
24.            CLIENT_ID       ClientId;                   /* 020 */
25.            PVOID           ActiveRpcHandle;            /* 028 */
26.            PVOID           ThreadLocalStoragePointer;  /* 02c */
27.            PPEB            Peb;                        /* 030 */
28.            ULONG           LastErrorValue;             /* 034 */
29.            ULONG           CountOfOwnedCriticalSections;/* 038 */
30.            PVOID           CsrClientThread;            /* 03c */
31.            PVOID           Win32ThreadInfo;            /* 040 */
32.            ULONG           Win32ClientInfo[31];        /* 044 used for user32 private data in Wine */
33.            PVOID           WOW32Reserved;              /* 0c0 */
34.            ULONG           CurrentLocale;              /* 0c4 */
35.            ULONG           FpSoftwareStatusRegister;   /* 0c8 */
36.            PVOID           SystemReserved1[54];        /* 0cc used for kernel32 private data in Wine */
37.            LONG            ExceptionCode;              /* 1a4 */
38.            ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 1a8 */
39.            BYTE            SpareBytes1[24];            /* 1bc used for ntdll private data in Wine */
40.            PVOID           SystemReserved2[10];        /* 1d4 used for ntdll private data in Wine */
41.            GDI_TEB_BATCH   GdiTebBatch;                /* 1fc used for vm86 private data in Wine */
42.            ULONG           gdiRgn;                     /* 6dc */
43.            ULONG           gdiPen;                     /* 6e0 */
44.            ULONG           gdiBrush;                   /* 6e4 */
45.            CLIENT_ID       RealClientId;               /* 6e8 */
46.            HANDLE          GdiCachedProcessHandle;     /* 6f0 */
47.            ULONG           GdiClientPID;               /* 6f4 */
48.            ULONG           GdiClientTID;               /* 6f8 */
49.            PVOID           GdiThreadLocaleInfo;        /* 6fc */
50.            PVOID           UserReserved[5];            /* 700 */
51.            PVOID           glDispachTable[280];        /* 714 */
52.            ULONG           glReserved1[26];            /* b74 */
53.            PVOID           glReserved2;                /* bdc */
54.            PVOID           glSectionInfo;              /* be0 */
55.            PVOID           glSection;                  /* be4 */
56.            PVOID           glTable;                    /* be8 */
57.            PVOID           glCurrentRC;                /* bec */
58.            PVOID           glContext;                  /* bf0 */
59.            ULONG           LastStatusValue;            /* bf4 */
60.            UNICODE_STRING  StaticUnicodeString;        /* bf8 used by advapi32 */
61.            WCHAR           StaticUnicodeBuffer[261];   /* c00 used by advapi32 */
62.            PVOID           DeallocationStack;          /* e0c */
63.            PVOID           TlsSlots_[64];              /* e10 */
64.            LIST_ENTRY      TlsLinks;                   /* f10 */
65.            PVOID           Vdm;                        /* f18 */
66.            PVOID           ReservedForNtRpc;           /* f1c */
67.            PVOID           DbgSsReserved[2];           /* f20 */
68.            ULONG           HardErrorDisabled;          /* f28 */
69.            PVOID           Instrumentation[16];        /* f2c */
70.            PVOID           WinSockData;                /* f6c */
71.            ULONG           GdiBatchCount;              /* f70 */
72.            ULONG           Spare2;                     /* f74 */
73.            ULONG           Spare3;                     /* f78 */
74.            ULONG           Spare4;                     /* f7c */
75.            PVOID           ReservedForOle_;            /* f80 */
76.            ULONG           WaitingOnLoaderLock;        /* f84 */
77.            PVOID           Reserved5_[3];              /* f88 */
78.            PVOID          *TlsExpansionSlots_;         /* f94 */
79.            ULONG           ImpersonationLocale;        /* f98 */
80.            ULONG           IsImpersonating;            /* f9c */
81.            PVOID           NlsCache;                   /* fa0 */
82.            PVOID           ShimData;                   /* fa4 */
83.            ULONG           HeapVirtualAffinity;        /* fa8 */
84.            PVOID           CurrentTransactionHandle;   /* fac */
85.            PVOID           ActiveFrame;                /* fb0 */
86.            PVOID          *FlsSlots;                   /* fb4 */
87.                        struct _TEB    *self;
88.        };
89.    };
90.} TEB;
91.typedef TEB *PTEB;

'유용한 지식 자료들 > 기타' 카테고리의 다른 글

윈도우 버전 정보 (GetVersion)  (0) 2012.12.07
PEB structure  (0) 2012.08.09
Win32 Thread Information Block (TIB), TEB  (0) 2012.08.08
64비트 인지 아닌지 확인하기  (0) 2012.07.18
Clustering VS Classification  (0) 2012.06.27
  Comments,     Trackbacks