frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•6mo 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•6mo 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•6mo 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).

Why Were Hyperlinks Chosen to Be Blue?

https://www.newspointapp.com/english/tech/why-were-hyperlinks-chosen-to-be-blue/articleshow/10087...
1•thunderbong•39s ago•0 comments

The Forge Calculator

https://theforgecalculators.com/
1•quchao•48s ago•1 comments

X deletes EU Commission advertising account after fine

https://en.ilsole24ore.com/art/x-delete-advertising-account-eu-commission-fine-AIhnZ5H
1•amarcheschi•1m ago•0 comments

Ask HN: What's the best book you read in the last year?

1•fdw•5m ago•0 comments

Show HN: Not-so-Secret-Santa, for convoluted and explicit secret Santa rings

http://santa.pistolas.co.uk/
1•savgore•12m ago•0 comments

YouTube does not apply GenAI filters to videos

https://twitter.com/YouTubeInsider/status/1958199532363317467
1•xnx•14m ago•1 comments

What Is Important?

1•hafanis•16m ago•0 comments

Faith and Reform: is the religious right on the rise in UK politics?

https://www.theguardian.com/politics/2025/dec/07/is-the-religious-right-on-the-rise-in-uk-politics
1•beardyw•19m ago•1 comments

The Binding Problem

https://maxhodak.com/nonfiction/2025/12/05/the-binding-problem
1•0x79de•20m ago•0 comments

UK tax system steers anyone living off capital to becoming an eccentric laird

https://thetontineengine.substack.com/p/gilts-dividends-and-a-shed-full-of
2•rwmj•21m ago•0 comments

Show HN: Tikpal- Your AI Voice Partner – Focus, Flow, Forge

https://tikpal.ai
1•bingbing123•22m ago•0 comments

Pouring Packages with Homebrew

https://lwn.net/Articles/1046236/
3•pykello•24m ago•0 comments

The Hum of the Machine

https://registerspill.thorstenball.com/p/the-hum-of-the-machine
2•goranmoomin•24m ago•0 comments

The Bernoulli Manifesto

http://luschny.de/math/zeta/The-Bernoulli-Manifesto.html
1•bkudria•25m ago•0 comments

Show HN: Secache – Sampling Eviction Cache

https://pkg.go.dev/github.com/Snawoot/secache
1•Snawoot•27m ago•0 comments

Into the Inferno review – Werner Herzog peers into the depths of the volcano

https://www.theguardian.com/film/2016/oct/21/into-the-inferno-review-werner-herzog-peers-into-the...
1•andsoitis•28m ago•0 comments

Have You Accepted AI Yet?

https://softwaremaniacs.org/blog/2025/12/05/have-you-accepted-ai-yet/
1•tectiv3•31m ago•0 comments

Building Browser Agents: Architecture, Security, and Practical Solutions

https://arxiv.org/abs/2511.19477
1•aramvr•31m ago•1 comments

Quantifying Human-AI Synergy

https://osf.io/preprints/psyarxiv/vbkmt_v1
1•hunglee2•33m ago•0 comments

Show HN: Gratia – a tiny multilingual ritual engine (oops → portal →)

1•razvan•35m ago•0 comments

Show HN: Cursor AI Tips – Community-curated guide for AI-assisted coding

https://github.com/murataslan1/cursor-ai-tips
1•murataslan•37m ago•0 comments

Show HN: A tiny chat-style prompt generator I built for myself

https://02.dailyaiship.com/
1•bosschow•41m ago•0 comments

Netflix Is Buying Warner Bros and HBO

https://www.pcmag.com/news/netflix-is-buying-warner-bros-and-hbo-heres-what-this-means-for-you
1•ashishgupta2209•42m ago•0 comments

How Prompt Caching Works

https://sankalp.bearblog.dev/how-prompt-caching-works/
1•nkko•43m ago•0 comments

Stablecoins Can Help Criminals Launder Money and Evade Sanctions

https://www.nytimes.com/2025/12/07/technology/how-a-cryptocurrency-helps-criminals-launder-money-...
1•fleahunter•46m ago•0 comments

Python AsyncIO: Parallelism, Multiprocessing, Concurrency and Threading

https://realpython.com/async-io-python/
2•BinaryIgor•47m ago•1 comments

AddressGen.top – Now supporting 40 countries for random address generation

https://addressgen.top
2•addressGen•49m ago•1 comments

The secret inside one million boxes

https://eieio.games/blog/the-secret-inside-one-million-checkboxes/
2•damethos•53m ago•0 comments

Characters? In This Economy?

https://www.bitecode.dev/p/80-characters-in-this-economy
3•BiteCode_dev•56m ago•0 comments

GPS interference in the Baltic Sea becoming more complex and stronger

https://www.heise.de/en/news/Study-GPS-interference-in-the-Baltic-Sea-becoming-more-complex-and-s...
2•altilunium•57m ago•0 comments