Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. ×
Apple

Journal Journal: PlayerPro registration code generator

/* ***************
The source for PlayerPro was released, but you still need a registration code to run the binary.  For those of you who are too lazy to do so yourselves, here's a C program that generated a working registration code for me, mostly ripped from Registration.c in the PlayerPro source.  (however, there are definitions for some lingering Carbon-isms)

I didn't feel like figuring out what the second parameter to the code generation routine is for, because "37", the first thing I tried, worked.

If you're really lazy, just try this code, which "worked for me":  CID4PQXPSQXTTYRR

* ***************/

#include <stdlib.h>
#include <stdio.h>

typedef char Str255[256];
typedef char Str32[33];
typedef char* Ptr;

void pStrcpy(char* dest, char* src) {
    strcpy(dest+1, src);
}

void NumToString(int num, char* dest) {
    sprintf(dest+1, "%d", num);
}

void GenerateCodeNewID( Str255 strID, long num)
{
    Str32    tStr;
    Str32    Div19;
    long    microVal, i, tt;

    pStrcpy( strID, "CID4TTTTTTTTTTTTTTTTTTTTT");

    strID[ 0] = 4 + 6 + 5;

    tt = num * 13;

    sprintf( (Ptr) Div19, "%6ld", tt);
    for( i = 0; i < 6; i++) if( Div19[ i] == ' ') Div19[ i] = '0';

    Div19[ 0] = (Div19[ 0] - 0x30) + 0x51;
    Div19[ 1] = (Div19[ 1] - 0x30) + 0x50;
    Div19[ 2] = (Div19[ 2] - 0x30) + 0x51;
    Div19[ 3] = (Div19[ 3] - 0x30) + 0x50;
    Div19[ 4] = (Div19[ 4] - 0x30) + 0x51;
    Div19[ 5] = (Div19[ 5] - 0x30) + 0x51;

    microVal = tt & 0x0000000F;

    tt = 0x38;
    tt *= 0x21;

    NumToString( tt, tStr);

    tStr[ 0] = (tStr[ 1] - 0x30) + 0x50 - microVal;
    tStr[ 1] = (tStr[ 2] - 0x30) + 0x51 - microVal;
    tStr[ 2] = (tStr[ 3] - 0x30) + 0x50 - microVal;
    tStr[ 3] = (tStr[ 4] - 0x30) + 0x51 - microVal;

    for( i = 0; i < 4; i++) strID[ 5 + i*2] = tStr[ i];
    for( i = 0; i < 6; i++) strID[ 6 + i*2] = Div19[ i];
        strID[ 6 + 9] = Div19[ 5];
}

int main(int c, char *v[]) {
    Str255 foo;

    GenerateCodeNewID(foo,37);

    foo[16] = 0;

    printf("%s\n", foo+1);
}

Slashdot Top Deals

Practical people would be more practical if they would take a little more time for dreaming. -- J. P. McEvoy

Working...