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

A self-disinfecting fabric eliminates bacteria, fungi and viruses

https://www.upv.es/noticias-upv/noticia-16087-un-tejido-auto-en.html
1•geox•2m ago•0 comments

rerecord: docs screenshots as text

https://www.npmjs.com/package/rerecord
1•TheSaifurRahman•2m ago•0 comments

Show HN: CallSitter – bot that answers my calls and wastes scammers' time

https://github.com/szerintedmi/callsitter
1•szert•6m ago•0 comments

MNT Pocket Reform Laptop – MNT Research Shop

https://shop.mntre.com/products/mnt-pocket-reform
1•tambourine_man•6m ago•0 comments

Kosmos 2612 and ICEYE-X36: a worrisome cat-and-mouse-game in Space

https://sattrackcam.blogspot.com/2026/10/kosmos-2612-and-iceye-x36-worrisome-cat.html
2•runningmike•8m ago•2 comments

How Far Will AI Assistants Go for a Refund They Can't Get?

https://www.vals.ai/blogs/impossible-refund
2•DeepLogin•8m ago•0 comments

Show HN: A 3D catalog of rocket engines you can take apart

https://farsidelab.com/concept/rocket-engines/
1•kari_nojd•11m ago•0 comments

Show HN: APIFlow Studio – A browser API client with local mock responses

https://apiflowstudio.onrender.com/
1•yashpateldev•11m ago•0 comments

From 'I want my own harness' to corporate sponsorship

https://dirac.run/posts/from-my-own-harness-to-corporate-sponsorship
1•GodelNumbering•12m ago•0 comments

Una Watch TOTP – MFA on your wrist!

https://shkspr.mobi/blog/2026/10/una-watch-totp-mfa-on-your-wrist/
1•ColinWright•12m ago•0 comments

Show HN: I built a smart audiobook converter that sounds human (not KokoroTTS)

https://www.book2speech.com/
2•orencoda•13m ago•0 comments

How to Make Your Own Flying Car AI Video (Make a Tesla Roadster AI Video)

https://roadster-ai.net/blog/how-to-make-roadster-ai-video
1•Moon_Y•13m ago•0 comments

Show HN: CardChase, recover failed subscription charges before they churn

https://thecompound.tech
1•kyisaiah47•15m ago•0 comments

CVE-2026-55562 PoC?

https://www.patchcve.com/reference/cve/CVE-2026-55562
1•PatchCVE•17m ago•1 comments

Ask HN: How to speed up code-reviews?

2•baalimago•19m ago•2 comments

A New Way to Think About Borrow Checking (In Reverse)

https://verdagon.dev/blog/reverse-borrow-checking
3•verdagon•20m ago•2 comments

ODS: NHS Organisational Data as Parquet Files

https://github.com/olizilla/ods
1•pacharanero•20m ago•0 comments

Show HN: A forest's wildlife, synthesized live in Rust, playable in the browser

https://zaghaghi.github.io/spore-and-skog-dev-log/
5•zaghaghi•21m ago•0 comments

Hands up who thinks anarchism is a constitutional theory?

https://cambridgeblog.org/2026/10/hands-up-who-thinks-anarchism-is-a-constitutional-theory/
2•jruohonen•22m ago•0 comments

Show HN: The Handsome Boy

https://www.derschoenejunge.de/index.html
1•damuellen•28m ago•0 comments

Agent-bridge – an OpenAI-compatible API for headless coding-agent CLIs

https://github.com/R3n3r0/agent-bridge
2•paolorusso•28m ago•0 comments

Google Meet Enshittification

4•chrisjj•32m ago•0 comments

I've been using an AI agent for a month, and I'm both impressed and terrified

https://www.androidauthority.com/using-ai-agent-instinct-one-month-later-impressions-3720825/
1•donk8r•36m ago•1 comments

Hyperland (1990)

https://archive.org/details/Hyperland1990
2•GaryBluto•37m ago•0 comments

Chips Under Control?

https://www.mpg.de/27039176/hardwaresecurity-quantumcryptography
1•jruohonen•39m ago•0 comments

Show HN: Shipback – SFTP deploys your AI agent can undo

https://github.com/aldohushi1-stack/shipback-sftp
4•aldoh•42m ago•0 comments

Who Owns the Machines?

https://www.iankduncan.com/personal/2026-10-15-who-owns-the-machines/
3•notfried•45m ago•1 comments

It's time to shut down business schools

https://www.nytimes.com/2026/10/18/opinion/business-school-mba-harvard-cornell-cambridge.html
2•ilamont•45m ago•0 comments

Doctors and Lawyers Are Joining AI's $400-an-Hour Gig Economy

https://news.bloomberglaw.com/esg/doctors-and-lawyers-are-joining-ais-400-an-hour-gig-economy
1•theanonymousone•47m ago•0 comments

The Cost of Looking Competent

https://yusufaytas.com/the-cost-of-looking-competent
7•yusufaytas•48m ago•0 comments