Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !include LogicLib.nsh
- !define TOKEN_ADJUST_PRIVILEGES 0x0020
- !define SE_PRIVILEGE_ENABLED 0x00000002
- !define SE_DEBUG_NAME SeDebugPrivilege
- Function AdjustProcessTokenPrivileges
- System::Store "S r2"
- System::Call 'kernel32::GetCurrentProcess()i.s'
- System::Call 'advapi32::OpenProcessToken(is, i ${TOKEN_ADJUST_PRIVILEGES},*i.r1)i.r0?e'
- ${If} $0 <> 0
- pop $0 ;throw away GLE
- System::Call 'advapi32::LookupPrivilegeValue(tn,tr2,*l.r2)i.r0?e'
- ${If} $0 <> 0
- System::Call "*(i 1,l r2,i ${SE_PRIVILEGE_ENABLED},is)i.r2" ;last member=throw away GLE
- System::Call 'advapi32::AdjustTokenPrivileges(ir1,i0,ir2,i0,i0,i0)i?e'
- System::Free $2
- ${EndIf}
- System::Call 'kernel32::CloseHandle(ir1)'
- ${EndIf}
- System::Store L
- FunctionEnd
- section
- Push SeDebugPrivilege
- call AdjustProcessTokenPrivileges
- pop $0
- DetailPrint error=$0
- sectionend
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement