radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
20.56k stars 2.99k forks source link

Some Unicode characters appear funny on graph output #17391

Open elicn opened 4 years ago

elicn commented 4 years ago

Work environment

Questions Answers
OS/arch/bits (mandatory) Ubuntu 20.04.1 x86-64
File format of the file you reverse (mandatory) ELF
Architecture/bits of the file (mandatory) x86/64
r2 -v full output, not truncated (mandatory) radare2 4.6.0-git 26193 @ linux-x86-64 git.4.4.0-498-g154416c8f

commit: 154416c8fd4ce0a399c42e27ba88a0c535e320a0 build: 2020-08-02__02:36:41

Expected behavior

base64 encoded characters should appear correctly on the screen.

Actual behavior

Some Unicode characters encoded with base64 appear funny on the screen. For example, the Unicode character '\u03a6' should appear as the Greek letter Phi, but appears as two gibberish characters on the screen. On the other hand, '\u2660' appropriately appears as a Spade symbol.

Steps to reproduce the behavior

On bash: $ echo -n $'\u03a6' | base64 yields: zqY= However, on r2: ag- ; agn "Phi" base64:zqY= ; agg yields gibberish characters (see screenshot below)

Notes:

  1. The character appears fine if printed directly, without being encoded to base64 first.
  2. e scr.utf8 = true

Additional Logs, screenshots, source-code, configuration dump, ...

phi

elicn commented 4 years ago

Apparently it has nothing to do with base64, its the graph output: uni I'll edit the bug title.