File size: 2,629 Bytes
d46f4a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
79
80
81
82
83
84
85
86
87
88
89
/*

 * Copyright (c) 2024 lax1dude. All Rights Reserved.

 * 

 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND

 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED

 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.

 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,

 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT

 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR

 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,

 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)

 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE

 * POSSIBILITY OF SUCH DAMAGE.

 * 

 */

#ifndef _INCLUDED_EPW_HEADER_H
#define _INCLUDED_EPW_HEADER_H

#include "stdint.h"

struct epw_slice {
	uint32_t sliceOffset;
	uint32_t sliceLength;
};

struct epw_slice_compressed {
	uint32_t sliceOffset;
	uint32_t sliceCompressedLength;
	uint32_t sliceDecompressedLength;
	uint32_t _reserved;
};

struct epw_assets_epk_file {
	struct epw_slice filePath;
	struct epw_slice loadPath;
	struct epw_slice_compressed fileData;
};

struct epw_header {
	uint8_t magic[8];
	
	uint32_t fileLength;
	uint32_t fileCRC32;
	uint16_t versionMajor;
	uint16_t versionMinor;
	
	uint32_t clientVersionInt;
	
	struct epw_slice clientPackageName;
	struct epw_slice clientOriginName;
	struct epw_slice clientOriginVersion;
	struct epw_slice clientOriginVendor;
	struct epw_slice clientForkName;
	struct epw_slice clientForkVersion;
	struct epw_slice clientForkVendor;
	struct epw_slice metadataSegment;
	
	uint64_t creationTime;
	uint32_t numEPKs;
	
	struct epw_slice splashImageData;
	struct epw_slice splashImageMIME;
	struct epw_slice pressAnyKeyImageData;
	struct epw_slice pressAnyKeyImageMIME;
	struct epw_slice crashImageData;
	struct epw_slice crashImageMIME;
	struct epw_slice faviconImageData;
	struct epw_slice faviconImageMIME;
	
	struct epw_slice loaderJSData;
	uint32_t _reserved_0;
	uint32_t _reserved_1;
	
	struct epw_slice loaderWASMData;
	uint32_t _reserved_2;
	uint32_t _reserved_3;
	
	struct epw_slice_compressed JSPIUnavailableData;
	struct epw_slice_compressed eagruntimeJSData;
	struct epw_slice_compressed classesWASMData;
	struct epw_slice_compressed classesDeobfTEADBGData;
	struct epw_slice_compressed classesDeobfWASMData;
	
	struct epw_assets_epk_file assetsEPKs[];
};

#endif