Exemplo n.º 1
0
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 );
}
Exemplo n.º 2
0
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 );
}
Exemplo n.º 3
0
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 );
}
Exemplo n.º 4
0
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 );
}