From aaa8e347ede9ccdfdb1622a3c7cd676d271986cb Mon Sep 17 00:00:00 2001 From: UnknownObject <38148526+UnknownObject000@users.noreply.github.com> Date: Sat, 17 Sep 2022 15:11:08 +0800 Subject: [PATCH] Delete NTV_05_RtlAdjustPrivilege directory --- .../NTV_05_RtlAdjustPrivilege.cpp | 35 ----- .../NTV_05_RtlAdjustPrivilege.vcxproj | 135 ------------------ .../NTV_05_RtlAdjustPrivilege.vcxproj.filters | 22 --- .../NTV_05_RtlAdjustPrivilege.vcxproj.user | 4 - 4 files changed, 196 deletions(-) delete mode 100644 NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.cpp delete mode 100644 NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.vcxproj delete mode 100644 NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.vcxproj.filters delete mode 100644 NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.vcxproj.user diff --git a/NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.cpp b/NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.cpp deleted file mode 100644 index 47c3ac7..0000000 --- a/NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// NTV_05_RtlAdjustPrivilege.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 -// - -#include - -//准备函数指针 -typedef UINT(CALLBACK* typeRtlAdjustPrivilege)(ULONG, BOOL, BOOL, PINT); - -//从ntdll.dll中获取函数,封装API -UINT RtlAdjustPrivilege(ULONG Privilege, BOOL bEnablePrivilege, BOOL IsThreadPrivilege, PINT PreviousValue) -{ - HMODULE hDll = GetModuleHandle(L"ntdll.dll"); - if (hDll == NULL) - return false; - typeRtlAdjustPrivilege func_RtlAdjustPrivilege = (typeRtlAdjustPrivilege)GetProcAddress(hDll, "RtlAdjustPrivilege"); - return func_RtlAdjustPrivilege(Privilege, bEnablePrivilege, IsThreadPrivilege, PreviousValue); -} - -//API函数的调用(以获取SeShutdownPrivilege为例) -void NtGetShutdown() -{ - int nEn = 0; - LUID luidPriv; - LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &luidPriv); - RtlAdjustPrivilege(luidPriv.LowPart, TRUE, FALSE, &nEn); - return; -} - -//测试用主函数——尝试关闭计算机 -int main() -{ - NtGetShutdown(); - ExitWindowsEx(EWX_SHUTDOWN, 0); - return 0; -} \ No newline at end of file diff --git a/NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.vcxproj b/NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.vcxproj deleted file mode 100644 index d6121a0..0000000 --- a/NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {eeaa3db2-5f86-4204-be11-608b75c963d7} - NTV05RtlAdjustPrivilege - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.vcxproj.filters b/NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.vcxproj.filters deleted file mode 100644 index 6e5b551..0000000 --- a/NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - 源文件 - - - \ No newline at end of file diff --git a/NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.vcxproj.user b/NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.vcxproj.user deleted file mode 100644 index 0f14913..0000000 --- a/NTV_05_RtlAdjustPrivilege/NTV_05_RtlAdjustPrivilege.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file