frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

Systemd 261-Rc1 Released with OS Installer, IMDS Subsystem and New Storagectl

https://www.phoronix.com/news/systemd-261-rc1
1•Bender•29s ago•0 comments

Feds unwittingly leak pilots' pre-crash conversation

https://www.theregister.com/science/2026/05/23/feds-unwittingly-leak-pilots-pre-crash-conversatio...
1•Bender•2m ago•0 comments

Kagi Search API is now in public preview

https://kagi.com/changelog#10622
1•mroche•4m ago•0 comments

A Visual Tour of Classical Electromagnetism (1960)

https://web.mit.edu/8.02t/www/802TEAL3D/visualizations/guidedtour/Tour.htm#_Toc27302365
1•nill0•4m ago•0 comments

My Hermes and Obsidian Setup and Use Cases

https://metedata.substack.com/p/013-my-hermes-and-obsidian-set-up
1•thunderbong•5m ago•0 comments

New rule requires most green-card applicants to apply from outside U.S.

https://www.washingtonpost.com/immigration/2026/05/22/new-rule-requires-most-green-card-applicant...
2•michaelsbradley•9m ago•0 comments

Shocker: Docker implemented in ~300 lines of bash

https://github.com/traceypooh/shocker
1•traceypooh•12m ago•0 comments

Any positive sides of LLM there?

2•artturibyte•13m ago•1 comments

WebFinder for Tailscale

https://zeulewan.github.io/web-finder/index.html
1•zeulewan•16m ago•0 comments

The Web Is About to Get a Second Door

https://medium.com/@vektormemory/the-web-is-about-to-get-a-second-door-5f9fa0fd0d0f
1•vektormemory•20m ago•0 comments

ngn-k tutorial

https://razetime.github.io/ngn-k-tutorial/
1•1vuio0pswjnm7•24m ago•1 comments

The commencement speech that shook the world

https://idiallo.com/blog/the-commencement-speech-that-shook-the-world
1•shaunpud•26m ago•0 comments

Family Abundance | Why Childcare is So Expensive in Silicon Valley

https://proliberal.substack.com/p/family-abundance
1•mtsteiner•29m ago•0 comments

Trying to preserve other peoples code

https://github.com/Essenceia/CRC_generator/tree/main
3•random__duck•33m ago•0 comments

Why Russian Propaganda Works – and How to Stop Falling for It

https://economicsofpower.substack.com/p/why-russian-propaganda-works-and
5•mariuz•40m ago•0 comments

Ask HN: Has anyone solved Amazon's animated GIF captcha programmatically?

3•jrejaud•48m ago•0 comments

Let me AI that for you

https://let-me-ai.com/
2•NordStreamYacht•49m ago•2 comments

Cognitive architecture AI weighted memory, and a falsifiable continuity metric

https://zenodo.org/records/20350249
1•timeless-hayoka•57m ago•0 comments

Authoritative DNS over encrypted transport at OARC 45

https://blog.apnic.net/2026/05/20/authoritative-dns-over-encrypted-transport-at-oarc-45/
1•8organicbits•1h ago•0 comments

I Need Help

https://substack.com/profile/273607136-melissa-mcguckin/note/c-263672437
2•melissamcguckin•1h ago•1 comments

Is AI Profitable Yet?

https://isaiprofitable.com/
98•poyu•1h ago•47 comments

You Only Use 10% of Printf() – Here Are Things They Didn't Teach You [video]

https://www.youtube.com/watch?v=kdnN0kk7MS0
4•bwidlar•1h ago•0 comments

C-style arbitrary precision calculator

https://github.com/lcn2/calc
1•modinfo•1h ago•0 comments

Sci-Hub has created a new AI chatbot. Is it any good?

https://cen.acs.org/policy/publishing/Sci-Hub-created-new-AI/104/web/2026/04
4•scubscub•1h ago•0 comments

You can issue a 15-year SSL certificate today. Why almost nobody does

2•panelica•1h ago•5 comments

What it takes to run an AI coworker on iMessage

https://opencomputer.dev/blog/what-it-takes-to-run-an-ai-coworker-on-imessage/
2•iacguy•1h ago•0 comments

The Bitcoin Governance Event Horizon

https://earthchronicles.substack.com/p/the-bitcoin-governance-event-horizon
2•taguniversalsw•1h ago•0 comments

Megalodon: Mass GitHub Repo Backdooring via CI Workflows

https://safedep.io/megalodon-mass-github-repo-backdooring-ci-workflows/
2•pabs3•1h ago•0 comments

Vince Is Dead (2023)

https://tildas2.tildas.org/art/sad/dead.htm
2•kniffy•1h ago•1 comments

Instant YouTube channel analysis using public metrics

1•Aafy•1h ago•0 comments