|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hello,
I have developed a client server application using C. i have a list of usernames and a list of passwords in a text file. i need to be able to do 2 loops so i can send the usernames and the passwords to the server and get a response back. basically its a ftp force attack to find the correct username and password. i have written most of the code but i'm kind of strugling to finish it off and sort out the errors. this is a task we have to do for university. i have tried different books and websites and still can't sort out the errors. i really need your help. Any advice would be most helpfull this is the client part: # C Code:
this is the handeltcpclient.c C Code:
Last edited by Jaan; 03-01-2008 at 06:39 AM. Reason: Please use tags when you're posting your codes! |
| Sponsored Links |
|
|
|
|||||
|
This type of code tends to be platform specific. What you may want to do is isolate your testing to major components. Is the connection made? Is the username received? Is the password received?
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||
|
i did get a connection before i added the loop in my handeltcpclient.c
there seems to be a problem with my stringcompare(strcmp and strncpy) can't sort out the errors tho. im using bluefish editor in linux to compile the program. have u got any ideas how to get rid of the errors? i would really appreciate it if you could help me to sort it out as this task is worth 50% of the module and i've never done c programming before |
|
|||||
|
If you send us the errors you're getting we may be able to help
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||
|
these are the errors i get
[student@localhost tcp]$ gcc client.c diewitherror.c handeltcp.c gcc: handeltcp.c: No such file or directory [student@localhost tcp]$ gcc client.c diewitherror.c handeltcp.c gcc: handeltcp.c: No such file or directory [student@localhost tcp]$ gcc client.c diewitherror.c handeltcpclient.c handeltcpclient.c: In function ‘handeltcpclient’: handeltcpclient.c:28: error: incompatible types in assignment handeltcpclient.c:35: error: invalid operands to binary & handeltcpclient.c:37: warning: passing argument 1 of ‘strncpy’ from incompatible pointer type handeltcpclient.c:37: warning: passing argument 2 of ‘strncpy’ makes pointer from integer without a cast handeltcpclient.c:37: error: too few arguments to function ‘strncpy’ handeltcpclient.c:38: warning: passing argument 1 of ‘strcmp’ makes pointer from integer without a cast handeltcpclient.c:41: warning: passing argument 1 of ‘sprintf’ from incompatible pointer type handeltcpclient.c:46: error: invalid operands to binary & handeltcpclient.c:46: error: ‘messageSize’ undeclared (first use in this function) handeltcpclient.c:46: error: (Each undeclared identifier is reported only once handeltcpclient.c:46: error: for each function it appears in.) handeltcpclient.c:51: warning: assignment makes pointer from integer without a cast handeltcpclient.c:54: warning: ‘return’ with a value, in function returning void handeltcpclient.c:59: error: ‘file’ undeclared (first use in this function) handeltcpclient.c:71: warning: ‘return’ with a value, in function returning void handeltcpclient.c:75: error: incompatible types in assignment handeltcpclient.c:77: warning: passing argument 1 of ‘strncpy’ from incompatible pointer type handeltcpclient.c:77: warning: passing argument 2 of ‘strncpy’ makes pointer from integer without a cast handeltcpclient.c:77: error: too few arguments to function ‘strncpy’ handeltcpclient.c:78: warning: passing argument 1 of ‘strcmp’ makes pointer from integer without a cast handeltcpclient.c:81: warning: passing argument 1 of ‘sprintf’ from incompatible pointer type handeltcpclient.c:85: warning: passing argument 1 of ‘strncpy’ from incompatible pointer type handeltcpclient.c:85: warning: passing argument 2 of ‘strncpy’ makes pointer from integer without a cast handeltcpclient.c:85: error: too few arguments to function ‘strncpy’ handeltcpclient.c:86: warning: passing argument 1 of ‘strcmp’ makes pointer from integer without a cast handeltcpclient.c:92: error: ‘sucess’ undeclared (first use in this function) handeltcpclient.c:98: error: expected expression before ‘if’ handeltcpclient.c:139: error: expected declaration or statement at end of input handeltcpclient.c:139: error: expected declaration or statement at end of input handeltcpclient.c:139: error: expected declaration or statement at end of input handeltcpclient.c:139: error: expected declaration or statement at end of input handeltcpclient.c:139: error: expected declaration or statement at end of input |
| Sponsored Links |
|
|