Advertisement
Guest User

Untitled

a guest
Jan 12th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.08 KB | None | 0 0
  1. Local $handlefromPID = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", 0x001F0FFF, "bool", 0, "dword", @AutoItPID)[0]
  2.  
  3. Local $trustee = DllStructCreate("int TrusteeForm;int TrusteeType")
  4. Local $dacl = DllStructCreate("int grfAccessMode;dword grfAccessPermissions;dword grfInheritance;int Trustee")
  5.  
  6. MsgBox(0,0,$dacl)
  7.  
  8. $setdataTrustee = DllStructSetData($trustee, "0", "1")
  9. $setdataacl = DllStructSetData($dacl, "6", "0x401FFFFF", "NO_INHERITANCE")
  10.  
  11. Local $result = SetSecurityInfo($handlefromPID, 6, 0x00000004, 0, 0, $setdataacl, 0)
  12.  
  13.  
  14. Func SetSecurityInfo($handle, $ObjectType, $SecurityInfo, $psidOwner, $psidGroup, $pDacl, $pSacl)
  15.         $call = DllCall("Advapi32.dll", "long", "SetSecurityInfo", _
  16.                         "ptr", $handle, _
  17.                         "int", $ObjectType, _
  18.                         "dword", $SecurityInfo, _
  19.                         "ptr", $psidOwner, _
  20.                         "ptr", $psidGroup, _
  21.                         "ptr", $pDacl, _
  22.                         "ptr", $pSacl)
  23.         Return $call[0]
  24. EndFunc   ;==>SetSecurityInfo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement