Skip to content

putchar music

Challenge Link: putchar_music

Category: programming

Writeup: putchar music

This one line of C program works on Linux Desktop. What is this movie's title? Please answer the flag as SECCON{MOVIES_TITLE}, replace all alphabets with capital letters, and spaces with underscores.

main(t,i,j){unsigned char p[]="###<f_YM\204g_YM\204g_Y_H #<f_YM\204g_YM\204g_Y_H #+-?[WKAMYJ/7 #+-?[WKgH #+-?[WKAMYJ/7hk\206\203tk\\YJAfkkk";for(i=0;t=1;i=(i+1)%(sizeof(p)-1)){double x=pow(1.05946309435931,p[i]/6+13);for(j=1+p[i]%6;t++%(8192/j);)putchar(t>>5|(int)(t*x));}}

Solution

I found a cool video "Creating music in one line of C code"on Youtube, and it looked similar to this challenge.

Here is the instructions mentioned below the video:

  1. Compile source code (main.c)
gcc main.c -lm
  1. Play with mplayer
./a.out | mplayer -demuxer rawaudio -rawaudio rate=8000:channels=1:samplesize=1 -

Then you will get a cool music like this !!