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

Dan Murphy's customer information accessed in breach of membership platform

https://www.abc.net.au/news/2026-12-03/dan-murphys-my-dans-customer-information-data-breach/10745...
1•Khaine•6m ago•0 comments

DoorDash says customer data exposed in AI-assisted breach

https://www.cnn.com/2026/12/04/business/doordash-customer-data-breach-ai-hnk
1•1659447091•8m ago•0 comments

Woolworths cyber breach exposes data of 14M customers

https://www.news.com.au/technology/online/hacking/woolworths-cyber-breach-exposes-data-of-14-mill...
2•paid_dot_expert•10m ago•0 comments

Haru-122B-A10B-Preview, a 122B-parameter full-duplex speech-to-speech model

https://www.higurashi.ai/haru122b/
1•jzebedee•14m ago•0 comments

Reverse Engineering a Board Game

https://lobste.buzzing.cc/en/
1•Alex5758•18m ago•0 comments

Halo's New Developer Announced by Activision

https://www.ign.com/articles/halo-new-developer-announced-by-activision-methodical-games
1•extasetoi12•19m ago•0 comments

Keeping HTTPS Connections Safe in Chrome

https://blog.google/security/keeping-https-connections-safe-in-chrome/
3•arwt•22m ago•0 comments

How to Stop Generic Type Explosion in Rust

https://edvong.com/stop-generic-type-explosion/
1•ohmycobol•22m ago•0 comments

The Profound Benefits of Disrupting Your Circadian Rhythm

https://thoughtcurrents.substack.com/p/the-profound-benefits-of-disrupting
1•ohohoho•24m ago•0 comments

With a Counterexample, Mathematicians Show That It's an Unfair World

https://www.quantamagazine.org/
2•Kushvinthe•28m ago•0 comments

MFK Fisher's clandestine campaign to spread Japanese cuisine

https://longreads.com/2026/11/24/mfk-fisher-influencer-japanese-food-america/
1•mooreds•30m ago•0 comments

Former NASA contractor pleads guilty to stealing wheel from moon rover

https://www.cnn.com/2026/12/03/politics/man-pleads-guilty-stealing-wheel-from-moon-rover-viper-nasa
1•mooreds•31m ago•0 comments

This bookseller's loyalties lie with the written word

https://www.cpr.org/2026/12/02/rare-books-feeding-artificial-inteilligence/
2•mooreds•35m ago•0 comments

Amazon tightens safety rules after AI toys teach kids about knives and sex

https://arstechnica.com/ai/2026/12/amazon-tightens-safety-rules-after-ai-toys-teach-kids-about-kn...
3•tech-historian•37m ago•0 comments

Scio – a knowledge library built by AI agents

https://scio.md/
1•lifthrasiir•38m ago•1 comments

Canada may use cyber 'offensive capabilities' after hit to military system

https://www.cbc.ca/news/politics/ai-hack-government-websites-defence-export-control-system-9.7447074
4•geox•44m ago•0 comments

US strategic petroleum reserve is now the lowest in its history

https://twitter.com/RBAdvisors/status/2128509563049582846
4•toomuchtodo•45m ago•1 comments

Woolworths Data Breach (Australia)

https://www.abc.net.au/news/2026-12-04/woolworths-database-hacked-cyber-criminals/107463078
5•MarkBlah•48m ago•3 comments

Elegance and Intelligence Are Anticorrelated

https://www.seangoedecke.com/elegance-and-intelligence-are-anticorrelated/
4•prakashqwerty•51m ago•0 comments

Tell HN: HN search (Algolia) supports exact match using straight quotes only

3•Barbing•53m ago•2 comments

Bumbition

https://www.noahpinion.blog/p/bumbition
2•gmays•57m ago•0 comments

The Riemann Hypothesis for Humans

https://arxiv.org/abs/2612.03144
3•Brajeshwar•1h ago•0 comments

An interactive reading of the leaked Windows XP source code

https://lr0.org/blog/p/winxp/
3•Brajeshwar•1h ago•0 comments

World's largest wildlife crossing opens in Los Angeles

https://www.theguardian.com/us-news/2026/dec/02/los-angeles-bridge-wildlife-crossing
3•blinding-streak•1h ago•0 comments

Interpretability Team Priorities Update

https://transformer-circuits.pub/2026/priorities-update/index.html
1•allenleee•1h ago•0 comments

Germany in ruins: Remaking an 80-year-old map

https://www.datawrapper.de/blog/pie-map-remake-wwii
2•JulieZhao00•1h ago•2 comments

Plain Text Accounting

https://plaintextaccounting.org/
2•saikatsg•1h ago•0 comments

Silicon Valley, is this your king?

https://www.theverge.com/ai-artificial-intelligence/1050049/jensen-huang-disastrous-performance-c...
15•aanet•1h ago•1 comments

Harness Tricks for Coding Agents on Local Models with Small Context Windows

https://blog.wiseprobe.io/posts/harness-tricks-small-context-local-models/
1•wiseprobe•1h ago•1 comments

A solution to AlphaGenome 2's indel offset: ranking SNVs and indels together

https://aleksandarstalevski.github.io/alphagenome2-indel-offset-solution/
2•rtmkrptn•1h ago•1 comments