Difference between revisions of "Truxton start adding files"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This tells the API that you are not an ETL process, you just want to add stuff to Truxton. =Syntax= <syntaxhighlight lang="C"> void truxton_start_adding_files( uint64_t trutx...")
 
Line 25: Line 25:
 
   FILETIME now;
 
   FILETIME now;
  
   GetSystemTimeAsFileTime(&now);
+
   GetSystemTimePreciseAsFileTime(&now);
  
 
   ULARGE_INTEGER ticks;
 
   ULARGE_INTEGER ticks;

Revision as of 03:50, 13 November 2020

This tells the API that you are not an ETL process, you just want to add stuff to Truxton.

Syntax

void truxton_start_adding_files( uint64_t trutxon_handle );

Parameters

truxton_handle

The handle created by the truxton_create call.

Sample

void add_folder(uint64_t truxton, uint64_t parent_file)
{
   truxton_start_adding_files(truxton);

   uint64_t child = truxton_child_file_new_child(parent_file);

   truxton_child_file_set_type(child, Type_Directory);
   truxton_child_file_set_name(child, "Custom Exploits Folder");

   FILETIME now;

   GetSystemTimePreciseAsFileTime(&now);

   ULARGE_INTEGER ticks;

   ticks.LowPart = now.dwLowDateTime;
   ticks.HighPart = now.dwHighDateTime;

   truxton_child_file_set_created(child, ticks.QuadPart);
   truxton_child_file_set_accessed(child, ticks.QuadPart);
   truxton_child_file_set_modified(child, ticks.QuadPart);

   truxton_child_file_set_origin(child, ORIGIN_GENERATED);

   if ( truxton_child_file_save(child) == 0 )
   {
      printf( "Failed to add child to Truxton\n" );
   }
}