Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | MAX_METADATA_STRING_LENGTH 256 |
#define | ROW_READ(name) rowcounts->name = rz_read_le32(rowcountbuf); |
#define | ROW_READ_WITH_INDEX(name) |
#define | TRY_SEEK(rowsize, rowcountname) |
#define | READ_BUF_INDEX_SIZE(var, index_size) |
#define | INDEX_SIZE_FROM_TAG(name, tag_size) ut32 name = (index_count > (0xFFFF >> tag_size)) ? 4 : 2; |
Functions | |
static int | bin_pe_read_metadata_string (char *to, RzBuffer *frombuf, ut64 fromoff) |
static void | _free_stream (Pe_image_metadata_stream *stream) |
static ut32 | clr_max_rows (int count,...) |
static int | read_image_metadata_tilde_header (RzBuffer *b, ut64 addr, Pe_image_clr *clr) |
static int | read_image_clr_header (RzBuffer *b, ut64 addr, Pe_image_clr_header *header) |
int | bin_pe_dotnet_read_method_header (Pe_image_clr *clr, RzBuffer *b, RzBinSymbol *sym) |
int | bin_pe_dotnet_init_metadata (Pe_image_clr *clr, bool big_endian, RzBuffer *b, ut64 metadata_directory) |
int | bin_pe_dotnet_init_clr (Pe_image_clr *clr, RzBuffer *b, ut64 image_clr_hdr_paddr) |
static void | free_metadata_header (Pe_image_metadata_header *metadata) |
void | bin_pe_dotnet_destroy_clr (Pe_image_clr *clr) |
#define INDEX_SIZE_FROM_TAG | ( | name, | |
tag_size | |||
) | ut32 name = (index_count > (0xFFFF >> tag_size)) ? 4 : 2; |
#define READ_BUF_INDEX_SIZE | ( | var, | |
index_size | |||
) |
#define ROW_READ | ( | name | ) | rowcounts->name = rz_read_le32(rowcountbuf); |
#define ROW_READ_WITH_INDEX | ( | name | ) |
#define TRY_SEEK | ( | rowsize, | |
rowcountname | |||
) |
|
static |
Definition at line 32 of file dotnet.c.
References free().
Referenced by bin_pe_dotnet_init_metadata().
void bin_pe_dotnet_destroy_clr | ( | Pe_image_clr * | clr | ) |
Definition at line 968 of file dotnet.c.
References free(), free_metadata_header(), Pe_image_clr::header, Pe_image_clr::metadata_header, Pe_image_clr::methoddefs, rz_buf_free(), rz_list_free(), rz_pvector_free(), Pe_image_clr::streams, Pe_image_clr::strings, Pe_image_clr::tilde, and Pe_image_clr::typedefs.
Referenced by rz_bin_pe_free().
int bin_pe_dotnet_init_clr | ( | Pe_image_clr * | clr, |
RzBuffer * | b, | ||
ut64 | image_clr_hdr_paddr | ||
) |
Definition at line 932 of file dotnet.c.
References b, error(), free(), Pe_image_clr::header, header, len, read_image_clr_header(), and RZ_NEW0.
Referenced by bin_pe_init_clr().
int bin_pe_dotnet_init_metadata | ( | Pe_image_clr * | clr, |
bool | big_endian, | ||
RzBuffer * | b, | ||
ut64 | metadata_directory | ||
) |
Definition at line 783 of file dotnet.c.
References _free_stream(), b, bin_pe_read_metadata_string(), Pe_image_clr::blob_stream, c, calloc(), count, fail, Pe_image_metadata_header::Flags, free(), len, MAX_METADATA_STRING_LENGTH, Pe_image_clr::metadata_header, Pe_image_clr::methoddefs, NULL, Pe_image_metadata_stream::Offset, read_image_metadata_tilde_header(), Pe_image_metadata_header::Reserved, rz_buf_fread_at(), rz_buf_new_slice(), rz_buf_read_at(), rz_buf_size(), rz_list_append(), rz_list_free(), rz_list_newf(), RZ_LOG_WARN, RZ_NEW0, rz_pvector_new(), Pe_image_metadata_stream::Size, Pe_image_clr::streams, streams, Pe_image_clr::strings, strings(), Pe_image_clr::strings_stream, Pe_image_clr::tilde, Pe_image_clr::tilde_stream, Pe_image_clr::typedefs, Pe_image_metadata_header::VersionString, and Pe_image_metadata_header::VersionStringLength.
Referenced by bin_pe_init_clr().
int bin_pe_dotnet_read_method_header | ( | Pe_image_clr * | clr, |
RzBuffer * | b, | ||
RzBinSymbol * | sym | ||
) |
Definition at line 745 of file dotnet.c.
References b, Pe_image_clr_methodheader::flags, flags, rz_bin_symbol_t::paddr, PE_READ_STRUCT_FIELD, RZ_BUF_CUR, rz_buf_read(), rz_buf_read8(), rz_buf_seek(), RZ_BUF_SET, rz_warn_if_fail, rz_warn_if_reached, Pe_image_clr_methodheader::size, rz_bin_symbol_t::size, st64, and rz_bin_symbol_t::vaddr.
Referenced by rz_bin_pe_get_clr_methoddef_offset(), and rz_bin_pe_get_clr_symbols().
Definition at line 11 of file dotnet.c.
References MAX_METADATA_STRING_LENGTH, rz_buf_read8_at(), and to.
Referenced by bin_pe_dotnet_init_metadata().
|
static |
Definition at line 960 of file dotnet.c.
References free(), and Pe_image_metadata_header::VersionString.
Referenced by bin_pe_dotnet_destroy_clr().
|
static |
Definition at line 715 of file dotnet.c.
References addr, b, header, PE_READ_STRUCT_FIELD, RZ_BUF_CUR, rz_buf_read(), rz_buf_seek(), RZ_BUF_SET, and st64.
Referenced by bin_pe_dotnet_init_clr().
|
static |
Definition at line 62 of file dotnet.c.
References addr, Pe_image_metadata_index_sizes::assemblyref, Pe_image_metadata_index_sizes::assemblyrefprocessor, b, BIT_ASSEMBLY, BIT_ASSEMBLYOS, BIT_ASSEMBLYPROCESSOR, BIT_ASSEMBLYREF, BIT_ASSEMBLYREFOS, BIT_ASSEMBLYREFPROCESSOR, BIT_CLASSLAYOUT, BIT_CONSTANT, BIT_CUSTOMATTRIBUTE, BIT_DECLSECURITY, BIT_ENCLOG, BIT_ENCMAP, BIT_EVENT, BIT_EVENTMAP, BIT_EVENTPTR, BIT_EXPORTEDTYPE, BIT_FIELD, BIT_FIELDLAYOUT, BIT_FIELDMARSHAL, BIT_FIELDPTR, BIT_FIELDRVA, BIT_FILE, BIT_GENERICPARAM, BIT_GENERICPARAMCONSTRAINT, BIT_IMPLMAP, BIT_INTERFACEIMPL, BIT_MANIFESTRESOURCE, BIT_MEMBERREF, BIT_METHODDEF, BIT_METHODDEFPTR, BIT_METHODIMPL, BIT_METHODSEMANTICS, BIT_METHODSPEC, BIT_MODULE, BIT_MODULEREF, BIT_NESTEDCLASS, BIT_PARAM, BIT_PROPERTY, BIT_PROPERTYMAP, BIT_PROPERTYPTR, BIT_STANDALONESIG, BIT_TYPEDEF, BIT_TYPEREF, BIT_TYPESPEC, Pe_image_metadata_index_sizes::blob, clr_max_rows(), error(), Pe_image_metadata_index_sizes::event, Pe_image_metadata_typedef::extends, Pe_image_metadata_index_sizes::field, Pe_image_metadata_typedef::fieldlist, flags, free(), Pe_image_metadata_index_sizes::genericparam, Pe_image_metadata_index_sizes::guid, Pe_image_metadata_tilde_header::HeapSizes, i, index_size(), INDEX_SIZE_FROM_TAG, memset(), Pe_image_metadata_index_sizes::methoddef, Pe_image_clr::methoddefs, Pe_image_metadata_typedef::methodlist, Pe_image_metadata_index_sizes::moduleref, Pe_image_metadata_methoddef::name, Pe_image_metadata_typedef::name, Pe_image_metadata_index_sizes::param, Pe_image_metadata_methoddef::paramlist, PE_READ_STRUCT_FIELD, Pe_image_metadata_index_sizes::property, READ_BUF_INDEX_SIZE, ROW_READ, ROW_READ_WITH_INDEX, rva(), RZ_BUF_CUR, rz_buf_read(), rz_buf_seek(), RZ_BUF_SET, rz_calloc, rz_list_append(), RZ_LOG_WARN, RZ_NEW0, rz_pvector_push(), Pe_image_metadata_methoddef::signature, st64, Pe_image_metadata_index_sizes::string, Pe_image_clr::tilde, TRY_SEEK, Pe_image_metadata_index_sizes::typedef_, Pe_image_clr::typedefs, and Pe_image_metadata_tilde_header::Valid.
Referenced by bin_pe_dotnet_init_metadata().