hey, me again (lol), this time it's arrays...my friend sent me some C source that he said i could use in my project.but after about an hour or so of messing with it i havn't been able to get anywhere...I don't know how to use arrays very well and this is way over my head, unfortunatley he doesn't know VB and can't help me with this...this part of the program right here is very important, and if i can't get it to work then everything else is useless....could someone PLEASE help me with this?
// -------------------------------------------------------------------
// Input: szName: null terminated string to be encrypted
//
// Output: will output to the specified buffer szRslt. The buffer
// must be twice as large as the largest possible input string.
//
void NapsterEncrypt(Char * szName, Char * szRslt)
{
unsigned int n;
static unsigned char chKeys[10] = {0x35, 0x0d, 0x54, 0x21, 0x5a, 0x20, 0x53, 0x08, 0x03, 0x04};
for (n=0; n < strlen(szName); n++)
sprintf(&szRslt[2*n], "%02x", szName[n] ^ chKeys[n%10]); // encrypt
szRslt[2*n] = '\0'; // terminate
return;
}
// -------------------------------------------------------------------
// Input: szName: null terminated string to be encrypted
//
// Output: will output to the specified buffer szRslt. The buffer
// must be twice as large as the largest possible input string.
//
void NapsterEncrypt(Char * szName, Char * szRslt)
{
unsigned int n;
static unsigned char chKeys[10] = {0x35, 0x0d, 0x54, 0x21, 0x5a, 0x20, 0x53, 0x08, 0x03, 0x04};
for (n=0; n < strlen(szName); n++)
sprintf(&szRslt[2*n], "%02x", szName[n] ^ chKeys[n%10]); // encrypt
szRslt[2*n] = '\0'; // terminate
return;
}