Skip to content

Commit

Permalink
Update for Transformice 1.797
Browse files Browse the repository at this point in the history
  • Loading branch information
friedkeenan committed Jan 25, 2024
1 parent 71676f4 commit 1b8ffa8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
24 changes: 23 additions & 1 deletion src/leakers/Leaker.as
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down
12 changes: 9 additions & 3 deletions src/leakers/TransformiceLeaker.as
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1b8ffa8

Please sign in to comment.