mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-11 23:34:04 +09:00
test malicious code
This commit is contained in:
4
assets/test_malicious.js
Normal file
4
assets/test_malicious.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
println(_TVDOS.VERSION); // sanity check
|
||||||
|
try { cmdHistory.push("lol haxxxxxx"); } catch(_) {}
|
||||||
|
try { CURRENT_DRIVE = "B"; } catch(_) {}
|
||||||
|
return "XwX";
|
||||||
@@ -20,7 +20,7 @@ function print_prompt_text() {
|
|||||||
con.color_pair(0,253);
|
con.color_pair(0,253);
|
||||||
print(" \\"+shell_pwd.join("\\").substring(1)+" ");
|
print(" \\"+shell_pwd.join("\\").substring(1)+" ");
|
||||||
if (errorlevel != 0) {
|
if (errorlevel != 0) {
|
||||||
con.color_pair(211,253);
|
con.color_pair(166,253);
|
||||||
print("["+errorlevel+"] ");
|
print("["+errorlevel+"] ");
|
||||||
}
|
}
|
||||||
con.color_pair(253,255);
|
con.color_pair(253,255);
|
||||||
@@ -397,10 +397,11 @@ if (goInteractive) {
|
|||||||
try {
|
try {
|
||||||
errorlevel = 0; // reset the number
|
errorlevel = 0; // reset the number
|
||||||
errorlevel = shell.execute(cmdbuf);
|
errorlevel = shell.execute(cmdbuf);
|
||||||
|
if (isNaN(errorlevel)) errorlevel = 2;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
printerrln("\n"+e);
|
printerrln("\n"+e);
|
||||||
if (errorlevel === 0 || errorlevel === undefined) {
|
if (errorlevel === 0 || isNaN(errorlevel)) {
|
||||||
errorlevel = 1; // generic failure
|
errorlevel = 1; // generic failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -409,6 +410,7 @@ if (goInteractive) {
|
|||||||
cmdHistory.push(cmdbuf);
|
cmdHistory.push(cmdbuf);
|
||||||
|
|
||||||
cmdHistoryScroll = 0;
|
cmdHistoryScroll = 0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user