2 * This file is part of the bayou project.
4 * Copyright (C) 2008 Advanced Micro Devices, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 static void print_banner(void)
24 printf("\e[H\e[JBayou Payload Chooser v0.3\n");
29 extern unsigned long _binary_builtin_lar_start;
34 lar = openlar((void *)&_binary_builtin_lar_start);
37 printf("[CHOOSER]: Unable to scan the attached LAR file\n");
41 get_configuration(lar);
43 if (bayoucfg.n_entries == 0) {
44 printf("[CHOOSER]: No payloads were found in the LAR\n");
49 * If timeout == 0xFF, then show the menu immediately.
50 * If timeout is zero, then find and run the default item immediately.
51 * If there is no default item, then show the menu.
52 * If timeout is anything else, then show a message and wait for a
53 * keystroke. If there is no keystroke in time then run the default.
54 * If there is no default then show the menu.
56 if (bayoucfg.timeout != 0xFF) {
57 struct payload *d = payload_get_default();
60 if (bayoucfg.timeout == 0)
63 run_payload_timeout(d, bayoucfg.timeout);