Hadi G. Ghauch

52 papers A* 1A 1B 3Misc 4Journal 31Unranked 12
YearRankTypeTitle / Venue / Authors
2022 J jnl
IEEE Trans. Signal Process.
Qiyou Duan, Hadi G. Ghauch, Taejoon Kim
2021 J jnl
CoRR
Qiyou Duan, Hadi G. Ghauch, Taejoon Kim
2021 J jnl
IEEE Access
Qiyou Duan, Taejoon Kim, Hadi G. Ghauch
2021 J jnl
IEEE Trans. Commun.
Jose Mairton B. da Silva Jr., Hadi G. Ghauch, Gábor Fodor, Mikael Skoglund, Carlo Fischione
2020 J jnl
IEEE Trans. Cogn. Commun. Netw.
Hossein Shokri Ghadikolaei, Hadi G. Ghauch, Gábor Fodor, Mikael Skoglund, Carlo Fischione
2020 J jnl
CoRR
Hossein Shokri Ghadikolaei, Hadi G. Ghauch, Gábor Fodor, Mikael Skoglund, Carlo Fischione
2020 B conf
GLOBECOM
Qiyou Duan, Taejoon Kim, Hadi G. Ghauch, Eric W. M. Wong
2020 J jnl
CoRR
Qiyou Duan, Taejoon Kim, Hadi G. Ghauch
2020 Misc conf
ACSSC
Hadi G. Ghauch, Hossein Shokri Ghadikolaei, Mikael Skoglund, Carlo Fischione
2020 J jnl
IEEE Trans. Wirel. Commun.
Boules A. Mouris, Hadi G. Ghauch, Ragnar Thobaben, B. Lars G. Jonsson
2019 Misc conf
ICASSP
Hadi G. Ghauch, Taejoon Kim, Carlo Fischione, Mikael Skoglund
2019 J jnl
IEEE Commun. Mag.
Antti Tölli, Hadi G. Ghauch, Jarkko Kaleva, Petri Komulainen, Mats Bengtsson, Mikael Skoglund, Michael L. Honig, Eeva Lähetkangas, Esa Tiirola, Kari Pajukoski
2019 Misc conf
ACSSC
Wai-Ming Chan, Hadi G. Ghauch, Taejoon Kim, Elisabeth de Carvalho, Gábor Fodor
2019 A* conf
ICML
Hossein Shokri Ghadikolaei, Hadi G. Ghauch, Carlo Fischione, Mikael Skoglund
2019 J jnl
CoRR
Boules A. Mouris, Hadi G. Ghauch, Ragnar Thobaben, B. Lars G. Jonsson
2018 J jnl
CoRR
Hadi G. Ghauch, Hossein Shokri Ghadikolaei, Carlo Fischione, Mikael Skoglund
2018 J jnl
CoRR
Antti Tölli, Hadi G. Ghauch, Jarkko Kaleva, Petri Komulainen, Mats Bengtsson, Mikael Skoglund, Michael L. Honig, Eeva Lähetkangas, Esa Tiirola, Kari Pajukoski
2018 conf
ICC Workshops
Jose Mairton B. da Silva Jr., Hadi G. Ghauch, Gábor Fodor, Carlo Fischione
2018 J jnl
CoRR
José Mairton B. da Silva Jr., Hadi G. Ghauch, Gábor Fodor, Carlo Fischione
2018 J jnl
CoRR
Hadi G. Ghauch, Mikael Skoglund, Hossein Shokri Ghadikolaei, Carlo Fischione, Ali H. Sayed
2018 conf
mmNets
Hossein Shokri Ghadikolaei, Hadi G. Ghauch, Carlo Fischione
2018 conf
ICC
Hadi G. Ghauch, Taejoon Kim, Mikael Skoglund, Carlo Fischione
2018 J jnl
CoRR
Hadi G. Ghauch, Taejoon Kim, Mikael Skoglund, Carlo Fischione
2018 J jnl
EURASIP J. Wirel. Commun. Netw.
Sahar Imtiaz, Georgios P. Koudouridis, Hadi G. Ghauch, James Gross
2018 conf
WCNC Workshops
Sahar Imtiaz, Hadi G. Ghauch, George P. Koudouridis, James Gross
2018 J jnl
IEEE Trans. Wirel. Commun.
Hadi G. Ghauch, Muhammad Mahboob Ur Rahman, Sahar Imtiaz, Christer Qvarfordt, Mikael Skoglund, James Gross
2017 conf
VTC Fall
Hadi G. Ghauch, Sahar Imtiaz, Mikael Skoglund, George P. Koudouridis, James Gross
2017 J jnl
CoRR
Sahar Imtiaz, Hadi G. Ghauch, Muhammad Mahboob Ur Rahman, George P. Koudouridis, James Gross
2017 J jnl
IEEE J. Sel. Areas Commun.
Hadi G. Ghauch, Taejoon Kim, Mats Bengtsson, Mikael Skoglund
2016 J jnl
CoRR
Hadi G. Ghauch, Muhammad Mahboob Ur Rahman, Sahar Imtiaz, James Gross
2016 conf
ICC
Hadi G. Ghauch, Muhammad Mahboob Ur Rahman, Sahar Imtiaz, James Gross
2016 A conf
MSWiM
Sahar Imtiaz, Hadi G. Ghauch, Muhammad Mahboob Ur Rahman, George P. Koudouridis, James Gross
2016 J jnl
CoRR
Sahar Imtiaz, Hadi G. Ghauch, Muhammad Mahboob Ur Rahman, George P. Koudouridis, James Gross
2016 J jnl
CoRR
Hadi G. Ghauch, Muhammad Mahboob Ur Rahman, Sahar Imtiaz, James Gross, Mikael Skoglund, Christer Qvarfordt
2016 J jnl
CoRR
Hadi G. Ghauch, Taejoon Kim, Mats Bengtsson, Mikael Skoglund
2016 J jnl
CoRR
Hadi G. Ghauch, Mats Bengtsson, Taejoon Kim, Mikael Skoglund
2016 J jnl
IEEE J. Sel. Top. Signal Process.
Hadi G. Ghauch, Taejoon Kim, Mats Bengtsson, Mikael Skoglund
2016 Misc conf
ACSSC
Wai-Ming Chan, Taejoon Kim, Hadi G. Ghauch, Mats Bengtsson
2015 J jnl
IEEE Trans. Signal Process.
Hadi G. Ghauch, Taejoon Kim, Mats Bengtsson, Mikael Skoglund
2015 conf
CAMSAP
Hadi G. Ghauch, Rami Mochaourab, Mats Bengtsson, Mikael Skoglund
2015 J jnl
CoRR
Rami Mochaourab, Rasmus Brandt, Hadi G. Ghauch, Mats Bengtsson
2015 conf
EUSIPCO
Rami Mochaourab, Rasmus Brandt, Hadi G. Ghauch, Mats Bengtsson
2015 conf
ICC Workshops
Hamed Farhadi, Hadi G. Ghauch, Mikael Skoglund
2015 conf
GLOBECOM Workshops
Muhammad Mahboob Ur Rahman, Hadi G. Ghauch, Sahar Imtiaz, James Gross
2015 J jnl
CoRR
Muhammad Mahboob Ur Rahman, Hadi G. Ghauch, Sahar Imtiaz, James Gross
2015 J jnl
CoRR
Hadi G. Ghauch, Taejoon Kim, Mats Bengtsson, Mikael Skoglund
2015 conf
SPAWC
Hadi G. Ghauch, Mats Bengtsson, Taejoon Kim, Mikael Skoglund
2014 J jnl
CoRR
Jiguang He, Taejoon Kim, Hadi G. Ghauch, Kunpeng Liu, Guangjian Wang
2014 conf
GLOBECOM Workshops
Jiguang He, Taejoon Kim, Hadi G. Ghauch, Kunpeng Liu, Guangjian Wang
2013 B conf
GLOBECOM
Hadi G. Ghauch, Taejoon Kim, Mats Bengtsson, Mikael Skoglund
2011 B conf
GLOBECOM
Hadi G. Ghauch, Constantinos B. Papadias
2011 J jnl
CoRR
Hadi G. Ghauch, Constantinos B. Papadias
tests/unit/test_decompile_utils.py
← Index tests/unit/test_decompile_utils.py python
"""Unit tests for decompiler utility modules:
- bninja/utils/hashes.py
- bninja/utils/json_encoder.py
- bninja/analysis/low_level_normalization.py
"""
import hashlib
import json
import pytest


