Skip to content

SWE-agent[bot] PR to fix: PyEval._invoke silently skips IndexError in certain pipeline#16

Draft
github-actions[bot] wants to merge 5 commits into
masterfrom
swe-agent-fix-#5-88563685
Draft

SWE-agent[bot] PR to fix: PyEval._invoke silently skips IndexError in certain pipeline#16
github-actions[bot] wants to merge 5 commits into
masterfrom
swe-agent-fix-#5-88563685

Conversation

@github-actions

@github-actions github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown

This is a PR opened by AI tool SWE Agent to close #5 (PyEval._invoke silently skips IndexError in certain pipeline).

Closes #5.

Thought process ('trajectory') of SWE-agent (click to expand)

🧑‍🚒 Response (0):

👀‍ Observation (0):

No matches found for "." in /quark-engine

🧑‍🚒 Response (1):

👀‍ Observation (1):

Found 451 matches for "*" in /quark-engine:
/quark-engine/codecov.yml
/quark-engine/README.md
/quark-engine/.travis.yml
/quark-engine/Pipfile.lock
/quark-engine/quark/__pycache__/__init__.cpython-311.pyc
/quark-engine/quark/logo.py
/quark-engine/quark/script/ares.py
/quark-engine/quark/script/frida/agent.js
/quark-engine/quark/script/frida/__init__.py
/quark-engine/quark/script/utils.py
/quark-engine/quark/script/__init__.py
/quark-engine/quark/script/objection.py
/quark-engine/quark/agent/prompts.py
/quark-engine/quark/agent/templates/index.html
/quark-engine/quark/agent/templates/artificial-intelligence.png
/quark-engine/quark/agent/quarkAgent.py
/quark-engine/quark/agent/static/js/chatbox.js
/quark-engine/quark/agent/static/css/style.css
/quark-engine/quark/agent/static/images/quark-logo.png
/quark-engine/quark/agent/agentTools.py
/quark-engine/quark/agent/__init__.py
/quark-engine/quark/agent/quarkAgentWeb.py
/quark-engine/quark/rules/sendLocation_SMS.json
/quark-engine/quark/report.py
/quark-engine/quark/evaluator/pyeval.py
/quark-engine/quark/evaluator/__init__.py
/quark-engine/quark/rulegeneration.py
/quark-engine/quark/webreport/generate.py
/quark-engine/quark/webreport/__init__.py
/quark-engine/quark/webreport/genrule_report_layout.html
/quark-engine/quark/webreport/analysis_report_layout.html
/quark-engine/quark/__init__.py
/quark-engine/quark/cli.py
/quark-engine/quark/freshquark.py
/quark-engine/quark/utils/logger.py
/quark-engine/quark/utils/pprint.py
/quark-engine/quark/utils/graph.py
/quark-engine/quark/utils/__init__.py
/quark-engine/quark/utils/weight.py
/quark-engine/quark/utils/regex.py
/quark-engine/quark/utils/colors.py
/quark-engine/quark/utils/tools.py
/quark-engine/quark/utils/output.py
/quark-engine/quark/config.py
/quark-engine/quark/forensic/forensic.py
/quark-engine/quark/forensic/__init__.py
/quark-engine/quark/forensic/vt_analysis.py
/quark-engine/quark/radiocontrast.py
/quark-engine/quark/core/apkpatcher.py
/quark-engine/quark/core/quark.py
/quark-engine/quark/core/analysis.py
/quark-engine/quark/core/shurikenapkinfo.py
/quark-engine/quark/core/struct/valuenode.py
/quark-engine/quark/core/struct/__init__.py
/quark-engine/quark/core/struct/tableobject.py
/quark-engine/quark/core/struct/bytecodeobject.py
/quark-engine/quark/core/struct/ruleobject.py
/quark-engine/quark/core/struct/registerobject.py
/quark-engine/quark/core/struct/methodobject.py
/quark-engine/quark/core/apkinfo.py
/quark-engine/quark/core/parallelquark.py
/quark-engine/quark/core/__init__.py
/quark-engine/quark/core/rzapkinfo.py
/quark-engine/quark/core/r2apkinfo.py
/quark-engine/quark/core/axmlreader/python.py
/quark-engine/quark/core/axmlreader/__init__.py
/quark-engine/quark/core/axmlreader/rizin/__init__.py
/quark-engine/quark/core/axmlreader/rizin/axml_definition
/quark-engine/quark/core/axmlreader/radare2/__init__.py
/quark-engine/quark/core/axmlreader/radare2/axml_definition
/quark-engine/quark/core/interface/__init__.py
/quark-engine/quark/core/interface/baseapkinfo.py
/quark-engine/tests/test_freshquark.py
/quark-engine/tests/script/test_ares.py
/quark-engine/tests/script/test_frida.py
/quark-engine/tests/script/rules/00193.json
/quark-engine/tests/script/rules/00068.json
/quark-engine/tests/script/test_script.py
/quark-engine/tests/script/test_objection.py
/quark-engine/tests/agent/test_quarkAgent.py
/quark-engine/tests/agent/conftest.py
/quark-engine/tests/agent/test_agentTools.py
/quark-engine/tests/conftest.py
/quark-engine/tests/evaluator/test_pyeval.py
/quark-engine/tests/webreport/test_generate.py
/quark-engine/tests/__init__.py
/quark-engine/tests/utils/test_colors.py
/quark-engine/tests/utils/test_weight.py
/quark-engine/tests/utils/test_regex.py
/quark-engine/tests/utils/test_output.py
/quark-engine/tests/utils/test_tools.py
/quark-engine/tests/utils/test_graph.py
/quark-engine/tests/utils/test_pprint.py
/quark-engine/tests/test_report.py
/quark-engine/tests/forensic/test_forensic.py
/quark-engine/tests/core/test_axmlreader.py
/quark-engine/tests/core/test_quark.py
/quark-engine/tests/core/json_report_sample.json
/quark-engine/tests/core/struct/test_bytecodeobject.py
/quark-engine/tests/core/struct/test_ruleobject.py
/quark-engine/tests/core/struct/test_methodobject.py
/quark-engine/tests/core/struct/test_registerobject.py
/quark-engine/tests/core/struct/test_valuenode.py
/quark-engine/tests/core/struct/test_tableobject.py
/quark-engine/tests/core/test_analysis.py
/quark-engine/tests/core/test_apkpatcher.py
/quark-engine/tests/core/test_rzapkinfo.py
/quark-engine/tests/core/test_apkinfo.py
/quark-engine/.pre-commit-config.yaml
/quark-engine/LICENSE
/quark-engine/docs/make.bat
/quark-engine/docs/Makefile
/quark-engine/docs/requirements.txt
/quark-engine/docs/source/integration.rst
/quark-engine/docs/source/quark-logo.png
/quark-engine/docs/source/malware_report.rst
/quark-engine/docs/source/install.rst
/quark-engine/docs/source/install_index.rst
/quark-engine/docs/source/conf.py
/quark-engine/docs/source/index.rst
/quark-engine/docs/build/html/genindex.html
/quark-engine/docs/build/html/index.html
/quark-engine/docs/build/html/search.html
/quark-engine/docs/build/html/.buildinfo
/quark-engine/docs/build/html/contribution.html
/quark-engine/docs/build/html/coding_style.html
/quark-engine/docs/build/html/dev.html
/quark-engine/docs/build/html/searchindex.js
/quark-engine/docs/build/html/_sources/contribution.rst.txt
/quark-engine/docs/build/html/_sources/install.rst.txt
/quark-engine/docs/build/html/_sources/coding_style.rst.txt
/quark-engine/docs/build/html/_sources/dev_index.rst.txt
/quark-engine/docs/build/html/_sources/index.rst.txt
/quark-engine/docs/build/html/_sources/dev.rst.txt
/quark-engine/docs/build/html/_sources/addRules.rst.txt
/quark-engine/docs/build/html/_static/underscore.js
/quark-engine/docs/build/html/_static/js/theme.js
/quark-engine/docs/build/html/_static/doctools.js
/quark-engine/docs/build/html/_static/css/badge_only.css
/quark-engine/docs/build/html/_static/css/theme.css
/quark-engine/docs/build/html/_static/jquery.js
/quark-engine/docs/build/html/_static/searchtools.js
/quark-engine/docs/build/html/_static/file.png
/quark-engine/docs/build/html/_static/minus.png
/quark-engine/docs/build/html/_static/basic.css
/quark-engine/docs/build/html/_static/plus.png
/quark-engine/docs/build/html/_static/language_data.js
/quark-engine/docs/build/html/_static/documentation_options.js
/quark-engine/docs/build/html/_static/pygments.css
/quark-engine/docs/build/html/dev_index.html
/quark-engine/docs/build/html/addRules.html
/quark-engine/docs/build/html/objects.inv
/quark-engine/docs/build/html/install.html
/quark-engine/docs/build/doctrees/dev_index.doctree
/quark-engine/docs/build/doctrees/environment.pickle
/quark-engine/docs/build/doctrees/index.doctree
/quark-engine/docs/build/doctrees/coding_style.doctree
/quark-engine/docs/build/doctrees/install.doctree
/quark-engine/docs/build/doctrees/contribution.doctree
/quark-engine/docs/build/doctrees/addRules.doctree
/quark-engine/docs/build/doctrees/dev.doctree
/quark-engine/setup.py
/quark-engine/Pipfile
/quark-engine/bandit.yml
/quark-engine/.github/workflows/ai-issue-solver/demos/fix-incorrect-opcode-naming/fix-incorrect-opcode-naming.yaml
/quark-engine/.github/workflows/ai-issue-solver/sweagent.yaml
/quark-engine/.github/workflows/ai-issue-solver/tools/apk_downloader/config.yaml
/quark-engine/.github/workflows/ai-issue-solver/tools/apk_downloader/bin/download_sample_apk
/quark-engine/.github/workflows/ai-issue-solver/tools/quark_rules_downloader/config.yaml
/quark-engine/.github/workflows/ai-issue-solver/tools/quark_rules_downloader/bin/download_quark_rules
/quark-engine/.github/workflows/kali-package.dockerfile
/quark-engine/.github/workflows/docker-publish.yml
/quark-engine/.github/workflows/github-release-issue-pr.yml
/quark-engine/.github/workflows/pythonpublish.yml
/quark-engine/.github/workflows/github-release-draft.yml
/quark-engine/.github/workflows/kali-package.yml
/quark-engine/.github/workflows/ai-issue-solver.yml
/quark-engine/.github/workflows/pytest.yml
/quark-engine/.github/workflows/docker-image.yml
/quark-engine/.github/workflows/smoke_test.yml
/quark-engine/.github/workflows/codeql-analysis.yml
/quark-engine/.github/ISSUE_TEMPLATE/custom.md
/quark-engine/.github/ISSUE_TEMPLATE/bug_report.md
/quark-engine/.github/ISSUE_TEMPLATE/feature_request.md
/quark-engine/quark_engine.egg-info/dependency_links.txt
/quark-engine/quark_engine.egg-info/requires.txt
/quark-engine/quark_engine.egg-info/SOURCES.txt
/quark-engine/quark_engine.egg-info/top_level.txt
/quark-engine/quark_engine.egg-info/PKG-INFO
/quark-engine/quark_engine.egg-info/entry_points.txt
/quark-engine/.readthedocs.yaml
/quark-engine/.codacy.yml
/quark-engine/.gitignore
/quark-engine/Dockerfile
/quark-engine/.git/HEAD
/quark-engine/.git/logs/HEAD
/quark-engine/.git/logs/refs/remotes/origin/test_update_doc
/quark-engine/.git/logs/refs/remotes/origin/ai-issue-solver
/quark-engine/.git/logs/refs/remotes/origin/feature_enhance_behavior_map
/quark-engine/.git/logs/refs/remotes/origin/add_ability_to_execute_method
/quark-engine/.git/logs/refs/remotes/origin/add_shuriken_core
/quark-engine/.git/logs/refs/remotes/origin/v25.11.1_memory_limited
/quark-engine/.git/logs/refs/remotes/origin/swe-agent-fix-#2-72001824
/quark-engine/.git/logs/refs/remotes/origin/lazy_invoked_state
/quark-engine/.git/logs/refs/remotes/origin/swe-agent-fix-#5-94067619
/quark-engine/.git/logs/refs/remotes/origin/fix_valueerror_with_negative_apk_score
/quark-engine/.git/logs/refs/remotes/origin/release/v22.2.1
/quark-engine/.git/logs/refs/remotes/origin/release/21.12.1
/quark-engine/.git/logs/refs/remotes/origin/release/v22.3.1
/quark-engine/.git/logs/refs/remotes/origin/release/v22.5.1
/quark-engine/.git/logs/refs/remotes/origin/release/v22.7.1
/quark-engine/.git/logs/refs/remotes/origin/release/v22.4.1
/quark-engine/.git/logs/refs/remotes/origin/update_parser_for_rizin_0.4
/quark-engine/.git/logs/refs/remotes/origin/add_toxicpanda_report
/quark-engine/.git/logs/refs/remotes/origin/fix_specify_rules
/quark-engine/.git/logs/refs/remotes/origin/prepare_to_release_debian_package_v21.10.2
/quark-engine/.git/logs/refs/remotes/origin/fix_json_report
/quark-engine/.git/logs/refs/remotes/origin/fix_support_standard_api_format
/quark-engine/.git/logs/refs/remotes/origin/fix-indicate_the_compatible_Rizin_version
/quark-engine/.git/logs/refs/remotes/origin/fix-specify-version-for-dependencies
/quark-engine/.git/logs/refs/remotes/origin/update_smoke_test_for_SMS_message_ruleset
/quark-engine/.git/logs/refs/remotes/origin/dev
/quark-engine/.git/logs/refs/remotes/origin/for_test
/quark-engine/.git/logs/refs/remotes/origin/fix/update_README
/quark-engine/.git/logs/refs/remotes/origin/fix/missing_blank_line_in_doc
/quark-engine/.git/logs/refs/remotes/origin/fix/specify_the_Meson_version_to_0.62.0
/quark-engine/.git/logs/refs/remotes/origin/update_the_responsibility_of_core_library_team
/quark-engine/.git/logs/refs/remotes/origin/swe-agent-fix-#4-60182413
/quark-engine/.git/logs/refs/remotes/origin/support_multidex
/quark-engine/.git/logs/refs/remotes/origin/adjust_score_with_ai
/quark-engine/.git/logs/refs/remotes/origin/update_parser_for_rizin_v0.3.x
/quark-engine/.git/logs/refs/remotes/origin/swe-agent-fix-#5-34659551
/quark-engine/.git/logs/refs/remotes/origin/swe-agent-fix-#4-94205640
/quark-engine/.git/logs/refs/remotes/origin/swe-agent-fix-#5-74465369
/quark-engine/.git/logs/refs/remotes/origin/method_execution_api_with_demo_script
/quark-engine/.git/logs/refs/remotes/origin/swe-agent-fix-#2-50670988
/quark-engine/.git/logs/refs/remotes/origin/support_multidex_for_rizin_0.4
/quark-engine/.git/logs/refs/remotes/origin/add_doc_for_basebridge
/quark-engine/.git/logs/refs/remotes/origin/test_shuriken_win
/quark-engine/.git/logs/refs/remotes/origin/feat/quark_script_for_cwe_926
/quark-engine/.git/logs/refs/remotes/origin/feat/add_quark_script_case_for_cwe_780
/quark-engine/.git/logs/refs/remotes/origin/feat/update_readme
/quark-engine/.git/logs/refs/remotes/origin/feat/support_recursive_loading_of_rules
/quark-engine/.git/logs/refs/remotes/origin/feat/quark_script_for_cwe_89
/quark-engine/.git/logs/refs/remotes/origin/feat/update_doc_for_quark_script_APIs_to_detect_CWE-749
/quark-engine/.git/logs/refs/remotes/origin/feat/quark_script
/quark-engine/.git/logs/refs/remotes/origin/feat/quark_script_for_detecting_register_value_comparison
/quark-engine/.git/logs/refs/remotes/origin/feat/quark_script_hook_with_frida
/quark-engine/.git/logs/refs/remotes/origin/feat/quark_script_cwe312_test
/quark-engine/.git/logs/refs/remotes/origin/feat/quark_script_for_cwe_749
/quark-engine/.git/logs/refs/remotes/origin/feat/quark_script_for_cwe_327
/quark-engine/.git/logs/refs/remotes/origin/feat/quark_script_for_cve_2020-14125
/quark-engine/.git/logs/refs/remotes/origin/for_rule_adjust
/quark-engine/.git/logs/refs/remotes/origin/add_cwe_327_showcase_link_to_readme
/quark-engine/.git/logs/refs/remotes/origin/master
/quark-engine/.git/logs/refs/remotes/origin/fix_issue_301
/quark-engine/.git/logs/refs/remotes/origin/fix_pyeval
/quark-engine/.git/logs/refs/remotes/origin/fix_dvm
/quark-engine/.git/logs/refs/remotes/origin/swe-agent-fix-#2-99765813
/quark-engine/.git/logs/refs/remotes/origin/action_enhancement
/quark-engine/.git/logs/refs/remotes/origin/add_showcase_to_README
/quark-engine/.git/logs/refs/remotes/origin/swe-agent-fix-#4-07936308
/quark-engine/.git/logs/refs/remotes/origin/disable_assert_check
/quark-engine/.git/logs/refs/remotes/origin/add_automatic_installation_for_rizin
/quark-engine/.git/logs/refs/remotes/origin/add_doc_for_droidkungfu
/quark-engine/.git/logs/refs/remotes/origin/add_readthedocs_conf_file
/quark-engine/.git/logs/refs/remotes/origin/update_isj_command_parser
/quark-engine/.git/logs/refs/remotes/origin/feature_add_stage_3_info
/quark-engine/.git/logs/refs/remotes/origin/patch_abnormal_apk
/quark-engine/.git/logs/refs/remotes/origin/add_shuriken_core_lib
/quark-engine/.git/logs/refs/remotes/origin/Update_README_for_the_link_to_the_Quark_Script_document_of_CWE_780
/quark-engine/.git/logs/refs/remotes/origin/fix_update_for_new_rizin
/quark-engine/.git/logs/refs/remotes/origin/rz_lib_0.7.3
/quark-engine/.git/logs/refs/remotes/origin/swe-agent-fix-#4-57350964
/quark-engine/.git/logs/refs/remotes/origin/ci/update_smoke_tests_for_rules_for_contact_info_accessing
/quark-engine/.git/logs/refs/remotes/origin/remove_dependency_kaleido_temporarily
/quark-engine/.git/logs/refs/remotes/origin/update_member_page
/quark-engine/.git/logs/refs/remotes/origin/tighten_prettytable
/quark-engine/.git/logs/refs/remotes/origin/fix_smoke_test
/quark-engine/.git/logs/refs/remotes/origin/add_doc_for_golddream
/quark-engine/.git/logs/refs/remotes/origin/pr/sidra-asa/690
/quark-engine/.git/logs/refs/remotes/origin/swe-agent-fix-#4-30084029
/quark-engine/.git/logs/refs/remotes/origin/flowchart
/quark-engine/.git/logs/refs/remotes/origin/test_README
/quark-engine/.git/logs/refs/remotes/origin/swe-agent-fix-#2-81923856
/quark-engine/.git/logs/refs/remotes/origin/release_22.1.1
/quark-engine/.git/logs/refs/remotes/origin/detect_slocker_behavior_fail
/quark-engine/.git/logs/refs/remotes/origin/fix_scan_extended_class
/quark-engine/.git/logs/refs/heads/master
/quark-engine/.git/index
/quark-engine/.git/config
/quark-engine/.git/info/exclude
/quark-engine/.git/objects/pack/pack-c408d5035657968d041c99f225511132cee436d7.idx
/quark-engine/.git/objects/pack/pack-dfa56f28371ee7e2da81bf440c7d4615c31d8d31.rev
/quark-engine/.git/objects/pack/pack-dfa56f28371ee7e2da81bf440c7d4615c31d8d31.pack
/quark-engine/.git/objects/pack/pack-c408d5035657968d041c99f225511132cee436d7.pack
/quark-engine/.git/objects/pack/pack-c408d5035657968d041c99f225511132cee436d7.rev
/quark-engine/.git/objects/pack/pack-dfa56f28371ee7e2da81bf440c7d4615c31d8d31.idx
/quark-engine/.git/config.worktree
/quark-engine/.git/ORIG_HEAD
/quark-engine/.git/shallow
/quark-engine/.git/hooks/push-to-checkout.sample
/quark-engine/.git/hooks/fsmonitor-watchman.sample
/quark-engine/.git/hooks/pre-receive.sample
/quark-engine/.git/hooks/pre-applypatch.sample
/quark-engine/.git/hooks/post-update.sample
/quark-engine/.git/hooks/sendemail-validate.sample
/quark-engine/.git/hooks/pre-commit.sample
/quark-engine/.git/hooks/commit-msg.sample
/quark-engine/.git/hooks/prepare-commit-msg.sample
/quark-engine/.git/hooks/applypatch-msg.sample
/quark-engine/.git/hooks/pre-rebase.sample
/quark-engine/.git/hooks/pre-merge-commit.sample
/quark-engine/.git/hooks/update.sample
/quark-engine/.git/hooks/pre-push.sample
/quark-engine/.git/refs/remotes/origin/test_update_doc
/quark-engine/.git/refs/remotes/origin/ai-issue-solver
/quark-engine/.git/refs/remotes/origin/feature_enhance_behavior_map
/quark-engine/.git/refs/remotes/origin/add_ability_to_execute_method
/quark-engine/.git/refs/remotes/origin/add_shuriken_core
/quark-engine/.git/refs/remotes/origin/v25.11.1_memory_limited
/quark-engine/.git/refs/remotes/origin/swe-agent-fix-#2-72001824
/quark-engine/.git/refs/remotes/origin/lazy_invoked_state
/quark-engine/.git/refs/remotes/origin/swe-agent-fix-#5-94067619
/quark-engine/.git/refs/remotes/origin/fix_valueerror_with_negative_apk_score
/quark-engine/.git/refs/remotes/origin/release/v22.2.1
/quark-engine/.git/refs/remotes/origin/release/21.12.1
/quark-engine/.git/refs/remotes/origin/release/v22.3.1
/quark-engine/.git/refs/remotes/origin/release/v22.5.1
/quark-engine/.git/refs/remotes/origin/release/v22.7.1
/quark-engine/.git/refs/remotes/origin/release/v22.4.1
/quark-engine/.git/refs/remotes/origin/update_parser_for_rizin_0.4
/quark-engine/.git/refs/remotes/origin/add_toxicpanda_report
/quark-engine/.git/refs/remotes/origin/fix_specify_rules
/quark-engine/.git/refs/remotes/origin/prepare_to_release_debian_package_v21.10.2
/quark-engine/.git/refs/remotes/origin/fix_json_report
/quark-engine/.git/refs/remotes/origin/fix_support_standard_api_format
/quark-engine/.git/refs/remotes/origin/fix-indicate_the_compatible_Rizin_version
/quark-engine/.git/refs/remotes/origin/fix-specify-version-for-dependencies
/quark-engine/.git/refs/remotes/origin/update_smoke_test_for_SMS_message_ruleset
/quark-engine/.git/refs/remotes/origin/dev
/quark-engine/.git/refs/remotes/origin/for_test
/quark-engine/.git/refs/remotes/origin/fix/update_README
/quark-engine/.git/refs/remotes/origin/fix/missing_blank_line_in_doc
/quark-engine/.git/refs/remotes/origin/fix/specify_the_Meson_version_to_0.62.0
/quark-engine/.git/refs/remotes/origin/update_the_responsibility_of_core_library_team
/quark-engine/.git/refs/remotes/origin/swe-agent-fix-#4-60182413
/quark-engine/.git/refs/remotes/origin/support_multidex
/quark-engine/.git/refs/remotes/origin/adjust_score_with_ai
/quark-engine/.git/refs/remotes/origin/update_parser_for_rizin_v0.3.x
/quark-engine/.git/refs/remotes/origin/swe-agent-fix-#5-34659551
/quark-engine/.git/refs/remotes/origin/swe-agent-fix-#4-94205640
/quark-engine/.git/refs/remotes/origin/swe-agent-fix-#5-74465369
/quark-engine/.git/refs/remotes/origin/method_execution_api_with_demo_script
/quark-engine/.git/refs/remotes/origin/swe-agent-fix-#2-50670988
/quark-engine/.git/refs/remotes/origin/support_multidex_for_rizin_0.4
/quark-engine/.git/refs/remotes/origin/add_doc_for_basebridge
/quark-engine/.git/refs/remotes/origin/test_shuriken_win
/quark-engine/.git/refs/remotes/origin/feat/quark_script_for_cwe_926
/quark-engine/.git/refs/remotes/origin/feat/add_quark_script_case_for_cwe_780
/quark-engine/.git/refs/remotes/origin/feat/update_readme
/quark-engine/.git/refs/remotes/origin/feat/support_recursive_loading_of_rules
/quark-engine/.git/refs/remotes/origin/feat/quark_script_for_cwe_89
/quark-engine/.git/refs/remotes/origin/feat/update_doc_for_quark_script_APIs_to_detect_CWE-749
/quark-engine/.git/refs/remotes/origin/feat/quark_script
/quark-engine/.git/refs/remotes/origin/feat/quark_script_for_detecting_register_value_comparison
/quark-engine/.git/refs/remotes/origin/feat/quark_script_hook_with_frida
/quark-engine/.git/refs/remotes/origin/feat/quark_script_cwe312_test
/quark-engine/.git/refs/remotes/origin/feat/quark_script_for_cwe_749
/quark-engine/.git/refs/remotes/origin/feat/quark_script_for_cwe_327
/quark-engine/.git/refs/remotes/origin/feat/quark_script_for_cve_2020-14125
/quark-engine/.git/refs/remotes/origin/for_rule_adjust
/quark-engine/.git/refs/remotes/origin/add_cwe_327_showcase_link_to_readme
/quark-engine/.git/refs/remotes/origin/master
/quark-engine/.git/refs/remotes/origin/fix_issue_301
/quark-engine/.git/refs/remotes/origin/fix_pyeval
/quark-engine/.git/refs/remotes/origin/fix_dvm
/quark-engine/.git/refs/remotes/origin/swe-agent-fix-#2-99765813
/quark-engine/.git/refs/remotes/origin/action_enhancement
/quark-engine/.git/refs/remotes/origin/add_showcase_to_README
/quark-engine/.git/refs/remotes/origin/swe-agent-fix-#4-07936308
/quark-engine/.git/refs/remotes/origin/disable_assert_check
/quark-engine/.git/refs/remotes/origin/add_automatic_installation_for_rizin
/quark-engine/.git/refs/remotes/origin/add_doc_for_droidkungfu
/quark-engine/.git/refs/remotes/origin/add_readthedocs_conf_file
/quark-engine/.git/refs/remotes/origin/update_isj_command_parser
/quark-engine/.git/refs/remotes/origin/feature_add_stage_3_info
/quark-engine/.git/refs/remotes/origin/patch_abnormal_apk
/quark-engine/.git/refs/remotes/origin/add_shuriken_core_lib
/quark-engine/.git/refs/remotes/origin/Update_README_for_the_link_to_the_Quark_Script_document_of_CWE_780
/quark-engine/.git/refs/remotes/origin/fix_update_for_new_rizin
/quark-engine/.git/refs/remotes/origin/rz_lib_0.7.3
/quark-engine/.git/refs/remotes/origin/swe-agent-fix-#4-57350964
/quark-engine/.git/refs/remotes/origin/ci/update_smoke_tests_for_rules_for_contact_info_accessing
/quark-engine/.git/refs/remotes/origin/remove_dependency_kaleido_temporarily
/quark-engine/.git/refs/remotes/origin/update_member_page
/quark-engine/.git/refs/remotes/origin/tighten_prettytable
/quark-engine/.git/refs/remotes/origin/fix_smoke_test
/quark-engine/.git/refs/remotes/origin/add_doc_for_golddream
/quark-engine/.git/refs/remotes/origin/pr/sidra-asa/690
/quark-engine/.git/refs/remotes/origin/swe-agent-fix-#4-30084029
/quark-engine/.git/refs/remotes/origin/flowchart
/quark-engine/.git/refs/remotes/origin/test_README
/quark-engine/.git/refs/remotes/origin/swe-agent-fix-#2-81923856
/quark-engine/.git/refs/remotes/origin/release_22.1.1
/quark-engine/.git/refs/remotes/origin/detect_slocker_behavior_fail
/quark-engine/.git/refs/remotes/origin/fix_scan_extended_class
/quark-engine/.git/refs/tags/v21.8.1
/quark-engine/.git/refs/tags/v20.08
/quark-engine/.git/refs/tags/v21.01.5
/quark-engine/.git/refs/tags/v20.11
/quark-engine/.git/refs/tags/v21.5.1
/quark-engine/.git/refs/tags/v21.3.2
/quark-engine/.git/refs/tags/v21.7.2
/quark-engine/.git/refs/tags/v21.4.3
/quark-engine/.git/refs/tags/v21.7.1
/quark-engine/.git/refs/tags/0.0.1
/quark-engine/.git/refs/tags/v21.4.2
/quark-engine/.git/refs/tags/v21.6.3
/quark-engine/.git/refs/tags/v21.3.4
/quark-engine/.git/refs/tags/v20.10
/quark-engine/.git/refs/tags/v19.10
/quark-engine/.git/refs/tags/v21.4.1
/quark-engine/.git/refs/tags/v21.01.3
/quark-engine/.git/refs/tags/v21.01.1
/quark-engine/.git/refs/tags/v21.01.2
/quark-engine/.git/refs/tags/v21.01.4
/quark-engine/.git/refs/tags/21.3.1
/quark-engine/.git/refs/tags/v20.04
/quark-engine/.git/refs/tags/v21.6.2
/quark-engine/.git/refs/tags/v21.6.1
/quark-engine/.git/refs/tags/v21.01.6
/quark-engine/.git/refs/tags/v21.02.2
/quark-engine/.git/refs/tags/v20.12
/quark-engine/.git/refs/tags/v21.02.1
/quark-engine/.git/refs/tags/v21.3.3
/quark-engine/.git/refs/tags/v20.01
/quark-engine/.git/refs/heads/master
/quark-engine/.git/description
/quark-engine/.git/FETCH_HEAD
/quark-engine/debian/quark-engine.links
/quark-engine/debian/quark-engine.install
/quark-engine/debian/changelog
/quark-engine/debian/copyright
/quark-engine/debian/control
/quark-engine/debian/rules
/quark-engine/debian/helper-script/quark
/quark-engine/debian/helper-script/freshquark
/quark-engine/debian/watch
/quark-engine/debian/quark-engine.triggers
/quark-engine/debian/source/format

