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

How did I publish a paper in ACMKDD as an undergraduate

https://medium.com/@JarrettYe/how-did-i-publish-a-paper-in-acmkdd-as-an-undergraduate-c0199baddf31
1•ktimespi•2m ago•1 comments

Writers need new strategies to stand up to AI

https://www.thedial.world/articles/news/copyright-law-ai-intellectual-property
2•colinprince•3m ago•0 comments

Gary Marcus: US won't "win" AI war with China. What we should do instead.

https://garymarcus.substack.com/p/china-has-all-but-caught-up-the-us
1•giardini•6m ago•0 comments

Scientists Visualize the Complex, Dynamic World Inside a Human Cell

https://mymodernmet.com/eukaryotic-cell-digizyme/
1•o4c•8m ago•0 comments

US judge approves Anthropic's $1.5B settlement of copyright lawsuit

https://finance.yahoo.com/technology/ai/articles/us-judge-approves-anthropics-1-204851948.html
1•lilerjee•8m ago•0 comments

Magnet Fishing on a Military Base [video]

https://www.youtube.com/watch?v=l0uMGoW1KPM
1•xvxvx•10m ago•1 comments

New spinning drone hides in plain sight

https://news.northwestern.edu/stories/2026/07/new-spinning-drone-hides-in-plain-sight
1•o4c•13m ago•0 comments

A Practical Guide to Calculating, Pricing, and Building Recurring

https://ebookbizai.com/store/maggiebookhub/home
1•bokeke1•13m ago•0 comments

Building Agentic Workflows in Python with LangGraph

https://machinelearningmastery.com/building-agentic-workflows-in-python-with-langgraph/
2•eigenBasis•14m ago•0 comments

Mevion: Low-Cost Open-Source Data Collection System for Dual-Arm Manipulation

https://haraduka.github.io/mevion-hardware/
2•ilreb•16m ago•0 comments

AI Is Changing the Economics of Native Apps

https://medium.com/@robsandhu/ai-is-changing-the-economics-of-native-apps-e81c7f325948
3•rsandhu•17m ago•0 comments

DepthART: Scaling Foundation Monocular Depth to Tiny Models

https://xuefeng-cvr.github.io/DepthART/
2•ilreb•17m ago•0 comments

Is surveillance risk chilling your online speech?

5•Webstir•19m ago•1 comments

Show HN: Turn casual photos into professional headshots with AI

https://portraify.app
3•camel2243•23m ago•0 comments

Hugging Face warns an autonomous AI agent hacked its network

https://www.bleepingcomputer.com/news/security/hugging-face-breach-autonomous-ai-agent-system-int...
3•sbulaev•29m ago•0 comments

Invisible Details

https://invisibledetails.com
2•handfuloflight•30m ago•0 comments

Snake-and-commits: Turn your GitHub contribution graph into a real game of Snake

https://github.com/dahan8473/snake-and-commits
2•thunderbong•33m ago•0 comments

Top American AI Execs Sound Alarm on Chinese Models

https://www.wsj.com/tech/ai/top-american-ai-execs-sound-alarm-on-chinese-models-3c74f8c1
2•Cider9986•33m ago•1 comments

Is OpenCode and Kimi K3 better than Claude Code?

2•vijayst•34m ago•2 comments

A Cap Table for Your Life

https://www.karthikuppu.com/personal-token
2•koopuluri•35m ago•0 comments

Motif-3-Beta

https://huggingface.co/Motif-Technologies/Motif-3-Beta
2•ilreb•37m ago•0 comments

Reductions Network – A Compendium of Reductions

https://reductions.network/
2•o4c•37m ago•0 comments

ML-pokedex – experiments trying to train some models directly on RDF

https://alganet.github.io/ml-pokedex/index.html
2•gaigalas•37m ago•0 comments

Wireless Communication Software Defined Radio (SDR) Course

https://wirelesspi.com/sdr-course/
2•teleforce•38m ago•0 comments

DeepSWE – Best Benchmark for Evaluating AI Coding Agents?

https://www.i-programmer.info/professional-programmer/103-i-programmer/18759-why-software-enginee...
2•aquastorm•38m ago•0 comments

Malicious Agent Skills in the Wild

https://arxiv.org/abs/2602.06547
2•yruzin•41m ago•0 comments

Show HN: Envy - A flat-file, frictionless note-taking application for macOS

https://envynote.app
3•widowlark•41m ago•0 comments

MiniMax M3: How Sparse Attention Makes Long-Horizon Agents Practical

https://twitter.com/omarsar0/status/2074494774292148726
4•gmays•44m ago•0 comments

Kimi Linear: An Expressive, Efficient Attention Architecture

https://arxiv.org/abs/2510.26692
3•ashish01•47m ago•0 comments

Show HN: Shackle – Deterministic runtime governance for AI agents

https://github.com/Fame510/SHACKLE
2•shacklepro•48m ago•0 comments