@isopodlabs/binary_libs 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/elf.js +2 -2
- package/package.json +1 -1
- package/dist/CompoundDocument.d copy.ts +0 -95
- package/dist/arch.d copy.ts +0 -18
- package/dist/clr.d copy.ts +0 -409
- package/dist/elf.d copy.ts +0 -152
- package/dist/mach.d copy.ts +0 -505
- package/dist/pe.d copy.ts +0 -144
package/dist/elf.js
CHANGED
|
@@ -41,7 +41,7 @@ const OSABI = {
|
|
|
41
41
|
HPUX: 1, // HP-UX operating system
|
|
42
42
|
STANDALONE: 255, // Standalone (embedded)application
|
|
43
43
|
};
|
|
44
|
-
const Ident = {
|
|
44
|
+
const Ident = binary.SizeType(16, {
|
|
45
45
|
//enum {MAGIC = '\177ELF'};
|
|
46
46
|
magic: binary.UINT32_LE,
|
|
47
47
|
file_class: binary.asEnum(binary.UINT8, CLASS),
|
|
@@ -53,7 +53,7 @@ const Ident = {
|
|
|
53
53
|
abiversion: binary.UINT8,
|
|
54
54
|
pad: binary.ArrayType(7, binary.UINT8),
|
|
55
55
|
})
|
|
56
|
-
};
|
|
56
|
+
});
|
|
57
57
|
const ET = {
|
|
58
58
|
NONE: 0, // No file type
|
|
59
59
|
REL: 1, // Relocatable file
|
package/package.json
CHANGED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import * as binary from '@isopodlabs/binary';
|
|
2
|
-
declare class FAT {
|
|
3
|
-
shift: number;
|
|
4
|
-
sectors: Uint8Array;
|
|
5
|
-
fat: Int32Array;
|
|
6
|
-
freed: number[];
|
|
7
|
-
dirty_fat: Set<number>;
|
|
8
|
-
dirty_sec: Set<number>;
|
|
9
|
-
constructor(size: number, shift: number, sectors: Uint8Array);
|
|
10
|
-
private free;
|
|
11
|
-
private alloc;
|
|
12
|
-
get_chain(id: number): number[];
|
|
13
|
-
resize_chain(chain: number[], data_size: number): void;
|
|
14
|
-
clear_dirty(): void;
|
|
15
|
-
read_chain(chain: number[], dest: Uint8Array): void;
|
|
16
|
-
read_chain_alloc(chain: number[]): Uint8Array;
|
|
17
|
-
read(id: number, dest: Uint8Array): void;
|
|
18
|
-
write_chain(chain: number[], source: Uint8Array): void;
|
|
19
|
-
dirty_chain_part(chain: number[], offset: number): Uint8Array;
|
|
20
|
-
}
|
|
21
|
-
declare const Header_base: (new (s: binary._stream) => {
|
|
22
|
-
magic: bigint;
|
|
23
|
-
id: Uint8Array;
|
|
24
|
-
revision: number;
|
|
25
|
-
version: number;
|
|
26
|
-
byteorder: number;
|
|
27
|
-
sector_shift: number;
|
|
28
|
-
mini_shift: number;
|
|
29
|
-
unused1: void;
|
|
30
|
-
num_directory: number;
|
|
31
|
-
num_fat: number;
|
|
32
|
-
first_directory: number;
|
|
33
|
-
transaction: void;
|
|
34
|
-
mini_cutoff: number;
|
|
35
|
-
first_mini: number;
|
|
36
|
-
num_mini: number;
|
|
37
|
-
first_difat: number;
|
|
38
|
-
num_difat: number;
|
|
39
|
-
difat: Uint8Array;
|
|
40
|
-
} & {
|
|
41
|
-
write(w: binary._stream): void;
|
|
42
|
-
}) & {
|
|
43
|
-
get: <X extends abstract new (...args: any) => any>(this: X, s: binary._stream) => InstanceType<X>;
|
|
44
|
-
put: (s: binary._stream, v: any) => void;
|
|
45
|
-
};
|
|
46
|
-
export declare class Header extends Header_base {
|
|
47
|
-
sector_size(): number;
|
|
48
|
-
use_mini(size: number): boolean;
|
|
49
|
-
valid(): boolean;
|
|
50
|
-
}
|
|
51
|
-
declare const DirEntry_base: (new (s: binary._stream) => {
|
|
52
|
-
name: string;
|
|
53
|
-
name_size: number;
|
|
54
|
-
type: number;
|
|
55
|
-
colour: number;
|
|
56
|
-
left: number;
|
|
57
|
-
right: number;
|
|
58
|
-
root: number;
|
|
59
|
-
guid: Uint8Array;
|
|
60
|
-
flags: number;
|
|
61
|
-
creation: bigint;
|
|
62
|
-
modification: bigint;
|
|
63
|
-
sec_id: number;
|
|
64
|
-
size: number;
|
|
65
|
-
unused: number;
|
|
66
|
-
} & {
|
|
67
|
-
write(w: binary._stream): void;
|
|
68
|
-
}) & {
|
|
69
|
-
get: <X extends abstract new (...args: any) => any>(this: X, s: binary._stream) => InstanceType<X>;
|
|
70
|
-
put: (s: binary._stream, v: any) => void;
|
|
71
|
-
};
|
|
72
|
-
declare class DirEntry extends DirEntry_base {
|
|
73
|
-
index: number;
|
|
74
|
-
constructor(index: number, r: binary.stream);
|
|
75
|
-
load(fat: FAT): Uint8Array;
|
|
76
|
-
}
|
|
77
|
-
declare class Master {
|
|
78
|
-
header: Header;
|
|
79
|
-
difat: Int32Array;
|
|
80
|
-
fat: FAT;
|
|
81
|
-
mini_fat: FAT;
|
|
82
|
-
mini_chain: number[];
|
|
83
|
-
constructor(sectors: Uint8Array, header: Header);
|
|
84
|
-
get_fat(mini: boolean): FAT;
|
|
85
|
-
flush(filename: string): Promise<void>;
|
|
86
|
-
}
|
|
87
|
-
export declare class Reader extends Master {
|
|
88
|
-
entries: DirEntry[];
|
|
89
|
-
private entry_chain;
|
|
90
|
-
constructor(sectors: Uint8Array, header: Header);
|
|
91
|
-
find(name: string, i?: number): DirEntry | undefined;
|
|
92
|
-
read(e: DirEntry): Uint8Array;
|
|
93
|
-
write(e: DirEntry, data: Uint8Array): void;
|
|
94
|
-
}
|
|
95
|
-
export {};
|
package/dist/arch.d copy.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as binary from '@isopodlabs/binary';
|
|
2
|
-
declare const _HEADER: {
|
|
3
|
-
name: binary.TypeT<string>;
|
|
4
|
-
date: binary.TypeT<number>;
|
|
5
|
-
uid: binary.TypeT<number>;
|
|
6
|
-
gid: binary.TypeT<number>;
|
|
7
|
-
mode: binary.TypeT<number>;
|
|
8
|
-
size: binary.TypeT<number>;
|
|
9
|
-
fmag: binary.TypeT<string>;
|
|
10
|
-
contents: binary.TypeT<any>;
|
|
11
|
-
};
|
|
12
|
-
export type HEADER = binary.ReadType<typeof _HEADER>;
|
|
13
|
-
export declare class ArchFile {
|
|
14
|
-
members: HEADER[];
|
|
15
|
-
static check(data: Uint8Array): boolean;
|
|
16
|
-
constructor(data: Uint8Array);
|
|
17
|
-
}
|
|
18
|
-
export {};
|
package/dist/clr.d copy.ts
DELETED
|
@@ -1,409 +0,0 @@
|
|
|
1
|
-
import * as binary from '@isopodlabs/binary';
|
|
2
|
-
import * as pe from './pe';
|
|
3
|
-
declare enum TABLE {
|
|
4
|
-
Module = 0,
|
|
5
|
-
TypeRef = 1,
|
|
6
|
-
TypeDef = 2,
|
|
7
|
-
Field = 4,
|
|
8
|
-
MethodDef = 6,
|
|
9
|
-
Param = 8,
|
|
10
|
-
InterfaceImpl = 9,
|
|
11
|
-
MemberRef = 10,
|
|
12
|
-
Constant = 11,
|
|
13
|
-
CustomAttribute = 12,
|
|
14
|
-
FieldMarshal = 13,
|
|
15
|
-
DeclSecurity = 14,
|
|
16
|
-
ClassLayout = 15,
|
|
17
|
-
FieldLayout = 16,
|
|
18
|
-
StandAloneSig = 17,
|
|
19
|
-
EventMap = 18,
|
|
20
|
-
Event = 20,
|
|
21
|
-
PropertyMap = 21,
|
|
22
|
-
Property = 23,
|
|
23
|
-
MethodSemantics = 24,
|
|
24
|
-
MethodImpl = 25,
|
|
25
|
-
ModuleRef = 26,
|
|
26
|
-
TypeSpec = 27,
|
|
27
|
-
ImplMap = 28,
|
|
28
|
-
FieldRVA = 29,
|
|
29
|
-
Assembly = 32,
|
|
30
|
-
AssemblyProcessor = 33,
|
|
31
|
-
AssemblyOS = 34,
|
|
32
|
-
AssemblyRef = 35,
|
|
33
|
-
AssemblyRefProcessor = 36,
|
|
34
|
-
AssemblyRefOS = 37,
|
|
35
|
-
File = 38,
|
|
36
|
-
ExportedType = 39,
|
|
37
|
-
ManifestResource = 40,
|
|
38
|
-
NestedClass = 41,
|
|
39
|
-
GenericParam = 42,
|
|
40
|
-
MethodSpec = 43,
|
|
41
|
-
GenericParamConstraint = 44
|
|
42
|
-
}
|
|
43
|
-
declare class clr_stream extends binary.stream {
|
|
44
|
-
heaps: Uint8Array[];
|
|
45
|
-
heap_sizes: number;
|
|
46
|
-
table_counts: number[];
|
|
47
|
-
constructor(buffer: Uint8Array, heaps: Uint8Array[], heap_sizes: number, table_counts: number[]);
|
|
48
|
-
getOffset(big: boolean): number;
|
|
49
|
-
getHeap(heap: number): Uint8Array;
|
|
50
|
-
getIndex(table: number): number;
|
|
51
|
-
getCodedIndex(B: number, trans: number[]): number;
|
|
52
|
-
getString(): string;
|
|
53
|
-
getGUID(): string;
|
|
54
|
-
getBlob(): Uint8Array;
|
|
55
|
-
}
|
|
56
|
-
declare class Indexed {
|
|
57
|
-
table: number;
|
|
58
|
-
constructor(table: number);
|
|
59
|
-
get(s: clr_stream): number;
|
|
60
|
-
}
|
|
61
|
-
declare class IndexedList extends Indexed {
|
|
62
|
-
get(s: clr_stream): number;
|
|
63
|
-
}
|
|
64
|
-
declare class CodedIndex {
|
|
65
|
-
trans: number[];
|
|
66
|
-
B: number;
|
|
67
|
-
constructor(trans: number[], B: number);
|
|
68
|
-
get(s: clr_stream): number;
|
|
69
|
-
}
|
|
70
|
-
declare const TableReaders: {
|
|
71
|
-
0: {
|
|
72
|
-
generation: binary.TypeT<number>;
|
|
73
|
-
name: {
|
|
74
|
-
get(s: clr_stream): string;
|
|
75
|
-
put(_s: clr_stream, _v: number): void;
|
|
76
|
-
};
|
|
77
|
-
mvid: {
|
|
78
|
-
get(s: clr_stream): string;
|
|
79
|
-
put(_s: clr_stream, _v: number): void;
|
|
80
|
-
};
|
|
81
|
-
encid: {
|
|
82
|
-
get(s: clr_stream): string;
|
|
83
|
-
put(_s: clr_stream, _v: number): void;
|
|
84
|
-
};
|
|
85
|
-
encbaseid: {
|
|
86
|
-
get(s: clr_stream): string;
|
|
87
|
-
put(_s: clr_stream, _v: number): void;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
1: {
|
|
91
|
-
scope: CodedIndex;
|
|
92
|
-
name: {
|
|
93
|
-
get(s: clr_stream): string;
|
|
94
|
-
put(_s: clr_stream, _v: number): void;
|
|
95
|
-
};
|
|
96
|
-
namespce: {
|
|
97
|
-
get(s: clr_stream): string;
|
|
98
|
-
put(_s: clr_stream, _v: number): void;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
2: {
|
|
102
|
-
flags: binary.TypeT<number>;
|
|
103
|
-
name: {
|
|
104
|
-
get(s: clr_stream): string;
|
|
105
|
-
put(_s: clr_stream, _v: number): void;
|
|
106
|
-
};
|
|
107
|
-
namespce: {
|
|
108
|
-
get(s: clr_stream): string;
|
|
109
|
-
put(_s: clr_stream, _v: number): void;
|
|
110
|
-
};
|
|
111
|
-
extends: CodedIndex;
|
|
112
|
-
fields: IndexedList;
|
|
113
|
-
methods: IndexedList;
|
|
114
|
-
};
|
|
115
|
-
4: {
|
|
116
|
-
flags: binary.TypeT<number>;
|
|
117
|
-
name: {
|
|
118
|
-
get(s: clr_stream): string;
|
|
119
|
-
put(_s: clr_stream, _v: number): void;
|
|
120
|
-
};
|
|
121
|
-
signature: {
|
|
122
|
-
get(s: clr_stream): Uint8Array;
|
|
123
|
-
put(_s: clr_stream, _v: number): void;
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
6: {
|
|
127
|
-
code: binary.TypeT<number>;
|
|
128
|
-
implflags: binary.TypeT<number>;
|
|
129
|
-
flags: binary.TypeT<number>;
|
|
130
|
-
name: {
|
|
131
|
-
get(s: clr_stream): string;
|
|
132
|
-
put(_s: clr_stream, _v: number): void;
|
|
133
|
-
};
|
|
134
|
-
signature: {
|
|
135
|
-
get(s: clr_stream): Uint8Array;
|
|
136
|
-
put(_s: clr_stream, _v: number): void;
|
|
137
|
-
};
|
|
138
|
-
paramlist: IndexedList;
|
|
139
|
-
};
|
|
140
|
-
8: {
|
|
141
|
-
flags: binary.TypeT<number>;
|
|
142
|
-
sequence: binary.TypeT<number>;
|
|
143
|
-
name: {
|
|
144
|
-
get(s: clr_stream): string;
|
|
145
|
-
put(_s: clr_stream, _v: number): void;
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
9: {
|
|
149
|
-
clss: Indexed;
|
|
150
|
-
interfce: CodedIndex;
|
|
151
|
-
};
|
|
152
|
-
10: {
|
|
153
|
-
clss: CodedIndex;
|
|
154
|
-
name: {
|
|
155
|
-
get(s: clr_stream): string;
|
|
156
|
-
put(_s: clr_stream, _v: number): void;
|
|
157
|
-
};
|
|
158
|
-
signature: {
|
|
159
|
-
get(s: clr_stream): Uint8Array;
|
|
160
|
-
put(_s: clr_stream, _v: number): void;
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
11: {
|
|
164
|
-
type: binary.TypeT<number>;
|
|
165
|
-
parent: CodedIndex;
|
|
166
|
-
value: {
|
|
167
|
-
get(s: clr_stream): Uint8Array;
|
|
168
|
-
put(_s: clr_stream, _v: number): void;
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
12: {
|
|
172
|
-
parent: CodedIndex;
|
|
173
|
-
type: CodedIndex;
|
|
174
|
-
value: {
|
|
175
|
-
get(s: clr_stream): Uint8Array;
|
|
176
|
-
put(_s: clr_stream, _v: number): void;
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
13: {
|
|
180
|
-
parent: CodedIndex;
|
|
181
|
-
native_type: {
|
|
182
|
-
get(s: clr_stream): Uint8Array;
|
|
183
|
-
put(_s: clr_stream, _v: number): void;
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
14: {
|
|
187
|
-
action: binary.TypeT<number>;
|
|
188
|
-
parent: CodedIndex;
|
|
189
|
-
permission_set: {
|
|
190
|
-
get(s: clr_stream): Uint8Array;
|
|
191
|
-
put(_s: clr_stream, _v: number): void;
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
15: {
|
|
195
|
-
packing_size: binary.TypeT<number>;
|
|
196
|
-
class_size: binary.TypeT<number>;
|
|
197
|
-
parent: Indexed;
|
|
198
|
-
};
|
|
199
|
-
16: {
|
|
200
|
-
offset: binary.TypeT<number>;
|
|
201
|
-
field: Indexed;
|
|
202
|
-
};
|
|
203
|
-
17: {
|
|
204
|
-
signature: {
|
|
205
|
-
get(s: clr_stream): Uint8Array;
|
|
206
|
-
put(_s: clr_stream, _v: number): void;
|
|
207
|
-
};
|
|
208
|
-
};
|
|
209
|
-
18: {
|
|
210
|
-
parent: Indexed;
|
|
211
|
-
event_list: IndexedList;
|
|
212
|
-
};
|
|
213
|
-
20: {
|
|
214
|
-
flags: binary.TypeT<number>;
|
|
215
|
-
name: {
|
|
216
|
-
get(s: clr_stream): string;
|
|
217
|
-
put(_s: clr_stream, _v: number): void;
|
|
218
|
-
};
|
|
219
|
-
event_type: CodedIndex;
|
|
220
|
-
};
|
|
221
|
-
21: {
|
|
222
|
-
parent: Indexed;
|
|
223
|
-
property_list: IndexedList;
|
|
224
|
-
};
|
|
225
|
-
23: {
|
|
226
|
-
flags: binary.TypeT<number>;
|
|
227
|
-
name: {
|
|
228
|
-
get(s: clr_stream): string;
|
|
229
|
-
put(_s: clr_stream, _v: number): void;
|
|
230
|
-
};
|
|
231
|
-
type: {
|
|
232
|
-
get(s: clr_stream): Uint8Array;
|
|
233
|
-
put(_s: clr_stream, _v: number): void;
|
|
234
|
-
};
|
|
235
|
-
};
|
|
236
|
-
24: {
|
|
237
|
-
flags: binary.TypeT<number>;
|
|
238
|
-
method: Indexed;
|
|
239
|
-
association: CodedIndex;
|
|
240
|
-
};
|
|
241
|
-
25: {
|
|
242
|
-
clss: Indexed;
|
|
243
|
-
method_body: CodedIndex;
|
|
244
|
-
method_declaration: CodedIndex;
|
|
245
|
-
};
|
|
246
|
-
26: {
|
|
247
|
-
name: {
|
|
248
|
-
get(s: clr_stream): string;
|
|
249
|
-
put(_s: clr_stream, _v: number): void;
|
|
250
|
-
};
|
|
251
|
-
};
|
|
252
|
-
27: {
|
|
253
|
-
signature: {
|
|
254
|
-
get(s: clr_stream): Uint8Array;
|
|
255
|
-
put(_s: clr_stream, _v: number): void;
|
|
256
|
-
};
|
|
257
|
-
};
|
|
258
|
-
28: {
|
|
259
|
-
flags: binary.TypeT<number>;
|
|
260
|
-
member_forwarded: CodedIndex;
|
|
261
|
-
name: {
|
|
262
|
-
get(s: clr_stream): string;
|
|
263
|
-
put(_s: clr_stream, _v: number): void;
|
|
264
|
-
};
|
|
265
|
-
scope: Indexed;
|
|
266
|
-
};
|
|
267
|
-
29: {
|
|
268
|
-
rva: binary.TypeT<number>;
|
|
269
|
-
field: Indexed;
|
|
270
|
-
};
|
|
271
|
-
32: {
|
|
272
|
-
hashalg: binary.TypeT<number>;
|
|
273
|
-
major: binary.TypeT<number>;
|
|
274
|
-
minor: binary.TypeT<number>;
|
|
275
|
-
build: binary.TypeT<number>;
|
|
276
|
-
rev: binary.TypeT<number>;
|
|
277
|
-
flags: binary.TypeT<number>;
|
|
278
|
-
publickey: {
|
|
279
|
-
get(s: clr_stream): Uint8Array;
|
|
280
|
-
put(_s: clr_stream, _v: number): void;
|
|
281
|
-
};
|
|
282
|
-
name: {
|
|
283
|
-
get(s: clr_stream): string;
|
|
284
|
-
put(_s: clr_stream, _v: number): void;
|
|
285
|
-
};
|
|
286
|
-
culture: {
|
|
287
|
-
get(s: clr_stream): string;
|
|
288
|
-
put(_s: clr_stream, _v: number): void;
|
|
289
|
-
};
|
|
290
|
-
};
|
|
291
|
-
33: {
|
|
292
|
-
processor: binary.TypeT<number>;
|
|
293
|
-
};
|
|
294
|
-
34: {
|
|
295
|
-
platform: binary.TypeT<number>;
|
|
296
|
-
minor: binary.TypeT<number>;
|
|
297
|
-
major: binary.TypeT<number>;
|
|
298
|
-
};
|
|
299
|
-
35: {
|
|
300
|
-
major: binary.TypeT<number>;
|
|
301
|
-
minor: binary.TypeT<number>;
|
|
302
|
-
build: binary.TypeT<number>;
|
|
303
|
-
rev: binary.TypeT<number>;
|
|
304
|
-
flags: binary.TypeT<number>;
|
|
305
|
-
publickey: {
|
|
306
|
-
get(s: clr_stream): Uint8Array;
|
|
307
|
-
put(_s: clr_stream, _v: number): void;
|
|
308
|
-
};
|
|
309
|
-
name: {
|
|
310
|
-
get(s: clr_stream): string;
|
|
311
|
-
put(_s: clr_stream, _v: number): void;
|
|
312
|
-
};
|
|
313
|
-
culture: {
|
|
314
|
-
get(s: clr_stream): string;
|
|
315
|
-
put(_s: clr_stream, _v: number): void;
|
|
316
|
-
};
|
|
317
|
-
hashvalue: {
|
|
318
|
-
get(s: clr_stream): Uint8Array;
|
|
319
|
-
put(_s: clr_stream, _v: number): void;
|
|
320
|
-
};
|
|
321
|
-
};
|
|
322
|
-
36: {
|
|
323
|
-
processor: binary.TypeT<number>;
|
|
324
|
-
assembly: Indexed;
|
|
325
|
-
};
|
|
326
|
-
37: {
|
|
327
|
-
platform: binary.TypeT<number>;
|
|
328
|
-
major: binary.TypeT<number>;
|
|
329
|
-
minor: binary.TypeT<number>;
|
|
330
|
-
assembly: Indexed;
|
|
331
|
-
};
|
|
332
|
-
38: {
|
|
333
|
-
flags: binary.TypeT<number>;
|
|
334
|
-
name: {
|
|
335
|
-
get(s: clr_stream): string;
|
|
336
|
-
put(_s: clr_stream, _v: number): void;
|
|
337
|
-
};
|
|
338
|
-
hash: {
|
|
339
|
-
get(s: clr_stream): Uint8Array;
|
|
340
|
-
put(_s: clr_stream, _v: number): void;
|
|
341
|
-
};
|
|
342
|
-
};
|
|
343
|
-
39: {
|
|
344
|
-
flags: binary.TypeT<number>;
|
|
345
|
-
typedef_id: binary.TypeT<number>;
|
|
346
|
-
name: {
|
|
347
|
-
get(s: clr_stream): string;
|
|
348
|
-
put(_s: clr_stream, _v: number): void;
|
|
349
|
-
};
|
|
350
|
-
namespce: {
|
|
351
|
-
get(s: clr_stream): string;
|
|
352
|
-
put(_s: clr_stream, _v: number): void;
|
|
353
|
-
};
|
|
354
|
-
implementation: CodedIndex;
|
|
355
|
-
};
|
|
356
|
-
40: {
|
|
357
|
-
data: binary.TypeT<number>;
|
|
358
|
-
flags: binary.TypeT<number>;
|
|
359
|
-
name: {
|
|
360
|
-
get(s: clr_stream): string;
|
|
361
|
-
put(_s: clr_stream, _v: number): void;
|
|
362
|
-
};
|
|
363
|
-
implementation: CodedIndex;
|
|
364
|
-
};
|
|
365
|
-
41: {
|
|
366
|
-
nested_class: Indexed;
|
|
367
|
-
enclosing_class: Indexed;
|
|
368
|
-
};
|
|
369
|
-
42: {
|
|
370
|
-
number: binary.TypeT<number>;
|
|
371
|
-
flags: binary.TypeT<number>;
|
|
372
|
-
owner: CodedIndex;
|
|
373
|
-
name: {
|
|
374
|
-
get(s: clr_stream): string;
|
|
375
|
-
put(_s: clr_stream, _v: number): void;
|
|
376
|
-
};
|
|
377
|
-
};
|
|
378
|
-
43: {
|
|
379
|
-
method: CodedIndex;
|
|
380
|
-
instantiation: {
|
|
381
|
-
get(s: clr_stream): Uint8Array;
|
|
382
|
-
put(_s: clr_stream, _v: number): void;
|
|
383
|
-
};
|
|
384
|
-
};
|
|
385
|
-
44: {
|
|
386
|
-
owner: Indexed;
|
|
387
|
-
constraint: CodedIndex;
|
|
388
|
-
};
|
|
389
|
-
};
|
|
390
|
-
interface Table {
|
|
391
|
-
count: number;
|
|
392
|
-
size: number;
|
|
393
|
-
offset: number;
|
|
394
|
-
}
|
|
395
|
-
export declare class CLR {
|
|
396
|
-
header: any;
|
|
397
|
-
table_info: any;
|
|
398
|
-
heaps: Uint8Array[];
|
|
399
|
-
tables: Record<TABLE, Table>;
|
|
400
|
-
raw?: Uint8Array;
|
|
401
|
-
Resources?: Uint8Array;
|
|
402
|
-
constructor(pe: pe.PE, clr_data: Uint8Array);
|
|
403
|
-
getEntry(t: TABLE, i: number): any;
|
|
404
|
-
getTable<T extends TABLE>(t: T): binary.ReadType<typeof TableReaders[T]>[];
|
|
405
|
-
getResources(block: string): Record<string, any> | undefined;
|
|
406
|
-
getResource(block: string, name: string): any;
|
|
407
|
-
allResources(): {} | undefined;
|
|
408
|
-
}
|
|
409
|
-
export {};
|
package/dist/elf.d copy.ts
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import * as binary from '@isopodlabs/binary';
|
|
2
|
-
declare const PT: {
|
|
3
|
-
readonly NULL: 0;
|
|
4
|
-
readonly LOAD: 1;
|
|
5
|
-
readonly DYNAMIC: 2;
|
|
6
|
-
readonly INTERP: 3;
|
|
7
|
-
readonly NOTE: 4;
|
|
8
|
-
readonly SHLIB: 5;
|
|
9
|
-
readonly PHDR: 6;
|
|
10
|
-
readonly TLS: 7;
|
|
11
|
-
readonly LOOS: 1610612736;
|
|
12
|
-
readonly UNWIND: 1684333904;
|
|
13
|
-
readonly EH_FRAME: 1685382480;
|
|
14
|
-
readonly GNU_STACK: 1685382481;
|
|
15
|
-
readonly GNU_RELRO: 1685382482;
|
|
16
|
-
readonly OS_SCE: 1879047936;
|
|
17
|
-
readonly HIOS: 1879048191;
|
|
18
|
-
readonly LOPROC: 1879048192;
|
|
19
|
-
readonly HIPROC: 2147483647;
|
|
20
|
-
};
|
|
21
|
-
declare const SHT: {
|
|
22
|
-
readonly NULL: 0;
|
|
23
|
-
readonly PROGBITS: 1;
|
|
24
|
-
readonly SYMTAB: 2;
|
|
25
|
-
readonly STRTAB: 3;
|
|
26
|
-
readonly RELA: 4;
|
|
27
|
-
readonly HASH: 5;
|
|
28
|
-
readonly DYNAMIC: 6;
|
|
29
|
-
readonly NOTE: 7;
|
|
30
|
-
readonly NOBITS: 8;
|
|
31
|
-
readonly REL: 9;
|
|
32
|
-
readonly SHLIB: 10;
|
|
33
|
-
readonly DYNSYM: 11;
|
|
34
|
-
readonly LOOS: 1610612736;
|
|
35
|
-
readonly HIOS: 1879048191;
|
|
36
|
-
readonly LOPROC: 1879048192;
|
|
37
|
-
readonly HIPROC: 2147483647;
|
|
38
|
-
readonly LOUSER: 2147483648;
|
|
39
|
-
readonly HIUSER: 4294967295;
|
|
40
|
-
readonly PS3_RELA: number;
|
|
41
|
-
};
|
|
42
|
-
export declare class ELFFile {
|
|
43
|
-
static check(data: Uint8Array): boolean;
|
|
44
|
-
segments: [string, {
|
|
45
|
-
data: binary.MappedMemory;
|
|
46
|
-
p_type: string;
|
|
47
|
-
p_flags: Record<string, bigint | boolean> | Record<string, number | boolean>;
|
|
48
|
-
p_offset: number | bigint;
|
|
49
|
-
p_vaddr: binary.hex<number | bigint>;
|
|
50
|
-
p_paddr: binary.hex<number | bigint>;
|
|
51
|
-
p_filesz: number | bigint;
|
|
52
|
-
p_memsz: number | bigint;
|
|
53
|
-
p_align: number | bigint;
|
|
54
|
-
}][];
|
|
55
|
-
sections: [string, {
|
|
56
|
-
data: binary.MappedMemory;
|
|
57
|
-
sh_name: number;
|
|
58
|
-
sh_type: string;
|
|
59
|
-
sh_flags: Record<string, bigint | boolean> | Record<string, number | boolean>;
|
|
60
|
-
sh_addr: binary.hex<number | bigint>;
|
|
61
|
-
sh_offset: number | bigint;
|
|
62
|
-
sh_size: number | bigint;
|
|
63
|
-
sh_link: number;
|
|
64
|
-
sh_info: number;
|
|
65
|
-
sh_addralign: number | bigint;
|
|
66
|
-
sh_entsize: number | bigint;
|
|
67
|
-
}][];
|
|
68
|
-
header: {
|
|
69
|
-
e_type: string;
|
|
70
|
-
e_machine: string;
|
|
71
|
-
e_version: string;
|
|
72
|
-
e_entry: binary.hex<number | bigint>;
|
|
73
|
-
e_phoff: number | bigint;
|
|
74
|
-
e_shoff: number | bigint;
|
|
75
|
-
e_flags: number;
|
|
76
|
-
e_ehsize: number;
|
|
77
|
-
e_phentsize: number;
|
|
78
|
-
e_phnum: number;
|
|
79
|
-
e_shentsize: number;
|
|
80
|
-
e_shnum: number;
|
|
81
|
-
e_shstrndx: number;
|
|
82
|
-
};
|
|
83
|
-
getDynamic: () => {
|
|
84
|
-
d_tag: string;
|
|
85
|
-
d_val: number | bigint;
|
|
86
|
-
}[] | undefined;
|
|
87
|
-
getRel: () => {
|
|
88
|
-
r_offset: binary.hex<number | bigint>;
|
|
89
|
-
r_info: never;
|
|
90
|
-
}[] | undefined;
|
|
91
|
-
getRelA: () => {
|
|
92
|
-
r_addend: number | bigint;
|
|
93
|
-
r_offset: binary.hex<number | bigint>;
|
|
94
|
-
r_info: never;
|
|
95
|
-
}[] | undefined;
|
|
96
|
-
getSymbols: () => [string, {
|
|
97
|
-
st_info: {
|
|
98
|
-
type: string;
|
|
99
|
-
binding: string;
|
|
100
|
-
};
|
|
101
|
-
st_other: {
|
|
102
|
-
visibility: string;
|
|
103
|
-
other: number | bigint;
|
|
104
|
-
};
|
|
105
|
-
st_shndx: string;
|
|
106
|
-
st_value: binary.hex<number | bigint>;
|
|
107
|
-
st_size: number | bigint;
|
|
108
|
-
data: binary.MappedMemory | undefined;
|
|
109
|
-
st_name: number;
|
|
110
|
-
}][] | undefined;
|
|
111
|
-
getDynamicSymbols: () => [string, {
|
|
112
|
-
st_info: {
|
|
113
|
-
type: string;
|
|
114
|
-
binding: string;
|
|
115
|
-
};
|
|
116
|
-
st_other: {
|
|
117
|
-
visibility: string;
|
|
118
|
-
other: number | bigint;
|
|
119
|
-
};
|
|
120
|
-
st_shndx: string;
|
|
121
|
-
st_value: binary.hex<number | bigint>;
|
|
122
|
-
st_size: number | bigint;
|
|
123
|
-
data: binary.MappedMemory | undefined;
|
|
124
|
-
st_name: number;
|
|
125
|
-
}][] | undefined;
|
|
126
|
-
constructor(data: Uint8Array);
|
|
127
|
-
getSegmentByType(type: keyof typeof PT): {
|
|
128
|
-
data: binary.MappedMemory;
|
|
129
|
-
p_type: string;
|
|
130
|
-
p_flags: Record<string, bigint | boolean> | Record<string, number | boolean>;
|
|
131
|
-
p_offset: number | bigint;
|
|
132
|
-
p_vaddr: binary.hex<number | bigint>;
|
|
133
|
-
p_paddr: binary.hex<number | bigint>;
|
|
134
|
-
p_filesz: number | bigint;
|
|
135
|
-
p_memsz: number | bigint;
|
|
136
|
-
p_align: number | bigint;
|
|
137
|
-
} | undefined;
|
|
138
|
-
getSectionByType(type: keyof typeof SHT): {
|
|
139
|
-
data: binary.MappedMemory;
|
|
140
|
-
sh_name: number;
|
|
141
|
-
sh_type: string;
|
|
142
|
-
sh_flags: Record<string, bigint | boolean> | Record<string, number | boolean>;
|
|
143
|
-
sh_addr: binary.hex<number | bigint>;
|
|
144
|
-
sh_offset: number | bigint;
|
|
145
|
-
sh_size: number | bigint;
|
|
146
|
-
sh_link: number;
|
|
147
|
-
sh_info: number;
|
|
148
|
-
sh_addralign: number | bigint;
|
|
149
|
-
sh_entsize: number | bigint;
|
|
150
|
-
} | undefined;
|
|
151
|
-
}
|
|
152
|
-
export {};
|
package/dist/mach.d copy.ts
DELETED
|
@@ -1,505 +0,0 @@
|
|
|
1
|
-
import * as binary from '@isopodlabs/binary';
|
|
2
|
-
declare class mach_stream extends binary.endianStream {
|
|
3
|
-
base: Uint8Array;
|
|
4
|
-
mem?: binary.memory | undefined;
|
|
5
|
-
constructor(base: Uint8Array, data: Uint8Array, be: boolean, mem?: binary.memory | undefined);
|
|
6
|
-
subdata(offset: number, size?: number): Uint8Array;
|
|
7
|
-
substream(offset: number, size?: number): mach_stream;
|
|
8
|
-
getmem(address: bigint, size: number): Uint8Array | Promise<Uint8Array> | undefined;
|
|
9
|
-
}
|
|
10
|
-
declare const fat_arch: {
|
|
11
|
-
cputype: binary.TypeT<string>;
|
|
12
|
-
cpusubtype: binary.TypeT<string | number>;
|
|
13
|
-
offset: binary.TypeT<number>;
|
|
14
|
-
size: binary.TypeT<number>;
|
|
15
|
-
align: binary.TypeT<number>;
|
|
16
|
-
contents: binary.TypeT<MachFile | undefined>;
|
|
17
|
-
};
|
|
18
|
-
export declare enum CMD {
|
|
19
|
-
SEGMENT = 1,// segment of this file to be mapped
|
|
20
|
-
SYMTAB = 2,// link-edit stab symbol table info
|
|
21
|
-
SYMSEG = 3,// link-edit gdb symbol table info (obsolete)
|
|
22
|
-
THREAD = 4,// thread
|
|
23
|
-
UNIXTHREAD = 5,// unix thread (includes a stack)
|
|
24
|
-
LOADFVMLIB = 6,// load a specified fixed VM shared library
|
|
25
|
-
IDFVMLIB = 7,// fixed VM shared library identification
|
|
26
|
-
FVMFILE = 9,// fixed VM file inclusion (internal use)
|
|
27
|
-
DYSYMTAB = 11,// dynamic link-edit symbol table info
|
|
28
|
-
LOAD_DYLIB = 12,// load a dynamically linked shared library
|
|
29
|
-
ID_DYLIB = 13,// dynamically linked shared lib ident
|
|
30
|
-
LOAD_DYLINKER = 14,// load a dynamic linker
|
|
31
|
-
ID_DYLINKER = 15,// dynamic linker identification
|
|
32
|
-
PREBOUND_DYLIB = 16,// modules prebound for a dynamically linked shared library
|
|
33
|
-
ROUTINES = 17,// image routines
|
|
34
|
-
SUB_FRAMEWORK = 18,// sub framework
|
|
35
|
-
SUB_UMBRELLA = 19,// sub umbrella
|
|
36
|
-
SUB_CLIENT = 20,// sub client
|
|
37
|
-
SUB_LIBRARY = 21,// sub library
|
|
38
|
-
TWOLEVEL_HINTS = 22,// two-level namespace lookup hints
|
|
39
|
-
PREBIND_CKSUM = 23,// prebind checksum
|
|
40
|
-
LOAD_WEAK_DYLIB = 2147483672,// load a dynamically linked shared library that is allowed to be missing (all symbols are weak imported).
|
|
41
|
-
SEGMENT_64 = 25,// 64-bit segment of this file to be mapped
|
|
42
|
-
ROUTINES_64 = 26,// 64-bit image routines
|
|
43
|
-
UUID = 27,// the uuid
|
|
44
|
-
RPATH = 2147483676,// runpath additions
|
|
45
|
-
CODE_SIGNATURE = 29,// local of code signature
|
|
46
|
-
SEGMENT_SPLIT_INFO = 30,// local of info to split segments
|
|
47
|
-
REEXPORT_DYLIB = 2147483679,// load and re-export dylib
|
|
48
|
-
LAZY_LOAD_DYLIB = 32,// delay load of dylib until first use
|
|
49
|
-
ENCRYPTION_INFO = 33,// encrypted segment information
|
|
50
|
-
DYLD_INFO = 34,// compressed dyld information
|
|
51
|
-
DYLD_INFO_ONLY = 2147483682,// compressed dyld information only
|
|
52
|
-
LOAD_UPWARD_DYLIB = 2147483683,// load upward dylib
|
|
53
|
-
VERSION_MIN_MACOSX = 36,// build for MacOSX min OS version
|
|
54
|
-
VERSION_MIN_IPHONEOS = 37,// build for iPhoneOS min OS version
|
|
55
|
-
FUNCTION_STARTS = 38,// compressed table of function start addresses
|
|
56
|
-
DYLD_ENVIRONMENT = 39,// string for dyld to treat like environment variable
|
|
57
|
-
MAIN = 2147483688,// replacement for LC_UNIXTHREAD
|
|
58
|
-
DATA_IN_CODE = 41,// table of non-instructions in __text
|
|
59
|
-
SOURCE_VERSION = 42,// source version used to build binary
|
|
60
|
-
DYLIB_CODE_SIGN_DRS = 43,// Code signing DRs copied from linked dylibs
|
|
61
|
-
ENCRYPTION_INFO_64 = 44,// 64-bit encrypted segment information
|
|
62
|
-
LINKER_OPTION = 45,// linker options in MH_OBJECT files
|
|
63
|
-
LINKER_OPTIMIZATION_HINT = 46,// optimization hints in MH_OBJECT files
|
|
64
|
-
VERSION_MIN_TVOS = 47,// build for AppleTV min OS version
|
|
65
|
-
VERSION_MIN_WATCHOS = 48,// build for Watch min OS version
|
|
66
|
-
NOTE = 49,// arbitrary data included within a Mach-O file
|
|
67
|
-
BUILD_VERSION = 50,// build for platform min OS version
|
|
68
|
-
DYLD_EXPORTS_TRIE = 2147483699,// used with linkedit_data_command, payload is trie
|
|
69
|
-
DYLD_CHAINED_FIXUPS = 2147483700
|
|
70
|
-
}
|
|
71
|
-
declare const cmd_table: {
|
|
72
|
-
1: {
|
|
73
|
-
get(s: mach_stream): {
|
|
74
|
-
data: binary.MappedMemory | undefined;
|
|
75
|
-
segname: string;
|
|
76
|
-
vmaddr: number;
|
|
77
|
-
vmsize: number;
|
|
78
|
-
fileoff: number;
|
|
79
|
-
filesize: number;
|
|
80
|
-
maxprot: number;
|
|
81
|
-
initprot: number;
|
|
82
|
-
nsects: number;
|
|
83
|
-
flags: Record<string, bigint | boolean> | Record<string, number | boolean>;
|
|
84
|
-
sections: Record<string, any> | undefined;
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
25: {
|
|
88
|
-
get(s: mach_stream): {
|
|
89
|
-
data: binary.MappedMemory | undefined;
|
|
90
|
-
segname: string;
|
|
91
|
-
vmaddr: bigint;
|
|
92
|
-
vmsize: bigint;
|
|
93
|
-
fileoff: bigint;
|
|
94
|
-
filesize: bigint;
|
|
95
|
-
maxprot: number;
|
|
96
|
-
initprot: number;
|
|
97
|
-
nsects: number;
|
|
98
|
-
flags: Record<string, bigint | boolean> | Record<string, number | boolean>;
|
|
99
|
-
sections: Record<string, any> | undefined;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
6: {
|
|
103
|
-
name: {
|
|
104
|
-
get(s: binary.stream): string;
|
|
105
|
-
};
|
|
106
|
-
minor_version: binary.TypeT<binary.hex<number | bigint>>;
|
|
107
|
-
header_addr: binary.TypeT<binary.hex<number | bigint>>;
|
|
108
|
-
};
|
|
109
|
-
7: {
|
|
110
|
-
name: {
|
|
111
|
-
get(s: binary.stream): string;
|
|
112
|
-
};
|
|
113
|
-
minor_version: binary.TypeT<binary.hex<number | bigint>>;
|
|
114
|
-
header_addr: binary.TypeT<binary.hex<number | bigint>>;
|
|
115
|
-
};
|
|
116
|
-
12: {
|
|
117
|
-
name: {
|
|
118
|
-
get(s: binary.stream): string;
|
|
119
|
-
};
|
|
120
|
-
timestamp: binary.TypeT<number>;
|
|
121
|
-
current_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
122
|
-
compatibility_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
123
|
-
};
|
|
124
|
-
13: {
|
|
125
|
-
name: {
|
|
126
|
-
get(s: binary.stream): string;
|
|
127
|
-
};
|
|
128
|
-
timestamp: binary.TypeT<number>;
|
|
129
|
-
current_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
130
|
-
compatibility_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
131
|
-
};
|
|
132
|
-
2147483672: {
|
|
133
|
-
name: {
|
|
134
|
-
get(s: binary.stream): string;
|
|
135
|
-
};
|
|
136
|
-
timestamp: binary.TypeT<number>;
|
|
137
|
-
current_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
138
|
-
compatibility_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
139
|
-
};
|
|
140
|
-
2147483679: {
|
|
141
|
-
name: {
|
|
142
|
-
get(s: binary.stream): string;
|
|
143
|
-
};
|
|
144
|
-
timestamp: binary.TypeT<number>;
|
|
145
|
-
current_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
146
|
-
compatibility_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
147
|
-
};
|
|
148
|
-
32: {
|
|
149
|
-
name: {
|
|
150
|
-
get(s: binary.stream): string;
|
|
151
|
-
};
|
|
152
|
-
timestamp: binary.TypeT<number>;
|
|
153
|
-
current_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
154
|
-
compatibility_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
155
|
-
};
|
|
156
|
-
2147483683: {
|
|
157
|
-
name: {
|
|
158
|
-
get(s: binary.stream): string;
|
|
159
|
-
};
|
|
160
|
-
timestamp: binary.TypeT<number>;
|
|
161
|
-
current_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
162
|
-
compatibility_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
163
|
-
};
|
|
164
|
-
18: {
|
|
165
|
-
get(s: binary.stream): string;
|
|
166
|
-
};
|
|
167
|
-
19: {
|
|
168
|
-
get(s: binary.stream): string;
|
|
169
|
-
};
|
|
170
|
-
20: {
|
|
171
|
-
get(s: binary.stream): string;
|
|
172
|
-
};
|
|
173
|
-
21: {
|
|
174
|
-
get(s: binary.stream): string;
|
|
175
|
-
};
|
|
176
|
-
14: {
|
|
177
|
-
get(s: binary.stream): string;
|
|
178
|
-
};
|
|
179
|
-
15: {
|
|
180
|
-
get(s: binary.stream): string;
|
|
181
|
-
};
|
|
182
|
-
39: {
|
|
183
|
-
get(s: binary.stream): string;
|
|
184
|
-
};
|
|
185
|
-
2147483676: {
|
|
186
|
-
get(s: binary.stream): string;
|
|
187
|
-
};
|
|
188
|
-
16: {
|
|
189
|
-
name: {
|
|
190
|
-
get(s: binary.stream): string;
|
|
191
|
-
};
|
|
192
|
-
nmodules: binary.TypeT<number>;
|
|
193
|
-
linked_modules: {
|
|
194
|
-
get(s: binary.stream): string;
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
|
-
4: {
|
|
198
|
-
flavor: binary.TypeT<number>;
|
|
199
|
-
count: binary.TypeT<number>;
|
|
200
|
-
};
|
|
201
|
-
5: {
|
|
202
|
-
flavor: binary.TypeT<number>;
|
|
203
|
-
count: binary.TypeT<number>;
|
|
204
|
-
};
|
|
205
|
-
17: {
|
|
206
|
-
init_address: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
207
|
-
init_module: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
208
|
-
reserved1: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
209
|
-
reserved2: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
210
|
-
reserved3: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
211
|
-
reserved4: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
212
|
-
reserved5: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
213
|
-
reserved6: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
214
|
-
};
|
|
215
|
-
26: {
|
|
216
|
-
init_address: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
217
|
-
init_module: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
218
|
-
reserved1: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
219
|
-
reserved2: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
220
|
-
reserved3: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
221
|
-
reserved4: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
222
|
-
reserved5: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
223
|
-
reserved6: binary.TypeT<bigint> | binary.TypeT<number>;
|
|
224
|
-
};
|
|
225
|
-
2: {
|
|
226
|
-
get(s: binary._stream): (string | {
|
|
227
|
-
strx: number;
|
|
228
|
-
flags: {
|
|
229
|
-
ext: number | bigint;
|
|
230
|
-
type: string;
|
|
231
|
-
pext: number | bigint;
|
|
232
|
-
stab: string;
|
|
233
|
-
};
|
|
234
|
-
sect: number;
|
|
235
|
-
desc: {
|
|
236
|
-
ref: string;
|
|
237
|
-
flags: Record<string, bigint | boolean> | Record<string, number | boolean>;
|
|
238
|
-
align: number | bigint;
|
|
239
|
-
};
|
|
240
|
-
value: number | bigint;
|
|
241
|
-
})[][] | undefined;
|
|
242
|
-
};
|
|
243
|
-
22: {
|
|
244
|
-
get(s: mach_stream): {
|
|
245
|
-
sub_image: number | bigint;
|
|
246
|
-
toc: number | bigint;
|
|
247
|
-
}[] | undefined;
|
|
248
|
-
};
|
|
249
|
-
23: {
|
|
250
|
-
cksum: binary.TypeT<number>;
|
|
251
|
-
};
|
|
252
|
-
27: {
|
|
253
|
-
uuid: binary.TypeT<Uint8Array>;
|
|
254
|
-
};
|
|
255
|
-
29: {
|
|
256
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
257
|
-
};
|
|
258
|
-
30: {
|
|
259
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
260
|
-
};
|
|
261
|
-
38: {
|
|
262
|
-
get(s: mach_stream): {
|
|
263
|
-
data: Uint8Array;
|
|
264
|
-
contents: (number | bigint)[];
|
|
265
|
-
};
|
|
266
|
-
};
|
|
267
|
-
41: {
|
|
268
|
-
get(s: mach_stream): {
|
|
269
|
-
data: Uint8Array;
|
|
270
|
-
contents: {
|
|
271
|
-
offset: binary.hex<number | bigint>;
|
|
272
|
-
length: number;
|
|
273
|
-
kind: string;
|
|
274
|
-
}[];
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
43: {
|
|
278
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
279
|
-
};
|
|
280
|
-
46: {
|
|
281
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
282
|
-
};
|
|
283
|
-
2147483699: {
|
|
284
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
285
|
-
};
|
|
286
|
-
2147483700: {
|
|
287
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
288
|
-
};
|
|
289
|
-
33: {
|
|
290
|
-
cryptoff: binary.TypeT<number>;
|
|
291
|
-
cryptsize: binary.TypeT<number>;
|
|
292
|
-
cryptid: binary.TypeT<number>;
|
|
293
|
-
};
|
|
294
|
-
44: {
|
|
295
|
-
cryptoff: binary.TypeT<number>;
|
|
296
|
-
cryptsize: binary.TypeT<number>;
|
|
297
|
-
cryptid: binary.TypeT<number>;
|
|
298
|
-
pad: binary.TypeT<number>;
|
|
299
|
-
};
|
|
300
|
-
36: {
|
|
301
|
-
version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
302
|
-
reserved: binary.TypeT<number>;
|
|
303
|
-
};
|
|
304
|
-
37: {
|
|
305
|
-
version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
306
|
-
reserved: binary.TypeT<number>;
|
|
307
|
-
};
|
|
308
|
-
47: {
|
|
309
|
-
version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
310
|
-
reserved: binary.TypeT<number>;
|
|
311
|
-
};
|
|
312
|
-
48: {
|
|
313
|
-
version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
314
|
-
reserved: binary.TypeT<number>;
|
|
315
|
-
};
|
|
316
|
-
34: {
|
|
317
|
-
rebase: {
|
|
318
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
319
|
-
};
|
|
320
|
-
bind: {
|
|
321
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
322
|
-
};
|
|
323
|
-
weak_bind: {
|
|
324
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
325
|
-
};
|
|
326
|
-
lazy_bind: {
|
|
327
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
328
|
-
};
|
|
329
|
-
exprt: {
|
|
330
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
331
|
-
};
|
|
332
|
-
};
|
|
333
|
-
2147483682: {
|
|
334
|
-
rebase: {
|
|
335
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
336
|
-
};
|
|
337
|
-
bind: {
|
|
338
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
339
|
-
};
|
|
340
|
-
weak_bind: {
|
|
341
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
342
|
-
};
|
|
343
|
-
lazy_bind: {
|
|
344
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
345
|
-
};
|
|
346
|
-
exprt: {
|
|
347
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
348
|
-
};
|
|
349
|
-
};
|
|
350
|
-
3: {
|
|
351
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
352
|
-
};
|
|
353
|
-
9: {
|
|
354
|
-
name: {
|
|
355
|
-
get(s: binary.stream): string;
|
|
356
|
-
};
|
|
357
|
-
header_addr: binary.TypeT<number>;
|
|
358
|
-
};
|
|
359
|
-
2147483688: {
|
|
360
|
-
entryoff: binary.TypeT<number>;
|
|
361
|
-
stacksize: binary.TypeT<number>;
|
|
362
|
-
};
|
|
363
|
-
42: {
|
|
364
|
-
version: binary.TypeT<{
|
|
365
|
-
a: number | bigint;
|
|
366
|
-
b: number | bigint;
|
|
367
|
-
c: number | bigint;
|
|
368
|
-
d: number | bigint;
|
|
369
|
-
e: number | bigint;
|
|
370
|
-
}>;
|
|
371
|
-
};
|
|
372
|
-
50: {
|
|
373
|
-
platform: binary.TypeT<string>;
|
|
374
|
-
minos: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
375
|
-
sdk: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
376
|
-
tools: binary.TypeT<Record<string, {
|
|
377
|
-
tool: string;
|
|
378
|
-
version: Record<string, bigint | boolean> | Record<string, number | boolean>;
|
|
379
|
-
}>>;
|
|
380
|
-
};
|
|
381
|
-
45: {
|
|
382
|
-
count: binary.TypeT<number>;
|
|
383
|
-
};
|
|
384
|
-
49: {
|
|
385
|
-
data_owner: binary.TypeT<string>;
|
|
386
|
-
data: {
|
|
387
|
-
get(s: mach_stream): Uint8Array | undefined;
|
|
388
|
-
};
|
|
389
|
-
};
|
|
390
|
-
11: {
|
|
391
|
-
localsym: {
|
|
392
|
-
first: binary.TypeT<number>;
|
|
393
|
-
count: binary.TypeT<number>;
|
|
394
|
-
};
|
|
395
|
-
extdefsym: {
|
|
396
|
-
first: binary.TypeT<number>;
|
|
397
|
-
count: binary.TypeT<number>;
|
|
398
|
-
};
|
|
399
|
-
undefsym: {
|
|
400
|
-
first: binary.TypeT<number>;
|
|
401
|
-
count: binary.TypeT<number>;
|
|
402
|
-
};
|
|
403
|
-
toc: {
|
|
404
|
-
get(s: mach_stream): {
|
|
405
|
-
symbol_index: number;
|
|
406
|
-
module_index: number;
|
|
407
|
-
}[] | undefined;
|
|
408
|
-
};
|
|
409
|
-
modtab: {
|
|
410
|
-
get(s: mach_stream): ({
|
|
411
|
-
objc_module_info_addr: number;
|
|
412
|
-
objc_module_info_size: number;
|
|
413
|
-
module_name: number;
|
|
414
|
-
extdefsym: never;
|
|
415
|
-
refsym: never;
|
|
416
|
-
localsym: never;
|
|
417
|
-
extrel: never;
|
|
418
|
-
init_iterm: never;
|
|
419
|
-
} | {
|
|
420
|
-
objc_module_info_size: number;
|
|
421
|
-
objc_module_info_addr: bigint;
|
|
422
|
-
module_name: number;
|
|
423
|
-
extdefsym: never;
|
|
424
|
-
refsym: never;
|
|
425
|
-
localsym: never;
|
|
426
|
-
extrel: never;
|
|
427
|
-
init_iterm: never;
|
|
428
|
-
})[] | undefined;
|
|
429
|
-
};
|
|
430
|
-
extrefsym: {
|
|
431
|
-
get(s: mach_stream): {
|
|
432
|
-
symbol_index: number | bigint;
|
|
433
|
-
flags: number | bigint;
|
|
434
|
-
}[] | undefined;
|
|
435
|
-
};
|
|
436
|
-
indirectsym: {
|
|
437
|
-
get(s: mach_stream): {
|
|
438
|
-
symbol_index: number | bigint;
|
|
439
|
-
flags: number | bigint;
|
|
440
|
-
}[] | undefined;
|
|
441
|
-
};
|
|
442
|
-
extrel: {
|
|
443
|
-
get(s: mach_stream): {
|
|
444
|
-
address: number;
|
|
445
|
-
symbol_ref: {
|
|
446
|
-
symbol_index: number | bigint;
|
|
447
|
-
flags: number | bigint;
|
|
448
|
-
};
|
|
449
|
-
}[] | undefined;
|
|
450
|
-
};
|
|
451
|
-
locrel: {
|
|
452
|
-
get(s: mach_stream): {
|
|
453
|
-
address: number;
|
|
454
|
-
symbol_ref: {
|
|
455
|
-
symbol_index: number | bigint;
|
|
456
|
-
flags: number | bigint;
|
|
457
|
-
};
|
|
458
|
-
}[] | undefined;
|
|
459
|
-
};
|
|
460
|
-
};
|
|
461
|
-
};
|
|
462
|
-
export declare class MachFile {
|
|
463
|
-
header: any;
|
|
464
|
-
commands: {
|
|
465
|
-
cmd: CMD;
|
|
466
|
-
data: any;
|
|
467
|
-
}[];
|
|
468
|
-
ready: Promise<void>;
|
|
469
|
-
static check(data: Uint8Array): boolean;
|
|
470
|
-
constructor(data: Uint8Array, mem?: binary.memory);
|
|
471
|
-
load(data: Uint8Array, be: boolean, bits: 32 | 64, mem?: binary.memory): Promise<void>;
|
|
472
|
-
getCommand<T extends CMD>(cmd: T): binary.ReadType<typeof cmd_table[T]>;
|
|
473
|
-
getSegment(name: string): {
|
|
474
|
-
data: binary.MappedMemory | undefined;
|
|
475
|
-
segname: string;
|
|
476
|
-
vmaddr: number;
|
|
477
|
-
vmsize: number;
|
|
478
|
-
fileoff: number;
|
|
479
|
-
filesize: number;
|
|
480
|
-
maxprot: number;
|
|
481
|
-
initprot: number;
|
|
482
|
-
nsects: number;
|
|
483
|
-
flags: Record<string, bigint | boolean> | Record<string, number | boolean>;
|
|
484
|
-
sections: Record<string, any> | undefined;
|
|
485
|
-
} | {
|
|
486
|
-
data: binary.MappedMemory | undefined;
|
|
487
|
-
segname: string;
|
|
488
|
-
vmaddr: bigint;
|
|
489
|
-
vmsize: bigint;
|
|
490
|
-
fileoff: bigint;
|
|
491
|
-
filesize: bigint;
|
|
492
|
-
maxprot: number;
|
|
493
|
-
initprot: number;
|
|
494
|
-
nsects: number;
|
|
495
|
-
flags: Record<string, bigint | boolean> | Record<string, number | boolean>;
|
|
496
|
-
sections: Record<string, any> | undefined;
|
|
497
|
-
} | undefined;
|
|
498
|
-
}
|
|
499
|
-
export declare class FATMachFile {
|
|
500
|
-
archs: binary.ReadType<typeof fat_arch>[];
|
|
501
|
-
static check(data: Uint8Array): boolean;
|
|
502
|
-
constructor(data: Uint8Array, mem?: binary.memory);
|
|
503
|
-
load(file: binary.endianStream, mem?: binary.memory): void;
|
|
504
|
-
}
|
|
505
|
-
export {};
|
package/dist/pe.d copy.ts
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import * as binary from '@isopodlabs/binary';
|
|
2
|
-
declare const DOS_HEADER: {
|
|
3
|
-
magic: binary.TypeT<number>;
|
|
4
|
-
cblp: binary.TypeT<number>;
|
|
5
|
-
cp: binary.TypeT<number>;
|
|
6
|
-
crlc: binary.TypeT<number>;
|
|
7
|
-
cparhdr: binary.TypeT<number>;
|
|
8
|
-
minalloc: binary.TypeT<number>;
|
|
9
|
-
maxalloc: binary.TypeT<binary.hex<number | bigint>>;
|
|
10
|
-
ss: binary.TypeT<number>;
|
|
11
|
-
sp: binary.TypeT<number>;
|
|
12
|
-
csum: binary.TypeT<number>;
|
|
13
|
-
ip: binary.TypeT<number>;
|
|
14
|
-
cs: binary.TypeT<number>;
|
|
15
|
-
lfarlc: binary.TypeT<number>;
|
|
16
|
-
ovno: binary.TypeT<number>;
|
|
17
|
-
};
|
|
18
|
-
declare const EXE_HEADER: {
|
|
19
|
-
res: binary.TypeT<number[]>;
|
|
20
|
-
oemid: binary.TypeT<number>;
|
|
21
|
-
oeminfo: binary.TypeT<number>;
|
|
22
|
-
res2: binary.TypeT<number[]>;
|
|
23
|
-
lfanew: binary.TypeT<number>;
|
|
24
|
-
};
|
|
25
|
-
export declare class pe_stream extends binary.stream {
|
|
26
|
-
pe: PE;
|
|
27
|
-
constructor(pe: PE, data: Uint8Array);
|
|
28
|
-
get_rva(): Uint8Array | undefined;
|
|
29
|
-
}
|
|
30
|
-
declare const Section_base: (new (s: binary._stream) => {
|
|
31
|
-
Name: string;
|
|
32
|
-
VirtualSize: number;
|
|
33
|
-
VirtualAddress: binary.hex<number | bigint>;
|
|
34
|
-
SizeOfRawData: number;
|
|
35
|
-
PointerToRawData: binary.hex<number | bigint>;
|
|
36
|
-
PointerToRelocations: binary.hex<number | bigint>;
|
|
37
|
-
PointerToLinenumbers: binary.hex<number | bigint>;
|
|
38
|
-
NumberOfRelocations: number;
|
|
39
|
-
NumberOfLinenumbers: number;
|
|
40
|
-
Characteristics: Record<string, bigint | boolean> | Record<string, number | boolean>;
|
|
41
|
-
}) & {
|
|
42
|
-
get: <X extends abstract new (...args: any) => any>(this: X, s: binary._stream) => InstanceType<X>;
|
|
43
|
-
};
|
|
44
|
-
declare class Section extends Section_base {
|
|
45
|
-
data?: binary.MappedMemory;
|
|
46
|
-
constructor(r: binary.stream);
|
|
47
|
-
get flags(): number;
|
|
48
|
-
}
|
|
49
|
-
interface DirectoryInfo {
|
|
50
|
-
read?: (pe: PE, data: binary.MappedMemory) => any;
|
|
51
|
-
}
|
|
52
|
-
export declare const DIRECTORIES: Record<string, DirectoryInfo>;
|
|
53
|
-
export declare const DATA_DIRECTORY: {
|
|
54
|
-
VirtualAddress: binary.TypeT<number>;
|
|
55
|
-
Size: binary.TypeT<number>;
|
|
56
|
-
};
|
|
57
|
-
type Directory = binary.ReadType<typeof DATA_DIRECTORY>;
|
|
58
|
-
declare const OPTIONAL_HEADER: {
|
|
59
|
-
Magic: binary.TypeT<string>;
|
|
60
|
-
MajorLinkerVersion: binary.TypeT<number>;
|
|
61
|
-
MinorLinkerVersion: binary.TypeT<number>;
|
|
62
|
-
SizeOfCode: binary.TypeT<number>;
|
|
63
|
-
SizeOfInitializedData: binary.TypeT<number>;
|
|
64
|
-
SizeOfUninitializedData: binary.TypeT<number>;
|
|
65
|
-
AddressOfEntryPoint: binary.TypeT<binary.hex<number | bigint>>;
|
|
66
|
-
BaseOfCode: binary.TypeT<binary.hex<number | bigint>>;
|
|
67
|
-
};
|
|
68
|
-
declare const OPTIONAL_HEADER32: {
|
|
69
|
-
BaseOfData: binary.TypeT<binary.hex<number | bigint>>;
|
|
70
|
-
ImageBase: binary.TypeT<binary.hex<number | bigint>>;
|
|
71
|
-
SectionAlignment: binary.TypeT<number>;
|
|
72
|
-
FileAlignment: binary.TypeT<number>;
|
|
73
|
-
MajorOperatingSystemVersion: binary.TypeT<number>;
|
|
74
|
-
MinorOperatingSystemVersion: binary.TypeT<number>;
|
|
75
|
-
MajorImageVersion: binary.TypeT<number>;
|
|
76
|
-
MinorImageVersion: binary.TypeT<number>;
|
|
77
|
-
MajorSubsystemVersion: binary.TypeT<number>;
|
|
78
|
-
MinorSubsystemVersion: binary.TypeT<number>;
|
|
79
|
-
Win32VersionValue: binary.TypeT<number>;
|
|
80
|
-
SizeOfImage: binary.TypeT<number>;
|
|
81
|
-
SizeOfHeaders: binary.TypeT<number>;
|
|
82
|
-
CheckSum: binary.TypeT<number>;
|
|
83
|
-
Subsystem: binary.TypeT<number>;
|
|
84
|
-
DllCharacteristics: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
85
|
-
SizeOfStackReserve: binary.TypeT<number>;
|
|
86
|
-
SizeOfStackCommit: binary.TypeT<number>;
|
|
87
|
-
SizeOfHeapReserve: binary.TypeT<number>;
|
|
88
|
-
SizeOfHeapCommit: binary.TypeT<number>;
|
|
89
|
-
LoaderFlags: binary.TypeT<number>;
|
|
90
|
-
DataDirectory: binary.TypeT<Record<string, {
|
|
91
|
-
VirtualAddress: number;
|
|
92
|
-
Size: number;
|
|
93
|
-
}>>;
|
|
94
|
-
};
|
|
95
|
-
declare const OPTIONAL_HEADER64: {
|
|
96
|
-
ImageBase: binary.TypeT<binary.hex<number | bigint>>;
|
|
97
|
-
SectionAlignment: binary.TypeT<number>;
|
|
98
|
-
FileAlignment: binary.TypeT<number>;
|
|
99
|
-
MajorOperatingSystemVersion: binary.TypeT<number>;
|
|
100
|
-
MinorOperatingSystemVersion: binary.TypeT<number>;
|
|
101
|
-
MajorImageVersion: binary.TypeT<number>;
|
|
102
|
-
MinorImageVersion: binary.TypeT<number>;
|
|
103
|
-
MajorSubsystemVersion: binary.TypeT<number>;
|
|
104
|
-
MinorSubsystemVersion: binary.TypeT<number>;
|
|
105
|
-
Win32VersionValue: binary.TypeT<number>;
|
|
106
|
-
SizeOfImage: binary.TypeT<number>;
|
|
107
|
-
SizeOfHeaders: binary.TypeT<number>;
|
|
108
|
-
CheckSum: binary.TypeT<number>;
|
|
109
|
-
Subsystem: binary.TypeT<number>;
|
|
110
|
-
DllCharacteristics: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
|
|
111
|
-
SizeOfStackReserve: binary.TypeT<bigint>;
|
|
112
|
-
SizeOfStackCommit: binary.TypeT<bigint>;
|
|
113
|
-
SizeOfHeapReserve: binary.TypeT<bigint>;
|
|
114
|
-
SizeOfHeapCommit: binary.TypeT<bigint>;
|
|
115
|
-
LoaderFlags: binary.TypeT<number>;
|
|
116
|
-
DataDirectory: binary.TypeT<Record<string, {
|
|
117
|
-
VirtualAddress: number;
|
|
118
|
-
Size: number;
|
|
119
|
-
}>>;
|
|
120
|
-
};
|
|
121
|
-
export declare class PE {
|
|
122
|
-
private data;
|
|
123
|
-
header: binary.ReadType<typeof DOS_HEADER> & binary.ReadType<typeof EXE_HEADER>;
|
|
124
|
-
opt?: binary.ReadType<typeof OPTIONAL_HEADER> & (binary.ReadType<typeof OPTIONAL_HEADER32> | binary.ReadType<typeof OPTIONAL_HEADER64>);
|
|
125
|
-
sections: Section[];
|
|
126
|
-
static check(data: Uint8Array): boolean;
|
|
127
|
-
constructor(data: Uint8Array);
|
|
128
|
-
get directories(): Record<string, {
|
|
129
|
-
VirtualAddress: number;
|
|
130
|
-
Size: number;
|
|
131
|
-
}> | undefined;
|
|
132
|
-
FindSectionRVA(rva: number): Section | undefined;
|
|
133
|
-
FindSectionRaw(addr: number): Section | undefined;
|
|
134
|
-
GetDataRVA(rva: number, size?: number): binary.MappedMemory | undefined;
|
|
135
|
-
GetDataRaw(addr: number, size: number): Uint8Array | undefined;
|
|
136
|
-
GetDataDir(dir: Directory): binary.MappedMemory | undefined;
|
|
137
|
-
ReadDirectory(name: string): any;
|
|
138
|
-
}
|
|
139
|
-
export declare function ReadExports(file: pe_stream): (string | number | binary.MappedMemory | undefined)[][];
|
|
140
|
-
export declare class DLLImports extends Array {
|
|
141
|
-
}
|
|
142
|
-
export declare function ReadImports(file: pe_stream): [string, any][];
|
|
143
|
-
export declare function ReadResourceDirectory(file: binary.stream, data: binary.MappedMemory, type?: number): Record<string, any>;
|
|
144
|
-
export {};
|