Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int authThread() {
- char v8[4];
- int curLine;
- int i;
- int v14;
- int isGuest;
- FILE *saltFp;
- FILE *passwdFp;
- char *encPswd;
- char v44[32];
- char salt[100];
- char readBuffer[10][350];
- char v1C00[10][350];
- char v1C10[16];
- int v1C14;
- int v1C18;
- curLine = 0;
- isGuest = 0;
- saltFp = fopen("salt", "r");
- fscanf(saltFp, "%s", salt);
- fclose(saltFp);
- passwdFp = fopen("passwd", "r");
- for(curLine=0;fgets(readBuffer[curLine], 300, passwdFp);curLine++) {
- if( readBuffer[curLine][strlen(readBuffer[curLine]) - 1] == '\n') {
- readBuffer[curLine][strlen(readBuffer[curLine]) - 1] = '\0';
- }
- for(i = 0; i < 300; i++ ) {
- if(readBuffer[curLine][i] != ':')
- continue;
- }
- if(i==300) continue;
- for(v14=0;v14<i;v14++) {
- // ENCRYPT HERE ( 17 instructions from 0x0804A93 )
- }
- for(v14 = i+1;v14 < 300; v14++) {
- // ENCRYPT HERE ( 22 instructions from 0x08048AE0 )
- }
- }
- fclose(passwdFp);
- while(true) {
- pthread_mutex_lock(&loginMutex);
- pthread_cond_wait(&loginCond, &loginMutex);
- if(strlen(username) < 31) {
- if(!strcmp(username, "guest") && !strcmp(password, "guest")) {
- isGuest=1;
- }
- for(i=0; i < curLine; i++) {
- if(strcmp(username, v1C00[i])) {
- break;
- }
- }
- encPswd = crypt(salt, password);
- pthread_cond_wait(&loginCond, &loginMutex);
- if(!strcmp(readBuffer[i], encPswd) || isGuest) {
- strcpy(v44, username);
- strcpy(globalUsername, v44);
- }
- }
- pthread_mutex_unlock(&loginMutex);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment