how does obfuscation and obfuscated code actually work?
Let's skip the ropes, I'm a software engineer, and I'd like to get started on SWF obfuscation. The one I encountered is Protector IV.V on Kongregate (protector-4point5_Secure.swf). When I look at it in a decompiler, I see stuff like this:
var x01 = -348 + x04x05();
while (x01 = eval("x01") + 709, eval("x01") == 786)
{
x01 = eval("x01") + 107;
break;
}
if (eval("x01") == 683)
{
x01 = eval("x01") - 108;
}
So it looks like valid bytecode since the decompiler doesn't crash, but it looks like garbage, keeps doing a huge amount of math with a variable named x01. My question is not what emits this or what can decode this because I saw it here in other topics. I'd like to know HOW it's done. Is this the actual bytecode that runs in Flash and this math adds up to some actual, useful code? Or is there some hidden AS code that changes the bytecode itself? What capability of the Flash VM do these obfuscators exploit?