radareorg / iaito

Official QT frontend of radare2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project saving doesn't work (on windows)

JomerDev opened this issue · comments

Environment

# copypaste this script into your shell and replace it with the output
Windows 10, so none of the commands work.
iaito version 5.8.8 using rs-5.8.8 (downloaded today from the releases page)

Description

No project or anything actually gets saved. I tried it in different folders, with different names. But even though the console says that the project was saved the folder the project is supposed to be saved in is empty

Test

Try to save a project in a known folder. Check if any data actually appeared after saving

Ok, this just got weirder.
I tried again to save with the project name 'a' and it worked. Opening that file doesn't work, the iaito window just vanishes after a few seconds. I tried to save it again as 'ab' but then the saving window also vanished (crashed, since it isn't visible in task manager either)

Is this issue happening on radare2 for windows too? Can you tell which version are you using? Last release is almost 1 year old and there are a bunch of fixes since then

radare2 had at least partially the same issue, it also crashed when I tried to open the r2 file iaito generated.
iaito version 5.8.8 using rs-5.8.8 (downloaded yesterday from the releases page)

r2 5.8.8 is the last release and it's very old. so i won't check this issue because there have been tons of fixes since then. I plan to release soon. If you want to use iaito/radare2 on windows i would recommend you to download the artifacts from github ci, or install it in wsl2 via flatpak

i will come back after the release

Tried on both Windows 11 22h2 and Windows 10 22h2, project saving and reloading works for me. I used the 5.8.8 binary from releases.

Are you able to run procmon to track down why this is happening? Filter for CreateFile api calls when saving projects.

Tested it again with procmon and the new release, it looks like using any uppercase character in the folder name breaks saving. Nothing shows up in procmon in that case, as if iaito wasn't even trying to do anything. Using the same folder name with only lowercase works

Turns out this is because valid project names must be lower characters, numbers, or "_".

Not sure if this is intended.

If it is I would expect an error message of any kind telling me that nothing was saved

I just checked the code and its ignoring the error codes when saving the project

const bool ok = true; // use core->rc

anybody wants to try to fix it? I can do that but im happy to see more cobtributors

Sure, I'll have some free time in a few days.
Might take awhile though because I've never contributed to iaito or radare2's codebase.

Fixed in 869998b

Screenshot 2024-04-09 at 17 02 08

Sorry for taking over, but i had a look at the issue and doing a proper fix required to modify r2, because relying on the output of the command was a very dirty solution.

You will need to pull this commit from r2 radareorg/radare2#22812 to test the fix. But i will do another release of r2 and iaito relatively soon.

Feel free to review and imporve r2 and and iaito commits, with better error message, or more checks in more places to make the project better and more solid. Thanks for reporting!

Thank you for fixing this! May I ask why no uppercase characters are allowed?

The reason is because projects are suposed to be portable and movable across systems. Mac and windows have case insensitive filesystems which caused some inconsistencies and spotted those bugs in the testsuite at the time. This way we ensure everyone uses the same rules

Thanks! I was looking through the codebase earlier and didn't know where would be best to patch either, so it would have taken significantly longer if I did it.

Yeah, usually i can fix things quickier but it's always good to have more eyes checking the code and improving and testing anything, because there are a lot of small details that won't show up easily and im busy with work and several opensource projects to maintain everyday, so having more hands always help.

Dont worry much about time to fix if you care about contributing :) the more you try the faster you get over time.

Feel free to throw me any question if you have or join the discord/telegram/matrix chats for better discussions.