npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

binarycpu

v0.0.5

Published

Identify binary files and their cpu/processor architecture

Downloads

14

Readme

binarycpu

Identify the processor architecture of binary files.

Usage

On the command line

Simply install with npm install -g binarycpu and then call this with the path you wish to scan. e.g.

binarycpu c:\\apps

And it will print out the file names of identified PE/MZ binary files with their appropriate cpu architecture (see table below).

In your own code

const binarycpu = require('binarycpu')

const arch = binarycpu.determinePEArch(filename)

null is returned if the file is not a MZ/PE file. If the processor architecture is unknown it will return unknown as well as the hex identifier.

Possible architectures

These have been kept the same as the Microsoft docs for PE files.

| Hex ID | Name | description | ------ | ------ | ----------- | 0x0000 | native | applicable to any machine type | 0x0EBC | ebc | EFI byte code | 0x014C | ia32 | Intel 386 or later compatible processors | 0x0200 | ia64 | Intel Itanium processor family | 0x8664 | amd64 | AMD x64 extensions / Intel 64-bit 'Core' | 0x0166 | r4000 | MIPS R4000 little endian | 0x0169 | wcemipsv2 | MIPS little-endian WCE v2 | 0x0266 | mips16 | MIPS16 | 0x0366 | mipsfpu | MIPS with FPU | 0x0466 | mipsfpu16 | MIPS16 with FPU | 0x01A1 | sh3 | Hitachi SH3 | 0x01A3 | sh3dsp | Hitachi SH3 DSP | 0x01A6 | sh4 | Hitachi SH4 | 0x01A8 | sh5 | Hitachi SH5 | 0x01F0 | powerpc | Power PC little endian | 0x01F1 | powerpcfp | Power PC with floating point support | 0x01C0 | arm | ARM little endian | 0x01C2 | thumb | ARM Thumb | 0x01C4 | armnt | ARM Thumb-2 little endian | 0xAA64 | arm64 | ARM64 little endian | 0x5032 | riscv32 | RISC-V 32-bit address space | 0x5064 | riscv64 | RISC-V 64-bit address space | 0x5128 | riscv128 | RISC-V 128-bit address space | 0x01D3 | am33 | Matsushita AM33 | 0x9041 | m32r | Mitsubishi M32R little endian

Notes

  • Only Portable Executable files are supported (ELF, mach-O could be added later)
  • Errors are thrown if it is a MZ file but it can't find the PE signature