11 printf(
"usage: getidblock [options] filename id\n");
12 printf(
"\tfilename - name of the file to access\n");
13 printf(
"\tid - ID of the block to fetch (0 to fetch all) - can begin with 0x for hex\n");
14 printf(
"\toptions\n");
15 printf(
"\t\t-p\tProcess the block before finishing.\n");
16 printf(
"\t\t-b\tDump the blocks in binary to stdout.\n");
17 printf(
"\t\t\tView the debug log for information\n");
21 void dumper(uint64_t i_id);
28 DEBUG_INFO((
"\n\n\nLooking at block index1 id %#"PRIx64
"\n", i_id));
31 DIE((
"Error loading block\n"));
34 DEBUG_INFO((
"Printing block i_id %#"PRIx64
", size %#"PRIx64
"\n", i_id, (uint64_t)readSize));
36 if (fwrite(buf, 1, readSize, stdout) != 0) {
37 DIE((
"Error occurred during writing of buf to stdout\n"));
40 printf(
"Block id %#"PRIx64
", size %#"PRIx64
"\n", i_id, (uint64_t)readSize);
46 DEBUG_INFO((
"Parsing block id %#"PRIx64
"\n", i_id));
70 uint64_t parent_d_id = (parent) ? parent->
d_id : 0;
71 printf(
"Descriptor block d_id %#"PRIx64
" parent d_id %#"PRIx64
" children %i desc.i_id=%#"PRIx64
", assoc tree.i_id=%#"PRIx64
"\n",
83 int main(
int argc,
char*
const* argv)
93 while ((c =
getopt(argc, argv,
"bp")) != -1) {
116 i_id = (uint64_t)strtoll(sid, NULL, 0);
121 DIE((
"Error opening file\n"));
126 DIE((
"Error loading file index\n"));
141 DIE((
"pst_close failed\n"));
void dump_desc(pst_desc_tree *ptr, pst_desc_tree *parent)
void pst_debug_hexdumper(FILE *out, const char *buf, size_t size, int cols, int delta)
void pst_freeItem(pst_item *item)
Free the item returned by pst_parse_item().
void * pst_malloc(size_t size)
int pst_close(pst_file *pf)
Close a pst file.
This contains the common mapi elements, and pointers to structures for each major mapi item type...
int getopt(int argc, char *const *argv, char *optstring)
struct pst_desc_tree * next
struct pst_desc_tree * child
int pst_open(pst_file *pf, const char *name, const char *charset)
Open a pst file.
pst_index_ll * pst_getID(pst_file *pf, uint64_t i_id)
Lookup the i_id in the index linked list, and return a pointer to the element.
void dumper(uint64_t i_id)
size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t i_id, char **buf)
Get an ID block from file using pst_ff_getIDblock() and decrypt if necessary.
pst_index_ll * assoc_tree
int main(int argc, char *const *argv)
pst_item * pst_parse_item(pst_file *pf, pst_desc_tree *d_ptr, pst_id2_tree *m_head)
Process a high level object from the pst file.
pst_desc_tree * pst_getNextDptr(pst_desc_tree *d)
Walk the descriptor tree.
pst_desc_tree * d_head
the head and tail of the top level of the descriptor tree
#define DEBUG_INIT(fname, mutex)
int pst_load_index(pst_file *pf)
Load the index entries from the pst file.
pst_index_ll * i_table
the array of index structures