frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

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

Milo – AI MCAT coach that builds your daily study plan and keeps you accountable

https://askmilo.io
1•savagebrody•52s ago•1 comments

pg_ClickHouse: A Postgres extension for querying ClickHouse

https://clickhouse.com/blog/introducing-pg_clickhouse
1•soheilpro•3m ago•0 comments

Humans were lighting fires from scratch a lot earlier than previously thought

https://www.economist.com/science-and-technology/2025/12/10/humans-were-lighting-fires-from-scrat...
1•andsoitis•5m ago•1 comments

Visual Thought AGI Architecture Blueprint- the missing key – imagination

https://visualthoughtagi.com
1•user2342ca•9m ago•1 comments

Humans & LLMs rate deliberation as superior to intuition on reasoning tasks

https://www.nature.com/articles/s44271-025-00320-8
1•gsf_emergency_6•11m ago•0 comments

Exactly-Once Semantics Are Possible

https://www.confluent.io/blog/exactly-once-semantics-are-possible-heres-how-apache-kafka-does-it/
1•intrepidsoldier•22m ago•0 comments

Show HN: Knav – Embed an AI assistant on your site, trained on your docs

https://www.knav.app/
1•randydigital•22m ago•0 comments

Cannabis dispensaries lead to reduced opioid prescriptions

https://medicalxpress.com/news/2025-11-cannabis-dispensaries-opioid-prescriptions-plausible.html
3•PaulHoule•23m ago•0 comments

Rubio's Directive on State Dept Typography, Re-Establishing Times New Roman

https://daringfireball.net/2025/12/full_text_of_marco_rubio_state_dept_directive_times_new_roman
1•coloneltcb•23m ago•1 comments

American Ports Have a Problem That's Costing You Money

https://www.youtube.com/watch?v=qFyYqUwXWLw
1•m-hodges•23m ago•0 comments

Be Careful with GIDs in Rails

https://blog.julik.nl/2025/12/a-trap-with-global-ids
2•julik•24m ago•0 comments

Cryptographers Show That AI Protections Will Always Have Holes

https://www.quantamagazine.org/cryptographers-show-that-ai-protections-will-always-have-holes-202...
2•EA-3167•28m ago•0 comments

Online child sexual abuse surges by 26% in year

https://www.theguardian.com/society/2025/dec/11/online-child-sexual-abuse-surges-by-26-percent-in...
2•vinni2•32m ago•0 comments

What border guards will look for on your socials, could be made to hand over DNA

https://www.afr.com/world/north-america/here-s-what-trump-s-border-officials-will-look-for-on-you...
2•KnuthIsGod•41m ago•2 comments

Malaysia uncovers $1B in power theft losses from illegal crypto mining

https://www.theblock.co/post/379443/malaysia-power-theft-crypto-mining
6•walterbell•49m ago•0 comments

The GPT Prophecy Begins (book trailer)

https://www.youtube.com/watch?v=u480QTwbA6o
1•nuevita70•55m ago•0 comments

Ask HN: End of Year Book Recommendations

4•marai2•57m ago•1 comments

Z-Image-Turbo

https://alternativeto.net/software/z-image-turbo/about/
1•indextts•1h ago•0 comments

Wenis

https://en.wikipedia.org/wiki/Wenis
1•oatsandsugar•1h ago•0 comments

Pslscale.com – AI facial analysis for attractiveness scoring

https://pslscale.com
2•czmilo•1h ago•1 comments

Is AI a Bubble? Why We're Betting on the Installation Phase

1•rchachra•1h ago•0 comments

Police swap suspect sketches for AI

https://www.washingtonpost.com/nation/2025/12/09/ai-police-suspect-sketch-arizona/
1•1659447091•1h ago•1 comments

Patterns.dev

https://www.patterns.dev/
3•handfuloflight•1h ago•0 comments

What Least Squares Assumes About Your Data

http://sebmestre.blogspot.com/2025/12/least-squares-is-just-maximum.html
1•sebastianmestre•1h ago•0 comments

Veteran-built iPhone steadiness tracker to help people avoid falls

3•jimlucas95338•1h ago•0 comments

Jonathan Blow new game announced. Uses new language and new engine

https://twitter.com/Jonathan_Blow/status/1998845944918618171
4•sergiotapia•1h ago•2 comments

DeepSeek is using Nvidia's banned Blackwell AI chips

https://www.cnbc.com/2025/12/10/nvidia-report-china-deepseek-ai-blackwell-chips.html
1•zyh888•1h ago•0 comments

AI Researcher: Replacing scientists with AI is evil

https://twitter.com/togelius/status/1997920576804143583
2•ks2048•1h ago•0 comments

My Favorite Self-Hosted Apps Launched in 2025

https://selfh.st/post/2025-favorite-new-apps/
3•shaunpud•1h ago•0 comments

The devious art of lying by telling the truth (2017)

https://www.bbc.com/future/article/20171114-the-disturbing-art-of-lying-by-telling-the-truth
2•1659447091•1h ago•0 comments