Additional Info
|
I found some info lying around and thought it was worth sharing, as the question has been raised more than once.
"Amayeta SWF Encrypt", uses a protection method which involves nothing more than hiding. The Primary Method First, the original bytecode is moved into a new record (type=253), and a new record is created with the type and header of the original bytecode (12 or 59, which are DoAction and DoInitAction respectively). Because the type 253 doesn't correspond to an existing type, decompilers ignore it. Next, the original bytecode has nine bytes appended, which consist of two jumps:
In addition, amayeta adds a record of type 255 before the first 253 record; this "signature" record has consisted of a single byte of data, 0x20, in all of the protected SWFs the author has examined. ? Ancillary Methods A second obfuscation trick just places the code to be hidden in an instruction with an invalid opcode (0xFC). This instruction is then placed inside of the junk code. A bit of junk code followed by the old jump-into-middle-of-instruction trick to confuse decompilers. Simply removing this code (first 0x2A bytes) fixes it. Unprotect Method -=Click To Show=- The method of the unprotector is to convert a 253 record followed by a type 12 or 59 record into the corresponding 12 or 59 record, renumbering the original obfuscator's record to type 254. The type 59, DoInitAction record, contains an additional 16-bit word following its header to identify the sprite to which it refers; this word is copied to the type 253 record after the data is moved two bytes forward to accomodate. The ten bytes (or eight, in the case of fixed 59 records) where the jumps were located are filled with zeros to both terminate the ActionScript bytecode and clear the end of the record to avoid confusing a disassembler, without having to hassle with the resizing of records (which is the same reason for merely renaming instead of removing the inserted blocks of the obfuscator.) General working procedure:
? ? ? tags that contain code are:
? ? ? may contain code but are apparently not used:
? ? ? When there are multiple code blocks in one tag (for example multiple conditions on DefineButton2), ? ? ? the code is arranged as follows in the 253 tag: ? enter2_cond1: ? ? ? <code cond1> ? ? ? jmp ret1_cond1 ? enter1_cond1: ? ? ? jmp enter2_cond1 ? enter_cond2: ? ? ? <code cond2> ? ? ? jmp ret_cond2? ? ? ? ? ? ? ? ? -> return to junk code ? ? ? jmp enter_cond2? ? ? ? ? <- junk code jumps here ? ret1_cond1: ? ? ? jmp ret2_cond1? ? ? ? ? ? ? ? -> return to junk code ? ? ? ? ? ? jmp enter1_cond1? ? ? ? <- junk code jumps here I use this AoB tool to make all the AoBs I post. Try the online version if you dont feel like downloading it. |