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

Function STR_reg_gen

arch/arm64/disassembler/decode2.c:25985–26050  ·  view source on GitHub ↗

str_reg_gen.xml */

Source from the content-addressed store, hash-verified

25983
25984/* str_reg_gen.xml */
25985int STR_reg_gen(context *ctx, Instruction *instr)
25986{
25987 int rc = DECODE_STATUS_UNMATCHED;
25988 /* class iclass_general */
25989 /* size=1x|111|V=0|00|opc=00|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */
25990 if((INSWORD & 0xBFE00C00)==0xB8200800) {
25991 decode_fields32(ENC_STR_32_LDST_REGOFF, ctx, instr);
25992 ctx->wback = FALSE;
25993 ctx->postindex = FALSE;
25994 ctx->scale = UINT(ctx->size);
25995 if(SLICE(ctx->option,1,1)==0) {
25996 UNDEFINED;
25997 }
25998 ctx->extend_type = DecodeRegExtend(ctx->option);
25999 ctx->shift = (ctx->S==1) ? ctx->scale : 0;
26000 if(ctx->size==2) OK(ENC_STR_32_LDST_REGOFF);
26001 if(ctx->size==3) OK(ENC_STR_64_LDST_REGOFF);
26002 }
26003 /* post-decode pcode */
26004 ctx->n = UINT(ctx->Rn);
26005 ctx->t = UINT(ctx->Rt);
26006 ctx->m = UINT(ctx->Rm);
26007 ctx->acctype = ctx->AccType_NORMAL;
26008 if(SLICE(ctx->opc,1,1)==0) {
26009 if(SLICE(ctx->opc,0,0)==1) {
26010 ctx->memop = MemOp_LOAD;
26011 };
26012 if(ctx->size==3) {
26013 ctx->regsize = 0x40;
26014 };
26015 ctx->signed_ = FALSE;
26016 }
26017 else {
26018 if(ctx->size==3) {
26019 ctx->memop = MemOp_PREFETCH;
26020 if(SLICE(ctx->opc,0,0)==1) {
26021 UNDEFINED;
26022 }
26023 }
26024 else {
26025 ctx->memop = MemOp_LOAD;
26026 if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) {
26027 UNDEFINED;
26028 }
26029 if(SLICE(ctx->opc,0,0)==1) {
26030 ctx->regsize = 0x20;
26031 };
26032 ctx->signed_ = TRUE;
26033 }
26034 }
26035 ctx->datasize = (8) << (ctx->scale);
26036 ctx->tag_checked = ctx->memop!=MemOp_PREFETCH;
26037 ctx->wb_unknown = FALSE;
26038 ctx->rt_unknown = FALSE;
26039 if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) {
26040 // assignment from ConstrainUnpredictable()
26041 // assert
26042 // switch on constraint

Callers 1

Calls 2

decode_fields32Function · 0.85
DecodeRegExtendFunction · 0.85

Tested by

no test coverage detected