|
@@ -1094,7 +1094,12 @@ int mangle(int fd, char *buffer) {
|
|
|
ZF_LOGI("seen: ANSI_CLS");
|
|
|
|
|
|
if (random_activate(9)) {
|
|
|
+ int r;
|
|
|
+ int color;
|
|
|
char display[100] = "";
|
|
|
+ const char* phrasing[] = {"HeHeHe", "Poof!", "Got U",
|
|
|
+ "Anyone there?", "There Wolf", "There Castle"};
|
|
|
+ const char* phr;
|
|
|
|
|
|
ZF_LOGI("mangle(ANSI_CLS)");
|
|
|
// sprintf( display, "^P2...");
|
|
@@ -1102,7 +1107,14 @@ int mangle(int fd, char *buffer) {
|
|
|
// strcpy(display, "^P2^S501234567890^P1abcdef^P2g^P3h^P4i^S0^P2");
|
|
|
|
|
|
// strcpy(display, "^P2^S301234^P15^S0^P2");
|
|
|
- strcpy(display, "^S3^C1Hi^S0^P1");
|
|
|
+
|
|
|
+ // Add in random text, plus color!
|
|
|
+ r = random() % ((sizeof(phrasing) / sizeof(char *)) - 1);
|
|
|
+ color = random() % 16;
|
|
|
+ if(color == 0){ color++; }
|
|
|
+ sprintf(display, "^P1^S3^C%02d%s^S0^P1", color, phrasing[r]);
|
|
|
+ ZF_LOGD("mangle(ANSI_CLS): Inserted (%02d) %s", color, phrasing[r]);
|
|
|
+
|
|
|
// Move the buffer so there's room for the display string.
|
|
|
memmove(cp + strlen(display), cp, strlen(cp) + 1);
|
|
|
strncpy(cp, display, strlen(display));
|