# ============================================================================
# 1a. hashes.py
# ============================================================================

from redb.extractors.decompiler.bninja.utils.hashes import (
    calculate_md5,
    calculate_sha256,
    calculate_tlsh,
)


class TestCalculateMD5:
    def test_calculate_md5_known_value(self):
        expected = hashlib.md5(b"test").hexdigest()
        assert calculate_md5("test") == expected

    def test_calculate_md5_empty(self):
        expected = hashlib.md5(b"").hexdigest()
        assert calculate_md5("") == expected


class TestCalculateSHA256:
    def test_calculate_sha256_known_value(self):
        expected = hashlib.sha256(b"hello world").hexdigest()
        assert calculate_sha256("hello world") == expected

    def test_calculate_sha256_empty_string(self):
        result = calculate_sha256("")
        assert len(result) == 64
        assert all(c in "0123456789abcdef" for c in result)


class TestCalculateTLSH:
    def test_calculate_tlsh_long_data(self):
        # TLSH requires >= 50 bytes
        data = "A" * 100
        result = calculate_tlsh(data)
        assert result is not None
        assert isinstance(result, str)

    def test_calculate_tlsh_short_data(self):
        data = "A" * 10
        result = calculate_tlsh(data)
        assert result is None

    def test_calculate_tlsh_deterministic(self):
        data = "x" * 200
        assert calculate_tlsh(data) == calculate_tlsh(data)



