mirror of
https://github.com/morluto/rea.git
synced 2026-11-21 06:04:03 +00:00
refactor(elf): share fixed header declaration widths (#12391)
This commit is contained in:
1 parent
ad996352c3
commit
1ba93c8a1b
18 files changed
+184
-96
No files matched your search
@@ -17,7 +17,11 @@ it.each(formats)(
|
||||
const wide = bits === 64;
|
||||
const length = wide ? 56 : 32;
|
||||
const backing = Buffer.alloc(length + 19, 0xa5);
|
||||
const bytes = backing.subarray(7, 7 + length);
|
||||
const bytes = new Uint8Array(
|
||||
backing.buffer,
|
||||
backing.byteOffset + 7,
|
||||
length,
|
||||
);
|
||||
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
||||
const values = wide
|
||||
? [
|
||||
@@ -45,7 +49,7 @@ it.each(formats)(
|
||||
});
|
||||
const before = Buffer.from(backing);
|
||||
const parsed = readElfProgramHeader(
|
||||
backing.subarray(7),
|
||||
new Uint8Array(backing.buffer, bytes.byteOffset, length + 5),
|
||||
bits,
|
||||
littleEndian,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user