| |
|
|
| Moin...
with whom Native-APIs ZwQuerySystemInformation and ZwSetSystemInformation there whom Parameter SYTEM_INFORMATION_CLASS. setting one this on SystemGlobalFlag, can globale Systemflags read or settle. has someone a Idea, what these individual ? Happen? very effect?
Greeting
Andreas |
|
|
| |
|
|
|
| Mmmh... I Have whom local, the are ? Happen? for Debugging. here time View source: CompileMarkSeparationDef @ZwQuerySystemInformation(4) !"NTDLL","ZwQuerySystemInformation"
Def @ZwSetSystemInformation(3) !"NTDLL","ZwSetSystemInformation"
DEF @LsaNtStatusToWinError(1) !"advapi32","LsaNtStatusToWinError"
DEF @FormatMessage(7) !"KERNEL32","FormatMessageA"
DEF @LookupPrivilegeValue(3) !"advapi32","LookupPrivilegeValueA" Ermittelt aus dem Namen eines Privilegs dessen Luid.
DEF @AdjustTokenPrivileges(6) !"advapi32","AdjustTokenPrivileges" Stellt Privilegien ein.
DEF @OpenProcessToken(3) !"advapi32","OpenProcessToken" Öffnet Einstellprozess.
DEF @GetCurrentProcess(0) !"kernel32","GetCurrentProcess" Ermittel das Handle des aktiven Prozesses.
DEF @CopyMemory(3) !"kernel32","RtlMoveMemory"
DEF @CloseHandle(1) !"kernel32","CloseHandle" Schließt ein Handle (Programm).
Declare AHRückgabe&,AHGETERROR_Buffer#,AHGETERROR_Buffer$
Declare Flags&,Fehler&,NT_FEhler&,Return&,LUID#,TOKEN_PRIVILEGES#
LET NT_Fehler&=@ZwQuerySystemInformation(9,@ADDR(Flags&),4,@ADDR(return&))
LET AHRückgabe&=@LsaNtStatusToWinError(NT_Fehler&)
Fehlercode_bestimmen
Addstring "Fehler bei ZwQuerySystemInformation: "+AHGETERROR_Buffer$
Addstring "Ausgelesene Flags: $"+@Hex$(Flags&)
Set_Privilege_Status "SeDebugPrivilege",$2
LET Flags&=$9
LET NT_Fehler&=@ZwSetSystemInformation(9,@ADDR(Flags&),4)
LET AHRückgabe&=@LsaNtStatusToWinError(NT_Fehler&)
Fehlercode_bestimmen
Addstring "Fehler bei ZwSetSystemInformation: "+AHGETERROR_Buffer$
LET NT_Fehler&=@ZwQuerySystemInformation(9,@ADDR(Flags&),4,@ADDR(return&))
LET AHRückgabe&=@LsaNtStatusToWinError(NT_Fehler&)
Fehlercode_bestimmen
Addstring "Fehler bei ZwQuerySystemInformation: "+AHGETERROR_Buffer$
Addstring "Ausgelesene Flags: $"+@Hex$(Flags&)
@Editbox("ZwQuerySystemInformation mit SystemGlobalFlag",1)
Proc Fehlercode_bestimmen
DIM AHGETERROR_Buffer#,32000
@FormatMessage($1000,0,AHRückgabe&,0,AHGETERROR_Buffer#,32000,0) Wandelt Fehlercode in Landesspezifische Message um.
Let AHGETERROR_Buffer$=@trim$(@STRING$(AHGETERROR_Buffer#,0))
Dispose AHGETERROR_Buffer#
Endproc
Proc Set_Privilege_Status
Parameters Privilege_name$,Aktive&
Declare NewState&,AH_Token_Handle&,LU_SYSTEM$
DIM TOKEN_PRIVILEGES#,16
DIM LUID#,8
Clear LUID#,LU_SYSTEM$
@LookupPrivilegeValue(@ADDR(LU_SYSTEM$),@ADDR(Privilege_name$),LUID#)
CLEAR AH_Token_Handle&
LET FEHLER&=@OpenProcessToken(@GetCurrentProcess(),$20,@ADDR(AH_Token_Handle&))
LONG TOKEN_PRIVILEGES#,0=1
LET NewState&=TOKEN_PRIVILEGES#
@CopyMemory(NewState&+4,LUID#,8)
LET NewState&=Aktive&
Clear Aktive&
IF @or(NewState&,$2)=NewState&
LET Aktive&=@or(AKTIVE&,$2)
Endif
IF @or(NewState&,$80000000)=NewState&
LET Aktive&=@or(AKTIVE&,$80000000)
Endif
LONG TOKEN_PRIVILEGES#,12=Aktive&
LET FEHLER&=@AdjustTokenPrivileges(AH_Token_Handle&,0,TOKEN_PRIVILEGES#,0,0,0)
If AH_TOKEN_Handle&<>0
@CLOSEHANDLE(AH_Token_Handle&)
endif
Dispose TOKEN_PRIVILEGES#
Dispose LUI class=s4 href='./../../Function-References/XProfan/endproc/'>endproc
and here The ? Happen?: [quote:6a25c38565] FLG_STOP_ON_EXCEPTION $1 FLG_SHOW_LDR_SNAPS $2 FLG_DEBUG_INITIAL_COMMAND $4 FLG_STOP_ON_HUNG_GUI 0x00000008 FLG_HEAP_ENABLE_TAIL_CHECK $10 FLG_HEAP_ENABLE_FREE_CHECK $20 FLG_HEAP_VALIDATE_PARAMETERS $40 FLG_HEAP_VALIDATE_ALL 0x00000080 FLG_POOL_ENABLE_TAIL_CHECK $100 FLG_POOL_ENABLE_FREE_CHECK $200 FLG_POOL_ENABLE_TAGGING $400 FLG_HEAP_ENABLE_TAGGING $800 FLG_USER_STACK_TRACE_DB $1000 FLG_KERNEL_STACK_TRACE_DB 0x00002000 FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000 FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000 FLG_IGNORE_DEBUG_PRIV 0x00010000 FLG_ENABLE_CSRDEBUG 0x00020000 FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000 FLG_DISABLE_PAGE_KERNEL_STACKS $80000 FLG_HEAP_ENABLE_CALL_TRACING $100000 FLG_HEAP_DISABLE_COALESCING $200000 FLG_ENABLE_CLOSE_EXCEPTIONS $400000 FLG_ENABLE_EXCEPTION_LOGGING $800000 FLG_ENABLE_DBGPRINT_BUFFERING $8000000 [/quote:6a25c38565] Greeting
Andreas |
|
|
| |
|
|