# ============================================================================
# 1b. json_encoder.py
# ============================================================================

from redb.extractors.decompiler.bninja.utils.json_encoder import BinaryNinjaEncoder


class TestBinaryNinjaEncoder:
    def test_encode_value_confidence_object(self):
        obj = type("VC", (), {"value": 42, "confidence": 255})()
        result = json.dumps(obj, cls=BinaryNinjaEncoder)
        assert json.loads(result) == 42

    def test_encode_str_fallback(self):
        obj = type("Obj", (), {"__str__": lambda self: "custom_repr"})()
        result = json.dumps(obj, cls=BinaryNinjaEncoder)
        assert json.loads(result) == "custom_repr"

    def test_encode_normal_types(self):
        data = {"a": 1, "b": [2, 3], "c": "hello"}
        result = json.dumps(data, cls=BinaryNinjaEncoder)
        assert json.loads(result) == data

    def test_encode_set_via_str(self):
        # Python sets have __str__, so BinaryNinjaEncoder converts them
        # to their string repr instead of raising TypeError.
        result = json.dumps(set([1, 2, 3]), cls=BinaryNinjaEncoder)
        parsed = json.loads(result)
        assert isinstance(parsed, str)
        assert "1" in parsed


# ============================================================================
# 1c. low_level_normalization.py
# ============================================================================

from redb.extractors.decompiler.bninja.analysis.low_level_normalization import (
    LowLevelNormalization,
)


class MockIL:
    """Mock IL node for normalization tests."""
    def __init__(self, operation, operands=None):
        self.operation = operation
        self.operands = operands or []


class TestLowLevelNormalization:
    def setup_method(self):
        self.normalizer = LowLevelNormalization()

    def test_normalize_single_instruction(self):
        node = MockIL(operation=5)
        result = self.normalizer.normalize_instruction_all_levels(node)
        assert result == [5]

    def test_normalize_nested_operands(self):
        child1 = MockIL(operation=10)
        child2 = MockIL(operation=20)
        root = MockIL(operation=1, operands=[child1, child2])
        result = self.normalizer.normalize_instruction_all_levels(root)
        assert result == [1, 10, 20]

    def test_normalize_empty_operands(self):
        node = MockIL(operation=42, operands=[])
        result = self.normalizer.normalize_instruction_all_levels(node)
        assert result == [42]

    def test_normalize_list_operands(self):
        # Simulates phi-node style list operands
        inner = MockIL(operation=99)
        node = MockIL(operation=7, operands=[[inner]])
        result = self.normalizer.normalize_instruction_all_levels(node)
        assert result == [7, 99]

    def test_normalize_none_input(self):
        result = self.normalizer.normalize_instruction_all_levels(None)
        assert result == []