🧑‍🚒 Response (2):

👀‍ Observation (2):

Here's the result of running `cat -n` on /quark-engine/quark/evaluator/pyeval.py:
   150	    def _invoke(self, instruction, look_up=False, skip_self=False):
   151	        """
   152	        Function call in Android smali code. It will check if the corresponding
   153	        table field has a value, if it does,
   154	        inserts its own function name into called_by_func column.
   155	        """
   156	
   157	        opcode, *regList, targetMethod = instruction
   158	        regIdxList = [int(r[1:]) for r in regList]
   159	
   160	        if look_up and len(regIdxList) > 0:
   161	            try:
   162	                targetMethod = self._lookup_implement(
   163	                    self.table_obj.getLatestRegValue(
   164	                        regIdxList[0]
   165	                    ).current_type,
   166	                    instruction[-1],
   167	                    skip_self=skip_self,
   168	                )
   169	            except ValueError as e:
   170	                log.exception(e)
   171	            except IndexError:
   172	                pass
   173	
   174	        valueOfRegList = []
   175	        # query the value from hash table based on register index.
   176	        for index in regIdxList:
   177	            if not self.table_obj.getRegValues(index):
   178	                # Insert a RegisterObject if one is missing.
   179	                # Therefore, we can trace the usage of this register.
   180	                self.table_obj.insert(
   181	                    index, RegisterObject(Primitive("", None))
   182	                )
   183	
   184	            value = self.table_obj.getLatestRegValue(index)
   185	            valueOfRegList.append(value.value)
   186	
   187	        # Check whether any argument is missing a value type.
   188	        argIdxWithoutType = [
   189	            idx
   190	            for idx, arg in enumerate(valueOfRegList)
   191	            if isinstance(arg, Primitive) and arg.value_type == ""
   192	        ]
   193	        if len(argIdxWithoutType) > 0:
   194	            # Set the missing value types based on the method's descriptor.
   195	            argTypes = (
   196	                []
   197	                if opcode.startswith("invoke-static")
   198	                else [targetMethod[: targetMethod.find("->")]]
   199	            )
   200	
   201	            rawArgTypes = targetMethod[
   202	                targetMethod.find("(") + 1 : targetMethod.find(")")
   203	            ].split(" ")
   204	            
   205	            for argType in rawArgTypes:
   206	                argTypes.append(argType)
   207	                if argType in ["J", "D"]:
   208	                    # Put long and double twice
   209	                    # because these types take up two registers.
   210	                    argTypes.append(argType)
   211	
   212	            for argIdx in argIdxWithoutType:
   213	                valueOfRegList[argIdx].value_type = argTypes[argIdx]
   214	
   215	        methodCall = MethodCall(targetMethod, tuple(valueOfRegList))
   216	
   217	        # insert the function and the parameter into called_by_func
   218	        for index in regIdxList:
   219	            # add the function name into each parameter table
   220	            value = self.table_obj.getLatestRegValue(index)
   221	            value.called_by_func = methodCall
   222	
   223	            if (
   224	                value.bears_object()
   225	                and value.current_type != "Ljava/lang/String;"
   226	            ):
   227	                # If the register bears an object, update its value to reflect
   228	                # the method invocation since the method may modify the
   229	                # internal state of the object.
   230	                value.value = methodCall
   231	
   232	        if not targetMethod.endswith(")V"):
   233	            # push the return value into ret_stack
   234	            self.ret_stack.append(methodCall)
   235	
   236	            # Extract the type of return value
   237	            self.ret_type = targetMethod[targetMethod.index(")") + 1 :]
   238	
   239	    def _move_result(self, instruction):
   240	
   241	        reg = instruction[1]
   242	        index = int(reg[1:])
   243	        try:
   244	            pre_ret = self.ret_stack.pop()
   245	            variable_object = RegisterObject(
   246	                value=pre_ret, value_type=self.ret_type
   247	            )
   248	            self.table_obj.insert(index, variable_object)
   249	            self.ret_type = ""
   250	        except IndexError as e:
   251	
   252	            log.exception(f"{e} in _move_result")
   253	
   254	    def _move_object(self, src_reg_idx: int, dest_reg_idx: int):
   255	        """
   256	        Move object from src_reg_idx to dest_reg_idx without creating new
   257	        RegisterObject. This allow both registers to point to the same object.
   258	        """
   259	        # Get the source object from the table
   260	        src_obj = self.table_obj.getLatestRegValue(src_reg_idx)

🧑‍🚒 Response (3):

👀‍ Observation (3):

Downloading sample APK from https://github.com/ev-flow/apk-samples/raw/refs/heads/master/malware-samples/Ahmyth.apk to /quark-engine...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Warning: Failed to open the file /quark-engine: Is a directory

  0  261k    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (23) client returned ERROR on write of 1369 bytes
Failed to download APK from https://github.com/ev-flow/apk-samples/raw/refs/heads/master/malware-samples/Ahmyth.apk.

🧑‍🚒 Response (4):

👀‍ Observation (4):

Downloading sample APK from https://github.com/ev-flow/apk-samples/raw/refs/heads/master/malware-samples/Ahmyth.apk to /quark-engine/Ahmyth.apk...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100  261k  100  261k    0     0   802k      0 --:--:-- --:--:-- --:--:--  802k
Successfully downloaded APK to /quark-engine/Ahmyth.apk.
-rw-r--r-- 1 root root 262K Mar  5 06:12 /quark-engine/Ahmyth.apk

🧑‍🚒 Response (5):

👀‍ Observation (5):

Found 2 matches for "filled-new-array" in /quark-engine:
/quark-engine/quark/evaluator/pyeval.py (1 matches)
/quark-engine/tests/evaluator/test_pyeval.py (1 matches)
End of matches for "filled-new-array" in /quark-engine

