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

Getty Images Advances Financial Restructuring

https://investors.gettyimages.com/news-releases/news-release-details/getty-images-advances-financ...
1•sharpshadow•33s ago•0 comments

Show HN: Cryptex Vault – A password manager designed to outlive its creator

https://www.cryptex-vault.com/
1•Bl4cksmith•56s ago•0 comments

The New Age of Reading

https://www.newyorker.com/magazine/2026/10/26/james-daunt-profile
1•FinnLobsien•57s ago•0 comments

Magnitude-7 earthquake hits Tibet, killing at least 16 destroying hundreds homes

https://www.theguardian.com/world/2026/oct/23/magnitude-7-earthquake-hits-china-tibet
1•teleforce•1m ago•0 comments

I revived an app I built 3 years ago to put limits on my spending

https://spendion.onrender.com
1•guzmanluis•4m ago•0 comments

Text Is Unnatural, and LLMs Are Built on It

https://www.innerkore.com/blog/text-is-unnatural-llms-learn-the-map/
1•gagan2020•6m ago•0 comments

Show HN: KronLSTM Walkthrough

https://kron-lstm.vercel.app/
2•aithena•6m ago•0 comments

Hackers Are Serving Malware to iPhones via Infected Websites

https://www.forbes.com/sites/thomasbrewster/2026/10/22/apple-iphone-hacks-via-infected-websites/
1•alt227•8m ago•0 comments

Php2shell Scanner

https://github.com/assetnote/php2shell-scanner
1•runesor•8m ago•0 comments

The Things – The Thing as told from the creature's perspective

https://clarkesworldmagazine.com/watts_01_10/
1•jkly•8m ago•0 comments

Meta Muse hits 10M users

https://fortune.com/2026/10/22/mark-zuckerberg-meta-muse-stripe-credit-limit-shopping/
1•satvikpendem•9m ago•0 comments

Chinese mathematician Sun Zhiwei proposes 1k problems to challenge AI

https://www.scmp.com/news/china/science/article/3371652/chinese-mathematician-sun-zhiwei-proposes...
1•jonbaer•11m ago•0 comments

Google DeepMind Engineer Resigns in Protest of Pentagon Contract

https://theintercept.com/2026/10/21/google-deepmind-resign-ai-military-gaza/
3•kome•16m ago•0 comments

The Rise and Fall of Jev

https://blog.alexewerlof.com/p/rise-and-fall-of-jev-eval-hype-vs-llm
2•flail•18m ago•0 comments

Show HN: Kucedr (was Friday) – a desktop AI agent that runs on your machine

https://www.kucedr.com/
1•haraldbregu•19m ago•0 comments

Lobsters: Rename vibecoding to LLMs (Greasemonkey script)

https://greasyfork.org/en/scripts?by=1646191
1•birdculture•20m ago•0 comments

WeChat TUI

https://github.com/kevmo314/wechat-cli
1•kevmo314•21m ago•0 comments

How to become a top-tier AI agent user (0.01%)?

1•vishalwaghmode•24m ago•1 comments

Ukraine is wiping out Russian data centers, setting its AI race back

https://fortune.com/2026/10/22/ukraine-russia-drones-data-centers-ai-race/
1•entryleveljobsc•24m ago•0 comments

Show HN: A super fast(est), staged zsh plugin manager (github.com/arastu/zflash)

https://github.com/arastu/zflash
2•arastuq•24m ago•0 comments

A new Digital Audio Workstation created using AI

https://github.com/BurningTreeC/faderframe
2•BTC_BurningTree•25m ago•1 comments

A Robust Decentralized Infrastructure for Trust-Aware Open Knowledge Sharing

https://knowledgepixels.com/nanopub-ecosystem-paper/
2•tkuhn•29m ago•3 comments

ScalarDB 3.19 has been released

https://medium.com/scalar-engineering/scalardb-3-19-has-been-released-8f6cc4ef8fec
3•josh-scalar•40m ago•0 comments

What PHP2Shell Does – A Bartender Analogy

https://joeykeller.com/php2shell-bartender
2•sdoering•40m ago•0 comments

The CS50 Show with David J. Malan [video]

https://www.youtube.com/watch?v=4t23RAQNrPk
2•vismit2000•40m ago•0 comments

Argument from Incredulity

https://www.logicallyfallacious.com/logicalfallacies/Argument-from-Incredulity
3•Bluestein•41m ago•0 comments

Fortescue is using KUKA welding robots to handle 6 MW charging cables

https://electrek.co/2026/10/22/fortescue-is-using-kuka-welding-robots-to-handle-6-mw-charging-cab...
3•cisc•41m ago•0 comments

Dutch intelligence service spied on phone of Trump's son-in-law Jared Kushner

https://nltimes.nl/2026/10/23/dutch-intelligence-service-spied-phone-trumps-son-law-jared-kushner...
6•amelius•43m ago•2 comments

TSMC seeks factory-equipment alternatives to thwart China's rare earths grip

https://www.reuters.com/world/china/tsmc-seeks-factory-equipment-alternatives-thwart-chinas-rare-...
2•giuliomagnifico•44m ago•0 comments

What a Terrible Day to Have a Computer

https://blog.ricci.io/what-a-terrible-day-to-have-a-computer-d6b323r
3•ColinWright•45m ago•0 comments