Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

R2Pipe Python Fails Sometimes #28

Closed
Stormys opened this issue Aug 18, 2017 · 7 comments
Closed

R2Pipe Python Fails Sometimes #28

Stormys opened this issue Aug 18, 2017 · 7 comments

Comments

@Stormys
Copy link

Stormys commented Aug 18, 2017

So, I can't seem to figure out why and what is causing r2pipe to fail for me.
I am writing a program to essential go a list of binaries, get the functions, and select certain functions that I have marked as of interest and run ag [func] to obtain their dot graph.

Yet, I have not been able to figure out why my code will return NoneType object errors with ag [func] on all of the functions except main when I simple comment out handle.cmd('aaa') and uncomment the other one command. Yet, the current implementation below works 100% of the time. Why and how would a previous command impact other commands?

def openBinary(file):
    handle = r2pipe.open(file)
    handle.cmd('aaa')
    #handle.cmd('e anal.jmptbl=true;e anal.jmpref=true;e anal.jmpabove=true;aaa')
    return handle

I am also positive that the only command in my code that appears to fail is ag [func]. Other commands such as af had to be commented out as well as they seemed to impact both my aflj and ag command.

@radare
Copy link
Collaborator

radare commented Aug 19, 2017 via email

@Stormys
Copy link
Author

Stormys commented Aug 21, 2017

Unfortunately I can not give complete details on the exact binaries or the full program I am using but I tested this on /bin/cat and obtain the same issue.

I am on Ubuntu 16.04 using Python 2.7.12

radare2 1.7.0-git 15541 @ linux-x86-64 git.1.6.0-268-gc1f6b29
commit: c1f6b29e8e960f3590604fa5cd25cddfb5dbf120 build: 2017-08-08__11:20:08
r2pipe (0.9.1)

I might be able to pull up a smaller script a little later that outputs with the same error.

@Stormys
Copy link
Author

Stormys commented Aug 22, 2017

Here is a full python script that causes my issue along with a compiled version of cat and the output of running my script on cat.

Let me know if you are able to reproduce it

r2pipe_issue_28.tar.gz

@Stormys
Copy link
Author

Stormys commented Aug 22, 2017

Oops. After analyzing the code/issue I wrote up for the previous post it is not caused by r2pipe but radareorg/radare2#8258. I do believe though that i am still running into another error in my larger code that may or not be caused by r2pipe. I am going to take some more time to analyze and see if I can reproduce a smaller case of this error.

@Stormys
Copy link
Author

Stormys commented Aug 22, 2017

So I figured out my issue. It is occurring due to radare2 asking "Do you want to print x lines?" after a command. Is there a way to disable this? If not I believe this would be useful to implement especially for those using r2pipe to interact with radare.

@Stormys Stormys closed this as completed Aug 22, 2017
@lzina
Copy link

lzina commented Jan 16, 2020

Hi @Stormys ,
Did you find any way to disable "Do you want to print x lines?" message?

Thanks,

@radare
Copy link
Collaborator

radare commented Jan 17, 2020 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants