2 * Copyright (C) 2008 dhewg, #wiidev efnet
4 * Copyright (C) 2006 Mike Melanson (mike at multimedia.cx)
6 * this file is part of wiifuse
7 * http://wiibrew.org/index.php?title=Wiifuse
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include <sys/types.h>
30 #define DATA_PREFIX "/usr/local/etc/wiifuse"
31 #define KEYFILE DATA_PREFIX "/image.key"
32 #define MAX_FILENAME_SIZE 1024
37 typedef long long s64
;
39 typedef unsigned char u8
;
40 typedef unsigned short u16
;
41 typedef unsigned int u32
;
42 typedef unsigned long long u64
;
44 #define ROUNDUP64B(x) (((u64)(x) + 64 - 1) & ~(64 - 1))
46 u16
get_be16 (const u8
*p
);
47 u32
get_be32 (const u8
*p
);
48 u64
get_be64 (const u8
*p
);
49 void put_be16 (u8
*p
, const u16 value
);
50 void put_be32 (u8
*p
, const u32 value
);
51 void put_be64 (u8
*p
, const u64 value
);
53 extern u8 verbose_level
;
55 #define LOG(level, format, args...) \
56 if (verbose_level >= level) \
57 printf (format "\n", ## args)
59 #define LOG_ERR(format, args...) \
60 fprintf (stderr, "ERROR: " format "\n", ## args)
62 size_t g_strnlen (const char *s
, size_t size
);
64 u32
get_dol_size (const u8
*header
);