Wargame 0-1 Magic [100]

Description

Do you believe in magic?

nc bamboofox.cs.nctu.edu.tw 10000

Hint

Stack buffer overflow

void do_magic(char *buf,int n)
{
        int i;
        srand(time(NULL));
        for (i = 0; i < n; i++)
                buf[i] ^= rand()%256;
}

void magic()
{
        char magic_str[60];
        scanf("%s", magic_str);
        do_magic(magic_str, strlen(magic_str));
        printf("%s", magic_str);
}

Files

magic
# Avatar Name Last time Point
1 r3dhun9 2019-08-12 15:29:36 +0800 100
2 吳宗遠 2019-07-25 19:20:16 +0800 100
3 lee.tw() 2019-07-19 19:05:43 +0800 100
4 スタ 2019-07-18 00:59:46 +0800 100
5 phyman 2019-06-23 23:12:57 +0800 100
6 n0b0dy 2019-04-23 19:35:48 +0800 100
7 wechhu 2019-03-30 12:47:05 +0800 100
8 糖醋黄瓜 2019-03-22 18:01:41 +0800 100
9 SplashEM 2019-02-17 21:24:03 +0800 100
10 p0stganda1f 2019-02-17 15:50:51 +0800 100
11 wouuuuuuuuu 2018-12-30 17:47:20 +0800 100
12 hwy 2018-07-22 16:23:59 +0800 100
13 李冠廷 2018-07-20 09:03:07 +0800 100
14 idle_fire 2018-07-13 00:22:00 +0800 100
15 fsociety 2018-07-10 04:29:01 +0800 100
16 吳建興 2018-07-09 00:15:20 +0800 100
17 SSSP4RTA 2018-06-16 01:00:05 +0800 100
18 nctu 2018-04-14 17:41:42 +0800 100
19 0wning 2018-04-06 16:45:41 +0800 100
20 deadbeef 2018-03-13 21:42:44 +0800 100
21 zjw88282740 2018-03-07 23:27:45 +0800 100
22 歐陽詮 2018-02-16 21:59:36 +0800 100
23 ss8651twtw 2018-02-06 22:52:49 +0800 100
24 zwhubuntu 2017-12-06 22:15:17 +0800 100
25 Hungwen Chien 2017-11-01 14:44:18 +0800 100
26 Tryout Chen 2017-10-30 19:31:14 +0800 100
27 Nassim Asrir 2017-10-13 07:35:02 +0800 100
28 st424204 2017-10-08 23:55:30 +0800 100
29 mike1636216 2017-10-06 18:23:35 +0800 100
30 Phagoria 2017-10-06 08:04:59 +0800 100