-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgar.bt
55 lines (49 loc) · 1.19 KB
/
gar.bt
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
// GAR file parser
// Author: @drewler
// Based on info from @xdanieldzd's N3DSCmbViewer
#include "cmb.bt"
LittleEndian();
typedef struct {
uint number_files_with_type;
uint file_number_index_offset;
uint file_type_name_offset;
uint unknown00;
} FILE_TYPE;
typedef struct {
uint file_size;
uint file_name_offset;
uint full_path_offset;
} FILE_INFO;
typedef struct {
char magic[4];
uint archive_size;
ushort number_file_types;
ushort number_files;
uint file_types_offset;
uint file_info_index_offset;
uint file_index_offset;
char codename[8];
local int i = 0;
local int saved_position = FTell();
local char tmp_magic[4];
FSeek(file_types_offset);
for(i = 0; i < number_file_types; i++){
FILE_TYPE file_type;
}
FSeek(file_info_index_offset);
for(i = 0; i < number_files; i++){
FILE_INFO file_info;
}
FSeek(file_index_offset);
for(i = 0; i < number_files; i++){
uint file_offset;
}
for(i = 0; i < number_files; i++){
FSeek(file_offset[i]);
ReadBytes(tmp_magic, FTell(), 4);
if(tmp_magic == "cmb\x20"){
CMB cmb;
}
}
} GAR;
GAR gar;