I've a problem with my .c program. I'll explain it :
- I have 2 files (listePassword.txt and system_1.phl)
- First file contains 10 passwords (like 123456, 12345678, admin, etc)
- The second contains 10 hashs (f31041d6d9c2031086bfe561d8e4b63f or 77b6508f00223102d793837b9dd60358 for example)
I made a function to read lines on these files (1 word / hash by line). The code :
int main(int argc, char const *argv[]) {
FILE *f = fopen("listePasswords.txt","r");
FILE *S1 = fopen("system_1.phl", "r");
unsigned char passwords[10][32];
unsigned char system_1[10][32];
lireFichier(f, passwords);
lireFichier(S1, system_1);
And now the function :
void lireFichier(FILE *f, unsigned char (*resultats)[32]) {
int i = 0;
if(f){
while(fgets(resultats[i], sizeof(resultats[i]), f) != 0) {
printf("%s\n", resultats[i]);
i++;
fgetc(f);
}
}
}
The program doesn't read first char of each password except the first word, and I don't have all lines of the system_1.phl.
Can you help me a little ? :D (don't help with "{" or "}", I probably didn't paste them all).
Thanks guys ! (sorry, I'm French and not so good in English ahah).