frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

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

Would HN Accept PRs?

1•jorisw•1m ago•0 comments

Recovoly – Built for Better Document Recovery

https://www.recovoly.com/
1•thisarajay•8m ago•0 comments

240M-Year-old giant "sand creeper" found hidden in retaining wall

https://www.sciencedaily.com/releases/2026/05/260504154028.htm
1•Eridanus2•8m ago•0 comments

Pomodoro CLI

https://codeberg.org/kevinschoon/pomo
1•ankitg12•10m ago•0 comments

Know Your .agent?

https://estherdyson.substack.com/p/know-your-agent
1•nembal•10m ago•0 comments

OpenClaw Had a Rough Week

https://openclaw.ai/blog/openclaw-rough-week
1•nouhailaeg•11m ago•0 comments

The AI operator: Biggest role in Silicon Valley

https://www.rishgupta.com/blog/the-ai-operator-biggest-role-in-silicon-valley
2•nreece•13m ago•0 comments

Map projections: a practical guide to common mistakes and how to fix them

https://dominicroye.github.io/blog/map-projections/
1•altilunium•14m ago•0 comments

Facebook Buying Instagram For $1B.(2012)

https://www.bgr.com/general/facebook-paying-1-billion-for-instagram/
1•downbad_•16m ago•2 comments

Car Dealerships Scam America [video]

https://www.youtube.com/watch?v=GREaEG_0Xcw
1•type4•16m ago•0 comments

How I caught an illegal Russian spy [video]

https://www.youtube.com/watch?v=xjo0iLssbI8
1•burnt-resistor•23m ago•0 comments

Why should a Trace-ID be 128 bits? (A Surprisingly Long Answer)

https://newsletter.signoz.io/p/why-should-a-trace-id-be-128-bits
1•elza_1111•26m ago•0 comments

FairwayMapper – Introducing Golfers to Mapping

https://community.openstreetmap.org/t/fairwaymapper-introducing-golfers-to-mapping/142814
1•altilunium•28m ago•0 comments

Banking Malware hiding inside a flashlight app? (BeatBanker / BTMOB)

https://blog.ostorlab.co/beatbanker-btmob-tv-v-23-static-analysis.html
1•Jhonny_doe•28m ago•0 comments

Garmin releases new luxury home audio system globally

https://www.notebookcheck.net/Garmin-releases-new-luxury-home-audio-system-globally.1289575.0.html
1•thunderbong•29m ago•0 comments

The Kurzweil Library

https://www.thekurzweillibrary.com
1•andsoitis•29m ago•1 comments

A bidirectional typechecking puzzle in the Grace programming language

https://haskellforall.com/2026/05/a-bidirectional-typechecking-puzzle
3•fanf2•32m ago•0 comments

Code never mattered in the first place

https://mar.coconauts.net/blog/posts/code-never-mattered/
1•marbartolome•36m ago•0 comments

The Place of Houses: Questionnaire [pdf]

http://www.duodickinson.com/Yours_complete.pdf
2•Kaibeezy•36m ago•0 comments

How to improve code quality of Claude Code and codex (on 2026-05)

1•david_d8912•36m ago•0 comments

It is distressing that AI does not know the seven cardinal virtues

https://en.wikipedia.org/wiki/Seven_virtues
2•chasil•43m ago•5 comments

You made me rich, thank you

https://github.com/theori-io/copy-fail-CVE-2026-31431/issues/128
9•mfi•44m ago•4 comments

Donlyn Lyndon, Last Surviving Creator of the Sea Ranch, Dies at 90

https://www.nytimes.com/2026/05/05/arts/design/donlyn-lyndon-dead.html
2•Kaibeezy•44m ago•1 comments

NHS England withdraws public software over AI hacking fears

https://www.computing.co.uk/news/2026/security/nhs-england-withdraws-public-software-over-hacking...
2•latein•45m ago•0 comments

Show HN: Yumi – Your workspace for AI chat, notes, and research

https://askyumi.app
1•yumi-dev•45m ago•0 comments

Fedora is now the default Linux recommendation, and Ubuntu did this to itself

https://www.xda-developers.com/fedora-becoming-default-linux-recommendation-ubuntu-fault/
2•bundie•46m ago•1 comments

The Deletion Test – The Phoenix Architecture

https://aicoding.leaflet.pub/3md5ftetaes2e
2•fagnerbrack•48m ago•0 comments

The 80% Problem in Agentic Coding

https://addyo.substack.com/p/the-80-problem-in-agentic-coding
1•fagnerbrack•48m ago•0 comments

How the Lobsters front page works – nilenso blog

https://blog.nilenso.com/blog/2026/01/20/lobsters-front-page/
1•fagnerbrack•48m ago•0 comments

The Boring Internet

https://www.terrygodier.com/the-boring-internet
4•crowdhailer•50m ago•1 comments