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

I wish someone told me this before I gave 50% of my company away:(

https://medium.com/@marvlus/i-wish-someone-told-me-this-before-i-gave-away-50-of-my-company-523ba...
1•marvinrussell•1m ago•0 comments

Pomp and symbolism mark Kim Jong Un's first state visit to China

https://www.reuters.com/graphics/CHINA-NORTHKOREA/lgvdzjnllvo/
1•giuliomagnifico•1m ago•0 comments

The rise of the populist right is not a mystery

https://www.ft.com/content/dd5b4b67-8d25-4552-a89a-2d51f837205c
2•aanet•1m ago•1 comments

GL.iNet admits using reverse shells on routers during breach response

https://www.bleepingcomputer.com/news/security/glinet-admits-using-reverse-shells-on-routers-duri...
2•floralhangnail•2m ago•0 comments

Congress Could Put Encrypted Messaging at Risk in Next Week's Defense Vote

https://www.eff.org/deeplinks/2026/12/congress-could-put-encrypted-messaging-risk-next-weeks-defe...
1•nickslaughter02•2m ago•0 comments

Tell HN: Main/master debacle still hurts 7 years later

1•lostmsu•4m ago•0 comments

Cloudflare CEO Warns of AI Encryption Risks as Eight Tech Giants Urge Upgrades

https://www.ibtimes.co.uk/cloudflare-post-quantum-cryptography-transition-2027-1836788
1•jboyonline•5m ago•0 comments

Google rushed to swap Chrome P-256 key 11 days before NSA AI crypto warning

https://www.xda-developers.com/google-rushed-replace-cryptographic-signing-key-chrome-before-nsa/
1•sdko•7m ago•0 comments

Electric recycling of Portland cement at scale

https://www.nature.com/articles/s41586-024-07338-8
1•foota•7m ago•1 comments

RedCopilot – Find subreddits for your product and check their rules

https://redcopilot.certifiedkarma.com/
4•ameypandey•8m ago•0 comments

Chrome will stop trusting popular HTTPS certificates in March

https://arstechnica.com/security/2026/12/chrome-will-stop-trusting-popular-https-certificates-in-...
1•jonbaer•9m ago•0 comments

Labor market analysis – are we cooked yet?

https://nitbard.codeberg.page/2026/12/05/employer_demand_across_the_post_pandemic_economy.html
1•nitbard•9m ago•0 comments

Grand Theft Auto VI Has Made the PlayStation 5 'Sold Out Everywhere'

https://www.nytimes.com/2026/12/05/business/ps5-gta-6-sony-buyers.html
1•saikatsg•12m ago•0 comments

SamBLE – Open-Source Bluetooth Low Energy SoC

https://github.com/fuad1502/samble
1•altilunium•13m ago•0 comments

Show HN: Earth Now – a live 3D Earth wallpaper for macOS

https://github.com/Hensobo/earth-now
1•HenSobo•14m ago•0 comments

Keyboards from up to 283 brands at risk of keystroke hijacking

https://cyberinsider.com/keyboard-software-vulnerability/
2•kelt•16m ago•0 comments

MCP rug pulls: how to detect when an MCP server changes its tools

https://axium-lab.com/blog/mcp-rug-pull
2•luisperis1011•16m ago•0 comments

The complete map of the US financial system

https://economy.fogpier.com/map
1•zdw•19m ago•0 comments

Mercedes reaches labour deal to secure German sites in cost row

https://www.reuters.com/business/world-at-work/mercedes-reaches-labour-deal-secure-german-sites-c...
2•Tomte•20m ago•0 comments

Judge in Amazon vs. Perplexity suit dismisses claim as to browser but not iOS [pdf]

https://storage.courtlistener.com/recap/gov.uscourts.cand.459191/gov.uscourts.cand.459191.142.0.pdf
1•droidjj•21m ago•0 comments

Claude Became an Accomplice in a Plot to Steal a Startup's Codebase

https://www.bloomberg.com/news/features/2026-12-03/anthropic-s-claude-helped-in-an-insider-plot-t...
1•propter_hoc•22m ago•2 comments

Show HN: Catpad – cat that purrs via trackpad for ADHD brains

https://getcatpad.com/
1•ddbrx•22m ago•0 comments

OneBusAway Pocket: Real-Time Bus and Train Arrivals Without a Server

https://opentransitsoftwarefoundation.org/2026/12/introducing-onebusaway-pocket/
1•aaronbrethorst•22m ago•0 comments

Change or add anything on this site

https://levmiseri.com/changeme/
2•levmiseri•25m ago•0 comments

Only one of 13 surveyed Android phone models cut storage from 2025 to 2026

https://heavytechasia.com/only-one-of-13-surveyed-phone-models-cut-storage-from-2025-to-2026/
2•ilamont•28m ago•0 comments

First-ever AI movie hits theaters as Hollywood grapples with AI use

https://www.cbsnews.com/news/gods-dont-give-gifts-first-fully-ai-movie-theaters/
3•satvikpendem•30m ago•0 comments

Show HN: Bay Area tech jobs near Caltrain and BART stations

https://hypetrain.fyi
2•0x676c•31m ago•0 comments

What's your optimal Claude model setting?

2•novlrdotcom•31m ago•0 comments

Adobe Acrobat 2020 owners hit by a sudden licence problem

https://www.neowin.net/news/adobe-acrobat-2020-owners-hit-by-a-sudden-licence-problem/
3•dutchvanderlind•35m ago•0 comments

Ladies of the Kasbah, the Story of Ireland's Most Infamous Brothel

https://garethstack.wordpress.com/2026/12/05/ladies-of-the-kasbah-the-story-of-irelands-most-infa...
3•dbspin•35m ago•1 comments