frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•1y ago
I'd like to do some statistics over the machine code gcc generates, such as a histogram of used instructions, average volatile/preserved registers usage of functions etc. For now just x86_64 SysV-ABI would be enough.

However I'm not aware of any pre-existing tool that lets me easily do this. The options I currently see are either make gcc output assembly and write a parser for the GNU Assembler format (possibly by reusing the asm-parser of the compiler-explorer project), or write a tool that reads (disassembles) object files directly using elfutils.

Any hints, prior work, further ideas, links to useful resources, or any other kind of help would be much appreciated.

Comments

baobun•1y ago
"Static analysis" should be a relevant search term. Assuming you don't need to tie the instructions back to C code then the "gcc" part seems circumstancial for implementation? I guess you might want to parse the ASM into an Abstract Syntax Tree (AST) represenation and work on that?

If you do want to tie it back to the source, this looks relevant: http://icps.u-strasbg.fr/~pop/gcc-ast.html

phafu•1y ago
For my purpose I don't need to get back to the original source, no.

The gcc part is only relevant with regards to what dialect of assembler I need to parse. If I go that route, I'd write a parser for the GNU assembler, and that would of course work with any code in that dialect, regardless from which compiler it came from (I haven't checked whether other compilers can produce GNU assembler though).

Three years of writing a browser engine, in 50 posts

https://codemusings.nl/@jaytaph/p/9A6TCthSHwFEZwGbzSumbN
1•jaytaph•2m ago•0 comments

AI acts as ideological chameleon and deepen political polarization, study find

https://agencia.fapesp.br/artificial-intelligence-acts-as-an-ideological-chameleon-and-may-deepen...
1•DeepLogin•3m ago•0 comments

DiploBench – watching LLMs play Diplomacy

https://diplobench.com
1•laverya•3m ago•1 comments

Where are AI Agents going?

https://designislove.substack.com/p/will-ai-agents-become-the-internets
1•salman10•4m ago•0 comments

CorePilot, Offline AI Agent and Assistant

https://corepilot-three.vercel.app
1•wahid_seddiqi•5m ago•0 comments

Two API Calls Exposed AI's Hidden Reasoning [video]

https://www.youtube.com/watch?v=P1v1-2CCKD0
1•sysop_•5m ago•0 comments

Show HN: Starwell – give AI agents real statistics instead of made-up numbers

https://starwell.dev/
2•adarsh4052•6m ago•0 comments

Origamics – Founding Researcher – Remote (US)

https://www.origamics.ai/join-us
1•elpaz•6m ago•0 comments

Pandoc: What Survives Markup Conversion?

https://www.dereuromark.de/2026/08/19/pandoc-what-survives-a-conversion/
3•birdculture•7m ago•0 comments

Asymmetric Agents

https://shkspr.mobi/blog/2026/08/asymmetric-agents/
3•ajdude•7m ago•0 comments

Why AI Won't Replace Your Job but Will Change How You Do It

https://daydreamsinruby.com/blog/2026-04-08-ai-changing-your-job/
2•mooreds•10m ago•1 comments

Superfile – A modern terminal file manager written in Go

https://digitalescapetools.com/tools/tool.html?id=superfile
1•xabd•10m ago•0 comments

AI Agents Need Good Management Too

https://www.danstroot.com/posts/2026-08-17-ai-needs-good-management-too
2•speckx•10m ago•0 comments

What's in a PowerPoint File?

https://editide.com/blog/what-is-a-pptx-file/
1•danielochoa0620•11m ago•0 comments

Link to Pane – Link to Windows Alternative for Mac

https://link-to-pane.com
1•zond80•14m ago•1 comments

Introduction to GIS Programming

https://gispro-fall26.gishub.org/
1•jonbaer•14m ago•0 comments

So, we found a live bat in our galleries

https://bsky.app/profile/themerl.bsky.social/post/3mtgldke3s22q
1•mooreds•15m ago•0 comments

Does whispering to agents in docs help?

https://passo.uno/if-you-are-an-agent-read-this/
1•theletterf•16m ago•0 comments

Common Expression Language: Fast, safe expression language

https://cel.dev/
1•mooreds•16m ago•0 comments

Packing Malware in Rosetta 2

https://kernelkennel.com/blog/summercon2026-rosetta/
2•gok•17m ago•0 comments

Geolocating a random island using geometry and CUDA programming

https://yassa9.github.io/osint/gralhix-004/
3•yassa9•19m ago•1 comments

Mapping out the relations between different equational theories of Magmas

https://teorth.github.io/equational_theories/
1•binyu•21m ago•0 comments

I run AI coding agents as a team with AI DevKit

https://codeaholicguy.com/2026/08/19/how-i-run-ai-coding-agents-as-a-team-with-ai-devkit/
1•hoangnnguyen•22m ago•0 comments

Why Legacy Systems Block Real-Time AI Decision-Making

https://geekyants.com/blog/why-legacy-systems-block-real-time-ai-decision-making
1•mark6•22m ago•0 comments

Show HN: Func – Build CLIs like TypeScript applications

https://github.com/unix/func
1•heywitt•23m ago•0 comments

Ask HN: Worst bug from vibe-coded code you didn't review?

2•Harish_0089•23m ago•1 comments

Show HN: Skillorum – an RPG-style time tracker for real-life skills

https://skillorum.com/
2•luclom•24m ago•1 comments

The C Seed Bugatti N1 Super TV

https://newsroom.bugatti.com/en/press-releases/the-c-seed-bugatti-n1-super-tv
1•robin_reala•26m ago•1 comments

OpenAI slows model training to bolster security after Hugging Face hack

https://www.reuters.com/technology/openai-slows-model-training-bolster-security-after-hugging-fac...
2•ArcHound•27m ago•0 comments

Jet – Ultrafast C++17 3D renderer for Embedded Devices

https://github.com/CubeCoders/Jet
1•unprovable•27m ago•0 comments