Windows에서 사용되는 구조체 일람
ZwQuerySystemInformation
[ZwQuerySystemInformation may be altered or unavailable in subsequent versions of Windows. Applications should use the alternate functions listed in this topic.]
Retrieves the specified system information.
Syntax
NTSTATUS WINAPI ZwQuerySystemInformation( __in SYSTEM_INFORMATION_CLASS SystemInformationClass, __inout PVOID SystemInformation, __in ULONG SystemInformationLength, __out_opt PULONG ReturnLength );
Parameters
- SystemInformationClass
-
The type of system information to be retrieved. This parameter can be one of the following values from the SYSTEM_INFORMATION_CLASS enumeration type.
-
SystemBasicInformation
-
The number of processors in the system in a SYSTEM_BASIC_INFORMATION structure. Use the GetSystemInfo function instead.
-
SystemPerformanceInformation
-
An opaque SYSTEM_PERFORMANCE_INFORMATION structure that can be used to generate an unpredictable seed for a random number generator. Use the CryptGenRandom function instead.
-
SystemTimeOfDayInformation
-
An opaque SYSTEM_TIMEOFDAY_INFORMATION structure that can be used to generate an unpredictable seed for a random number generator. Use the CryptGenRandom function instead.
-
SystemProcessInformation
-
An array of SYSTEM_PROCESS_INFORMATION structures, one for each process running in the system.
These structures contain information about the resource usage of each process, including the number of handles used by the process, the peak page-file usage, and the number of memory pages that the process has allocated.
-
SystemProcessorPerformanceInformation
-
An array of SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION structures, one for each processor installed in the system.
-
SystemInterruptInformation
-
An opaque SYSTEM_INTERRUPT_INFORMATION structure that can be used to generate an unpredictable seed for a random number generator. Use the CryptGenRandom function instead.
-
SystemExceptionInformation
-
An opaque SYSTEM_EXCEPTION_INFORMATION structure that can be used to generate an unpredictable seed for a random number generator. Use the CryptGenRandom function instead.
-
SystemRegistryQuotaInformation
-
A SYSTEM_REGISTRY_QUOTA_INFORMATION structure.
-
SystemLookasideInformation
-
An opaque SYSTEM_LOOKASIDE_INFORMATION structure that can be used to generate an unpredictable seed for a random number generator. Use the CryptGenRandom function instead.
-
- SystemInformation
-
A pointer to a buffer that receives the requested information. The size and structure of this information varies depending on the value of the SystemInformationClass parameter, as indicated in the following table.
-
SYSTEM_BASIC_INFORMATION
-
When the SystemInformationClass parameter is SystemBasicInformation, the buffer pointed to by the SystemInformation parameter should be large enough to hold a single SYSTEM_BASIC_INFORMATION structure having the following layout:
typedef struct _SYSTEM_BASIC_INFORMATION { BYTE Reserved1[24]; PVOID Reserved2[4]; CCHAR NumberOfProcessors; } SYSTEM_BASIC_INFORMATION;
The NumberOfProcessors member contains the number of processors present in the system. Use GetSystemInfo instead to retrieve this information.
The other members of the structure are reserved for internal use by the operating system.
-
SYSTEM_PERFORMANCE_INFORMATION
-
When the SystemInformationClass parameter is SystemPerformanceInformation, the buffer pointed to by the SystemInformation parameter should be large enough to hold an opaque SYSTEM_PERFORMANCE_INFORMATION structure for use in generating an unpredictable seed for a random number generator. For this purpose, the structure has the following layout:
typedef struct _SYSTEM_PERFORMANCE_INFORMATION { BYTE Reserved1[312]; } SYSTEM_PERFORMANCE_INFORMATION;
Individual members of the structure are reserved for internal use by the operating system.
Use the CryptGenRandom function instead to generate cryptographically random data.
-
SYSTEM_TIMEOFDAY_INFORMATION
-
When the SystemInformationClass parameter is SystemTimeOfDayInformation, the buffer pointed to by the SystemInformation parameter should be large enough to hold an opaque SYSTEM_TIMEOFDAY_INFORMATION structure for use in generating an unpredictable seed for a random number generator. For this purpose, the structure has the following layout:
typedef struct _SYSTEM_TIMEOFDAY_INFORMATION { BYTE Reserved1[48]; } SYSTEM_TIMEOFDAY_INFORMATION;
Individual members of the structure are reserved for internal use by the operating system.
Use the CryptGenRandom function instead to generate cryptographically random data.
-
SYSTEM_PROCESS_INFORMATION
-
When the SystemInformationClass parameter is SystemProcessInformation, the buffer pointed to by the SystemInformation parameter should be large enough to hold an array that contains as many SYSTEM_PROCESS_INFORMATION structures as there are processes running in the system. Each structure has the following layout:
typedef struct _SYSTEM_PROCESS_INFORMATION { ULONG NextEntryOffset; ULONG NumberOfThreads; BYTE Reserved1[48]; PVOID Reserved2[3]; HANDLE UniqueProcessId; PVOID Reserved3; ULONG HandleCount; BYTE Reserved4[4]; PVOID Reserved5[11]; SIZE_T PeakPagefileUsage; SIZE_T PrivatePageCount; LARGE_INTEGER Reserved6[6]; } SYSTEM_PROCESS_INFORMATION;
The NumberOfThreads member contains the total number of currently running threads in the process.
The HandleCount member contains the total number of handles being used by the process in question; use GetProcessHandleCount to retrieve this information instead.
The PeakPagefileUsage member contains the maximum number of bytes of page-file storage used by the process, and the PrivatePageCount member contains the number of memory pages allocated for the use of this process.
You can also retrieve this information using either the GetProcessMemoryInfo function or the Win32_Process class.
The other members of the structure are reserved for internal use by the operating system.
-
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
-
When the SystemInformationClass parameter is SystemProcessorPerformanceInformation, the buffer pointed to by the SystemInformation parameter should be large enough to hold an array that contains as many SYSTEM_PROCESS_INFORMATION structures as there are processors (CPUs) installed in the system. Each structure has the following layout:
typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION { LARGE_INTEGER IdleTime; LARGE_INTEGER KernelTime; LARGE_INTEGER UserTime; LARGE_INTEGER Reserved1[2]; ULONG Reserved2; } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
The IdleTime member contains the amount of time that the system has been idle, in 1/100ths of a nanosecond.
The KernelTime member contains the amount of time that the system has spent executing in Kernel mode (including all threads in all processes, on all processors), in 1/100ths of a nanosecond.
The UserTime member contains the amount of time that the system has spent executing in User mode (including all threads in all processes, on all processors), in 1/100ths of a nanosecond.
Use GetSystemTimes instead to retrieve this information.
-
SYSTEM_INTERRUPT_INFORMATION
-
When the SystemInformationClass parameter is SystemInterruptInformation, the buffer pointed to by the SystemInformation parameter should be large enough to hold an array that contains as many opaque SYSTEM_INTERRUPT_INFORMATION structures as there are processors (CPUs) installed on the system. Each structure, or the array as a whole, can be used to generate an unpredictable seed for a random number generator. For this purpose, the structure has the following layout:
typedef struct _SYSTEM_INTERRUPT_INFORMATION { BYTE Reserved1[24]; } SYSTEM_INTERRUPT_INFORMATION;
Individual members of the structure are reserved for internal use by the operating system.
Use the CryptGenRandom function instead to generate cryptographically random data.
-
SYSTEM_EXCEPTION_INFORMATION
-
When the SystemInformationClass parameter is SystemExceptionInformation, the buffer pointed to by the SystemInformation parameter should be large enough to hold an opaque SYSTEM_EXCEPTION_INFORMATION structure for use in generating an unpredictable seed for a random number generator. For this purpose, the structure has the following layout:
typedef struct _SYSTEM_EXCEPTION_INFORMATION { BYTE Reserved1[16]; } SYSTEM_EXCEPTION_INFORMATION;
Individual members of the structure are reserved for internal use by the operating system.
Use the CryptGenRandom function instead to generate cryptographically random data.
-
SYSTEM_REGISTRY_QUOTA_INFORMATION
-
When the SystemInformationClass parameter is SystemRegistryQuotaInformation, the buffer pointed to by the SystemInformation parameter should be large enough to hold a single SYSTEM_REGISTRY_QUOTA_INFORMATION structure having the following layout:
typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION { ULONG RegistryQuotaAllowed; ULONG RegistryQuotaUsed; PVOID Reserved1; } SYSTEM_REGISTRY_QUOTA_INFORMATION;
The RegistryQuotaAllowed member contains the maximum size, in bytes, that the Registry can attain on this system.
The RegistryQuotaUsed member contains the current size of the Registry, in bytes.
Use GetSystemRegistryQuota instead to retrieve this information.
The other member of the structure is reserved for internal use by the operating system.
-
SYSTEM_LOOKASIDE_INFORMATION
-
When the SystemInformationClass parameter is SystemLookasideInformation, the buffer pointed to by the SystemInformation parameter should be large enough to hold an opaque SYSTEM_LOOKASIDE_INFORMATION structure for use in generating an unpredictable seed for a random number generator. For this purpose, the structure has the following layout:
typedef struct _SYSTEM_LOOKASIDE_INFORMATION { BYTE Reserved1[32]; } SYSTEM_LOOKASIDE_INFORMATION;
Individual members of the structure are reserved for internal use by the operating system.
Use the CryptGenRandom function instead to generate cryptographically random data.
-
- SystemInformationLength
-
The size of the buffer pointed to by the SystemInformation parameter, in bytes.
- ReturnLength
-
An optional pointer to a location where the function writes the actual size of the information requested. If that size is less than or equal to the SystemInformationLength parameter, the function copies the information into the SystemInformation buffer; otherwise, it returns an NTSTATUS error code and returns in ReturnLength the size of buffer required to receive the requested information.
Return Value
Returns an NTSTATUS success or error code.
The forms and significance of NTSTATUS error codes are listed in the Ntstatus.h header file available in the Windows Device Driver Kit (DDK), and are described in the DDK documentation.
Remarks
The ZwQuerySystemInformation function and the structures that it returns are internal to the operating system and subject to change from one release of Windows to another. To maintain the compatibility of your application, it is better to use the alternate functions previously mentioned instead.
If you do use ZwQuerySystemInformation, access the function through run-time dynamic linking. This gives your code an opportunity to respond gracefully if the function has been changed or removed from the operating system. Signature changes, however, may not be detectable.
This function has no associated import library. You must use the LoadLibrary and GetProcAddress functions to dynamically link to Ntdll.dll.
Requirements
DLL |
Requires Ntdll.dll. |
---|
See Also
GetSystemInfo
GetProcessHandleCount
GetProcessMemoryInfo
GetSystemTimes
GetSystemRegistryQuota
Send comments about this topic to Microsoft
Build date: 5/15/2008
Hidden Process 탐지 방법
( 왠만한 루트킷들은 이 값을 조작하므로 별로 소용없을지도 모르지만,
ZwQuerySystemInformation()을 후킹하여 결과값을 조작하는 식으로 숨기는 경우는
이 방법으로 손쉽게 찾아낼 수 있습니다. )
2. ZwOpenProcess() Brute-Force Detection
유효 PID인 0L부터 0xFFFFL까지 4의 배수들을 모두 Open해서 성공적으로 열어지는 프로세스를
감지합니다. 단, 프로세스가 종료되었으나 핸들이 닫히지 않은 경우에도 Open되므로 추가적인
확인이 필요합니다.
3. PspCidTable Traverse
Windows NT에는 PspCidTable이라는 Unexported Symbol이 존재하는데, 프로세스와 스레드에
대한 개체 포인터들을 저장하고 있는 핸들 테이블의 일종입니다. 이를 트레버싱하여 숨겨진
프로세스를 찾을 수도 있습니다.
( 개체 포인터만 저장되어있으므로, 포인터-0x18 한 값이 가리키는 OBJECT_HEADER 헤더의
Type 필드가 PsProcessType인지 검사해줄 필요가 있습니다. )
4. Process Handle Table Link Traverse
EPROCESS에는 HandleTable 필드가 존재하고 이 안에는 링크드 리스트가 존재합니다.
이 리스트를 이용해서 트레버싱하면 모든 EPROCESS를 찾을 수 있습니다.
5. CSRSS.EXE의 Handle Table Traversing
CSRSS.EXE 프로세스는 프로세스 시작을 커널에 통지하고 그 뒷처리를 하는 역할을 하기도 합니다.
(BaseSetProcessCreateNotify라는 Unexported/Undocumented Symbol을 이용합니다.
[출처] 제가 알고있는 숨겨진 프로세스를 찾는 방법들|작성자 에버어어
(APM + ITS + SVN 설치 따라하기) 3. MySQL 설치하기
Apache + Tomcat + Mysql + PHP + Eventum + Zeroboard + SVN + WebSVN
설치하기
< MySQL 설치하기 >
문서 내용 :
a. MySQL 프로그램 설치
b. 아파치와 톰캣 연동
c. 한글 깨지는 오류 수정
d. 오류 확인 해결하기
기본 준비물 :
공식 홈페이지 : http://www.mysql.com/
Download Url : http://dev.mysql.com/downloads/mysql/5.0.html
설치는 다음 파일을 기준으로 합니다
mysql-essential-5.0.51a-win32.msi
파일을 다운로드 받아 실행합니다
특별한 것 없이 설치를 마무리하고,
바로 MySQL Server 설정을 하도록 합니다
상세설정으로 합니다
시스템 자원 사용율에 영향을 주는 설정이라는군요
Developer Machine 은 일반적인 용도의 PC일 경우
Server Machine 은 기타 서버 App가 동작중인 PC 인 경우
Dedicated MySQL Server는 MySQL 전용 PC일 경우 선택하라고 나와있네요
기본설정으로 진행합니다
InnoDB가 위치하게 될 폴더를 설정합니다
용도에 맞는 커넥션 수를 설정합니다
일반적인 용도에서는
TCP/IP Networking 을 하지 않아도 상관이 없을 듯하지만,
원격으로 서버를 관리하기 위해서는 왠지 필요한 기능인 것 같군요
확장성을 위해 선택
DB에 한글을 사용해야하므로,
Mulilingualism을 선택합니다
MySQL 을 Windows Service로 등록하면
PC를 부팅하여 완전히 로그인이 되지 않아도
MySQL이 동작합니다
즉, Windows 계정에 암호가 설정되어있어도,
부팅시 아무 설정없이 바로 MySQL DB를 사용할 수 있게 되죠
관리자 암호를 설정해주시고
실행을 누르시면
설정이 완료됩니다.
기본적으로, MySQL은 커맨드 라인 툴을 통해 동작하는데요,
보기만 해도 막막합니다
명령들을 알고 있는 상태에서는 상당히 편리한게 커맨드 라인이지만,
명령어를 모르는 상태에서는… 뭥미...
이럴 때, 도움을 주는 GUI툴이 MySQL Tools 입니다
<MySQL Tools 설치하기 >
기본 준비물 :
공식 홈페이지 : http://dev.mysql.com/downloads/gui-tools/5.0.html
Download Url : http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-gui-tools-5.0-r12-win32.msi/from/http://mysql.byungsoo.net/
설치는 다음 파일을 기준으로 합니다
mysql-gui-tools-5.0-r12-win32.msi
Next버튼과 완료 버튼만 누르면 설치 끝…
MySQL 메뉴에서 MySQL System Tray Monitor 를 선택하여 시작합니다
트레이 아이콘으로 서버 상태를 볼 수 있는데요,
위와 같이 톱니 모양에 빨간색 네모가 있으면
서버가 중지되어있는 상태입니다
Start Instance 를 선택하여 서버를 기동해 줍니다
MySQL이 Running 상태로 바뀌었습니다
이제 DB 설정을 하기 위해
MySQL Administrator 를 선택합니다
접속 화면입니다
DB가 설치된 PC에 Tools를 설치했기 때문에,
localhost 접속을 해줍니다
포트, 유저명과 패스워드는 MySQL 설치시 입력했던 것을
입력해줍니다.
실행된 화면입니다. 서버의 일반 사양을 보여주네요
유저를 설정하는 화면도 보이고
DB가 있는 경우에는 DB의 구조도 확인할 수 있습니다.
기타 사용에 대한 부분은 이후에 진행될 보드 설치 부분에서 다루도록 하죠.
이것으로, MySQL 설치가 완료 되었습니다.