From e81d4e900d0fac5c631c58e50320e582ed71bbb6 Mon Sep 17 00:00:00 2001 From: Anton Kochkov Date: Wed, 17 Jul 2013 01:54:05 +0400 Subject: [PATCH] Fixed "cmp" opcode colorization --- libr/core/disasm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libr/core/disasm.c b/libr/core/disasm.c index e9960df612..e991ab7565 100644 --- a/libr/core/disasm.c +++ b/libr/core/disasm.c @@ -52,7 +52,7 @@ static char *filter_refline(const char *str) { static void colorize_opcode (char *p, const char *reg, const char *num) { int i, j, k, is_mod; - int is_jmp = (*p == 'j' || *p == 'c')? 1: 0; + int is_jmp = (*p == 'j' || ((*p == 'c') && (p[1] == 'a')))? 1: 0; char *o; if (is_jmp) return; @@ -80,8 +80,13 @@ static void colorize_opcode (char *p, const char *reg, const char *num) { strcpy (o+j, Color_RESET); j += strlen (Color_RESET); o[j++] = p[i]; - strcpy (o+j, reg); - j += strlen (reg)-1; + if ((p[i] > '0') && (p[i] < '9')) { + strcpy (o+j, num); + j += strlen (num)-1; + } else { + strcpy (o+j, reg); + j += strlen (reg)-1; + } continue; case ' ': // find if next ',' before ' ' is found