diff options
| author | pack <pack@packgekko.xyz> | 2026-08-09 10:54:08 +0000 |
|---|---|---|
| committer | pack <pack@packgekko.xyz> | 2026-08-09 10:54:08 +0000 |
| commit | d3adc16a08d95d6e331de55d7d3bf05a66a874a8 (patch) | |
| tree | a2dabd199501e67c547c2ce79e1374ca3aa55443 /node_modules/detect-libc/lib/elf.js | |
| parent | 55a4f1fc869e41aca748c63d3018f0448b1606e0 (diff) | |
| download | crud-d3adc16a08d95d6e331de55d7d3bf05a66a874a8.tar.gz | |
stop tracking node_modules/
Diffstat (limited to 'node_modules/detect-libc/lib/elf.js')
| -rw-r--r-- | node_modules/detect-libc/lib/elf.js | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/node_modules/detect-libc/lib/elf.js b/node_modules/detect-libc/lib/elf.js deleted file mode 100644 index aa166aa..0000000 --- a/node_modules/detect-libc/lib/elf.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2017 Lovell Fuller and others. -// SPDX-License-Identifier: Apache-2.0 - -'use strict'; - -const interpreterPath = (elf) => { - if (elf.length < 64) { - return null; - } - if (elf.readUInt32BE(0) !== 0x7F454C46) { - // Unexpected magic bytes - return null; - } - if (elf.readUInt8(4) !== 2) { - // Not a 64-bit ELF - return null; - } - if (elf.readUInt8(5) !== 1) { - // Not little-endian - return null; - } - const offset = elf.readUInt32LE(32); - const size = elf.readUInt16LE(54); - const count = elf.readUInt16LE(56); - for (let i = 0; i < count; i++) { - const headerOffset = offset + (i * size); - const type = elf.readUInt32LE(headerOffset); - if (type === 3) { - const fileOffset = elf.readUInt32LE(headerOffset + 8); - const fileSize = elf.readUInt32LE(headerOffset + 32); - return elf.subarray(fileOffset, fileOffset + fileSize).toString().replace(/\0.*$/g, ''); - } - } - return null; -}; - -module.exports = { - interpreterPath -}; |