# Eggdrop 1.4.1 Botnet Core

**Category:** Eggdrop_Bot
**Original Author:** Robey Pointer (Eggheads)

## Description
This is a core component of an IRC botnet, providing essential functionalities such as channel management, user interaction, and network communication.

## Key Features
- **Channel Management:**
  - Channel CTCP flood protection.
  - Channel avalanche flood protection.
  - Channel join-part flood protection.
- **User Interaction:**
  - Userfile transfer and update commands from sharebots.
  - DCC-based command handling.
- **Network Communication:**
  - Botnet linking, unlinking, and relaying.
  - Pinging bots periodically to check leaf status.

## File Analysis
- **acconfig.h** — Template file for autoheader usage when building `config.h.in`.
- **action.fix.tcl** — Fixes for mIRC dcc chat `/me` commands and telnet session `/me` commands.
- **alltools.tcl** — Includes toolbox, toolkit, and moretools TCL scripts, updated by various contributors.
- **compat.tcl** — Quick mapping of old tcl functions to new ones for lazy script updates.
- **getops-2.2d.tcl** — Script used for bots to request and give ops to each other in a botnet.
- **klined.tcl** — Handles k-lined servers by removing them from the bot's server list when detected.
- **notes2.tcl** — Bind apart script with various enhancements.
- **ques5.tcl** — Web scraping tool for Eggdrop 1.3.x+ versions, updated multiple times.
- **sentinel1.54.tcl** — Flood protection system integrated with BitchX CTCP simulation.
- **userinfo1.0.tcl** — Provides user information commands like whois and URL indexing.
- **botcmd.c** — Handles commands that come across the botnet, including userfile transfer and update commands from sharebots.
- **botmsg.c** — Formats messages to be sent on the botnet and sends different messages to different versioned bots.
- **botnet.c** — Keeps track of connected bots in the chain, dumping lists or bot trees to users.
- **chan.h** — Common stuff for channel management.
- **chanprog.c** — Handles various functionalities like maintaining server list, revenge punishment, timers, and utimers.
- **cmds.c** — Handles commands from a user via dcc that cause server interaction.
- **cmdt.h** — Stuff for built-in commands.
- **dcc.c** — Manages activity on a dcc socket.
- **dccutil.c** — Handles various functions to send formatted text to varying types of connections, including `.who`, `.whom`, and `.dccstat`.
- **eggdrop.h** — Compile-time settings for Eggdrop.
- **flags.c** — Handles flag matching and conversion functions.
- **flags.h** — Definitions for language support.
- **language.c** — Handles language support code.
- **main.c** — Core event handling, signal handling, command line arguments, context and assert debugging.
- **main.h** — Includes most other include files.
- **match.c** — Wildcard matching functions.
- **mem.c** — Memory allocation and deallocation.
- **misc.c** — Handles various miscellaneous functionalities like split(), maskhost(), copyfile(), movefile(), fixfrom(), logging, queueing output for the bot, help system, motd display, etc.
- **modules.c** — Supports modules in Eggdrop.
- **modules.h** — Header file for module support.
- **net.c** — Handles all raw network i/o.
- **patch.h** — Header file for adding patches to Eggdrop's version string.
- **proto.h** — Prototypes for every function used outside its own module.
- **rfc1459.c** — Implements RFC 1459 protocol handling.
- **tandem.h** — Stuff used by tcl.c and tclhash.c.
- **tcl.c** — Handles commands added to Tcl, Tcl initialization, getting and setting Tcl/eggdrop variables.
- **tcldcc.c** — Handles Tcl stubs for the dcc commands.
- **tclegg.h** — Stuff used by tcl.c and tclhash.c.
- **tclhash.c** — Handles various bindings and procedures lookups.
- **tclhash.h** — Header file for tclhash.c.
- **tclmisc.c** — Handles Tcl stubs for file system commands and other miscellaneous functions.
- **tcluser.c** — Handles Tcl stubs for user-record-oriented commands.
- **userent.c** — Handles user-entry handling, new style more versatile.
- **userrec.c** — Handles add_q(), del_q(), str2flags(), flags2str(), str2chflags(), chflags2str(), and various functions to find and change user records.
- **users.c** — Handles testing and enforcing ignores, adding and removing ignores, listing ignores, auto-linking bots, sending and receiving a userfile from a bot, listing users, reading the user file.
- **users.h** — Structures and definitions used by users.c and userrec.c.
- **global.h** — RSAREF types and constants.
- **md5.h** — Header file for md5c.c.
- **md5c.c** — Implements RSA Data Security's MD5 message-digest algorithm.
- **module.h** — Header file for module support.
- **modvals.h** — Header file for module values.
- **assoc.c** — Part of assoc.mod, handles association code moved from botnet.c for module work.
- **bf_tab.h** — Blowfish P-box and S-box tables.
- **blowfish.c** — Encryption and decryption of passwords using the Blowfish algorithm.
- **blowfish.h** — Header file for blowfish.mod.