Truxton media get size

From truxwiki.com
Jump to navigation Jump to search

This retrieves the number of bytes in the original media. This corresponds to the [Size] column of the [Media] table. The number of bytes in the media is the best guess of the number of bytes that will be processed during exploitation. If the media being loaded is an E01 disk image, the uncompressed size is recorded.

Syntax

uint64_t truxton_media_get_size( uint64_t media_handle );

Parameters

media_handle

The handle created by the truxton_media_open_id or truxton_media_create call.

Return value

The number of bytes in the media.

Sample

void is_tiny( uint64_t media )
{
   uint64_t size = truxton_media_get_size( media );

   if ( size < (100 * 1024 * 1024) )
   {
      printf( "This tiny media is smaller than 100MB\n" );
   }
   else
   {
      printf( "The media is not tiny\n" );
   }
}