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

We should be more ambitious with the software we build

https://danluu.com/ambitious/
1•ltratt•1m ago•0 comments

FBI Explores Espionage Case Against Saudi OpenAI Suspect

https://www.wsj.com/us-news/law/fbi-explores-espionage-case-against-saudi-openai-suspect-fbaedefe
1•JumpCrisscross•1m ago•0 comments

Small Programs and Languages

https://ratfactor.com/cards/pl-small
1•andsoitis•4m ago•0 comments

The Importance of Limitations for Creativity and Learning

https://ratfactor.com/cards/limitations
1•andsoitis•6m ago•0 comments

Forecasting Financial Markets with Timestral

https://philippdubach.com/posts/forecasting-financial-markets-with-timestral/
1•7777777phil•6m ago•0 comments

The Experiment review – easily the most disturbing thing on British TV

https://www.theguardian.com/tv-and-radio/2026/oct/21/the-experiment-channel-four-tv-review-uk-naz...
1•nephihaha•6m ago•0 comments

Show HN: WhatsApp Bridge for those with their own VPS

https://github.com/vid-t/whatsapp-bridge
1•vid_t•7m ago•1 comments

Israeli central bank rejects Netanyahu's plan to use crypto to evade sanctions

https://www.ft.com/content/39e475e7-0392-4856-aaaf-5ab3e35b8215IsraelicentralbankrejectsBenjaminN...
2•JumpCrisscross•8m ago•0 comments

Interesting properties about the design of the UK 50p piece [pdf]

https://cdn.ima.org.uk/wp/wp-content/uploads/2022/03/Westward-Ho-Conway-Concorde-and-curiously-cu...
1•greengreengrass•10m ago•0 comments

US executives quit $25B gas venture over claims of secret Russian control

https://www.ft.com/content/e9cfbfbb-e65a-4303-aebb-20d59319ef1b
3•JumpCrisscross•10m ago•0 comments

How to Start a Startup Game

https://www.neuroplusgbrain.net/
1•FDX2018•12m ago•0 comments

Apple should fuck themselves with their "privacy"

5•itvision•16m ago•0 comments

The power of having less features

https://ratfactor.com/cards/no-feature
1•andsoitis•17m ago•0 comments

OpenAI says it will no longer train its AI models on the live internet

https://techcrunch.com/2026/10/23/openai-says-it-will-no-longer-train-its-ai-models-on-the-live-i...
1•colinprince•17m ago•0 comments

Bridgeplay: Windows Steam games on your Mac

https://bridgeplay.dev/
1•evo_9•19m ago•0 comments

Vaccine generates immune response to KRAS mutations in pancreatic cancer study

https://newsnetwork.mayoclinic.org/discussion/investigational-vaccine-generates-immune-response-t...
3•slater•20m ago•0 comments

Who Wrote This Byte: git blame for your build’s bytes

https://fzakaria.com/2026/10/23/who-wrote-this-byte
1•ingve•21m ago•0 comments

Who Owns the Roadmap? Six Ways to Build a Forward Deployed Engineering Business

https://mwvdveld.substack.com/p/who-owns-the-roadmap-six-ways-to
1•RenaissanceDad•21m ago•1 comments

Doctors' offices are charging patients 10 times more by claiming to be hospitals

https://www.washingtonpost.com/business/2026/10/24/doctors-offices-are-charging-patients-10-times...
2•bookofjoe•23m ago•1 comments

A stack to calm the mind and stay on track

https://ratfactor.com/stack/
1•Curiositry•24m ago•0 comments

Ask HN: Any real cases where AI slop ruined a codebase and forced a rewrite?

1•hukuuu•25m ago•0 comments

Making My Blog Readable by AI Agents

https://deallocatedobjects.com/posts/making-my-blog-readable-by-ai-agents
1•ingve•27m ago•0 comments

Data center spend will double to $2.1T by 2028

https://www.reuters.com/business/data-center-spending-more-than-double-21-trillion-by-2028-2026-1...
1•sumnole•31m ago•0 comments

Procrastination is burning my future

https://www.mashally.org/posts/procrastination_is_burning_my_future/
1•mashally•32m ago•0 comments

Studies violate policies on collaboration between editors and authors

https://retractionwatch.com/2026/10/22/editorcheck-handling-editors-authors-collaboration-plos-md...
1•leephillips•36m ago•0 comments

Sevenbox, find what an AI agent's wrong decision affected

https://github.com/sevenboxlabs/sevenbox
2•ObeeAI•39m ago•0 comments

Community

https://marco.org/2026/10/24/community
2•colinprince•40m ago•2 comments

Lobster, Programming Languages, and Game Engines [video]

https://www.youtube.com/watch?v=hDT79xdqf3k
2•andsoitis•46m ago•0 comments

Apple Hides a Playable Classic iPod Inside Its Music Website

https://www.macobserver.com/news/apple-hides-a-fully-playable-classic-ipod-inside-its-music-website/
1•wodow•46m ago•0 comments

Show HN: Perch, a calm Mac app for juggling Claude Code sessions

https://perchfocus.com/
1•eastandwestwind•47m ago•0 comments