diff --git a/src/leakers/Leaker.as b/src/leakers/Leaker.as index 4de8a7e..76272d2 100644 --- a/src/leakers/Leaker.as +++ b/src/leakers/Leaker.as @@ -194,6 +194,23 @@ package leakers { } } + private static function has_security_error_method(description: XML) : Boolean { + for each (var method: * in description.elements("factory").elements("method")) { + var params: * = method.elements("parameter"); + if (params.length() != 1) { + continue; + } + + if (params[0].attribute("type") != "flash.events::SecurityErrorEvent") { + continue; + } + + return true; + } + + return false; + } + protected function is_socket_class(klass: Class) : Boolean { return klass == Socket; } @@ -273,7 +290,8 @@ package leakers { /* The connection class is the only one that only inherits from 'Object', doesn't implement any - interface, and has a non-static 'Socket' property. + interface, and has a method which accepts a + 'SecurityErrorEvent'. */ var klass: * = domain.getDefinition(class_name); @@ -295,6 +313,10 @@ package leakers { continue; } + if (!has_security_error_method(description)) { + continue; + } + var socket_prop_name: String = this.get_socket_property(domain, description); if (socket_prop_name == null) { continue; diff --git a/src/leakers/TransformiceLeaker.as b/src/leakers/TransformiceLeaker.as index bce79c8..3c8d78b 100644 --- a/src/leakers/TransformiceLeaker.as +++ b/src/leakers/TransformiceLeaker.as @@ -13,11 +13,17 @@ package leakers { var description: * = describeType(klass); for each (var method: * in description.elements("factory").elements("method")) { - if (method.attribute("returnType") == "flash.net::Socket") { - this.socket_getter = method.attribute("name"); + if (method.attribute("returnType") != "*") { + return false; + } - return true; + if (method.elements("parameter").length() != 0) { + return false; } + + this.socket_getter = method.attribute("name"); + + return true; } return false;