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

The Internet Is Starting to Card Everyone. Startups Are Making Millions from It

https://www.inc.com/georgia-fearn/the-internet-is-starting-to-card-everyone-these-startups-are-ma...
1•speckx•1m ago•0 comments

Hwatu: A daemon-based WebKit browser with 13ms window spawns

https://github.com/hongnoul/hwatu
1•hongnoul_•2m ago•0 comments

Show HN: Vifu – An open-source AI runtime for games

https://github.com/vifudotdev/vifu
1•DR_MING•3m ago•0 comments

TTFT benchmark: LLM Gateway vs. OpenRouter (Claude-haiku-4.5, 150 runs)

https://gist.github.com/smakosh/0ca360230fb267d375b91dbd50548b67
1•steebchen•3m ago•0 comments

Thoughts on Integers (2023)

https://blog.xoria.org/integers/
1•mpweiher•4m ago•0 comments

Slash Pages

https://slashpages.net/
1•birdculture•6m ago•0 comments

Show HN: Interact with inactive macOS windows without selecting the window first

https://github.com/dainank/apple-click-through
1•dainank•6m ago•0 comments

Show HN: LiteRadar – Fast, ad-free, 60fps weather radar

https://literadar.com
2•peetle•6m ago•1 comments

Productionizing research is a boundary problem

https://rpc3.dev/posts/productionizing-research-is-a-boundary-problem/
1•rpc3•8m ago•0 comments

How to build interactive experiences with canvases

https://github.blog/ai-and-ml/github-copilot/how-to-build-interactive-experiences-with-canvases/
1•Brajeshwar•8m ago•0 comments

Show HN: CoreBase – Governed AI Agents for your product, on your customers' data

https://corebasehq.com
1•y11t0•9m ago•1 comments

Natural raises $30M to reinvent payments for AI agents – and take on Stripe

https://thenextweb.com/news/natural-series-a-agentic-payments-ai-agents
1•krrishd•9m ago•0 comments

Google Commits $40M to the Genesis Mission – Google Cloud Blog

https://cloud.google.com/blog/topics/public-sector/accelerating-frontiers-of-scientific-discovery...
1•xnx•9m ago•0 comments

Google ordered to open Android and Search to rivals in Europe

https://www.theverge.com/policy/966438/eu-google-android-ai-interoperability-search-data-dma
1•smugma•13m ago•1 comments

When Listening to Music Was a Team Sport

https://www.nytimes.com/2026/07/21/arts/design/art-of-noise-cooper-hewitt-smithsonian-design.html
1•reaperducer•13m ago•0 comments

Show HN: Codify – Terraform for Developer Environments

https://codifycli.com/
3•kevinwang5658•14m ago•2 comments

OSS ChatGPT WebUI v4 – Projects, Agent Profiles, Server Tools, 1-Click Sharing

https://llmspy.org
1•mythz•15m ago•0 comments

European Commission: Guidance to Google for AI Interoperability on Android

https://daringfireball.net/2026/07/ec_google_guidance_android_ai_and_search_sharing
1•smugma•15m ago•0 comments

Samsung Galaxy Z Fold8 Ultra, Fold8 and Flip8

https://news.samsung.com/global/samsung-galaxy-z-fold8-ultra-fold8-and-flip8foldables-perfected-f...
1•jerryslm•16m ago•0 comments

Security.ubuntu.com Is Down

https://status.canonical.com/#/incident/KNms6QK9ewuzz-7xUsPsNylV20jEt5kyKsd8A-3ptQHXz-Eu10FX079C0...
2•moebrowne•17m ago•0 comments

Ukraine's secret weapon: The bright pink 'Flamingo' missiles

https://www.dailymail.com/news/article-15996043/Ukraine-secret-weapon-pink-Flamingo-missiles-engi...
4•Bender•18m ago•0 comments

Agent-Shell 0.63 Updates

https://xenodium.com/agent-shell-0-63-updates
2•xenodium•19m ago•0 comments

Looking for the Ladder

https://agglomerations.eig.org/p/looking-for-the-ladder
2•toomuchtodo•19m ago•0 comments

Universe Pro appears to be a Ponzi-style crypto investment scheme

https://anon8109361.github.io/universe-pro-investigation/
2•Monotoko•19m ago•2 comments

Show HN: Web swing through midtown NYC

https://www.swingnyc.com/
2•shahahmed•19m ago•0 comments

Reddit Marketing Strategy: How Founders Use Reddit Without Sounding Promotional

https://reddmatch.com/blog/reddit-marketing-strategy
2•eradon•19m ago•0 comments

Trump hands powerful nuclear technology to Saudi Arabia as Iran war spirals

https://www.dailymail.com/news/article-15996501/Trump-sparks-fear-hands-powerful-nuclear-technolo...
4•Bender•20m ago•0 comments

Claude Playing Crusader Kings 3

https://www.twitch.tv/skullbloc
2•stebbins•20m ago•1 comments

Agentic Workflow's Cache Keepalive Costs 8x Too Much

https://blog.mempko.com/keeping-the-kv-cache-warm-measuring-prompt-cache-eviction-across-anthropi...
2•mempko•20m ago•1 comments

Machina Machista

https://mpadge.eu/blog/machina-machista.html
3•mpadge•20m ago•0 comments