Weimin Lei

86 papers Misc 1Journal 63Unranked 22
YearRankTypeTitle / Venue / Authors
2026 J jnl
Expert Syst. Appl.
Wenhui Ye, Weimin Lei, Wenchao Zhang, Wei Zhang
2026 J jnl
Pattern Recognit.
Wei Wang, Weimin Lei, Wei Zhang, Bojian Song, Guanghui Zhang, Yuanze Meng
2026 J jnl
ACM Trans. Multim. Comput. Commun. Appl.
Xinyi Chen, Weimin Lei, Wei Zhang, Wenhui Ye, Yanwen Wang
2026 J jnl
Displays
Wengang Zhong, Yanwen Wang, Weimin Lei, Wei Zhang, Xinyi Chen
2025 J jnl
Displays
Qingyang Jing, Weimin Lei, Jing Liu, Tiantian Chu
2025 J jnl
Frontiers Artif. Intell.
Xiting Peng, Jinyan Liang, Xiaoyu Zhang, Haibo Yang, Weimin Lei
2025 Misc conf
ICASSP
Wei Wang, Bojian Song, Xi Chen, Yaxin Gao, Weimin Lei
2025 J jnl
J. Electronic Imaging
Honglong Lv, Xinyi Chen, Yanhao Shu, Weimin Lei, Wei Zhang, Hanyun Hu
2025 J jnl
IEEE Trans. Geosci. Remote. Sens.
Wenhui Ye, Weimin Lei, Wenchao Zhang, Wei Zhang
2025 J jnl
Symmetry
Xinyi Chen, Weimin Lei, Wei Zhang, Yanwen Wang, Mingxin Liu
2024 conf
ICMSS
Peng Zhang, Weimin Lei, Wei Zhang, Zhaonan Lin, Xinlei Zhao, Zhichao Li, Lijia Dong
2024 J jnl
IEEE Commun. Lett.
Liying Tian, Yan Ma, Weimin Lei, Yubo Li
2024 J jnl
Comput. Vis. Image Underst.
Peng Zhang, Xinlei Zhao, Lijia Dong, Weimin Lei, Wei Zhang, Zhaonan Lin
2024 J jnl
Signal Image Video Process.
Kai Ji, Weimin Lei, Wei Zhang
2024 J jnl
J. Real Time Image Process.
Peng Zhang, Lijia Dong, Xinlei Zhao, Weimin Lei, Wei Zhang
2024 J jnl
Vis. Comput.
Qingyang Jing, Peng Zhang, Wei Zhang, Weimin Lei
2024 J jnl
IET Image Process.
Dacheng Zhang, Wei Zhang, Weimin Lei, Xinyi Chen
2024 J jnl
Multim. Tools Appl.
Wenhui Ye, Weimin Lei, Wei Zhang, Tingting Yu, Xiang Feng
2024 J jnl
Multim. Syst.
Xinyi Chen, Weimin Lei, Wei Zhang, Huan Meng, Hantian Guo
2023 J jnl
Mach. Vis. Appl.
Kai Ji, Weimin Lei, Wei Zhang
2023 J jnl
Sensors
Peng Zhang, Weimin Lei, Xinlei Zhao, Lijia Dong, Zhaonan Lin
2023 J jnl
Symmetry
Peng Zhang, Siqi Wang, Wei Zhang, Weimin Lei, Xinlei Zhao, Qingyang Jing, Mingxin Liu
2023 J jnl
J. Electronic Imaging
Dacheng Zhang, Weimin Lei, Wei Zhang, Xinyi Chen
2023 conf
ICCCS
Peng Zhang, Weimin Lei, Xinlei Zhao, Lijia Dong, Zhaonan Lin
2023 J jnl
IET Image Process.
Dacheng Zhang, Weimin Lei, Wei Zhang, Xinyi Chen
2023 conf
ICNCC
Peng Zhang, Weimin Lei, Xinlei Zhao, Lijia Dong, Zhaonan Lin
2023 J jnl
Expert Syst. Appl.
Wenhui Ye, Wei Zhang, Weimin Lei, Wenchao Zhang, Xinyi Chen, Yanwen Wang
2023 conf
ICCCS
Lei Yang, Weimin Lei
2023 J jnl
Int. J. Pattern Recognit. Artif. Intell.
Kai Ji, Weimin Lei, Wei Zhang
2022 J jnl
Frontiers Neurorobotics
Lei Yang, Weimin Lei, Wei Zhang, Tianbing Ye
2022 conf
ICCCS
Hao Li, Weimin Lei, Wei Zhang
2021 J jnl
Int. J. Commun. Syst.
Songyang Zhang, Weimin Lei, Wei Zhang, Hao Li
2021 J jnl
Int. J. Sens. Networks
Songyang Zhang, Weimin Lei
2021 J jnl
Trans. Emerg. Telecommun. Technol.
Songyang Zhang, Weimin Lei, Wei Zhang, Yunchong Guan
2020 J jnl
IEEE Access
Wei Zhang, Weimin Lei, Songyang Zhang
2020 J jnl
Trans. Emerg. Telecommun. Technol.
Songyang Zhang, Weimin Lei, Wei Zhang, Yuzhuo Zhan, Hao Li
2020 conf
ICCCS
Hang Cao, Xiaowen Liu, Yida Wang, Yuting Li, Weimin Lei
2020 J jnl
IET Image Process.
Dacheng Zhang, Weimin Lei, Wei Zhang, Xinyi Chen
2020 conf
ICCCS
Hao Li, Weimin Lei, Wei Zhang
2020 J jnl
Int. J. Commun. Syst.
Songyang Zhang, Weimin Lei, Wei Zhang, Yuzhuo Zhan, Hao Li
2020 J jnl
IEEE Access
Shuo Li, Weimin Lei, Wei Zhang, Xiaoyu Wang, Lidong Wang
2019 J jnl
Symmetry
Yunchong Guan, Weimin Lei, Wei Zhang, Yuzhuo Zhan, Hao Li, Songyang Zhang
2019 J jnl
Symmetry
Yuzhuo Zhan, Weimin Lei, Yunchong Guan
2019 J jnl
Comput. Commun.
Hao Li, Weimin Lei, Wei Zhang, Yunchong Guan
2019 J jnl
Signal Image Video Process.
Dacheng Zhang, Weimin Lei, Wei Zhang, Xinyi Chen
2019 J jnl
CoRR
Songyang Zhang, Weimin Lei
2019 J jnl
IEEE Access
Songyang Zhang, Weimin Lei, Wei Zhang, Yunchong Guan, Hao Li
2019 conf
SimuTools
Songyang Zhang, Weimin Lei, Wei Zhang, Yunchong Guan
2019 J jnl
Inf. Sci.
Xiaoshi Song, Mengying Yuan, Chao Jia, Ning Ye, Weimin Lei
2019 J jnl
IET Biom.
Zhaozheng Li, Weimin Lei, Wei Zhang
2019 J jnl
Int. J. Commun. Syst.
Yunchong Guan, Weimin Lei, Wei Zhang, Hao Li, Songyang Zhang
2019 J jnl
J. Electronic Imaging
Dacheng Zhang, Weimin Lei, Wei Zhang, Xinyi Chen
2018 J jnl
Informatica
Chong Fu, Gao-yuan Zhang, Mai Zhu, Junxin Chen, Weimin Lei
2018 J jnl
Secur. Commun. Networks
Chong Fu, Gao-yuan Zhang, Mai Zhu, Zhe Chen, Weimin Lei
2018 J jnl
Secur. Commun. Networks
Zhaozheng Li, Weimin Lei, Wei Zhang, KwangHyok Jo
2018 J jnl
Int. J. Netw. Secur.
KwangHyok Jo, Weimin Lei, Zhaozheng Li, Xiaoshi Song
2018 J jnl
Int. J. Commun. Syst.
Zhaozheng Li, Weimin Lei
2018 J jnl
Int. J. Commun. Syst.
Guangye Li, Shaowei Liu, Hao Li, Weimin Lei, Wei Zhang
2018 conf
ICACT
Lidan Shang, Qiushi Yang, Jianing Wang, Shubin Li, Weimin Lei
2018 J jnl
Int. J. Pattern Recognit. Artif. Intell.
Yutong Gao, Weimin Lei, Xie Xie, Yue Fu, Lu Zhang
2018 J jnl
Comput. Networks
Yunchong Guan, Weimin Lei, Wei Zhang, Shaowei Liu, Hao Li
2018 J jnl
CoRR
Songyang Zhang, Weimin Lei, Wei Zhang, Yunchong Guan
2017 conf
ISPA/IUCC
Chong Fu, Gao-yuan Zhang, Mai Zhu, Li-ying Cong, Weimin Lei
2017 J jnl
J. Inf. Sci. Eng.
Xiao Yu, Weimin Lei, Wei Zhang, Li Song
2017 J jnl
Int. J. Commun. Syst.
Wei Zhang, Zhaolong Ning, Weimin Lei, Zhikui Chen
2017 J jnl
Comput. Networks
Shaowei Liu, Weimin Lei, Wei Zhang, Yunchong Guan
2017 J jnl
IEEE Access
Xiaoshi Song, Yuting Geng, Xiangbo Meng, Jun Liu, Weimin Lei, Yingyou Wen
2017 J jnl
Int. J. Commun. Syst.
Wei Zhang, Weimin Lei, Yunchong Guan, Guangye Li, Lei Yang
2017 J jnl
KSII Trans. Internet Inf. Syst.
Shaowei Liu, Weimin Lei, Wei Zhang, Hao Li
2017 J jnl
KSII Trans. Internet Inf. Syst.
Shaowei Liu, Weimin Lei, Wei Zhang, Xiaoshi Song
2017 conf
5GWN
Xiaoshi Song, Yuting Geng, Xiangbo Meng, Ning Ye, Jun Liu, Weimin Lei
2016 conf
ICCSE
Ying Bao, Weimin Lei, Wei Zhang, Jian Song
2015 conf
INFOCOM Workshops
Weimin Lei, Hao Li, Wei Zhang, Shaowei Liu, Yunchong Guan
2014 J jnl
Entropy
Chong Fu, Jun-Bin Huang, Ning-Ning Wang, Qi-Bin Hou, Weimin Lei
2014 J jnl
Comput. Commun.
Wei Zhang, Weimin Lei, Shaowei Liu, Guangye Li
2013 conf
IEEE CLOUD
Wei Zhang, Weimin Lei, Xiao Chen, Shaowei Liu
2012 conf
CICSyN
Hao Cheng, Weimin Lei
2012 conf
SOLI
Xinxin Bai, Shaocong Han, Haifeng Wang, Wenjun Yin, Rongfu Sun, Tao Zhang, Jun Liu, Weimin Lei
2012 conf
CICSyN
Xingchen Lu, Weimin Lei, Wei Zhang
2010 J jnl
J. Networks
Junchao Li, Weimin Lei, Haiyang Si
2010 J jnl
Int. J. Commun. Netw. Syst. Sci.
Xiuwu Zhang, Ruifeng Guo, Weimin Lei, Wei Zhang
2009 conf
HIS (2)
Wei Zhang, Weimin Lei, Hongbin Li
2009 conf
HIS (2)
Haibo Yang, Hu Lin, Jin Li, Weimin Lei
2009 conf
HIS (2)
Jinghua Lin, Weimin Lei, Yong Liu
2008 conf
ISCSCT (1)
Wei Zhang, Weimin Lei, Xiuwu Zhang
2008 conf
ICYCS
Xiuwu Zhang, Weimin Lei, Wei Zhang
tests/integration/test_pe_extractor.py
← Index tests/integration/test_pe_extractor.py python
"""
Integration tests for the PEExtractor base class.
"""
import pytest
from unittest.mock import Mock, patch, MagicMock

pytestmark = [pytest.mark.integration, pytest.mark.pe]


class TestPEExtractorInitialization:
    """Tests for PEExtractor initialization."""

    def test_pe_extractor_with_valid_pe(self, pe_binary_path, mock_logger):
        """Test PEExtractor initialization with valid PE file."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            assert extractor.pe is not None
            assert extractor.filepath == pe_binary_path

    def test_pe_extractor_with_provided_pe_object(self, pe_binary_path, mock_logger, pe_object):
        """Test PEExtractor initialization with pre-existing PE object."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger, pe=pe_object)

            # Should use the provided PE object, not create a new one
            assert extractor.pe is pe_object

    def test_pe_extractor_with_invalid_file(self, elf_binary_path, mock_logger):
        """Test PEExtractor initialization with non-PE file."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(elf_binary_path, mock_logger)

            # Should return None for pe when file is not a valid PE
            assert extractor.pe is None
            # Logger should have recorded an error
            assert mock_logger.error.called


class TestPEExtractorMethods:
    """Tests for PEExtractor helper methods."""

    def test_check_dotnet_true(self, pe_binary_path, mock_logger):
        """Test _check_dotnet returns True for .NET PE."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            # The test PE file is a .NET binary
            if extractor.pe is not None:
                result = extractor._check_dotnet()
                # d8637bdbcfc9112fcb1f0167b398e771 is a .NET binary
                assert result is True

    def test_check_dotnet_false(self, elf_binary_path, mock_logger):
        """Test _check_dotnet returns False for non-PE file."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(elf_binary_path, mock_logger)

            # Should return False when PE is None
            result = extractor._check_dotnet()
            assert result is False

    def test_is_signed_false(self, pe_binary_path, mock_logger):
        """Test _is_signed method."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            if extractor.pe is not None:
                result = extractor._is_signed()
                # Result depends on the actual binary
                assert isinstance(result, bool)

    def test_has_overlay(self, pe_binary_path, mock_logger):
        """Test _has_overlay method."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            if extractor.pe is not None:
                result = extractor._has_overlay()
                assert isinstance(result, bool)


class TestGeneratePEFileObject:
    """Tests for _generate_pefile_object method."""

    def test_generate_pefile_object_valid(self, pe_binary_path, mock_logger):
        """Test _generate_pefile_object with valid PE file."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            # The PE object should be created successfully
            assert extractor.pe is not None

    def test_generate_pefile_object_invalid(self, temp_text_file, mock_logger):
        """Test _generate_pefile_object with invalid file."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(temp_text_file, mock_logger)

            # Should return None for invalid PE
            assert extractor.pe is None


class TestGenerateDotNetFileObject:
    """Tests for _generate_dotnetfile_object method."""

    def test_generate_dotnetfile_object_valid(self, pe_binary_path, mock_logger):
        """Test _generate_dotnetfile_object with .NET PE file."""
        from redb.extractors.pe_extractors.pe_dotnet import PEDotNetExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEDotNetExtractor(pe_binary_path, mock_logger)

            if extractor.pe is not None and extractor._check_dotnet():
                dotnet, error = extractor._generate_dotnetfile_object()
                # Should create dotnet object for .NET PE
                assert dotnet is not None
                assert error is None

    def test_generate_dotnetfile_object_invalid(self, elf_binary_path, mock_logger):
        """Test _generate_dotnetfile_object with non-.NET file."""
        from redb.extractors.pe_extractors.pe_dotnet import PEDotNetExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEDotNetExtractor(elf_binary_path, mock_logger)

            dotnet, error = extractor._generate_dotnetfile_object()
            # Should return error for non-.NET file
            assert dotnet is None
            assert error is not None


class TestPEExtractorTag:
    """Tests for tag method in PE extractors."""

    def test_pe_features_tag(self, pe_binary_path, mock_logger):
        """Test that PEFeaturesExtractor returns correct tag."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor
        from redb.extractors.enum import Tag

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)
            assert extractor.tag() == Tag.PE_FEATURES.value

    def test_pe_import_tag(self, pe_binary_path, mock_logger):
        """Test that PEImportExtractor returns correct tag."""
        from redb.extractors.pe_extractors.pe_imports import PEImportExtractor
        from redb.extractors.enum import Tag

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEImportExtractor(pe_binary_path, mock_logger)
            assert extractor.tag() == Tag.PE_IMPORT.value

    def test_pe_section_tag(self, pe_binary_path, mock_logger):
        """Test that PESectionExtractor returns correct tag."""
        from redb.extractors.pe_extractors.pe_sections import PESectionExtractor
        from redb.extractors.enum import Tag

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PESectionExtractor(pe_binary_path, mock_logger)
            assert extractor.tag() == Tag.PE_SECTION.value


class TestPEExtractorClickHouseTable:
    """Tests for get_clickhouse_table method in PE extractors."""

    def test_pe_features_clickhouse_table(self, pe_binary_path, mock_logger):
        """Test that PEFeaturesExtractor returns correct ClickHouse table name."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)
            assert extractor.get_clickhouse_table() == "redb_pe_features"

    def test_pe_import_clickhouse_table(self, pe_binary_path, mock_logger):
        """Test that PEImportExtractor returns correct ClickHouse table name."""
        from redb.extractors.pe_extractors.pe_imports import PEImportExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEImportExtractor(pe_binary_path, mock_logger)
            assert extractor.get_clickhouse_table() == "redb_pe_imports"

    def test_pe_section_clickhouse_table(self, pe_binary_path, mock_logger):
        """Test that PESectionExtractor returns correct ClickHouse table name."""
        from redb.extractors.pe_extractors.pe_sections import PESectionExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PESectionExtractor(pe_binary_path, mock_logger)
            assert extractor.get_clickhouse_table() == "redb_pe_sections"


class TestPEExtractorPrepareExportData:
    """Tests for prepare_export_data method in PE extractors."""

    def test_pe_features_prepare_export_elasticsearch(self, pe_binary_path, mock_logger):
        """Test prepare_export_data for Elasticsearch."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            if extractor.pe is not None:
                # First extract
                extractor.extract()
                result = extractor.prepare_export_data("ElasticsearchExporter")
                # Should return the pe_features dataclass
                assert result is extractor.pe_features

    def test_pe_features_prepare_export_clickhouse(self, pe_binary_path, mock_logger):
        """Test prepare_export_data for ClickHouse."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            if extractor.pe is not None:
                # First extract
                extractor.extract()
                result = extractor.prepare_export_data("ClickHouseExporter")

                # Should return tuple of (data, column_names, column_type_names)
                assert isinstance(result, tuple)
                assert len(result) == 3
                data, column_names, column_type_names = result
                assert isinstance(data, list)
                assert isinstance(column_names, list)
                assert isinstance(column_type_names, list)
                # Column names and types should match in length
                assert len(column_names) == len(column_type_names)