fxos/doc/projects.md

3.6 KiB

Projects

Projects are fxos' way of managing data long-term by saving it to disk and reloading it. Projects allow virtual space settings, binary objects, analysis results and user annotations to be saved and reused across multiple sessions.

When fxos is running it always has exactly one project open at all times. It is visible in the prompt, which consists of the project name and the current binary. For instance in

unnamed_project*|cg_3.60>

the project name in unnamed_project and the currently-focused binary is cg_3.60. A star next to the project name indicates that it has unsaved changes.

Contents

A project consists of

  • A set of binaries (with their analysis results, annotations, etc);
  • Cross-binary analysis results.

Projects are saved to disk as folders with names usually ending in .fxos. fxos expects to manage the entire folder, so extra files should not be created in there. Since the format is binary serialization for convenience, it's also unlikely to be convenient to edit without using fxos directly.

Recent projects

fxos remembers recently-opened projects. By default (when started with no arguments), fxos loads the most recent project.

The list of paths and associated names can be printed with the Info Projects (ip) command. It is updated automatically at startup, pruning projects that have been moved or removed. This list can be used to refer to projects by name instead of specifying their full paths, such as in the CLI option -p.

Commands for managing projects

pn: Project New

pn [<name> ["<path>"]]

(1) pn
(2) pn cg_system
(3) pn cg_system "~/cg_system.fxos"

pn will create a new project and switch to it (if the current project has been saved). With no path argument (1,2), it generates a temporary project that must be given a path in ps the first time it is saved. If no name argument is provided, a placeholder name like "unnamed_project" is generated. With a path argument (3), the project is saved immediately.

pr: Project Rename

pr <new_name>

pr renames the current project. This does not change its path; to change the path, use ps to save to a new path then remove the old copy.

ps: Project Save

ps ["<path>"]

ps saves the current project. If no argument is specified, this saves to project's current path. With an argument, saves to a new folder (Save As). This can be used to copy or move projects.

pm: Project Migrate

pm <vspace_name>

pm migrates a "virtual space" defined by an fxosrc file to the project format. Previous versions of fxos used a global library of virtual spaces, loaded through a startup script called fxosrc, as makeshift projects. This was replaced in fxos 1.x by actual projects to allow saving analysis results.

In version 1.x, fxos still loads fxosrc if it exists, and lists any legacy virtual spaces in ip. pm imports a legacy virtual space, designated by name, into the current project as a new binary.

Opening projects from the command line and fxos prompt

Opening on the command-line

(1) % fxos <path>/
(2) % fxos <file>
(3) % fxos -p <name>

When specifying an existing folder as argument (1), fxos assumes the folder is a project folder and attempts to load it. When specifying an existing file (2), a new temporary project is created, with that file mapped in the virtual space. When specifying -p, fxos loads the most recent project with the provided name.

pl: Project Load

pl (<name> | "<path>")

pl loads an existing project. With a symbol argument, loads a recent project by name. With a string that identifies a folder, loads a project from the filesystem.