25#define WIN32_NO_STATUS
80 char passwd[] = {
's',
'e',
'c',
'r',
'e',
't', 0, 0, 0, 0, 0, 0, 0, 0 };
82 { 0x85, 0xf5, 0x28, 0x9f, 0x09, 0xdc, 0xa7, 0xeb,
83 0xaa, 0xd3, 0xb4, 0x35, 0xb5, 0x14, 0x04, 0xee };
85 pSystemFunction006( passwd,
lmhash );
88 "lmhash: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
97 unsigned char hash[0x40] = {
98 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0x12,
99 0xc2, 0x26, 0x5b, 0x23, 0x73, 0x4e, 0x0d, 0xac };
100 unsigned char challenge[0x40] = {
101 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
103 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97,
104 0x82, 0xa6, 0x67, 0xaf, 0x6d, 0x42, 0x7c, 0x6d,
105 0xe6, 0x7c, 0x20, 0xc2, 0xd3, 0xe7, 0x7c, 0x56 };
106 unsigned char output[0x18];
109 r = pSystemFunction008(0,0,0);
112 r = pSystemFunction008(challenge,0,0);
115 r = pSystemFunction008(challenge,
hash, 0);
121 r = pSystemFunction008(challenge, 0, output);
125 r = pSystemFunction008(0, 0, output);
128 memset(output, 0,
sizeof output);
129 r = pSystemFunction008(challenge,
hash, output);
137 unsigned char key[8] = { 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0 };
138 unsigned char data[8] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
139 unsigned char expected[8] = { 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97 };
140 unsigned char output[16];
143 r = pSystemFunction001(0,0,0);
146 memset(output, 0,
sizeof output);
148 r = pSystemFunction001(
data,
key,output);
157 unsigned char key[8] = { 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0 };
158 unsigned char expected[8] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
159 unsigned char data[8] = { 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97 };
160 unsigned char output[8];
163 memset(output, 0,
sizeof output);
164 r = pSystemFunction002(
data,
key, output);
172 unsigned char szKey[] = {
'f',
'o',
'o',0 };
173 unsigned char szData[8] = {
'b',
'a',
'r',0 };
174 unsigned char expected[] = {0x28, 0xb9, 0xf8, 0xe1};
180 key.Length =
sizeof szKey;
181 key.MaximumLength =
key.Length;
183 data.Buffer = szData;
185 data.MaximumLength = 8;
187 r = pSystemFunction032(&
data, &
key);
195 unsigned char output[8],
data[8];
196 unsigned char key[7] = { 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24 };
197 unsigned char exp1[8] = { 0x9d, 0x21, 0xc8, 0x86, 0x6c, 0x21, 0xcf, 0x43 };
198 char exp2[] =
"KGS!@#$%";
212 memset(output, 0,
sizeof output);
213 r = pSystemFunction002(
data,
key, output);
216 ok( !
memcmp(
exp2, output,
sizeof output),
"decrypted message wrong\n");
221 unsigned char inbuf[0x100], keybuf[0x100], resbuf[0x100];
222 unsigned char output[8];
232 memset(keybuf, 0,
sizeof keybuf);
233 memset(resbuf, 0,
sizeof resbuf);
236 in.Length =
in.MaximumLength = 0;
239 key.Length =
key.MaximumLength = 0;
242 out.Length =
out.MaximumLength = 0;
249 key.MaximumLength = 0x100;
256 in.MaximumLength = 0;
274 key.MaximumLength = 0;
280 out.MaximumLength = 0x40;
286 memset(output, 0,
sizeof output);
287 r = pSystemFunction002(
out.Buffer,
key.Buffer, output);
290 ok(((
unsigned int*)output)[0] ==
in.Length,
"crypted length wrong\n");
291 ok(((
unsigned int*)output)[1] == 1,
"crypted value wrong\n");
293 memset(output, 0,
sizeof output);
294 r = pSystemFunction002(
out.Buffer+8,
key.Buffer, output);
296 ok(!
memcmp(output,
inbuf,
sizeof output),
"crypted data wrong\n");
298 memset(output, 0,
sizeof output);
299 r = pSystemFunction002(
out.Buffer+16,
key.Buffer, output);
301 ok(!
memcmp(output,
inbuf,
sizeof output),
"crypted data wrong\n");
306 char output[0x40],
result[0x40];
309 static char datastr[] =
"twinkle twinkle little star";
310 static char keystr[] =
"byolnim";
312 in.Buffer = (
unsigned char *)datastr;
314 in.MaximumLength = 0;
316 key.Buffer = (
unsigned char *)keystr;
318 key.MaximumLength = 0;
320 out.Buffer = (
unsigned char *)output;
321 out.Length =
out.MaximumLength =
sizeof output;
337 ok(
res.Length ==
in.Length,
"Length wrong\n");
341 out.MaximumLength = 0;
345 "Expected STATUS_SUCCESS or STATUS_INVALID_PARAMETER_1, got %08x\n",
r);
347 ok(
res.Length ==
in.Length,
"Length wrong\n");
350 res.MaximumLength = 0;
354 "Expected STATUS_BUFFER_TOO_SMALL or STATUS_INVALID_PARAMETER_1, got %08x\n",
r);
360 "Expected STATUS_UNKNOWN_REVISION or STATUS_INVALID_PARAMETER_1, got %08x\n",
r);
369 unsigned char hash[0x10] = {
370 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0x12,
371 0xc2, 0x26, 0x5b, 0x23, 0x73, 0x4e, 0x0d, 0xac };
372 unsigned char challenge[8] = {
373 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
375 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97,
376 0x82, 0xa6, 0x67, 0xaf, 0x6d, 0x42, 0x7c, 0x6d,
377 0xe6, 0x7c, 0x20, 0xc2, 0xd3, 0xe7, 0x7c, 0x56 };
378 unsigned char output[0x18];
381 memset(output, 0,
sizeof output);
382 r = pSystemFunction009(challenge,
hash, output);
388 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24,
389 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24,
392 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
393 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0
396 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97,
397 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97, 0
403 unsigned char output[0x11];
408 win_skip(
"SystemFunction%03d is not available\n",
num);
415 memset(output, 0,
sizeof output);
424 unsigned char output[0x11];
429 win_skip(
"SystemFunction%03d is not available\n",
num);
436 memset(output, 0,
sizeof output);
444 0x69, 0x51, 0x35, 0x69, 0x0d, 0x29, 0x24, 0xad,
445 0x23, 0x6d, 0xfd, 0x43, 0x0d, 0xd3, 0x25, 0x81, 0
450 unsigned char key[4], output[0x11];
455 win_skip(
"SystemFunction%03d is not available\n",
num);
459 memset(output, 0,
sizeof output);
472 unsigned char key[4], output[0x11];
477 win_skip(
"SystemFunction%03d is not available\n",
num);
481 memset(output, 0,
sizeof output);
494 unsigned char arg1[0x20],
arg2[0x20];
499 win_skip(
"function is not available\n");
508 ok(
r == 1,
"wrong error code\n");
515 ok(
r == 1,
"wrong error code\n");
521 ok(
r == 0,
"wrong error code\n");
527 ok(
r == 0,
"wrong error code\n");
535 if (pSystemFunction001)
538 win_skip(
"SystemFunction001 is not available\n");
541 if (pSystemFunction002)
544 win_skip(
"SystemFunction002 is not available\n");
547 if (pSystemFunction003)
550 win_skip(
"SystemFunction002 is not available\n");
553 if (pSystemFunction004)
556 win_skip(
"SystemFunction004 is not available\n");
559 if (pSystemFunction005)
562 win_skip(
"SystemFunction005 is not available\n");
565 if (pSystemFunction006)
568 win_skip(
"SystemFunction006 is not available\n");
571 if (pSystemFunction008)
574 win_skip(
"SystemFunction008 is not available\n");
577 if (pSystemFunction009)
580 win_skip(
"SystemFunction009 is not available\n");
631 if (pSystemFunction032)
634 win_skip(
"SystemFunction032 is not available\n");
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
#define GetProcAddress(x, y)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLuint GLuint GLuint GLuint arg1
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
double __cdecl exp2(double)
#define memcpy(s1, s2, n)
static descrypt pSystemFunction027
static void test_SystemFunction008(void)
static descrypt pSystemFunction015
static void test_SystemFunction003(void)
static void test_memcmpfunc(memcmpfunc fn)
static void test_SystemFunction009(void)
static descrypt pSystemFunction013
static void test_SystemFunction_encrypt(descrypt func, int num)
static descrypt pSystemFunction019
static unsigned char des_plaintext[]
static descrypt pSystemFunction023
static void test_SystemFunction006(void)
static const struct ustring struct ustring *static const struct ustring struct ustring *static PSTR lmhash
static unsigned char des_ciphertext[]
int(WINAPI * descrypt)(unsigned char *, unsigned char *, unsigned char *)
static descrypt pSystemFunction021
static memcmpfunc pSystemFunction031
static void test_SystemFunction032(void)
static void test_SystemFunction004(void)
static descrypt pSystemFunction025
static descrypt pSystemFunction022
static void test_SystemFunction001(void)
static const struct ustring *static descrypt pSystemFunction012
static void test_SystemFunction_dec32(descrypt func, int num)
static memcmpfunc pSystemFunction030
static void test_SystemFunction002(void)
static descrypt pSystemFunction016
static void test_SystemFunction_enc32(descrypt func, int num)
static descrypt pSystemFunction014
int(WINAPI * memcmpfunc)(unsigned char *, unsigned char *)
static descrypt pSystemFunction026
static void test_SystemFunction_decrypt(descrypt func, int num)
static descrypt pSystemFunction024
static descrypt pSystemFunction018
static unsigned char des_ciphertext32[]
static void test_SystemFunction005(void)
static descrypt pSystemFunction017
static descrypt pSystemFunction020
#define STATUS_UNKNOWN_REVISION
#define STATUS_INVALID_PARAMETER_2
#define STATUS_INVALID_PARAMETER_1
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_UNSUCCESSFUL
static GLenum _GLUfuncptr fn