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

Agentcn – Installable AI Agents

1•anayat•47s ago•0 comments

Show HN: I ran 1.3M simulations to fix trade AI in my browser Basketball GM

https://hoops-gm.com/
1•otbasketball•1m ago•0 comments

Ask HN: How do you use claude code / codex at work for your enterprise?

1•surajkrajan•4m ago•0 comments

Startup Equity Survival Guide: what can go wrong with your equity before an IPO

https://github.com/huanghe/startup-equity-guide
1•hahaxixicc•22m ago•0 comments

Amimcp – let Claude work on your Amiga

https://github.com/thomas-luebker/amimcp
1•nickt•22m ago•0 comments

Show HN: AppPage – Fix Instagram blocking App Store links in your bio

https://apppage.co/
3•maulikdhameliya•26m ago•0 comments

Leopold Aschenbrenner Turned $100M into $45B Betting on AI – It Almost Blew Up [video]

https://www.youtube.com/watch?v=mJhGRim2MWY
2•mgh2•30m ago•1 comments

Designing with Code

https://justinjay.wang/designing-with-code/
2•prismatic•36m ago•0 comments

Software Engineering is dead (again)

https://fffej.substack.com/p/software-engineering-is-dead-again
2•ColinEberhardt•42m ago•0 comments

I got an email about resistance

https://www.seangoedecke.com/i-got-an-email-about-resistance/
2•savanaly•42m ago•0 comments

Show HN: VidServe – Turn any local video folder into a LAN streaming site

https://guokai.dev/vidserve/
1•hanguokai•47m ago•0 comments

Reducing Graphics API Complexity: A Clean Slate Design for Modern GPUs [video]

https://www.youtube.com/watch?v=aQv9pUl9PBM
1•matt_d•52m ago•0 comments

I Built Computer Engineering for Babies

https://hackylabs.com/blogs/engineering/how-i-built-computer-engineering-for-babies
1•preetamjinka•53m ago•0 comments

An Innocent Driver Was Held at Gunpoint over a Flock Cam Mix-Up:Wrong Person/Car

https://www.motorbiscuit.com/an-innocent-driver-was-held-at-gunpoint-over-a-flock-camera-mix-up-w...
1•Markoff•57m ago•0 comments

Microsoft Word for Windows 1.1a, Native X64 Port

https://github.com/jmarshall23/msword
4•BruceEel•58m ago•0 comments

Show HN: Fixing optical computing jitter via fluid dynamics in GPU registers

https://github.com/PJHkorea/photonic-mesh-fng-router
1•PJHkorea•59m ago•1 comments

Driving a 7.3" 6-Color E-Paper Display in `no_std` Rust (ESP32-S3)

https://github.com/melastmohican/rust-reterminal-e1002-examples
1•melastmohican•59m ago•0 comments

Muse Code Sends Codex and Claude Instructions to Meta by Default

https://runtimewire.com/article/exclusive-muse-code-sends-codex-and-claude-instructions-to-meta-b...
2•ryanmerket•1h ago•0 comments

Six months of action gaming alters brain networks and improves visual attention

https://www.psypost.org/six-months-of-action-gaming-alters-brain-networks-and-improves-visual-att...
1•giuliomagnifico•1h ago•1 comments

Meta CTO told employees AI gains should go into more work

https://thenextweb.com/news/meta-bosworth-ai-productivity-more-work-not-time-off
1•chanux•1h ago•2 comments

Termdom: Build terminal apps with HTML, CSS and the DOM

https://github.com/bikeshaving/termdom
2•thunderbong•1h ago•0 comments

NASA Wildfire Tracker – Real-time satellite feeds and microclimate risk modeling

https://nasa-wildfire-tracker-3pfkr5zcs2jmze5dpknvet.streamlit.app/
1•ClimateDev•1h ago•0 comments

Churvaness – Bilingual books for language learners

https://leanpub.com/u/churvaness
1•pawpatrol•1h ago•1 comments

Open Source, third-party auditing for AI Agents

https://github.com/ifixai-ai/iFixAi
2•dimneo24•1h ago•1 comments

Play Football Online

https://danfootball.com
2•declaj•1h ago•0 comments

Interviewpad.io

https://www.interviewpad.io/
3•sharva•1h ago•3 comments

Apple to require iOS apps must have minimum OS version of iOS 15 in 2027 onwards

https://www.reddit.com/r/iOSProgramming/comments/1vgql6n/new_warning_when_uploading_app_to_app_st...
3•busymom0•1h ago•2 comments

The Nixpkgs core team has unfortunately decided to disband

https://github.com/NixOS/org/pull/277
2•codewiz•1h ago•0 comments

The original URL for this prediction will no longer be available in 11 years (2011)

http://longbets.org/601/
79•doubletwoyou•1h ago•13 comments

How I sell my garlic online.

https://Demeterfamilyfarm.com
1•Hilliard_Ohiooo•1h ago•0 comments