radareorg / r2pipe.rs

Rust crate for r2pipe
Other
45 stars 19 forks source link

Updating retrieval of local variable information from r2 #17

Closed chinmaydd closed 7 years ago

chinmaydd commented 7 years ago

r2 now uses afvb for local variable information instead of afaj(as was the case when the library was implemented).

For easier parsing, we can use the afvbj @ _addr_ for which the example output is as follows: [{"name":"local_8h","kind":"var","type":"int","ref":{"base":"rbp", "offset":-8}}]

Considering this, it would be apt to update the LVarInfo struct to parse the reference better. A possible idea would be:

pub struct LVarRef {
    pub base: Option<String>,
    pub offset: Option<String>,
}

We would also need to update the locals_of function which fetches this information.

Thoughts ?

radare commented 7 years ago

I think that all this functionality should be outside the core r2pipe module. The r2pipe api should support more transports and have better tests. All the high level logic of r2 commands providing a userfriendly api on top of them should be moved somewhere else imho

On 28 Dec 2016, at 18:19, Chinmay Deshpande notifications@github.com wrote:

r2 now uses afvb for local variable information instead of afaj(as was the case when the library was implemented).

For easier parsing, we can use the afvbj @ addr for which the example output is as follows: [{"name":"local_8h","kind":"var","type":"int","ref":{"base":"rbp", "offset":-8}}]

Considering this, it would be apt to update the LVarInfo struct to parse the reference better. A possible idea would be:

pub struct LVarRef { pub base: Option, pub offset: Option, } We would also need to update the locals_of function which fetches this information.

Thoughts ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

sushant94 commented 7 years ago

I think it should remain here. I'm sure most people would prefer to use the rust structs that we provide as comapred to raw json parsing that they'll have to implement all over again. Besides, they can always use the raw form if they want to. It's not like we're making that harder to use in any way.

radare commented 7 years ago

Its great to see you again :) prehappy new year

On 31 Dec 2016, at 01:13, Sushant Dinesh notifications@github.com wrote:

Closed #17 via 110dc30.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

sushant94 commented 7 years ago

Great to be back! Thanks, Happy new year to you too :)