forked from difcareer/010templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Bt2NvidiaWrapper.bt
61 lines (54 loc) · 1.78 KB
/
Bt2NvidiaWrapper.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
56
57
58
59
60
61
//--------------------------------------
//--- 010 Editor v6.0beta1 Binary Template
//
// File: Bt2NvidiaWrapper.bt
// Author: Tim "diff" Strazzere
// <[email protected]>
// <[email protected]>
// Revision: 0.5
// Purpose: Quick template for "Bt2" files, which seems to be an Nvidia specific
// format for "wrapped" things;
// - modem.wrapped
// - secondary_boot.wrapped
//
// Not done - more to reverse
//--------------------------------------
typedef enum <uint> {
UNKNOWN = 0x0A14E91C,
// Head of both modem and secondary
NORMAL = 0x1CE9140A,
BT2_BOOTMAGIC = 0x1CE8060A,
// Found right before xml in seconardy_boot.wrapped
BT2_TRAILER_MAGIC = 0x1CEB72AB,
MODEM = 0x1CE70100
} magic <format=hex>;
// 0x20 bytes large according to reversing
typedef struct {
// Likely magic bytes appears normally as;
// 0x0A14E91C
// Seems to be code to check for;
// 0x1CE9140A
// 0x1CEB72AB "trailer magic"
magic tag <format=hex, comment="Magic bytes">;
uint length <comment="Length of header">;
uint file_size <comment="Size of content after header">;
uint file_id;
if(length - 0x10 > 0) {
byte data[length - 0x10];
}
} header;
typedef struct {
magic tag <format=hex, comment="Magic bytes tag">;
uint length <comment="Length of BT2 Trailer XML">;
if(length > 0) {
byte xml_data[length];
}
} BT2Trailer;
typedef struct {
header head;
if(head.length + head.file_size != FileSize()) {
Warning("File size does not seem correct according to header, expected %d but have %d", head.file_size, FileSize());
}
//byte data[head.file_size - head.length];
} archive;
archive archive_struct;