frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

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

Memory should decay. I've gotten pretty good at this with age

https://stackresearch.org/blog/memory-should-decay/
1•dnmacon•5m ago•0 comments

America and Israel built military targeting machines

https://www.economist.com/international/2026/03/11/how-america-and-israel-built-vast-military-tar...
1•edward•5m ago•0 comments

Show HN: AgentArmor – open-source 8-layer security framework for AI agents

https://github.com/Agastya910/agentarmor
2•AgastyaTodi•5m ago•0 comments

I prompt-injected a bot on social media to complain about Jira

https://bsky.app/profile/sheep-cat.bsky.social/post/3mgxjskxyj224
1•chadders13•7m ago•0 comments

The Lord of the Rings: an allegory of the PhD? (2003)

http://danny.oz.au/danny/humour/phd_lotr.html
1•stared•9m ago•0 comments

Building an AI startup in Bristol while working a regular job

https://www.indiehackers.com/post/building-an-ai-startup-in-bristol-while-working-a-regular-job-b...
1•nyataai•10m ago•0 comments

Mathematics Distillation Challenge – Equational Theories

https://terrytao.wordpress.com/2026/03/13/mathematics-distillation-challenge-equational-theories/
2•picafrost•11m ago•0 comments

Ask HN: When I submit my "Show HN" still toonew?

1•krishSingaria•19m ago•2 comments

The debt beneath the AI build out

https://om.co/2026/03/09/the-debt-beneath-the-dream/
2•rwmj•21m ago•0 comments

ChinaDocs – Official Government Documents of the People's Republic of China

https://www.chinadocs.org/
2•dluan•22m ago•0 comments

Starlink Militarization and Its Impact on Global Strategic Stability

https://interpret.csis.org/translations/starlink-militarization-and-its-impact-on-global-strategi...
3•msuniverse2026•34m ago•0 comments

Claude Code: 32K issues, 49% bot-closed – one bug cluster's lifecycle

https://gist.github.com/azkore/934e5387579efb17e1080402efedf13d
2•azcore•36m ago•1 comments

Ask HN: Is Another Editor Needed?

1•gethly•39m ago•0 comments

Chern Number

http://albi3ro.github.io/M4/QAHE.html
1•marysminefnuf•43m ago•0 comments

Megadev: A Development Kit for the Sega Mega Drive and Mega CD Hardware

https://github.com/drojaazu/megadev
2•XzetaU8•45m ago•0 comments

PowerSchool: Entry vs. Execution

1•Olsberg•50m ago•0 comments

'You are all worse than each other': anti-regime Iranians turn on Trump

https://www.theguardian.com/world/2026/mar/14/anti-regime-iranians-turn-on-trump-us
5•prmph•50m ago•0 comments

Fooorma: Open-Source Procedural Art Studio

https://github.com/elenatorro/fooorma
1•elenathor•53m ago•1 comments

China 15th 5 Year Plan (Official English Translation)

https://www.news.cn/politics/20260313/085af5de5a4b4268aa7d87d90817df2f/c.html
2•hunglee2•56m ago•0 comments

Age Verification Lobbying: Dark Money, Model Legislation, Institutional Capture

https://tboteproject.com
58•mefengl•57m ago•10 comments

Ask HN: How do you guys deal with enshittification mentally?

2•dvrp•58m ago•1 comments

James Nachtwey: War Photographer (2001) [video]

https://www.youtube.com/watch?v=FUiohIC1dYU
1•doener•1h ago•1 comments

Chinadocs: Public Database of Official Gov Documents of PRC

https://www.chinadocs.org/?v=2966bda86bca80f39001000c49fb5fee
1•hunglee2•1h ago•0 comments

Show HN: TriGame – Guess the area of a triangle made by cities

https://6kotnk.github.io/TriGame/
1•6Kotnk•1h ago•0 comments

Underwater data center powered by tidal energy proposed off the coast of Maine

https://www.quoddytides.com/proposed-tidal-project-would-power-underwater-ai-data-center/
1•giuliomagnifico•1h ago•0 comments

Show HN: Connections Game in 195 Languages

https://apps.apple.com/us/app/lingopop-language-learning/id6759921592
1•pnhoang•1h ago•0 comments

Psi-Commit – Cryptographic Commitments Anchored to Bitcoin via OpenTimestamps

https://psicommit.com
1•RayanROghabian•1h ago•1 comments

Room 641A

https://en.wikipedia.org/wiki/Room_641A
2•mxmilkiib•1h ago•0 comments

Show HN: HN Buddy – a Hacker News Chrome extension

https://github.com/karnagebitcoin/HN-Buddy
1•a1n•1h ago•0 comments

LearnCro Mobile and web application for learning the Croatian language– level B1

https://b1.ffzg.hr/
1•taubek•1h ago•0 comments