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

Behind the tools that made Thief and System Shock

https://www.gamedeveloper.com/programming/behind-dromed-and-shocked-the-tools-that-made-thief-and...
1•ibobev•44s ago•0 comments

I almost found the eMudhra d=4 Private Key

https://blog.hboeck.de/archives/910-How-I-almost-found-the-eMudhra-d4-Private-Key.html
1•mritzmann•4m ago•0 comments

Show HN: Zmb-audit – Zero-dep Python AST auditor for AI-generated dead code

https://github.com/ADevBelgie/zmb-audit
1•ArthurDev•4m ago•0 comments

Show HN:A household emergency plan that runs in the browser

https://ohcrapkit.com/
1•delimiterbob•5m ago•0 comments

Show HN: Marble3 – a 3D game engine for the web

https://marble3.dev/
1•benoit-hirbec•7m ago•0 comments

How I Stopped Dreading 9000-Line PRs and Remain the Engineer

https://technology.doximity.com/articles/how-i-stopped-dreading-9000-line-prs-and-remain-the-engi...
1•nilbus•10m ago•0 comments

Show HN: OpenLune: AI Development Environments as Code

https://github.com/dominikbraun
1•EspressoGPT•10m ago•0 comments

Scam centers from Cambodia moving to Madagascar

https://www.japantimes.co.jp/news/2026/10/31/world/crime-legal/madagascar-scam-centers/
1•weryberl5•11m ago•1 comments

Show HN: Nanit Camera on Your Mac

https://github.com/Theo-/deskcam
1•theo31•12m ago•0 comments

Computing ab+CD and other expressions with correct rounding in binary floating-p

https://hal.science/hal-05874593
1•fanf2•13m ago•0 comments

macOS 27.3: New "Accessibility" Permission Warning Is Beyond Ridiculous

https://wojciechkulik.pl/blog/macos-27-3-new-accessibility-permission-warning-is-beyond-ridiculous/
2•latexr•14m ago•0 comments

Launch Rehearsal

https://github.com/medlmobileenterprises/launch-rehearsal
1•mjgilmorejr•18m ago•0 comments

The Game Informer Vault

https://www.ebay.com/itm/800994909685
2•NickHirras•20m ago•0 comments

A tool to check post-quantum cryptography readiness of websites

https://ispostquantumready.com/
1•zidoo•20m ago•1 comments

Show HN: Flash your Philips Hue lights when Claude Code finishes or needs input

https://github.com/michaeldmueller/hue-claude
1•lurkingllama•21m ago•0 comments

Lojycal Procurement, From purchase to vendor dispatch, asset register and ERP

https://www.lojycal.com/procurement
1•Lojycal•21m ago•0 comments

Show HN: Spires, standard playing cards game I designed

https://github.com/joetex/SpiresCardGame
1•JoeOfTexas•22m ago•0 comments

A New Chapter at Twitch

https://blog.twitch.tv/en/2026/12/03/a-new-chapter-at-twitch/
2•lrae•26m ago•0 comments

Show HN: Kapoof – Black holes and burning paper for closing Mac windows

https://kapoof.app/
3•pugdogdev•27m ago•2 comments

Get notified when an outage happens

https://pushout.app/@outages
2•vasanthv•28m ago•1 comments

Show HN: PosKVM – Open SSH and VNC from the same device card

https://apps.apple.com/us/app/poskvm-remote-desktop-vnc/id6823037350
1•aribada•29m ago•0 comments

Zellij manages terminal workspaces with style

https://lwn.net/Articles/1106913/
2•signa11•30m ago•0 comments

What I learned as a hired consultant to autodidact physicists (2016)

https://aeon.co/ideas/what-i-learned-as-a-hired-consultant-for-autodidact-physicists
2•zenincognito•32m ago•1 comments

Host internal apps on a private machine with auth and permissions handled

https://innabase.com
1•johnyeocx•33m ago•0 comments

Remy – Fast, Free, Local Dictation with Cleanup

https://github.com/brysonjl/remy
1•bloff•34m ago•1 comments

Show HN: [ccbuild] A C++ build system where your build scripts are C++

https://github.com/aniket-ray/ccbuild
1•aniketray•34m ago•0 comments

Bhopal Disaster

https://en.wikipedia.org/wiki/Bhopal_disaster
10•gostsamo•35m ago•1 comments

Honeypots that hack the hacking agent back

https://github.com/NebuSec/ArtexPot
2•_____k•35m ago•0 comments

Climate change could make your daily cup of coffee cheaper, but taste less good

https://www.frontiersin.org/news/2026/12/02/frontiers-plant-science-climate-change-coffee-cheaper
1•DeepLogin•35m ago•0 comments

The unlikely policemen of Wall Street's new money machine

https://www.ft.com/content/4d20786d-bfb1-44fc-9b18-14f26e454ad6
1•petethomas•35m ago•0 comments