#include <iostream>
#include <cstring>
#include <windows.h>
#include <Lm.h>
using namespace std;
int main()
{
char fromName[20];
char computerName[20];
char message[100];
char fake[30];
//char completeCommand[140];
int num;
cout<<"Welcome, you are about to have the best fun of"
<<"\nyour typing career at the expense of someone else!"<<endl;
cout<<"Please enter the name of the computer you want to spam: ";
cin.getline(computerName, 20);
char* compConst = computerName;
cout<<"Please enter the message you wish to spam with (must be below 100 chars): ";
cin.getline(message, 100);
cout<<"Please enter the assumed name: ";
cin.getline(fake, 30);
char* nameConst = fake;
cout<<"Please enter the number of messages you wish to send to that alias: ";
cin>>num;
int msg = strlen(message);
system("net name RECTOR /add");
//NetMessageNameAdd(NULL, LPCWSTR("RECTOR"));
for(int i = 0; i<num; i++){
if(NetMessageBufferSend(NULL,(LPCWSTR)compConst, (LPCWSTR)nameConst, (BYTE*)message, msg*2)==ERROR_ACCESS_DENIED);
{cout<<"BEEP."<<endl;}
}
cout<<ERROR_ACCESS_DENIED<<endl;
cout<<"Done."<<endl;
system("PAUSE");
return 0;
}
#include <iostream>
#include <windows.h>
#include <Lm.h>
#define MAXLEN 50
using namespace std;
int main()
{
DWORD rc;
char from[MAXLEN];
char name[MAXLEN];
char msg[MAXLEN];
char server[MAXLEN];
wchar_t serverW[MAXLEN];
wchar_t msgW[MAXLEN];
wchar_t nameW[MAXLEN];
wchar_t fromW[MAXLEN];
int num;
cout<<"Welcome, have fun spamming the crap out of people!"<<endl;
cout<<"TO: ";
cin >> name;
cin.get();
cout<<"MESSAGE: ";
cin.getline(msg, 50);
cout<<"FROM: ";
cin >> from;
cout<<"HOW MANY? ";
cin >> num;
//mbstowcs( serverW, server, MAXLEN );
mbstowcs(msgW, msg, MAXLEN);
mbstowcs(nameW, name, MAXLEN);
mbstowcs(fromW, from, MAXLEN);
NetMessageNameAdd(NULL, fromW);
for(int i = 0; i<num; i++)
{
rc = NetMessageBufferSend( NULL, nameW, fromW, (byte*)msgW, wcslen( msgW ) * 2 );
if(rc==NERR_Success)
{
cout<<"Completed."<<endl;
}
else {
if(rc!=NERR_Success)
{
cout<<"Failed because of ";
}
if(rc==NERR_NameNotFound)
{
cout<<"an invalid message alias."<<endl;
}
if(rc==ERROR_INVALID_PARAMETER)
{
cout<<"an invalid parameter."<<endl;
}
if(rc==ERROR_NOT_SUPPORTED)
{
cout<<"an invalid network."<<endl;
}
if(rc==NERR_NetworkError)
{
cout<<"a network error."<<endl;
}}
}
NetMessageNameDel(NULL, fromW);
cout<<"Done."<<endl;
system("PAUSE");
return 0;
}