Skip to content

Instantly share code, notes, and snippets.

@rhasson
Created September 11, 2012 02:54
Show Gist options
  • Save rhasson/3695612 to your computer and use it in GitHub Desktop.
Save rhasson/3695612 to your computer and use it in GitHub Desktop.
var pst_index_ll = Struct ({
// uint64_t i_id;
'i_id': 'uint64',
// uint64_t offset;
'offset': 'uint64',
// uint64_t size;
'size': 'uint64',
// int64_t u1;
'u1': 'int64'
});
// struct pst_index_ll *next;
pst_index_ll.defineProperty('next', pst_index_ll);
var pst_desc_tree = Struct ({
//uint64_t d_id;
'd_id': 'uint64',
//uint64_t parent_d_id;
'parent_d_id': 'uint64',
//int32_t no_child;
'no_child': 'int32'
});
//pst_index_ll *desc;
pst_desc_tree.defineProperty('desc', pst_index_ll);
//pst_index_ll *assoc_tree;
pst_desc_tree.defineProperty('assoc_tree', pst_index_ll);
//struct pst_desc_tree *prev;
pst_desc_tree.defineProperty('prev', pst_desc_tree);
//struct pst_desc_tree *next;
pst_desc_tree.defineProperty('next', pst_desc_tree);
//struct pst_desc_tree *parent;
pst_desc_tree.defineProperty('parent', pst_desc_tree);
//struct pst_desc_tree *child;
pst_desc_tree.defineProperty('child', pst_desc_tree);
//struct pst_desc_tree *child_tail;
pst_desc_tree.defineProperty('child_tail', pst_desc_tree);
var pst_block_recorder = Struct ({
//int64_t offset;
'offset': 'int64',
//size_t size;
'size': 'size_t',
//int readcount;
'readcount': 'int'
});
//struct pst_block_recorder *next;
pst_block_recorder.defineProperty('next', pst_block_recorder);
var pst_file = Struct({
/** file pointer to opened PST file
FILE* fp; */
'fp': 'pointer',
/** original cwd when the file was opened
char* cwd; */
'cwd': 'CString',
/** original file name when the file was opened
char* fname; */
'fname': 'CString',
/** default character set for items without one
char* charset; */
'charset': 'CString',
/** @li 0 is 32-bit pst file, pre Outlook 2003;
* @li 1 is 64-bit pst file, Outlook 2003 or later
int do_read64; */
'do_read64': 'int',
/** file offset of the first b-tree node in the index tree
uint64_t index1; */
'index1': 'uint64',
/** back pointer value in the first b-tree node in the index tree
uint64_t index1_back; */
'index1_back': 'uint64',
/** file offset of the first b-tree node in the descriptor tree
uint64_t index2; */
'index2': 'uint64',
/** back pointer value in the first b-tree node in the descriptor tree
uint64_t index2_back; */
'index2_back': 'uint64',
/** size of the pst file
uint64_t size; */
'size': 'uint64',
/** @li 0 PST_NO_ENCRYPT, none
* @li 1 PST_COMP_ENCRYPT, simple byte substitution cipher with fixed key
* @li 2 PST_ENCRYPT, german enigma 3 rotor cipher with fixed key
unsigned char encryption; */
'encryption': 'uchar',
/** index type or file type
* @li 0x0e 32 bit pre Outlook 2003
* @li 0x0f 32 bit pre Outlook 2003
* @li 0x15 64 bit Outlook 2003 or later
* @li 0x17 64 bit Outlook 2003 or later
unsigned char ind_type; */
'ind_type': 'uchar'
});
/** the head and tail of the linked list of index structures
pst_index_ll *i_head, *i_tail; */
pst_file.defineProperty('i_head', pst_index_ll);
pst_file.defineProperty('i_tail', pst_index_ll);
/** the head and tail of the top level of the descriptor tree
pst_desc_tree *d_head, *d_tail; */
//pst_file.defineProperty('d_head', pst_desc_tree);
pst_file.defineProperty('d_head', ref.types.int);
pst_file.defineProperty('d_tail', pst_desc_tree);
/** the head of the extended attributes linked list
pst_x_attrib_ll *x_head; */
pst_file.defineProperty('x_head', pst_x_attrib_ll);
/** the head of the block recorder, a debug artifact
* used to detect cases where we might read the same
* block multiple times while processing a pst file.
pst_block_recorder *block_head; */
pst_file.defineProperty('block_head', pst_block_recorder);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment