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 Does Bluetooth Work?

https://www.bbc.co.uk/programmes/w3ct8k71
2•vismit2000•2m ago•0 comments

Show HN: Pytest-tia – run only the tests your Git diff affects, with receipts

https://github.com/breadMSA/pytest-tia
2•BreadWasEaten•6m ago•0 comments

I created an open source app to check if a photo is from an AI or a Camera

https://github.com/Wavesonics/C2PAVerify
2•Wavesonics•8m ago•1 comments

Is It Possible to Block Childrens' Access to Social Media? [video]

https://www.youtube.com/watch?v=2jJeSgO_MGo
2•dev_hugepages•9m ago•0 comments

How Russian President Vladimir Putin plans to live forever

https://www.vox.com/podcasts/491360/vladimir-putin-live-forever-26-billion-cryo-pigs-longevity-guru
3•thunderbong•10m ago•0 comments

Ask HN: Using OPA/Rego to secure MCP tool execution. Does it make sense?

3•wmolino•20m ago•0 comments

Show HN: AI Voice Generator for Creators

https://speakora.io/
2•laimingj•22m ago•0 comments

I made SHORT SQUEEZE, a finance movie trailer created with AI

https://www.instagram.com/reel/DZy5nOKN7Pz/
2•pyipeng•24m ago•0 comments

Mastodon 4.6 Released

https://lwn.net/Articles/1078466/
2•daesorin•24m ago•0 comments

Voxtral Realtime WebGPU – A Hugging Face Space by Mistralai

https://huggingface.co/spaces/mistralai/Voxtral-Realtime-WebGPU
2•fagnerbrack•27m ago•0 comments

Release 4.0.0 · HuggingFace/Transformers.js

https://github.com/huggingface/transformers.js/releases/tag/4.0.0
2•fagnerbrack•28m ago•0 comments

Big tech engineers need big egos

https://www.seangoedecke.com/big-tech-needs-big-egos/
3•fagnerbrack•28m ago•0 comments

Lisp in the Rust Type System

https://github.com/playX18/lisp-in-types/
3•quasigloam•36m ago•0 comments

Bevy 0.19

https://bevy.org/news/bevy-0-19/
4•paavohtl•40m ago•0 comments

Before SpaceX IPO, Investors in China Acquired Stakes

https://www.propublica.org/article/spacex-elon-musk-ipo-foreign-investors-china
5•ilreb•41m ago•0 comments

I Stored a Website in a Favicon

https://www.timwehrle.de/blog/i-stored-a-website-in-a-favicon/
22•theanonymousone•46m ago•4 comments

Gizmodo breached, hosting malware and no action taken for hours

https://old.reddit.com/r/cybersecurity_help/comments/1uajrup/beware_gizmodo_captcha_malware_attempt/
3•mullingitover•54m ago•1 comments

Virtual whiteboard for sketching hand-drawn like diagrams

https://github.com/excalidraw/excalidraw
2•modinfo•1h ago•0 comments

Bun 1.4 coming July 7th

https://twitter.com/jarredsumner/status/2068059134952677887
2•sorenbs•1h ago•0 comments

Show HN: I wrote a Rust book ending with a Redis clone

https://shankhan3.gumroad.com/l/dnwmtp
2•zeeshanali0094•1h ago•0 comments

Ask HN: What's a simple app you'd build if you had a weekend?

3•akashwadhwani35•1h ago•2 comments

GenAIDojo

https://www.genaidojo.io/
2•aniketwattawmar•1h ago•0 comments

EAS Alarm at midnight caused by a hacker in Brazil

https://www.reddit.com/r/mildlyinfuriating/s/wLRv2s1u5k
3•davidkwast•1h ago•2 comments

Study: Conservatives are dying at higher rates than liberals

https://www.fastcompany.com/91561329/widening-health-gap-between-liberals-and-conservatives
4•MilnerRoute•1h ago•0 comments

The New Calculus of AI-Based Coding

https://blog.joemag.dev/2025/10/the-new-calculus-of-ai-based...
3•aabdi•1h ago•1 comments

Designing a backyard deck for my house

https://blog.cosmin.cloud/posts/diy-deck.html
2•spycraft•1h ago•0 comments

Compress tool outputs, logs, files, RAG chunks before LLM for 60-95% less tokens

https://github.com/chopratejas/headroom
2•gmays•1h ago•0 comments

Trapped in a Waymo: SF passenger recounts terrifying construction zone ordeal

https://abc7news.com/post/waymo-recall-san-francisco-man-recounts-terrifying-moment-when-robotaxi...
3•mikhael•1h ago•0 comments

Show HN: Stocks Porfolio in a URL and Favicon

https://stocksreader.com/
5•franciscop•1h ago•1 comments

Bureaulogy – formation, evolution, and perpetuation of bureaucracies

https://grantslatton.com/bureaulogy
3•thelastgallon•1h ago•1 comments