From 692f94e05893232dadc8a6e2c43242180dc16748 Mon Sep 17 00:00:00 2001 From: pancake Date: Sun, 5 Nov 2017 03:42:25 +0100 Subject: [PATCH] Add spaces around * --- libr/asm/p/asm_x86_cs.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/libr/asm/p/asm_x86_cs.c b/libr/asm/p/asm_x86_cs.c index f66a3ea996..2ea6140d6d 100644 --- a/libr/asm/p/asm_x86_cs.c +++ b/libr/asm/p/asm_x86_cs.c @@ -120,6 +120,26 @@ static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { memcpy (op->buf_asm, "jnz", 3); } } +#if 0 + // [eax + ebx*4] => [eax + ebx * 4] + char *ast = strchr (op->buf_asm, '*'); + if (ast && ast > op->buf_asm) { + ast--; + if (ast[0] != ' ') { + char *tmp = strdup (ast + 1); + if (tmp) { + ast[0] = ' '; + if (tmp[0] && tmp[1] && tmp[1] != ' ') { + strcpy (ast, " * "); + strcpy (ast + 3, tmp + 1); + } else { + strcpy (ast + 1, tmp); + } + free (tmp); + } + } + } +#endif #if USE_ITER_API /* do nothing because it should be allocated once and freed in the_end */ #else