rizinorg / rizin

UNIX-like reverse engineering framework and command-line toolset.
https://rizin.re
GNU Lesser General Public License v3.0
2.71k stars 363 forks source link

read syscall on x86-64 Linux #3885

Open createyourpersonalaccount opened 1 year ago

createyourpersonalaccount commented 1 year ago

Work environment

Questions Answers
OS/arch/bits (mandatory) Debian x86/64
File format of the file you reverse (mandatory) ELF
Architecture/bits of the file (mandatory) x86/64
rizin -v full output, not truncated (mandatory) rizin 0.7.0 @ linux-x86-64; commit: 729edc8919adb0227bc5fba67ffcef514cb4cf84

Expected behavior

I expect

asr 0 ===> read
asn read ===> 0

Actual behavior

asr 0 ===> ERROR: Cannot resolve syscall: 0
asn read ===> 128
createyourpersonalaccount commented 1 year ago

As far as I can tell in sdb_array_get_num() the value 0 is both possible and an error. This database API is problematic, it needs an error parameter or a value parameter and to return errors only.

I think this is public API, what do you think should happen?