You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A bit of invesitgation done and it looks like the code that handles this cmd (libr/core/cmd_meta.c) treats the 3rd paramter as a repeat counter and not the address location.
The code in question is in mentioned file in lines 658-665.
We can see that the third argument is parsed and set as reapet variable and later it's used as an condition for exiting the while-loop. Having this knowledge it's obvious that r2 hangs as it tries to repeat the action 0x401034 times.
Not sure if my understanding of this command usage is wrong, help message is not updated or the code is not working as it should according to the spec.
Also noticed additional (if think) wrong behavior, if the third parameter is something that's not parsable as number it will be set as the string itself (which is weird).
@XVilka thanks for tagging this, if it's a good first issue I might consider doing it, but I'm still missing what should be the expected behavior here? Is the help message of Cs wrong? Or the code should change to make use the third parameter as addr and not as repeat counter?
This issue has been automatically marked as stale because it has not had recent activity. Considering a lot has changed since its creation, we kindly ask you to check again if the issue you reported is still relevant in the current version of radare2. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions.
Work environment
Expected behavior
Cs
should correctly create a stringActual behavior
radare2 hangs
Steps to reproduce the behavior
If we check the
Cs?
command we can see that we can useCs
like this:Cs 31 0x401034
it hangs the r2.r2 EsetCrackMe2015.exe
(Dropbox link)s 0x401034
Cs
command like help suggestsCs 31 0x401034
Additional Logs, screenshots, source-code, configuration dump, ...
A bit of invesitgation done and it looks like the code that handles this cmd (
libr/core/cmd_meta.c
) treats the 3rd paramter as a repeat counter and not the address location.The code in question is in mentioned file in lines 658-665.
We can see that the third argument is parsed and set as reapet variable and later it's used as an condition for exiting the while-loop. Having this knowledge it's obvious that r2 hangs as it tries to repeat the action
0x401034
times.Not sure if my understanding of this command usage is wrong, help message is not updated or the code is not working as it should according to the spec.
Also noticed additional (if think) wrong behavior, if the third parameter is something that's not parsable as number it will be set as the string itself (which is weird).
I.e.
Cs 31 @0x401034
will put in the current location the string "Error". (https://asciinema.org/a/Tv9uMsuYlUYqwfQ5zJ8gSATEJ)Note, that the address-less form (
Cs 31
) of this command works as expected.The text was updated successfully, but these errors were encountered: