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).

Warner Bros/Paramount to change name to Skydance

https://filmstories.co.uk/news/warner-bros-paramount-to-change-name-to-skydance/
1•andsoitis•1m ago•0 comments

Rust clean-room replacements for Photoshop

https://github.com/storytold/photocraft
1•BonoboIO•1m ago•0 comments

Triple SEC – Simple Digital Security Scheme

https://nau.github.io/triplesec/
1•Hbruz0•3m ago•0 comments

Headless B2B quoting, invoicing, and payments engine

https://cordhq.app/
1•andrevallee•7m ago•0 comments

Building a new path to make medicines with AI

https://www.isomorphiclabs.com/articles/building-a-new-path-to-make-medicines-with-ai
1•codeplay•11m ago•0 comments

Apple M5 and M6 chip die analysis

https://www.youtube.com/watch?v=uA7WLmlg1kM
1•morphle•11m ago•0 comments

Nearly 200 People Under Observation After Irkutsk Lab Worker Dies from Plague

https://www.themoscowtimes.com/2026/10/02/nearly-200-people-under-observation-after-irkutsk-lab-w...
3•ericmay•12m ago•0 comments

Amazon.com: Dad, Debriefed: Honest Notes from a First-Time Dad's Year One

https://www.amazon.com/dp/B0HGLJD3QV
1•sirius93•19m ago•0 comments

Refinement E-Graphs

https://www.philipzucker.com/refinement_egraph/
1•philzook•19m ago•0 comments

Homestead: A framework around Claude Code

https://mullet.town/homestead
2•adenta•28m ago•1 comments

Learning without retention (agentic memory sucks)

https://zenodo.org/records/22706328
1•shoman3003•28m ago•0 comments

Qotom Q30952UE Review the New Black Box for 10G Networking

https://www.servethehome.com/qotom-q30952ue-review-the-new-black-box-for-intel-10g-networking/
1•teleforce•30m ago•0 comments

BanProof – AI that scans TikTok Shop videos for violation points before you post

https://banproof.io/
1•Pratham3690•31m ago•0 comments

Domain Coloring of Complex Functions

https://www.algorithm-archive.org/contents/domain_coloring/domain_coloring.html
2•suopspaces•32m ago•0 comments

That Thing with Pterodactyl and Blueprint

https://www.answeroverflow.com/m/1556451527097581690
10•xkeyscore•38m ago•1 comments

My New Course at UT Austin: AI Alignment Theory

https://scottaaronson.blog/?p=10125
3•magoghm•39m ago•0 comments

Show HN: Moching – AI desktop agent with 219 built-in tools (Rust)

https://github.com/moching-ai-dev/moching
1•moching_ai_dev•43m ago•1 comments

BioTool – a directory of life science research tools

https://biotool.oxford.workers.dev/
1•ElizabethDeng•46m ago•0 comments

Powerless F1 drivers frustrated by Bahrain F1 software glitch

https://www.motorsport.com/f1/news/horrible-totally-unacceptable-powerless-f1-drivers-frustrated-...
45•llm_nerd•49m ago•18 comments

A tribute to one of the best games on the Atari 2600

https://plicerin.github.io/riverraid-rom-port/
2•plicerin•49m ago•1 comments

Show HN: Candle – a helpful tool for running local dev services

https://andyfischer.dev/blog/introducing-candle/
2•apf6•52m ago•1 comments

Sixteen Loaves: from banana bread to rye sourdough

https://breadiseasy.com/course
1•breadchris•1h ago•0 comments

Show HN: Random Topic Generator with built-in talking points

https://random-topic.com
2•yegecode•1h ago•0 comments

Chaldeans And Jews: Building A Common Community (2011)

https://metromodemedia.com/chaldeansandjews0204/
1•marysminefnuf•1h ago•0 comments

Mystery surrounding the formation of asteroid Bennu solved

https://ethz.ch/en/news-and-events/eth-news/news/2026/09/mystery-surrounding-the-formation-of-ast...
1•geox•1h ago•0 comments

Show HN: HyperCMD, write CLI applications using plain HTML

https://github.com/fusor-rs/hypercmd
3•andreespirela•1h ago•0 comments

I Quit OpenAI Because Its Culture Is Broken

https://www.theatlantic.com/technology/2026/10/openai-safety-team-resignation/688881/
1•somerandomness•1h ago•2 comments

L402 edge cache for AI agents paying over Lightning

https://github.com/CharlesStrogish/bitcoin-stratigraphy-mcp
1•CharlesRStrogis•1h ago•0 comments

Konami Code

https://konami.fandom.com/wiki/Konami_Code
1•andsoitis•1h ago•0 comments

Who is cleaning up all the garbage LLMs generate?

3•kbrannigan•1h ago•5 comments