31 if (
s->hdr.version !=
VC70) {
41 rz_list_foreach (pdb->
streams, it, ms) {
107 if (block_size > 0) {
108 num_blocks =
length / block_size;
109 if (
length % block_size) {
130 if (!
stream->stream_size) {
142 for (
size_t j = 0; j <
stream->blocks_num; j++) {
154 if (!
stream->stream_data) {
182 for (
size_t i = 0;
i < block_num;
i++) {
193 block_map[
i] = block_idx;
197 ut8 *stream_directory = (
ut8 *)
malloc(stream_directory_len);
198 if (!stream_directory) {
202 for (
size_t i = 0;
i < block_num;
i++) {
228 ut32 total_blocks = 0;
276 ut8 magic[4] = { 0 };
302 RZ_LOG_ERROR(
"The pdb file %s seems to be compressed, please use idpx command to extract the contents.\n",
filename);
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
RZ_IPI bool parse_dbi_stream(RzPdb *pdb, RzPdbMsfStream *stream)
RZ_IPI void free_dbi_stream(RzPdbDbiStream *stream)
RZ_IPI bool parse_gdata_stream(RzPdb *pdb, RzPdbMsfStream *stream)
RZ_IPI void free_gdata_stream(RzPdbGDataStream *stream)
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
void * malloc(size_t size)
RZ_IPI bool parse_omap_stream(RzPdb *pdb, RzPdbMsfStream *stream)
RZ_IPI void free_omap_stream(RzPdbOmapStream *stream)
static bool parse_streams(RzPdb *pdb)
static RzPdbMsfStreamDirectory * pdb7_extract_msf_stream_directory(RzPdb *pdb)
static void msf_stream_directory_free(void *data)
static bool pdb7_parse(RzPdb *pdb)
RZ_API RZ_OWN RzPdb * rz_bin_pdb_parse_from_file(RZ_NONNULL const char *filename)
Parse PDB file given the path.
bool is_compressed_pdb(RzBuffer *buf)
static ut64 count_blocks(ut64 length, ut64 block_size)
static void msf_stream_free(void *data)
RZ_API void rz_bin_pdb_free(RzPdb *pdb)
Free PDB instance.
RZ_API RZ_OWN RzPdb * rz_bin_pdb_parse_from_buf(RZ_NONNULL const RzBuffer *buf)
Parse PDB from the buffer.
static RzList * pdb7_extract_streams(RzPdb *pdb, RzPdbMsfStreamDirectory *msd)
static bool parse_pdb_stream(RzPdb *pdb, RzPdbMsfStream *stream)
RZ_IPI bool parse_tpi_stream(RzPdb *pdb, RzPdbMsfStream *stream)
RZ_IPI void free_pe_stream(RzPdbPeStream *stream)
RZ_IPI bool parse_pe_stream(RzPdb *pdb, RzPdbMsfStream *stream)
RZ_IPI void free_tpi_stream(RzPdbTpiStream *stream)
#define rz_return_val_if_fail(expr, val)
RZ_API st64 rz_buf_seek(RZ_NONNULL RzBuffer *b, st64 addr, int whence)
Modify the current cursor position in the buffer.
RZ_API RZ_OWN RzBuffer * rz_buf_new_slurp(const char *file)
Creates a new buffer from a file.
RZ_API st64 rz_buf_read_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL RZ_OUT ut8 *buf, ut64 len)
Read len bytes of the buffer at the specified address.
RZ_API RZ_OWN RzBuffer * rz_buf_new_with_pointers(const ut8 *bytes, ut64 len, bool steal)
Creates a new buffer with a bytes array.
#define rz_buf_read_le16(b, result)
Read a big endian or little endian (ut16, ut32, ut64) at the specified offset in the buffer and shift...
#define rz_buf_read_le32(b, result)
RZ_API void rz_buf_free(RzBuffer *b)
Free all internal data hold by the buffer and the buffer.
RZ_API st64 rz_buf_read(RZ_NONNULL RzBuffer *b, RZ_NONNULL RZ_OUT ut8 *buf, ut64 len)
RZ_API ut64 rz_buf_size(RZ_NONNULL RzBuffer *b)
Return the size of the buffer.
#define RZ_LOG_ERROR(fmtstr,...)
#define PDB_SIGNATURE_LEN
MSF file format header https://llvm.org/docs/PDB/MsfFile.html#the-superblock.
ut32 num_directory_bytes
The size of the stream directory, in bytes.
ut32 num_blocks
The total number of blocks in the file.
ut32 block_size
The block size of the internal file system.
ut32 block_map_addr
The index of a block within the MSF file.
char file_magic[PDB_SIGNATURE_LEN]
Must be equal to "Microsoft C / C++ MSF 7.00\\r\\n" followed by the bytes 1A 44 53 00 00 00.
ut32 free_block_map_block
The index of a block within the file, the data within that block is not used.
RzPdbRzPdbDbiStreamHdr hdr
RzPdbRzPdbDbiStreamDbgHeader dbg_hdr
RzPdbGDataStream * s_gdata
RzPdbMsfSuperBlock * super_block
void error(const char *msg)
if(dbg->bits==RZ_SYS_BITS_64)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()