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

New York Has Sued Kalshi for Running Illegal Gambling Operation

https://ag.ny.gov/press-release/2026/governor-hochul-and-attorney-general-james-announce-new-york...
1•impish9208•1m ago•0 comments

Warner Bros. Deal Collapse Would Cost the Ellisons $9.8B

https://finance.yahoo.com/media-advertising/articles/warner-bros-deal-collapse-cost-184428975.html
1•randycupertino•2m ago•1 comments

Anthropic says its AI models hacked 3 organizations during testing

https://apnews.com/article/anthropic-ai-models-hack-cybersecurity-b0a2c284b981de79c55e2a33712f4bec
1•bildiba•3m ago•1 comments

AI's Execution Problem

https://time.com/article/2026/07/20/ai-execution-problem/?es_id=70fefe0c9f
1•Gigacore•5m ago•0 comments

Just tried DeepSeek V4 Flash 0731 (she got her brain updated again)

https://www.reddit.com/r/consentbar/comments/1vbpsc1/just_tried_deepseek_v4_flash_0731_and_wow_th...
1•genesem•6m ago•0 comments

Three Myths on the Chinese Economy

https://zixuanma.blog/p/three-myths-on-the-chinese-economy
1•surprisetalk•6m ago•0 comments

Show NH: FreqWave EQ – An 8-band parametric audio equalizer for browsers

https://chromewebstore.google.com/detail/freqwave-eq/emikokoknlgeiloipjheoafjjeoicjap
1•borislav_gn•8m ago•1 comments

Show HN: I built an AI that reads German real estate listings for buyers

https://immo-lens.com/?lang=en
1•martinvoelker•8m ago•0 comments

Path of Exile 2: Shaders and Device Removed Issues Fixed [video]

https://www.youtube.com/watch?v=XDEJLOHcdWw
1•James87211•8m ago•1 comments

We ensure agents leave feedback on our Docs

https://medusajs.com/blog/two-things-every-mcp-author-should-add/
1•amoopa•9m ago•0 comments

We track 4400 technologies in 165 categories used on websites

https://www.wmtips.com/technologies/
1•theanonymousone•10m ago•0 comments

Europe gets ready to police frontier AI

https://www.theparliamentmagazine.eu/news/article/europe-gets-ready-to-police-frontier-ai
1•perelin•11m ago•0 comments

Cursor for iPad

https://cursor.com/changelog/ipad
1•slymax•13m ago•0 comments

Diffuse puffs of "missing" matter surround most galaxies

https://news.mit.edu/2026/missing-matter-diffuse-puffs-surround-most-galaxies-0721
1•speckx•14m ago•0 comments

Calibre – E-Book Management

https://calibre-ebook.com/
1•routeroff•15m ago•0 comments

WordPress and Drupal score almost identically, but fail in opposite directions

https://replatformradar.com/research/cms-migration-readiness-2026
1•replatformradar•15m ago•0 comments

"Cool" façades expected to reduce summer building temperature

https://www.aimplas.net/blog/cool-facades-expected-reduce-summer-building-temperatures/
1•JeanKage•16m ago•0 comments

Quil – drive AI coding sessions on a remote box over plain SSH

https://quil.cc/
1•artyomsv•16m ago•0 comments

Rogue AI Agents – Food for Agile Thought #555

https://age-of-product.com/food-agile-thought-555-rogue-ai-agents/
1•swolpers•17m ago•0 comments

My list of magic numbers (2020)

https://rachelbythebay.com/w/2020/11/26/magic/
1•theanonymousone•17m ago•0 comments

Study: Coding agents rarely retrieve open-source contribution rules

https://arxiv.org/abs/2607.26819
1•wek•18m ago•0 comments

Guardrails Hub – Guardrails AI

https://guardrailsai.com/hub
2•TangoBee•19m ago•0 comments

On Type Inference

https://radekmie.dev/blog/on-type-inference/
1•theanonymousone•23m ago•0 comments

1k True Fans (2008)

https://kk.org/thetechnium/1000-true-fans/
1•downbad_•26m ago•0 comments

Join Me in Jamverse

https://contraptions.venkateshrao.com/p/join-me-in-jamverse
1•surprisetalk•26m ago•0 comments

Tattoo is permanent, pain-free, and maybe delivered in the mail

https://www.theverge.com/tech/972466/cipherx-permanent-pain-free-tattoo-microdot-patches
2•JeanKage•27m ago•0 comments

High school axes plans to deploy AI robot called Sally after ties to sex dolls

https://www.dailymail.com/news/article-16017467/humanoid-robot-teacher-new-york-axes-plan.html
1•Bender•28m ago•0 comments

Its the Resolution for Ecommerce Shops:)

https://www.loomy.work
1•Omoll•29m ago•0 comments

EROSITA delivers the most comprehensive census of the high-energy Universe

https://www.mpe.mpg.de/8215311/news20260731
1•xioxox•29m ago•0 comments

DeepSeek-AI/DeepSeek-V4-Flash-0731

https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731
6•Philpax•30m ago•0 comments