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 Norwegian Case for Mediocracy

https://www.ft.com/content/0fe0455d-8633-4e1a-ab8f-f8cd94d60035
1•Anon84•46s ago•0 comments

Guidelines on processing of personal data through blockchain tech (2025) [pdf]

https://www.edpb.europa.eu/system/files/2026-07/edpb_guidelines_202502_blockchain_v2_en.pdf
1•janandonly•4m ago•0 comments

Show HN: Cljbang.el – A Clojure-like language that runs as Emacs Lisp

https://github.com/borkdude/cljbang.el
1•Borkdude•5m ago•0 comments

Saudis and US strike deal for kingdom to enrich uranium

https://www.theguardian.com/us-news/2026/jul/22/saudi-arabia-would-enrich-uranium-under-reported-...
1•geox•10m ago•0 comments

Iran says it attacked Amazon infrastructure in Bahrain

https://www.cnbc.com/2026/07/21/iran-war-update-five-things-to-know-after-resumption-of-hostiliti...
1•zdkaster•10m ago•0 comments

Yogurt

https://en.wikipedia.org/wiki/Yogurt
1•tosh•14m ago•0 comments

Show HN: Imagerry – client-side image customizer and converter (WASM / WebGPU)

https://imagerry.com/
2•its_ajseven•19m ago•0 comments

How the judge on Oracle vs. Google taught himself to code

https://www.theverge.com/2017/10/19/16503076/oracle-vs-google-judge-william-alsup-interview-waymo...
2•subset•19m ago•0 comments

Solvoya – I reverse-engineered 6 European rail/bus APIs for one trip search

https://solvoya.com/
2•solvoya•22m ago•4 comments

Show HN: A Hyprland fork built for parallel, multi-actor computer use

https://github.com/0xmiki/hypr-realm
2•mikiyas•23m ago•0 comments

Show HN: Gml – A Gmail CLI designed for agents

https://github.com/longyijdos/gmail
1•longyijdos•23m ago•0 comments

Richard Medhurst mobile phone seized. Did using a secure phone protect his data?

https://www.computerweekly.com/feature/Journalist-Richard-Medhurst-had-his-mobile-phone-seized-Di...
1•beardyw•24m ago•1 comments

Minuet, a KDE application for music education, calls for testers

https://sandroandrade.org/minuet-26-08-call-for-testers/
2•alberto-m•26m ago•0 comments

Capture of interstellar objects during stellar encounters

https://arxiv.org/abs/2607.18551
2•sciences44•26m ago•0 comments

Show HN: Audience Atlas, Map any GitHub user's followers and followings

https://github-audience-atlas.vercel.app/
1•ThierryRkt•27m ago•1 comments

OpenAI Says Its A.I. Models Went Rogue and Attacked a Digital Library

https://www.nytimes.com/2026/07/21/technology/openai-attack-hugging-face.html
1•ColinWright•28m ago•0 comments

Drip Pricing

https://en.wikipedia.org/wiki/Drip_pricing
1•doener•30m ago•0 comments

Automatic Layout of Railroad Diagrams

https://arxiv.org/abs/2509.15834
1•tosh•32m ago•0 comments

A year in a foxhole: How one Ukrainian soldier survived beneath the front lines

https://www.reuters.com/world/ukraine-russia-war/year-foxhole-how-one-ukrainian-soldier-survived-...
4•petethomas•33m ago•0 comments

Goodbye Discord webhooks, hello Gotify

https://0ut3r.space/2026/07/22/hello-gotify/
1•h0ek•33m ago•0 comments

One Docker socket to rule them all: Escaping Codex, Cursor, and Gemini CLI

https://www.pillar.security/blog/one-docker-socket-to-rule-them-all-escaping-codex-cursor-and-gem...
2•BlueBerry2001•33m ago•0 comments

Turbocharged solo dev – zooming out a couple of clicks

https://adjohu.com/blog/turbocharged-solo-dev/
1•adjohu•34m ago•0 comments

New Araghchi Interview Reveals Iranian Delusions and Vulnerabilities

https://www.meforum.org/mef-observer/new-araghchi-interview-reveals-iranian-delusions-and-vulnera...
1•YeGoblynQueenne•35m ago•0 comments

Friluftsliv

https://en.wikipedia.org/wiki/Outdoor_recreation
1•simonebrunozzi•35m ago•0 comments

Donating another $20M to Public First Action

https://www.anthropic.com/news/donation-public-first-action
2•surprisetalk•36m ago•1 comments

Pegasus: The evolution of the most notorious spyware system

https://securitylab.amnesty.org/latest/2026/07/inside-pegasus-the-evolution-of-the-worlds-most-no...
2•cyb0rg0•38m ago•0 comments

Microsoft strikes 'multibillion-dollar' deal with French AI firm Mistral

https://www.france24.com/en/france/20260721-microsoft-strikes-multi-billion-dollar-deal-to-expand...
5•taubek•39m ago•0 comments

Old Tapes

https://newsletter.doomberg.com/p/old-tapes
1•simonebrunozzi•41m ago•0 comments

Show HN: Ckg-agentforce – Salesforce AgentForce as a traversable MCP graph

https://github.com/Yarmoluk/ckg-agentforce
1•Yarmoluk72•41m ago•0 comments

Low-Background Steel

https://en.wikipedia.org/wiki/Low-background_steel
1•tosh•47m ago•0 comments