@isopodlabs/binary_libs 1.2.0 → 1.3.0

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/mach.d.ts CHANGED
@@ -1,29 +1,29 @@
1
- import * as binary from '@isopodlabs/binary';
2
- declare class mach_stream extends binary.endianStream {
1
+ import * as bin from '@isopodlabs/binary';
2
+ declare class mach_stream extends bin.endianStream {
3
3
  base: Uint8Array;
4
4
  memflags: number;
5
- mem?: binary.memory | undefined;
6
- constructor(base: Uint8Array, data: Uint8Array, be: boolean, memflags: number, mem?: binary.memory | undefined);
5
+ mem?: bin.memory | undefined;
6
+ constructor(base: Uint8Array, data: Uint8Array, be: boolean, memflags: number, mem?: bin.memory | undefined);
7
7
  subdata(offset: number, size?: number): Uint8Array;
8
8
  substream(offset: number, size?: number): mach_stream;
9
9
  getmem(address: bigint, size: number): Uint8Array | Promise<Uint8Array> | undefined;
10
10
  }
11
11
  declare const header: {
12
- magic: binary.TypeT<number>;
13
- cputype: binary.TypeT<string>;
14
- cpusubtype: binary.TypeT<string | number>;
15
- filetype: binary.TypeT<string>;
16
- ncmds: binary.TypeT<number>;
17
- sizeofcmds: binary.TypeT<number>;
18
- flags: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
12
+ magic: bin.TypeT<number>;
13
+ cputype: bin.TypeT<string>;
14
+ cpusubtype: bin.TypeT<string | number>;
15
+ filetype: bin.TypeT<string>;
16
+ ncmds: bin.TypeT<number>;
17
+ sizeofcmds: bin.TypeT<number>;
18
+ flags: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
19
19
  };
20
20
  declare const fat_arch: {
21
- cputype: binary.TypeT<string>;
22
- cpusubtype: binary.TypeT<string | number>;
23
- offset: binary.TypeT<number>;
24
- size: binary.TypeT<number>;
25
- align: binary.TypeT<number>;
26
- contents: binary.TypeT<MachFile | undefined>;
21
+ cputype: bin.TypeT<string>;
22
+ cpusubtype: bin.TypeT<string | number>;
23
+ offset: bin.TypeT<number>;
24
+ size: bin.TypeT<number>;
25
+ align: bin.TypeT<number>;
26
+ contents: bin.TypeT<MachFile | undefined>;
27
27
  };
28
28
  export declare enum CMD {
29
29
  SEGMENT = 1,// segment of this file to be mapped
@@ -81,12 +81,12 @@ export declare enum CMD {
81
81
  declare const cmd_table: {
82
82
  1: {
83
83
  get(s: mach_stream): {
84
- data: binary.MappedMemory | undefined;
84
+ data: bin.MappedMemory | undefined;
85
85
  segname: string;
86
- vmaddr: binary.hex<number | bigint>;
87
- vmsize: binary.hex<number | bigint>;
88
- fileoff: binary.hex<number | bigint>;
89
- filesize: binary.hex<number | bigint>;
86
+ vmaddr: bin.hex<number | bigint>;
87
+ vmsize: bin.hex<number | bigint>;
88
+ fileoff: bin.hex<number | bigint>;
89
+ filesize: bin.hex<number | bigint>;
90
90
  maxprot: number;
91
91
  initprot: number;
92
92
  nsects: number;
@@ -96,12 +96,12 @@ declare const cmd_table: {
96
96
  };
97
97
  25: {
98
98
  get(s: mach_stream): {
99
- data: binary.MappedMemory | undefined;
99
+ data: bin.MappedMemory | undefined;
100
100
  segname: string;
101
- vmaddr: binary.hex<number | bigint>;
102
- vmsize: binary.hex<number | bigint>;
103
- fileoff: binary.hex<number | bigint>;
104
- filesize: binary.hex<number | bigint>;
101
+ vmaddr: bin.hex<number | bigint>;
102
+ vmsize: bin.hex<number | bigint>;
103
+ fileoff: bin.hex<number | bigint>;
104
+ filesize: bin.hex<number | bigint>;
105
105
  maxprot: number;
106
106
  initprot: number;
107
107
  nsects: number;
@@ -111,129 +111,129 @@ declare const cmd_table: {
111
111
  };
112
112
  6: {
113
113
  name: {
114
- get(s: binary.stream): string;
114
+ get(s: bin.stream): string;
115
115
  };
116
- minor_version: binary.TypeT<binary.hex<number | bigint>>;
117
- header_addr: binary.TypeT<binary.hex<number | bigint>>;
116
+ minor_version: bin.TypeT<bin.hex<number | bigint>>;
117
+ header_addr: bin.TypeT<bin.hex<number | bigint>>;
118
118
  };
119
119
  7: {
120
120
  name: {
121
- get(s: binary.stream): string;
121
+ get(s: bin.stream): string;
122
122
  };
123
- minor_version: binary.TypeT<binary.hex<number | bigint>>;
124
- header_addr: binary.TypeT<binary.hex<number | bigint>>;
123
+ minor_version: bin.TypeT<bin.hex<number | bigint>>;
124
+ header_addr: bin.TypeT<bin.hex<number | bigint>>;
125
125
  };
126
126
  12: {
127
127
  name: {
128
- get(s: binary.stream): string;
128
+ get(s: bin.stream): string;
129
129
  };
130
- timestamp: binary.TypeT<number>;
131
- current_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
132
- compatibility_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
130
+ timestamp: bin.TypeT<number>;
131
+ current_version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
132
+ compatibility_version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
133
133
  };
134
134
  13: {
135
135
  name: {
136
- get(s: binary.stream): string;
136
+ get(s: bin.stream): string;
137
137
  };
138
- timestamp: binary.TypeT<number>;
139
- current_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
140
- compatibility_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
138
+ timestamp: bin.TypeT<number>;
139
+ current_version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
140
+ compatibility_version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
141
141
  };
142
142
  2147483672: {
143
143
  name: {
144
- get(s: binary.stream): string;
144
+ get(s: bin.stream): string;
145
145
  };
146
- timestamp: binary.TypeT<number>;
147
- current_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
148
- compatibility_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
146
+ timestamp: bin.TypeT<number>;
147
+ current_version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
148
+ compatibility_version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
149
149
  };
150
150
  2147483679: {
151
151
  name: {
152
- get(s: binary.stream): string;
152
+ get(s: bin.stream): string;
153
153
  };
154
- timestamp: binary.TypeT<number>;
155
- current_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
156
- compatibility_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
154
+ timestamp: bin.TypeT<number>;
155
+ current_version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
156
+ compatibility_version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
157
157
  };
158
158
  32: {
159
159
  name: {
160
- get(s: binary.stream): string;
160
+ get(s: bin.stream): string;
161
161
  };
162
- timestamp: binary.TypeT<number>;
163
- current_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
164
- compatibility_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
162
+ timestamp: bin.TypeT<number>;
163
+ current_version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
164
+ compatibility_version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
165
165
  };
166
166
  2147483683: {
167
167
  name: {
168
- get(s: binary.stream): string;
168
+ get(s: bin.stream): string;
169
169
  };
170
- timestamp: binary.TypeT<number>;
171
- current_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
172
- compatibility_version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
170
+ timestamp: bin.TypeT<number>;
171
+ current_version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
172
+ compatibility_version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
173
173
  };
174
174
  18: {
175
- get(s: binary.stream): string;
175
+ get(s: bin.stream): string;
176
176
  };
177
177
  19: {
178
- get(s: binary.stream): string;
178
+ get(s: bin.stream): string;
179
179
  };
180
180
  20: {
181
- get(s: binary.stream): string;
181
+ get(s: bin.stream): string;
182
182
  };
183
183
  21: {
184
- get(s: binary.stream): string;
184
+ get(s: bin.stream): string;
185
185
  };
186
186
  14: {
187
- get(s: binary.stream): string;
187
+ get(s: bin.stream): string;
188
188
  };
189
189
  15: {
190
- get(s: binary.stream): string;
190
+ get(s: bin.stream): string;
191
191
  };
192
192
  39: {
193
- get(s: binary.stream): string;
193
+ get(s: bin.stream): string;
194
194
  };
195
195
  2147483676: {
196
- get(s: binary.stream): string;
196
+ get(s: bin.stream): string;
197
197
  };
198
198
  16: {
199
199
  name: {
200
- get(s: binary.stream): string;
200
+ get(s: bin.stream): string;
201
201
  };
202
- nmodules: binary.TypeT<number>;
202
+ nmodules: bin.TypeT<number>;
203
203
  linked_modules: {
204
- get(s: binary.stream): string;
204
+ get(s: bin.stream): string;
205
205
  };
206
206
  };
207
207
  4: {
208
- flavor: binary.TypeT<number>;
209
- count: binary.TypeT<number>;
208
+ flavor: bin.TypeT<number>;
209
+ count: bin.TypeT<number>;
210
210
  };
211
211
  5: {
212
- flavor: binary.TypeT<number>;
213
- count: binary.TypeT<number>;
212
+ flavor: bin.TypeT<number>;
213
+ count: bin.TypeT<number>;
214
214
  };
215
215
  17: {
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>;
216
+ init_address: bin.TypeT<number> | bin.TypeT<bigint>;
217
+ init_module: bin.TypeT<number> | bin.TypeT<bigint>;
218
+ reserved1: bin.TypeT<number> | bin.TypeT<bigint>;
219
+ reserved2: bin.TypeT<number> | bin.TypeT<bigint>;
220
+ reserved3: bin.TypeT<number> | bin.TypeT<bigint>;
221
+ reserved4: bin.TypeT<number> | bin.TypeT<bigint>;
222
+ reserved5: bin.TypeT<number> | bin.TypeT<bigint>;
223
+ reserved6: bin.TypeT<number> | bin.TypeT<bigint>;
224
224
  };
225
225
  26: {
226
- init_address: binary.TypeT<bigint> | binary.TypeT<number>;
227
- init_module: binary.TypeT<bigint> | binary.TypeT<number>;
228
- reserved1: binary.TypeT<bigint> | binary.TypeT<number>;
229
- reserved2: binary.TypeT<bigint> | binary.TypeT<number>;
230
- reserved3: binary.TypeT<bigint> | binary.TypeT<number>;
231
- reserved4: binary.TypeT<bigint> | binary.TypeT<number>;
232
- reserved5: binary.TypeT<bigint> | binary.TypeT<number>;
233
- reserved6: binary.TypeT<bigint> | binary.TypeT<number>;
226
+ init_address: bin.TypeT<number> | bin.TypeT<bigint>;
227
+ init_module: bin.TypeT<number> | bin.TypeT<bigint>;
228
+ reserved1: bin.TypeT<number> | bin.TypeT<bigint>;
229
+ reserved2: bin.TypeT<number> | bin.TypeT<bigint>;
230
+ reserved3: bin.TypeT<number> | bin.TypeT<bigint>;
231
+ reserved4: bin.TypeT<number> | bin.TypeT<bigint>;
232
+ reserved5: bin.TypeT<number> | bin.TypeT<bigint>;
233
+ reserved6: bin.TypeT<number> | bin.TypeT<bigint>;
234
234
  };
235
235
  2: {
236
- get(s: binary._stream): (string | {
236
+ get(s: bin._stream): (string | {
237
237
  strx: number;
238
238
  flags: {
239
239
  ext: number | bigint;
@@ -257,10 +257,10 @@ declare const cmd_table: {
257
257
  }[] | undefined;
258
258
  };
259
259
  23: {
260
- cksum: binary.TypeT<number>;
260
+ cksum: bin.TypeT<number>;
261
261
  };
262
262
  27: {
263
- uuid: binary.TypeT<Uint8Array>;
263
+ uuid: bin.TypeT<Uint8Array>;
264
264
  };
265
265
  29: {
266
266
  get(s: mach_stream): Uint8Array | undefined;
@@ -278,7 +278,7 @@ declare const cmd_table: {
278
278
  get(s: mach_stream): {
279
279
  data: Uint8Array;
280
280
  contents: {
281
- offset: binary.hex<number | bigint>;
281
+ offset: bin.hex<number | bigint>;
282
282
  length: number;
283
283
  kind: string;
284
284
  }[];
@@ -297,31 +297,31 @@ declare const cmd_table: {
297
297
  get(s: mach_stream): Uint8Array | undefined;
298
298
  };
299
299
  33: {
300
- cryptoff: binary.TypeT<number>;
301
- cryptsize: binary.TypeT<number>;
302
- cryptid: binary.TypeT<number>;
300
+ cryptoff: bin.TypeT<number>;
301
+ cryptsize: bin.TypeT<number>;
302
+ cryptid: bin.TypeT<number>;
303
303
  };
304
304
  44: {
305
- cryptoff: binary.TypeT<number>;
306
- cryptsize: binary.TypeT<number>;
307
- cryptid: binary.TypeT<number>;
308
- pad: binary.TypeT<number>;
305
+ cryptoff: bin.TypeT<number>;
306
+ cryptsize: bin.TypeT<number>;
307
+ cryptid: bin.TypeT<number>;
308
+ pad: bin.TypeT<number>;
309
309
  };
310
310
  36: {
311
- version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
312
- reserved: binary.TypeT<number>;
311
+ version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
312
+ reserved: bin.TypeT<number>;
313
313
  };
314
314
  37: {
315
- version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
316
- reserved: binary.TypeT<number>;
315
+ version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
316
+ reserved: bin.TypeT<number>;
317
317
  };
318
318
  47: {
319
- version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
320
- reserved: binary.TypeT<number>;
319
+ version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
320
+ reserved: bin.TypeT<number>;
321
321
  };
322
322
  48: {
323
- version: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
324
- reserved: binary.TypeT<number>;
323
+ version: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
324
+ reserved: bin.TypeT<number>;
325
325
  };
326
326
  34: {
327
327
  rebase: {
@@ -362,16 +362,16 @@ declare const cmd_table: {
362
362
  };
363
363
  9: {
364
364
  name: {
365
- get(s: binary.stream): string;
365
+ get(s: bin.stream): string;
366
366
  };
367
- header_addr: binary.TypeT<number>;
367
+ header_addr: bin.TypeT<number>;
368
368
  };
369
369
  2147483688: {
370
- entryoff: binary.TypeT<number>;
371
- stacksize: binary.TypeT<number>;
370
+ entryoff: bin.TypeT<number>;
371
+ stacksize: bin.TypeT<number>;
372
372
  };
373
373
  42: {
374
- version: binary.TypeT<{
374
+ version: bin.TypeT<{
375
375
  a: number | bigint;
376
376
  b: number | bigint;
377
377
  c: number | bigint;
@@ -380,35 +380,35 @@ declare const cmd_table: {
380
380
  }>;
381
381
  };
382
382
  50: {
383
- platform: binary.TypeT<string>;
384
- minos: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
385
- sdk: binary.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
386
- tools: binary.TypeT<Record<string, {
383
+ platform: bin.TypeT<string>;
384
+ minos: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
385
+ sdk: bin.TypeT<Record<string, bigint | boolean> | Record<string, number | boolean>>;
386
+ tools: bin.TypeT<Record<string, {
387
387
  tool: string;
388
388
  version: Record<string, bigint | boolean> | Record<string, number | boolean>;
389
389
  }>>;
390
390
  };
391
391
  45: {
392
- count: binary.TypeT<number>;
392
+ count: bin.TypeT<number>;
393
393
  };
394
394
  49: {
395
- data_owner: binary.TypeT<string>;
395
+ data_owner: bin.TypeT<string>;
396
396
  data: {
397
397
  get(s: mach_stream): Uint8Array | undefined;
398
398
  };
399
399
  };
400
400
  11: {
401
401
  localsym: {
402
- first: binary.TypeT<number>;
403
- count: binary.TypeT<number>;
402
+ first: bin.TypeT<number>;
403
+ count: bin.TypeT<number>;
404
404
  };
405
405
  extdefsym: {
406
- first: binary.TypeT<number>;
407
- count: binary.TypeT<number>;
406
+ first: bin.TypeT<number>;
407
+ count: bin.TypeT<number>;
408
408
  };
409
409
  undefsym: {
410
- first: binary.TypeT<number>;
411
- count: binary.TypeT<number>;
410
+ first: bin.TypeT<number>;
411
+ count: bin.TypeT<number>;
412
412
  };
413
413
  toc: {
414
414
  get(s: mach_stream): {
@@ -421,20 +421,50 @@ declare const cmd_table: {
421
421
  objc_module_info_addr: number;
422
422
  objc_module_info_size: number;
423
423
  module_name: number;
424
- extdefsym: never;
425
- refsym: never;
426
- localsym: never;
427
- extrel: never;
428
- init_iterm: never;
424
+ extdefsym: {
425
+ first: number;
426
+ count: number;
427
+ };
428
+ refsym: {
429
+ first: number;
430
+ count: number;
431
+ };
432
+ localsym: {
433
+ first: number;
434
+ count: number;
435
+ };
436
+ extrel: {
437
+ first: number;
438
+ count: number;
439
+ };
440
+ init_iterm: {
441
+ first: number;
442
+ count: number;
443
+ };
429
444
  } | {
430
445
  objc_module_info_size: number;
431
446
  objc_module_info_addr: bigint;
432
447
  module_name: number;
433
- extdefsym: never;
434
- refsym: never;
435
- localsym: never;
436
- extrel: never;
437
- init_iterm: never;
448
+ extdefsym: {
449
+ first: number;
450
+ count: number;
451
+ };
452
+ refsym: {
453
+ first: number;
454
+ count: number;
455
+ };
456
+ localsym: {
457
+ first: number;
458
+ count: number;
459
+ };
460
+ extrel: {
461
+ first: number;
462
+ count: number;
463
+ };
464
+ init_iterm: {
465
+ first: number;
466
+ count: number;
467
+ };
438
468
  })[] | undefined;
439
469
  };
440
470
  extrefsym: {
@@ -471,21 +501,21 @@ declare const cmd_table: {
471
501
  };
472
502
  export declare class MachFile {
473
503
  static check(data: Uint8Array): boolean;
474
- header: binary.ReadType<typeof header>;
504
+ header: bin.ReadType<typeof header>;
475
505
  commands: {
476
506
  cmd: CMD;
477
507
  data: any;
478
508
  }[];
479
- constructor(data: Uint8Array, mem?: binary.memory);
480
- load(data: Uint8Array, be: boolean, bits: 32 | 64, mem?: binary.memory): void;
481
- getCommand<T extends CMD>(cmd: T): binary.ReadType<typeof cmd_table[T]>;
509
+ constructor(data: Uint8Array, mem?: bin.memory);
510
+ load(data: Uint8Array, be: boolean, bits: 32 | 64, mem?: bin.memory): void;
511
+ getCommand<T extends CMD>(cmd: T): bin.ReadType<typeof cmd_table[T]>;
482
512
  getSegment(name: string): {
483
- data: binary.MappedMemory | undefined;
513
+ data: bin.MappedMemory | undefined;
484
514
  segname: string;
485
- vmaddr: binary.hex<number | bigint>;
486
- vmsize: binary.hex<number | bigint>;
487
- fileoff: binary.hex<number | bigint>;
488
- filesize: binary.hex<number | bigint>;
515
+ vmaddr: bin.hex<number | bigint>;
516
+ vmsize: bin.hex<number | bigint>;
517
+ fileoff: bin.hex<number | bigint>;
518
+ filesize: bin.hex<number | bigint>;
489
519
  maxprot: number;
490
520
  initprot: number;
491
521
  nsects: number;
@@ -494,9 +524,9 @@ export declare class MachFile {
494
524
  } | undefined;
495
525
  }
496
526
  export declare class FATMachFile {
497
- archs: binary.ReadType<typeof fat_arch>[];
527
+ archs: bin.ReadType<typeof fat_arch>[];
498
528
  static check(data: Uint8Array): boolean;
499
- constructor(data: Uint8Array, mem?: binary.memory);
500
- load(file: binary.endianStream, mem?: binary.memory): void;
529
+ constructor(data: Uint8Array, mem?: bin.memory);
530
+ load(file: bin.endianStream, mem?: bin.memory): void;
501
531
  }
502
532
  export {};