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 US added a record 20.2 GWh of battery storage in just 3 months

https://electrek.co/2026/08/31/the-us-added-a-record-20-2-gwh-of-battery-storage-in-just-3-months/
2•ljf•1m ago•0 comments

Show HN: Levo – a macOS menu bar app for timed stretch breaks

https://levo.zaploom.in/
1•kapil708•2m ago•0 comments

Chained PHP2Shell Exploit Roots 25 Servers, Including US Government Servers

https://dreamgroup.com/blog/chained-php2shell-exploit-roots-25-servers
2•882542F3884314B•3m ago•0 comments

Widespread ransomware attacks reported on Synology NAS, including on latest DSM

https://old.reddit.com/r/synology/comments/1xhqgov/well_it_finally_happened_my_first_real_ransomw...
3•supersing•6m ago•0 comments

Show HN: I got tired of travel spreadsheets so I made a travel planner app

https://www.wherewhen.cc
2•stavros•8m ago•0 comments

Show HN: MiniToolDesk – 100% client-side developer toolbox (35 tools, no ads)

https://minitooldesk.com/
2•minitooldesk•9m ago•0 comments

AI Industry's Gamble on Trump Crashes into New Political Reality

https://www.bloomberg.com/news/features/2026-10-29/ai-industry-stands-to-lose-in-midterm-election...
1•angry_impala•10m ago•0 comments

HeavyAI (formerly MapD) is now open source

https://github.com/heavyai/heavydb
1•jonbaer•11m ago•0 comments

Nvidia Chief Seen as Target of Chinese Spy Plot

https://www.nytimes.com/2026/10/29/us/politics/nvidia-china-jensen-huang-trump.html
2•u1hcw9nx•12m ago•1 comments

Lindroids, run Linux apps on Android from any container application

https://github.com/dixonSolutions/lindroids
3•rat_rad•18m ago•1 comments

Sprout – A Modern Motherboard for Old iPods

https://certainthings.studio/sprout/
2•voisin•22m ago•0 comments

Website migration costs are going to zero

https://dri.es/website-migration-costs-are-going-to-zero
2•esher•23m ago•0 comments

Anthropic engineer declares the coding interview dead

https://www.theregister.com/ai-and-ml/2026/10/28/anthropic-engineer-declares-the-coding-interview...
4•signa11•24m ago•0 comments

The provocative new theory that could explain aging and disease

https://www.scientificamerican.com/article/the-provocative-new-theory-that-could-explain-aging-an...
1•voisin•25m ago•0 comments

AI Article Reviews Dominate Human Peer Reviews at Their Best [pdf]

https://gking.harvard.edu/files/peerless.pdf
1•qsi•27m ago•0 comments

Matrix takes sovereign messaging into the realm of the tech giants

https://www.theregister.com/software/2026/10/29/matrix-takes-sovereign-messaging-into-the-realm-o...
1•defrost•27m ago•0 comments

Show HN: Endlesstokens – an LLM API billed by time, not tokens

https://endlesstokens.ai/
1•mirastacklabs•28m ago•0 comments

Building a Banana Sorter AI Machine

https://www.bvaibhav.info/notes/banana-sorter
1•vb7132•31m ago•0 comments

Em dashes on Reddit have become 10 times more popular in a few years

https://kissmypost.com/research/em-dash-chatgpt-reddit
4•DeepLogin•31m ago•1 comments

Systemd Inhibitor Locks

https://systemd.io/INHIBITOR_LOCKS/
1•ankitg12•31m ago•0 comments

A full-featured web framework written in Gleam, running on the BEAM

https://github.com/howdy-gleam/howdy
1•crowdhailer•32m ago•0 comments

Local Code by Draw Things: open-source frontier intelligence on your Mac

https://releases.drawthings.ai/p/local-code-by-draw-things-open-source
1•joshcsimmons•32m ago•0 comments

CATL pushes ahead with 20 Ah solid-state EV batteries, with 500 Wh/kg in sight

https://electrek.co/2026/10/28/catl-pushes-ahead-20-ah-solid-state-ev-batteries-500-wh-kg/
2•cisc•35m ago•0 comments

We explain how attackers keep reading mail after M365 session revocation

https://labs.eye.security/how-attackers-keep-reading-mail-after-m365-session-revocation/
1•646754375•37m ago•0 comments

I Used AI to Fake a Scientific Paper. Here's What Happened

https://spectrum.ieee.org/ai-generated-scientific-papers
2•pseudolus•38m ago•0 comments

Residential proxy sourcing and consent: Q&A with Massive's CEO

https://www.reddit.com/r/WebScrapingInsider/comments/1xf9hdj/where_do_residential_proxies_really_...
15•Smith-7831•38m ago•0 comments

Hackers expose the identities of more than 40k DHS employees

https://www.npr.org/2026/10/28/nx-s1-6021497/dhs-hack-ice
1•pseudolus•39m ago•1 comments

Chopchop

https://chopchop.cbu.uib.no/about
2•altilunium•41m ago•0 comments

Mnemosyne latest version on GitHub by 28naem

https://github.com/28naem-del/mnemosyne
1•mnemosyai•41m ago•0 comments

Phone was compromised before the user turned it on: the rise of Midnight Mimosa

https://www.bitdefender.com/en-us/blog/labs/midnight-mimosa-malware
3•exceptione•43m ago•1 comments