Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Once, I wrote something in Java, out of which you <strong>can't</strong> escape. Really impossible. It is for Windows. Here you go:</p> <pre><code>import java.awt.Robot; import javax.swing.JFrame; public class WindowsSecurity implements Runnable { private JFrame frame; private boolean running; public WindowsSecurity(JFrame yourFrame) { this.frame = yourFrame; new Thread(this).start(); } public void stop() { this.running = false; } public void run() { try { this.terminal.getParentFrame().setAlwaysOnTop(true); this.terminal.getParentFrame().setDefaultCloseOperation(0); kill("explorer.exe"); // Kill explorer Robot robot = new Robot(); int i = 0; while (running) { sleep(30L); focus(); releaseKeys(robot); sleep(15L); focus(); if (i++ % 10 == 0) { kill("taskmgr.exe"); } focus(); releaseKeys(robot); } Runtime.getRuntime().exec("explorer.exe"); // Restart explorer } catch (Exception e) { } } private void releaseKeys(Robot robot) { robot.keyRelease(17); robot.keyRelease(18); robot.keyRelease(127); robot.keyRelease(524); robot.keyRelease(9); } private void sleep(long millis) { try { Thread.sleep(millis); } catch (Exception e) { } } private void kill(String string) { try { Runtime.getRuntime().exec("taskkill /F /IM " + string).waitFor(); } catch (Exception e) { } } private void focus() { this.frame.grabFocus(); this.frame.requestFocus(); } } </code></pre> <p><strong>Background of this code:</strong> I wrote some kind of fake terminal in which I could let appear everything what I wanted. Eg, the stupid Windows messages like: "Keyboard not found, press any key to continue". I used it as a joke on school. Fire up this app and leave the room, it would log out the Windows account automatically after one minute. But I hadn't thought that there would be a teacher that used <kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>Del</kbd> to kill my application. He left a message in my personal documents in which he wrote what he did and ended his message with "I've beaten you, haha I'm evil". So, I wanted to go in competition with him. And then wrote this code. He tried more than five times in school to escape from the app, but he couldn't (I can't as well :D). Of course he could turn off the machine or log out. But the target was to access my personal documents.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload