Skip to content

Instantly share code, notes, and snippets.

@c272
Last active July 2, 2019 20:08
Show Gist options
  • Save c272/dcd8c4c684b8a847f30ca6778ce048d7 to your computer and use it in GitHub Desktop.
Save c272/dcd8c4c684b8a847f30ca6778ce048d7 to your computer and use it in GitHub Desktop.
A terrible EZ_n lock solver, 500 characters.
function(ctx, args)
{
//ca = call arguments, r = response, ezs = ez index.
var ca={},r
var strs = "open unlock release 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97".split(" ")
//initially call func to get response.
function c() {
r = args.t.call(ca)
}
c()
//check for errors
function n(){return !r.includes("not the")}
//pwn the "ez_x" parameter
function pwn(ezs) {
for (var i=0; i<3; i++) {
ca[ezs] = strs[i]
c()
if (n()) break
}
}
for (;;) {
//done yet?
if (r.includes("Con")) return ca
//ez21
if (r.includes("Z_2"))
{
pwn("ez_21")
}
//ez35
else if (r.includes("Z_3"))
{
pwn("ez_35")
for (var i=0; i<10; i++) {
ca.digit = i
c()
if(n()) break
}
}
//ez40
else
{
pwn("ez_40")
//6-30
for (var i=3; i<28; i++) {
ca.ez_prime = parseInt(strs[i])
c()
if(n()) break
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment