Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

hidden BBCode messages

Name: Anonymous 2013-03-04 13:35

[o][/o]=0
[i][/i]=1
check page source

also read this:
http://en.wikipedia.org/wiki/Steganography

Name: () !!var9KdY9ji7pxRk 2013-03-05 11:57

I spent far too much time on this. I'll generalize it later implement >>8-san's scheme.


#include <stdio.h>
#include <strings.h>

#define INMATCH -10
#define BROKEN -20

static char dead[255] = {0};

typedef struct {
  char **table;
  int n; // number of entries
  int s; // byte slices per entry
  int m; // shift factor
} scheme;

int get_match(char **needles, int n, char c){

  static int pos = 0;
  static char alive[255] = {0};

  int match = -1;

  for (int i = 0; i < n; ++i){
    if (pos == 0)
      alive[i] = (needles[i][pos] == c);
    else if (alive[i]){
      alive[i] = (needles[i][pos] == c);
      if (alive[i] && needles[i][pos+1] == '\0'){
    match = i;
    break;
      }
    }
  }

  if (memcmp(alive, dead, 255) == 0){
    pos = 0;
    return BROKEN;
  }
  else if (match != -1){
    memset(alive, 0x00, 255);
    pos = 0;
    return match;
  }
  else {
    ++pos;
    return INMATCH;
  }

}

void parse_hidden(scheme *prog, int v, FILE *file){
 
#define GETINPUT(z) (z = fgetc(file))

  char parts[1024*16];

  int x = 0, c = 1, t = BROKEN, b = 0, h = 0;

  t = get_match(prog[0].table, prog[0].n, GETINPUT(c));

  while (c != EOF){

    if (t == BROKEN){
      if (b != 0 && h != 0){
    fprintf(stdout, "\n+----------------- - - -\n|  \n|  ");
    int n, o, m, s;

    if ( h < (prog[1].n) ){
      n = prog[1].n;
      s = prog[1].s;
      m = prog[1].m;
    }
    else {
      n = prog[0].n;
      s = prog[0].s;
      m = prog[0].m;
    }
   
    for (int i = 0; i < b;){
      x = 0;
      for (o = s-1; o >= 0;)
        x = (parts[i++] << (o--*m)) | x;
     
      if ((x >= 32 && x <= 126) || x == '\n' || x == '\r'){
        fputc(x, stdout);
        if (x == '\n')
          fprintf(stdout, "|  ");
      }
    }
      }
      b = 0;
      h = 0;
    }

    if (t == BROKEN && c != EOF)
      do t = get_match(prog[0].table, prog[0].n, GETINPUT(c)); while (t == BROKEN && c != EOF);

    while (t == INMATCH && c != EOF)
      t = get_match(prog[0].table, prog[0].n, GETINPUT(c));

    if (c == EOF) break;
    if (t == BROKEN){
      t = get_match(prog[0].table, prog[0].n, GETINPUT(c));
      continue;
    }

    parts[b++] = t;
    if (t > h) h = t;

    t = get_match(prog[0].table, prog[0].n, GETINPUT(c));
   
  }
}

int main(int argc, char **argv){

  char *tableu4[] = {
    "<span class=\"o\"></span>",\
    "<i></i>",
    "<b></b>",
    "<u></u>"
  };

  scheme prog[2] =  {
    {
      .table = tableu4,
      .n = 4,
      .s = 4,
      .m = 2
    },
    {
      .table = tableu4,
      .n = 2,
      .s = 8,
      .m = 1
    }
  };
 
  parse_hidden(prog, 2, stdin);

  fprintf(stdout, "\n+----------------- - - -\n\n");

  return 0;
}

Name: () !!var9KdY9ji7pxRk 2013-03-05 11:58

Detects encodings automatically. Or tries to. Result of running it on this thread:


+----------------- - - -

|  lol dongs
+----------------- - - -

|  dongs you say?

|  Back to /b/ ``please''.
+----------------- - - -

>>2
|  No thank you!
+----------------- - - -

|  penis penis penis penis lol
+----------------- - - -

|  LLLLLEEEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLLLLLL
|  >EGIN WIN /G/RO
|  >LEL DONGS AMIRITE???? XDDDDDDDDD
+----------------- - - -

>>14

|  u mad?
+----------------- - - -

>>15
|  /backplate getgoes/
+----------------- - - -


+----------------- - - -

|  u wot m8
+----------------- - - -


+----------------- - - -

i(X8I9Y((ih-huh}|uu8iuiu8uu8]u]u}iyIi(iI8)IIhi8i)i9Y((|Y(ihhH|Qh(i|i<ih
+----------------- - - -

|  #include <stdio.h>
|  char *table[] = {"","","",""};
|  int main(int argc, char **argv){
|    int c, i;
|    while ( (c = fgetc(stdin)) != EOF)
|      for (i = 3; i >= 0; i--)
|        printf("%s",table[((c>>(i*2))&0x03)]);
|  }

+----------------- - - -

|  #include <stdio.h>
|  int main(int argc, char **argv){
|    int c;
|    unsigned char x, j;
|    do    
|      for (j = 0; j < 8; j++){
|        c = fgetc(stdin);
|        if (c == EOF) goto end;
|        x=((x<<1)|!(c=='0'));
|      } while (putchar(x));
|   end:
|    return 0;
|  }

+----------------- - - -


Fucked up post in the middle is the one where I pasted the wrong output.

Enjoy.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List