I just misread the operands of the rcall instruction
their is 2 similar types of instruction (naming conveintions used only
by me and mentioned no where in the manual) the N_T where the n operand
is 8 bit and NET_T where the n operand is 11 bit
the rcall looks like the following 1101 1nnn nnnn nnnn which is obviosly
NEX_T
r2agent:
- Fix the usage to match other r2 binaries.
- Remove trailing whitespace.
- Remove addressed TODO.
- Add a default case to display usage and exit if -p option was used
without argument.
- Return 1 instead of 0 if too much arguments are provided.
- Small coding style fixes.
radiff2:
- Small coding style fixes.
rafind2:
- Add a default case to display usage and exit if an option have a missing
argument or getopt does not recognize an option character.
- Small coding style fixes.
ragg2:
- Small coding style fixes.
rahash2:
- Remove useless optarg check.
- Missing arguments and unknown options now display usage and exit.
- Small coding style fixes.
rarun2:
- Small coding style fixes.
rasm2:
- Small coding style fixes.
- Missing arguments and unknown options now display usage and exit.
rax2:
- Small coding style fixes.
radare2:
- Missing arguments and unknown options now display usage and exit.
- Small coding style fixes.
getopt is returning '?' if there is a missing option argument, which cause
the switch to branch on the default case. Consequently, tests on optarg are
redundant if a valid argument was given and never executed if the argument is
missing.
I also hunted 4th illegal memory read
the first 2 bytes of b is always casted to (ut16) type
with out checking if b even contains 2 bytes
now it is handled it correctly