The Sleuth Kit  4.0
Functions
C Hash Database Functions

Functions

void tsk_hdb_close (TSK_HDB_INFO *hdb_info)
 Close an open hash database. More...
 
uint8_t tsk_hdb_hasindex (TSK_HDB_INFO *hdb_info, uint8_t htype)
 Determine if the open hash database has an index. More...
 
int8_t tsk_hdb_lookup_raw (TSK_HDB_INFO *hdb_info, uint8_t *hash, uint8_t len, TSK_HDB_FLAG_ENUM flags, TSK_HDB_LOOKUP_FN action, void *ptr)
 Search the index for the given hash value given (in binary form). More...
 
int8_t tsk_hdb_lookup_str (TSK_HDB_INFO *hdb_info, const char *hash, TSK_HDB_FLAG_ENUM flags, TSK_HDB_LOOKUP_FN action, void *ptr)
 Search the index for a text/ASCII hash value. More...
 
uint8_t tsk_hdb_makeindex (TSK_HDB_INFO *a_hdb_info, TSK_TCHAR *a_type)
 Create an index for an open hash database. More...
 
TSK_HDB_INFOtsk_hdb_open (TSK_TCHAR *db_file, TSK_HDB_OPEN_ENUM flags)
 Open a hash database. More...
 

Detailed Description

Function Documentation

void tsk_hdb_close ( TSK_HDB_INFO hdb_info)
uint8_t tsk_hdb_hasindex ( TSK_HDB_INFO hdb_info,
uint8_t  htype 
)

Determine if the open hash database has an index.

Parameters
hdb_infoHash database to consider
htypeHash type that index should be of
Returns
1 if index exists and 0 if not

Referenced by TskHdbInfo::hasIndex(), and idxonly_name().

int8_t tsk_hdb_lookup_raw ( TSK_HDB_INFO hdb_info,
uint8_t *  hash,
uint8_t  len,
TSK_HDB_FLAG_ENUM  flags,
TSK_HDB_LOOKUP_FN  action,
void *  ptr 
)

Search the index for the given hash value given (in binary form).

Parameters
hdb_infoOpen hash database (with index)
hashArray with binary hash value to search for
lenNumber of bytes in binary hash value
flagsFlags to use in lookup
actionCallback function to call for each hash db entry (not called if QUICK flag is given)
ptrPointer to data to pass to each callback
Returns
-1 on error, 0 if hash value not found, and 1 if value was found.

References tsk_error_reset(), tsk_error_set_errno(), tsk_error_set_errstr(), TSK_HDB_HTYPE_SHA1_LEN, and tsk_hdb_lookup_str().

Referenced by TskHdbInfo::lookupRaw().

int8_t tsk_hdb_lookup_str ( TSK_HDB_INFO hdb_info,
const char *  hash,
TSK_HDB_FLAG_ENUM  flags,
TSK_HDB_LOOKUP_FN  action,
void *  ptr 
)

Search the index for a text/ASCII hash value.

Parameters
hdb_infoOpen hash database (with index)
hashHash value to search for (NULL terminated string)
flagsFlags to use in lookup
actionCallback function to call for each hash db entry (not called if QUICK flag is given)
ptrPointer to data to pass to each callback
Returns
-1 on error, 0 if hash value not found, and 1 if value was found.

References TSK_HDB_INFO::db_type, TSK_HDB_INFO::hash_len, TSK_HDB_INFO::hIdx, TSK_HDB_INFO::idx_lbuf, TSK_HDB_INFO::idx_llen, TSK_HDB_INFO::idx_off, TSK_HDB_INFO::idx_size, TSK_HDB_INFO::lock, tsk_error_reset(), tsk_error_set_errno(), tsk_error_set_errstr(), tsk_error_set_errstr2(), TSK_HDB_DBTYPE_IDXONLY_ID, TSK_HDB_FLAG_QUICK, TSK_HDB_HTYPE_MD5_ID, TSK_HDB_HTYPE_MD5_LEN, TSK_HDB_HTYPE_SHA1_ID, and TSK_HDB_HTYPE_SHA1_LEN.

Referenced by TskHdbInfo::lookupStr(), and tsk_hdb_lookup_raw().

uint8_t tsk_hdb_makeindex ( TSK_HDB_INFO a_hdb_info,
TSK_TCHAR a_type 
)

Create an index for an open hash database.

Parameters
a_hdb_infoOpen hash database to index
a_typeText of hash database type
Returns
1 on error

Referenced by TskHdbInfo::createIndex().

TSK_HDB_INFO* tsk_hdb_open ( TSK_TCHAR db_file,
TSK_HDB_OPEN_ENUM  flags 
)

Copyright © 2007-2013 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.