Skip to content
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

Remove ascii arrows from disassembly widget #413

Closed
xarkes opened this issue Mar 21, 2018 · 25 comments
Closed

Remove ascii arrows from disassembly widget #413

xarkes opened this issue Mar 21, 2018 · 25 comments
Assignees
Labels
Enhancement Label requests for new features or to improve existing ones good first issue Easy issues for new comers. rizin Needs changes into rizin codebase.
Milestone

Comments

@xarkes
Copy link
Member

xarkes commented Mar 21, 2018

Needs to fix pdJ with scr.html=true some characters aren't parsed correctly.
Needs to fix some fcnlines in radare2 too, cf screenshot below.
2018-03-21-104545_1019x288_scrot

@xarkes xarkes added Enhancement Label requests for new features or to improve existing ones good first issue Easy issues for new comers. rizin Needs changes into rizin codebase. labels Mar 21, 2018
@Maijin
Copy link
Member

Maijin commented Mar 21, 2018

@thestr4ng3r ^

@thestr4ng3r
Copy link
Member

Do you have an example what exactly needs to be fixed in pdJ?

@xarkes
Copy link
Member Author

xarkes commented Mar 21, 2018

I can't send a screenshot but the fcnlines character when utf8 is enabled is printed as \xe4\xXX\xXX something and it should be converted to a single character when using scr.html=true. The same way that \x1b for ansi codes is changed to <font color="#xxxxxx">

@xarkes xarkes added this to the 1.5.0 milestone Apr 18, 2018
@ITAYC0HEN
Copy link
Member

Screenshots attached.
Also, while scrolling with the wheel, it changes where and how the lines are.

image

image

@xarkes
Copy link
Member Author

xarkes commented Jun 1, 2018

I tried with this dumb patch:

diff --git a/libr/core/disasm.c b/libr/core/disasm.c
index fd83d10f4..a2bd2e50f 100644
--- a/libr/core/disasm.c
+++ b/libr/core/disasm.c
@@ -1729,7 +1729,8 @@ static void ds_print_pre(RDisasmState *ds) {
 
        char *c_esc = NULL;
        if (ds->use_json) {
-               c = c_esc = r_str_escape (c);
+               //c = c_esc = r_str_escape (c);
+               c = c_esc = strdup (c);
        }
        r_cons_printf ("%s%s%s ",
                COLOR (ds, color_fline), c,

Now the utf-8 characters are properly shown, but it looks like the characters are not vertically aligned anymore.

@xarkes xarkes modified the milestones: 1.5.0, 1.6.0 Jul 1, 2018
@XVilka
Copy link
Member

XVilka commented Jul 3, 2018

See also radareorg/radare2#10555

@Maijin
Copy link
Member

Maijin commented Jul 3, 2018

CC @cyanpencil

@XVilka
Copy link
Member

XVilka commented Aug 3, 2018

Wasn't this fixed already?

@xarkes
Copy link
Member Author

xarkes commented Aug 3, 2018

No, otherwise the issue would be closed :)

@ITAYC0HEN
Copy link
Member

ITAYC0HEN commented Aug 17, 2018

@xarkes your fix works fine - the problem with the vertical alignment is in the font being used. I assume
Inconsolata doesn't support some characters such as "─" or ">" so the character is being printed with a different font that has different char-width.

Inconsolata (Default font):
inconsolata

Free Mono:
freemono

@XVilka
Copy link
Member

XVilka commented Aug 17, 2018 via email

@xarkes
Copy link
Member Author

xarkes commented Aug 20, 2018

Great, maybe we can change default font in Cutter and then merge the fix.

@ITAYC0HEN
Copy link
Member

ITAYC0HEN commented Aug 20, 2018 via email

@radare
Copy link
Contributor

radare commented Aug 20, 2018

agave is nice too. i put some nice console fonts in my Therm (iterm2 fork) if u want to check them too

@thestr4ng3r
Copy link
Member

Yeah agave is great. Looks really nice in cutter.

@xarkes
Copy link
Member Author

xarkes commented Aug 20, 2018

Screenshots? :P

@radare
Copy link
Contributor

radare commented Aug 20, 2018 via email

@thestr4ng3r
Copy link
Member

agave:
agave
Vertical lines don't look too good, but maybe that can be fixed somehow. I like the font though.

@xarkes
Copy link
Member Author

xarkes commented Aug 20, 2018

Yeah I like the font too, and I don't really mind if the lines are a bit broken. As you said I think it can be fixed with the line height.

@ITAYC0HEN
Copy link
Member

ITAYC0HEN commented Aug 20, 2018

It's too heavy imo. I prefer thinner fonts. Maybe there's a thinner version
Also, yeah, no continuous lines :(

@xarkes xarkes removed this from the 1.6.0 milestone Sep 25, 2018
@ITAYC0HEN
Copy link
Member

okay so we need to decide on the right font to use and finally get rid of the dashed lines in cutter

|
|
|
|

@xarkes
Copy link
Member Author

xarkes commented Mar 11, 2019

I think we just need to stop relying on r2 output when it comes to our interface.
All we need from 2 is the disassembly, we should draw our own arrows.
I am renaming this issue.

@xarkes xarkes changed the title Use e scr.utf8=true by default Remove ascii arrows from disassembly widget Mar 11, 2019
@xarkes xarkes added this to To Do in Disassembly Widget Mar 11, 2019
@XVilka
Copy link
Member

XVilka commented Mar 11, 2019

Exactly, it will help to solve also 1) selection problem (don't select opcode bytes and reflines) 2) folding 3) highlighting and colors.

@ITAYC0HEN
Copy link
Member

the solution is a WIP and almost done. Tracked by @xarkes here: https://github.com/radareorg/cutter/tree/disassemblyWidget

@Maijin Maijin modified the milestones: 1.8.2?, 1.8.3 Jun 10, 2019
@xarkes xarkes mentioned this issue Jun 25, 2019
@ITAYC0HEN
Copy link
Member

Pullrequest is pending: https://github.com/radareorg/cutter/pull/1626

@Adikso Adikso closed this as completed Jul 14, 2019
Disassembly Widget automation moved this from To Do to Done Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Label requests for new features or to improve existing ones good first issue Easy issues for new comers. rizin Needs changes into rizin codebase.
Projects
Development

No branches or pull requests

7 participants