Mahdi Hashemzadeh

31 papers Journal 31
YearRankTypeTitle / Venue / Authors
2026 J jnl
Pattern Anal. Appl.
Shirin Khezri, Nasser Aghazadeh, Mahdi Hashemzadeh, Amin Golzari Oskouei
2025 J jnl
Int. J. Mach. Learn. Cybern.
Arezou Najafi Moghaddam, Nasser Aghazadeh, Mahdi Hashemzadeh, Amin Golzari Oskouei
2025 J jnl
Pattern Recognit.
Nasim Abdolmaleki, Leyli Mohammad Khanli, Mahdi Hashemzadeh, Shahin Pourbahrami
2024 J jnl
Image Vis. Comput.
Bahareh Asheghi, Pedram Salehpour, Abdolhamid Moallemi Khiavi, Mahdi Hashemzadeh, Amirhassan Monajemi
2024 J jnl
Soft Comput.
Vahid Mohammadian Takaloo, Mahdi Hashemzadeh, Jalil Ghavidel Neycharan
2023 J jnl
Pattern Recognit.
Paria Soltanzadeh, Mohammad-Reza Feizi-Derakhshi, Mahdi Hashemzadeh
2023 J jnl
Expert Syst. Appl.
Nacer Farajzadeh, Nima Sadeghzadeh, Mahdi Hashemzadeh
2023 J jnl
Knowl. Inf. Syst.
Saeed Hamdollahi Oskouei, Mahdi Hashemzadeh
2023 J jnl
Entertain. Comput.
Nacer Farajzadeh, Nima Sadeghzadeh, Mahdi Hashemzadeh
2022 J jnl
Signal Process.
Bahareh Asheghi, Pedram Salehpour, Abdolhamid Moallemi Khiavi, Mahdi Hashemzadeh
2022 J jnl
Comput. Biol. Medicine
Nacer Farajzadeh, Nima Sadeghzadeh, Mahdi Hashemzadeh
2022 J jnl
Inf. Sci.
Shahin Pourbahrami, Mahdi Hashemzadeh
2022 J jnl
J. Comput. Sci.
Nasim Abdolmaleki, Leyli Mohammad Khanli, Mahdi Hashemzadeh, Shahin Pourbahrami
2022 J jnl
Softw. Impacts
Amin Golzari Oskouei, Mahdi Hashemzadeh
2022 J jnl
Neurocomputing
Mehrad Aria, Mahdi Hashemzadeh, Nacer Farajzadeh
2022 J jnl
Appl. Soft Comput.
Mahdi Hashemzadeh, Nacer Farajzadeh, Milad Heydari
2022 J jnl
J. Comput. Sci.
Ali Hosseini, Mahdi Hashemzadeh, Nacer Farajzadeh
2021 J jnl
J. Comput. Sci.
Nacer Farajzadeh, Mahdi Hashemzadeh
2021 J jnl
Appl. Soft Comput.
Amin Golzari Oskouei, Mahdi Hashemzadeh, Bahareh Asheghi, Mohammad Ali Balafar
2021 J jnl
Inf. Sci.
Paria Soltanzadeh, Mahdi Hashemzadeh
2019 J jnl
Signal Process.
Mahdi Hashemzadeh, Bahareh Asheghi, Nacer Farajzadeh
2019 J jnl
Expert Syst. Appl.
Mahdi Hashemzadeh, Alireza Zademehdi
2019 J jnl
Appl. Soft Comput.
Mahdi Hashemzadeh, Amin Golzari Oskouei, Nacer Farajzadeh
2019 J jnl
Artif. Intell. Medicine
Mahdi Hashemzadeh, Baharak Adlpour Azar
2018 J jnl
Multim. Tools Appl.
Nacer Farajzadeh, Aziz Karamiani, Mahdi Hashemzadeh
2018 J jnl
Inf. Sci.
Nacer Farajzadeh, Mahdi Hashemzadeh
2018 J jnl
Comput. Electr. Eng.
Mahdi Hashemzadeh
2016 J jnl
Int. J. Comput. Intell. Syst.
Mahdi Hashemzadeh, Nacer Farajzadeh
2016 J jnl
Inf. Sci.
Mahdi Hashemzadeh, Nacer Farajzadeh
2014 J jnl
Multim. Tools Appl.
Mahdi Hashemzadeh, Gang Pan, Min Yao
2013 J jnl
Int. J. Pattern Recognit. Artif. Intell.
Mahdi Hashemzadeh, Gang Pan, Yueming Wang, Min Yao, Jian Wu
tests/unit/test_decompile_arch.py
← Index tests/unit/test_decompile_arch.py python
"""Unit tests for architecture modules:
- bninja/arch/creator.py
- bninja/arch/x86.py
"""
import sys
import pytest

