1 |
#!/usr/bin/perl |
#!/usr/bin/perl |
2 |
|
|
3 |
# fluscate.pl 0.03 - The Flash Obfuscator |
# fluscate.pl 0.04 - The Flash Obfuscator |
4 |
|
|
5 |
# $Id$ |
# $Id$ |
6 |
# $Log$ |
# $Log$ |
7 |
|
# Revision 1.5 2004/07/26 16:11:58 joko |
8 |
|
# updated pod |
9 |
|
# included more complete list of flash event-handlers |
10 |
|
# fixed substitution regex #1: now using spaces around function names |
11 |
|
# |
12 |
|
# Revision 1.4 2004/07/26 13:51:54 joko |
13 |
|
# updated pod |
14 |
|
# |
15 |
# Revision 1.3 2004/07/23 12:56:07 joko |
# Revision 1.3 2004/07/23 12:56:07 joko |
16 |
# updated pod |
# updated pod |
17 |
# |
# |
48 |
|
|
49 |
=head1 Features |
=head1 Features |
50 |
|
|
51 |
|
|
52 |
|
=head2 Obfuscation |
53 |
|
|
54 |
|
See ASO Pro: http://www.genable.com/aso/preview.html |
55 |
|
|
56 |
|
|
57 |
=head2 Functions |
=head2 Functions |
58 |
|
|
59 |
fluscate handles two different styles of function declarations: |
fluscate handles two different styles of function declarations: |
106 |
branchIfTrue ls" |
branchIfTrue ls" |
107 |
... after each "constants" declaration (->pollute) |
... after each "constants" declaration (->pollute) |
108 |
- what about other symbols beside "function"s? (e.g. variables) (->mode) |
- what about other symbols beside "function"s? (e.g. variables) (->mode) |
109 |
|
- include list of ->keywords from: |
110 |
|
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/ |
111 |
|
- replace symbols in multiple files (->multifile) |
112 |
|
|
113 |
=head2 Notes |
=head2 Notes |
114 |
|
|
121 |
- "getMember" and "getVariable" also do function calls! |
- "getMember" and "getVariable" also do function calls! |
122 |
- there are reserved function names which must not be replaced! (-> event handlers, e.g. "onPress") |
- there are reserved function names which must not be replaced! (-> event handlers, e.g. "onPress") |
123 |
|
|
124 |
|
|
125 |
|
=head1 Links |
126 |
|
|
127 |
|
=head2 ActionScript Decompilers / Disassemblers |
128 |
|
|
129 |
|
Flasm: |
130 |
|
http://www.nowrap.de/flasm.html |
131 |
|
http://www.opaque.net/~dave/flasm/ |
132 |
|
Flare: http://www.nowrap.de/flare.html |
133 |
|
Sothink SWF Decompiler: http://www.srctec.com/flashdecompiler/ |
134 |
|
Imperator FLA: http://www.ave-imperator.com/ |
135 |
|
SWF Decompiler: http://www.19.5degs.com/swfdecompiler.php |
136 |
|
Gordon: http://www.futurecandy.com/ |
137 |
|
|
138 |
|
=head2 ActionScript Editors & Co. |
139 |
|
|
140 |
|
URL Action Editor and Actionscript Viewer: |
141 |
|
http://www.buraks.com/ |
142 |
|
http://voisen.org/archives/2003/02/uae_303_and_asv_309.php |
143 |
|
SE|PY ActionScript Editor: http://www.sephiroth.it/python/sepy.php |
144 |
|
|
145 |
|
=head2 Obfuscators |
146 |
|
|
147 |
|
ASO Pro (ActionScript Obfuscator Pro): http://www.genable.com/aso/preview.html |
148 |
|
SWOB (swf obfuscator): http://home.byu.net/jtb64/Swob.htm |
149 |
|
OBFU - A Flash Actionscript obfuscator: http://opaque.net/~dave/obfu/ |
150 |
|
|
151 |
|
=head2 Misc |
152 |
|
|
153 |
|
ActionScript Protection: |
154 |
|
http://www.as-protect.com/ |
155 |
|
http://www.quasimondo.com/archives/000377.php |
156 |
|
Developer's SWF Guardian: http://anyrd.anyorganization.com/ |
157 |
|
Password Busting / SWF Protections: http://www.searchlores.org/cinix_fla.htm |
158 |
|
|
159 |
|
=head2 Off-Topic |
160 |
|
|
161 |
|
XPath for Actionscript and other stuff: http://www.xfactorstudio.com/Actionscript/ |
162 |
|
SerializerClass: http://sourceforge.net/projects/serializerclass/ |
163 |
|
AMF::Perl - Flash Remoting in Perl and Python - using Flash Remoting protocol (AMF): |
164 |
|
http://simonf.com/amfperl/ |
165 |
|
PEAR::SWF - Read and write SWF head tag: http://www.sephiroth.it/test/php/SWF/ |
166 |
|
AMFPHP - Flash Remoting for PHP: http://www.amfphp.org/ |
167 |
|
|
168 |
=cut |
=cut |
169 |
|
|
170 |
|
|
178 |
'function_stacked' => 'function(?:2|)\s\s\(.*?\)', |
'function_stacked' => 'function(?:2|)\s\s\(.*?\)', |
179 |
'push' => 'push\s\'(.+?)\'', |
'push' => 'push\s\'(.+?)\'', |
180 |
}; |
}; |
181 |
my @symbols_events = qw( onPress onReleaseOutside onRelease onMouseDown onEnterFrame ); |
my @symbols_events = qw( |
182 |
|
onDragOut |
183 |
|
onDragOver |
184 |
|
onKeyUp |
185 |
|
onKeyDown |
186 |
|
onKillFocus |
187 |
|
onPress |
188 |
|
onRelease |
189 |
|
onReleaseOutside |
190 |
|
onRollOut |
191 |
|
onRollOver |
192 |
|
onSetFocus |
193 |
|
onActivity |
194 |
|
onStatus |
195 |
|
onSelect |
196 |
|
onData |
197 |
|
onLoad |
198 |
|
allowDomain |
199 |
|
allowInsecureDomain |
200 |
|
onMouseDown |
201 |
|
onMouseMove |
202 |
|
onMouseUp |
203 |
|
onMouseWheel |
204 |
|
onEnterFrame |
205 |
|
onUnload |
206 |
|
onLoadComplete |
207 |
|
onLoadError |
208 |
|
onLoadInit |
209 |
|
onLoadProgress |
210 |
|
onLoadStart |
211 |
|
onID3 |
212 |
|
onSoundComplete |
213 |
|
onResize |
214 |
|
onChanged |
215 |
|
onScroller |
216 |
|
); |
217 |
my @symbols; |
my @symbols; |
218 |
|
|
219 |
# 1. read flasm code from STDIN |
# 1. read flasm code from STDIN |
256 |
|
|
257 |
# function declarations; single quotes might not be there! |
# function declarations; single quotes might not be there! |
258 |
if (m/$regex->{function}/) { |
if (m/$regex->{function}/) { |
259 |
s/'*$symbol'*/'$symbol_counter'/i; |
s/\s'*$symbol'*\s/ '$symbol_counter' /i; |
260 |
|
|
261 |
# "constants"-line at begin of each block; single quotes should already be there |
# "constants"-line at begin of each block; single quotes should already be there |
262 |
} elsif (m/$regex->{constants}/) { |
} elsif (m/$regex->{constants}/) { |