Class R2Shell

Class that interacts with the r2ai plugin (requires rlang-python and r2i r2pm packages to be installed). Provides a way to script the interactions with different language models using javascript from inside radare2.

Hierarchy

  • R2Shell

Constructors

  • Create a new instance of the R2Shell

       *
    

    Parameters

    Returns R2Shell

    instance of the shell api

Properties

rp: R2Papi

Keep a reference to the associated r2papi instance

Methods

  • Change current directory

       *
    

    Parameters

    • path: string

      to the directory *

    Returns boolean

    true if successful

  • Change current directory on the internal radare2 filesystem

       *
    

    Parameters

    • path: string

      name to change to *

    Returns void

    TODO: should return boolean

  • Enumerate all the mountpoints set in the internal virtual filesystem of radare2

    Returns any[]

    array of mount

  • Enumerate all the mountpoints set in the internal virtual filesystem of radare2

    Returns any[]

    array of mount

  • TODO: Checks if a file exists (not implemented)

       *
    

    Parameters

    • path: string

    Returns boolean

    true if the file exists, false if it does not

  • TODO: not implemented

    Parameters

    • file: string

    Returns boolean

  • TODO: not implemented

    Parameters

    • file: string

    Returns boolean

  • List files in the current directory

       *
    

    Returns string[]

    array of file names

  • List the files contained in the given path within the virtual radare2 filesystem.

       *
    

    Parameters

    • path: string

      name to change to *

    Returns string[]

    TODO: should return boolean

  • Create a new directory in the host system, if the opational recursive argument is set to true it will create all the necessary subdirectories instead of just the specified one.

       *
    

    Parameters

    • file: string
    • Optional recursive: boolean

    Returns boolean

    true if successful

  • Mount the given offset on the specified path using the filesytem. This is not a system-level mountpoint, it's using the internal filesystem abstraction of radare2.

       *
    

    Parameters

    • fstype: string
    • path: string
    • offset: string | number

    Returns boolean

    return code (0 is success)

  • Opens an URL or application Execute xdg-open on linux, start on windows, open on Mac

       *
    

    Parameters

    • arg: string

    Returns void

  • Run a system command and get the return code

       *
    

    Parameters

    • cmd: string

    Returns number

    return code (0 is success)

  • Unmount the mountpoint associated with the given path.

       *
    

    Parameters

    • path: string

      to the mounted filesystem *

    Returns void

    TODO: should return boolean

  • Deletes a file

       *
    

    Parameters

    • file: string

    Returns boolean

    true if successful

Generated using TypeDoc