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.
18 static void print_banner(void)
20 printf("\e[H\e[JBayou Payload Chooser v0.3\n");
25 extern unsigned long _binary_builtin_lar_start
;
30 lar
= openlar((void *)&_binary_builtin_lar_start
);
33 printf("[CHOOSER]: Unable to scan the attached LAR file\n");
37 get_configuration(lar
);
39 if (bayoucfg
.n_entries
== 0) {
40 printf("[CHOOSER]: No payloads were found in the LAR\n");
45 * If timeout == 0xFF, then show the menu immediately.
46 * If timeout is zero, then find and run the default item immediately.
47 * If there is no default item, then show the menu.
48 * If timeout is anything else, then show a message and wait for a
49 * keystroke. If there is no keystroke in time then run the default.
50 * If there is no default then show the menu.
52 if (bayoucfg
.timeout
!= 0xFF) {
53 struct payload
*d
= payload_get_default();
56 if (bayoucfg
.timeout
== 0)
59 run_payload_timeout(d
, bayoucfg
.timeout
);