Advertisement
Aslai

Guess what it is

Oct 8th, 2011
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.17 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stack>
  3.  
  4. int main(){
  5.     std::stack<int> s;
  6.     int pos;
  7.     char in[100000];
  8.     printf( ": "); gets( in );
  9.     FILE* a = fopen( "out.bin", "w" );
  10.     int p = 0x9D93;
  11.  
  12.     fprintf( a, "%c%c", 0xBB, 0x6D ); p+=2;
  13.     char getAnstoDE[] = {   0x21, 0x78, 0x84,
  14.                             0x36, 0x04,
  15.                             0x23,
  16.                             0x36, 0x72,
  17.                             0x23,
  18.                             0x36, 0x00,
  19.                             0x23,
  20.                             0x36, 0x00,
  21.                             0xEF, 0xF4, 0x42,
  22.                             0x1A, 0x6f, 0x13,
  23.                             0x1A, 0x67, 0x13,
  24.                             0x19, 0x36, 0x00
  25.                             };
  26.     fwrite( getAnstoDE, 26, 1, a ); p += 26;
  27.     fprintf( a, "%c%c%c", 0x21, 0xEC, 0x86 ); p+=3;
  28.  
  29.     fprintf( a, "%c%c", 0x3E, 0xFF ); p+=2;
  30.     fprintf( a, "%c%c%c%c%c%c%c%c%c", 0x36, 0, 0x23, 0x3D, 0xFE, 0, 0xC2, p&0xFF, (p>>8)&0xFF ); p+=9;
  31.     fprintf( a, "%c%c%c%c%c", 0x21, 0xEC, 0x86, 0x06, 0x00 ); p+=5;
  32.  
  33.     for( int i = 0; in[i] != 0; i ++ ){
  34.         switch( in[i] ){
  35.             case 0x2B:
  36.                 fprintf( a, "%c", 0x34 ); p++;
  37.                 break;
  38.             case 0x2D:
  39.                 fprintf( a, "%c", 0x35 ); p++;
  40.                 break;
  41.             case 0x3E:
  42.                 fprintf( a, "%c%c%c%c%c%c%c%c%c", 0x23, 0x78, 0xC6, 0x01, 0x30, 0x01, 0x25, 0x47 ); p+=8;
  43.                 break;
  44.             case 0x3C:
  45.                 fprintf( a, "%c%c%c%c%c%c%c%c%c", 0x2B, 0x78, 0xD6, 0x01, 0x30, 0x01, 0x24, 0x47 ); p+=8;
  46.                 break;
  47.             case 0x5B:
  48.             {
  49.                 s.push( p+6 );
  50.                 int pp = p;
  51.                 for( int j = i+1, depth = 1; in[j] != 0; j++ ){
  52.                     if( in[j] == '[' ) depth ++;
  53.                     if( in[j] == ']' ) depth --;
  54.  
  55.                     if( in[j] == 0x2B || in[j] == 0x2D ){
  56.                         pp++;
  57.                     }
  58.                     if( in[j] == 0x3C || in[j] == 0x3E ){
  59.                         pp+=8;
  60.                     }
  61.  
  62.                     if( in[j] == 0x5B || in[j] == 0x5D ){
  63.                         pp+=6;
  64.                     }
  65.                     if( in[j] == 0x2E){
  66.                         pp+=4;
  67.                     }
  68.                     if( in[j] == 0x2C){
  69.                         pp+=7;
  70.                     }
  71.  
  72.                     if( depth <= 0 ) break;
  73.                 }
  74.                 fprintf( a, "%c%c%c%c%c%c", 0x7E, 0xFE, 0x00, 0xCA, pp&0xFF, (pp>>8)&0xFF ); p+=6;
  75.             } break;
  76.             case 0x5D:
  77.             {
  78.                 int pp = s.top( );
  79.                 s.pop();
  80.                 fprintf( a, "%c%c%c%c%c%c", 0x7E, 0xFE, 0x00, 0xC2, pp&0xFF, (pp>>8)&0xFF ); p+=6;
  81.             } break;
  82.             case 0x2E:
  83.             {
  84.                 fprintf( a, "%c%c%c%c", 0x7E, 0xEF, 0x04, 0x45 ); p+=4;
  85.             } break;
  86.             case 0x2C:
  87.             {
  88.                 fprintf( a, "%c%c%c%c%c%c%c", 0x1A, 0x77, 0xFE, 0x00, 0x28, 0x01, 0x13 ); p+=7;
  89.             } break;
  90.  
  91.         }
  92.     }
  93.     fprintf( a, "%c", 0xC9 ); p+=1;
  94. }
  95.  
  96.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement