-
-
Save nns779/b77be5df86203f8570fe5ad66e664628 to your computer and use it in GitHub Desktop.
[NOT TESTED] PX-Q3PE(ASIE5606X8)によるTSの暗号化を無力化してみるパッチ https://github.com/knight-rider/ptx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ptx_dvb/drivers/media/pci/ptx/pxq3pe.c b/ptx_dvb/drivers/media/pci/ptx/pxq3pe.c | |
index 57165c8..97d43bc 100644 | |
--- a/ptx_dvb/drivers/media/pci/ptx/pxq3pe.c | |
+++ b/ptx_dvb/drivers/media/pci/ptx/pxq3pe.c | |
@@ -21,14 +21,7 @@ MODULE_AUTHOR(PTX_AUTH); | |
MODULE_DESCRIPTION("PLEX PX-Q3PE Driver"); | |
MODULE_LICENSE("GPL"); | |
-static char *auth = PTX_AUTH; | |
-static int ni, | |
- nx, | |
- idx[8] = {}, | |
- xor[4] = {}; | |
-module_param(auth, charp, 0); | |
-module_param_array(idx, int, &ni, 0); | |
-module_param_array(xor, int, &nx, 0); | |
+static u8 crypto_seed[16] = {0x0B, 0x24, 0x71, 0xE3, 0xC6, 0x1A, 0xF7, 0xCD, 0xC4, 0xF4, 0xF8, 0xA6, 0xF0, 0xB2, 0x01, 0x00}; | |
static struct pci_device_id pxq3pe_id_table[] = { | |
{0x188B, 0x5220, 0x0B06, 0x0002, 0, 0, 0}, | |
@@ -370,10 +363,7 @@ int pxq3pe_thread(void *dat) | |
set_freezable(); | |
while (!kthread_should_stop()) { | |
u8 *rbuf = &p->sBuf[p->sBufStart]; | |
- int i = 0, | |
- j = 0, | |
- k, | |
- sz = p->sBufSize - p->sBufStart; | |
+ int sz = p->sBufSize - p->sBufStart; | |
try_to_freeze(); | |
if (!p->sBufByteCnt) { | |
@@ -382,13 +372,6 @@ int pxq3pe_thread(void *dat) | |
} | |
if (sz > p->sBufByteCnt) | |
sz = p->sBufByteCnt; | |
- while (j < sz / PTX_TS_SIZE) { | |
- j++; | |
- i += 4; | |
- while (i < j * PTX_TS_SIZE) | |
- for (k = 0; k < 8; k++, i++) | |
- rbuf[i] ^= xor[idx[k]]; | |
- } | |
dvb_dmx_swfilter(&adap->demux, rbuf, sz); | |
p->sBufStart = (p->sBufStart + sz) % p->sBufSize; | |
p->sBufByteCnt -= sz; | |
@@ -566,7 +549,7 @@ static int pxq3pe_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id | |
pxq3pe_w_gpio0(card, 0, 1); | |
pxq3pe_w_gpio0(card, 1, 1); | |
for (i = 0; i < 16; i++) | |
- if (!pxq3pe_w(card, PXQ3PE_I2C_ADR_GPIO, 0x10 + i, auth + i, 1, PXQ3PE_MOD_GPIO)) | |
+ if (!pxq3pe_w(card, PXQ3PE_I2C_ADR_GPIO, 0x10 + i, crypto_seed[i], 1, PXQ3PE_MOD_GPIO)) | |
break; | |
if (i < 16 || !pxq3pe_w(card, PXQ3PE_I2C_ADR_GPIO, 5, ®ctl, 1, PXQ3PE_MOD_GPIO)) | |
return ptx_abort(pdev, pxq3pe_remove, -EIO, "hw_init failed i=%d", i); | |
diff --git a/ptx_dvb/drivers/video/pxq3pe_dtv.c b/ptx_dvb/drivers/video/pxq3pe_dtv.c | |
index 86bc378..e59f988 100644 | |
--- a/ptx_dvb/drivers/video/pxq3pe_dtv.c | |
+++ b/ptx_dvb/drivers/video/pxq3pe_dtv.c | |
@@ -21,6 +21,8 @@ MODULE_AUTHOR(MOD_AUTH); | |
MODULE_DESCRIPTION("PLEX PX-Q3PE Driver"); | |
MODULE_LICENSE("GPL"); | |
+static u8 crypto_seed[16] = {0x0B, 0x24, 0x71, 0xE3, 0xC6, 0x1A, 0xF7, 0xCD, 0xC4, 0xF4, 0xF8, 0xA6, 0xF0, 0xB2, 0x01, 0x00}; | |
+ | |
static struct pci_device_id pxq3pe_id_table[] = { | |
{0x188B, 0x5220, 0x0B06, 0x0002, 0, 0, 0}, | |
{} | |
@@ -1554,7 +1556,7 @@ dev_dbg(&card->pdev->dev, "%s gfp 0x%llx", __func__, gfp); | |
pxq3pe_w_gpio0(card, 0, 1); | |
pxq3pe_w_gpio0(card, 1, 1); | |
for (i = 0; i < 16; i++) | |
- if (!pxq3pe_w(card, PXQ3PE_I2C_ADR_GPIO, 0x10 + i, MOD_AUTH + i, 1, PXQ3PE_MOD_GPIO)) | |
+ if (!pxq3pe_w(card, PXQ3PE_I2C_ADR_GPIO, 0x10 + i, crypto_seed[i], 1, PXQ3PE_MOD_GPIO)) | |
break; | |
v8 = 0xA0; | |
if (i < 16 || !pxq3pe_w(card, PXQ3PE_I2C_ADR_GPIO, 5, &v8, 1, PXQ3PE_MOD_GPIO)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment