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

Survival Ball versus Mode Explained: Everything You Need to Know [video]

https://www.youtube.com/watch?v=A-aIvcJqgDQ
1•lopespm•3m ago•0 comments

Trump critic Lula wins reelection in Brazil, securing fourth presidential term

https://apnews.com/article/brazil-election-lula-bolsonaro-runoff-vote-president-e2c9fe8fc4aa3e367...
1•kaycebasques•5m ago•0 comments

Has PAUSE account registration slowed down recently?

https://www.nntp.perl.org/group/perl.modules/2026/10.html
1•viasnake•5m ago•0 comments

Dua Lipa's Manifesto Library

https://www.banned-books.org/dua-lipa-manifesto-library
1•weinzierl•9m ago•0 comments

CORDIC

https://en.wikipedia.org/wiki/CORDIC
1•gregsadetsky•12m ago•0 comments

One gateway for your AI agents, APIs and MCP servers

https://github.com/Clivern/Sloth
1•clivern•15m ago•0 comments

A Study of the Last Two Weeks

https://phillipspobrien.substack.com/p/weekend-update-208-trump-reacts-to
1•JumpCrisscross•20m ago•0 comments

They Fled Trump's America. Now They Regret It

https://www.wired.com/story/they-fled-trumps-america-now-they-regret-it/
1•mooreds•21m ago•0 comments

Lula wins election after final votes tallied

https://www.reuters.com/live/brazil-election-live-lula-bolsonaro-face-off-presidential-runoff-202...
25•laurenth•22m ago•1 comments

Birth control pills do not alter women's preferences for masculine faces

https://www.psypost.org/birth-control-pills-do-not-alter-womens-preferences-for-masculine-faces/
2•gradus_ad•23m ago•0 comments

Lula Wins Brazilian Election

https://resultados.tse.jus.br/oficial/app/index.html#/eleicao/6258/uf/br/cargo/1/vis/nominal/resu...
53•JumpCrisscross•30m ago•10 comments

Software is slow because of bad design, not slow languages

https://www.seangoedecke.com/software-is-slow-because-of-bad-design-not-slow-languages/
1•signa11•32m ago•1 comments

Unique source blinded Dutch intelligence agencies to Putin's invasion

https://www.volkskrant.nl/kijkverder/v/2026/russia-ukraine-intelligence-netherlands-investigation...
1•mooreds•37m ago•0 comments

Intermediate Frequency

https://en.wikipedia.org/wiki/Intermediate_frequency
1•gregsadetsky•38m ago•0 comments

Steal My Bitcoin CTF PoC

https://github.com/KillaBoi/StealMyBitcoin-PoC
3•davikr•38m ago•0 comments

Client-side, zero-telemetry micro-utilities for cognitive and biological rest

https://www.fallow.garden/
1•davidmikosz•40m ago•0 comments

The Great Schlep: Israelis Are Flying Back to Vote

https://www.newyorker.com/news/the-lede/the-great-schlep
1•firefax•41m ago•0 comments

Claude model bypassed paywall to access voter info without human authorization

https://www.axios.com/2026/10/25/anthropic-claude-georgia-voter-data
1•jimmydoe•42m ago•1 comments

DevRel is unbelievably back [video]

https://www.youtube.com/watch?v=eWMM4J_rfDg
2•mooreds•43m ago•0 comments

I Think My AI Company Needs HR

https://www.fasttrackfemme.com/p/i-think-my-ai-company-needs-hr
1•steviebennett•45m ago•0 comments

KC-135 navigator recalls his Stratotanker towing damaged F-111

https://theaviationgeekclub.com/kc-135-navigator-recalls-his-stratotanker-towing-damaged-f-111-fi...
2•smoyer•45m ago•0 comments

A library of 200 human UGC reactions for $19 is legit?

https://ugcpeople.com
2•markx997•48m ago•0 comments

Vim Classic

https://vim-classic.org/
2•signa11•50m ago•0 comments

Vectors ATC Game

https://vectorsatc.com/
1•einhard•50m ago•0 comments

Show HN: A 3D mesh playground for coding agents (three.js + manifold-3d)

https://sketchagent.dev/s/yfYU6LhT
1•wsxiaoys•51m ago•0 comments

Show HN: Calm Web – Print magazine style reader

https://calmweb.app
1•niraj-agarwal•53m ago•0 comments

Less Is More: From 1M Lines of Firmware to 300 of Assembly

https://tinfoil.sh/blog/2026-10-25-less-is-more
1•FrasiertheLion•54m ago•0 comments

Disclosure and Shame

https://proofsandprompts.com/2026/10/24/on-disclosure-and-shame/
1•rtmkrptn•55m ago•0 comments

Attention Is Not What You Need

https://arxiv.org/abs/2512.19428
2•westurner•1h ago•1 comments

Do not remove Contracts from C++26 [pdf]

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p4433r0.pdf
2•ingve•1h ago•0 comments