diff --git a/.github/workflows/smoke_test.yml b/.github/workflows/smoke_test.yml index de5ebf97..b905254d 100644 --- a/.github/workflows/smoke_test.yml +++ b/.github/workflows/smoke_test.yml @@ -100,10 +100,8 @@ jobs: - name: Check Ahmyth Result shell: bash # This sample should have 39 behaviors with 100% confidence. - # Rule 00015 is currently detected with 80% confidence because PyEval fails - # to track byte arrays (issue #889: https://github.com/ev-flow/quark-engine/issues/889). run: | - if [ "${{ env.Ahmyth_RESULT }}" == "38" ]; then + if [ "${{ env.Ahmyth_RESULT }}" == "39" ]; then exit 0 else exit 1 diff --git a/quark/core/struct/registerobject.py b/quark/core/struct/registerobject.py index f979ddb6..280eb506 100644 --- a/quark/core/struct/registerobject.py +++ b/quark/core/struct/registerobject.py @@ -119,7 +119,7 @@ def bears_object(self) -> bool: False otherwise. :rtype: bool """ - return self.current_type is None or self.current_type.startswith("L") + return self.current_type is None or self.current_type.startswith(("L", "[")) def iterateInvolvedCalls(self) -> Generator[MethodCall, None, None]: """ diff --git a/tests/core/struct/test_registerobject.py b/tests/core/struct/test_registerobject.py index 2bd33a75..0f7dea97 100644 --- a/tests/core/struct/test_registerobject.py +++ b/tests/core/struct/test_registerobject.py @@ -43,10 +43,18 @@ def test_value(self, standard_register_obj): def test_bears_object(self): reg_with_object = RegisterObject("value", value_type="Ljava/lang/String;") reg_with_primitive = RegisterObject("value", value_type="I") + reg_with_array = RegisterObject("value", value_type="[B") + reg_with_object_array = RegisterObject( + "value", value_type="[Ljava/lang/String;" + ) + reg_with_multi_dim_array = RegisterObject("value", value_type="[[B") reg_with_none = RegisterObject("value", value_type=None) assert reg_with_object.bears_object() is True assert reg_with_primitive.bears_object() is False + assert reg_with_array.bears_object() is True + assert reg_with_object_array.bears_object() is True + assert reg_with_multi_dim_array.bears_object() is True assert reg_with_none.bears_object() is True def test_iterate_involved_calls_returns_nested_calls(self):