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

numbro 1.9.3 not usable after obfuscation #271

Closed
quentint opened this issue Jun 1, 2018 · 12 comments

Comments

Projects
None yet
2 participants
@quentint
Copy link

commented Jun 1, 2018

Expected Behavior

numbro should remain functional after obfuscation.

Current Behavior

numbro breaks after obfuscation.

Steps to Reproduce (for bugs)

  1. Get numbro 1.9.3 (haven't tried other versions yet): https://github.com/BenjaminVanRyseghem/numbro/blob/1.9.3/dist/numbro.js
  2. Paste in https://obfuscator.io/
  3. Run generated JS in console
  4. Run numbro(12).format('0,0')
  5. Throws Uncaught TypeError: Cannot read property 'marker' of undefined

Your Environment

Version 67.0.3396.62 (Official Build) (64-bit)

@sanex3339

This comment has been minimized.

Copy link
Collaborator

commented Jun 1, 2018

Ok for me.
image

what obfuscator options did you use?

@sanex3339

This comment has been minimized.

Copy link
Collaborator

commented Jun 1, 2018

Upd: reproduced with some options

@quentint

This comment has been minimized.

Copy link
Author

commented Jun 1, 2018

You're fast :)

Here are my options:

image

@sanex3339

This comment has been minimized.

Copy link
Collaborator

commented Jun 1, 2018

It breaks when transformObjectKeys option is enabled

@quentint

This comment has been minimized.

Copy link
Author

commented Jun 1, 2018

Good catch.

@sanex3339 sanex3339 added this to the 0.17.0 milestone Jun 1, 2018

@sanex3339

This comment has been minimized.

Copy link
Collaborator

commented Jun 1, 2018

Found the problem.
Following code

(function () {
    const object = {foo: 'foo'},
        variable = object.foo;
})();

with transformObjectKeys obfuscating to this code:

(function () {
    const _0x3c1d66 = {}, _0x53248b = _0x3c1d66['foo'];
    _0x3c1d66['foo'] = 'foo';
}());
@sanex3339

This comment has been minimized.

Copy link
Collaborator

commented Jun 1, 2018

Know how to fix it. Expect fix in a next few days.

@quentint

This comment has been minimized.

Copy link
Author

commented Jun 2, 2018

@sanex3339

This comment has been minimized.

Copy link
Collaborator

commented Jun 4, 2018

Fix in master branch. Until release (few weeks) you can use version from master branch.

@sanex3339

This comment has been minimized.

Copy link
Collaborator

commented Jun 5, 2018

Right now i disabled transformation keys of object that was declated in variable declarators and that using inside other variable declarator inside same variable declaration

@sanex3339 sanex3339 added the fixed label Jun 27, 2018

@sanex3339

This comment has been minimized.

Copy link
Collaborator

commented Jun 27, 2018

0.17.0 version in out!

@sanex3339 sanex3339 closed this Jun 27, 2018

@quentint

This comment has been minimized.

Copy link
Author

commented Jul 2, 2018

Thanks a bunch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.