-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The outputs of 'cmd()' is empty on Windows 10 #146
Comments
That's not a good work around, things are failing randomly due to these null bytes long after the pipe is opened. |
Apparently changing |
The first message after spawning r2 its a null byte. The rest of messages
do not have this. So an rfind should break other things. I cant repro on
linux/mac.
On Fri, 28 Jan 2022 at 23:14, Filipe R. Côgo ***@***.***> wrote:
Apparently changing zro = foo.find(b"\x00") to zro = foo.rfind(b"\x00")
on _cmd_process(self, cmd) at open_sync.py solves the issue.
—
Reply to this email directly, view it on GitHub
<#146 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG75FRHOQJWVRFJK5RBK3DUYMIMJANCNFSM5L6CC6NA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
--pancake
|
I had the same issue, and it seems that it's not only the first message after spawn that has a null byte - every command return started with \x00. I added a check after
|
Can you send a pullrequest instead?
… On 25 Apr 2022, at 18:11, stiv-kupchik ***@***.***> wrote:
I had the same issue, and it seems that it's not only the first message after spawn that has a null byte - every command return started with \x00. I added a check after foo.read for this and it seemed to solve the issue
if os.name == "nt":
if len(foo) > 1 and foo.startswith(b"\x00"):
foo = foo[1:]
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.
|
Fixed in master. thanks for submitting the fix! |
I'm afraid this still doesn't work for me on Windows 11 And I installed the latest from git:
With the above patch, but I still face the same problem, about 90% of the time the first cmd is empty, and the results don't come through unless I call |
r2 5.5.4 is pretty old, like 1 year old. there was a release of the r2pipe module so no need to install it from git. i'll look into that if that's not the case. |
Last release of r2pipe on PyPi is 1.6.5 from November 2021, and doesn't have the code from #147 ? |
omg i forgot to publish 1.6.6 🤦 i just pushed 1.7.0 with some more changes. can you try again? thanks for the headsup |
Thanks @trufae but it still doesn't work, what changes are you referring to? I'm currently just doing this in my code to work around it:
|
i had some time (finally) to test and fix it. Please try again with r2pipe 1.7.1 :) it seems to work well on windows linux and mac now. i need to improve the testsuite. i have also realized that if you have outdated plugins, the "please run r2pm .." message is breaking r2pipe too. |
I dont have windows 10, but on windows11 it works for me if i spawn python from inside r2. Like this:
But it fails if i spawn r2 from the r2pipe instance.. so that means that i can repro, and it should be easy to fix. (hold my beer) |
Looks like a racist condition 🤔 |
Fixed in r2pipe-1.8.0 please confirm :) |
Environment
Description
There seems to be a bug here, the cmd command does not output the results correctly. This looks like an issue with newlines.
Test
The text was updated successfully, but these errors were encountered: