Rizin
unix-like reverse engineering framework and cli tools
nds.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2014 Alberto Ortega
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 /*
5 http://dsibrew.org/wiki/NDS_Format
6 http://sourceforge.net/p/devkitpro/ndstool/ci/master/tree/source/header.h
7 */
8 
9 #ifndef NIN_NDS_H
10 #define NIN_NDS_H
11 
12 #include <rz_types_base.h>
13 
15  struct nds_hdr {
16  st8 title[0xC];
17  st8 gamecode[0x4];
18  st8 makercode[2];
19  ut8 unitcode;
20  ut8 devicetype;
21  ut8 devicecap;
22  ut8 reserved1[0x9];
23  ut8 romversion;
24  ut8 reserved2;
25  ut32 arm9_rom_offset;
26  ut32 arm9_entry_address;
27  ut32 arm9_ram_address;
28  ut32 arm9_size;
29  ut32 arm7_rom_offset;
30  ut32 arm7_entry_address;
31  ut32 arm7_ram_address;
32  ut32 arm7_size;
33  ut32 fnt_offset;
34  ut32 fnt_size;
35  ut32 fat_offset;
36  ut32 fat_size;
37  ut32 arm9_overlay_offset;
38  ut32 arm9_overlay_size;
39  ut32 arm7_overlay_offset;
40  ut32 arm7_overlay_size;
41  ut32 rom_control_info1;
42  ut32 rom_control_info2;
43  ut32 banner_offset;
44  ut16 secure_area_crc;
45  ut16 rom_control_info3;
46  ut32 offset_0x70;
47  ut32 offset_0x74;
48  ut32 offset_0x78;
49  ut32 offset_0x7C;
50  ut32 application_end_offset;
51  ut32 rom_header_size;
52  ut32 offset_0x88;
53  ut32 offset_0x8C;
54 
55  /* reserved */
56  ut32 offset_0x90;
57  ut32 offset_0x94;
58  ut32 offset_0x98;
59  ut32 offset_0x9C;
60  ut32 offset_0xA0;
61  ut32 offset_0xA4;
62  ut32 offset_0xA8;
63  ut32 offset_0xAC;
64  ut32 offset_0xB0;
65  ut32 offset_0xB4;
66  ut32 offset_0xB8;
67  ut32 offset_0xBC;
68 
69  ut8 logo[156];
70  ut16 logo_crc;
71  ut16 header_crc;
72  });
73 
74 #endif /* NIN_NDS_H */
uint16_t ut16
uint32_t ut32
uint8_t ut8
Definition: lh5801.h:11
RZ_PACKED(struct nds_hdr { st8 title[0xC];st8 gamecode[0x4];st8 makercode[2];ut8 unitcode;ut8 devicetype;ut8 devicecap;ut8 reserved1[0x9];ut8 romversion;ut8 reserved2;ut32 arm9_rom_offset;ut32 arm9_entry_address;ut32 arm9_ram_address;ut32 arm9_size;ut32 arm7_rom_offset;ut32 arm7_entry_address;ut32 arm7_ram_address;ut32 arm7_size;ut32 fnt_offset;ut32 fnt_size;ut32 fat_offset;ut32 fat_size;ut32 arm9_overlay_offset;ut32 arm9_overlay_size;ut32 arm7_overlay_offset;ut32 arm7_overlay_size;ut32 rom_control_info1;ut32 rom_control_info2;ut32 banner_offset;ut16 secure_area_crc;ut16 rom_control_info3;ut32 offset_0x70;ut32 offset_0x74;ut32 offset_0x78;ut32 offset_0x7C;ut32 application_end_offset;ut32 rom_header_size;ut32 offset_0x88;ut32 offset_0x8C;ut32 offset_0x90;ut32 offset_0x94;ut32 offset_0x98;ut32 offset_0x9C;ut32 offset_0xA0;ut32 offset_0xA4;ut32 offset_0xA8;ut32 offset_0xAC;ut32 offset_0xB0;ut32 offset_0xB4;ut32 offset_0xB8;ut32 offset_0xBC;ut8 logo[156];ut16 logo_crc;ut16 header_crc;})
#define st8
Definition: rz_types_base.h:16