Fix sdiv and ldrsb pseudo for arm ##decompiler

This commit is contained in:
pancake 2024-08-20 14:06:18 +02:00 committed by pancake
parent cc041f6e0e
commit 2b2fa3fde0
2 changed files with 7 additions and 3 deletions

View File

@ -89,15 +89,16 @@ static int replace(int argc, const char *argv[], char *newstr) {
{ 3, "ldruh", "# = (uword) # + #", { 1, 2, 3 } },
{ 2, "ldrb", "# = (byte) #", { 1, 2 } },
{ 3, "ldrb", "# = (byte) # + #", { 1, 2, 3 } },
{ 2, "ldrsb", "# = (byte) #", { 1, 2 } },
{ 2, "ldr.w", "# = #", { 1, 2 } },
{ 4, "ldrsb", "# = (byte) # + #", { 1, 2, 3 } },
{ 3, "ldrsb", "# = (byte) # + #", { 1, 2, 3 } },
{ 2, "ldrsb", "# = (byte) #", { 1, 2 } },
{ 2, "ldrsw", "# = #", { 1, 2 } },
{ 4, "ldrsw", "# = # + # #", { 1, 2, 3, 4 } },
{ 3, "ldrsw", "# = # + #", { 1, 2, 3 } },
{ 3, "ldr", "# = # + #", { 1, 2, 3 } },
{ 3, "ldrb", "# = (byte) # + #", { 1, 2, 3 } },
{ 3, "ldrsb", "# = (byte) # + #", { 1, 2, 3 } },
{ 3, "ldr.w", "# = # + #", { 1, 2, 3 } },
{ 3, "ldrsw", "# = # + #", { 1, 2, 3 } },
{ 0, "mov", "# = #", { 1, 2 } },
{ 0, "fmov", "# = #", { 1, 2 } },
{ 0, "mvn", "# = ~#", { 1, 2 } },
@ -114,8 +115,10 @@ static int replace(int argc, const char *argv[], char *newstr) {
{ 0, "muf", "# = # * #", { 1, 2, 3 } },
{ 0, "mul", "# = # * #", { 1, 2, 3 } },
{ 0, "fmul", "# = # * #", { 1, 2, 3 } },
{ 0, "smul", "# = # * #", { 1, 2, 3 } },
{ 0, "muls", "# = # * #", { 1, 2, 3 } },
{ 0, "div", "# = # / #", { 1, 2, 3 } },
{ 0, "sdiv", "# = # / #", { 1, 2, 3 } },
{ 0, "fdiv", "# = # / #", { 1, 2, 3 } },
{ 0, "udiv", "# = (unsigned) # / #", { 1, 2, 3 } },
{ 0, "orr", "# = # | #", { 1, 2, 3 } },

View File

@ -586,6 +586,7 @@ static char *colorword(char *res, const char *k, const char *color) {
}
static void colorcode(void) {
// TODO : dupped from libr/util/print_code.c r_print_code_tocolor
RCons *cons = r_cons_singleton ();
int i;
char *res = r_str_ndup (cons->context->buffer, cons->context->buffer_len);