[Git][videolan/libdvdcss][master] tools/csstest: improve debugging info
"Jean-Baptiste Kempf (@jbk)" <[email protected]> Sun, 05 Jun 2022 14:58:55 +0200
| Newsgroups | gmane.comp.video.videolan.libdvdcss.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============8796633621201020667==
Content-Type: multipart/alternative;
boundary="--==_mimepart_629ca88f5a5b0_6b094878898764d";
charset=UTF-8
Content-Transfer-Encoding: 7bit
----==_mimepart_629ca88f5a5b0_6b094878898764d
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdcss
Commits:
d0b6a291 by Francois Cartegnie at 2022-06-05T14:52:02+02:00
tools/csstest: improve debugging info
- - - - -
1 changed file:
- test/csstest.c
Changes:
=====================================
test/csstest.c
=====================================
@@ -12,6 +12,8 @@
#include <dvdcss/dvdcss.h>
+#define DVDCSS_DSI_PES 0x400
+
static int isscrambled( unsigned char * );
static void dumpsector ( unsigned char * );
@@ -67,7 +69,7 @@ int main( int i_argc, char *ppsz_argv[] )
}
/* Print the sector */
- printf( "requested sector: " );
+ printf( "requested sector:\t" );
dumpsector( p_buffer );
/* Check if sector was encrypted */
@@ -93,7 +95,7 @@ int main( int i_argc, char *ppsz_argv[] )
}
/* Print the decrypted sector */
- printf( "unscrambled sector: " );
+ printf( "unscrambled sector:\t" );
dumpsector( p_buffer );
}
else
@@ -113,14 +115,21 @@ static int isscrambled( unsigned char *p_buffer )
return p_buffer[ 0x14 ] & 0x30;
}
+static void dumpmem( unsigned char *p_buffer, int sz )
+{
+ for( ; sz ; sz--, p_buffer++ )
+ printf( "%.2x", *p_buffer );
+}
+
/* Print parts of a 2048 bytes buffer */
static void dumpsector( unsigned char *p_buffer )
{
- int i_amount = 4;
- for( ; i_amount ; i_amount--, p_buffer++ ) printf( "%.2x", *p_buffer );
+ /* print pack header and first PES bytes up to flags */
+ dumpmem( &p_buffer[0], 21 );
+ printf( "..." );
+ /* print DSI up to block number */
+ dumpmem( &p_buffer[DVDCSS_DSI_PES], 17 );
printf( "..." );
- i_amount = 22;
- p_buffer += 200;
- for( ; i_amount ; i_amount--, p_buffer++ ) printf( "%.2x", *p_buffer );
- printf( "...\n" );
+ dumpmem( &p_buffer[DVDCSS_BLOCK_SIZE - 8], 8 );
+ printf( "\n" );
}
View it on GitLab: https://code.videolan.org/videolan/libdvdcss/-/commit/d0b6a291c24eda3727ad5c7a14956fc1fc82446d
--
View it on GitLab: https://code.videolan.org/videolan/libdvdcss/-/commit/d0b6a291c24eda3727ad5c7a14956fc1fc82446d
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
----==_mimepart_629ca88f5a5b0_6b094878898764d--
--===============8796633621201020667==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGliZHZkY3Nz
LWRldmVsIG1haWxpbmcgbGlzdApsaWJkdmRjc3MtZGV2ZWxAdmlkZW9sYW4ub3JnCmh0dHBzOi8v
bWFpbG1hbi52aWRlb2xhbi5vcmcvbGlzdGluZm8vbGliZHZkY3NzLWRldmVsCg==
--===============8796633621201020667==--