Difference between revisions of "Truxton get machine id"

From truxwiki.com
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Retrieves the version of the Truxton application object.
+
Retrieves the identifier of the machine that Truxton is running on using a Windows generated value.
  
 
=Syntax=
 
=Syntax=
 
<source lang="C">
 
<source lang="C">
void truxton_get_machine_id( uint64_t trutxon_handle, char * destination_string, size_t max_size );
+
void truxton_get_machine_id( uint64_t truxton_handle, char * destination_string, size_t max_size );
 
</source>
 
</source>
  
Line 29: Line 29:
 
     uint64_t truxton = truxton_create();
 
     uint64_t truxton = truxton_create();
  
     truxton_get_machine_id(truxton, id, sizeof(id));
+
     truxton_get_machine_id( truxton, id, sizeof(id) );
  
     printf("%s\n", id);
+
     printf( "%s\n", id );
  
     truxton_destroy(truxton);
+
     truxton_destroy( truxton );
  
 
     truxton_stop();
 
     truxton_stop();
 
}
 
}
 
</source>
 
</source>

Latest revision as of 16:52, 20 May 2021

Retrieves the identifier of the machine that Truxton is running on using a Windows generated value.

Syntax

void truxton_get_machine_id( uint64_t truxton_handle, char * destination_string, size_t max_size );

Parameters

truxton_handle

The handle created by the truxton_create call.

destination_string

The string to be written to.

max_size

The maximum number of characters that can be written to destination_string

Remarks

This identifier is a GUID retrieved from the MachineGuid value of the HKLM\SOFTWARE\Microsoft\Cryptography key in the registry.

Sample

void main()
{
    char id[256];

    truxton_start();

    uint64_t truxton = truxton_create();

    truxton_get_machine_id( truxton, id, sizeof(id) );

    printf( "%s\n", id );

    truxton_destroy( truxton );

    truxton_stop();
}