@@ -18,12 +18,12 @@ class ObfuscateJS
18
18
#
19
19
# The 'Symbols' argument should have the following format:
20
20
#
21
- # {
22
- # 'Variables' => [ 'var1', ... ],
23
- # 'Methods' => [ 'method1', ... ],
24
- # 'Namespaces' => [ 'n', ... ],
25
- # 'Classes' => [ { 'Namespace' => 'n', 'Class' => 'y'}, ... ]
26
- # }
21
+ # {
22
+ # 'Variables' => [ 'var1', ... ],
23
+ # 'Methods' => [ 'method1', ... ],
24
+ # 'Namespaces' => [ 'n', ... ],
25
+ # 'Classes' => [ { 'Namespace' => 'n', 'Class' => 'y'}, ... ]
26
+ # }
27
27
#
28
28
# Make sure you order your methods, classes, and namespaces by most
29
29
# specific to least specific to prevent partial substitution. For
@@ -138,14 +138,14 @@ def obfuscate(opts = {})
138
138
# while (buf.length < len)
139
139
# buf << set[rand(set.length)].chr
140
140
# end
141
- #
141
+ #
142
142
# buf
143
143
#}
144
144
end
145
145
146
146
# Remove our comments
147
147
remove_comments
148
-
148
+
149
149
# Globally replace symbols
150
150
replace_symbols ( @opts [ 'Symbols' ] ) if @opts [ 'Symbols' ]
151
151
@@ -191,9 +191,9 @@ def replace_symbols(symbols)
191
191
next if symbols [ symtype ] . nil?
192
192
symbols [ symtype ] . each { |sym |
193
193
dyn = Rex ::Text . rand_text_alpha ( rand ( 32 ) +1 ) until dyn and not taken . key? ( dyn )
194
-
194
+
195
195
taken [ dyn ] = true
196
-
196
+
197
197
if symtype == 'Classes'
198
198
full_sym = sym [ 'Namespace' ] + "." + sym [ 'Class' ]
199
199
@dynsym [ full_sym ] = dyn
0 commit comments