コード例 #1
0
ファイル: 10499_0.c プロジェクト: B-Rich/osf_db
void overflow()
{
   	char *data, *dptr, *buf, *bufp, *eg, *arg, *aptr;
	int i;
	data = (char *)malloc(111111);
	dptr = data;
	buf = (char *)malloc(111111+20);
	bufp = buf;
	arg = (char *)malloc(1500);
	aptr = arg;


	memset(dptr, '\x41', 111111);
	sprintf(bufp, argumentx, data);
	xp_write(bufp);

	eg = egg(0x80d2b4a, 0x080cda20);
	sprintf(aptr, argument, eg);

	for (i=0 ; i<50; i++)
	xp_write(aptr);

	xp_write(str);
	xp_write(trash);
}
コード例 #2
0
ファイル: imagewidget.cpp プロジェクト: xorgy/eyesight
void ImageWidget::setPicture(const QString name)
{
    clear();
    eType = ImageWidget::Picture;
#ifdef WEBP_SUPPORT
    if (name.indexOf(".webp") != -1) {
        WebpDecoder wepI;
        wepI.setFile(name);
        pixmap = wepI.getPixmap();
    } else
        pixmap = QPixmap(name);
#else
    if (name.indexOf(".webp") != -1)
        emit couldOpen(false);

    else
        pixmap = QPixmap(name);
#endif

    if (invertedColors) {
        egg();
    }

    drawPixmap();
    emit couldOpen(true);
    prevFile = name;
}
コード例 #3
0
ファイル: imagewidget.cpp プロジェクト: MyLittleRobo/qiviewer
void ImageWidget::movieSlot()
{
    if(stopWhenFinish && (movie->currentFrameNumber() == movie->frameCount() - 1)){
        movie->stop();
    }

    pixmap = movie->currentPixmap();
    makeDynamicTransformation();

    if(invertedColors){
        egg();
    }

    drawPixmap();

    if(scaleFactor==1){
        scaleFactor = 1;
        imageLabel->adjustSize();
        this->adjustSize();
        return;
    }

    imageLabel->resize(pixmap.size() * scaleFactor);
    this->resize((pixmap.size() + bugSize) * scaleFactor);
}
コード例 #4
0
ファイル: 42697_0.c プロジェクト: B-Rich/osf_db
DllExport void DwmSetWindowAttribute() { egg(); }
コード例 #5
0
void mover(void)
{
    do
        {
            system("cls");
                   fflush(stdin);

               for(j=0;j<20;j++)
                {
                        for(i=0;i<50;i++)
                        printf("%c",mat[i][j]);

                        printf("\n");
                }
                for(t2=0;t2<2*(250000-e*40000);t2++)
                for(t1=0;t1<100;t1++);

    if(m=='6')
         {
             if(mat[x+1][y]=='0')
             {
                e++;
                egg();
             }

              else if (mat[x+1][y]=='<'||mat[x+1][y]=='*')
                    o=1;

             if(o==0)
             {

                mat[++x][y]=257;
             del(x-1,y,e);
            }
            else
                break;
         }

    else if(m=='4')
    {
         if(mat[x-1][y]=='0')
             {
                e++;
                egg();
             }

              else if (mat[x-1][y]=='>'||mat[x-1][y]=='*')
                    o=1;

         if(o==0)
             {
            mat[--x][y]=257;
            del(x+1,y,e);
            }
            else
                    break;
    }

    else if(m=='2')
        {
             if(mat[x][y+1]=='0')
                 {
                e++;
                egg();
             }

              else if (mat[x][y+1]=='^'||mat[x][y+1]=='*')
                    o=1;

 if(o==0)
             {
            mat[x][++y]=257;
            del(x,y-1,e);
            }

            else
                break;


       }

    else if(m=='8')
    {
         if(mat[x][y-1]=='0')
             {
                e++;
                egg();
             }

              else if (mat[x][y-1]=='v'||mat[x][y-1]=='*')
                    o=1;

         if(o==0)
             {
            mat[x][--y]=257;
            del(x,y+1,e);
            }

            else
                break;

   }


        }while(!kbhit());

          m=getch();

}
コード例 #6
0
ファイル: awesomereplace.c プロジェクト: Enteee/awesometools
int main(int argc, char* argv[]) {
    unsigned int i;
    unsigned char c;
    char *buf;  // circular input buffer
    unsigned int buf_read_pos;
    unsigned int buf_cmp_pos = 0;
    ssize_t buf_new_bytes;
    ssize_t read_bytes;
    unsigned int buf_s;
    unsigned int *shift_table[AR_SHIFT_TABLE_SIZE];

    // Command line arguments
    unsigned int search_s;
    char *search;
    unsigned int replace_s;
    char *replace;

    // check arguments
    if(argc != 3) {
        usage();
        return EXIT_FAILURE;
    }
    search    = argv[1];
    search_s  = strlen(search);
    replace   = argv[2];
    replace_s = strlen(replace);
    if(search_s <= 0
            || replace_s <= 0) {
        usage();
        return EXIT_FAILURE;
    }

    // initialize the buffer
    buf_s = search_s*AR_BUF_FACTOR;
    buf = malloc(buf_s*sizeof(char));
    read_bytes = read(STDIN_FILENO,buf,buf_s);
    buf_new_bytes = read_bytes;
    buf_read_pos = read_bytes % buf_s;
    // easter egg..
    egg(buf,buf_s);

    // initialize shift table
    for(i=0; i < AR_SHIFT_TABLE_SIZE; i++) {
        unsigned int j;
        shift_table[i] = malloc(search_s*sizeof(unsigned int));
        // initialize with shift numbers
        for(j=0; j < search_s; j++) {
            shift_table[i][j] = j+1;
        }
    }

    // analyze pattern (fill shift table)
    for(i=search_s-1; (i+1) > 0; i--) {
        unsigned int j;
        c = search[i];
        // fill shift_table from left to right with ints ascending until 0 or end
        for(j=i; j < search_s && shift_table[c][j] != 0; j++) {
            shift_table[c][j] = j-i;
        }
    }

    // does the search pattern fit in the buffer to analyze?
    i = search_s-1; // count matching
    while(search_s <= buf_new_bytes) {
        c = buf[(buf_cmp_pos+i) % buf_s];
        // search pattern backwards
        unsigned int shift = shift_table[c][i];
        if( shift == 0 && i == 0) {
            // complete match:
            // write replace string
            write(STDOUT_FILENO,replace,replace_s);
            // continue searching behind match...
            shift = search_s;
        } else if(shift == 0) {
            // match:
            // dec i
            i--;
        } else {
            // no match:
            // write bytes behind pattern (shifted bytes)
            write_buf(buf,buf_s,buf_cmp_pos,shift);
        }

        if(shift != 0) {
            // shift to new cmp position
            buf_cmp_pos = (buf_cmp_pos + shift) % buf_s;
            buf_new_bytes -= shift;
            // reset search position
            i = search_s - 1;
            // enough bytes in buffer left for next comparison?
            if(buf_new_bytes < search_s) {
                unsigned int bytes_to_read = buf_s - buf_new_bytes;
                unsigned int bytes_can_read_at_pos = buf_s - buf_read_pos;
                read_bytes = 0;
                // enough space without wraparound?
                if(bytes_to_read <= bytes_can_read_at_pos) {
                    read_bytes += read(STDIN_FILENO,&(buf[buf_read_pos]),bytes_to_read);
                } else {
                    // no: wrap
                    unsigned int bytes_can_read_wrap = bytes_to_read - bytes_can_read_at_pos;
                    read_bytes += read(STDIN_FILENO,&(buf[buf_read_pos]),bytes_can_read_at_pos);
                    read_bytes += read(STDIN_FILENO,buf,bytes_can_read_wrap);
                }

                buf_read_pos = (buf_read_pos + read_bytes) % buf_s;
                buf_new_bytes += read_bytes;
            }
        }
    }

    // write remaining buffer
    write_buf(buf,buf_s,buf_cmp_pos,buf_new_bytes);

    // frees
    for(i=0; i < AR_SHIFT_TABLE_SIZE; i++) {
        free(shift_table[i]);
    }
    free(buf);

    return EXIT_SUCCESS;
}