aboutsummaryrefslogtreecommitdiff
path: root/laichzeit/banner.h
blob: 31fef15e47a998ca27a665f18120d04378542e8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*****************************************************************************
 *  Laichzeit                                                                *
 *  Part of the Benzin Project                                               *
 *  Copyright (C)2009 SquidMan (Alex Marshall)       <SquidMan72@gmail.com>  *
 *  Copyright (C)2009 megazig  (Stephen Simpson)      <megazig@hotmail.com>  *
 *  Copyright (C)2009 Matt_P   (Matthew Parlane)                             *
 *  Copyright (C)2009 comex                                                  *
 *  Copyright (C)2009 booto                                                  *
 *  All Rights Reserved, HACKERCHANNEL.                                      *
 * ------------------------------------------------------------------------- *
 *  banner.h                                                                 *
 *  The header file for all the final banner stuff. Include this!            *
 * ------------------------------------------------------------------------- *
 *  Compilation code contributed by:                                         *
 *          icefire                                                          *
 *  Intermediation code contributed by:                                      *
 *          SquidMan                                                         *
 *****************************************************************************/

#ifndef BANNER_H
#define BANNER_H

#include "types.h"

#define USE_BANNER

typedef struct
{
	u8	zeroes[128];	// padding
	char	imet[4];	// `IMET'
	u64	unk;		// 0x0000060000000003 fixed, unknown purpose
	u32	sizes[3];	// icon.bin, banner.bin, sound.bin
	u32	flag1;		// ???
	u16	names[7][42];	// JP, EN, DE, FR, ES, IT, NL
	u8	zeroes_2[840];	// Padding
	u8	crypto[16];	// MD5 of 0x40 to 0x640 in header. 
				// Should be all 0's when calculating MD5.
} IMET;

typedef struct
{
	char	imd5[4];	// `IMD5'
	u32	filesize;	// Size of rest of file
	u8	zeroes[8];	// Padding
	u8	crypto[16];	// MD5 of rest of file
} IMD5;

typedef struct
{
	char	src[256];	// Filename.
	char	dst[256];	// Filename.
	u32	size;		// Size of the data.
	u8*	data;		// The data.
} U8File;

typedef struct ud
{
	char	   name[256];	// Name.
	int	   filecnt;	// How many files.
	U8File*	   files;	// The files.
	int	   dircnt;	// How many subdirs.
	struct ud* dirs;	// The dirs.
} U8Dir;

typedef struct
{
	U8Dir	rootdir;	// The root dir.
} U8;

IMET*  LaichMeta_IMET(char** names, \
		      u32 iconsize, u32 bannersize, u32 soundsize);
IMD5*  LaichMeta_IMD5(u8* file, u32 size);
U8*    LaichMeta_StartU8(U8Dir* root);
U8Dir* LaichMeta_CreateDirInDirU8(U8Dir* arc, char* name);
void   LaichMeta_CreateFileInDirU8(U8Dir* arc, char* src, char* dst);
u8*    LaichMeta_CompileU8(U8* input, u32* size);

#endif //BANNER_H