~/hooky

47d57e54be0751569f3505754d6e7c3a0bc1e5c2 — Arthur Melton dfc58611 2 years ago
beautify js
2 files changed, 34 insertions(+), 25 deletions(-)

M command/public/glue.js
M command/public/main.js
M command/public/glue.js => command/public/glue.js +20 -13
@@ 1,26 1,33 @@

const invoke = window.__TAURI__.invoke

export async function invokeGen(features, payload, sendTo) {
  document.getElementById("GenCover").style.display = "block";
  document.getElementById("setup").style.display = "none";
  await invoke("gen",
               {features : features, payload : payload, sendTo : sendTo});
  document.getElementById("GenCover").style.display = "none";
  document.getElementById("dashboard").style.display = "block";
    document.getElementById("GenCover").style.display = "block";
    document.getElementById("setup").style.display = "none";
    await invoke("gen", {
        features: features,
        payload: payload,
        sendTo: sendTo
    });
    document.getElementById("GenCover").style.display = "none";
    document.getElementById("dashboard").style.display = "block";
}

export async function isOn(
    id) { return await document.getElementById(id).checked;}
    id) {
    return await document.getElementById(id).checked;
}

export async function setPayload() {
  document.getElementById("payload").value =
      await window.__TAURI__.dialog.open();
    document.getElementById("payload").value =
        await window.__TAURI__.dialog.open();
}

export async function
getPayload() { return document.getElementById("payload").value;}
getPayload() {
    return document.getElementById("payload").value;
}

export async function getIp() {
  return document.getElementById("ip").value + ":" +
         document.getElementById("port").value;
}
    return document.getElementById("ip").value + ":" +
        document.getElementById("port").value;
}
\ No newline at end of file

M command/public/main.js => command/public/main.js +14 -12
@@ 1,19 1,21 @@

const invoke = window.__TAURI__.invoke

async function code() {
  document.getElementById("victim_exe").innerHTML =
      await invoke("victim_payload", {});
  while (true) {
    var get_new = await invoke("get_new", {});
    for (let i in get_new) {
      document.getElementById("victims").innerHTML =
          `<pre>${JSON.stringify(get_new[i], null, "\t")}</pre>` +
          document.getElementById("victims").innerHTML;
    document.getElementById("victim_exe").innerHTML =
        await invoke("victim_payload", {});
    while (true) {
        var get_new = await invoke("get_new", {});
        for (let i in get_new) {
            document.getElementById("victims").innerHTML =
                `<pre>${JSON.stringify(get_new[i], null, "\t")}</pre>` +
                document.getElementById("victims").innerHTML;
        }
        await sleep(5000);
    }
    await sleep(5000);
  }
}

function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
function sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}

code();
code();
\ No newline at end of file