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

Science investigation casts doubt on genes hailed for warding off Alzheimer's

https://www.science.org/content/article/science-investigation-casts-doubt-genes-hailed-warding-al...
1•sbulaev•1m ago•0 comments

Move FreeBSD System Between ZFS Disks

https://vermaden.wordpress.com/2026/08/14/move-freebsd-between-zfs-disks/
1•vermaden•1m ago•0 comments

PBS loses 70 years of TV history after cloud storage vendor goes defunct

https://www.tomshardware.com/software/cloud-storage/nine-pbs-loses-access-to-70-years-of-data-aft...
2•doener•2m ago•0 comments

The Coldcard Hack: A Postmortem

https://praveenperera.com/blog/coldcard-mk3-weak-rng-wave1/
1•abrowne2•3m ago•0 comments

Inside North Korea's Operation to Conquer the American Job Market

https://www.wsj.com/business/media/inside-north-koreas-operation-to-conquer-the-american-job-mark...
1•bookofjoe•5m ago•1 comments

The Evolving Role of the Red Team in the Era of Agentic Security

https://blog.google/security/the-evolving-role-of-the-red-team-in-the-era-of-agentic-security/
1•shaunpud•13m ago•0 comments

An anchoring layer between facts and AI memory

https://github.com/Anchorstate-Lab/GMR
1•Zongming•15m ago•1 comments

Further Developments About Internal AI Models Hacking Things

https://thezvi.substack.com/p/further-developments-about-internal
1•gmays•17m ago•0 comments

Show HN: AI Slop Kitchen

https://play-kitchen.netlify.app/
1•admtal•18m ago•0 comments

Think of AI as a lens, not a person

https://aethermug.com/posts/gen-ai-is-a-lens-into-humanity
2•mrcgnc•22m ago•0 comments

Loyalty cards that live in Apple/Google Wallet, no app to install

https://www.fideliyapass.com/
2•zakox•25m ago•0 comments

The Trump administration's Most Dangerous Attack on Science Yet

https://www.realclearscience.com/articles/2026/08/11/the_trump_administrations_most_dangerous_att...
4•rbanffy•26m ago•0 comments

Seoul soars past Dubai as busiest international airport

https://www.ft.com/content/f3f3c945-6a75-4663-b8ec-d5251438c1c5
3•JumpCrisscross•28m ago•0 comments

Watch It Work

https://www.texturehq.com/blog/watch-it-work
2•victorquinn•28m ago•0 comments

Show HN: Making Autonomous Work Reviewable

https://markupbase.com/whitepapers/making-autonomous-work-reviewable/
2•jasondoyle•29m ago•0 comments

14,000 crypto holders face security risk after Trezor data breach

https://www.ft.com/content/a91356ef-67bd-4bd9-947b-b272423f1318
3•petethomas•34m ago•0 comments

HoneyMatcha – A coordination platform for you and your personal agent

https://honeymatcha.io/
1•JaiRathore•36m ago•0 comments

Using AI chatbots? Here are four ways to reduce the energy drain

https://knowablemagazine.org/content/article/food-environment/2026/four-ways-to-reduce-energy-use...
1•knowablemag•37m ago•0 comments

Fibermaxxing? Your microbes (and your health) say thanks

https://knowablemagazine.org/content/article/health-disease/2026/fiber-feeds-the-microbiome-and-i...
1•knowablemag•39m ago•2 comments

What can we learn from Australia's social media ban for teens?

https://knowablemagazine.org/content/article/society/2026/studying-the-social-media-ban-under-six...
1•knowablemag•39m ago•0 comments

AI Looms over Software Companies – and the Investors Who Piled into Them

https://www.bloomberg.com/graphics/2026-ai-private-equity-software/
1•petethomas•41m ago•0 comments

Show HN: MCP-stama – An ultra-fast Rust MCP server with no dependencies

https://github.com/StamManif/mcp-stama
48•stammanif•41m ago•0 comments

OpenAI's Revenue Run Rate Tops $40B Ahead of IPO

https://www.bloomberg.com/news/articles/2026-08-13/openai-s-revenue-run-rate-tops-40-billion-ahea...
2•mfiguiere•42m ago•2 comments

The End of Mathematics

https://www.daniellitt.com/blog/2026/8/11/the-end-of-mathematics
2•rzk•42m ago•0 comments

US sells 30-year bonds at highest borrowing costs since 2001

https://www.ft.com/content/9c9c948f-dc8b-4385-a9b9-4b98dc1eadd9
29•petethomas•43m ago•25 comments

ParleHub – Enterprise AI Collaboration and Cost Control – Launch Today on PH

https://parlehub.com/
1•ciaranodonnell•44m ago•0 comments

Ask HN: Does Codex's Computer History plugin seem like a misstep to anyone else?

2•joshcsimmons•54m ago•0 comments

The magic of a two-year waitlist

https://seths.blog/2026/08/the-magic-of-a-two-year-waitlist/
1•herbertl•55m ago•0 comments

Chief Revenue Officer for OpenAI Resigns

https://twitter.com/Kr00ney/status/2087946389351284777
1•slowin•55m ago•1 comments

AI #181: Astra Goes Cyber Critical

https://thezvi.substack.com/p/ai-181-astra-goes-cyber-critical
1•paulpauper•55m ago•0 comments