danielkrupinski / Osiris

Cross-platform game hack for Counter-Strike 2 with Panorama-based GUI.
MIT License
3.33k stars 964 forks source link

Request documentation of Osiris code #3756

Open hamad12a opened 2 years ago

hamad12a commented 2 years ago

Since this code is for educational purposes it needs to be well documented. I'm not a software engineer nor a good programmer, but I want to learn Osiris code and how it works, but the lack of documentation hardens realizing it.

mdilai commented 2 years ago

Good code doesn't need any comments, it should be self-explaining. And Osiris definitely is it. Basically, I've learned C++ on Osiris code some years ago (much love, Daniel :3). It's absolutely clear WHAT every Osiris's function do. Other questions - WHY and HOW. Osiris, like any cheat, just hook functions of Source engine and override them. For this you must refer official Source SDK and leaked old CSGO source where original functions are commented, as well as to official Source SDK Documentation. There you will find all needed to understand Osiris code base

hamad12a commented 2 years ago

@mdilai Code is code, as much as it can explain itself but cannot be 100% human readable, documentation always complements any code. That's standard in programming and doesn't need argumentation. Being learned C++ from Osiris is a personal experience not a general rule for all humans. My respects dear

mdilai commented 2 years ago

https://en.wikipedia.org/wiki/Self-documenting_code

As soon as you will understand Osiris, you will understand that comments almost unnecessary for most of a code (Inventory Changer is a bit hard, to be honest).

hamad12a commented 2 years ago

@mdilai Excuse my curiosity; how does the Linux code version be different from the Windows version?

mdilai commented 2 years ago

It's almost the same, only differs in hooking patterns. Search repository for "_WIN32", "linux" and "WIN32_LINUX"