From 3ae1a44b05975b72e34a454724139e352d483867 Mon Sep 17 00:00:00 2001 From: oscam-emu Date: Wed, 27 Mar 2024 23:45:51 +0000 Subject: [PATCH] Update patch --- oscam-emu.patch | 66 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/oscam-emu.patch b/oscam-emu.patch index add0a5b5..84007298 100644 --- a/oscam-emu.patch +++ b/oscam-emu.patch @@ -4592,7 +4592,7 @@ Index: module-emulator-osemu.h +#ifdef WITH_EMU + +// Version info -+#define EMU_VERSION 800 ++#define EMU_VERSION 801 + +#define EMU_MAX_CHAR_KEYNAME 12 +#define EMU_KEY_FILENAME "SoftCam.Key" @@ -4685,7 +4685,7 @@ Index: module-emulator-powervu.c =================================================================== --- module-emulator-powervu.c (nonexistent) +++ module-emulator-powervu.c (working copy) -@@ -0,0 +1,2733 @@ +@@ -0,0 +1,2795 @@ +#define MODULE_LOG_PREFIX "emu" + +#include "globals.h" @@ -6992,6 +6992,31 @@ Index: module-emulator-powervu.c + } +} + ++static void create_data_unmask_emm_mode_04(uint8_t *emmBody, uint8_t *data) ++{ ++ int i; ++ uint8_t padding[] = ++ { ++ 0x56, 0xC7, 0x05, 0x66, 0xC7, 0x4E, 0xC1, 0xA0, ++ 0x9E, 0xD1, 0xFE, 0x92, 0xE8, 0xCD, 0x5F, 0xAF, ++ 0xCF, 0xE5, 0xE9, 0x9E, 0x7A, 0x38, 0xAC, 0x68 ++ }; ++ ++ memcpy(data + 0x28, padding, 0x18); ++ ++ for (i = 0; i < 5; i++) ++ { ++ data[0 + i * 8] = emmBody[0x06 + i * 0x1B]; ++ data[1 + i * 8] = emmBody[0x19 + i * 0x1B]; ++ data[2 + i * 8] = emmBody[0x16 + i * 0x1B]; ++ data[3 + i * 8] = emmBody[0x0A + i * 0x1B]; ++ data[4 + i * 8] = emmBody[0x13 + i * 0x1B]; ++ data[5 + i * 8] = emmBody[0x05 + i * 0x1B]; ++ data[6 + i * 8] = emmBody[0x14 + i * 0x1B]; ++ data[7 + i * 8] = emmBody[0x18 + i * 0x1B]; ++ } ++} ++ +static uint8_t get_mode_unmask_emm(uint8_t *extraData) +{ + uint16_t data = ((uint16_t)extraData[0] << 8) + extraData[1]; @@ -7130,6 +7155,43 @@ Index: module-emulator-powervu.c + emm[0x13 + 0x0C + i * 0x1B] ^= mask[0x0F]; + } + } ++ else if (modeUnmask == 0x04) ++ { ++ for (i = 0; i < 5; i++) ++ { ++ emm[0x13 + 0x05 + i * 0x1B] -= emm[0x13 + 0x04 + i * 0x1B]; ++ emm[0x13 + 0x06 + i * 0x1B] -= emm[0x13 + 0x0B + i * 0x1B]; ++ emm[0x13 + 0x0A + i * 0x1B] -= emm[0x13 + 0x17 + i * 0x1B]; ++ emm[0x13 + 0x13 + i * 0x1B] -= emm[0x13 + 0x1A + i * 0x1B]; ++ emm[0x13 + 0x14 + i * 0x1B] -= emm[0x13 + 0x0E + i * 0x1B]; ++ emm[0x13 + 0x16 + i * 0x1B] -= emm[0x13 + 0x15 + i * 0x1B]; ++ emm[0x13 + 0x18 + i * 0x1B] -= emm[0x13 + 0x08 + i * 0x1B]; ++ emm[0x13 + 0x19 + i * 0x1B] -= emm[0x13 + 0x12 + i * 0x1B]; ++ } ++ ++ create_data_unmask_emm_mode_04(emm + 0x13, data); ++ create_hash_mode_04(data, mask); ++ ++ for (i = 0; i < 5; i++) ++ { ++ emm[0x13 + 0x0B + i * 0x1B] ^= mask[0x00]; ++ emm[0x13 + 0x12 + i * 0x1B] ^= mask[0x01]; ++ emm[0x13 + 0x15 + i * 0x1B] ^= mask[0x02]; ++ emm[0x13 + 0x17 + i * 0x1B] ^= mask[0x03]; ++ emm[0x13 + 0x1A + i * 0x1B] ^= mask[0x04]; ++ emm[0x13 + 0x04 + i * 0x1B] ^= mask[0x05]; ++ emm[0x13 + 0x0E + i * 0x1B] ^= mask[0x06]; ++ emm[0x13 + 0x08 + i * 0x1B] ^= mask[0x07]; ++ emm[0x13 + 0x09 + i * 0x1B] ^= mask[0x08]; ++ emm[0x13 + 0x0C + i * 0x1B] ^= mask[0x09]; ++ emm[0x13 + 0x03 + i * 0x1B] ^= mask[0x0A]; ++ emm[0x13 + 0x0F + i * 0x1B] ^= mask[0x0B]; ++ emm[0x13 + 0x10 + i * 0x1B] ^= mask[0x0C]; ++ emm[0x13 + 0x07 + i * 0x1B] ^= mask[0x0D]; ++ emm[0x13 + 0x0D + i * 0x1B] ^= mask[0x0E]; ++ emm[0x13 + 0x11 + i * 0x1B] ^= mask[0x0F]; ++ } ++ } + else + { + cs_log("A new unknown emm mode [%d] is in use.", modeUnmask);