J. Robinson

14 papers A* 1B 1Misc 1Journal 9Unranked 1
YearRankTypeTitle / Venue / Authors
2025 J jnl
Comput. Phys. Commun.
Sebastiano Aiello, Albert Akhriev, A. R. Alhebsi, M. Alshamsi, Sergio Alves Garre, Antonio Ambrosone, Fabrizio Ameli, Michel André, L. Aphecetche, M. Ardid, S. Ardid, H. Atmani, Julien Aublin, F. Badaracco, L. Bailly-Salins, Z. Bardacová, Bruny Baret, A. Bariego-Quintana, Y. Becherini, Meriem Bendahman, F. Benfenati, M. Benhassi, M. Bennani, D. M. Benoit, Edward Berbee, Vincent Bertin, Simone Biagi, M. Boettcher, David Bonanno, A. B. Bouasla, J. Boumaaza, M. Bouta, M. Bouwhuis, C. Bozza, R. M. Bozza, H. Brânzas, F. Bretaudeau, M. Breuhaus, Ronald Bruijn, J. Brunner, R. Bruno, E. Buis, Raffaele Buompane, J. Busto, B. Caiffi, David Calvo, A. Capone, F. Carenini, V. Carretero, T. Cartraud, P. Castaldi, V. Cecchini, S. Celli, L. Cerisy, M. Chabab, Andrew Chen, S. Cherubini, T. Chiarusi, M. Circella, R. Cocimano, J. A. B. Coelho, Alexis Coleiro, A. Condorelli, R. Coniglione, P. Coyle, A. Creusot, G. Cuttone, Richard Dallier, A. De Benedittis, B. De Martino, Gwenhaël de Wasseige, V. Decoene, I. Del Rosso, Letizia Stella Di Mauro, I. Di Palma, Antonio F. Díaz, Dídac Diego-Tortosa, C. Distefano, A. Domi, C. Donzaud, Damien Dornic, E. Drakopoulou, D. Drouhin, Jean-Grégoire Ducoin, R. Dvornický, T. Eberl, E. Eckerová, A. Eddymaoui, T. van Eeden, M. Eff, D. van Eijk, I. El Bojaddaini, S. El Hedri, V. Ellajosyula, A. Enzenhöfer, G. Ferrara, M. D. Filipovic, F. Filippini, D. Franciotti, L. A. Fusco, S. Gagliardini, T. Gal, Juan García Méndez, Alfonso Garcia Soto, C. Gatius Oliver, N. Geißelbrecht, E. Genton, H. Ghaddari, L. Gialanella, B. K. Gibson, E. Giorgio, I. Goos, P. Goswami, Sara Rebecca Gozzini, R. Gracia, Claudio Guidi, B. Guillon, M. Gutiérrez, Connie Haack, H. van Haren, A. Heijboer, L. Hennig, Juan José Hernández-Rey, W. Idrissi Ibnsalih, G. Illuminati, D. Joly, M. de Jong, P. de Jong, B. J. Jung, P. Kalaczynski, G. Kistauri, C. Kopper, A. Kouchner, Y. Y. Kovalev, V. Kueviakoe, Vladimir Kulikovskiy, R. Kvatadze, M. Labalme, Robert Lahmann, Mathieu Lamoureux, G. Larosa, C. Lastoria, A. Lazo, S. Le Stum, G. Lehaut, V. Lemaître, E. Leonora, N. Lessing, G. Levi, M. Lindsey Clark, Fabio Longhitano, F. Magnani, J. Majumdar, L. Malerba, Fadahat Mamedov, J. Manczak, A. Manfreda, Martina Marconi, A. Margiotta, A. Marinelli, C. Markou, L. Martin, M. Mastrodicasa, S. Mastroianni, J. Mauro, Gennaro Miele, Pasquale Migliozzi, E. Migneco, M. L. Mitsou, C. M. Mollo, L. Morales-Gallegos, A. Moussa, I. Mozun Mateo, R. Muller, M. R. Musone, M. Musumeci, Sergio Navas, Amid Nayerhoda, C. A. Nicolau, B. Nkosi, B. Ó Fearraigh, V. Oliviero, A. Orlando, E. Oukacha, D. Paesani, Juan Palacios González, G. Papalashvili, V. Parisi, E. J. Pastor Gomez, C. Pastore, A. M. Paun, G. E. Pavalas, S. Peña Martínez, M. Perrin-Terrin, V. Pestel, R. Pestes, P. Piattelli, A. Plavin, C. Poirè, V. Popa, T. Pradier, J. Prado, S. Pulvirenti, C. A. Quiroz-Rangel, N. Randazzo, S. Razzaque, I. C. Rea, Diego Real, Giorgio Riccobene, J. Robinson, A. Romanov, E. Ros, A. Saina, Francisco Salesa Greus, D. F. E. Samtleben, Agustín Sánchez Losa, Silvia Sanfilippo, M. Sanguineti, D. Santonocito, P. Sapienza, J. Schnabel, J. Schumann, H. M. Schutte, J. Seneca, Irene Sgura, R. Shanidze, A. Sharma, Yury Shitov, F. Simkovic, A. Simonelli, A. Sinopoulou, Bernardino Spisso, Maurizio Spurio, Dimitris Stavropoulos, I. Stekl, S. M. Stellacci, M. Taiuti, Y. Tayalati, H. Thiersen, S. Thoudam, I. Tosta e Melo, B. Trocme, V. Tsourapis, Alexandru Tudorache, E. Tzamariudaki, A. Ukleja, Antonin Vacheret, V. Valsecchi, V. Van Elewyck, G. Vannoye, G. Vasileiadis, F. Vazquez de Sola, Alessandro Veutro, Salvatore Viola, D. Vivolo, A. van Vliet, E. de Wolf, I. Lhenry-Yvon, S. Zavatarelli, Angela Zegarelli, D. Zito, Juan de Dios Zornoza, Juan Zúñiga, Natalia Zywucka
2024 J jnl
Comput. Phys. Commun.
Sebastiano Aiello, Albert Akhriev, Sergio Alves Garre, Zineb Aly, Antonio Ambrosone, Fabrizio Ameli, Michel André, E. Androutsou, Marco Anghinolfi, Mancia Anguita, L. Aphecetche, M. Ardid, S. Ardid, H. Atmani, Julien Aublin, Christos Bagatelas, L. Bailly-Salins, Z. Bardacová, Bruny Baret, S. Basegmez du Pree, Y. Becherini, Meriem Bendahman, F. Benfenati, M. Benhassi, D. M. Benoit, Edward Berbee, Vincent Bertin, Vincent van Beveren, Simone Biagi, M. Boettcher, J. Boumaaza, M. Bouta, M. Bouwhuis, C. Bozza, R. M. Bozza, H. Brânzas, F. Bretaudeau, Ronald Bruijn, J. Brunner, R. Bruno, E. Buis, Raffaele Buompane, J. Busto, B. Caiffi, David Calvo, S. Campion, A. Capone, F. Carenini, V. Carretero, T. Cartraud, P. Castaldi, V. Cecchini, S. Celli, L. Cerisy, M. Chabab, M. Chadolias, Andrew Chen, S. Cherubini, T. Chiarusi, M. Circella, R. Cocimano, J. A. B. Coelho, Alexis Coleiro, R. Coniglione, P. Coyle, A. Creusot, A. Cruz, G. Cuttone, Richard Dallier, Y. Darras, A. De Benedittis, B. De Martino, V. Decoene, R. Del Burgo, Letizia Stella Di Mauro, I. Di Palma, Antonio F. Díaz, Dídac Diego-Tortosa, C. Distefano, A. Domi, C. Donzaud, Damien Dornic, M. Dörr, E. Drakopoulou, D. Drouhin, R. Dvornický, T. Eberl, E. Eckerová, A. Eddymaoui, T. van Eeden, M. Eff, D. van Eijk, I. El Bojaddaini, S. El Hedri, A. Enzenhöfer, G. Ferrara, M. D. Filipovic, F. Filippini, L. A. Fusco, O. Gabella, J. Gabriel, S. Gagliardini, T. Gal, Juan García Méndez, Alfonso Garcia Soto, C. Gatius Oliver, N. Geißelbrecht, H. Ghaddari, L. Gialanella, B. K. Gibson, E. Giorgio, A. Girardi, I. Goos, D. Goupilliere, Sara Rebecca Gozzini, R. Gracia, K. Graf, C. Guidi, B. Guillon, M. Gutiérrez, H. van Haren, A. Heijboer, A. Hekalo, L. Hennig, Juan José Hernández-Rey, F. Huang, W. Idrissi Ibnsalih, Giulia Illuminati, C. W. James, P. Jansweijer, M. de Jong, P. de Jong, B. J. Jung, P. Kalaczynski, O. Kalekin, U. F. Katz, N. R. Khan Chowdhury, A. Khatun, G. Kistauri, C. Kopper, A. Kouchner, V. Kulikovskiy, R. Kvatadze, M. Labalme, Robert Lahmann, G. Larosa, C. Lastoria, A. Lazo, S. Le Stum, G. Lehaut, E. Leonora, N. Lessing, G. Levi, M. Lindsey Clark, Fabio Longhitano, J. Majumdar, L. Malerba, Fadahat Mamedov, J. Manczak, A. Manfreda, Martina Marconi, A. Margiotta, A. Marinelli, C. Markou, L. Martin, J. A. Martínez-Mora, F. Marzaioli, M. Mastrodicasa, S. Mastroianni, S. Miccichè, Gennaro Miele, Pasquale Migliozzi, E. Migneco, S. Minutoli, M. L. Mitsou, C. M. Mollo, L. Morales-Gallegos, C. Morley-Wong, A. Mosbrugger, A. Moussa, I. Mozun Mateo, R. Muller, M. R. Musone, M. Musumeci, L. Nauta, Sergio Navas, Amid Nayerhoda, C. A. Nicolau, B. Nkosi, B. Ó Fearraigh, V. Oliviero, A. Orlando, E. Oukacha, Juan Palacios González, G. Papalashvili, E. J. Pastor Gomez, A. M. Paun, G. E. Pavalas, S. Peña Martínez, M. Perrin-Terrin, J. Perronnel, V. Pestel, R. Pestes, P. Piattelli, C. Poirè, V. Popa, T. Pradier, S. Pulvirenti, Gilles Quéméner, C. Quiroz, U. Rahaman, N. Randazzo, S. Razzaque, I. C. Rea, Diego Real, S. Reck, Giorgio Riccobene, J. Robinson, A. Romanov, A. Saina, Francisco Salesa Greus, D. F. E. Samtleben, Agustín Sánchez Losa, M. Sanguineti, C. Santonastaso, D. Santonocito, P. Sapienza, Y. Scarpetta, J. Schnabel, M. F. Schneider, J. Schumann, H. M. Schutte, J. Seneca, B. Setter, I. Sgura, R. Shanidze, Yury Shitov, F. Simkovic, A. Simonelli, A. Sinopoulou, M. V. Smirnov, Bernardino Spisso, Maurizio Spurio, Dimitris Stavropoulos, I. Stekl, M. Taiuti, Y. Tayalati, H. Tedjditi, H. Thiersen, I. Tosta e Melo, B. Trocme, S. Tsagkli, V. Tsourapis, E. Tzamariudaki, Antonin Vacheret, V. Valsecchi, V. Van Elewyck, G. Vannoye, G. Vasileiadis, F. Vazquez de Sola, C. Verilhac, Alessandro Veutro, Salvatore Viola, D. Vivolo, H. Warnhofer, Jörn Wilms, E. de Wolf, H. Yepes-Ramirez, G. Zarpapis, S. Zavatarelli, Angela Zegarelli, D. Zito, Juan de Dios Zornoza, Juan Zúñiga, Natalia Zywucka
2021 J jnl
Biomed. Signal Process. Control.
Kirsty A. Jones, Craig A. Paterson, D. J. Hamilton, A. D. Small, W. Martin, J. Robinson, N. E. R. Goodfield
2017 J jnl
Comput. Geosci.
M. Elwaseif, J. Robinson, F. D. Day-Lewis, D. Ntarlagiannis, L. D. Slater, J. W. Lane, B. J. Minsley, G. Schultz
2014 J jnl
IET Image Process.
Ziran Wu, J. Robinson
2003 conf
VVG
Enrico Costanza, J. Robinson
1997 J jnl
Signal Process. Image Commun.
M. Nakajima, J. Robinson, A. Clark
1995 B conf
ICIP
L. Strub, J. Robinson
1990 J jnl
Comput. Commun. Rev.
J. Robinson, Dan Friedman, Martha Steenstrup
1988 A* conf
INFOCOM
Samuel T. Chanson, Kaliappa Ravindran, J. Robinson
1986 J jnl
Int. J. Man Mach. Stud.
Alan Burns, J. Robinson
1986
J. Robinson
1985 J jnl
Comput. J.
J. Robinson, Alan Burns
1976 Misc conf
ICASSP
J. Robinson, John R. Welch, Charles F. Teacher
tests/unit/test_decompile_medium_level.py
← Index tests/unit/test_decompile_medium_level.py python
# tests/unit/test_decompile_medium_level.py
"""Unit tests (mocked BN) for bninja/analysis/medium_level.py
   and bninja/analysis/medium_level_normalization.py."""
# tests/unit/test_decompile_medium_level.py
import sys
from unittest.mock import MagicMock, patch

# Installa gli stubs BN
from tests.unit.conftest_binja_stubs import install_binja_stubs
install_binja_stubs()

# ── Definisci MockMLILInstruction PRIMA di importare il modulo ──
class MockMLILInstruction:
    def __init__(self, operation, address=0, operands=None):
        self.operation = operation
        self.address = address
        self.operands = operands or []

# ── Patcha il modulo BN in modo che isinstance() funzioni ──
sys.modules["binaryninja"].MediumLevelILInstruction = MockMLILInstruction
sys.modules["binaryninja"].SSAVariable = type("SSAVariable", (), {})
sys.modules["binaryninja"].Variable = type("Variable", (), {})
sys.modules["binaryninja"].ILIntrinsic = type("ILIntrinsic", (), {})

# Ora importa il modulo — vede già i tipi corretti
from redb.extractors.decompiler.bninja.analysis.medium_level_normalization import (
    MediumLevelNormalization,
)	

class MockMLILFunction:
    def __init__(self, instructions):
        self._instructions = instructions

    @property
    def instructions(self):
        return iter(self._instructions)

    @property
    def basic_blocks(self):
        # one block containing all instructions, good enough for MinHasher
        block = MagicMock()
        block.__iter__ = lambda self_: iter([])  # not used by MediumLevelAnalysis
        return [block]


