Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a feature for mapping real files into the symbolic filesystem #115

Closed
Boyan-MILANOV opened this issue Jun 12, 2022 · 1 comment · Fixed by #116
Closed

Add a feature for mapping real files into the symbolic filesystem #115

Boyan-MILANOV opened this issue Jun 12, 2022 · 1 comment · Fixed by #116
Assignees
Labels
env/emulation Everything related to emulation of the environment (file system, syscalls, library emulation, ...) Good first issue Good issue to get started and contribute to Maat refactoring Code refactoring & restructuration

Comments

@Boyan-MILANOV
Copy link
Collaborator

Maat's loader has some code to map a real file from the host computer to the virtual symbolic filesystem:

engine->env->fs.create_file(lib_fs_path, true);
env::physical_file_t pfile = engine->env->fs.get_file(lib_fs_path);
if (pfile == nullptr) {
throw loader_exception(
Fmt() << "Error getting file in emulated filesystem: "
<< lib_fs_path >>
Fmt::to_str);
}
addr_t offset = 0;
pfile->copy_real_file(lib_path);

We should definitely allow to do this automatically from a simple method, as part of the FileSystem API. For example FileSystem::add_real_file(/path/to/real/file, /path/in/virtual/fs). The method must also be exposed in the python bindings.

This feature is required by #93 (comment)

@Boyan-MILANOV Boyan-MILANOV added env/emulation Everything related to emulation of the environment (file system, syscalls, library emulation, ...) refactoring Code refactoring & restructuration Good first issue Good issue to get started and contribute to Maat labels Jun 12, 2022
@Boyan-MILANOV Boyan-MILANOV self-assigned this Jun 12, 2022
@Boyan-MILANOV
Copy link
Collaborator Author

Fixed by #116 in the dev-next branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env/emulation Everything related to emulation of the environment (file system, syscalls, library emulation, ...) Good first issue Good issue to get started and contribute to Maat refactoring Code refactoring & restructuration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant