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).

The New Big Ball of Mud: Why Agentic AI Systems Turn Fragile

https://www.nngroup.com/articles/big-ball-of-mud-ai/
1•TonyAlicea10•2m ago•0 comments

Diplomatic Ways to Critique AI Slop

https://www.seascapemodels.org/posts/2026-10-20-diplomatic-critique-of-ai-slop/
1•sebg•5m ago•0 comments

Fun and useful ideas/mini-projects to build with Claude

https://araujo.zip/blog/things-i-built-with-claude
1•pedrospective•5m ago•0 comments

Musk ordered Starlink slowdown in Ukraine, then blamed it on Trump

https://arstechnica.com/tech-policy/2026/10/report-says-musk-not-trump-ordered-starlink-throttlin...
1•AliCollins•5m ago•0 comments

10 Most Expensive States to Start a Business (2027)

https://www.northwestregisteredagent.com/start-a-business/expensive-states-for-startups
1•hwj•6m ago•0 comments

Practical Compiler Construction, 64-Bit Edition

http://t3x.org/reload64/
2•nils-m-holm•7m ago•0 comments

Amazon identifies Oct 17 PHP2Shell exploitation prior to public disclosure

https://aws.amazon.com/blogs/security/amazon-threat-intelligence-identifies-php2shell-exploitatio...
4•cubefox•7m ago•0 comments

"Flying Tesla is just another Lie" [TopCars TV] [video]

https://www.youtube.com/watch?v=SY6OhPs3ltM
1•Kevin_Flynn•7m ago•0 comments

DrinkR: Estimate your Blood Alcohol Concentration (BAC) (right in the browser)

https://rasmusab.github.io/drinkr/
1•sebg•8m ago•0 comments

The Responsibility of Invention

https://blue-continuum.com/the-responsibility-of-invention
1•dnetesn•8m ago•0 comments

Virtual3D – v1.0.710(Oct 22.26) Released

https://starsigndev.itch.io/virtual3d
1•antonyrobwells•9m ago•0 comments

Hacking attempts as companies, governments rush to patch PHP flaws

https://www.reuters.com/world/asia-pacific/cloudflare-sees-millions-exploit-attempts-after-php-di...
1•TechTechTech•12m ago•0 comments

Did it just build.. a clock?

https://theclock.online/
1•DirkJanMeijer•12m ago•1 comments

Safespace: A Safe Space to Experience Pull Requests

https://github.com/jonocarroll/safespace
1•sebg•13m ago•0 comments

Capcom says breach affected > 11M Capcom ID accounts, CC details unaffected

https://www.videogameschronicle.com/news/capcom-says-a-data-breach-affected-more-than-11-million-...
1•choult•14m ago•0 comments

Xbox wants you to pay 24 to 40 cents per hour to stream games you bought

https://arstechnica.com/gaming/2026/10/xbox-wants-you-to-pay-24-to-40-cents-per-hour-to-stream-ga...
4•entryleveljobsc•15m ago•0 comments

Nginx 1.30.6 (stable) and 1.31.8 (mainline) released with security fixes

https://nginx.org/en/security_advisories.html
1•Bender•15m ago•0 comments

TIL that Earth is technically in an Ice Age

https://twitter.com/Andercot/status/2113160571713630218
2•bilsbie•16m ago•0 comments

Craig Newmark (Craigslist Founder) AMA on Reddit

https://www.reddit.com/r/IAmA/comments/1xbpz45/im_craig_from_craigslist_and_founder_of_take9_a/
1•mrburton•18m ago•0 comments

2026 Ruby on Rails Community Survey Results

https://railsdeveloper.com/survey/2026
1•ksec•19m ago•0 comments

I did this without your knowledge

https://www.lesswrong.com/posts/3375SZNGA5dKHQMie/i-did-this-without-your-knowledge
1•amanverasia•20m ago•0 comments

How Meta's Muse Solves CAPTCHAs on Google, Amazon and Cloudflare

https://github.com/sneakers-the-rat/muse-skills/tree/main/topics/bot_challenge
1•mrkn1•21m ago•0 comments

International Caps Lock Day

https://web.archive.org/web/20110708115131/http://www.capslockday.com/
2•vladde•22m ago•2 comments

Show HN: Pure-Rust port of bzip3 compressor. Format-compatible with C

https://github.com/ing-systems/bzip3-rs
1•ing-systems•22m ago•0 comments

Hetzner: PHP security issues CVE-2026-109618 and CVE-2026-109619

https://status.hetzner.com/incident/f4144d55-38c3-48d1-8664-7a3429355cd7
1•tosh•23m ago•0 comments

Write Moby Dick, approximately

https://codegolf.stackexchange.com/questions/152856/write-moby-dick-approximately
1•unleaded•23m ago•0 comments

Microlandia gets its own game engine

https://microlandia.city/2026/10/22/version-2-2-0
2•phaser•23m ago•0 comments

Hugging Face's New AI Biology Model Lets You Chat with DNA

https://www.wired.com/story/hugging-face-new-ai-biology-model-chat-with-dna/
1•Baghramian11•24m ago•0 comments

Ruby Prism Release v2.0.0

https://github.com/ruby/prism/releases/tag/v2.0.0
1•ksec•24m ago•0 comments

Palmer Luckey on X: "Immigration policy must be driven by the present

https://twitter.com/PalmerLuckey/status/2113159728188854654
1•bilsbie•24m ago•0 comments