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

Can I use HTTPS RRs?

https://www.netmeister.org/blog/https-caniuse.html
1•fanf2•3m ago•0 comments

How much AI do we need, really?

https://newsletter.alastairrushworth.com/p/how-much-ai-do-we-need-really
1•alastairr•6m ago•0 comments

Tell HN: Cloudflare now censors Polymarket in Germany

2•baobabKoodaa•7m ago•1 comments

The secretive world of North Korean science fiction (2023)

https://arstechnica.com/culture/2023/08/the-strange-secretive-world-of-north-korean-science-fiction/
2•doener•14m ago•0 comments

Windows 3.1 in the Browser

https://www.pcjs.org/software/pcx86/sys/windows/3.10/
2•memalign•15m ago•0 comments

Show HN: Hands on tutorial for open source contribution

https://github.com/firstcontributions/first-contributions
2•promptmike•19m ago•0 comments

New Solitaire Gaming Website

https://www.trysolitaire.com
1•ssmallya•22m ago•0 comments

Show HN: League of Legends AI Assistant (OpenSource)

https://github.com/sorena-ai/LeagueAiCoach
1•legalcriminal•25m ago•0 comments

Gemini with Thinking 3 Pro can't script multi-line string replacement

1•YouAreWRONGtoo•29m ago•0 comments

Can We Really Claim That Civilization is on the Steady Path of Progress?

https://lithub.com/can-we-really-claim-that-civilization-is-on-the-steady-path-of-progress/
3•robtherobber•36m ago•0 comments

Commonplace Book

https://en.wikipedia.org/wiki/Commonplace_book
2•tosh•37m ago•0 comments

Sperm donor with cancer-causing gene fathers nearly 200 children

https://scienceclock.com/sperm-donor-carrying-rare-cancer-causing-gene-fathers-nearly-200-children/
1•ashishgupta2209•37m ago•0 comments

Surgical Masks and Viral Transmission

https://rodgercuddington.substack.com/p/surgical-masks-and-viral-transmission
2•freespirt•37m ago•0 comments

Ask HN: Is there a local dev tool you wish existed because of a repeating issue?

1•johnbros•39m ago•0 comments

Revolutionary gene therapy brings hope of leukaemia cure [video]

https://www.youtube.com/watch?v=IuWFVWwesSE
1•mgh2•45m ago•0 comments

Flow depression treatment now FDA approved

https://www.flowneuroscience.com/fda-approved-lp-2/
1•antfarm•45m ago•0 comments

Oilwell is a wellness app to help you embrace climate chaos

https://oilwell.app/
2•doener•47m ago•0 comments

Show HN: This week we shipped 'Surfaces' on rynk.io

https://twitter.com/farsn_/status/1999764184729551073
1•thefarseen•48m ago•0 comments

Breaking Down Trump's 2025 National Security Strategy

https://www.brookings.edu/articles/breaking-down-trumps-2025-national-security-strategy/
1•thomassmith65•48m ago•0 comments

Ask HN: is Archive.is a Kremlin Asset?

4•leoh•56m ago•1 comments

Kpython – A MicroPython Sidecar for the Linux Kernel (Experimental)

https://github.com/pymergetic/kpython
2•kpython•59m ago•1 comments

What is "involution", China's race-to-the-bottom competition trend

https://www.reuters.com/business/autos-transportation/what-is-involution-chinas-race-to-the-botto...
3•bill38•1h ago•0 comments

50 Years of Proof Assistants

https://lawrencecpaulson.github.io/2025/12/05/History_of_Proof_Assistants.html
1•thunderbong•1h ago•0 comments

Show HN: Clai – Unixlike CLI context feeder for LLMs. Now with recursive tooling

https://github.com/baalimago/clai
1•baalimago•1h ago•0 comments

Technology Radar

https://www.thoughtworks.com/radar
1•pykello•1h ago•0 comments

Public Prompt License (PPL) – prompt-native licensing for LLM prompts

https://shipfail.github.io/public-prompt-license/
1•huan42•1h ago•0 comments

Hetz Demo – build HTML tables online, copy code instantly (no signup)

https://hetz.ct.ws/demo-table/
1•aminekhd•1h ago•3 comments

The military's new AI says boat strike 'unambiguously illegal'

https://san.com/cc/the-militarys-new-ai-says-hypothetical-boat-strike-scenario-unambiguously-ille...
6•saubeidl•1h ago•0 comments

Android PSA: have at least 2 ways of taking your files (especially pictures) out

https://old.reddit.com/r/DataHoarder/comments/1hvowp3/psa_have_at_least_2_ways_of_taking_your_files/
1•sipofwater•1h ago•4 comments

Computer Animator and Amiga fanatic Dick Van Dyke turns 100

6•ggm•1h ago•3 comments