<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<script src="static/wasm_exec.js"></script>
<script>
const go = new Go();
WebAssembly.instantiateStreaming(fetch("static/main.wasm"), go.importObject)
.then((result) => go.run(result.instance));
function check_flag() {
var flag = document.getElementById("flag").value;
console.log("你输入的 flag 是:");
console.log(flag);
if (document.getElementById("flag").value === "flag{this_1s_fake_f_l_A__g}") {
console.log("I have a gift for you!");
console.log(console.gift("ABCCDDEE", "AABBCCDDEE"));
alert("恭喜你,答对了!我想你应该知道 flag 是什么了 !");
} else {
alert("答错了,再想想吧!");
}
}
</script>
<body>
<input id="flag" type="text" />
<button id="btn" onclick="check_flag();" >Click</button>
</body>
</html>