|
分享源码
界面截图: |
|
是否带模块: |
纯源码 |
备注说明: |
- |
|
changeFileOwnership | 逻辑型 | | |
filename_ | 文本型 | | | | owneeraccountname_ | 文本型 | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | _sid | 字节集 | | | _nbuffersize | 整数型 | | | _szdomainname | 文本型 | | | _ndomain | 整数型 | | | _result | 整数型 | | | _peuse | 整数型 | | | _secdesc | SECURITY_DESCRIPTOR | | | _revision | 整数型 | | | _htoken | 整数型 | | | _psid | 整数型 | | |
_sid = 取空白字节集 (4096 )_szdomainname = 取空白文本 (4096 )_nbuffersize = 4096 _ndomain = 4096 _enablePrivilege ( #SE_RESTORE_NAME )_enablePrivilege ( #SE_BACKUP_NAME )_enablePrivilege ( #SE_SECURITY_NAME )_enablePrivilege ( #SE_TAKE_OWNERSHIP_NAME )如果 (是否为空 (owneeraccountname_ )) API_OpenProcessToken (API_GetCurrentProcess (), #TOKEN_ALL_ACCESS, _htoken )调试输出 (_getLogonSID (_htoken, _psid )) API_CloseHandle (_htoken )_result = API_LookupAccountName (0, owneeraccountname_, 取变量数据地址 (_sid ), _nbuffersize, _szdomainname, _ndomain, _peuse )如果真 (_result = 0 )调试输出 (“LookupAccountName Error”)返回 (假)_result = API_InitializeSecurityDescriptor (_secdesc, #SECURITY_DESCRIPTOR_REVISION )如果真 (_result = 0 )调试输出 (“InitializeSecurityDescriptor Error”)返回 (假)_result = API_SetSecurityDescriptorOwner (_secdesc, 选择 (是否为空 (owneeraccountname_), _psid, 取变量数据地址 (_sid)), 0)如果真 (_result = 0 )调试输出 (“SetSecurityDescriptorOwner Error”)返回 (假)_result = API_SetFileSecurity (filename_, #OWNER_SECURITY_INFORMATION, _secdesc)如果真 (_result = 0 )调试输出 (“SetFileSecurity Error”)返回 (假)_disablePrivilege ( #SE_RESTORE_NAME )_disablePrivilege ( #SE_BACKUP_NAME )_disablePrivilege ( #SE_SECURITY_NAME )_disablePrivilege ( #SE_TAKE_OWNERSHIP_NAME )返回 (真)|
_enablePrivilege | 逻辑型 | | |
privilege_ | 文本型 | | | | 返回 (_modifyPrivilegeState (privilege_, 真)) |
_disablePrivilege | 逻辑型 | | |
privilege_ | 文本型 | | | | 返回 (_modifyPrivilegeState (privilege_, 假)) |
_modifyPrivilegeState | 逻辑型 | | |
privilege_ | 文本型 | | | | enable_ | 逻辑型 | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | _htoken | 整数型 | | | _privilegeid | LUID | | | _myprives | TOKEN_PRIVILEGES | | | _result | 整数型 | | |
_result = API_OpenProcessToken (API_GetCurrentProcess (), #TOKEN_ADJUST_PRIVILEGES, _htoken )如果真 (_result = 0 )返回 (假)_result = API_LookupPrivilegeValue (0, privilege_, _privilegeid)如果真 (_result = 0 )返回 (假)_myprives.Privileges [1].pLuid = _privilegeid_myprives.PrivilegeCount = 1 _myprives.Privileges [1 ].Attributes = 选择 (enable_, #SE_PRIVILEGE_ENABLED, 0 )_result = API_AdjustTokenPrivileges (_htoken, 0, _myprives, 0, 0, 0 )如果真 (_result = 0 )返回 (假)API_CloseHandle (_htoken)返回 (真)|
_getLogonSID | 逻辑型 | | |
htoken_ | 整数型 | | | | ppsid_ | 整数型 | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | _bsuccess | 逻辑型 | | | _dwIndex | 整数型 | | | _dwLength | 整数型 | | | _ptg | 整数型 | | | API_GetTokenInformation (htoken_, #TokenGroups, _ptg, 0, _dwLength )_ptg = API_HeapAlloc (API_GetProcessHeap (), #HEAP_ZERO_MEMORY, _dwLength )API_GetTokenInformation (htoken_, #TokenGroups, _ptg, _dwLength, _dwLength ) 计次循环首 (指针到整数 (_ptg ), _dwIndex ) 如果真 (位与 (指针到整数 (_ptg + 8 × _dwIndex ), #SE_GROUP_LOGON_ID ) = #SE_GROUP_LOGON_ID )_dwLength = API_GetLengthSid (指针到整数 (_ptg + 8 × _dwIndex - 4 )) ppsid_ = API_HeapAlloc (API_GetProcessHeap (), #HEAP_ZERO_MEMORY, _dwLength )API_CopySid (_dwLength, ppsid_, 指针到整数 (_ptg + 8 × _dwIndex - 4 )) 跳出循环 ()
. 计次循环尾 ()返回 (真)
设置文件所有者.rar
(5.93 KB, 下载次数: 50)
|
|