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("leaking random flag ...\n");
11 
12   unsigned int *secret_page = (int *)secret_page_i;
13   char *secret_page_c = (char *)secret_page_i;
14 
15   unsigned int index = secret_page[0] % 0xf00;
16 
17   transmit(1, &secret_page_c[index], 4, NULL);
18 }
19