Jeremy Greiner
2005-01-26 16:46:09 UTC
I'm working on a tool to decrypt the vob files from the dvd, using
libdvdcss however I'm having very little luck, the output vob appears to
still be scrambled (has a lot of the green blockyness)
This is the code I'm using currently:
m_CSSHandle is a dvdcss_t and m_Files is a class I built to derive the
sector location of the different files.
I used a tool called vStrip to verify the sector locations of the files
for the movie I was using, TROY ..
Any pointers and hints would be greatly appreciated .. I don't get any
errors, and the function always returns true however it seems scrambled.
bool CDecrypt::CSSDecryptFile(CString input_file, CString output_file)
{
//grab the starting sector for the file
int start = m_Files->GetVideoFileLBA(input_file);
int end = m_Files->GetVideoFileLBA(input_file, true);
//one sector
byte buffer[2048];
FILE * output = fopen(output_file, "w");
if(output == NULL) return false;
DVDCssSeek(m_CSSHandle, 490, DVDCSS_SEEK_KEY);
//for(int i = start; i <= end; i++)
for(int i = 490; i <= 78931; i++)
{
//read 1 sector
if(DVDCssRead(m_CSSHandle, buffer, 1,
DVDCSS_NOFLAGS) != 1)
{
return false;
}
//check to see if the buffer is scrambled
if(scrambled(buffer))
{
if(DVDCssSeek(m_CSSHandle, i,
DVDCSS_SEEK_MPEG) == i)
{
if(DVDCssRead(m_CSSHandle, buffer, 1, DVDCSS_READ_DECRYPT) != 1)
{
return
false;
}
if(scrambled(buffer))
{
AfxMessageBox("Error did not decrypt dvd.", MB_OK);
return
false;
}
}
else
{
AfxMessageBox("Error did
not decrypt dvd.", MB_OK);
return false;
}
}
fwrite(buffer, sizeof(char), 2048, output);
}
fclose(output);
return true;
}
Thanks in Advance
-jeremy
PS if you have any questions feel free to contact me via the list or
directly.
This email is scanned by "MailScan Antivirus for Mail-Server".
libdvdcss however I'm having very little luck, the output vob appears to
still be scrambled (has a lot of the green blockyness)
This is the code I'm using currently:
m_CSSHandle is a dvdcss_t and m_Files is a class I built to derive the
sector location of the different files.
I used a tool called vStrip to verify the sector locations of the files
for the movie I was using, TROY ..
Any pointers and hints would be greatly appreciated .. I don't get any
errors, and the function always returns true however it seems scrambled.
bool CDecrypt::CSSDecryptFile(CString input_file, CString output_file)
{
//grab the starting sector for the file
int start = m_Files->GetVideoFileLBA(input_file);
int end = m_Files->GetVideoFileLBA(input_file, true);
//one sector
byte buffer[2048];
FILE * output = fopen(output_file, "w");
if(output == NULL) return false;
DVDCssSeek(m_CSSHandle, 490, DVDCSS_SEEK_KEY);
//for(int i = start; i <= end; i++)
for(int i = 490; i <= 78931; i++)
{
//read 1 sector
if(DVDCssRead(m_CSSHandle, buffer, 1,
DVDCSS_NOFLAGS) != 1)
{
return false;
}
//check to see if the buffer is scrambled
if(scrambled(buffer))
{
if(DVDCssSeek(m_CSSHandle, i,
DVDCSS_SEEK_MPEG) == i)
{
if(DVDCssRead(m_CSSHandle, buffer, 1, DVDCSS_READ_DECRYPT) != 1)
{
return
false;
}
if(scrambled(buffer))
{
AfxMessageBox("Error did not decrypt dvd.", MB_OK);
return
false;
}
}
else
{
AfxMessageBox("Error did
not decrypt dvd.", MB_OK);
return false;
}
}
fwrite(buffer, sizeof(char), 2048, output);
}
fclose(output);
return true;
}
Thanks in Advance
-jeremy
PS if you have any questions feel free to contact me via the list or
directly.
This email is scanned by "MailScan Antivirus for Mail-Server".