Skip to content
This repository has been archived by the owner on Dec 6, 2020. It is now read-only.

Commit

Permalink
Fix 'import as' bug (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Jun 27, 2019
1 parent 9829aa6 commit ebb2ae2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/obfuscator.py
Expand Up @@ -315,12 +315,10 @@ def _prepare_imports(self):
if que1:
# same for the next 4 steps
# Get random variable name
obf_name = generate_rand_str(self.strgen_type, len(que1.group(1)) * self.obf_len_constant)
real_namespace = que1.group(1)
obf_name = generate_rand_str(self.strgen_type, len(line.split(' as ')[1]) * self.obf_len_constant)
real_namespace = line.split(' as ')[1]
obf_dict[real_namespace] = obf_name

replaced += line.split('as')[0] + 'as ' + obf_name + '\n'

replaced += line.split(' as ')[0] + ' as ' + obf_name + '\n'
continue
#-------------------------------#
que2 = re.search(draft1, line)
Expand Down

0 comments on commit ebb2ae2

Please sign in to comment.