########################## #!d:/usr/bin/perl.exe -w use Win32::API; my $op=pack('L',0); my $tr=pack("LL",0,0); my $xx=pack("LLLL",1,unpack("LL",$tr),0x02); my $wa=pack("LLLL",0,0,0,0); my $ui=length($wa); my $sd=pack('L',0); ######## my $gcp=Win32::API->new("kernel32" ,"GetCurrentProcess" ,[] ,'N'); my $opt=Win32::API->new("advapi32" ,"OpenProcessToken" ,[N,N,N] ,'N'); my $atp=Win32::API->new("advapi32" ,"AdjustTokenPrivileges" ,[N,N,P,N,P,N] ,'N'); my $lpv=Win32::API->new("advapi32" ,"LookupPrivilegValueA" ,[P,P,P] ,'N'); my $ewe=Win32::API->new("user32" ,"ExitWindowsEx" ,[N,N] ,'N'); ######## my $gh=$gcp->Call(); my $wo=$opt->Call($gh,0x20||0x08,$op); $wo=$lpv->Call('',"SeShutdownPrivilege",$tr); $wo=$atp->Call($op,0,$xx,$ui,$wa,$sd); ######## $ewe->Call(0x02,0);