Oussama El Ghoul

25 papers B 1C 2Journal 4Unranked 18
YearRankTypeTitle / Venue / Authors
2024 J jnl
IEEE Access
Achraf Othman, Amira Dhouib, Hajer Chalghoumi, Oussama El Ghoul, Amnah Mohammed Al-Mutawaa
2023 J jnl
IEEE Access
Oussama El Ghoul, Maryam Aziz, Achraf Othman
2023 conf
PETRA
Achraf Othman, Oussama El Ghoul, Maryam Aziz, Khansa Chemnad, Sammy Sedrati, Amira Dhouib
2023 J jnl
Sensors
Amina Ben Haj Amor, Oussama El Ghoul, Mohamed Jemni
2022 C conf
EDUCON
Oussama El Ghoul, Achraf Othman
2021 conf
ICTA
Amina Ben Haj Amor, Oussama El Ghoul, Mohamed Jemni
2021 conf
ICTA
Achraf Othman, Oussama El Ghoul
2020 conf
ICCHP (1)
Oussama El Ghoul, Ikrami Ahmed, Achraf Othman, Dena Al-Thani, Amani Al-Tamimi
2019 conf
ICTA
Amina Ben Haj Amor, Oussama El Ghoul, Mohamed Jemni
2017 conf
ICTA
Amina Ben Haj Amor, Oussama El Ghoul, Mohamed Jemni
2017 conf
ICTA
Ibtissem Talbi, Oussama El Ghoul, Mohamed Jemni
2016 conf
ICCHP (2)
Ibtissem Talbi, Oussama El Ghoul, Mohamed Jemni
2015 conf
ICTA
Ibtissem Talbi, Oussama El Ghoul, Mohamed Jemni
2014 conf
ICCHP (2)
Oussama El Ghoul, Mohamed Jemni
2013 conf
ICTA
Yosra Bouzid, Oussama El Ghoul, Mohamed Jemni
2012 conf
GRAPP/IVAPP
Achraf Othman, Oussama El Ghoul, Mohamed Jemni
2012 conf
ICCHP (2)
Yosra Bouzid, Maher Jbali, Oussama El Ghoul, Mohamed Jemni
2012 conf
W4A
Oussama El Ghoul, Nour Ben Yahia, Mohamed Jemni
2010 conf
ICCHP (2)
Achraf Othman, Oussama El Ghoul, Mohamed Jemni
2009 conf
USAB
Oussama El Ghoul, Mohamed Jemni
2009 conf
ICTA
Oussama El Ghoul, Mohamed Jemni
2009 J jnl
Int. Arab J. Inf. Technol.
Oussama El Ghoul, Mohamed Jemni
2008 C conf
ICCHP
Mohamed Jemni, Oussama El Ghoul
2008 B conf
ICALT
Mohamed Jemni, Oussama El Ghoul
2007 conf
CVHI
Mohamed Jemni, Oussama El Ghoul, Nour Ben Yahia, Mehrez Boulares
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