Imane Guellil

25 papers C 1Journal 16Unranked 8
YearRankTypeTitle / Venue / Authors
2026 J jnl
SN Comput. Sci.
Imane Guellil, Yousra Berrachedi, Nidhal Eddine Chenni, Massi-Nissa Abboud, Jinge Wu, Honghan Wu, Beatrice Alex
2025 conf
ACL (1)
Imane Guellil, Salomé Andres, Atul Anand, Bruce Guthrie, Huayu Zhang, Abul Hasan, Honghan Wu, Beatrice Alex
2025 J jnl
CoRR
Imane Guellil, Salomé Andres, Atul Anand, Bruce Guthrie, Huayu Zhang, Abul Kalam Hasan, Honghan Wu, Beatrice Alex
2025 J jnl
Comput. Biol. Medicine
Abul Hasan, Jinge Wu, Quang Ngoc Nguyen, Salomé Andres, Imane Guellil, Huayu Zhang, Arlene Casey, Beatrice Alex, Bruce Guthrie, Honghan Wu
2024 conf
NLDB (2)
Imane Guellil, Salomé Andres, Bruce Guthrie, Atul Anand, Huayu Zhang, Abul Kalam Hasan, Honghan Wu, Beatrice Alex
2024 J jnl
Knowl. Inf. Syst.
Imane Guellil, Antonio García-Domínguez, Peter R. Lewis, Shakeel Hussain, Geoffrey Smith
2024 J jnl
CoRR
Abul Hasan, Jinge Wu, Quang Ngoc Nguyen, Salomé Andres, Imane Guellil, Huayu Zhang, Arlene Casey, Beatrice Alex, Bruce Guthrie, Honghan Wu
2023 J jnl
Frontiers Digit. Health
Huayu Zhang, Arlene Casey, Imane Guellil, Víctor Suárez-Paniagua, Clare Macrae, Charis Marwick, Honghan Wu, Bruce Guthrie, Beatrice Alex
2022 conf
SMM4H@COLING
Imane Guellil, Jinge Wu, Honghan Wu, Tony Sun, Beatrice Alex
2021 J jnl
SN Comput. Sci.
Imane Guellil, Ahsan Adeel, Faiçal Azouaou, Fodil Benali, Ala-Eddine Hachani, Kia Dashtipour, Mandar Gogate, Cosimo Ieracitano, Reza Kashani, Amir Hussain
2021 J jnl
J. King Saud Univ. Comput. Inf. Sci.
Imane Guellil, Houda Saadane, Faiçal Azouaou, Billel Gueni, Damien Nouvel
2021 conf
WASSA@EACL
Imane Guellil, Faiçal Azouaou, Fodil Benali, Ala-Eddine Hachani
2021 conf
AfricaNLP
Imane Guellil, Ahsan Adeel, Faiçal Azouaou, Mohamed Boubred, Yousra Houichi, Akram Abdelhaq Moumna
2020 J jnl
Soc. Netw. Anal. Min.
Imane Guellil, Faiçal Azouaou, Francisco Chiclana
2020 J jnl
Inteligencia Artif.
Imane Guellil, Marcelo Mendoza, Faiçal Azouaou
2020 J jnl
Int. J. Web Inf. Syst.
Imane Guellil, Ahsan Adeel, Faiçal Azouaou, Sara Chennoufi, Hanene Maafi, Thinhinane Hamitouche
2019 J jnl
Int. J. Web Inf. Syst.
Imane Guellil, Kareem Darwish, Faiçal Azouaou
2019 J jnl
CoRR
Imane Guellil, Houda Saadane, Faiçal Azouaou, Billel Gueni, Damien Nouvel
2019 J jnl
Soc. Netw. Anal. Min.
Imane Guellil, Faiçal Azouaou, Marcelo Mendoza
2019 C conf
AICCSA
Imane Guellil, Faiçal Azouaou, Alessandro Valitutti
2018 conf
CORIA-TALN-RJC (TALN 2)
Imane Guellil, Faiçal Azouaou, Fodil Benali, Ala-Eddine Hachani, Houda Saadane
2018 conf
WASSA@EMNLP
Imane Guellil, Ahsan Adeel, Faiçal Azouaou, Fodil Benali, Ala-Eddine Hachani, Amir Hussain
2018 J jnl
CoRR
Imane Guellil, Faiçal Azouaou, Fodil Benali, Ala-Eddine Hachani, Houda Saadane
2018 conf
BICS
Imane Guellil, Ahsan Adeel, Faiçal Azouaou, Amir Hussain
2018 J jnl
CoRR
Imane Guellil, Ahsan Adeel, Faiçal Azouaou, Amir Hussain
tests/unit/test_decompile_strings.py
← Index tests/unit/test_decompile_strings.py python
"""Unit tests for bninja/analysis/strings.py — StringAnalysis."""
import pytest
import math
from unittest.mock import MagicMock


