diff --git a/librz/analysis/p/analysis_tricore_cs.c b/librz/analysis/p/analysis_tricore_cs.c index 7da2a08d506..b15e70303cc 100644 --- a/librz/analysis/p/analysis_tricore_cs.c +++ b/librz/analysis/p/analysis_tricore_cs.c @@ -762,6 +762,20 @@ static RzAnalysisILConfig *il_config(RzAnalysis *analysis) { return cfg; } +static int archinfo(RzAnalysis *a, RzAnalysisInfoType query) { + switch (query) { + case RZ_ANALYSIS_ARCHINFO_MIN_OP_SIZE: + return 2; + case RZ_ANALYSIS_ARCHINFO_MAX_OP_SIZE: + return 4; + case RZ_ANALYSIS_ARCHINFO_TEXT_ALIGN: + case RZ_ANALYSIS_ARCHINFO_DATA_ALIGN: + case RZ_ANALYSIS_ARCHINFO_CAN_USE_POINTERS: + default: + return -1; + } +} + RzAnalysisPlugin rz_analysis_plugin_tricore_cs = { .name = "tricore", .desc = "Capstone TRICORE analysis plugin", @@ -769,6 +783,7 @@ RzAnalysisPlugin rz_analysis_plugin_tricore_cs = { .arch = "tricore", .bits = 32, .get_reg_profile = get_reg_profile, + .archinfo = archinfo, .op = rz_analysis_tricore_op, .il_config = il_config, }; diff --git a/test/db/analysis/tricore b/test/db/analysis/tricore index 12702411036..7dc69db51db 100644 --- a/test/db/analysis/tricore +++ b/test/db/analysis/tricore @@ -2,7 +2,7 @@ NAME=TriCore lea FILE=malloc://512 CMDS=!rz-asm -a tricore -d d916606c EXPECT=< ; load effective address - 0x80000028 7b00000d movh d0, 53248 ; move high - 0x8000002c 1b008200 addi d0, d0, 2080 ; add immediate - 0x80000030 cd80e20f mtcr #0xfe28, d0 ; move to core register - 0x80000034 0d00c004 isync ; synchronize instructions - 0x80000038 7b000008 movh d0, 32768 ; move high - 0x8000003c 1b003000 addi d0, d0, 768 ; add immediate - 0x80000040 cd40e20f mtcr #0xfe24, d0 ; move to core register - 0x80000044 0d00c004 isync ; synchronize instructions - 0x80000048 4d40e00f mfcr d0, #0xfe04 ; move from core register - 0x8000004c 8ff04701 or d0, d0, 127 ; bitwise or - 0x80000050 8f00c801 andn d0, d0, 128 - 0x80000054 cd40e00f mtcr #0xfe04, d0 ; move to core register - 0x80000058 0d00c004 isync ; synchronize instructions - 0x8000005c 4d40e00f mfcr d0, #0xfe04 ; move from core register - 0x80000060 8f005001 or d0, d0, 256 ; bitwise or - 0x80000064 cd40e00f mtcr #0xfe04, d0 ; move to core register - 0x80000068 0d00c004 isync ; synchronize instructions + 0x80000014 85f12000 ld.w %d1, 0xf0000020 ; load word + ,=< 0x80000018 6f010400 jz.t %e0, 0, -0x7fffffe0 ; jump if zero bit + ,==< 0x8000001c 5d006800 jl -0x7fffff14 ; jump and link + || 0x80000020 910000ad movh.a %d10, 0xd000 ; move high to address + || 0x80000024 d9aa6000 lea %d10, [%p10]0x420 ; load effective address + || 0x80000028 7b00000d movh %d0, 0xd000 ; move high + || 0x8000002c 1b008200 addi %d0, 0x820, ; add immediate + || 0x80000030 cd80e20f + || 0x80000031 80e2 mov.d %d2, %d14 ; move address to data register + || 0x80000033 0f0d00c0 + || 0x80000034 0d00c004 isync ; synchronize instructions + || 0x80000038 7b000008 movh %d0, 0x8000 ; move high + || 0x8000003c 1b003000 addi %d0, 0x300, ; add immediate + || 0x80000040 cd40e20f + || 0x80000041 40e20f0d + || 0x80000042 e20f mul %d15, %d0 ; multiply signed + || 0x80000044 0d00c004 isync ; synchronize instructions + || 0x80000048 4d40e00f mfcr %d0, %d0 ; move from core register + || 0x8000004c 8ff04701 + || 0x8000004d f047018f + || 0x8000004e 47018f00 and.and.t %d0, %d1, 0xf, %d0, 1 + || 0x80000052 c801 ld.a %e0, [%a15]0 ; load word to address register EOF RUN