4
Anakata
4y

After getting fed up of “being productive” I fooled around on GitHub and had a look at the Stuxnet virus source code which was obtained using a decompiler. Experts who reverse-engineered it found out that it was written in “object-oriented C.” While C is not an object oriented language, anything you can do with classes you can do with structs, static functions, pointers & function pointers. You can see this coding style in the Linux kernel, CPython interpreter and many other places. That was the first indication that a government agency or defence industry was responsible. Amazing stuff !

Comments
  • 4
    Turns out, C++ was just language canonification of things developers were already doing.

    Not sure it follows that sophistication = government involvement, but it does indicate funding.
  • 4
    I get how you mimic a class with a struct and function pointers, but how do you implement inheritance?
    All that virtual table headache....
  • 3
    @NickyBones
    Type annotation through internalized metadata and static construction

    https://codementor.io/@michaelsafya...
  • 0
  • 3
    @NickyBones
    Would assume you'd want to build a manager reflection cache and structural analyzer to handle that. Pointers pointers everywhere. No one ever said it was a good idea 😝
  • 0
    @SortOfTested It's a bad idea to point that saying "everything you can do with C++, you can do with C (and endless agony)" is no longer valid, or sane.
  • 2
    @NickyBones
    Sane people easily discriminate between novelty and utility. The rest, they can suffer until they recover.
  • 1
    @NickyBones always remember. Everything you can do in C/C++, C#, Java, Python and so on. You can do in machine code. I don't want to work with you if you do so. BUT you can
  • 1
    @KDSBest I actually did quite some assembly coding 😂 Don't hold it against me though, we didn't have other choices :)
  • 1
    @KDSBest remember anything you can do in assembly yoy can do in binary.
Add Comment