| 64 | } |
| 65 | |
| 66 | bool RemoteProcess::setPrivilege(bool enable_privilege) { |
| 67 | TOKEN_PRIVILEGES tp; |
| 68 | LUID luid; |
| 69 | |
| 70 | if (!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &luid)) { |
| 71 | return false; |
| 72 | } |
| 73 | |
| 74 | tp.PrivilegeCount = 1; |
| 75 | tp.Privileges[0].Luid = luid; |
| 76 | if (enable_privilege) { |
| 77 | tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; |
| 78 | } |
| 79 | else { |
| 80 | tp.Privileges[0].Attributes = 0; |
| 81 | } |
| 82 | |
| 83 | AdjustTokenPrivileges(this->process_token, false, &tp, sizeof(TOKEN_PRIVILEGES), NULL, NULL); |
| 84 | |
| 85 | if (GetLastError() != 0L) { |
| 86 | return false; |
| 87 | } |
| 88 | |
| 89 | return true; |
| 90 | } |
| 91 | |
| 92 | void RemoteProcess::startRemoteThread(void) { |
| 93 | this->remote_thread = CreateRemoteThread( |