From 9c1ded3b0ae8e540177ee0c0baa1f9c8fcf91989 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Wed, 18 Mar 2009 20:52:11 +0100 Subject: Initial commit of sources --- wii_wad.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 wii_wad.h (limited to 'wii_wad.h') diff --git a/wii_wad.h b/wii_wad.h new file mode 100644 index 0000000..3407219 --- /dev/null +++ b/wii_wad.h @@ -0,0 +1,43 @@ +/** + * wii_wad.h + */ + +#ifndef __WII_WAD_H__ +#define __WII_WAD_H__ + +#include +#include "types.h" +#include "wii_tmd.h" +#include "wii_tik.h" +#include "wii_imet.h" + +enum wad_section { + SECTION_WAD_HEADER = 0, + SECTION_CERT_CHAIN = 1, + SECTION_TICKET = 2, + SECTION_TMD = 3, + SECTION_DATA = 4, + SECTION_FOOTER = 5 +}; + +typedef struct { + u32 size; /* header size, always 0x20 */ + u16 type; + u16 unk0; + u32 cert_chain_size; + u32 crl_size; + u32 ticket_size; + u32 tmd_size; + u32 data_size; + u32 footer_size; +} wad_header; + +void print_wad(wad_header *wad); + +int wad_read(FILE *f, wad_header *wad); +void wad_read_tmd(FILE *f, wad_header *wad, tmd_header *tmd); +void wad_read_tik(FILE *f, wad_header *wad, tmd_header *tmd, wii_tik *tik); +void wad_read_app_info(FILE *f, wad_header *wad, tmd_content_record *tmd_content, wii_tik *tik, wii_build_info *bi, wii_imet *imet); +u32 wad_get_section_offset(wad_header *wad, u8 section); + +#endif -- cgit v1.1-32-gdbae