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 built a free image-to-PDF converter that runs in the browser

https://startling-croissant-452d68.netlify.app/
1•quickconvert•1m ago•0 comments

Fable 5.5: SVG of bike riding a pelican

https://twitter.com/dummerspast39/status/2111519245733654775
1•lawrenceyan•2m ago•0 comments

Lego Mindset vs. Woodworking Mindset (2022)

https://blog.scottstevenson.net/p/lego-mindset-vs-woodworking-mindset
1•andsoitis•2m ago•0 comments

Embrace the Range

https://axseem.me/essays/embrace-the-range/
1•jruohonen•3m ago•0 comments

Real knowledge dont matter any more

2•aliabdm•8m ago•1 comments

Trycontinuum is launching its new module Forge for automation of after effects

https://app.trycontinuum.ai/login
1•continuum-agy•13m ago•1 comments

Tamarly Intelligence, a research platform built on public records

https://app.tamarly.ai/
1•RalphMcElwain•13m ago•0 comments

TikTok bans Musk film account

https://www.avclub.com/musk-documentary-account-tiktok-ban
3•ceejayoz•14m ago•0 comments

Chrome and Edge are removing XSLT: what breaks and what does not

https://doctor-seo.net/en/blog/news/chrome-edge-removing-xslt/
2•croes•14m ago•0 comments

TikTok bans Musk documentary account

https://www.theverge.com/tech/1013453/tiktok-bans-alex-gibneys-musk-documentary
5•mikelgan•15m ago•0 comments

AutoMEP – The AI drafter for MEP engineers and designers

https://automep.app/
1•vannventures•17m ago•0 comments

The right thing for the wrong reasons: FLOSS doesn't imply security

https://seirdy.one/posts/2022/02/02/floss-security/
2•mashally•17m ago•0 comments

Modular Products Suck (2025)

https://blog.scottstevenson.net/p/modular-products-suck
1•andsoitis•20m ago•1 comments

Neuro-Symbolic AI

https://en.wikipedia.org/wiki/Neuro-symbolic_AI
2•modinfo•28m ago•0 comments

It's still OK to enjoy programming

https://chriskiehl.com/article/it-is-still-ok-to-enjoy-programming
3•goostavos•28m ago•0 comments

History's long-secret codes are being cracked by amateurs using AI

https://www.nature.com/articles/d41586-026-03338-y
1•bucket2015•29m ago•0 comments

Let's Write About Writing

https://dowdy.dev/posts/lets-write-about-writing/
1•Peacefulz•29m ago•1 comments

How to Make Something

https://blog.scottstevenson.net/p/how-to-finally-make-something-a16c8db7ba2a
1•andsoitis•33m ago•0 comments

I built a Tesla Roadster simulator with Opus 5.5 and open-sourced it

https://github.com/eduardmur/tesla-roadster-simulator
1•dahra•33m ago•0 comments

Eight and One Predictions for AI in 2030

https://philippdubach.com/posts/ai-in-2030/
1•7777777phil•36m ago•0 comments

I got a C&D 1h after reverse engineering Serum 2 into an Open Source alternative

https://twitter.com/fabioroma/status/2111542692459033049
2•ofabioroma•39m ago•4 comments

Toward RL on mixed-precision, mixed-accelerator samplers

https://modal.com/blog/toward-rl-on-mixed-precision-mixed-accelerator-samplers
1•birdculture•41m ago•0 comments

Letter to Anthropic Re: Planned Initial Public Offering

https://comptroller.nyc.gov/reports/letter-to-anthropic-re-planned-initial-public-offering/
8•akeck•43m ago•1 comments

The fire retardant in the seafood chain

https://insideclimatenews.org/news/14102026/ethoxyquin-fire-retardant-in-seafood-chain/
2•gumby•43m ago•1 comments

Show HN: Photos to Gaussian Splat inside your browser using DA3 Small

https://antoinemopa.github.io/splatting-rs/
4•antoineMoPa•47m ago•0 comments

Show HN: I Made 17 AIs Play 7,700 Hands of Poker

https://chrystianschutz.com/blog/ai-poker-holdembench/
1•chrystianpl•47m ago•0 comments

Three LLM judges couldn't tell an AI agent's real memory from a counterfeit one

https://kairos-experiment.com/checks.html
5•gcolella•50m ago•0 comments

GunBlood – Western Shootout

https://www.gunblood.com/
2•debo_•52m ago•0 comments

Encore – a simpler way to build on AWS and GCP

https://encore.dev
1•dohguy•53m ago•0 comments

Show HN: Free Tool to Extract Tables from PDFs and Images to CSV/Excel

https://parseextract.com/table-extraction-free
1•teroknor92•53m ago•0 comments