# StringAnalysis has no binaryninja imports, just collections and math
from redb.extractors.decompiler.bninja.analysis.strings import StringAnalysis


# ============================================================================
# Helper mocks
# ============================================================================

class MockStringEntry:
    """Mock for a Binary Ninja string reference."""
    def __init__(self, value, raw=None, start=0, length=0, type_name="Utf8String"):
        self.value = value
        self.raw = raw if raw is not None else (value.encode("utf-8") if isinstance(value, str) else value)
        self.start = start
        self.length = length if length else len(self.raw)
        self.type = MagicMock()
        self.type.name = type_name


class MockBinaryView:
    """Mock binary view with a strings list."""
    def __init__(self, strings=None):
        self.strings = strings or []


# ============================================================================
# 6a. StringAnalysis
# ============================================================================


class TestStringAnalysisEntropy:
    def setup_method(self):
        self.sa = StringAnalysis(bv=MockBinaryView(), functions=[])

    def test_entropy_empty_string(self):
        assert self.sa.entropy("") == 0.0

    def test_entropy_single_char(self):
        assert self.sa.entropy("aaaa") == 0.0

    def test_entropy_uniform_distribution(self):
        # "abcd" -> 4 unique chars, each p=1/4, entropy = log2(4) = 2.0
        result = self.sa.entropy("abcd")
        assert result == pytest.approx(2.0)

    def test_entropy_binary_string(self):
        # "ab" -> 2 unique chars, each p=1/2, entropy = log2(2) = 1.0
        result = self.sa.entropy("ab")
        assert result == pytest.approx(1.0)


class TestStringAnalysisAnalyze:
    def test_analyze_deduplication(self):
        """Duplicate (string, encoding) pairs -> only first kept."""
        entries = [
            MockStringEntry("hello", start=100, type_name="Utf8String"),
            MockStringEntry("hello", start=200, type_name="Utf8String"),
        ]
        bv = MockBinaryView(strings=entries)
        sa = StringAnalysis(bv=bv, functions=[])
        result = sa.analyze()
        assert len(result) == 1
        assert result[0]["string_offset"] == 100

    def test_analyze_sorted_by_address(self):
        """First occurrence (lowest offset) is the one kept."""
        entries = [
            MockStringEntry("world", start=500, type_name="Utf8String"),
            MockStringEntry("world", start=100, type_name="Utf8String"),
        ]
        bv = MockBinaryView(strings=entries)
        sa = StringAnalysis(bv=bv, functions=[])
        result = sa.analyze()
        assert len(result) == 1
        # The analyze() sorts by start, so 100 comes first
        assert result[0]["string_offset"] == 100

    def test_analyze_empty_bv(self):
        bv = MockBinaryView(strings=[])
        sa = StringAnalysis(bv=bv, functions=[])
        result = sa.analyze()
        assert result == []

    def test_analyze_output_schema(self):
        entries = [MockStringEntry("test_string", start=0, type_name="Utf8String")]
        bv = MockBinaryView(strings=entries)
        sa = StringAnalysis(bv=bv, functions=[])
        result = sa.analyze()
        assert len(result) == 1
        r = result[0]
        required_keys = [
            "string",
            "string_raw",
            "string_encoding",
            "string_offset",
            "string_length",
            "string_raw_length",
            "string_entropy",
        ]
        for key in required_keys:
            assert key in r, f"Missing key: {key}"