Difference between revisions of "Truxton child file create exif"
Jump to navigation
Jump to search
(→Sample) |
|||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
This creates an EXIF object sourced from this file that you can use in the [[Truxton C API#EXIF (Camera Information) | EXIF API.]] | This creates an EXIF object sourced from this file that you can use in the [[Truxton C API#EXIF (Camera Information) | EXIF API.]] | ||
| − | An EXIF object is how you add records to the <code>[[EXIF Table | EXIF]]</code> table. | + | An EXIF object is how you add records to the <code><nowiki>[</nowiki>[[EXIF Table|EXIF]]<nowiki>]</nowiki></code> table. |
| − | The resulting | + | The resulting EXIF object will automatically be associated with the file it was created from and with the media the file belongs to. |
| + | '''Note:''' Not all camera information comes from [https://en.wikipedia.org/wiki/Exif EXIF] sections. | ||
| + | Camera information can be exploited from anywhere in the file but the meta data will be stored in the <code><nowiki>[</nowiki>[[EXIF Table|EXIF]]<nowiki>]</nowiki></code> table. | ||
| − | |||
| − | |||
=Syntax= | =Syntax= | ||
| − | < | + | <source lang="C"> |
uint64_t truxton_child_file_create_exif( uint64_t child_handle ); | uint64_t truxton_child_file_create_exif( uint64_t child_handle ); | ||
| − | </ | + | </source> |
=Parameters= | =Parameters= | ||
==<code>child_handle</code>== | ==<code>child_handle</code>== | ||
| − | |||
The handle created by the [[truxton_child_file_create]] or [[truxton_file_create_child]] call. | The handle created by the [[truxton_child_file_create]] or [[truxton_file_create_child]] call. | ||
| Line 20: | Line 19: | ||
=Sample= | =Sample= | ||
| − | + | <source lang="C" highlight="21"> | |
| − | < | + | void add_folder( uint64_t truxton, uint64_t parent_file ) |
| − | void add_folder(uint64_t truxton, uint64_t parent_file) | ||
{ | { | ||
| − | truxton_start_adding_files(truxton); | + | truxton_start_adding_files( truxton ); |
| − | uint64_t child = truxton_child_file_create(truxton); | + | uint64_t child = truxton_child_file_create( truxton ); |
char id[40]; | char id[40]; | ||
| − | truxton_file_get_id(parent_file, id, sizeof(id)); | + | truxton_file_get_id( parent_file, id, sizeof(id) ); |
| − | truxton_child_file_set_parent_id(child, id); | + | truxton_child_file_set_parent_id( child, id ); |
| − | truxton_child_file_set_type(child, Type_Directory); | + | truxton_child_file_set_type( child, Type_Directory ); |
| − | truxton_child_file_set_name(child, "Custom Exploits Folder"); | + | truxton_child_file_set_name( child, "Custom Exploits Folder" ); |
| − | truxton_child_file_set_origin(child, ORIGIN_GENERATED); | + | truxton_child_file_set_origin( child, ORIGIN_GENERATED ); |
| − | if ( truxton_child_file_save(child) == 0 ) | + | if ( truxton_child_file_save( child ) == 0 ) |
{ | { | ||
printf( "Failed to add child to Truxton\n" ); | printf( "Failed to add child to Truxton\n" ); | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
} | } | ||
| − | uint64_t exif = truxton_child_file_create_exif(child); | + | uint64_t exif = truxton_child_file_create_exif( child ); |
| − | truxton_exif_set_make(exif, "Ford"); | + | truxton_exif_set_make( exif, "Ford" ); |
| − | truxton_exif_set_model(exif, "Mustang"); | + | truxton_exif_set_model( exif, "Mustang" ); |
| − | truxton_exif_set_device_time(exif, truxton_file_get_modified( parent_file ) ); | + | truxton_exif_set_device_time( exif, truxton_file_get_modified( parent_file ) ); |
| − | truxton_exif_set_latitude(exif, 27.94999); | + | truxton_exif_set_latitude( exif, 27.94999 ); |
| − | truxton_exif_set_longitude(exif, -82.354748); | + | truxton_exif_set_longitude( exif, -82.354748 ); |
| − | truxton_exif_save(exif); | + | truxton_exif_save( exif ); |
| − | truxton_exif_destroy(exif); | + | truxton_exif_destroy( exif ); |
| − | truxton_child_file_destroy(child); | + | truxton_child_file_destroy( child ); |
} | } | ||
| − | </ | + | </source> |
Latest revision as of 04:21, 13 February 2021
This creates an EXIF object sourced from this file that you can use in the EXIF API.
An EXIF object is how you add records to the [EXIF] table.
The resulting EXIF object will automatically be associated with the file it was created from and with the media the file belongs to.
Note: Not all camera information comes from EXIF sections.
Camera information can be exploited from anywhere in the file but the meta data will be stored in the [EXIF] table.
Syntax
uint64_t truxton_child_file_create_exif( uint64_t child_handle );
Parameters
child_handle
The handle created by the truxton_child_file_create or truxton_file_create_child call.
Return value
A handle to an EXIF object.
Sample
void add_folder( uint64_t truxton, uint64_t parent_file )
{
truxton_start_adding_files( truxton );
uint64_t child = truxton_child_file_create( truxton );
char id[40];
truxton_file_get_id( parent_file, id, sizeof(id) );
truxton_child_file_set_parent_id( child, id );
truxton_child_file_set_type( child, Type_Directory );
truxton_child_file_set_name( child, "Custom Exploits Folder" );
truxton_child_file_set_origin( child, ORIGIN_GENERATED );
if ( truxton_child_file_save( child ) == 0 )
{
printf( "Failed to add child to Truxton\n" );
}
uint64_t exif = truxton_child_file_create_exif( child );
truxton_exif_set_make( exif, "Ford" );
truxton_exif_set_model( exif, "Mustang" );
truxton_exif_set_device_time( exif, truxton_file_get_modified( parent_file ) );
truxton_exif_set_latitude( exif, 27.94999 );
truxton_exif_set_longitude( exif, -82.354748 );
truxton_exif_save( exif );
truxton_exif_destroy( exif );
truxton_child_file_destroy( child );
}