require cryptable to be checked if using shellcode.

This commit is contained in:
KingKDot
2026-05-17 22:14:11 -05:00
parent bab5054b47
commit a91cb0c51f
2 changed files with 41 additions and 2 deletions
+31
View File
@@ -501,9 +501,38 @@ function applyCryptableMode(enabled) {
if (upxC) upxC.classList.add("hidden");
}
updateShellcodeCheckboxVisibility();
saveFormSettings();
}
function applyCryptableShellcodeGate() {
const cryptableOn = !!document.getElementById("cryptable-mode")?.checked;
const setGate = (checkboxId, hintId) => {
const cb = document.getElementById(checkboxId);
const hint = document.getElementById(hintId);
if (!cb) return;
const label = cb.closest("label");
if (cryptableOn) {
cb.disabled = false;
label?.classList.remove("opacity-40", "pointer-events-none");
if (hint) hint.classList.add("hidden");
} else {
if (cb.checked) {
cb.checked = false;
cb.dispatchEvent(new Event("change", { bubbles: true }));
}
cb.disabled = true;
label?.classList.add("opacity-40", "pointer-events-none");
if (hint) hint.classList.remove("hidden");
}
};
setGate("donut-mode", "donut-cryptable-hint");
setGate("linux-shellcode-mode", "linux-sc-cryptable-hint");
}
function updateShellcodeCheckboxVisibility() {
const selected = Array.from(document.querySelectorAll('input[name="platform"]:checked')).map((el) => el.value);
const hasWindows = selected.some((p) => p.startsWith("windows-"));
@@ -515,6 +544,8 @@ function updateShellcodeCheckboxVisibility() {
const linuxScRow = document.getElementById("linux-sc-row");
if (linuxScRow) linuxScRow.classList.toggle("hidden", !hasLinuxAmd64);
applyCryptableShellcodeGate();
// SGN is only meaningful when there's shellcode to encode — i.e. Donut or
// Linux shellcode is enabled on a compatible platform.
const donutOn = document.getElementById("donut-mode")?.checked && hasWindows;