void pfxHexDumpPreview( const char* pfx, FILE* into, const uint8* data, uint32 length ) { char buffer[80]; if( length > HEX_DUMP_PREVIEW_LIMIT ) { pfxHexDump( pfx, into, data, HEX_DUMP_PREVIEW_LIMIT - 32 ); fprintf( into, "%s ... truncated ...\n", pfx ); build_hex_line( data, length, length - 16, buffer, 4 ); fprintf( into, "%s%s\n", pfx, buffer ); } else pfxHexDump( pfx, into, data, length ); }
void pfxHexDumpPreview( const char* pfx, LogType type, const uint8* data, uint32 length ) { char buffer[80]; if( length > HEX_DUMP_PREVIEW_LIMIT ) { pfxHexDump( pfx, type, data, HEX_DUMP_PREVIEW_LIMIT - 32 ); _log( type, "%s ... truncated ...", pfx ); build_hex_line( data, length, length - 16, buffer, 4 ); _log( type, "%s%s", pfx, buffer ); } else pfxHexDump( pfx, type, data, length ); }
void PyFileDumpVisitor::_dump( const char* pfx, const uint8* data, size_t len ) { if( fullHex() ) pfxHexDump( pfx, file(), data, len ); else pfxHexDumpPreview( pfx, file(), data, len ); }
void PyLogDumpVisitor::_dump( const char* pfx, const uint8* data, size_t len ) { if( !is_log_enabled( logHexType() ) ) return; if( fullHex() ) pfxHexDump( pfx, logHexType(), data, len ); else pfxHexDumpPreview( pfx, logHexType(), data, len ); }