In Vista, How Does the FLAGS Switch of REG.EXE Work? 비스타에서는 어떻게 플래그 스위치 Reg.exe 작업의? Part 2 제 2 부
Note: this content originally from 참고 :이 내용은 원래부터 http://mygreenpaste.blogspot.com http://mygreenpaste.blogspot.com . . If you are reading it from some other site, please take the time to visit 만약 다른 사이트에서 사이트를 방문하려면 시간이 걸릴 제발 읽고있다 My Green Paste, Inc 내 초록색 붙여넣기, Inc의 . . Thank you. 감사합니다.
Previously 이전 , I wrote about the FLAGS switch for REG.EXE in Vista and covered a technique that would set the virtualization-related flags of a registry key programmatically. 내가 비스타에서 Reg.exe에 대한 플래그 설정 스위치에 대해 쓴 및 가상화 기법 - 프로그래밍 관련 레지스트리 키를의 깃발 덮여있다. This post intends to cover the other side - querying for the virtualization-related flags of a registry key. 이 게시물은 다른 측면 커버하겠다는 - 가상화 기술에 대한 질의 - 레지스트리 키를의 관련 플래그. Again, we're dealing with an "undocumented" function in NTDLL.DLL - NtQueryKey: 다시 한 번, 우리 NTDLL.DLL에 "문서화"기능을 다루고있는거야 - NtQueryKey :
NTSTATUS NtQueryKey( NTSTATUS NtQueryKey (
IN HANDLE KeyHandle, 손잡이 KeyHandle,
IN KEY_INFORMATION_CLASS KeyInformationClass, KEY_INFORMATION_CLASS KeyInformationClass,
OUT PVOID KeyInformation, 밖 PVOID KeyInformation,
IN ULONG Length ULONG 길이
OUT PULONG ResultLength ); PULONG ResultLength);
To retrieve the flags for a key, call NtQueryKey with KeyInformationClass set to 5, which WDM.h tells us is KeyFlagsInformation. 열쇠, 전화 NtQueryKey KeyInformationClass와 5는 우리 WDM.h 설정에 대한 플래그를 검색하려면 KeyFlagsInformation임을 알립니다.
typedef enum _KEY_INFORMATION_CLASS { 열거 형식 _KEY_INFORMATION_CLASS (
KeyBasicInformation, KeyBasicInformation,
KeyNodeInformation, KeyNodeInformation,
KeyFullInformation, KeyFullInformation,
KeyNameInformation, KeyNameInformation,
KeyCachedInformation, KeyCachedInformation,
KeyFlagsInformation, KeyFlagsInformation,
KeyVirtualizationInformation, KeyVirtualizationInformation,
MaxKeyInfoClass // MaxKeyInfoClass should always be the last enum MaxKeyInfoClass / / MaxKeyInfoClass은 항상 마지막으로 열거해야한다
} KEY_INFORMATION_CLASS ) KEY_INFORMATION_CLASS
REG.EXE supplies 12 for the value of the Length param, and the last 4 bytes of the buffer (KeyInformation) are modified when NtQueryKey returns. Reg.exe 길이 param 속성의 가치를 위해, 그리고 버퍼 (KeyInformation)의 마지막 4 바이트가 바뀌었을 때 12 소모품 NtQueryKey 반환합니다. This would seem to suggest that the struct to receive the information containing the virtualization flags looks something like: 즉, 정보가 포함된 가상화 플래그를받을 것이라고 struct 제안할 것처럼 보이는 :
typedef struct _KEY_FLAGS_INFO { 형식 _KEY_FLAGS_INFO struct (
ULONG unknown1; ULONG unknown1;
ULONG unknown2; ULONG unknown2;
ULONG ControlFlags; ULONG ControlFlags;
} KEY_FLAGS_INFO, *PKEY_FLAGS_INFO; ) KEY_FLAGS_INFO, * PKEY_FLAGS_INFO;
Putting it all together, then, we have something like: 모두 함께 다음, 그것을 씌우고, 우리는 같은 것을 가지고 :
typedef NTSYSAPI NTSTATUS (NTAPI* FuncNtQueryKey)( HANDLE KeyHandle, KEY_INFORMATION_CLASS KeyInformationClass, PVOID KeyInformation, ULONG Length, PULONG ResultLength ); 형식 NTSYSAPI NTSTATUS (NTAPI * FuncNtQueryKey) (오스 KeyHandle, KEY_INFORMATION_CLASS KeyInformationClass, PVOID KeyInformation, ULONG 길이, PULONG ResultLength);
// ... / / ...
FuncNtQueryKey ntqk = (FuncNtQueryKey)GetProcAddress( GetModuleHandle( _T("ntdll.dll") ), "NtQueryKey" ); FuncNtQueryKey ntqk = (FuncNtQueryKey) GetProcAddress를 (GetModuleHandle (_T ( "Ntdll.dll은")), "NtQueryKey");
KEY_FLAGS_INFO kfi = {0}; KEY_FLAGS_INFO kfi = (0);
HKEY hTheKey = NULL; HKEY hTheKey = NULL로;
RegOpenKeyEx( HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Whatever"), 0, KEY_ALL_ACCESS, &hTheKey ); RegOpenKeyEx (HKEY_LOCAL_MACHINE을, _T ( "소프트웨어 \ \ 뭐든지"), 0, KEY_ALL_ACCESS, & hTheKey);
DWORD dwResultLen = 0; DWORD를 dwResultLen = 0;
DWORD dwNtqkResult = ntqk( hTheKey , KeyFlagsInformation, &kfi, sizeof( KEY_FLAGS_INFO ), &dwResultLen ); DWORD를 dwNtqkResult = ntqk (KeyFlagsInformation, & hTheKey kfi,에서는 sizeof (KEY_FLAGS_INFO), & dwResultLen);
RegCloseKey( hTheKey ); RegCloseKey (hTheKey);
hTheKey = NULL; hTheKey = NULL로;
The flags (_CONTROL_FLAGS, from 국기 (_CONTROL_FLAGS에서 Part 1 제 1 부 ) are stored as a bitmask in kfi.ControlFlags. ) kfi.ControlFlags에서 비트 마스크로 저장됩니다.
typedef enum _CONTROL_FLAGS { 열거 형식 _CONTROL_FLAGS (
RegKeyClearFlags = 0, RegKeyClearFlags = 0,
RegKeyDontVirtualize = 2, RegKeyDontVirtualize = 2,
RegKeyDontSilentFail = 4, RegKeyDontSilentFail = 4,
RegKeyRecurseFlag = 8 = 8 RegKeyRecurseFlag
} CONTROL_FLAGS; ) CONTROL_FLAGS;
The code above provides the same information as invoking REG.EXE FLAGS HKLM\Software\Whatever QUERY. 위의 코드 Reg.exe 플래그 HKLM의 호출과 같은 정보를 제공합니다 \ 소프트웨어 \ 어떤 쿼리입니다.
Again - note that this exploration was done on Windows Vista SP1. 다시 - 참고 사항이 탐사를 윈도우 비스타 SP1에서 이루어졌다. I would expect the content here to also apply to Windows Vista (no SP) as well as Windows Server 2008, but...Popularity: 2% 내가 여기 또한 Windows Vista (SP)에뿐만 아니라 윈도우 서버 2008,하지만 ... 인기에 적용할 : 2 %의 콘텐츠를 기대하는 것이
Written by «/\/\Ø|ö±ò\/»®©. «지음 / \ / \ ~ | à ¶  ± ² \ / » ®  ©. Read more great feeds at is source 읽기에서 더 많은 훌륭한 피드 소스입니다 WEBSITE 웹사이트
no comments 덧글 없음 . .
Read more articles on 에 대한 자세한 기사를 읽기 Sysinternals Forum Sysinternals 포럼 and 및 registry virtualization 레지스트리 가상화 and 및 reg.exe flags Reg.exe 플래그 and 및 NtQueryKey NtQueryKey and 및 REG_KEY_DONT_VIRTUALIZE REG_KEY_DONT_VIRTUALIZE and 및 flags 플래그 and 및 vista 비스타 and 및 otherSoftware otherSoftware and 및 REG_KEY_DONT_SILENT_FAIL REG_KEY_DONT_SILENT_FAIL and 및 reg 등록 and 및 Virtualization 가상화 . .
- [+] Digg [+] 디그 : Feature this article :이 문서는 기능
- [+] Del.icio.us [+] Del.icio.us : Bookmark this article : 북마크이 문서가
- [+] Furl [+] Furl : Bookmark this article : 북마크이 문서















