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

Mac OS X on Xbox 360

https://github.com/osx360/osx360-drivers
1•PortableCode•3m ago•0 comments

Bringing more agent harnesses and frameworks to Cloudflare, starting with Flue

https://blog.cloudflare.com/agents-platform-flue-sdk/
1•gurjeet•4m ago•0 comments

Former OC actor Ben McKenzie on crusade to take down 'stupid' cryptocurrency

https://www.rnz.co.nz/life/people/celebrity/former-oc-actor-ben-mckenzie-on-crusade-to-take-down-...
3•billybuckwheat•5m ago•0 comments

Load Cells for Silos

https://www.swttech.com/products/load-cells-for-silos/
1•swttech•5m ago•1 comments

What the EU AI Act means for you and your business

https://proton.me/blog/eu-ai-act
3•devonnull•13m ago•0 comments

Battery fires at recycling centres are costing UK £1B a year

https://www.theguardian.com/environment/2026/aug/22/lithium-battery-fires-waste-recycling-centres...
1•neehao•13m ago•0 comments

Neurologist with antivaccine views to lead NIH's child health institute

https://www.science.org/content/article/neurologist-antivaccine-views-lead-nih-s-child-health-ins...
1•sbulaev•15m ago•0 comments

Vorssaint – One menu bar icon doing the job of a dozen Mac apps

https://github.com/vorssaint/vorssaint-utils
1•danboarder•18m ago•0 comments

Sideshow: Give Your Agents a Stage

1•handfuloflight•18m ago•0 comments

Against Curry-Howard Mysticism

https://liamoc.net/forest/loc-000S/index.xml
1•pcfwik•25m ago•0 comments

Pixel Dot – Open-source Android habit tracker built with React Native

https://github.com/shivardev/HabbitDot
1•blazingbane•26m ago•0 comments

Tell me how to hack the system that requires the LINE app for voting

1•GanJin•27m ago•0 comments

Intel.com has 104 TXT records.. more than bind9 tolerates

https://dnsviz.net/d/intel.com/aoudhg/responses/
1•edelbitter•28m ago•1 comments

Show HN: Dsh-dispatch – dispatch tasks to DeepSeek Harness from your phone

https://github.com/alextangson/dsh-dispatch
1•lawrenceTang•28m ago•0 comments

Using thunderquakes to X-ray Earth

https://theconversation.com/using-thunderquakes-to-x-ray-earth-a-new-study-shows-urban-seismology...
2•pash•33m ago•0 comments

Show HN: Olivers Army – Discord for Politics

https://olivers.army
1•brandoniscool•34m ago•1 comments

Don't let activation energy expire

https://herbertlui.net/dont-let-activation-energy-expire/
1•herbertl•35m ago•0 comments

Founder calculators: SAFE terms and an accelerator shortlist and Runway

https://continuum-app.xyz/safe
1•charleswcho•45m ago•1 comments

Migrating a Synology NAS to a UniFi UNAS Pro 8 with Robocopy, SMB Multichannel

https://www.hanselman.com/blog/migrating-a-synology-nas-to-a-unifi-unas-pro-8-with-robocopy-smb-m...
4•soheilpro•49m ago•0 comments

Show HN: Conduit – local-first desktop LLM client, byok

https://github.com/runningpixels/conduit
1•emilioolivares•51m ago•0 comments

YouTube sued over ads in Premium: YouTube claims "promotions" are not "ads" [video]

https://www.youtube.com/watch?v=oxg7AHYeSBk
8•Bender•55m ago•2 comments

Push for Online Gun Sales Meets a Surprising Opponent: Small Gun Dealers

https://www.nytimes.com/2026/08/21/us/politics/online-gun-sales-trump.html
1•bookofjoe•57m ago•1 comments

Tesla discontinues its Solar Roof tiles, not economically viable

https://electrek.co/2026/08/20/tesla-discontinues-solar-roof-panels-only/
3•MilnerRoute•1h ago•0 comments

BanProof – AI that scans TikTok Shop videos for violation points before you post

https://banproof.io/
1•Pratham3690•1h ago•0 comments

World Humanoid Robot Games

https://en.wikipedia.org/wiki/World_Humanoid_Robot_Games
1•RickJWagner•1h ago•0 comments

He Was Wrongly Convicted of Attempted Rape. He's Suing the DNA Analysts

https://www.nytimes.com/2026/08/23/nyregion/new-york-dna-analysts-sued-rape-conviction.html
1•CaliforniaKarl•1h ago•0 comments

Spreadsheet-Defined Function Demo

https://casey.github.io/IronCalc/
1•rodarmor•1h ago•1 comments

New Experimental to Test #1 Craze

https://outgame.lol
1•thronebuster•1h ago•1 comments

The Lifecycle of LLM-as-a-Judge for Large-Scale Recommendation Explanations

https://arxiv.org/abs/2608.18300
1•mooreds•1h ago•0 comments

A Unicode Lover's Manifesto

https://dreamstation.systems/A%20Unicode%20Lover%E2%80%99s%20Manifesto.txt
1•robinpie•1h ago•0 comments