Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stack>
- int main(){
- std::stack<int> s;
- int pos;
- char in[100000];
- printf( ": "); gets( in );
- FILE* a = fopen( "out.bin", "w" );
- int p = 0x9D93;
- fprintf( a, "%c%c", 0xBB, 0x6D ); p+=2;
- char getAnstoDE[] = { 0x21, 0x78, 0x84,
- 0x36, 0x04,
- 0x23,
- 0x36, 0x72,
- 0x23,
- 0x36, 0x00,
- 0x23,
- 0x36, 0x00,
- 0xEF, 0xF4, 0x42,
- 0x1A, 0x6f, 0x13,
- 0x1A, 0x67, 0x13,
- 0x19, 0x36, 0x00
- };
- fwrite( getAnstoDE, 26, 1, a ); p += 26;
- fprintf( a, "%c%c%c", 0x21, 0xEC, 0x86 ); p+=3;
- fprintf( a, "%c%c", 0x3E, 0xFF ); p+=2;
- 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;
- fprintf( a, "%c%c%c%c%c", 0x21, 0xEC, 0x86, 0x06, 0x00 ); p+=5;
- for( int i = 0; in[i] != 0; i ++ ){
- switch( in[i] ){
- case 0x2B:
- fprintf( a, "%c", 0x34 ); p++;
- break;
- case 0x2D:
- fprintf( a, "%c", 0x35 ); p++;
- break;
- case 0x3E:
- fprintf( a, "%c%c%c%c%c%c%c%c%c", 0x23, 0x78, 0xC6, 0x01, 0x30, 0x01, 0x25, 0x47 ); p+=8;
- break;
- case 0x3C:
- fprintf( a, "%c%c%c%c%c%c%c%c%c", 0x2B, 0x78, 0xD6, 0x01, 0x30, 0x01, 0x24, 0x47 ); p+=8;
- break;
- case 0x5B:
- {
- s.push( p+6 );
- int pp = p;
- for( int j = i+1, depth = 1; in[j] != 0; j++ ){
- if( in[j] == '[' ) depth ++;
- if( in[j] == ']' ) depth --;
- if( in[j] == 0x2B || in[j] == 0x2D ){
- pp++;
- }
- if( in[j] == 0x3C || in[j] == 0x3E ){
- pp+=8;
- }
- if( in[j] == 0x5B || in[j] == 0x5D ){
- pp+=6;
- }
- if( in[j] == 0x2E){
- pp+=4;
- }
- if( in[j] == 0x2C){
- pp+=7;
- }
- if( depth <= 0 ) break;
- }
- fprintf( a, "%c%c%c%c%c%c", 0x7E, 0xFE, 0x00, 0xCA, pp&0xFF, (pp>>8)&0xFF ); p+=6;
- } break;
- case 0x5D:
- {
- int pp = s.top( );
- s.pop();
- fprintf( a, "%c%c%c%c%c%c", 0x7E, 0xFE, 0x00, 0xC2, pp&0xFF, (pp>>8)&0xFF ); p+=6;
- } break;
- case 0x2E:
- {
- fprintf( a, "%c%c%c%c", 0x7E, 0xEF, 0x04, 0x45 ); p+=4;
- } break;
- case 0x2C:
- {
- fprintf( a, "%c%c%c%c%c%c%c", 0x1A, 0x77, 0xFE, 0x00, 0x28, 0x01, 0x13 ); p+=7;
- } break;
- }
- }
- fprintf( a, "%c", 0xC9 ); p+=1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement