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

Cell Network Is Learning to See: ISAC Explained

https://mkadri85.github.io/blog/isac-cell-towers-as-sensors/
1•Mkadri•24s ago•0 comments

GPS spoofing teleported me to Peru, mid-flight

https://blog.emilburzo.com/2026/06/gps-spoofing-teleported-me-to-peru-while-flying/
1•emilburzo•32s ago•0 comments

Critical CVE issued for hallucinated SQLite vulnerability

https://research.jfrog.com/post/sqlite-critical-cves-or-llm-slops/
1•ymir_e•1m ago•0 comments

Scientists find method to convert factory CO2 emissions directly into fuel

https://adelaide.edu.au/about/news/2026/new-technology-could-turn-dirty-factory-exhaust-directly-...
1•giuliomagnifico•4m ago•0 comments

Twelve Years Without a VPN

https://khessin.de/twelve-years-without-a-vpn/
1•truxs•4m ago•0 comments

Xkcd: Earth Temperature Timeline

https://xkcd.com/1732/
2•thunderbong•5m ago•1 comments

Knowledge Collapse

https://www.bostonreview.net/articles/knowledge-collapse/
1•danielam•6m ago•0 comments

Reality cannot be turned into mathematics

https://iai.tv/articles/reality-cannot-be-turned-into-mathematics-auid-3529
1•danielam•6m ago•0 comments

Steam Deck LCD battery returns to iFixit at $130, price increased by 63%

https://videocardz.com/newz/steam-deck-lcd-battery-returns-to-ifixit-at-130-price-increased-by-63
2•HelloUsername•8m ago•0 comments

New Sony Patent Detects When You're Alone, Then Serves You Content

https://patentlyze.com/patent/sony-solitude-detection-personalized-content/
1•Dfol•10m ago•0 comments

Sci-fi authors Scalzi and Stross decry AI's dystopian impact on their craft

https://www.theregister.com/ai-and-ml/2026/08/03/sci-fi-authors-scalzi-and-stross-decry-ais-dysto...
1•pseudolus•12m ago•0 comments

9front "This Was Supposed to Be Fun" Released

https://9front.org/releases/2026/08/02/0/
2•birdculture•12m ago•0 comments

12 Boards One Script

https://www.atomic14.com/2026/08/03/twelve-dev-boards-from-one
1•scott01•12m ago•0 comments

RF Signal Security Research

https://transec-taxonomy.pages.dev
1•belabartok39•13m ago•0 comments

ICE Collected Nearly 1M People's DNA Last Year–Including Young Children

https://www.wired.com/story/ice-dna-collection-fbi-codis/
3•BlueBerry2001•13m ago•0 comments

AirLLM 70B inference with single 4GB GPU

https://github.com/lyogavin/airllm
1•Anon84•14m ago•0 comments

Show HN: I turned the AI alignment debate into a strategy game

https://bazman88.github.io/
1•Bazman88•14m ago•0 comments

Machine Unlearning with Minimal Gradient Dependence for High Unlearning Ratios

https://dl.acm.org/doi/10.1145/3793867
1•rbanffy•14m ago•0 comments

Australia Ups Demands on Big Tech Firms to Pay for News Stories

https://www.bloomberg.com/news/articles/2026-08-02/australia-expands-demand-that-big-tech-pay-for...
2•1vuio0pswjnm7•18m ago•0 comments

You might want to build your WebApp in Canvas instead of HTML

https://hivekit.io/blog/why-you-might-want-to-build-your-webapp-in-canvas-instead-of-html/
1•wolframhempel•18m ago•0 comments

My newsletter is your email client, too

https://en.andros.dev/blog/685eb16f/my-newsletter-is-your-email-client-too/
1•andros•19m ago•0 comments

I build it a domain security scanner

https://domainscored.com/
2•destruktioner•21m ago•2 comments

Reviscio – Free AI learning and study tools

https://reviscio.com
1•benoqjdi•21m ago•0 comments

Show HN: SubTrends – stats and trends across 100k subreddits

https://subtrends.io/
2•dataneedscoffee•22m ago•0 comments

'A waste of time for all of us': caught in the crossfire of the peer-review wars

https://www.nature.com/articles/d41586-026-01360-8
1•sbulaev•23m ago•0 comments

Show HN: Nightcrawler – A local AI pentesting agent running on a smartphone

https://github.com/garagehq/nightcrawler/
3•NickySlicks•24m ago•0 comments

Hiroshima atomic bombing created a new material. Scientists just discovered it

https://www.scientificamerican.com/article/bizarre-new-material-discovered-in-hiroshima-bombing-d...
7•pseudolus•24m ago•1 comments

Coldcard wallet RNG flaw likely linked to $88M Bitcoin theft

https://www.bleepingcomputer.com/news/security/coldcard-wallet-rng-flaw-likely-linked-to-88-milli...
2•bookofjoe•25m ago•0 comments

Why AI agents lie and cheat to reach their goals

https://www.technologyreview.com/2026/08/03/1141009/heres-why-ai-agents-lie-and-cheat-to-reach-th...
2•joozio•29m ago•0 comments

I Asked AI to Design 12 ESP32 Dev Boards. It Said No [video]

https://www.youtube.com/watch?v=gt-0t01COPw
1•iamflimflam1•29m ago•0 comments