Truxton identify bytes

From truxwiki.com
Revision as of 07:13, 12 January 2023 by Sam (talk | contribs) (Created page with "Given file contents, this function will determine the type the file. =Syntax= <source lang="C"> uint32_t truxton_identify_bytes(uint8_t const* buffer...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Given file contents, this function will determine the type the file.

Syntax

uint32_t truxton_identify_bytes(uint8_t const* buffer, uint64_t buffer_size);

Return value

The type of the file in buffer.

Sample

void main()
{
   uint8_t * file_buffer = nullptr;
   uint64_t file_size = 0;

   uint32_t file_type = Type_64bit_Windows_Executable;

   get_file_contents( "KERNEL32.DLL", &file_buffer, &file_size );

   uint32_t file_type = truxton_identify_bytes( file_buffer, file_size );

   printf( "%u\n", file_type );

   free( file_buffer );
}