radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
20.58k stars 2.99k forks source link

`afs` won't allow any custom type in the signature #17432

Open HoundThe opened 4 years ago

HoundThe commented 4 years ago

Work environment

Questions Answers
OS/arch/bits (mandatory) Ubuntu 20.04
File format of the file you reverse (mandatory) ELF
Architecture/bits of the file (mandatory) x86/64
r2 -v full output, not truncated (mandatory) radare2 4.6.0-git 25399 @ linux-x86-64 git.4.4.0-504-g78ea6ec78 commit: 78ea6ec78c908ad71a57866664798225b0e8f62d build: 2020-08-08__14:21:59

Expected behavior

[0x00001080]> afs Mammal *entry0 (int64_t arg3);
[0x00001080]> afs
Mammal *entry0 (int64_t arg3);

Actual behavior

[0x00001080]> afs void entry0 (int64_t arg3);
[0x00001080]> afs Mammal *entry0 (int64_t arg3);
<string>:1: error: ';' expected (got "entry0")
<string>:1: error: declaration expected

afs c-parser won't allow any custom Data types, so any custom structures etc. in the signature return type or arguments

XVilka commented 4 years ago

It allows only the types that are predefined at this stage, i.e. known to the compiler. It will be eliminated once we switch to tree-sitter. Not sure what we can do right now though.

HoundThe commented 4 years ago

Hmm is there some issue or PR regarding the tree-sitter switch?

XVilka commented 4 years ago

No separate issue, just a comment: https://github.com/radareorg/radare2/issues/4369#issuecomment-652987136

HoundThe commented 4 years ago

So I guess I should leave it as it is without signature change until tree sitter switch?