James B. D. Joshi

85 papers A* 1A 1B 3C 20Misc 10Journal 18Unranked 20
YearRankTypeTitle / Venue / Authors
2025 conf
TPS-ISA
M. Amin Rahimian, Benjamin Panny, James B. D. Joshi
2025 J jnl
CoRR
Runhua Xu, Bo Li, Chao Li, James B. D. Joshi, Shuai Ma, Jianxin Li
2024 J jnl
IEEE Trans. Dependable Secur. Comput.
Runhua Xu, Bo Li, Chao Li, James B. D. Joshi, Shuai Ma, Jianxin Li
2019 A conf
ICDCS
Runhua Xu, James B. D. Joshi, Chao Li
2019 J jnl
CoRR
Runhua Xu, James B. D. Joshi, Chao Li
2018 ch.
Encyclopedia of Database Systems (2nd ed.)
Yue Zhang, James B. D. Joshi
2018 ch.
Encyclopedia of Database Systems (2nd ed.)
Yue Zhang, James B. D. Joshi
2018 ch.
Encyclopedia of Database Systems (2nd ed.)
Yue Zhang, James B. D. Joshi
2018 ch.
Encyclopedia of Database Systems (2nd ed.)
Yue Zhang, James B. D. Joshi
2018 ch.
Encyclopedia of Database Systems (2nd ed.)
Yue Zhang, James B. D. Joshi
2016 B conf
CLOUD
Runhua Xu, James B. D. Joshi
2016 J jnl
Multim. Syst.
Lei Jin, Xuelian Long, Ke Zhang, Yu-Ru Lin, James B. D. Joshi
2016 conf
CIC
Runhua Xu, James B. D. Joshi
2015 J jnl
Comput. Secur.
Jianfeng Lu, James B. D. Joshi, Lei Jin, Yiding Liu
2014 J jnl
Comput. Secur.
Youna Jung, James B. D. Joshi
2014 Misc conf
IRI
Saman Taghavi Zargar, James B. D. Joshi, David Tipper
2014 J jnl
Mob. Networks Appl.
Lakshmish Ramaswamy, Barbara Carminati, James B. D. Joshi, Calton Pu
2014 conf
WPES
Lei Jin, Hassan Takabi, Xuelian Long, James B. D. Joshi
2014 B conf
NSS
Nathalie Baracaldo, Balaji Palanisamy, James B. D. Joshi
2014 J jnl
Inf. Syst. Frontiers
Chengcui Zhang, Elisa Bertino, Bhavani Thuraisingham, James B. D. Joshi
2014 Misc conf
IRI
Balaji Palanisamy, Sheldon Sensenig, James B. D. Joshi, Rose Constantino
2014 A* conf
CCS
Lei Jin, Balaji Palanisamy, James B. D. Joshi
2013 J jnl
Comput. Secur.
Lei Jin, James B. D. Joshi, Mohd Anwar
2012 J jnl
Artif. Intell. Rev.
Youna Jung, Minsoo Kim, Amirreza Masoumzadeh, James B. D. Joshi
2012 Misc conf
IRI
Lei Jin, Xuelian Long, James B. D. Joshi, Mohd Anwar
2012 J jnl
Comput. Secur.
Youna Jung, James B. D. Joshi
2012 conf
HICSS
Hassan Takabi, James B. D. Joshi
2012 J jnl
Int. J. Cloud Comput.
Hassan Takabi, James B. D. Joshi
2012 C conf
CollaborateCom
Youna Jung, Minsoo Kim, James B. D. Joshi
2012 conf
BADGERS@CCS
Lei Jin, Xuelian Long, James B. D. Joshi
2011 C ed.
CollaborateCom
Dimitrios Georgakopoulos, James B. D. Joshi
2011 C conf
PST
Jesus M. Gonzalez, Mohd Anwar, James B. D. Joshi
2011 C conf
CollaborateCom
Jesus M. Gonzalez, Mohd Anwar, James B. D. Joshi
2011 J jnl
Int. J. Inf. Priv. Secur. Integr.
Lei Jin, Hassan Takabi, James B. D. Joshi
2011 conf
SPRINGL
Amirreza Masoumzadeh, James B. D. Joshi
2011 C conf
CollaborateCom
Saman Taghavi Zargar, Hassan Takabi, James B. D. Joshi
2011 Misc conf
IRI
Youna Jung, Minsoo Kim, James B. D. Joshi
2011 J jnl
J. Inf. Knowl. Manag.
Mehmet Kaya, James B. D. Joshi, Mei-Ling Shyu
2011 Misc conf
IRI
Reda Alhajj, James B. D. Joshi, Mei-Ling Shyu
2011 conf
CODASPY
Lei Jin, Hassan Takabi, James B. D. Joshi
2011 B conf
TrustCom
Jesus M. Gonzalez, Mohd Anwar, James B. D. Joshi
2010 C ed.
SACMAT
James B. D. Joshi, Barbara Carminati
2010 C conf
CollaborateCom
Saman Taghavi Zargar, James B. D. Joshi
2010 Misc conf
IRI
Reda Alhajj, James B. D. Joshi, Mei-Ling Shyu
2010 conf
SocialCom/PASSAT
Amirreza Masoumzadeh, James B. D. Joshi
2010 Misc conf
IRI
Reda Alhajj, Shu-Ching Chen, Gongzhu Hu, James B. D. Joshi, Gordon K. Lee, Stuart Harvey Rubin, Mei-Ling Shyu, Lotfi A. Zadeh
2010 conf
CTS
Yue Zhang, James B. D. Joshi
2010 conf
COMPSAC Workshops
Hassan Takabi, James B. D. Joshi, Gail-Joon Ahn
2010 J jnl
IEEE Secur. Priv.
Hassan Takabi, James B. D. Joshi, Gail-Joon Ahn
2010 conf
SocialCom/PASSAT
Lei Jin, Hassan Takabi, James B. D. Joshi
2010 C conf
SACMAT
Hassan Takabi, James B. D. Joshi
2010 conf
HT
Yanhui Guo, James B. D. Joshi
2010 conf
ICEIS (3)
Yue Zhang, James B. D. Joshi
2009 C conf
CollaborateCom
Hassan Takabi, James B. D. Joshi, Hassan A. Karimi
2009 ch.
Encyclopedia of Database Systems
Yue Zhang, James B. D. Joshi
2009 ch.
Encyclopedia of Database Systems
Yue Zhang, James B. D. Joshi
2009 conf
SWS
Hassan Takabi, Minsoo Kim, James B. D. Joshi, Michael B. Spring
2009 C ed.
CollaborateCom
Elisa Bertino, James B. D. Joshi
2009 ch.
Encyclopedia of Database Systems
Yue Zhang, James B. D. Joshi
2009 J jnl
Computer
Carlos E. Caicedo, James B. D. Joshi, Summit R. Tuladhar
2009 conf
SpringSim
Saman Taghavi Zargar, M. Amir Moulavi, Rajkumar Buyya, Mahmoud Naghibzadeh, James B. D. Joshi
2009 ch.
Encyclopedia of Database Systems
Yue Zhang, James B. D. Joshi
2009 ch.
Encyclopedia of Database Systems
Yue Zhang, James B. D. Joshi
2009 C ed.
CollaborateCom
James B. D. Joshi, Tao Zhang
2008 C conf
CollaborateCom
Minsoo Kim, James B. D. Joshi, Minkoo Kim
2008 J jnl
ACM Trans. Inf. Syst. Secur.
James B. D. Joshi, Elisa Bertino, Arif Ghafoor, Yue Zhang
2008 conf
SUTC
Summit R. Tuladhar, Carlos E. Caicedo, James B. D. Joshi
2008 conf
OTM Conferences (2)
Amirreza Masoumzadeh, James B. D. Joshi
2008 C conf
CollaborateCom
Youna Jung, Amirreza Masoumzadeh, James B. D. Joshi, Minkoo Kim
2008 conf
EUC (2)
Yue Zhang, James B. D. Joshi
2008 C conf
SACMAT
Yue Zhang, James B. D. Joshi
2007 C conf
CollaborateCom
Yue Zhang, James B. D. Joshi
2007 Misc conf
IRI
Yue Zhang, James B. D. Joshi
2007 C conf
IPCCC
Kai Ouyang, James B. D. Joshi
2007 C conf
IAS
Yue Zhang, James B. D. Joshi
2006 conf
iTrust
Suroop Mohan Chandran, Korporn Panyim, James B. D. Joshi
2006 Misc conf
IRI
Jun-Hyung Park, Minsoo Kim, BongNam Noh, James B. D. Joshi
2006 C conf
CollaborateCom
Michael Chuang, Suronapee Phoomvuthisarn, James B. D. Joshi
2006 C conf
SACMAT
James B. D. Joshi, Elisa Bertino
2006 C conf
SACMAT
Siqing Du, James B. D. Joshi
2005 conf
WORDS
Smithi Piromruen, James B. D. Joshi
2005 Misc conf
IRI
Suroop Mohan Chandran, James B. D. Joshi
2003
James B. D. Joshi
2002 J jnl
IEEE Trans. Multim.
James B. D. Joshi, Zhaohui Kevin Li, Husni Fahmi, Basit Shafiq, Arif Ghafoor
2002 ch.
Advances in Digital Government
James B. D. Joshi, Arif Ghafoor, Walid G. Aref, Eugene H. Spafford
redb/extractors/decompiler/bninja/arch/x86.py
← Index redb/extractors/decompiler/bninja/arch/x86.py python
from binaryninja.enums import (
    InstructionTextTokenType,
)

# Support both package and standalone imports
try:
    from .architecture import Architecture
except ImportError:
    # Fallback to absolute imports (for multiprocessing spawned processes)
    from redb.extractors.decompiler.bninja.arch.architecture import Architecture


class Arch_x86(Architecture):
    """The concrete class for architecture-dependent details for x86_64"""

    def __init__(self):
        # general purpose registers for 64bits
        self.gpr_64 = [
            "RAX",
            "RBX",
            "RCX",
            "RDX",
            "RSI",
            "RDIR9",
            "R10",
            "R11",
            "R12",
            "R13",
            "R14",
            "R15",
        ]

        self.gpr_32 = [
            "EAX",
            "EBX",
            "ECX",
            "EDX",
            "ESI",
            "EDI",
            "R8D",
            "R9D",
            "R10D",
            "R11D",
            "R12D",
            "R13D",
            "R14D",
            "R15D",
        ]

        self.gpr_16 = [
            "AX",
            "BX",
            "CX",
            "DX",
            "SI",
            "DI",
            "R8W",
            "R9W",
            "R10W",
            "R11W",
            "R12W",
            "R13W",
            "R14W",
            "R15W",
        ]

        self.gpr_8 = [
            "AL",
            "BL",
            "CL",
            "DL",
            "SIL",
            "DIL",
            "R8B",
            "R9B",
            "R10B",
            "R11B",
            "R12B",
            "R13B",
            "R14B",
            "R15B",
        ]

        self.fpu_x87 = ["ST0", "ST1", "ST2", "ST3", "ST4", "ST5", "ST6", "ST7"]

        self.sse_xmm = [
            "XMM0",
            "XMM1",
            "XMM2",
            "XMM3",
            "XMM4",
            "XMM5",
            "XMM6",
            "XMM7",
            "XMM8",
            "XMM9",
            "XMM10",
            "XMM11",
            "XMM12",
            "XMM13",
            "XMM14",
            "XMM15",
        ]

        self.avx_ymm = [
            "YMM0",
            "YMM1",
            "YMM2",
            "YMM3",
            "YMM4",
            "YMM5",
            "YMM6",
            "YMM7",
            "YMM8",
            "YMM9",
            "YMM10",
            "YMM11",
            "YMM12",
            "YMM13",
            "YMM14",
            "YMM15",
        ]
        self.flags = ["FLAGS", "EFLAGS", "RFLAGS"]
        self.stack_registers = ["RBP", "RSP", "SP", "BP"]
        self.size = 8
        self.global_registers = (
            self.gpr_64
            + self.gpr_32
            + self.gpr_16
            + self.gpr_8
            + self.fpu_x87
            + self.sse_xmm
            + self.avx_ymm
        )
        self.opcode_categories = self._initialize_opcode_categories()

        ## instructions
        self.instructions = []

    def is_register(self, register):
        register = register.upper()
        return register in self.global_registers

    def is_general_purpose_register(self, register):
        register = register.upper()
        return (
            register in self.gpr_64
            or register in self.gpr_32
            or register in self.gpr_16
            or register in self.gpr_8
        )

    def is_stack_register(self, register):
        register = register.upper()
        return register in self.stack_registers

    def is_xmm_register(self, register):
        register = register.upper()
        return register in self.sse_xmm

    def is_control_flow(self, instr_tokens):
        return False

    def is_control_flow_instruction(self, instr_tokens):
        """Check if an instruction is a control flow instruction (jump, call, return, loop)."""
        try:
            # Extract the mnemonic from the instruction tokens
            mnemonic = None
            for token in instr_tokens:
                if token.type == InstructionTextTokenType.InstructionToken:
                    mnemonic = token.text.upper()
                    break

            if not mnemonic:
                return False

            # Check if it's a jump, call, return, or loop instruction
            return (
                mnemonic.startswith("J")  # All jumps (JMP, JE, JNE, etc.)
                or mnemonic == "CALL"  # Function calls
                or mnemonic == "RET"  # Return
                or mnemonic == "RETN"  # Another form of return
                or mnemonic.startswith("LOOP")
            )  # Loop instructions

        except Exception as e:
            print(e)
            # If we can't determine, assume it's not a control flow instruction
            return False

    def is_control_flow_instruction_by_mnemonic(self, mnemonic):
        """Check if an instruction is a control flow instruction based on its mnemonic."""
        if not mnemonic:
            return False

        mnemonic = mnemonic.upper()
        return (
            mnemonic.startswith("J")  # All jumps (JMP, JE, JNE, etc.)
            or mnemonic == "CALL"  # Function calls
            or mnemonic == "RET"  # Return
            or mnemonic == "RETN"  # Another form of return
            or mnemonic.startswith("LOOP")
        )

    def _initialize_opcode_categories(self):
        """Initialize mapping of opcodes to categories similar to Ghidra's implementation."""
        opcode_categories = {}
        opcode_index = {}  # Add this to mimic Ghidra's opcodeIndex

        # Define common opcodes array similar to Ghidra's COMMON_OPCODES
        COMMON_OPCODES = [
            # Core instructions (tracked individually)
            "MOV",
            "PUSH",
            "POP",
            "LEA",
            "CALL",
            "RET",  # Data movement and control
            "ADD",
            "SUB",
            "MUL",
            "DIV",  # Basic arithmetic
            "AND",
            "OR",
            "XOR",
            "NOT",  # Logical operations
            "JMP",
            "JE",
            "JNE",  # Basic jumps
            "TEST",
            "CMP",  # Comparisons
            # Grouped categories (aggregated tracking)
            "SIMD_MOVE",  # MOVAPS, MOVDQA, MOVDQU, etc.
            "COND_JUMP_EXT",  # Other conditional jumps (JG, JL, JGE, etc.)
            "STRING_OP",  # MOVS, STOS, LODS, SCAS, CMPS
            "STACK_ADV",  # ENTER, LEAVE, PUSHA, POPA
            "ARITHMETIC_ADV",  # IMUL, IDIV, ADC, SBB
            "BIT_OP",  # SHL, SHR, SAR, ROL, ROR, etc.
            "FPU_OP",  # FLD, FST, FADD, etc.
            "SYSTEM_OP",  # SYSCALL, INT, SYSENTER
            "CRYPTO_OP",  # AES*, SHA* instructions
            "MISC_OP",  # Rare but interesting (CPUID, RDTSC, etc.)
        ]

        # Create index map like Ghidra
        for i, opcode in enumerate(COMMON_OPCODES):
            opcode_index[opcode] = i

        # Now categorize opcodes using if/elif/else structure like in Ghidra
        for opcode in COMMON_OPCODES:
            # String Operations (checking these first to avoid MOV confusion)
            if opcode.startswith("MOVS") or opcode in [
                "STOS",
                "LODS",
                "SCAS",
                "CMPS",
                "REP",
                "REPE",
                "REPNE",
            ]:
                opcode_categories[opcode] = "STRING_MANIPULATION"

            # Data Movement (after string ops to avoid MOVS confusion)
            elif opcode.startswith("MOV") or opcode in ["LEA", "XCHG"]:
                opcode_categories[opcode] = "DATA_MOVEMENT"

            # Stack Operations
            elif opcode in ["PUSH", "POP", "ENTER", "LEAVE", "PUSHA", "POPA"]:
                opcode_categories[opcode] = "STACK_MANAGEMENT"

            # Control Flow (non-conditional)
            elif opcode in ["JMP", "CALL", "RET"]:
                opcode_categories[opcode] = "CONTROL_FLOW"

            # Conditional Jumps and Loops
            elif opcode.startswith("J") or opcode.startswith("LOOP"):
                opcode_categories[opcode] = "CONDITIONAL_JUMP"

            # Arithmetic
            elif opcode in [
                "ADD",
                "SUB",
                "MUL",
                "DIV",
                "IMUL",
                "IDIV",
                "ADC",
                "SBB",
                "INC",
                "DEC",
                "NEG",
            ]:
                opcode_categories[opcode] = "ARITHMETIC"

            # Logical
            elif opcode in ["AND", "OR", "XOR", "NOT", "TEST", "CMP"]:
                opcode_categories[opcode] = "LOGICAL"

            # Shifts & Rotates
            elif opcode in ["SHL", "SHR", "SAR", "SAL", "ROL", "ROR", "RCL", "RCR"]:
                opcode_categories[opcode] = "SHIFT_ROTATE"

            # System & Interrupts
            elif opcode in [
                "SYSCALL",
                "INT",
                "SYSENTER",
                "SYSEXIT",
                "SGDT",
                "SIDT",
                "SLDT",
                "WRMSR",
                "RDMSR",
            ]:
                opcode_categories[opcode] = "SYSTEM_CALLS"

            # Floating Point
            elif opcode.startswith("F"):
                opcode_categories[opcode] = "FPU_ARITHMETIC"

            # System Information and Random Number Generation
            elif opcode in ["PUSHF", "POPF", "CPUID", "RDTSC", "RDRAND", "RDSEED"]:
                opcode_categories[opcode] = "CPU_FEATURES"

            # Cryptography
            elif opcode.startswith("AES") or opcode.startswith("SHA"):
                opcode_categories[opcode] = "CRYPTOGRAPHIC"

            # Miscellaneous (including flag operations)
            else:
                opcode_categories[opcode] = "MISC"

        # Additional categorization for opcodes not in COMMON_OPCODES
        # This can be used in the normalize_opcode method

        # Store both maps as instance variables
        # self.opcode_categories = opcode_categories
        self.opcode_index = opcode_index

        return opcode_categories

    def is_simd_register(self, register):
        return register in self.sse_xmm