Fix endianess issue, noticed by drahn@. Tested by several people, thanks!

ok pval
This commit is contained in:
hshoexer 2005-08-29 20:28:17 +00:00
parent f142cc568d
commit bbef4bfca6
3 changed files with 87 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.4 2005/04/17 18:53:00 hshoexer Exp $
# $OpenBSD: Makefile,v 1.5 2005/08/29 20:28:17 hshoexer Exp $
COMMENT= "descramble scrambled DVDs using ACSS"
VER= 0.3
PKGNAME= ${DISTNAME}p0
DISTNAME= libdvd-${VER}
CATEGORIES= converters
MASTER_SITES= http://www.rommelwood.de/~hshoexer/${VER}/ \

View File

@ -0,0 +1,26 @@
$OpenBSD: patch-src_acss_c,v 1.1 2005/08/29 20:28:17 hshoexer Exp $
--- src/acss.c.orig Sun Apr 17 20:48:13 2005
+++ src/acss.c Wed Aug 24 23:39:20 2005
@@ -674,12 +674,9 @@ static void genseed(libdvd_t libdvd, uin
unsigned char digest[20];
RMD160_CTX ctx;
- if (sizeof(salts) < (unsigned int)((offset & 0x3f) * 2 + 1))
- return;
-
RMD160Init(&ctx);
RMD160Update(&ctx, libdvd->psz_challenge, strlen(libdvd->psz_challenge));
- RMD160Update(&ctx, (unsigned char*)&salts[offset * 2], sizeof(u_int32_t));
+ RMD160Update(&ctx, &salts[offset * 8], sizeof(u_int8_t) * 4);
RMD160Final(digest, &ctx);
for (i = 0; i < 3; i++)
@@ -687,7 +684,7 @@ static void genseed(libdvd_t libdvd, uin
RMD160Init(&ctx);
RMD160Update(&ctx, libdvd->psz_challenge, strlen(libdvd->psz_challenge));
- RMD160Update(&ctx, (unsigned char*)&salts[offset * 2 + 1], sizeof(u_int32_t));
+ RMD160Update(&ctx, &salts[offset * 8 + 4], sizeof(u_int8_t) * 4);
RMD160Final(digest, &ctx);
for (i = 0; i < 2; i++)

View File

@ -0,0 +1,59 @@
$OpenBSD: patch-src_scrambletables_h,v 1.1 2005/08/29 20:28:17 hshoexer Exp $
--- src/scrambletables.h.orig Sun Apr 17 20:48:13 2005
+++ src/scrambletables.h Wed Aug 24 23:37:02 2005
@@ -390,22 +390,38 @@ static uint8_t p_crypt_tab3[ 288 ] =
0xC3, 0x82, 0xC9, 0x15, 0x57, 0x16, 0x5D, 0x81
};
-static u_int32_t salts[64] =
+static unsigned char salts[256] =
{
- 0x00854b44, 0x0080c3a6, 0x00668282, 0x00779e09,
- 0x00590b94, 0x004f3aa1, 0x002c3060, 0x00b0f631,
- 0x00d6b8d7, 0x011a00ab, 0x0092b553, 0x000ab9fc,
- 0x0253f8a5, 0x000ac8e4, 0x00a9a691, 0x009123cf,
- 0x00760d3d, 0x00234235, 0x0143f3e8, 0x0029e3ac,
- 0x006e11b0, 0x002c0467, 0x00847fb5, 0x00f751ef,
- 0x000ab444, 0x00fdfff1, 0x00216cb2, 0x00351b6a,
- 0x047fc6e2, 0x0058783b, 0x009234f2, 0x0009f1a0,
- 0x00793605, 0x00450218, 0x067348b1, 0x03b17e0b,
- 0x000010c9, 0x0471d499, 0x004cd4d4, 0x00dc2509,
- 0x001345e1, 0x000b5fe1, 0x007c8403, 0x0040d707,
- 0x003f3cd5, 0x00b49c76, 0x0377eee4, 0x007ca9a2,
- 0x00226783, 0x012b3645, 0x02cd6782, 0x0356dcfa,
- 0x0037cd10, 0x0041aeaf, 0x00a9c80a, 0x034beb8f,
- 0x011843ba, 0x0004d67c, 0x00ea4496, 0x000fe750,
- 0x00260dae, 0x005b2adc, 0x02584ff0, 0x0026576e
+ 0x44, 0x4b, 0x85, 0x00, 0xa6, 0xc3, 0x80, 0x00,
+ 0x82, 0x82, 0x66, 0x00, 0x09, 0x9e, 0x77, 0x00,
+ 0x94, 0x0b, 0x59, 0x00, 0xa1, 0x3a, 0x4f, 0x00,
+ 0x60, 0x30, 0x2c, 0x00, 0x31, 0xf6, 0xb0, 0x00,
+ 0xd7, 0xb8, 0xd6, 0x00, 0xab, 0x00, 0x1a, 0x01,
+ 0x53, 0xb5, 0x92, 0x00, 0xfc, 0xb9, 0x0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