Difference between revisions of "Truxton enumeration set target"
Jump to navigation
Jump to search
(Created page with "This tells Truxton what to enumerate within the scope. =Syntax= <source lang="C"> void truxton_enumeration_set_target( uint64_t enumeration_handle, uint64_t target ); </sourc...") |
|||
| Line 8: | Line 8: | ||
=Parameters= | =Parameters= | ||
==<code>enumeration_handle</code>== | ==<code>enumeration_handle</code>== | ||
| − | The handle returned by calling <code>[[truxton_enumeration_create]]</code>. | + | The handle returned by calling <code>[[truxton_enumeration_create]]()</code>. |
==<code>target</code>== | ==<code>target</code>== | ||
Latest revision as of 12:00, 5 May 2023
This tells Truxton what to enumerate within the scope.
Syntax
void truxton_enumeration_set_target( uint64_t enumeration_handle, uint64_t target );
Parameters
enumeration_handle
The handle returned by calling truxton_enumeration_create().
target
What you want to get out of the enumeration.
Sample
void dump_media_in_investigation( uint64_t truxton_handle, uint64_t investigation_handle )
{
char media_name[ 256 ];
char investigation_id[ 65 ];
truxton_investigation_get_id( investigation_handle, investigation_id, sizeof( investigation_id ) );
uint64_t enumerator = truxton_enumeration_create( truxton );
// Now setup the enumeration to get the media in a particular investigation
truxton_enumeration_set_scope( enumerator, Type_Investigation );
truxton_enumeration_set_scope_id( enumerator, investigation_id );
truxton_enumeration_set_target( enumerator, Type_Media );
uint64_t media_handle = truxton_enumeration_get_next( enumerator );
while( media_handle != 0 )
{
truxton_media_get_name( media_handle, media_name, sizeof( media_name ) );
printf( "Media: %s\n", media_name );
media_handle = truxton_enumeration_get_next( enumerator );
}
truxton_enumeration_destroy( enumerator );
}
void main()
{
char investigation_name[256];
truxton_start();
uint64_t truxton = truxton_create();
uint64_t enumerator = truxton_enumeration_create( truxton );
truxton_enumeration_set_target( enumerator, Type_Investigation );
uint64_t investigation_handle = truxton_enumeration_get_next( enumerator );
while( investigation_handle != 0 )
{
truxton_investigation_get_name( investigation_handle, investigation_name, sizeof( investigation_name ) );
printf( "Investigation: %s\n", investigation_name );
dump_media_in_investigation( truxton, investigation_handle );
investigation_handle = truxton_enumeration_get_next( enumerator );
}
truxton_enumeration_destroy( enumerator );
truxton_destroy( truxton );
truxton_stop();
}