Skip to content

Commit

Permalink
Update patch
Browse files Browse the repository at this point in the history
  • Loading branch information
oscam-emu committed Mar 27, 2024
1 parent 87ff3e1 commit 3ae1a44
Showing 1 changed file with 64 additions and 2 deletions.
66 changes: 64 additions & 2 deletions oscam-emu.patch
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3ae1a44

Please sign in to comment.