-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
DeanEdward python unpacker offset problem #1616
Comments
@mFaou |
mFaou
added a commit
to mFaou/js-beautify
that referenced
this issue
Jan 11, 2019
…orrectly handled for non-minified scripts (issue beautifier#1616).
#1617 :) |
Fixed in #1617. |
I have a bug when use your def to unpack js code packed, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Hi,
The unpacker python script for DeanEdward packer doesn't correctly handle the begin and end offsets.
The result is that the unpacked code is not put at the right offset in the final script. Thus, it breaks the original script.
At line 28, it searches for the beginning offset with
source.replace(' ', '').find('eval(function(p,a,c,k,e,')
. However at line 30 when it copies the code withbeginstr = source[:mystr]
, it doesn't take into account the number of spaces. Thus, the unpacked code is put at a "random" place.For the end offset, the script starts the search at the beginning of the source code while it should be started after the begin offset.
Input
The code looked like this before beautification:
Expected Output
The code should have looked like this after beautification:
Actual Output
The code actually looked like this after beautification:
Steps to Reproduce
Use the last version (1.8.9) of jsbeautifier python version (the javascript seems correct)
Environment
OS: Linux
jsbeautifier 1.8.9
Settings
Default
Solution:
We can use a regex instead of the str.find function. This modified version of unpack.py fixes the bug:
The text was updated successfully, but these errors were encountered: