MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / decode_scratchpad

Function decode_scratchpad

arch/arm64/disassembler/decode_scratchpad.c:1543–11087  ·  view source on GitHub ↗

convert the result of pcode execution to a human-friendly list of operands */

Source from the content-addressed store, hash-verified

1541
1542/* convert the result of pcode execution to a human-friendly list of operands */
1543int decode_scratchpad(context* ctx, Instruction* instr)
1544{
1545 ArrangementSpec arr_spec = _1B;
1546
1547 /* index of operand array, as it's built */
1548 int i = 0;
1549
1550 /* populate operation */
1551 instr->operation = enc_to_oper(instr->encoding);
1552
1553 /* default to 0 operands */
1554 InstructionOperand zero = {0};
1555 for (uint32_t ii = 0; ii < MAX_OPERANDS; ++ii)
1556 instr->operands[ii] = zero;
1557
1558 switch (instr->encoding)
1559 {
1560 /* instrucitons with no operands */
1561 case ENC_AUTIA1716_HI_HINTS:
1562 case ENC_AUTIASP_HI_HINTS:
1563 case ENC_AUTIAZ_HI_HINTS:
1564 case ENC_AUTIB1716_HI_HINTS:
1565 case ENC_AUTIBSP_HI_HINTS:
1566 case ENC_AUTIBZ_HI_HINTS:
1567 case ENC_AXFLAG_M_PSTATE:
1568 case ENC_CFINV_M_PSTATE:
1569 case ENC_CSDB_HI_HINTS:
1570 case ENC_DGH_HI_HINTS:
1571 case ENC_DRPS_64E_BRANCH_REG:
1572 case ENC_ERETAA_64E_BRANCH_REG:
1573 case ENC_ERETAB_64E_BRANCH_REG:
1574 case ENC_ERET_64E_BRANCH_REG:
1575 case ENC_ESB_HI_HINTS:
1576 case ENC_NOP_HI_HINTS:
1577 case ENC_PACIA1716_HI_HINTS:
1578 case ENC_PACIASP_HI_HINTS:
1579 case ENC_PACIAZ_HI_HINTS:
1580 case ENC_PACIB1716_HI_HINTS:
1581 case ENC_PACIBSP_HI_HINTS:
1582 case ENC_PACIBZ_HI_HINTS:
1583 case ENC_RETAA_64E_BRANCH_REG:
1584 case ENC_RETAB_64E_BRANCH_REG:
1585 case ENC_SEVL_HI_HINTS:
1586 case ENC_SEV_HI_HINTS:
1587 case ENC_WFE_HI_HINTS:
1588 case ENC_WFI_HI_HINTS:
1589 case ENC_XAFLAG_M_PSTATE:
1590 case ENC_XPACLRI_HI_HINTS:
1591 case ENC_YIELD_HI_HINTS:
1592 case ENC_SETFFR_F_:
1593 // case ENC_SSBB_ONLY_BARRIERS:
1594 // case ENC_PSSBB_ONLY_BARRIERS:
1595 case ENC_SB_ONLY_BARRIERS:
1596 case ENC_TCOMMIT_ONLY_BARRIERS:
1597 case ENC_PSSBB_DSB_BO_BARRIERS:
1598 case ENC_SSBB_DSB_BO_BARRIERS:
1599 break;
1600 case ENC_WFET_ONLY_SYSTEMINSTRSWITHREG:

Callers 1

aarch64_decomposeFunction · 0.85

Calls 15

enc_to_operFunction · 0.85
wwwx_0123_regFunction · 0.85
bhsd_0123_regFunction · 0.85
sd_01_regFunction · 0.85
rhsd_0123x_regFunction · 0.85
rbhsd_0123x_regFunction · 0.85
rhsd_0123_regFunction · 0.85
hsdr_0123_regFunction · 0.85
rbhsdq_5bit_regFunction · 0.85
arr_spec_method1Function · 0.85
rsdr_0123_regFunction · 0.85
rhsdr_0123x_regFunction · 0.85

Tested by

no test coverage detected