Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cannot find decoder, proxy functions because of some empty statements #135

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

khanhnb
Copy link
Contributor

@khanhnb khanhnb commented Dec 14, 2023

This PR fixes the following errors when decoder functions contain empty statements:
err = TypeError: Failed to decode h, no decoder
err = Error: Push/shift calculation failed (iter=25>maxLoops=24)

Input to reproduce the error:

;(function (c, d) {
  var h = b,
    e = c()
  while (!![]) {
    try {
      var f =
        (-parseInt(h(0x7a)) / 0x1) * (-parseInt(h(0x78)) / 0x2) +
        (-parseInt(h(0x7e)) / 0x3) * (parseInt(h(0x77)) / 0x4) +
        -parseInt(h(0x7b)) / 0x5 +
        (-parseInt(h(0x7c)) / 0x6) * (-parseInt(h(0x75)) / 0x7) +
        (parseInt(h(0x76)) / 0x8) * (-parseInt(h(0x79)) / 0x9) +
        -parseInt(h(0x80)) / 0xa +
        parseInt(h(0x7f)) / 0xb
      if (f === d) break
      else e["push"](e["shift"]())
    } catch (g) {
      e["push"](e["shift"]())
    }
  }
})(a, 0xa005c)
function hi() {
  var i = b
  console["log"](i(0x7d))
}
hi()
// decoder function
function b(c, d) {
  ;
  ;
  var e = a()
// proxy function
  return (
    (b = function (f, g) {
      f = f - 0x75
      var h = e[f]
      return h
    }),
    b(c, d)
  )
}
function a() {
  ;
  ;
  var j = [
    "1263720pTqteZ",
    "4UVwcYM",
    "18RZHtoU",
    "45NcPTGE",
    "21026baFKTG",
    "5959055zOefdK",
    "76746cPNlrK",
    "Hello\x20World!",
    "3670650mEfMWw",
    "49556463VXYOgg",
    "11662950XTqwOX",
    "182LySSXZ"
  ]
  a = function () {
    return j
  }
  return a()
}

@relative
Copy link
Owner

thank you for your pr!

@relative relative merged commit 5d951b3 into relative:master Dec 18, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants