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 to Build Effective Evals for AI Agents

https://www.kdnuggets.com/how-to-build-effective-evals-for-ai-agents
1•eigenBasis•36s ago•0 comments

Seven Cloudflare settings that turned away paying API clients

https://forgemesh.io/blog/cloudflare-config-gotchas-paid-apis
1•agenticbotbot•51s ago•0 comments

LLMs for Mortals 6 months later

https://crimede-coder.com/blogposts/2026/LLMsForMortalsUpdate
1•apwheele•1m ago•0 comments

Halftone Generator

https://twenty.com/halftone
1•Bluestein•4m ago•0 comments

Alongside: A learning partner that turns any webpage into an editable whiteboard

https://github.com/SinghCoder/alongside
1•vismit2000•6m ago•0 comments

Applying Game Design to Reality

https://peterlebek.com/posts/applying-game-design-to-reality.html
1•lebek•8m ago•0 comments

Show HN: Aveela – Screenshots to client docs, hosted end-to-end in the EU

https://aveela.com/en
1•rgroli•8m ago•0 comments

At Right Angles Magazine – A Resource for School Mathematics

https://atrightangles.azimpremjiuniversity.edu.in/magazine-issues/
1•vismit2000•8m ago•0 comments

WVM – A headless Windows 11 execution sandbox for AI agents

https://github.com/AndrewProject-Zion/WVM
1•andy1571•9m ago•0 comments

Canada invited to become first 'associate member' of the EU

https://www.euronews.com/my-europe/2026/09/16/canada-to-become-first-associate-member-of-the-eu
1•thunderbong•10m ago•1 comments

GPUThor: Amplifying Rowhammer Attacks via Non-Uniform Patterns to Exploit

https://arxiv.org/abs/2609.16546
1•sbulaev•12m ago•0 comments

Most workers would take a pay cut for job security

https://www.marketwatch.com/story/most-workers-would-take-a-pay-cut-for-job-security-right-now-i-...
1•cramer4next•13m ago•0 comments

Show HN: Zhenzhu – Look up Chinese while reading on macOS

https://zhenzhu.app/
3•minhmoc710•13m ago•0 comments

Private Cloud Compute Security Guide – Documentation

https://security.apple.com/documentation/private-cloud-compute
2•djoldman•14m ago•0 comments

Agility's new humanoid robot will stop, squat to avoid harming human coworkers

https://arstechnica.com/ai/2026/09/agilitys-new-humanoid-robot-will-stop-squat-to-avoid-harming-h...
1•rbanffy•17m ago•1 comments

Maze Synopsis

https://www.futilitycloset.com/2026/09/03/synopsis/
1•surprisetalk•19m ago•0 comments

How to get a DOI for your blog posts

https://shkspr.mobi/blog/2026/09/how-to-get-a-doi-for-your-blog-posts/
2•n_plus_1_acc•19m ago•0 comments

Dream-RSI: Recursive Self-Improvement Through Evolving Worlds

https://www.dream-rsi.com/
1•fofoz•20m ago•0 comments

Ask HN: Might complex software have infinitely many vulnerabilities?

1•cogs•23m ago•0 comments

Where Direction Changes, but Nobody Mentions It

https://medium.com/@gurvinder372/article-18-where-direction-changes-but-nobody-mentions-it-6bdab9...
1•gps372•23m ago•0 comments

Show HN: TurboBench, the Compression Lie Detector, 100 Codecs, Daily Update

https://github.com/powturbo/TurboBench/blob/master/benchmark.md
3•powturbo•23m ago•0 comments

Interpreting Pangram

https://lucumr.pocoo.org/2026/9/14/interpreting-pangram/
1•tmarice•23m ago•0 comments

Why AI Coding Needs Specs, Not Better Prompts [video]

https://www.youtube.com/watch?v=f289f2GgfFE
1•Harish_0089•23m ago•0 comments

The more you study consciousness, the weirder it gets [video]

https://www.youtube.com/watch?v=hYrgLn7pWp8
1•binyu•24m ago•0 comments

Show HN: Vortole, word games for language learning at your proficiency level

https://vortole.com/
1•nohowtech•25m ago•0 comments

Turbocrypt: Universal File Encryption

https://github.com/jedisct1/turbocrypt
1•jedisct1•26m ago•0 comments

Apple detectives solved mystery of ancient tree and rewrote the history of fruit

https://www.scientificamerican.com/article/how-apple-detectives-solved-the-mystery-of-an-ancient-...
2•nkurz•26m ago•0 comments

Hightouch brings customer history from data warehouses to real-time marketing

https://hightouch.com/blog/same-session-architecture
1•mooreds•27m ago•0 comments

Signal registration without a phone number now available in Android beta

https://aboutsignal.com/news/signal-registration-without-a-phone-number-now-available/
2•bertman•27m ago•0 comments

The EU Bans Social Media for Under-13s

https://www.wired.com/story/the-eu-bans-social-media-for-under-13s/
1•AndrewDucker•28m ago•0 comments