class MockFunction:
    def __init__(self, name="func", start=0x1000, mlil=None):
        self.name = name
        self.start = start
        self.mlil = mlil



class TestMediumLevelNormalization:
    def setup_method(self):
        from redb.extractors.decompiler.bninja.analysis.medium_level_normalization import (
            MediumLevelNormalization,
        )
        self.norm = MediumLevelNormalization()

    def test_normalize_skeleton_single_instruction(self):
        il = MockMLILInstruction(operation=42, operands=[])
        result = self.norm.normalize_instruction_all_levels(il)
        assert result == [42]

    def test_normalize_skeleton_nested(self):
        inner = MockMLILInstruction(operation=7, operands=[])
        outer = MockMLILInstruction(operation=1, operands=[inner])
        result = self.norm.normalize_instruction_all_levels(outer)
        assert result == [1, 7]

    def test_normalize_skeleton_with_list_operand(self):
        inner_a = MockMLILInstruction(operation=10, operands=[])
        inner_b = MockMLILInstruction(operation=11, operands=[])
        outer = MockMLILInstruction(operation=2, operands=[[inner_a, inner_b]])
        result = self.norm.normalize_instruction_all_levels(outer)
        assert result == [2, 10, 11]

    def test_normalize_skeleton_none(self):
        result = self.norm.normalize_instruction_all_levels(None)
        # collect on None should leave ops empty
        assert result == []

    def test_normalize_typed_appends_leaf_types(self):
        # operand is a plain int -> "CONST"
        il = MockMLILInstruction(operation=3, operands=[42])
        result = self.norm.normalize_instr_with_operands(il)
        assert result == [3, "CONST"]

    def test_normalize_typed_bool_before_int(self):
        # bool must be detected before int (since bool is an int subclass)
        il = MockMLILInstruction(operation=4, operands=[True])
        result = self.norm.normalize_instr_with_operands(il)
        assert result == [4, "BOOL"]

    def test_normalize_typed_float(self):
        il = MockMLILInstruction(operation=5, operands=[1.5])
        result = self.norm.normalize_instr_with_operands(il)
        assert result == [5, "FLOAT_CONST"]

    def test_normalize_typed_str(self):
        il = MockMLILInstruction(operation=6, operands=["hello"])
        result = self.norm.normalize_instr_with_operands(il)
        assert result == [6, "STR"]

    def test_normalize_typed_unknown_falls_back_to_typename(self):
        class Weird:
            pass
        il = MockMLILInstruction(operation=8, operands=[Weird()])
        result = self.norm.normalize_instr_with_operands(il)
        assert result == [8, "WEIRD"]

    def test_normalize_typed_nested_mlil(self):
        inner = MockMLILInstruction(operation=99, operands=[7])
        outer = MockMLILInstruction(operation=1, operands=[inner])
        result = self.norm.normalize_instr_with_operands(outer)
        assert result == [1, 99, "CONST"]

    def test_normalize_typed_list_mixed(self):
        inner = MockMLILInstruction(operation=50, operands=[])
        il = MockMLILInstruction(operation=2, operands=[[inner, 99]])
        result = self.norm.normalize_instr_with_operands(il)
        assert result == [2, 50, "CONST"]


class TestMediumLevelAnalysis:
    def _make_analysis(self, instructions=None, mlil=True, start=0x1000):
        from redb.extractors.decompiler.bninja.analysis.medium_level import (
            MediumLevelAnalysis,
        )
        mlil_func = MockMLILFunction(instructions or []) if mlil else None
        func = MockFunction(name="testfunc", start=start, mlil=mlil_func)
        bv = MagicMock()
        return MediumLevelAnalysis(func, bv, MagicMock())

    def test_collect_returns_empty_when_no_mlil(self):
        a = self._make_analysis(mlil=False)
        sk, sk_addr, ty, ty_addr = a._collect_mlil_skeleton_and_typed()
        assert sk == [] and sk_addr == [] and ty == [] and ty_addr == []

    def test_collect_skeleton_and_typed_basic(self):
        instrs = [
            MockMLILInstruction(operation=1, address=0x1000, operands=[]),
            MockMLILInstruction(operation=2, address=0x1004, operands=[42]),
        ]
        a = self._make_analysis(instructions=instrs, start=0x1000)
        sk, sk_addr, ty, ty_addr = a._collect_mlil_skeleton_and_typed()

        assert sk == [[1], [2]]
        assert ty == [[1], [2, "CONST"]]
        assert sk_addr == [(0, [1]), (4, [2])]
        assert ty_addr == [(0, [1]), (4, [2, "CONST"])]

    def test_collect_negative_offset_clamped_to_zero(self):
        instrs = [
            MockMLILInstruction(operation=1, address=0x900, operands=[]),
        ]
        a = self._make_analysis(instructions=instrs, start=0x1000)
        _, sk_addr, _, ty_addr = a._collect_mlil_skeleton_and_typed()
        assert sk_addr[0][0] == 0
        assert ty_addr[0][0] == 0

    def test_log_error_records_entry(self):
        a = self._make_analysis()
        a.log_error("boom", "fname", 0x1234, ValueError("x"), "loc")
        assert len(a.errors) == 1
        err = a.errors[0]
        assert err["function_name"] == "fname"
        assert err["function_address"] == "4660"  # hex 0x1234
        assert err["error_location"] == "loc"
        assert err["error_message"] == "boom"
        assert err["error_type"] == "ValueError"
        assert "timestamp" in err

    @patch(
        "redb.extractors.decompiler.bninja.analysis.medium_level.MinHasher"
    )
    def test_analyze_returns_expected_keys(self, mock_minhasher):
        mock_minhasher.return_value.calculateMinHash.return_value = [1, 2, 3]

        instrs = [
            MockMLILInstruction(operation=1, address=0x1000, operands=[]),
            MockMLILInstruction(operation=2, address=0x1004, operands=[42]),
            MockMLILInstruction(operation=3, address=0x1008, operands=[]),
        ]
        a = self._make_analysis(instructions=instrs, start=0x1000)
        result, errors = a.analyze()

        expected_keys = {
            "function_address",
            "body_mlil_skeleton_vector",
            "sha256_mlil_skeleton",
            "tlsh_mlil_skeleton",
            "minhash_mlil_skeleton",
            "body_mlil_typed_vector",
            "sha256_mlil_typed",
            "tlsh_mlil_typed",
            "minhash_mlil_typed",
        }
        assert set(result.keys()) == expected_keys
        assert result["function_address"] == 0x1000
        assert result["minhash_mlil_skeleton"] == [1, 2, 3]
        assert result["minhash_mlil_typed"] == [1, 2, 3]
        assert errors == []

    @patch(
        "redb.extractors.decompiler.bninja.analysis.medium_level.MinHasher"
    )
    def test_analyze_empty_mlil(self, mock_minhasher):
        mock_minhasher.return_value.calculateMinHash.return_value = []
        a = self._make_analysis(mlil=False)
        result, errors = a.analyze()
        assert result["body_mlil_skeleton_vector"] == []
        assert result["body_mlil_typed_vector"] == []
        assert errors == []

    @patch(
        "redb.extractors.decompiler.bninja.analysis.medium_level.MinHasher"
    )
    def test_analyze_sha256_differs_skeleton_vs_typed(self, mock_minhasher):
        mock_minhasher.return_value.calculateMinHash.return_value = []

        instrs = [
            MockMLILInstruction(operation=1, address=0x1000, operands=[42]),
            MockMLILInstruction(operation=2, address=0x1004, operands=["foo"]),
            MockMLILInstruction(operation=3, address=0x1008, operands=[True]),
        ]
        a = self._make_analysis(instructions=instrs)
        result, _ = a.analyze()
        # skeleton ignores operand leaves, typed includes them -> different hashes
        assert result["sha256_mlil_skeleton"] != result["sha256_mlil_typed"]


