mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-30 23:24:19 +01:00
83e3aa545c
* Fixed spelling mistake in image download function. * Reverted HTTP to non SSL revision (r1252). * Removed Nintendont internal update feature (requires SSL). * Added batch wad (un)install from a folder. * Changed the wad install menu interface. * Added an option to the wad class to display or hide errors on wad install. * Fixed RemoveDirectory return value. * Added game type and console name in exported game list. (requested) * Updated French language
65 lines
1.8 KiB
C++
65 lines
1.8 KiB
C++
/****************************************************************************
|
|
* Copyright (C) 2011 Dimok
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
****************************************************************************/
|
|
#ifndef _WAD_H_
|
|
#define _WAD_H_
|
|
|
|
#include <gccore.h>
|
|
|
|
/* 'WAD Header' structure */
|
|
typedef struct
|
|
{
|
|
/* Header length */
|
|
u32 header_len;
|
|
/* WAD type */
|
|
u16 type;
|
|
u16 padding;
|
|
/* Data length */
|
|
u32 certs_len;
|
|
u32 crl_len;
|
|
u32 tik_len;
|
|
u32 tmd_len;
|
|
u32 data_len;
|
|
u32 footer_len;
|
|
} ATTRIBUTE_PACKED wadHeader;
|
|
|
|
class Wad
|
|
{
|
|
public:
|
|
Wad(const char *wadpath = 0, bool prompt = true);
|
|
virtual ~Wad();
|
|
bool Open(const char *wadpath);
|
|
void Close(void);
|
|
bool Install(const char *installpath);
|
|
bool UnInstall(const char *installpath);
|
|
void SetPrompt(bool choice) { showPrompt = choice; };
|
|
private:
|
|
bool InstallContents(const char *installpath);
|
|
int CheckContentMap(const char *installpath, tmd_content *content, char *filepath);
|
|
bool WriteFile(const char *filepath, u8 *buffer, u32 len);
|
|
bool SetTitleUID(const char *intallpath, const u64 &tid);
|
|
|
|
FILE *pFile;
|
|
wadHeader *header;
|
|
u8 *p_tik, *p_tmd;
|
|
u8 *content_map;
|
|
u32 content_map_size;
|
|
u32 content_start;
|
|
bool showPrompt;
|
|
};
|
|
|
|
#endif
|