🧑‍🚒 Response (6):

👀‍ Observation (6):

Found 4 matches for "new-array" in /quark-engine/quark/evaluator/pyeval.py:
Line 58:            "new-array": self.NEW_ARRAY,
Line 80:        for ins in ("filled-new-array", "filled-new-array/range"):
Line 421:                "new-array()[({src0})",
Line 569:            self._invoke(instruction[:-1] + [f"new-array(){value_type}"])
End of matches for "new-array" in /quark-engine/quark/evaluator/pyeval.py

🧑‍🚒 Response (7):

👀‍ Observation (7):

Here's the result of running `cat -n` on /quark-engine/quark/evaluator/pyeval.py:
   520	    def AGET_KIND(self, instruction):
   521	        """
   522	        aget-kind vx,vy,vz
   523	
   524	        Gets an object reference value of an object reference array into vx. The array is referenced by vy and is
   525	        indexed by vz.
   526	
   527	        It means vx = vy[vz].
   528	        """
   529	
   530	        try:
   531	            if "-" in instruction[0] and "object" not in instruction[0]:
   532	                index = instruction[0].index("-") + 1
   533	                value_type = self.type_mapping[instruction[0][index:]]
   534	            else:
   535	                array_reg_index = int(instruction[2][1:])
   536	                value_type = self.table_obj.getLatestRegValue(
   537	                    array_reg_index
   538	                ).current_type
   539	                # If value_type is not None
   540	                if value_type:
   541	                    value_type = value_type[1:]
   542	
   543	            self._move_value_to_register(
   544	                instruction, "{src0}[{src1}]", wide=True, value_type=value_type
   545	            )
   546	        except IndexError as e:
   547	            log.exception(f"{e} in AGET_OBJECT")
   548	
   549	    @logger
   550	    def MOVE_KIND(self, instruction):
   551	        try:
   552	            if instruction[0].startswith("move-object"):
   553	                self._move_object(
   554	                    src_reg_idx=int(instruction[2][1:]),
   555	                    dest_reg_idx=int(instruction[1][1:]),
   556	                )
   557	                return
   558	
   559	            wide = "wide" in instruction[0]
   560	            self._move_value_to_register(instruction, "{src0}", wide=wide)
   561	        except IndexError as e:
   562	            log.exception(f"{e} in MOVE_KIND")
   563	
   564	    @logger
   565	    def FILLED_NEW_ARRAY_KIND(self, instruction):
   566	        value_type = instruction[-1]
   567	
   568	        try:
   569	            self._invoke(instruction[:-1] + [f"new-array(){value_type}"])
   570	        except IndexError as e:
   571	            log.exception(f"{e} in MOVE_KIND")
   572	
   573	    @logger
   574	    def AGET_WIDE_KIND(self, instruction):
   575	        array_reg_index = int(instruction[2][1:])
   576	
   577	
   578	        try:
   579	            array_reg = self.table_obj.getLatestRegValue(array_reg_index)
   580	            value_type = (
   581	                array_reg.current_type[1:] if array_reg.current_type else None
   582	            )
   583	            destination = int(instruction[1][1:])
   584	            source_list = [int(reg[1:]) for reg in instruction[2:]]
   585	
   586	            self._transfer_register(
   587	                source_list,
   588	                destination,
   589	                "{src0}[{src1}]",
   590	                value_type=value_type,
   591	            )
   592	            self._transfer_register(
   593	                source_list,
   594	                destination + 1,
   595	                "{src0}[{src1}]",
   596	                value_type=value_type,
   597	            )
   598	        except IndexError as e:
   599	            log.exception(f"{e} in {instruction[0]}")
   600	
   601	    @logger
   602	    def APUT_KIND(self, instruction):
   603	        try:
   604	            value, array_reference, index = instruction[1:]
   605	            self._move_value_to_register(
   606	                (None, array_reference, array_reference, index, value),
   607	                "{src0}[{src1}]:{src2}",
   608	            )
   609	        except IndexError as e:
   610	            log.exception(f"{e} in {instruction[0]}")
   611	
   612	    @logger
   613	    def APUT_WIDE_KIND(self, instruction):
   614	        try:
   615	            value, array_reference, index = instruction[1:]
   616	            self._move_value_to_register(
   617	                (
   618	                    None,
   619	                    array_reference,
   620	                    array_reference,

🧑‍🚒 Response (8):

👀‍ Observation (8):

Found 9 matches for "_invoke" in /quark-engine/quark/evaluator/pyeval.py:
Line 150:    def _invoke(self, instruction, look_up=False, skip_self=False):
Line 299:        self._invoke(instruction, look_up=True)
Line 309:        self._invoke(instruction)
Line 319:        self._invoke(instruction)
Line 329:        self._invoke(instruction, look_up=True)
Line 339:        self._invoke(instruction, look_up=True, skip_self=True)
Line 348:        self._invoke(instruction)
Line 357:        self._invoke(instruction)
Line 569:            self._invoke(instruction[:-1] + [f"new-array(){value_type}"])
End of matches for "_invoke" in /quark-engine/quark/evaluator/pyeval.py

🧑‍🚒 Response (9):

👀‍ Observation (9):

Here's the result of running `cat -n` on /quark-engine/quark/evaluator/pyeval.py:
     1	# -*- coding: utf-8 -*-
     2	# This file is part of Quark-Engine - https://github.com/quark-engine/quark-engine
     3	# See the file 'LICENSE' for copying permission.
     4	# Thanks for the description of Dalvik bytecode instruction from the following
     5	# websites, some of our explanations or comments will quote from it.
     6	# https://source.android.google.cn/devices/tech/dalvik/instruction-formats
     7	# http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html
     8	
     9	import logging
    10	from quark import config
    11	from quark.core.struct.registerobject import RegisterObject
    12	from quark.core.struct.tableobject import TableObject
    13	from quark.core.struct.valuenode import (
    14	    Primitive, MethodCall, BytecodeOps
    15	)
    16	from quark.utils.logger import defaultHandler
    17	
    18	log = logging.getLogger(__name__)
    19	log.setLevel(logging.DEBUG)
    20	log.addHandler(defaultHandler)
    21	log.disabled = not config.DEBUG
    22	
    23	
    24	def logger(func):
    25	    def warp(*args, **kwargs):
    26	        log.info(f"{func.__name__} with args-> {args}")
    27	
    28	        func(*args, **kwargs)
    29	
    30	    return warp
    31	
    32	
    33	class PyEval:
    34	    def __init__(self, apkinfo):
    35	        # Main switch for executing the bytecode instruction.
    36	        self.eval = {
    37	            # invoke-kind
    38	            "invoke-virtual": self.INVOKE_VIRTUAL,
    39	            "invoke-virtual/range": self.INVOKE_VIRTUAL,
    40	            "invoke-direct": self.INVOKE_DIRECT,
    41	            "invoke-direct/range": self.INVOKE_DIRECT,
    42	            "invoke-static": self.INVOKE_STATIC,
    43	            "invoke-static/range": self.INVOKE_STATIC,
    44	            "invoke-interface": self.INVOKE_INTERFACE,
    45	            "invoke-interface/range": self.INVOKE_INTERFACE,
    46	            "invoke-super": self.INVOKE_SUPER,
    47	            "invoke-super/range": self.INVOKE_SUPER,
    48	            "invoke-polymorphic": self.INVOKE_POLYMORPHIC,
    49	            "invoke-polymorphic/range": self.INVOKE_POLYMORPHIC,
    50	            "invoke-custom": self.INVOKE_CUSTOM,
    51	            "invoke-custom/range": self.INVOKE_CUSTOM,
    52	            # move-result-kind
    53	            "move-result": self.MOVE_RESULT,
    54	            "move-result-wide": self.MOVE_RESULT_WIDE,
    55	            "move-result-object": self.MOVE_RESULT_OBJECT,
    56	            # instance-kind
    57	            "new-instance": self.NEW_INSTANCE,
    58	            "new-array": self.NEW_ARRAY,
    59	            # const-kind
    60	            "const-string": self.CONST_STRING,
    61	            "const-string/jumbo": self.CONST_STRING,
    62	            "const-class": self.CONST_CLASS,
    63	            "const": self.CONST,
    64	            "const/4": self.CONST_FOUR,
    65	            "const/16": self.CONST_SIXTEEN,
    66	            "const/high16": self.CONST_HIGHSIXTEEN,
    67	            "const-wide": self.CONST_WIDE,
    68	            "const-wide/16": self.CONST_WIDE_SIXTEEN,
    69	            "const-wide/32": self.CONST_WIDE_THIRTY_TWO,
    70	            "const-wide/high16": self.CONST_WIDE_HIGHSIXTEEN,
    71	        }
    72	
    73	        # move-kind
    74	        for prefix in ("move", "move-object", "move-wide"):
    75	            for postfix in ("", "/from16", "/16"):
    76	                self.eval[f"{prefix}{postfix}"] = self.MOVE_KIND
    77	        self.eval["array-length"] = self.MOVE_KIND
    78	
    79	        # filled-array-kind
    80	        for ins in ("filled-new-array", "filled-new-array/range"):
    81	            self.eval[ins] = self.FILLED_NEW_ARRAY_KIND
    82	
    83	        # aget-kind
    84	        for postfix in ("", "-object", "-boolean", "-byte", "-char", "-short"):
    85	            self.eval[f"aget{postfix}"] = self.AGET_KIND
    86	            self.eval["aget-wide"] = self.AGET_WIDE_KIND
    87	
    88	        # aput-kind
    89	        for postfix in ("", "-object", "-boolean", "-byte", "-char", "-short"):
    90	            self.eval[f"aput{postfix}"] = self.APUT_KIND
    91	            self.eval["aput-wide"] = self.APUT_WIDE_KIND
    92	
    93	        # neg-kind and not-kind
    94	        for prefix in ("neg", "not"):
    95	            self.eval[f"{prefix}-int"] = self.NEG_AND_NOT_KIND
    96	            self.eval[f"{prefix}-long"] = self.NEG_AND_NOT_KIND
    97	            self.eval[f"{prefix}-float"] = self.NEG_AND_NOT_KIND
    98	            self.eval[f"{prefix}-double"] = self.NEG_AND_NOT_KIND
    99	
   100	        # type casting
   101	        for first_type in ("int", "long", "float", "double"):
   102	            for second_type in ("int", "long", "float", "double"):
   103	                if first_type == second_type:
   104	                    continue
   105	                self.eval[f"{first_type}-{second_type}"] = self.CAST_TYPE
   106	
   107	        # binop_kind
   108	        for prefix in (
   109	            "add",
   110	            "sub",
   111	            "mul",
   112	            "div",
   113	            "rem",
   114	            "and",
   115	            "or",
   116	            "xor",
   117	            "shl",
   118	            "shr",
   119	            "ushr",
   120	        ):
   121	            for _type in ("int", "float", "double", "long"):
   122	                for postfix in ("", "/2addr", "/lit16", "/lit8"):
   123	                    self.eval[f"{prefix}-{_type}{postfix}"] = self.BINOP_KIND
   124	
   125	        self.eval["move-exception"] = lambda ins: self._assign_value(
   126	            (ins[0], ins[1], "Exception"), value_type="Ljava/lang/Throwable;"
   127	        )
   128	        self.eval[
   129	            "fill-array-data"
   130	        ] = lambda ins: self._move_value_and_data_to_register(
   131	            (ins[0], ins[1], ins[1], ins[2]), "Embedded-array-data()[]"
   132	        )
   133	
   134	        self.type_mapping = {
   135	            "boolean": "Z",
   136	            "byte": "B",
   137	            "char": "C",
   138	            "short": "S",
   139	            "int": "I",
   140	            "long": "J",

🧑‍🚒 Response (10):

👀‍ Observation (10):

Here's the result of running `cat -n` on /quark-engine/tests/evaluator/test_pyeval.py:
     1	import itertools
     2	from unittest.mock import patch
     3	
     4	import pytest
     5	
     6	from quark.core.apkinfo import AndroguardImp
     7	from quark.core.struct.registerobject import RegisterObject
     8	from quark.core.struct.tableobject import TableObject
     9	from quark.evaluator.pyeval import PyEval
    10	from quark.core.struct.valuenode import Primitive, MethodCall
    11	
    12	
    13	@pytest.fixture()
    14	def instructions():
    15	    ins = [
    16	        "invoke-virtual",
    17	        "invoke-direct",
    18	        "move-result-object",
    19	        "new-instance",
    20	        "const-string",
    21	        "const/4",
    22	        "aget-object",
    23	    ]
    24	
    25	    yield ins
    26	
    27	    del ins
    28	
    29	
    30	@pytest.fixture(scope="module")
    31	def apkinfo(SAMPLE_PATH_13667):
    32	    apkinfo = AndroguardImp(SAMPLE_PATH_13667)
    33	    yield apkinfo
    34	
    35	
    36	@pytest.fixture(scope="function")
    37	def pyeval(apkinfo):
    38	    pyeval = PyEval(apkinfo)
    39	
    40	    v4_mock_variable_obj = RegisterObject(
    41	        value=Primitive(
    42	            "Lcom/google/progress/SMSHelper;", "Lcom/google/progress/SMSHelper;"
    43	        ),
    44	        value_type="Lcom/google/progress/SMSHelper;",
    45	    )
    46	    v5_mock_variable_obj = RegisterObject(
    47	        value=MethodCall(
    48	            "java.lang.String.toString", (Primitive("some_number", ""),)
    49	        ),
    50	        value_type="I",
    51	    )
    52	    v6_mock_variable_obj = RegisterObject(
    53	        value=MethodCall(
    54	            "java.lang.Collection.toArray", (Primitive("an_array", ""),)
    55	        ),
    56	        value_type="[I",
    57	    )
    58	    v7_mock_variable_obj = RegisterObject(
    59	        value=Primitive("a_float", "F"), value_type="F"
    60	    )
    61	    v8_mock_variable_obj = RegisterObject(
    62	        value=Primitive(
    63	            "ArrayMap object", "Landroid/support/v4/util/ArrayMap;"
    64	        ),
    65	        value_type="Landroid/support/v4/util/ArrayMap;",
    66	    )
    67	    v9_mock_variable_obj = RegisterObject(
    68	        value=Primitive("some_string", "Ljava/lang/String;"),
    69	        value_type="Ljava/lang/String;",
    70	    )
    71	    v9_mock_variable_obj.called_by_func.append(
    72	        MethodCall("java.io.file.close", tuple())
    73	    )
    74	
    75	    pyeval.table_obj.insert(4, v4_mock_variable_obj)
    76	    pyeval.table_obj.insert(5, v5_mock_variable_obj)
    77	    pyeval.table_obj.insert(6, v6_mock_variable_obj)
    78	    pyeval.table_obj.insert(7, v7_mock_variable_obj)
    79	    pyeval.table_obj.insert(8, v8_mock_variable_obj)
    80	    pyeval.table_obj.insert(9, v9_mock_variable_obj)
    81	
    82	    yield pyeval
    83	
    84	    del pyeval
    85	
    86	
    87	MOVE_KIND = [
    88	    prefix + postfix
    89	    for prefix, postfix in itertools.product(
    90	        ["move", "move-object"], ["", "/from16", "/16"]
    91	    )
    92	] + ["array-length"]
    93	MOVE_WIDE_KIND = ["move-wide" + postfix for postfix in ["", "/from16", "/16"]]
    94	
    95	
    96	@pytest.fixture(scope="module", params=MOVE_KIND)
    97	def move_kind(request):
    98	    return request.param
    99	
   100	
   101	@pytest.fixture(scope="module", params=MOVE_WIDE_KIND)
   102	def move_wide_kind(request):
   103	    return request.param
   104	
   105	
   106	FILLED_ARRAY_KIND = ("filled-new-array", "filled-new-array/range")
   107	
   108	
   109	@pytest.fixture(scope="module", params=FILLED_ARRAY_KIND)
   110	def filled_array_kind(request):
   111	    return request.param
   112	
   113	
   114	AGET_KIND = [
   115	    "aget" + postfix
   116	    for postfix in ("", "-object", "-byte", "-char", "-short", "-boolean")
   117	]
   118	AGET_WIDE_KIND = ["aget-wide"]
   119	
   120	
   121	@pytest.fixture(scope="module", params=AGET_KIND)
   122	def aget_kind(request):
   123	    return request.param
   124	
   125	
   126	@pytest.fixture(scope="module", params=AGET_WIDE_KIND)
   127	def aget_wide_kind(request):
   128	    return request.param
   129	
   130	
   131	APUT_KIND = [
   132	    "aput" + postfix
   133	    for postfix in ("", "-object", "-byte", "-char", "-short", "-boolean")
   134	]
   135	APUT_WIDE_KIND = ("aput-wide",)
   136	
   137	
   138	@pytest.fixture(scope="module", params=APUT_KIND)
   139	def aput_kind(request):
   140	    return request.param
   141	
   142	
   143	@pytest.fixture(scope="module", params=APUT_WIDE_KIND)
   144	def aput_wide_kind(request):
   145	    return request.param
   146	
   147	
   148	NEG_NOT_KIND = [
   149	    prefix + postfix
   150	    for prefix, postfix in itertools.product(
   151	        ["neg-", "not-"], ["int", "long", "float"]
   152	    )
   153	]
   154	
   155	NEG_NOT_WIDE_KIND = ("neg-double", "not-double")
   156	
   157	
   158	@pytest.fixture(scope="module", params=NEG_NOT_KIND)
   159	def neg_not_kind(request):
   160	    return request.param
   161	
   162	
   163	@pytest.fixture(scope="module", params=NEG_NOT_WIDE_KIND)
   164	def neg_not_wide_kind(request):
   165	    return request.param
   166	
   167	
   168	ALL_CAST_KIND = list(
   169	    {
   170	        prefix + "-" + postfix
   171	        for prefix, postfix in itertools.product(
   172	            ("int", "long", "float", "double"),
   173	            ("int", "long", "float", "double"),
   174	        )
   175	    }.difference(
   176	        {
   177	            "int-int",
   178	            "long-long",
   179	            "float-float",
   180	            "double-double",
   181	            "double-long",
   182	            "long-double",
   183	        }
   184	    )
   185	)
   186	
   187	CAST_KIND = [
   188	    ins for ins in ALL_CAST_KIND if "double" not in ins and "long" not in ins
   189	]
   190	CAST_SIMPLE_TO_WIDE_KIND = [
   191	    ins
   192	    for ins in ALL_CAST_KIND
   193	    if ins.endswith("double") or ins.endswith("long")
   194	]
   195	CAST_WIDE_TO_SIMPLE_KIND = [
   196	    ins
   197	    for ins in ALL_CAST_KIND
   198	    if ins.startswith("double") or ins.startswith("long")
   199	]
   200	
   201	
   202	@pytest.fixture(scope="module", params=CAST_KIND)
   203	def cast_kind(request):
   204	    return request.param
   205	
   206	
   207	@pytest.fixture(scope="module", params=CAST_SIMPLE_TO_WIDE_KIND)
   208	def cast_simple_to_wide_kind(request):
   209	    return request.param
   210	
   211	
   212	@pytest.fixture(scope="module", params=CAST_WIDE_TO_SIMPLE_KIND)
   213	def cast_wide_to_simple_kind(request):
   214	    return request.param
   215	
   216	
   217	_BINOP_PREFIX = (
   218	    "add",
   219	    "sub",
   220	    "mul",
   221	    "div",
   222	    "rem",
   223	    "and",
   224	    "or",
   225	    "xor",
   226	    "shl",
   227	    "shr",
   228	    "ushr",
   229	)
   230	
   231	SIMPLE_BINOP_KIND = [
   232	    prefix + "-" + type_str
   233	    for prefix, type_str in itertools.product(
   234	        _BINOP_PREFIX, ("int", "float", "long")
   235	    )
   236	]
   237	
   238	BINOP_WIDE_KIND = [prefix + "-" + "double" for prefix in _BINOP_PREFIX]
   239	
   240	BINOP_2ADDR_KIND = [ins + "/2addr" for ins in SIMPLE_BINOP_KIND]
   241	BINOP_LIT_KIND = [
   242	    ins + postfix
   243	    for ins, postfix in itertools.product(
   244	        SIMPLE_BINOP_KIND, ("/lit8", "/lit16")
   245	    )
   246	]
   247	
   248	
   249	@pytest.fixture(scope="module", params=SIMPLE_BINOP_KIND)
   250	def simple_binop_kind(request):
   251	    return request.param
   252	
   253	
   254	@pytest.fixture(scope="module", params=BINOP_WIDE_KIND)
   255	def binop_wide_kind(request):
   256	    return request.param
   257	
   258	
   259	@pytest.fixture(scope="module", params=BINOP_2ADDR_KIND)
   260	def binop_2addr_kind(request):

🧑‍🚒 Response (11):

👀‍ Observation (11):

Found 1 matches for "def NEW_ARRAY" in /quark-engine/quark/evaluator/pyeval.py:
Line 417:    def NEW_ARRAY(self, instruction):
End of matches for "def NEW_ARRAY" in /quark-engine/quark/evaluator/pyeval.py

🧑‍🚒 Response (12):

👀‍ Observation (12):

Here's the result of running `cat -n` on /quark-engine/quark/evaluator/pyeval.py:
   400	        """
   401	
   402	        self._move_result(instruction)
   403	
   404	    @logger
   405	    def NEW_INSTANCE(self, instruction):
   406	        """
   407	        new-instance vx,type
   408	
   409	        Instantiates an object type and puts the reference of the newly created instance into vx.
   410	
   411	        Store variables to vx, and then insert the VariableObject into table.
   412	        """
   413	
   414	        self._assign_value(instruction, value_type=instruction[2])
   415	
   416	    @logger
   417	    def NEW_ARRAY(self, instruction):
   418	        try:
   419	            self._move_value_to_register(
   420	                instruction[:-1],
   421	                "new-array()[({src0})",
   422	                value_type=instruction[-1],
   423	            )
   424	        except IndexError as e:
   425	            log.exception(f"{e} in NEW_ARRAY")
   426	
   427	    @logger
   428	    def CONST_STRING(self, instruction):
   429	        """
   430	        const-string vx,string_id
   431	
   432	        Puts reference to a string constant identified by string_id into vx.
   433	
   434	        Store string variable to vx, and then insert the VariableObject into table.
   435	        """
   436	
   437	        self._assign_value(instruction, value_type="Ljava/lang/String;")
   438	
   439	    @logger
   440	    def CONST_CLASS(self, instruction):
   441	        self._assign_value(instruction, value_type="Ljava/lang/Class;")
   442	
   443	    @logger
   444	    def CONST(self, instruction):
   445	        """
   446	        const vx, lit32
   447	
   448	        Puts the integer constant into vx.
   449	        """
   450	        self._assign_value(instruction)
   451	
   452	    @logger
   453	    def CONST_FOUR(self, instruction):
   454	        """
   455	        const/4 vx,lit4
   456	
   457	        Puts the 4 bit constant into vx.
   458	
   459	        Store 4 bit constant into vx, and then insert the VariableObject into table.
   460	        """
   461	
   462	        self._assign_value(instruction)
   463	
   464	    @logger
   465	    def CONST_SIXTEEN(self, instruction):
   466	        """
   467	        const/16 vx,lit16
   468	
   469	        Puts the 4 bit constant into vx.
   470	        """

🧑‍🚒 Response (13):

👀‍ Observation (13):

Here's the result of running `cat -n` on /quark-engine/quark/evaluator/pyeval.py:
   260	        src_obj = self.table_obj.getLatestRegValue(src_reg_idx)
   261	
   262	        # Insert the source object to the destination register.
   263	        self.table_obj.insert(dest_reg_idx, src_obj)
   264	
   265	    def _assign_value(self, instruction, value_type=""):
   266	
   267	        reg = instruction[1]
   268	        value = instruction[2]
   269	        index = int(reg[1:])
   270	
   271	        wrapped_value = Primitive(value, value_type)
   272	
   273	        variable_object = RegisterObject(value=wrapped_value, value_type=value_type)
   274	        self.table_obj.insert(index, variable_object)
   275	
   276	    def _assign_value_wide(self, instruction, value_type=""):
   277	        """
   278	        For 64 bit, it has two register, which is vx and vx+1
   279	        """
   280	        reg = instruction[1]
   281	        value = instruction[2]
   282	        index = int(reg[1:])
   283	
   284	        wrapped_value = Primitive(value, value_type)
   285	
   286	        variable_object = RegisterObject(value=wrapped_value, value_type=value_type)
   287	        variable_object2 = RegisterObject(value=wrapped_value, value_type=value_type)
   288	        self.table_obj.insert(index, variable_object)
   289	        self.table_obj.insert(index + 1, variable_object2)
   290	
   291	    @logger
   292	    def INVOKE_VIRTUAL(self, instruction):
   293	        """
   294	        invoke-virtual { parameters }, methodtocall
   295	        invoke-virtual/range { parameters }, methodtocall
   296	
   297	        Invokes a virtual method with parameters.
   298	        """
   299	        self._invoke(instruction, look_up=True)
   300	
   301	    @logger
   302	    def INVOKE_DIRECT(self, instruction):
   303	        """
   304	        invoke-direct { parameters }, methodtocall
   305	        invoke-direct/range { parameters }, methodtocall
   306	
   307	        Invokes a method with parameters without the virtual method resolution. (first parameter is "this")
   308	        """
   309	        self._invoke(instruction)
   310	
   311	    @logger
   312	    def INVOKE_STATIC(self, instruction):
   313	        """
   314	        invoke-static {parameters}, methodtocall
   315	        invoke-static/range {parameters}, methodtocall
   316	
   317	        Invokes a static method with parameters.
   318	        """
   319	        self._invoke(instruction)
   320	
   321	    @logger
   322	    def INVOKE_INTERFACE(self, instruction):
   323	        """
   324	        invoke-interface { parameters }, methodtocall
   325	        invoke-interface/range { parameters }, methodtocall
   326	        
   327	        Invokes a interface method with parameters.
   328	        """
   329	        self._invoke(instruction, look_up=True)
   330	
   331	    @logger
   332	    def INVOKE_SUPER(self, instruction):
   333	        """
   334	        invoke-super { parameters }, methodtocall
   335	        invoke-super/range { parameters }, methodtocall
   336	        
   337	        Invokes a super method with parameters.
   338	        """
   339	        self._invoke(instruction, look_up=True, skip_self=True)
   340	
   341	    def INVOKE_POLYMORPHIC(self, instruction):
   342	        """
   343	        invoke-polymorphic { parameters }, methodtocall
   344	        invoke-polymorphic/range { parameters }, methodtocall
   345	        
   346	        Invokes a polymorphic method with parameters.
   347	        """
   348	        self._invoke(instruction)
   349	
   350	    def INVOKE_CUSTOM(self, instruction):
   351	        """
   352	        invoke-custom { parameters }, callsite
   353	        invoke-custom/range { parameters }, callsite
   354	        
   355	        Invokes a call site with parameters.
   356	        """
   357	        self._invoke(instruction)
   358	
   359	    @logger
   360	    def MOVE_RESULT(self, instruction):

🧑‍🚒 Response (14):

👀‍ Observation (14):

Invalid `view_range`: [1, 200]. Its second element `200` should be smaller than the number of lines in the file: `59`

🧑‍🚒 Response (15):

👀‍ Observation (15):

Invalid `view_range`: [1, 120]. Its second element `120` should be smaller than the number of lines in the file: `59`

... (truncated due to length limit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PyEval._invoke silently skips IndexError in certain pipeline

1 participant