As far as I’m aware, the main problem with decompilers is the fact that they can’t name variables and functions automaticly. But that doesn’t matter if you are just going from binary -> decompiler -> compiler -> binary

And I know there’s a lot of platform dependent code like OS APIs (such as DirectX, and WinAPI). But surely there are substitutions of the functions defined in these APIs right? I think automated porting could be performed 90% of the time and the remaining 10% could be fixed with community patches

This feels like a incredibly stupid idea after writing down but I just want to know

  • Onno (VK6FLAB)@lemmy.radio
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    If you’re not a programmer, then what you’re saying sounds reasonable, but if you are, it’s not.

    Different operating systems use different ways to interact with the outside world, in fact, it’s pretty much the only thing an operating system does.

    Consider for example responding to a mouse click.

    Each operating system handles this differently, sometimes within the same OS it’s different depending on what else is happening, (Linux X11 vs Linux Wayland).

    A mouse is pretty trivial on the face of it, but the operating system needs to be able to track each pulse from a mouse and respond to that and then it needs to tell your program about it. In other words, it needs to interrupt your program, deal with the pulse, update the relevant information, then resume your program.

    The same is true for the screen, disk storage, keyboard, memory and even the CPU itself.

    Even if the various operating systems use the same CPU, and these days they mostly don’t, running the same program in multiple places is extremely rare, and that’s for companies who have the source code to the software they sell.

    Some programs are more universal, because they’re written in a language like python that’s compiled when you launch it, but dig inside and you’ll find code specific to each operating system.

    Source: I’ve been writing software for over 40 years.