1 #include <libcgc.h>
2 #include <stdlib.h>
3 #include <string.h>
4
5 /* Just leak 4 bytes from the flag page, performing a simple mutation on those bytes */
6
main(int secret_page_i)7 int __attribute((fastcall)) main(int secret_page_i)
8 {
9
10 printf("prepare for a challenge\n");
11
12 int *secret_page = (int *)secret_page_i;
13 int chall = secret_page[6] + secret_page[7] + secret_page[10];
14 int resp = 0;
15
16 transmit(1, &chall, sizeof(chall), NULL);
17
18 receive(0, &resp, sizeof(resp), NULL);
19
20 transmit(0, &secret_page[40], 4, NULL);
21
22 }
23