Walid Abdelmoez

18 papers A* 1A 1C 4Journal 2Unranked 10
YearRankTypeTitle / Venue / Authors
2024 conf
ICCA
Mina Samir, Nada Sherief, Walid Abdelmoez
2022 conf
ICCTA
Wessam Ahmed AlBakary, Ahmed Ahmed Hesham Sedky, Walid Abdelmoez
2021 conf
FedCSIS (Position Papers)
Mostafa Alshamy, Walid Abdelmoez, Essam-Eldean Elfakharany, Hany H. Ammar
2019 conf
IDEAL (2)
Ahmed K. Taha, Mohamed Hamed Kholief, Walid Abdelmoez
2018 conf
ICCTA
Farida Orabi, Essam Kosba, Walid Abdelmoez
2015 conf
SOLI
Adnane Ghannem, Mohamed Salah Hamdi, Walid Abdelmoez, Hany H. Ammar
2007 C conf
AICCSA
Islam A. M. El-Maddah, Walid Abdelmoez, Hany H. Ammar
2007 C conf
AICCSA
Walid Abdelmoez, Katerina Goseva-Popstojanova, Hany H. Ammar
2006 C conf
AICCSA
Israr Pasha Shaik, Walid Abdelmoez, Rajesh Gunnalan, Ali Mili, Christopher P. Fuhrman, Mark Shereshevsky, A. Zeid, Hany H. Ammar
2005 conf
WICSA
Israr Pasha Shaik, Walid Abdelmoez, Rajesh Gunnalan, Mark Shereshevsky, A. Zeid, Hany H. Ammar, Ali Mili, Christopher P. Fuhrman
2005 A conf
ISSRE
Petar Popic, Dejan Desovski, Walid Abdelmoez, Bojan Cukic
2005 J jnl
IEEE Trans. Software Eng.
Vittorio Cortellessa, Katerina Goseva-Popstojanova, Kalaivani Appukkutty, Ajith Guedem, Ahmed E. Hassan, Rania Elnaggar, Walid Abdelmoez, Hany H. Ammar
2005 C conf
AICCSA
Walid Abdelmoez, Mark Shereshevsky, Rajesh Gunnalan, Hany H. Ammar, Bo Yu, S. Bogazzi, Mustafa Korkmaz, Ali Mili
2004 conf
CCCT (2)
Bo Yu, Ali Mili, Walid Abdelmoez, Rajesh Gunnalan, Mark Shereshevsky, Hany H. Ammar
2004 conf
IEEE METRICS
Walid Abdelmoez, Diaa Eldin M. Nassar, Mark Shereshevsky, Nicholay Gradetsky, Rajesh Gunnalan, Hany H. Ammar, Bo Yu, Ali Mili
2004 conf
ICSM
Walid Abdelmoez, Mark Shereshevsky, Rajesh Gunnalan, Hany H. Ammar, Bo Yu, S. Bogazzi, Mustafa Korkmaz, Ali Mili
2003 A* conf
ICSE
Tianjian Wang, Ahmed E. Hassan, Ajith Guedem, Walid Abdelmoez, Katerina Goseva-Popstojanova, Hany H. Ammar
2003 J jnl
IEEE Trans. Software Eng.
Katerina Goseva-Popstojanova, Ahmed E. Hassan, Ajith Guedem, Walid Abdelmoez, Diaa Eldin M. Nassar, Hany H. Ammar, Ali Mili
redb/extractors/apk_extractor.py
← Index redb/extractors/apk_extractor.py python
import logging
import zipfile
from abc import ABCMeta, abstractmethod

from redb.extractors.extractor import Extractor

logger = logging.getLogger(__name__)


@abstractmethod
class APKExtractor(Extractor, metaclass=ABCMeta):

    def __init__(
        self,
        filepath,
        log,
        exporters=None,
        index_prefix=None,
        known_benign=False,
        known_malicious=False,
        apk=None,
    ):
        # Read binary data before calling super().__init__ so that the
        # binary property override is available during hash computation.
        with open(filepath, "rb") as f:
            self._binary_data = f.read()

        self.apk = apk if apk else self._generate_apk_object(filepath)

        super().__init__(
            filepath,
            log,
            exporters,
            index_prefix,
            known_benign=known_benign,
            known_malicious=known_malicious,
        )

    @property
    def binary(self):
        """Override to use already-read binary data."""
        return self._binary_data

    def _generate_apk_object(self, filepath):
        """Parse APK using androguard."""
        apk = None
        try:
            # Suppress verbose androguard loguru DEBUG/INFO output
            from loguru import logger as loguru_logger
            loguru_logger.disable("androguard")
            from androguard.core.apk import APK
            apk = APK(filepath)
            if not apk.is_valid_APK():
                logger.warning(
                    f"APK validation warning for {filepath}"
                )
                # Still return the object — partial parsing may still work
        except Exception as e:
            logger.error(
                f"Format error parsing APK {filepath}: {e}"
            )
        return apk

    def _is_valid_apk(self):
        """Check if the APK object was parsed successfully."""
        return self.apk is not None

    def _get_zip_file(self):
        """Get a zipfile.ZipFile handle for direct archive inspection."""
        try:
            return zipfile.ZipFile(self.filepath, 'r')
        except (zipfile.BadZipFile, Exception) as e:
            self.log.error(f"Failed to open APK as ZIP: {e}")
            return None

    def _list_files(self):
        """List all files in the APK archive."""
        if not self._is_valid_apk():
            return []
        try:
            return self.apk.get_files()
        except Exception as e:
            self.log.error(f"Error listing APK files: {e}")
            return []