# Install binaryninja stubs before importing arch modules
from tests.unit.conftest_binja_stubs import install_binja_stubs
install_binja_stubs()

from redb.extractors.decompiler.bninja.arch.creator import ArchitectureCreator
from redb.extractors.decompiler.bninja.arch.x86 import Arch_x86


# ============================================================================
# 3a. ArchitectureCreator
# ============================================================================

class TestArchitectureCreator:
    def test_create_x86(self):
        arch = ArchitectureCreator("x86").get()
        assert isinstance(arch, Arch_x86)

    def test_create_x86_case_insensitive(self):
        for name in ["X86", "x86", "X86"]:
            arch = ArchitectureCreator(name).get()
            assert isinstance(arch, Arch_x86)

    def test_unsupported_arch_raises(self):
        with pytest.raises(ValueError, match="Unsupported architecture"):
            ArchitectureCreator("arm").get()


# ============================================================================
# 3b. Arch_x86
# ============================================================================

class TestArch_x86Registers:
    def setup_method(self):
        self.arch = Arch_x86()

    def test_is_register_valid(self):
        assert self.arch.is_register("RAX") is True
        assert self.arch.is_register("eax") is True
        assert self.arch.is_register("XMM0") is True

    def test_is_register_invalid(self):
        assert self.arch.is_register("INVALID_REG") is False

    def test_is_general_purpose_register(self):
        assert self.arch.is_general_purpose_register("RAX") is True
        assert self.arch.is_general_purpose_register("XMM0") is False

    def test_is_stack_register(self):
        assert self.arch.is_stack_register("RSP") is True
        assert self.arch.is_stack_register("RBP") is True
        assert self.arch.is_stack_register("RAX") is False

    def test_is_xmm_register(self):
        assert self.arch.is_xmm_register("XMM0") is True
        assert self.arch.is_xmm_register("RAX") is False


class TestArch_x86OpcodeCategories:
    def setup_method(self):
        self.arch = Arch_x86()

    def test_opcode_categories_populated(self):
        assert len(self.arch.opcode_categories) > 0

    def test_opcode_mov_category(self):
        assert self.arch.opcode_categories["MOV"] == "DATA_MOVEMENT"

    def test_opcode_call_category(self):
        assert self.arch.opcode_categories["CALL"] == "CONTROL_FLOW"

    def test_opcode_add_category(self):
        assert self.arch.opcode_categories["ADD"] == "ARITHMETIC"


class TestArch_x86ControlFlow:
    def setup_method(self):
        self.arch = Arch_x86()

    def test_is_control_flow_instruction_by_mnemonic(self):
        assert self.arch.is_control_flow_instruction_by_mnemonic("JMP") is True
        assert self.arch.is_control_flow_instruction_by_mnemonic("MOV") is False

    def test_is_control_flow_instruction_call(self):
        assert self.arch.is_control_flow_instruction_by_mnemonic("CALL") is True

    def test_is_control_flow_instruction_ret(self):
        assert self.arch.is_control_flow_instruction_by_mnemonic("RET") is True

    def test_is_control_flow_instruction_loop(self):
        assert self.arch.is_control_flow_instruction_by_mnemonic("LOOP") is True

    def test_is_control_flow_instruction_empty(self):
        assert self.arch.is_control_flow_instruction_by_mnemonic("") is False
        assert self.arch.is_control_flow_instruction_by_mnemonic(None) is False