Commit 493551fb authored by cRTrn13's avatar cRTrn13

No commit message

No commit message
parent 50618379
......@@ -3,20 +3,27 @@
#include "bluray.h"
#include "util/macro.h"
#include "util/logging.h"
BLURAY *bd_open(const char* device_path, const char* keyfile_path)
{
BLURAY *bd = malloc(sizeof(BLURAY));
// open aacs decryptor if present
bd->aacs = NULL;
bd->h_libaacs = NULL;
// open aacs decryptor if present
if ((bd->h_libaacs = dlopen("libaacs.so", RTLD_NOW))) {
DEBUG(DBG_BLURAY, "Downloaded libaacs (0x%08x)\n", bd->h_libaacs);
typedef AACS_KEYS* (*fptr)();
fptr fptr_s = dlsym(bd->h_libaacs, "aacs_open");
bd->aacs = fptr_s(device_path, keyfile_path);
}
DEBUG(DBG_BLURAY, "BLURAY initialized! (0x%08x)\n", bd);
return bd;
}
......@@ -29,9 +36,11 @@ void bd_close(BLURAY *bd)
fptr_s(bd->aacs);
}
X_FREE(bd);
dlclose(bd->h_libaacs);
DEBUG(DBG_BLURAY, "BLURAY closed! (0x%08x)\n", bd);
X_FREE(bd);
}
off_t bd_seek(BLURAY *bd, off_t pos)
......
......@@ -13,7 +13,8 @@ enum {
DBG_FILE = 4,
DBG_AACS = 8,
DBG_MKB = 16,
DBG_MMC = 32
DBG_MMC = 32,
DBG_BLURAY = 64
} debug_mask;
char *print_hex(uint8_t *str, int count);
......
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