Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | dbi_stream_header_t |
struct | RzPdbRzPdbDbiStreamDbgHeader |
struct | dbi_stream_t |
struct | RzPdbGDataStream |
struct | RzPdbOmapStream |
struct | RzPdbPeStream |
struct | tpi_stream_header_t |
struct | tpi_types |
struct | tpi_stream_t |
struct | RzPdbGuid |
struct | RzRzPdbStreamHeader |
struct | RzPdbStream |
struct | RzPdbMsfSuperBlock |
MSF file format header https://llvm.org/docs/PDB/MsfFile.html#the-superblock. More... | |
struct | RzPdbMsfStream |
struct | RzPdbMsfStreamDirectory |
struct | rz_pdb_t |
Macros | |
#define | CAB_SIGNATURE "MSCF" |
#define | PDB_SIGNATURE "Microsoft C/C++ MSF 7.00\r\n\x1a\x44\x53\x00\x00\x00" |
#define | PDB_SIGNATURE_LEN 32 |
#define | GET_BF(value, start, len) (((value) >> (start)) & ((1 << len) - 1)) |
Typedefs | |
typedef struct dbi_stream_header_t | RzPdbRzPdbDbiStreamHdr |
typedef struct dbi_stream_t | RzPdbDbiStream |
typedef struct tpi_stream_header_t | RzPdbTpiStreamHeader |
typedef struct tpi_types | RzPdbTpiType |
typedef struct tpi_stream_t | RzPdbTpiStream |
typedef enum pdb_stream_index_t | RzRzPdbStreamIndex |
typedef struct rz_pdb_t | RzPdb |
Enumerations | |
enum | RzPdbTpiCallingConvention { NEAR_C = 0x00000000 , FAR_C = 0x00000001 , NEAR_PASCAL = 0x00000002 , FAR_PASCAL = 0x00000003 , NEAR_FAST = 0x00000004 , FAR_FAST = 0x00000005 , SKIPPED = 0x00000006 , NEAR_STD = 0x00000007 , FAR_STD = 0x00000008 , NEAR_SYS = 0x00000009 , FAR_SYS = 0x0000000A , THISCALL = 0x0000000B , MIPSCALL = 0x0000000C , GENERIC = 0x0000000D , ALPHACALL = 0x0000000E , PPCCALL = 0x0000000F , SHCALL = 0x00000010 , ARMCALL = 0x00000011 , AM33CALL = 0x00000012 , TRICALL = 0x00000013 , SH5CALL = 0x00000014 , M32RCALL = 0x00000015 , CLRCALL = 0x00000016 , INLINECALL = 0x00000017 , NEAR_VEC = 0X00000018 , RESERVED = 0x00000019 , MAX_CV_CALL } |
enum | RzPdbTpiStreamVersion { V40 = 19950410 , V41 = 19951122 , V50 = 19961031 , V70 = 19990903 , V80 = 20040203 } |
enum | pdb_stream_index_t { PDB_STREAM_ROOT = 0 , PDB_STREAM_PDB , PDB_STREAM_TPI , PDB_STREAM_DBI , PDB_STREAM_GSYM , PDB_STREAM_SECT_HDR , PDB_STREAM_SECT__HDR_ORIG , PDB_STREAM_OMAP_TO_SRC , PDB_STREAM_OMAP_FROM_SRC , PDB_STREAM_FPO , PDB_STREAM_FPO_NEW , PDB_STREAM_XDATA , PDB_STREAM_PDATA , PDB_STREAM_TOKEN_RID_MAP , PDB_STREAM_MAX } |
enum | pdb_stream_version { VC2 = 19941610 , VC4 = 19950623 , VC41 = 19950814 , VC50 = 19960307 , VC98 = 19970604 , VC70Dep = 19990604 , VC70 = 20000404 , VC80 = 20030901 , VC110 = 20091201 , VC140 = 20140508 } |
typedef struct dbi_stream_t RzPdbDbiStream |
typedef struct dbi_stream_header_t RzPdbRzPdbDbiStreamHdr |
typedef struct tpi_stream_t RzPdbTpiStream |
typedef struct tpi_stream_header_t RzPdbTpiStreamHeader |
typedef struct tpi_types RzPdbTpiType |
typedef enum pdb_stream_index_t RzRzPdbStreamIndex |
enum pdb_stream_index_t |
Definition at line 161 of file rz_pdb.h.
enum pdb_stream_version |
RZ_API RZ_OWN char* rz_bin_pdb_calling_convention_as_string | ( | RZ_NONNULL RzPdbTpiCallingConvention | idx | ) |
Parses calling convention type as string.
idx |
Definition at line 35 of file tpi.c.
References FAR_C, FAR_FAST, FAR_PASCAL, FAR_STD, FAR_SYS, setup::idx, NEAR_C, NEAR_FAST, NEAR_PASCAL, NEAR_STD, NEAR_SYS, NEAR_VEC, NULL, strdup(), and THISCALL.
Referenced by parse_type_mfunction(), and parse_type_procedure().
RZ_API bool rz_bin_pdb_extract_in_folder | ( | RZ_NONNULL const char * | file_cab, |
RZ_NONNULL const char * | output_dir | ||
) |
Extracts compressed PDB files into a folder.
file_cab | The file cab |
output_dir | The output dir |
Definition at line 209 of file cab_extract.c.
References cab_error(), cabd, mscab_decompressor::close, mscab_decompressor::extract, mscabd_cabinet::files, free(), is_cab_using_unix_paths(), mspack_create_cab_decompressor(), mspack_destroy_cab_decompressor(), file::next, NULL, mscab_decompressor::open, rz_file_exists(), rz_file_is_directory(), RZ_LOG_ERROR, RZ_LOG_INFO, rz_return_val_if_fail, and sanitize_cab_filename().
Referenced by download(), and rz_cmd_pdb_extract_handler().
Free PDB instance.
pdb | PDB instance |
Definition at line 366 of file pdb.c.
References rz_pdb_t::buf, free(), free_dbi_stream(), free_gdata_stream(), free_omap_stream(), free_pe_stream(), free_tpi_stream(), rz_buf_free(), rz_list_free(), rz_pdb_t::s_dbi, rz_pdb_t::s_gdata, rz_pdb_t::s_omap, rz_pdb_t::s_pdb, rz_pdb_t::s_pe, rz_pdb_t::s_tpi, rz_pdb_t::streams, and rz_pdb_t::super_block.
Referenced by GetHeapGlobalsOffset(), rz_bin_pdb_parse_from_buf(), rz_cmd_info_pdb_show_handler(), rz_core_bin_pdb_load(), and rz_core_bin_print().
RZ_API RZ_BORROW RzPdbTpiType* rz_bin_pdb_get_type_by_index | ( | RZ_NONNULL RzPdbTpiStream * | stream, |
ut32 | index | ||
) |
Get RzPdbTpiType that matches tpi stream index.
Definition at line 1844 of file tpi.c.
References container_of, is_simple_type(), NULL, parse_simple_type(), rz_rbtree_find(), rz_return_val_if_fail, tpi_type_node_cmp(), and type.
Referenced by parse_enum(), parse_structure(), parse_type_arglist(), parse_type_array(), parse_type_member(), parse_type_mfunction(), parse_type_modifier(), parse_type_nest(), parse_type_onemethod(), parse_type_pointer(), parse_type_procedure(), parse_type_static_member(), parse_union(), and rz_bin_pdb_get_type_members().
RZ_API RZ_BORROW RzList* rz_bin_pdb_get_type_members | ( | RZ_NONNULL RzPdbTpiStream * | stream, |
RzPdbTpiType * | t | ||
) |
Get the RzPdbTpiType member list.
stream | TPI stream |
t | RzPdbTpiType |
Definition at line 406 of file tpi.c.
References tpi_types::leaf_type, LF_CLASS, LF_CLASS_19, LF_ENUM, LF_FIELDLIST, LF_STRUCTURE, LF_STRUCTURE_19, LF_UNION, NULL, rz_bin_pdb_get_type_by_index(), rz_return_val_if_fail, Tpi_LF_FieldList::substructs, autogen_x86imm::tmp, and tpi_types::type_data.
Referenced by parse_enum(), parse_structure(), and parse_union().
RZ_API RZ_BORROW char* rz_bin_pdb_get_type_name | ( | RZ_NONNULL RzPdbTpiType * | type | ) |
Get the name of the type.
type | RzPdbTpiType * |
Definition at line 447 of file tpi.c.
References LF_ARRAY, LF_CLASS, LF_CLASS_19, LF_ENUM, LF_ENUMERATE, LF_MEMBER, LF_METHOD, LF_NESTTYPE, LF_ONEMETHOD, LF_STMEMBER, LF_STRUCTURE, LF_STRUCTURE_19, LF_UNION, Tpi_Type_String::name, Tpi_LF_Array::name, Tpi_LF_Structure::name, Tpi_LF_Structure_19::name, Tpi_LF_Union::name, Tpi_LF_Enum::name, Tpi_LF_Enumerate::name, Tpi_LF_NestType::name, Tpi_LF_Method::name, Tpi_LF_Member::name, Tpi_LF_StaticMember::name, Tpi_LF_OneMethod::name, NULL, rz_return_val_if_fail, and type.
Referenced by parse_enum(), parse_enumerate(), parse_struct_member(), parse_structure(), parse_type_nest(), parse_type_onemethod(), parse_union(), and parse_union_member().
RZ_API ut64 rz_bin_pdb_get_type_val | ( | RZ_NONNULL RzPdbTpiType * | type | ) |
Get the numeric value inside the type.
type | RzPdbTpiType * |
Definition at line 507 of file tpi.c.
References Tpi_LF_Enumerate::enum_value, get_numeric_val(), Tpi_LF_Index::index, LF_ARRAY, LF_CLASS, LF_CLASS_19, LF_ENUMERATE, LF_INDEX, LF_MEMBER, LF_ONEMETHOD, LF_STRUCTURE, LF_STRUCTURE_19, LF_UNION, Tpi_LF_Member::offset, Tpi_LF_OneMethod::offset_in_vtable, rz_return_val_if_fail, Tpi_LF_Array::size, Tpi_LF_Structure::size, Tpi_LF_Structure_19::size, Tpi_LF_Union::size, and type.
Referenced by parse_enum(), parse_enumerate(), parse_struct_member(), parse_structure(), parse_type_array(), parse_union(), and parse_union_member().
RZ_API int rz_bin_pdb_omap_remap | ( | RZ_NONNULL RzPdbOmapStream * | omap_stream, |
int | address | ||
) |
return remapped symbol address
omap_stream | RzPdbOmapStream |
address | Where to remap |
Definition at line 89 of file omap.c.
References binary_search(), OmapEntry::from, i, len, malloc(), pos, rz_list_get_n(), rz_list_iterator(), rz_list_length(), and OmapEntry::to.
Referenced by pdb_set_symbols(), and rz_core_bin_pdb_gvars_as_string().
Parse PDB from the buffer.
buf | mmap of the PDB file |
Definition at line 315 of file pdb.c.
References RzPdbMsfSuperBlock::block_map_addr, RzPdbMsfSuperBlock::block_size, rz_pdb_t::buf, error(), RzPdbMsfSuperBlock::file_magic, RzPdbMsfSuperBlock::free_block_map_block, if(), len, NULL, RzPdbMsfSuperBlock::num_blocks, RzPdbMsfSuperBlock::num_directory_bytes, pdb7_parse(), PDB_SIGNATURE, PDB_SIGNATURE_LEN, rz_bin_pdb_free(), rz_buf_read(), rz_buf_read_le32, rz_buf_size(), RZ_LOG_ERROR, RZ_NEW0, rz_return_val_if_fail, st64, rz_pdb_t::super_block, RzPdbMsfSuperBlock::unknown, ut64(), and valid.
Referenced by rz_bin_pdb_parse_from_file().
RZ_API RZ_OWN RzPdb* rz_bin_pdb_parse_from_file | ( | RZ_NONNULL const char * | filename | ) |
Parse PDB file given the path.
filename | path of the PDB file |
Definition at line 292 of file pdb.c.
References is_compressed_pdb(), NULL, rz_bin_pdb_parse_from_buf(), rz_buf_free(), rz_buf_new_slurp(), RZ_LOG_ERROR, and rz_return_val_if_fail.
Referenced by GetHeapGlobalsOffset(), and rz_core_pdb_load_info().
RZ_API bool rz_bin_pdb_type_is_fwdref | ( | RZ_NONNULL RzPdbTpiType * | t | ) |
Return true if type is forward definition.
t | RzPdbTpiType |
Definition at line 372 of file tpi.c.
References TpiCVProperty::bits, TpiCVProperty::fwdref, LF_CLASS, LF_CLASS_19, LF_ENUM, LF_STRUCTURE, LF_STRUCTURE_19, LF_UNION, Tpi_LF_Structure::prop, Tpi_LF_Structure_19::prop, Tpi_LF_Union::prop, Tpi_LF_Enum::prop, rz_return_val_if_fail, and rz_warn_if_reached.
Referenced by parse_enum(), parse_structure(), and parse_union().