From: Jay Freeman (saurik) Date: Fri, 10 Jan 2014 08:04:21 +0000 (-0800) Subject: Filter chosen objects to those of the right size. X-Git-Tag: v0.9.500~82 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/c4fb5e261e9f928105f9259c0d1d55e657c49dc4 Filter chosen objects to those of the right size. --- diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index 9a7ab86..7b0785a 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -2241,9 +2241,13 @@ static void choose_(task_t task, void *baton, unsigned type, vm_range_t *ranges, Class isa(reinterpret_cast(pointers[0])); #endif - if (choice->query_.find(isa) == choice->query_.end()) + std::set::const_iterator result(choice->query_.find(isa)); + if (result == choice->query_.end()) continue; + // XXX: if (size < class_getInstanceSize(*result)) + if ((class_getInstanceSize(*result) + 15) / 16 * 16 != size) + continue; CYArrayPush(context, choice->results_, CYCastJSValue(context, reinterpret_cast(data))); } }