Commit 64940440 authored by cRTrn13's avatar cRTrn13

No commit message

No commit message
parent b356a292
......@@ -53,7 +53,7 @@ BLURAY *bd_open(const char* device_path, const char* keyfile_path)
void bd_close(BLURAY *bd)
{
if (bd->h_libaacs) {
if (bd->h_libaacs && bd->aacs) {
fptr_p_void fptr = dlsym(bd->h_libaacs, "aacs_close");
fptr(bd->aacs);
......@@ -91,7 +91,7 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len)
int read_len;
if ((read_len = file_read(bd->fp, buf, len))) {
if (bd->h_libaacs) {
if (bd->h_libaacs && bd->aacs) {
if ((bd->libaacs_decrypt_unit = dlsym(bd->h_libaacs, "aacs_decrypt_unit"))) {
if (!bd->libaacs_decrypt_unit(bd->aacs, buf, len, bd->s_pos)) {
DEBUG(DBG_BLURAY, "Unable decrypt unit! (0x%08x)\n", bd);
......
......@@ -2,7 +2,7 @@
# Set this for all builds, or use $bin_CPPFLAGS for individual
AM_CPPFLAGS = -I$(top_builddir)/src
bin_PROGRAMS=bdplus_test bdsplice mpls_dump clpi_dump
bin_PROGRAMS=bdplus_test bdsplice mpls_dump clpi_dump libbluray_test
bdplus_test_SOURCE=bdplus_test.c
......@@ -26,3 +26,7 @@ clpi_dump_SOURCES = \
clpi_dump_LDADD = $(BDNAV_LIB)
libbluray_test_SOURCES = \
libbluray_test.c
libbluray_test_LDADD = $(top_builddir)/src/libbluray.la
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include "../bluray.h"
#define HEX_PRINT(X,Y) { int zz; for(zz = 0; zz < Y; zz++) fprintf(stderr, "%02X", X[zz]); fprintf(stderr, "\n"); }
int main(int argc, char *argv[])
{
if (argc == 4) {
BLURAY *bd = bd_open(argv[1], argv[2]);
bd_select_title(bd, atoi(argv[3]));
unsigned char *buf = malloc(6144);
memset(buf,0,6144);
bd_read(bd, buf, 2048);
bd_read(bd, buf, 2048);
bd_read(bd, buf, 2048);
bd_read(bd, buf, 6144);
bd_close(bd);
} else {
printf("\nUsage:\n %s <media_path> <keyfile_path> <title_number>\n\n", argv[0]);
}
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment