Add 5 immersive hacking modules: terminal emulator, live data streams, system monitoring, attack visualization, log streaming
- Terminal Emu: live terminal showing fake command execution, privilege escalation, shell access - Data Stream: animated hex dumps and packet captures with scrolling binary data - System Monitor: target dashboard with processes, CPU/memory/network metrics - Attack Vis: exploit progression visualization (scan→enum→exploit→escalate→exfil) with intensity - Log Streamer: real-time colored log feed with alerts, successes, error tracking These modules make Cardputer FEEL like active hacking with live feedback, creating immersive sense of actively exploiting and monitoring compromised systems. Adds visceral "attack in progress" aesthetic to the interface. Brings toolkit to 48 modules across 11 categories.
This commit is contained in:
70
src/modules/datastream.cpp
Normal file
70
src/modules/datastream.cpp
Normal file
@@ -0,0 +1,70 @@
|
||||
#include "../core/module.h"
|
||||
#include "../core/ui.h"
|
||||
|
||||
// Data Stream: animated hex dumps, packet captures, scrolling binary data.
|
||||
// Shows live "network traffic" with realistic packet data flowing in real-time.
|
||||
// Makes it feel like you're intercepting and analyzing actual network communications.
|
||||
|
||||
class DataStream : public Module {
|
||||
enum DataType { HEX_DUMP, PACKET_CAPTURE, BINARY_STREAM, ASCII_LOG } dataType = HEX_DUMP;
|
||||
bool streaming = false;
|
||||
uint32_t bytesCaptured = 0;
|
||||
uint32_t packetCount = 0;
|
||||
uint32_t scrollPos = 0;
|
||||
char msg[3][40] = {{0},{0},{0}};
|
||||
|
||||
public:
|
||||
const char* name() const override { return "Data Stream"; }
|
||||
const char* blurb() const override { return "live packet capture"; }
|
||||
|
||||
void onEnter() override {
|
||||
streaming = false;
|
||||
bytesCaptured = 0;
|
||||
packetCount = 0;
|
||||
scrollPos = 0;
|
||||
say("Data capture: ready");
|
||||
}
|
||||
void onExit() override { streaming = false; }
|
||||
|
||||
bool onKey(char c) override {
|
||||
if (c == 't') { dataType = (DataType)((dataType + 1) % 4); return true; }
|
||||
if (c == ' ') { streaming = !streaming; if (streaming) { bytesCaptured = 0; packetCount = 0; } return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
void tick() override {
|
||||
if (!streaming) return;
|
||||
|
||||
bytesCaptured += (64 + (packetCount % 128));
|
||||
if (bytesCaptured % 256 == 0) packetCount++;
|
||||
scrollPos++;
|
||||
|
||||
if (packetCount % 5 == 0) {
|
||||
say("[PKT %u] %u bytes captured", packetCount, (bytesCaptured / 1024));
|
||||
}
|
||||
}
|
||||
|
||||
void draw() override {
|
||||
const char* dt[] = {"HEX", "PACKETS", "BINARY", "ASCII"};
|
||||
ui::lineC(0, ui::accent(), "Data Stream: %s %s", dt[dataType], streaming ? "LIVE" : "idle");
|
||||
|
||||
// Simulate hex dump scrolling
|
||||
ui::line(2, "00x%04x: 48 65 6c 6c 6f 20", scrollPos % 0xFFFF);
|
||||
ui::line(3, "00x%04x: 57 6f 72 6c 64 21", (scrollPos + 1) % 0xFFFF);
|
||||
ui::line(4, "00x%04x: 50 4b 54 00 41 42", (scrollPos + 2) % 0xFFFF);
|
||||
|
||||
ui::bar(5, (bytesCaptured % 2048) / 2048.0f, streaming ? ui::glow() : ui::dim(), "cap");
|
||||
|
||||
for (int i = 0; i < 3; i++) ui::line(7 + i, "%s", msg[i]);
|
||||
if (streaming) ui::spinner(228, ui::BODY_Y + 1, ui::glow());
|
||||
ui::hintBar("[t]ype [space]capture [`]back");
|
||||
}
|
||||
|
||||
private:
|
||||
void say(const char* fmt, ...) {
|
||||
for (int i = 2; i > 0; i--) strncpy(msg[i], msg[i-1], 39);
|
||||
va_list ap; va_start(ap, fmt); vsnprintf(msg[0], 40, fmt, ap); va_end(ap);
|
||||
}
|
||||
};
|
||||
|
||||
Module* makeDataStream() { return new DataStream(); }
|
||||
Reference in New Issue
Block a user