lock 2 key please help !

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
netbus
Posts: 2
Joined: 2005-12-21 10:27

lock 2 key please help !

Post by netbus » 2005-12-23 12:48

i cant make a working lock2 key function in c++ ( vs 2005).
the examples from wiki dont work

made this
char *creaza( char * lock)
{
char *key=new char[100];

int len=strlen(lock);
int i;

for (i = 1; i < len; i++)
key = lock ^ lock[i-1];

key[0] = lock[0] ^ lock[len-1] ^ lock[len-2] ^ 5;

for (i = 0; i < len; i++)
key = ((key<<4) & 240) | ((key>>4) & 15);

key[len]=0;

return key;

}

what is wrong? can somebody give me the exact steps in creating a key? that website doesn't work on my comp

joakim_tosteberg
Forum Moderator
Posts: 587
Joined: 2003-05-07 02:38
Location: Sweden, Linkoping

Post by joakim_tosteberg » 2005-12-23 16:13

You are missing the last step in the key genertation where you replaces some characters with /%DCXXX%/.

PseudonympH
Forum Moderator
Posts: 366
Joined: 2004-03-06 02:46

Post by PseudonympH » 2005-12-23 18:57

That and you're using strlen() when you're writing C++....

std::string (or std::vector, since you're not really doing string operations) is your friend.

netbus
Posts: 2
Joined: 2005-12-21 10:27

Post by netbus » 2005-12-25 12:57

joakim_tosteberg hm.. that doesn't help me much... i need to know exactly... :( please can u halp me? :D


PseudonympH why std::string? what;s the difference?

Locked