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

Trump nominates Army general to lead Cyber Command, NSA after ouster of director

https://defensescoop.com/2025/12/18/joshua-rudd-cyber-command-nsa-director-trump-nominee/
1•KnuthIsGod•1m ago•0 comments

Carbon and water footprints of data centers and what this could mean for AI

https://www.cell.com/patterns/fulltext/S2666-3899(25)00278-8
1•gm678•3m ago•0 comments

The Last Meteor Shower of 2025 and the Winter Solstice Align This Weekend

https://www.scientificamerican.com/article/the-last-meteor-shower-of-2025-and-the-winter-solstice...
1•quapster•3m ago•0 comments

Mapping every bike parking spot in Halifax

https://justbartek.ca/p/posts/hfxbikeparking/
1•luxurytent•5m ago•0 comments

Trump admin says White House ballroom construction is national security matter

https://apnews.com/article/trump-white-house-ballroom-national-security-de9756118bbfca8f40af9cf89...
1•clanky•6m ago•0 comments

Papis: CLI Document and Bibliography Manager

https://github.com/papis/papis
2•zerealshadowban•6m ago•1 comments

Show HN: Big Christmas Giveaway

https://indest.ee/
1•indest•7m ago•0 comments

Implicit contract assertions: a systematic mechanism to fix all UB C++ [pdf]

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3100r5.pdf
1•germandiago•7m ago•1 comments

An exploration of playing three generations of windows games on macOS

https://carette.xyz/posts/deep_dive_into_crossover/
3•LucidLynx•14m ago•0 comments

SQL Quest – The Bank Job

https://www.sqlhabit.com/quests/the-bank-job
1•makaronich•17m ago•0 comments

Amazon confirms years-long Russian cyberattack against AWS customers' devices

https://mashable.com/article/amazon-aws-russian-years-long-cyberattack
2•hackernj•17m ago•0 comments

The entire New Yorker Archive Is Now Fully Digitized

https://www.newyorker.com/news/press-room/the-entire-new-yorker-archive-is-now-fully-digitized
1•thm•18m ago•0 comments

Interview with Sebastian Borgeaud, Gemini 3.0 pre-trainng lead [video]

https://www.youtube.com/watch?v=cNGDAqFXvew
2•HarHarVeryFunny•18m ago•1 comments

Penny Farthing Race at 1928 Olympics

https://twitter.com/JamesMelville/status/2002324487576977716
2•keepamovin•23m ago•0 comments

Satellites Used to Have Months to Avoid Collisions–Now They Have Days

https://www.scientificamerican.com/article/satellites-used-to-have-months-to-avoid-collisions-now...
3•mooreds•24m ago•0 comments

China issues new rules to regulate internet platform pricing

https://www.reuters.com/world/asia-pacific/china-issues-new-rules-regulate-internet-platform-pric...
2•mooreds•24m ago•0 comments

Cloudflare Radar Year in Review

https://blog.cloudflare.com/radar-2025-year-in-review/
1•mooreds•25m ago•2 comments

Pg_textsearch is now open-source

https://github.com/timescale/pg_textsearch
1•conradfr•25m ago•0 comments

Getting Emacs and macOS to Play Nice

https://brainbaking.com/post/2025/12/getting-emacs-and-macos-to-play-nice/
2•Brajeshwar•28m ago•1 comments

Philosopher of Pride

https://aeon.co/essays/the-hidden-role-of-pride-and-shame-in-the-human-hive
2•Brajeshwar•28m ago•0 comments

Intel Custom Foundry Was Killed Already, Can the Fabs Rise Again?

https://tickerfeed.net/articles/intel-custom-foundry-was-tried-before
1•sethops1•31m ago•0 comments

Using Abuse Case Scenarios to Find Authorization and Business Logic Flaws

https://blog.nviso.eu/2025/12/18/integrating-abuse-case-scenarios-to-improve-authorization-testing/
1•runtimepanic•33m ago•0 comments

Browser extensions with 8M users collect extended AI conversations

https://arstechnica.com/security/2025/12/browser-extensions-with-8-million-users-collect-extended...
2•thm•34m ago•1 comments

Has anyone tried quantum randomness to drive temp functions for LLMs?

1•inshard•34m ago•0 comments

Google Sues SerpApi

https://www.reuters.com/legal/litigation/google-lawsuit-says-data-scraping-company-uses-fake-sear...
2•thm•39m ago•1 comments

Things people get wrong about Electron

https://felixrieseberg.com/things-people-get-wrong-about-electron/
2•heisenbit•40m ago•1 comments

Explained: You can't move Windows 11 taskbar like Windows 10

https://www.windowslatest.com/2025/12/19/why-you-cant-move-windows-11-taskbar-like-windows-10/
2•fidotron•41m ago•1 comments

Ireland's Profits Look Extraordinary – The Balance Sheet, Not the Real Economy

https://democracychallenged.com/2025/12/05/irelands-profits-look-extraordinary-but-its-the-balanc...
1•robtherobber•42m ago•0 comments

Genetic architecture and mechanisms of host-microbiome interactions in rats

https://www.nature.com/articles/s41467-025-66105-z
1•bookofjoe•43m ago•0 comments

Building with NextJS (When You'd Rather Use Svelte)

https://mohammedeabdelaziz.github.io/articles/go-next
2•mohammede•44m ago•0 comments