Truxton file create event
Revision as of 17:15, 9 June 2020 by Sam (talk | contribs) (Created page with "This creates an event from this file that you can use in the Event API. An event object is how you add records to the <code> Event</...")
This creates an event from this file that you can use in the Event API.
An event object is how you add records to the Event table.
The resulting event object will automatically be associated with the file it was created from and with the media the file belongs to.
Syntax
uint64_t truxton_file_create_event( uint64_t file_handle );
Parameters
file_handle
The handle created by the truxton_file_open_id or truxton_file_open_md5 call.
Return value
A handle to an event object.
Sample
1 void process_file(uint64_t truxton)
2 {
3 truxton_start_adding_files(truxton);
4
5 uint64_t child = truxton_child_file_create(truxton);
6
7 char id[40];
8
9 truxton_file_get_id(parent_file, id, sizeof(id));
10 truxton_child_file_set_parent_id(child, id);
11 truxton_child_file_set_type(child, Type_Directory);
12 truxton_child_file_set_name(child, "Custom Exploits Folder");
13
14 truxton_child_file_set_origin(child, ORIGIN_GENERATED);
15
16 if ( truxton_child_file_save(child) == 0 )
17 {
18 printf( "Failed to add child to Truxton\n" );
19 }
20
21 uint64_t event = truxton_child_file_create_event(child);
22
23 truxton_event_set_type(event, EVENT_TYPE_POSSIBLE_INFECTION);
24 truxton_event_set_start(event, truxton_file_get_created( parent_file ) );
25 truxton_event_set_end(event, truxton_file_get_modified( parent_file ) );
26 truxton_event_set_title(event, "Fancy Bear Panda Hurricane" );
27 truxton_event_set_description(event, "Russian Malware repurposed by Chinese military used in FBI investigation" );
28 truxton_event_save(event);
29 truxton_event_destroy(event);
30
31 truxton_child_file_destroy(child);
32 }