Skip to content

Commit

Permalink
LOIC-1.0.7.42-source
Browse files Browse the repository at this point in the history
  • Loading branch information
NewEraCracker committed Jan 29, 2012
1 parent 4285f5e commit f0c8958
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 139 deletions.
46 changes: 22 additions & 24 deletions HTTPFlooder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace LOIC
class HTTPFlooder : IFlooder
{
#region Fields
private BackgroundWorker bw;
private long lastAction;
private Random random = new Random();
private Timer tTimepoll = new Timer();
Expand All @@ -27,27 +28,17 @@ public HTTPFlooder(string ip, int port, string subSite, bool resp, int delay, in
#endregion

#region Properties
public int Delay { get; set; }

public int Downloaded { get; set; }

public int Requested { get; set; }

public int Failed { get; set; }

public bool IsFlooding { get; set; }

public string IP { get; set; }

public int Port { get; set; }

public bool Resp { get; set; }

public ReqState State { get; set; }

public string Subsite { get; set; }

public int Timeout { get; set; }
public int Delay { get; set; }
public int Downloaded { get; set; }
public int Requested { get; set; }
public int Failed { get; set; }
public bool IsFlooding { get; set; }
public string IP { get; set; }
public int Port { get; set; }
public bool Resp { get; set; }
public ReqState State { get; set; }
public string Subsite { get; set; }
public int Timeout { get; set; }
#endregion

#region Methods
Expand All @@ -60,11 +51,18 @@ public void Start()
tTimepoll.Tick += new EventHandler(tTimepoll_Tick);
tTimepoll.Start();

var bw = new BackgroundWorker();
bw.DoWork += new DoWorkEventHandler(bw_DoWork);
bw.RunWorkerAsync();
this.bw = new BackgroundWorker();
this.bw.DoWork += new DoWorkEventHandler(bw_DoWork);
this.bw.RunWorkerAsync();
this.bw.WorkerSupportsCancellation = true;
}

public void Stop()
{
this.IsFlooding = false;
this.bw.CancelAsync();
}

private static long Tick()
{
return DateTime.Now.Ticks / 10000;
Expand Down
4 changes: 2 additions & 2 deletions IFlooder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ namespace LOIC
interface IFlooder
{
#region Properties
int Delay { get; set; }

int Delay { get; set; }
bool IsFlooding { get; set; }
#endregion

#region Methods
void Start();
void Stop();
#endregion
}
}
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

[assembly: Guid("312adafc-fdac-484b-84c5-5c5457e47f67")]

[assembly: AssemblyVersion("1.0.6.0")]
[assembly: AssemblyVersion("1.0.7.0")]
49 changes: 27 additions & 22 deletions XXPFlooder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
namespace LOIC
{
class XXPFlooder : IFlooder
{
#region Constructors
public XXPFlooder(string ip, int port, int proto, int delay, bool resp, string data)
{
#region Fields
private BackgroundWorker bw;
#endregion

#region Constructors
public XXPFlooder(string ip, int port, int proto, int delay, bool resp, string data)
{
this.IP = ip;
this.Port = port;
Expand All @@ -18,31 +22,32 @@ public XXPFlooder(string ip, int port, int proto, int delay, bool resp, string d
#endregion

#region Properties
public bool IsFlooding { get; set; }

public int FloodCount { get; set; }

public string IP { get; set; }

public int Port { get; set; }

public int Protocol { get; set; }

public int Delay { get; set; }

public bool Resp { get; set; }

public string Data { get; set; }
public bool IsFlooding { get; set; }
public int FloodCount { get; set; }
public string IP { get; set; }
public int Port { get; set; }
public int Protocol { get; set; }
public int Delay { get; set; }
public bool Resp { get; set; }
public string Data { get; set; }
#endregion

#region Methods
public void Start()
{
IsFlooding = true;
var bw = new BackgroundWorker();
bw.DoWork += new DoWorkEventHandler(bw_DoWork);
bw.RunWorkerAsync();
this.IsFlooding = true;
this.bw = new BackgroundWorker();
this.bw.DoWork += new DoWorkEventHandler(bw_DoWork);
this.bw.RunWorkerAsync();
this.bw.WorkerSupportsCancellation = true;
}

public void Stop()
{
this.IsFlooding = false;
this.bw.CancelAsync();
}

#endregion

#region Event handlers
Expand Down
6 changes: 0 additions & 6 deletions app.config

This file was deleted.

Loading

0 comments on commit f0c8958

Please sign in to comment.