From a1ab700764ba80e5a2c5c9cfbbee684f5bcf3e14 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Sat, 17 Jun 2017 16:23:30 -0500 Subject: [PATCH] Fix search for ADX encryption type-9 key --- src/meta/adx.c | 108 ++++++++++++++++++------------------------------- 1 file changed, 40 insertions(+), 68 deletions(-) diff --git a/src/meta/adx.c b/src/meta/adx.c index 60822540..1c509a9f 100644 --- a/src/meta/adx.c +++ b/src/meta/adx.c @@ -548,6 +548,8 @@ static int find_key(STREAMFILE *file, uint8_t type, uint16_t *xor_start, uint16_ { /* try to guess key */ #define MAX_FRAMES (INT_MAX/0x8000) + struct { uint16_t start, mult, add; } *keys = NULL; + int keycount = 0, keymask = 0; int scales_to_do; int key_id; @@ -582,82 +584,52 @@ static int find_key(STREAMFILE *file, uint8_t type, uint16_t *xor_start, uint16_ if (type == 8) { - /* guess each of the keys */ - for (key_id=0;key_id