One of my special interests are mobile phones predating the iPhone 2G. Specifically their software stacks.
I occasionally dabble in Qualcomm BREW development.
You know that thing Apple/Steve Jobs had where they pissed on the software on old flip phones?
Yeah that uh...... That wasn't entirely marketing hyperbole.
Just..... Just a few of the Erdrich cursed shit I've found by getting Ghidra on the LG VX10000's ass (specifically a RAM dump). And also a few other places.
Floating point trigonometry functions! FSIN(), FCOS(), etc, they don't immediately go to their respective subroutines. No they first go through "F_CALC()" which first consists of a switch statement. You have to first select what trig function you need. This same general setup is done for the rest of the floating point functions.
Remember this is the 2000s. Many of these phones had ARM cores without hardware floating point support baked in. Floating point operations take up a good few hundred cycles to complete. Some intern ~20 years ago adding in this pissing shim function crap adds atleast a dozen cycles to this process all for no gain.
SETSTACKBOTTOM()
If your SDK and operating system has a "userland" accessible function that messes with the stack and has "Use with caution, only threading packages or system-level code should need to call this function." written in the SDK guide, that's a massive "fuck off" sized red flag.
And not the good red flag that represents The Internationale.
"Bonus" points for not even having someone at Qualcomm go through the BREW 3.1.5 SDK manual and correct grammatical and punctuation errors.
This was one of the cutting edge companies when it came to mobile phone SOCs back in the 2000s. Not only is your mobile phone RTOS peak "intern rot", more spaghettified then the shitty windows batch script programs I wrote when I was 9, and has a 3rd party software development setup that's so abhorrent that even the talented and experienced people in the LPC wiki have massive trouble with it.
But nobody thought to get some literary editors in to go through the SDK manual and make sure sentences have capitalized first letters and periods at the end!
It's boring mundane crap like this that truly indicates rot in a society/organization/whatever. If nobody can even be assed to do stuff like check grammar in public facing software literature, then you KNOW thousands of corners are being cut ever hour. AND THIS WAS TWENTY YEARS AGO!
Stupid shit in the "str" family of stdlib functions.
strlen() is not a complicated function. It runs along, counts bytes, and then returns when hitting a null value.
So then why does STRLEN(), and so far every single string related function, calling this weird mystery function on all of the char * arguments in these functions?
There's way WAY more batshit insane crap in Qualcomm BREW. I could probably draft up a megathread post about the weird nasty shit ALONE for here on hexbear. There's that much stuff!
But this was just a "brief" "WHAT WHERE THEY THINKING" style rant about my long term Qualcomm BREW/LG VX10000 reverse engineering project lol.