From bf7c9d9e65e54aa1c7867f3cc9ec095812648b56 Mon Sep 17 00:00:00 2001 From: Joonas Trussmann Date: Sat, 24 Sep 2022 03:39:48 +0300 Subject: [PATCH] Update exploit.js --- src/exploit.js | 60 +------------------------------------------------- 1 file changed, 1 insertion(+), 59 deletions(-) diff --git a/src/exploit.js b/src/exploit.js index ef138ed..3281f8d 100644 --- a/src/exploit.js +++ b/src/exploit.js @@ -271,64 +271,7 @@ async function lock(path) { } -async function hardlock(path) { - console.log("This will attempt to flash back stock FW (without any real verification) and reset secure_debug and dm_verity. Type 'yes' to confirm?") - return confirm() - .then(() => { - return identifyDevice(path) - .then(() => { - console.log("sending flash command for first slot") - return shell(` - umount /proc/cmdline || true - update_engine --update_package=/cache/ota.zip - reboot`) - }) - .then(() => { - console.log("waiting 2 minutes (30 seconds spare on just flash v2 goggles) for the flash to complete") - return sleep(120000) - }) - .then(() => { - port = new SerialPort({path: portPath, baudRate}) - }) - .then(() => { - console.log("sending flash command for second slot") - return shell(` - umount /proc/cmdline || true - update_engine --update_package=/cache/ota.zip - reboot`) - }) - .then(() => { - console.log("waiting 2 minutes (30 seconds spare on just flash v2 goggles) for the flash to complete") - return sleep(120000) - }) - .then(() => { - port = new SerialPort({path: portPath, baudRate}) - }) - .then(patch) - .then(()=> { - const config = configs[device].debug - config.data = Buffer.from("00000E00AF5C5F2800295F2FAF4849444A490000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FF0000000000000000000000880AEE0E01D4E85374710961DECE84176BF1F91800000000000000000000000000000000000000000000000000000000", "hex") - - //config.data = Uint8Array.from(Buffer.from("00000E00AF5C5F2800295F2FAF4849444A490000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FF0000000000000000000000880AEE0E01D4E85374710961DECE84176BF1F91800000000000000000000000000000000000000000000000000000000", "hex")) - return talk(port, config, false) - .then((result) => { - console.log(result) - port.close() - console.log("hardlock should be done, power cycle your device") - console.log("you can use 'shell reboot' and verify nothing happens") - console.log("you should get:") - console.log("harry, i'm sorry, you're not a wizard") - process.exit(0) - }) - }) - .catch((error)=> { - console.log(error) - process.exit(1) - }) - }) - -} function makeShellPayload(script) { @@ -347,6 +290,5 @@ function makeShellPayload(script) { module.exports.unlock = unlock -module.exports.hardlock = hardlock module.exports.lock = lock -module.exports.doShell = doShell \ No newline at end of file +module.exports.doShell = doShell