pancake
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    For starters, let's copy all the relevant messages from the chat. (Nah, copying is too much. Need to sum up later.) **also see this https://hackmd.io/uKWxCD4LQUOZGtOdr9TO3w** ## Double-Escape > [name=ratijas] > double press Escape throws out of panels mode into r2 shell. It is also required to press Escape twice to drop focus from the File/Edit/etc menu at the top. > > Is that by design? Escape key is not documented in help window. > [name=paπcake] [In reply to ratijas] > Oops missed that msg. Escape char is sent to the console for other special keys. So handling esc is not easy if youbwant to make it portable without using ptyinfo. So yeah its intended to have this behaviour but not documwnted as long as it can change over time or on different terminals > [name=ratijas] [In reply to paπcake] > now that i think of it, i experienced same weirdness in vim: from insert mode press escape, and wait up to a second or so, to let that escape key code actually propagate and apply. > [name=ratijas] [In reply to paπcake] > I got back to my computer and tried again. Single escape doesn't work in radare2, even after a timeout. Only double pressing it works. Which is extremely confusing and obscure UX. > > Also, why using escapes? Panels (v) and visual (V) modes are not some lightweight OK/Cancel dialogues — why should they even respond to an escape key at all? > [name=paπcake] [In reply to ratijas] > Just use q > [name=paπcake] Arrow keys, function keys, ctrl keys, mouse events are all handled by the escape character > [name=ratijas] [In reply to paπcake] > q works too, i suppose :) > [name=paπcake] I tend to use only alphabumeric keys > [name=paπcake] No arrows or esc > [name=paπcake] Esc never plays well with terminals > [name=ratijas] > but still it doesn't feel right just being able to escape out of the panels mode. Ctrl-C feels right, q feels OK, escape feels like... too easy to close. Like if panels mode was something as disposable as aforementioned OK/Cancel dialogue or a notification pop-up. > [name=ratijas] also, i found out about the possibility by escaping too much from some inner menus :) > > Closing seek-to-function pop-up was expected. Whole panels shutting down was kinda surprising. > [name=paπcake] > Why quiting when pressing esc is surprising at all? > [name=ratijas] [In reply to paπcake] > Well, they look like windows. You don't typically close desktop windows with escape. > [name=ratijas] unlike menus, pop-ups, dialogues etc > [name=ratijas] > especially given that File/Edit/... menu also closes with escape, and even worse — double escape. > > let's say, i opened File menu, pressed Esc -> nothing happened, pressed few more times "just to be sure"ⓒ -> panels went down altogether with File menu -> surprise, we're back to `[0x0000]>` prompt > [name=paπcake] > Esc aliases to q ## Bird's eye view of modes ![Bird's eye view of modes](https://i.imgur.com/Ur7lZ8b.png) ((Concept art)) TODO: make vector version of bird's eye view of modes using **dot**(1) or something similar. > [name=ratijas] I also would like to make a bird's-eye view of all available modes and commands to transition between them. > > I think it could help solve inconsistency in naming stuff like: short/full names, upper/lowercase, menu vs mode etc. > [name=ratijas] also, keys/commands terminology. uhm isnt clear what a key is and what a command is? > [name=ratijas] well, they are not distinguished in UI. that's all. a command needs enter at the end to be executed and its usually composed by more than one key press, a key is just pressing one key. > [name=ratijas] Yeah, maybe some little hint in title of help page would be just about enough. help message in visual and panels need a lot of love , mainly from feedback from new users. so im glad to have this pad in here :) > [name=ratijas] I already opened [an issue](https://github.com/radareorg/radare2/issues/18093) mentioning groupping commands. Now it also has to use word "keys" :) Groupping both keys and commands is essential. Leaving a mode: 'q' key or 'q' command * r2 -q - * silent prompt, no command echo, useful for piping scripts to stdin * r2 - * standard shell * r2 -e scr.color=0 - * plaintext shell, useful for serial consoles (no \r or \x1b[2K] to clearline) * visual mode * using the V command * use ! to toggle between panels and visual * space toggles graph and disasm * press : to enter prompt in visual to run commands, press enter (empty line) to go back to visual * panels mode * using the v command * use ! to toggle between panels and visual * m key opens the menu, q closes the menu * same ':' as in visual. all those keys use to work on all interactive modes. * graph mode * VV or pressing space in visual/panels * cursor (moving basic blocks around) is not a separate mode which a user can be `q`uit from. Maybe it should be? At least, there's a mark `(cursor)` appearing at the top left. * mount shell * ms command * rlang shell * #! command enters a python/node/... shell to interact with current session via r2pipe or rlang * various * inconsistency: why in prompt seeking is `s` but in visual mode is `g`? * some commands launch local one-off prompts, half of them can be closed via backspace when empty, others don't. For example, `V` + `f` shows "flag name" prompt which can't be closed with backspace. * visual glitch: immediately after exiting from panels mode to prompt, cursor is still colored like panels' borders. * visual glitch: in Visual Graph modes, top row is used to display currently displayed command, but right after the last character of the command, there might be some extra characters (2 columns, to be precise) rendered from a graph view. If first of those two characters also starts new ANSI escape color sequence, they'll be colored, otherwise default like the command on the left of them. * visual glitch: Color at the end of `f=` bar chart is not reset. Even the cursor is green after that. ![Green visual glitch](https://i.imgur.com/zhUH0xf.png) * Fix `aaf?` help. --- > [name=ratijas] > there's a menu which closes instantly upon pressing Escape. > > Go into Visual Graph Mode (VV), select some basic block with more than one input or output, and press i or I to select input node or output node by index respectively. When r2 prompts for which one you'd like to seek to, press Escape. > > Result: prompt with input/output nodes immediately closes. > [name=ratijas] so, it seems it should be possible to gracefully quit from panels or File/etc menu via single Escape. --- > [name=ratijas] Variables like `$FS`, `$$` etc have to be called something like "special variables" or "magic variables" to avoid confusion with variables defined in binary code of disassembled functions. --- https://book.rada.re/basic_commands/dietline.html Dietline page mentions some kinds of modes, calling them "all radare2 subshells - main prompt, SDB shell, visual prompt, and offsets prompt". > [name=ratijas] I don't think "visual prompt" is a particularly correct term. --- ## Panels scrolling bug In Panels Mode, panels other than Disassembly and Help are not reacting to the `h` key. They are supposed to be scrollable by `hjkl`, but once you scrolled to the right with `l` (little L), you can't move back by pressing `h`. As a temporary workaround, scrolling can be reset by clicking on an empty space inside a problematic panel. Context thread: https://t.me/radare/203893 Fixed by https://github.com/radareorg/radare2/pull/18190 --- ## Graph command changes settings Diff graph (`agd`) subcommands unexpectedly changed settings at least for graph utf vs. ascii borders, and for color scheme. Things that break stuff: - `agd*` - `agdd` - `agdg` - `agdk` - `agdt` - `agdv` Things that are going good: - Just `agd` by itself; - `agdj` - `agdw` #WTF --- ## `afi` doesn't look right It starts with weird `#`-only line, and the last line is a mess: ``` [0x00001070]> afi # offset: 0x00001070 name: entry0 size: 46 [...] args: 1 arg int64_t arg3 @ rdx diff: type: matchaddr: 0x1070function: entry0 ``` Last line bug only happens after broken `agd` command. ## `f=` output is not sorted? At the first sight, sections, segments, functions are all intermixed, which little sense to use this command at all. Actually, it is sorted by addresses. It seems like position on a bar is relative to the section to which that flag belongs to, but it's not always the case. Bar chart just looks weird and pointless. Its meaning should be documented better. ## Parsing size in `/p` Search commands `/p` and `/P` can't accept any 'size' expect simple decimal integers. The complaint here is the hex is not accepted. ``` [0x00402030]> /p 0x10 @ 0x00402000 Invalid pattern size (must be > 0) [0x00402030]> /p 16 @ 0x00402000 -- 0 7fffffffffffffff Searching patterns between 0x00000000 and 0x7fffffffffffffff bytes: 0: ffffffffffffffffffffffffffffffff found: 0: 0x00000000 0x00000010 count: 0: 2 0x00000011 ``` ## Cursor mode Respect utf8 settings to use unicode borders instead of ASCII around hex data. ## Memory maps `dmq` seems to be doing something different than just `dm`, but it is not documented in `dm?`. ## Memory maps How they work? General high-level overview is needed. ``` o? [...] | op[r|n|p|fd] select priorized file by fd (see ob), opn/opp/opr = next/previous/rotate ``` -- maybe "prioritized"? ## Server rap:// Server instance of radare may be killed by simply resizing terminal window due to receiving signal SIGWINCH. See also: **signal**(7). Minimal example: ```shell= $ radare2 rap://:1234 rap: listening at port 1234 ssl off RAP Server started (rap.loop=true) accept: Interrupted system call [r] Cannot open 'rap://' ``` Example after opening client session: ```shell $ radare2 rap://:1234 rap: listening at port 1234 ssl off RAP Server started (rap.loop=true) rap: client connected open (1): Warning: run r2 with -e io.cache=true to fix relocations in disassembly (flags: 0) len: 8 filename: '/bin/ls' [rap] unknown command 0x08 rap: waiting for new connection accept: Interrupted system call [r] Cannot open 'rap://' ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully