Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_bin.h>
Public Attributes | |
RZ_OWN RZ_NONNULL char * | name |
RZ_NONNULL RzBuffer * | buf |
bool | buf_owned |
whether buf is owned and freed by this RzBinVirtualFile More... | |
A virtual file is a binary buffer, exposed by a bin plugin for a loaded file. These virtual files can be used whenever data that is related to the file but not directly represented-as is in the raw file should be mapped into the virtual address space. Common examples for this include compressed segments or patching relocations. The idea is that the bin plugin exposes virtual files and then refers to them in the RzBinMap it returns.
For example, when there is a binary format that contains a compressed segment called "text", the bin plugin would create a virtual file:
RzBinVirtualFile { .name = "text_decompressed", .buf = rz_buf_new_with_bytes(<decompressed bytes>, <decompressed size>), ... }
which it can then use for mapping by referring to its exact name:
RzBinMap { .vsize = <decompressed size>, .name = "text", .vfile_name = "text_decompressed", ... }
When RzBin is used as part of RzCore, these virtual files can be opened as RzIO files using an URI like vfile://<binfile id>/<filename>
. By default, RzCore sets everything up automatically though so it is rather rare that one has to manually work with these URIs.
RZ_NONNULL RzBuffer* rz_bin_virtual_file_t::buf |
Definition at line 597 of file rz_bin.h.
Referenced by get_virtual_files(), rz_bin_virtual_file_free(), and virtual_files().
bool rz_bin_virtual_file_t::buf_owned |
whether buf is owned and freed by this RzBinVirtualFile
Definition at line 598 of file rz_bin.h.
Referenced by get_virtual_files(), rz_bin_virtual_file_free(), and virtual_files().
RZ_OWN RZ_NONNULL char* rz_bin_virtual_file_t::name |
Definition at line 596 of file rz_bin.h.
Referenced by cmd_descs_generate.Arg::__str__(), cmd_descs_generate.Detail::__str__(), cmd_descs_generate.Arg::_get_choices_cname(), cmd_descs_generate.CmdDesc::_validate(), find_vfile(), cmd_descs_generate.Detail::get_detail_entries_cname(), get_virtual_files(), test_group_name.GroupTest::run(), rz_bin_object_get_virtual_file(), rz_bin_virtual_file_free(), cmd_descs_generate.CmdDesc::str_tab(), and virtual_files().