4 ms·
I have written at length, in past Pascal posts, about my affinity for the language in my early days... specifically Borland Turbo (later Borland) Pascal[0]. I
by mdip 6y ago
I have written at length, in past Pascal posts, about my affinity for the language in my early days... specifically Borland Turbo (later Borland) Pascal[0].
I ended up hacking on some leaked Telegard source code, decided to scrap it after discovering something I thought was suspicious and realizing I couldn't expect to understand every detail of these thousands of lines of code that I shouldn't have had in the first place. I ended up completely rewriting it in time to run it on my own, and a few friends' BBSes for about two years until we all found romance, the internet or both.
Just thinking about one of the reasons why I did the rewrite reminds me of how incredible that language/ecosystem was--given the early-90s when I used it. The "final nail in the coffin" for me was the code that authenticated a user. Bear in mind, this is the early 90s. You had a "handle" and a number, which a 16-bit unsigned integer (0-65535), assigned sequentially with the admin always being "0", and you could login with the number. Passwords were not only stored in plain-text in a relatively readable format in a file on the drive, but the Admin panel helpfully displayed the user's password every time a 'sysop' viewed a user's account. The background is provided to make clear: this was not a complicated login routine designed to avoid side-channel attacks, perform string comparisons in deterministic times, etc -- if they were, it'd be an amazing waste of time given the total disregard for security throughout the code (and most projects of this era)... and if it were, I wouldn't have been a good enough developer to even identify it.
However, this code had a few `goto` statements, and some inline assembly. The three places that had inline assembly in this code were the ANSI implementation, that I wrote, the 16550 UART driver, that I wrote and this login routine that I did not write and as far as I could tell had absolutely no good reason to be there. After hours of refactoring, I broke the code out into "code that logs a user in" and "code that makes something"; That "something", IIRC, was a round-about way to generate a "master password" that could be used to login with any account (and `0` was `root`). During testing, I discovered that my "skipping the code that makes something" part resulted in an empty string value which meant I could login with no password to any account. I rewrote the whole login routine, and then the whole thing.
Would kind of love to look into that, now, since I'd actually be able to understand what is going on, now (maybe!).
[0] IIRC, the IDE fit on a 5.25" floppy, and Version 5.0 had a whole bunch of new, elaborate, syntax highlighting. It was amazing.