class TestMinHasherMLILKinds:
    def _make_func(self, instrs):
        # MinHasher iterates basic_blocks then over each block
        block = MagicMock()
        block.__iter__ = lambda self_: iter(instrs)
        f = MagicMock()
        f.basic_blocks = [block]
        return f

    def test_mlil_skeleton_uses_medium_normalizer(self):
        from redb.extractors.decompiler.bninja.similarity.minhasher import (
            MinHasher, TokenKind,
        )
        instrs = [
            MockMLILInstruction(operation=i, operands=[]) for i in range(5)
        ]
        func = self._make_func(instrs)
        hasher = MinHasher(seed=42, il_function=func, kind=TokenKind.MLIL)
        result = hasher.calculateMinHash()
        # 5 instructions -> 3 trigrams -> non-empty signature
        assert result != []

    def test_typed_mlil_differs_from_skeleton(self):
        from redb.extractors.decompiler.bninja.similarity.minhasher import (
            MinHasher, TokenKind,
        )
        instrs = [
            MockMLILInstruction(operation=1, operands=[42]),
            MockMLILInstruction(operation=2, operands=["s"]),
            MockMLILInstruction(operation=3, operands=[True]),
            MockMLILInstruction(operation=4, operands=[1.5]),
        ]
        func = self._make_func(instrs)
        skel = MinHasher(seed=42, il_function=func, kind=TokenKind.MLIL).calculateMinHash()
        typed = MinHasher(seed=42, il_function=func, kind=TokenKind.TYPED_MLIL).calculateMinHash()
        # Same seed, same instructions, but typed has extra leaf tokens
        # -> hashes should generally differ
        assert skel != typed

    def test_mlil_too_few_instructions(self):
        from redb.extractors.decompiler.bninja.similarity.minhasher import (
            MinHasher, TokenKind,
        )
        instrs = [MockMLILInstruction(operation=1, operands=[])] * 2
        func = self._make_func(instrs)
        hasher = MinHasher(seed=42, il_function=func, kind=TokenKind.MLIL)
        assert hasher.calculateMinHash() == []

    def test_unsupported_kind_raises(self):
        from redb.extractors.decompiler.bninja.similarity.minhasher import MinHasher
        func = self._make_func([])
        hasher = MinHasher(seed=42, il_function=func, kind="bogus")
        with pytest.raises(ValueError):
            hasher.calculateMinHash()