frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•6mo 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•6mo 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•6mo 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).

I Built an AI Terminator to Declare War on Email Marketing Spam

https://sub.zacbowling.com/p/i-built-an-ai-terminator-to-declare
1•zbowling•39s ago•0 comments

CoreWeave Reveals the Significant Fragility of the 'AI Trade' for Broader Market

https://seekingalpha.com/article/4849234-coreweave-reveals-the-significant-fragility-of-the-ai-tr...
1•zerosizedweasle•1m ago•0 comments

Show HN: NannyCam – A Baby Monitor App That Works Online or Offline

https://play.google.com/store/apps/details?id=com.babycam.videomonitor.babymonitor.nannycam&hl=en_US
1•idish•1m ago•0 comments

Show HN: Syncthing4swarm, Automatically Deploy Syncthing Across Docker Swarm

https://github.com/sammonsempes/syncthing4swarm
1•syncthing4swarm•1m ago•0 comments

Server Survival: 3D simulation game where you play as a Cloud Architect

https://github.com/pshenok/server-survival
1•freetonik•2m ago•0 comments

Apple will not let me join the Developer Program – and will not say why

https://blog.kulman.sk/apple-developer-program/
3•ingve•6m ago•0 comments

Zig quits GitHub, says Microsoft's AI obsession has ruined the service

https://www.theregister.com/2025/12/02/zig_quits_github_microsoft_ai_obsession/
5•Brajeshwar•7m ago•0 comments

Indian government reveals GPS spoofing at eight major airports

https://www.theregister.com/2025/12/03/india_gps_spoofing/
2•Brajeshwar•7m ago•0 comments

San Francisco sues food giants over ultra-processed products

https://www.theguardian.com/society/2025/dec/02/ultra-processed-foods-lawsuit-san-francisco
2•vinni2•8m ago•1 comments

General Parser Combinators in Racket (2012)

https://epsil.github.io/gll/
1•swatson741•10m ago•0 comments

EngineAI T800: Born to Disrupt

https://twitter.com/engineairobot/status/1995801607481819518
1•kfarr•10m ago•0 comments

Show HN: I stumbled on a free AI photo enhancer – surprisingly good results

https://aienhancer.ai/
3•passioner•11m ago•0 comments

Accepting US car standards would risk European lives

https://etsc.eu/accepting-us-car-standards-would-risk-european-lives-warn-cities-and-civil-society/
5•saubeidl•18m ago•0 comments

Zhuque-3 reaches orbit on test flight, first stage lost during landing attempt

https://spacenews.com/zhuque-3-reaches-orbit-on-test-flight-first-stage-lost-during-landing-attempt/
3•perihelions•21m ago•0 comments

Show HN: I built a privacy-first UK tax calculator

https://salarysacrificecalculator.org
2•tancky777•27m ago•0 comments

Claude Code on Desktop

https://code.claude.com/docs/en/desktop
1•ecares•28m ago•0 comments

AI receptionist, look for GTM cofounder

https://callpal.com
1•franklin_yao•33m ago•1 comments

Show HN: An AI environment to understand sources or topics

https://www.kerns.ai/
1•kanodiaayush•34m ago•0 comments

Monument Valley Blog

https://monumentvalley.blog/
1•Nancy1230•35m ago•0 comments

Google OCS Apollo: The >$3B Game-Changer in Datacenter Networking (2023)

https://newsletter.semianalysis.com/p/google-apollo-the-3-billion-game
1•smj-edison•38m ago•0 comments

Collagen amino acid composition supplementation reduces biological age in humans

https://www.nature.com/articles/s41514-025-00280-7
2•walterbell•39m ago•0 comments

ChatGPT's Biggest Foe: Poetry

https://nautil.us/chatgpts-biggest-foe-poetry-1252100/
5•billybuckwheat•41m ago•0 comments

Search for Malaysia Airlines flight MH370 to resume

https://www.theguardian.com/world/2025/dec/03/search-for-malaysia-airline-flight-mh370-to-resume-...
4•n1b0m•42m ago•0 comments

China's first orbital booster landing attempt

https://visitor.passport.weibo.cn/visitor/visitor?entry=sinawap&a=enter&url=https%3A%2F%2Fm.weibo...
4•nkoren•44m ago•1 comments

Apple Aperture: Senior QA (2004-2005)

https://substack.techreflect.org/p/aperture-senior-qa-2004-2005
2•Austin_Conlon•44m ago•0 comments

AI's Missing UI

https://www.fujimon.com/blog/missing-ui
3•yuyafujimoto•48m ago•1 comments

RFC-8927: JSON Type Definition

https://datatracker.ietf.org/doc/html/rfc8927
1•rapnie•51m ago•0 comments

Why are Transformers replacing CNNs? [video]

https://www.youtube.com/watch?v=KnCRTP11p5U
1•chii•52m ago•0 comments

GitHub Trending Page Stuck for a Month

https://github.com/orgs/community/discussions/179946
4•keksis_leo•1h ago•0 comments

Ask HN: Vibe Coded Apps in Production

1•rajeshrajappan•1h ago•2 comments