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

New NFS2ROOT Linux flaw can let attackers gain root privileges

https://www.bleepingcomputer.com/news/security/new-nfs2root-linux-flaw-can-let-attackers-gain-roo...
1•david_shaw•6m ago•0 comments

Werner Vogels' Tech predictions for 2027 and beyond

https://www.allthingsdistributed.com/2026/11/tech-predictions-for-2027-and-beyond.html
1•simonebrunozzi•9m ago•0 comments

Jared Kushner's 70-minute interview reveals naive bias

https://www.theguardian.com/us-news/2026/nov/27/jared-kushner-interview-peril-putin-corporate-rival
1•hbarka•11m ago•0 comments

The Russian billionaire with a secret stake in Tether

https://www.ft.com/content/260cdf2f-f878-4b00-9ea3-5253d7697d13
1•JumpCrisscross•11m ago•0 comments

The math behind large language models

https://avidlive.ai/llm-math
1•dluuuu•11m ago•0 comments

InkDraft – an iPad notebook that ChatGPT and Claude can read on request

https://inkdraft.org/
1•bmbrewington4•12m ago•0 comments

Astronomers Detect Evidence of Tunnels Beneath the Surface of the Moon

https://www.sciencealert.com/astronomers-detect-evidence-of-vast-tunnels-beneath-the-surface-of-t...
2•cybermango•13m ago•0 comments

The NYT's new AI columnist was paid by an Anthropic investor

https://x.com/i/trending/2126384772712648849
3•analyst74•14m ago•0 comments

Patient lawsuit alleges smart knee tracking implant installed without consent

https://consumerrights.wiki/w/Persona_IQ_smart_knee_implant_consent_lawsuits
3•basilikum•20m ago•0 comments

Contra Scott on SURA

https://vitalik.eth.limo/general/2026/11/28/contra_scott_on_sura.html
1•BenPace•20m ago•0 comments

Has AI just cracked Internet encryption? Rumoured 'bombshell' stuns scientists

https://www.nature.com/articles/d41586-026-03875-6
1•howard941•21m ago•0 comments

Native Shell

https://nsh.dev/
2•shepherdjerred•22m ago•1 comments

I Interrogated Saddam Hussein. This Is What We Got Wrong

https://www.nytimes.com/2026/11/28/opinion/saddam-hussein-us-iraq-war.html
1•johnny313•27m ago•1 comments

Time to Resurrect Direct File?

https://donmoynihan.substack.com/p/time-to-resurrect-direct-file
2•hn_acker•29m ago•0 comments

Roald Dahl's contribution to neurosurgery: the Wade-Dahl-Till shunt

https://pmc.ncbi.nlm.nih.gov/articles/PMC3029661/
4•thunderbong•29m ago•0 comments

Atto: Compact Embedding Models as small as 800 parameters

https://huggingface.co/blog/neuml/introducing-atto
1•dmezzdev•30m ago•0 comments

Show HN: I built an open-source AI interview assistant for Windows

https://floxolab.com/blog/build-free-ai-interview-assistant
1•floxolab•35m ago•0 comments

My Typing Mini-Game

https://lzon.ca/posts/blog/000096-quote-typing-game/
1•jpmitchell•36m ago•0 comments

Nvidia Hype

1•bdwilnalex•36m ago•0 comments

Show HN: I made a tiny live replica of SFO

https://tinysfo.com/
18•eiiot•37m ago•2 comments

The Rise of Microsoft Windows Part 3: Windows 3.0 [video]

https://www.youtube.com/watch?v=P2fJerxKeZ8
1•st_goliath•37m ago•0 comments

Stricter checks for uploaded distributions on PyPI

https://blog.pypi.org/posts/2026-11-18-stricter-checks-for-uploaded-sdists/
1•rbanffy•37m ago•0 comments

Show HN: Oho – a browser extension that rejects cookie banners

https://github.com/0khacha/oho
1•0med•38m ago•0 comments

Bat 0.27.0 Released

https://github.com/sharkdp/bat/releases/tag/v0.27.0
1•indentit•39m ago•0 comments

Teenage Engineering K.O. AMP-35 portable amplifier [video]

https://www.youtube.com/shorts/XBqZZymT3C4
1•gregkb•39m ago•1 comments

Show HN: An open-source dating app foundation instead of building from scratch

https://ph7builder.com/social-dating-features/
1•pierres7•40m ago•0 comments

I Restored The 1939 GM Futurliner [video]

https://www.youtube.com/watch?v=7J2Vx_pQ9jc
1•wizardforhire•41m ago•0 comments

Show HN: Just Dashboard, open-source Linux full management dashboard

https://just-dashboard.com/
1•Wayy10•43m ago•0 comments

Orca – SecureDrop+Tor Whistleblowing Platform for Big Tech Workers

https://orcaresist.org/index.html
1•HotGarbage•45m ago•0 comments

Character.ai Bankruptcy Auctions 21M Users' Private Conversations

https://www.chosun.com/english/industry-en/2026/11/27/C4UJBF7FORHGNAJTE4G27BS7JQ/
8•haunter•46m ago•1 comments