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

Webcrack doesn't fully remove deadcode #57

Open
mobapedia opened this issue Feb 7, 2024 · 5 comments · May be fixed by #45
Open

Webcrack doesn't fully remove deadcode #57

mobapedia opened this issue Feb 7, 2024 · 5 comments · May be fixed by #45

Comments

@mobapedia
Copy link

This code obfuscated with obfuscator.io (high):

function hi() {
  console.log("Hello World!");
}
hi();

Returns this when deobfuscated:

function a() {
  console.log("Hello World!");
}
a();
(function () {
  function a() {
    var a;
    try {
      a = Function("return (function() {}.constructor(\"return this\")( ));")();
    } catch (b) {
      a = window;
    }
    return a;
  }
  var c = a();
  c.setInterval(b, 4000);
})();
@mobapedia
Copy link
Author

Not sure if this is the same issue but it also fails to deobfuscate this: https://agma.io/js/ag251.js?v=240

@j4k0xb
Copy link
Owner

j4k0xb commented Feb 7, 2024

cant reproduce from the example but its random if it works or not. removing dead code is a known issue: #44

Not sure if this is the same issue but it also fails to deobfuscate this: agma.io/js/ag251.js?v=240

this one is obfuscated multiple times in a row and has dead code, possibly a custom/forked version
image
image

@mobapedia
Copy link
Author

mobapedia commented Feb 9, 2024

The dead code is not removed when mangle variables is on. Otherwise it deobfuscates it fine.

Obfuscated multiple times makes sense. Webcrack usually works on forked versions of obfuscator.io.

Also, why wouldn't it work on code thats obfuscated multiple times?

@j4k0xb
Copy link
Owner

j4k0xb commented Feb 9, 2024

Also, why wouldn't it work on code thats obfuscated multiple times?

it usually works, but if there dead code is left over it could mess up the next deobfuscations completely (e.g. string array isnt found)
compared to a single obfuscation where at least some things succeed

@mobapedia
Copy link
Author

ah ok. it was probably a custom version then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants