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 🙏

© 2025 – Pkg Stats / Ryan Hefner

gai

v0.5.0

Published

GDB Assembly Informant steps through your assembly code one instruction at a time and diffs register values.

Readme

gai build status

GDB Assembly Informant steps through your assembly code one instruction at a time and diffs register values.

assets/strlen.png

Table of Contents generated with DocToc

Installation

npm install -g gai

Usage

Preparation

Mark the sections of code you want to investigate with start .gai_s and end .gai_e labels.

Without these labels gai won't work.

As an example lets take examples/inc.asm:

global _start
_start:
  nop

.gai_s:                 ; gai instruction printing starts here
  inc eax
  inc eax

  mov eax, 0xffffffff
  inc eax
  inc eax

.gai_e:                 ; gai instruction printing ends here
  mov eax,1
  mov ebx,0
  int 80H

Then assemble the file, i.e. see examples/Makefile.

gai-print

Launch the following command which will batch debug the executable with gdb and then pipe the output through various scripts (see below) to generate the instructions including opcodes and information about modified registers.

gai-print examples/strlen

gai-json

Works exactly like gai-print except that it outputs the information in JSON format to be parsed by other tools.

This is useful in case you are writing an emulator or similar and want to check it against a real CPU. I'm using it for my visulator project.

gai-json examples/strlen > out.json

Other scripts

Three more gai-* scripts are in your path, mainly so the main scripts can find them in the npm bin path. They are of limited use by themselves so read through them to see if you want to run them directly.

Platforms

You need gdb and be able to generate assembly with debug symbols. I've tested on Linux only and know that it isn't working on OSX since it cannot generate the debug symbols.

Additionally ATM gai expects an x86 instruction set. However I'm open for PRs that add support for 64-bit.

Troubleshooting

If something goes wrong, i.e. you get no output, have a look inside the /tmp/gai__gdb_err.txt to see if somehow the gdb batch debugging failed to complete properly

You can then manually debug or run the following command to just run the gdb batch debug script:

gdb -nx --batch -x gai-gdb -f <your-executable>

Examples

In order to play with the examples make sure to have nasm installed and are running on a compatible platform.

Assuming you installed gai and cloned this repo, here is how you'd try the strlen example.

cd gai/examples
make strlen
gai-print strlen

License

GPL3