Commit 914aede0 authored by cRTrn13's avatar cRTrn13

No commit message

No commit message
parent 6d9ee062
......@@ -6,34 +6,40 @@
#include "util/macro.h"
#include "util/logging.h"
#if HAVE_BDPLUS
#include "libbdplus/bdplus.h"
#endif
BLURAY *bd_open(const char* device_path, const char* keyfile_path)
{
BLURAY *bd = malloc(sizeof(BLURAY));
BLURAY *bd = NULL;
bd->aacs = NULL;
bd->h_libaacs = NULL;
bd->fp = NULL;
strncpy(bd->device_path, device_path, 100);
// open aacs decryptor if present
if ((bd->h_libaacs = dlopen("libaacs.so", RTLD_LAZY))) {
DEBUG(DBG_BLURAY, "Downloaded libaacs (0x%08x)\n", bd->h_libaacs);
if (device_path) {
strncpy(bd->device_path, device_path, 100);
bd = malloc(sizeof(BLURAY));
typedef AACS_KEYS* (*fptr)();
if (keyfile_path) {
if ((bd->h_libaacs = dlopen("libaacs.so", RTLD_LAZY))) {
DEBUG(DBG_BLURAY, "Downloaded libaacs (0x%08x)\n", bd->h_libaacs);
fptr fptr_s = dlsym(bd->h_libaacs, "aacs_open");
bd->aacs = fptr_s(device_path, keyfile_path);
typedef AACS_KEYS* (*fptr)();
fptr fptr_s = dlsym(bd->h_libaacs, "aacs_open");
bd->aacs = fptr_s(device_path, keyfile_path);
} else {
DEBUG(DBG_BLURAY, "libaacs not present\n");
}
} else {
DEBUG(DBG_BLURAY, "No keyfile provided. You will not be able to make use of crypto functionality (0x%08x)\n", bd);
}
DEBUG(DBG_BLURAY, "BLURAY initialized! (0x%08x)\n", bd);
} else {
DEBUG(DBG_BLURAY, "libaacs not present\n");
DEBUG(DBG_BLURAY, "No device path provided!\n");
}
DEBUG(DBG_BLURAY, "BLURAY initialized! (0x%08x)\n", bd);
return bd;
}
......
......@@ -7,6 +7,7 @@
#include "file/file.h"
#include "libaacs/aacs.h"
#include "libbdplus/bdplus.h"
typedef int (*fptr_int)();
......
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