Create a project

glaurung repl

Open an interactive session over a binary and its project.

writes files or project state 2 worked examples

use it for

Use the REPL to move between functions, inspect evidence, decompile, rename, comment, and edit types without repeating long command lines.

Run glaurung repl --help on your installed version before putting the command in a script. Glaurung is still pre-1.0.

input
A binary plus an existing or new .glaurung project.
output
An interactive prompt. Navigation reads project state; annotation commands save immediately and enter the undo log.
mode
writes state. Interactive annotation commands update the project and enter the undo log.

command shape

syntax

short form
$ glaurung repl BINARY --db PROJECT

The installed parser is authoritative: glaurung repl --help

before the examples

project setup

The examples use the checked-in hello-c-clang-debug fixture and a project named hello.glaurung.

$ glaurung kickoff samples/binaries/platforms/linux/amd64/export/native/clang/debug/hello-c-clang-debug --db hello.glaurung

Skip this step if hello.glaurung already exists.

run it

examples

List functions and leave

Type functions 6 at the prompt, then q.

run

from the engine checkout
$ glaurung repl samples/binaries/platforms/linux/amd64/export/native/clang/debug/hello-c-clang-debug --db hello.glaurung

output

captured result captured REPL session, shortened
glaurung repl  binary=<repo>/samples/binaries/platforms/linux/amd64/export/native/clang/debug/hello-c-clang-debug
               db=hello.glaurung  session='main'
> functions 6
  16 functions, showing first 6:
    0x1000  _init  (set_by=analyzer)
    0x1020  sub_1020  (set_by=analyzer)
    0x1030  sub_1030  (set_by=analyzer)
    0x1036  sub_1036  (set_by=analyzer)
> q
saving and exiting…

captured REPL session, shortened.

Read the result: The prompt autosaves edits. Use help inside the REPL for navigation, xrefs, decompilation, labels, prototypes, and stack locals.

Keep two analyst sessions

A named session separates one line of investigation from another without copying the binary.

run

from the engine checkout
$ glaurung repl samples/binaries/platforms/linux/amd64/export/native/clang/debug/hello-c-clang-debug --db hello.glaurung --session exploit-review

output

captured result captured REPL session, shortened
glaurung repl  binary=samples/binaries/platforms/linux/amd64/export/native/clang/debug/hello-c-clang-debug
               db=hello.glaurung  session='exploit-review'
> help
glaurung repl commands

  Navigation
    goto <addr> | g <addr>      jump cursor to address
    back | b                    previous history position

  Persistence (auto-saved)
    rename <addr> <name>        set canonical function name
    comment <addr> <text>       attach a comment to an address
> quit
saving and exiting…

captured REPL session, shortened.

Read the result: The session name changes the analyst context, not the binary or project path. Writes still land in the same project and remain visible in its journal.

used above

important options

--db PROJECT
Open this project instead of creating one beside the binary.
--session NAME
Keep a separate analyst session in the same project.
--no-index
Skip the one-time call-graph indexing pass.

These are the flags used by the examples. Run glaurung repl --help for the complete parser help.

before you rely on it

checks

keep working

related commands

← all 40 commands