mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-25 14:19:51 +00:00
Fix comparison commands ??, ?!, ?+ and ?-
This commit is contained in:
parent
e367b93e93
commit
0b5d2ef737
12
TODO.md
12
TODO.md
@ -1,10 +1,18 @@
|
||||
<pre>
|
||||
____ ___ ___ ___ ____ ___ _____ ____
|
||||
| _ \/ \| \/ \ _ \/ _ \ \__ \ / \
|
||||
| ( V \ | ) V \ ( __/ .-` _/| () |
|
||||
|__\__|_|__|___/__|__|_\__\___\ |____(_)____/
|
||||
|
||||
</pre>
|
||||
|
||||
|
||||
Broken stuff to fixe before release
|
||||
===================================
|
||||
- conditionals doesnt work
|
||||
|
||||
- java
|
||||
- dalvik
|
||||
- dwarf
|
||||
- rar asm/dis
|
||||
|
||||
0.9.4
|
||||
=====
|
||||
|
@ -83,7 +83,7 @@ R_API int r_config_swap(RConfig *cfg, const char *name) {
|
||||
R_API ut64 r_config_get_i(RConfig *cfg, const char *name) {
|
||||
RConfigNode *node = r_config_node_get (cfg, name);
|
||||
if (node) {
|
||||
if (node->i_value != 0)
|
||||
if (node->i_value != 0 || !strcmp (node->value, "false"))
|
||||
return node->i_value;
|
||||
return (ut64)r_num_math (cfg->num, node->value);
|
||||
}
|
||||
|
@ -96,26 +96,31 @@ static int cmd_help(void *data, const char *input) {
|
||||
if (input[1] == 'i' || input[1]=='d')
|
||||
r_cons_printf ("%"PFMT64d"\n", n);
|
||||
else r_cons_printf ("0x%"PFMT64x"\n", n);
|
||||
core->num->value = n;
|
||||
core->num->value = n; // redundant
|
||||
break;
|
||||
case '=':
|
||||
r_num_math (core->num, input+1);
|
||||
case '=': // set num->value
|
||||
if (input[1]) {
|
||||
r_num_math (core->num, input+1);
|
||||
} else r_cons_printf ("0x%"PFMT64x"\n", core->num->value);
|
||||
break;
|
||||
case '+':
|
||||
//eprintf ("NUMVAL %llx\n", core->num->value);
|
||||
if (input[1]) {
|
||||
if (core->num->value & UT64_GT0)
|
||||
r_core_cmd (core, input+1, 0);
|
||||
st64 n = (st64)core->num->value;
|
||||
if (n>0) r_core_cmd (core, input+1, 0);
|
||||
} else r_cons_printf ("0x%"PFMT64x"\n", core->num->value);
|
||||
break;
|
||||
case '-':
|
||||
//eprintf ("NUMVAL %llx\n", core->num->value);
|
||||
if (input[1]) {
|
||||
if (core->num->value & UT64_LT0)
|
||||
r_core_cmd (core, input+1, 0);
|
||||
st64 n = (st64)core->num->value;
|
||||
if (n<0) r_core_cmd (core, input+1, 0);
|
||||
} else r_cons_printf ("0x%"PFMT64x"\n", core->num->value);
|
||||
break;
|
||||
case '!': // ??
|
||||
//eprintf ("NUMVAL %llx\n", core->num->value);
|
||||
if (input[1]) {
|
||||
if (core->num->value != UT64_MIN)
|
||||
if (!core->num->value)
|
||||
r_core_cmd (core, input+1, 0);
|
||||
} else r_cons_printf ("0x%"PFMT64x"\n", core->num->value);
|
||||
break;
|
||||
@ -294,6 +299,11 @@ static int cmd_help(void *data, const char *input) {
|
||||
} break;
|
||||
case '?': // ???
|
||||
if (input[1]=='?') {
|
||||
if (input[2]) {
|
||||
if (core->num->value)
|
||||
r_core_cmd (core, input+1, 0);
|
||||
break;
|
||||
}
|
||||
r_cons_printf (
|
||||
"Usage: ?[?[?]] expression\n"
|
||||
" ? eip-0x804800 ; show hex and dec result for this math expr\n"
|
||||
|
@ -180,6 +180,8 @@ R_API ut64 r_num_math(RNum *num, const char *str) {
|
||||
ret = r_num_calc (num, str, &err);
|
||||
if (err) eprintf ("r_num_calc error: (%s) in (%s)\n", err, str);
|
||||
else if (num) num->value = ret;
|
||||
if (num != NULL)
|
||||
num->value = ret;
|
||||
return ret;
|
||||
#else
|
||||
ut64 ret = 0LL;
|
||||
|
Loading…
Reference in New Issue
Block a user