From 731fc03a298a82fa6eaf0c18fbaaef57a0864fcf Mon Sep 17 00:00:00 2001 From: pancake Date: Fri, 9 May 2014 10:39:56 +0200 Subject: [PATCH] FIx #905 - assemble rdtsc and fix /c --- libr/asm/p/asm_x86_nz.c | 5 +++++ libr/core/asm.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libr/asm/p/asm_x86_nz.c b/libr/asm/p/asm_x86_nz.c index bc44cee296..17126fd003 100644 --- a/libr/asm/p/asm_x86_nz.c +++ b/libr/asm/p/asm_x86_nz.c @@ -134,6 +134,11 @@ static int assemble(RAsm *a, RAsmOp *ao, const char *str) { data[l++] = 0xfe; return l; } + if (!strcmp (op, "rdtsc")) { + data[l++] = 0x0f; + data[l++] = 0x31; + return l; + } arg = strchr (op, ' '); if (arg) { *arg = '\0'; diff --git a/libr/core/asm.c b/libr/core/asm.c index 351739f6b2..244bf1483c 100644 --- a/libr/core/asm.c +++ b/libr/core/asm.c @@ -93,7 +93,7 @@ R_API RList *r_core_asm_strsearch(RCore *core, const char *input, ut64 from, ut6 break; tokens[tokcount] = r_str_trim_head_tail (tok); } - tokens[tokcount-1] = NULL; + tokens[tokcount] = NULL; r_cons_break (NULL, NULL); for (at = from, matchcount = 0; at < to; at += core->blocksize-OPSZ) { if (r_cons_singleton ()->breaked)