== Part 14 – Good Bad Bugs ==

"Good gods, Fencesitter," a deckhand named Tooley exclaimed as Fencesitter climbed out of his Viper. After Bogie Alpha had jumped out, Hack had uses his Raptor to tow Fencesitter's out of fuel Viper back to the Galactica as the ships in the fleet were clearing out the Cylon's hacking. "What the hell did you do your Viper?"

"Ha, I'll tell you what he did!" Hack said with a laugh as he one armed hugged Fencesitter around the shoulders. "He totally pulled a full 15 gees and survived! That's like a record!"

"It must be," Tooley replied. "Because it sure looks like the entire engine assembly is completely slagged. I'm not sure why it didn't just blow up."

"Hey, it saved my life," Fencesitter told them. He looked at Hack. "Fifteen gees? Really?"

"Yeah, it was awesome!" Hack confirmed. "Never seen anything like it. And you did it in an instant. How'd you cut the limiters so fast?"

"I didn't," Fencesitter replied, dumbfounded. "Must have been a software glitch."


"Yes, the damage to the Galactica's exterior is almost entirely cosmetic," Sharon was saying. "The grooves cut and blasted into the plating are seventy five centimeters at the deepest, but are pretty narrow, so the plates actually have a higher integrity than the sensors say they have. But there's no way to erase the damage without either cutting nearly a meter thick layer off the affected plates which will weaken them considerably, or just replace the plates outright. I'd prefer the latter."

It had taken days for the fleet to get their systems back to normal. As no vengeful Cylon fleet had shown up to kill them all, Admiral Adama had decided that it was probably safe to stay in system just long enough to deconstruct the fueling station before moving on and planting it somewhere the Cylons wouldn't know about it. Bogie Alpha had to have returned to base by now, and if no response force had shown up yet by now, they probably weren't coming.

As such, the Admiral had decided to hold a fleet wide meeting of all the ship commanding officers and their department heads.

"You got off lighter than I did," Gaeta replied. "The Pegasus has a twenty meter wide crater in its side where the armor buckled from the impact. The outer layer got pushed into the middle layer which managed to hold. We're going to need a lot of new plating to get that section back up to spec."

"Well clearly you got dibs on the Forge ship then," Sharon told him.

"Thanks, the sacrifice to the Galactica's dignity means so much to me," Gaeta replied dryly. "We also found all kinds of fragments from the raider buried in the plating. The materials analysis guys were drooling over them because they had to be much harder than..."

"ADMIRAL ENTERING!"

Everyone shut up and jumped to their feet to attention as Admiral Adama strode across the room to the head of the Flag Officer's table. There were enough people present that there were actually multiple tables to seat them and any paperwork they brought.

"Be seated," Adama said as he sat down. Everyone obeyed and looked at him expectantly. "I'll get right to the point that everyone wants to know about. Doctor Wallis! Tell us what the frak happened with the CNP."

A pudgy, balding man in civilian dress stood up. Doctor Wallis was the head of the civilian contractor team from Baltar Inc, the company that made a lot of software for the Colonial Fleet including the Command Navigational Program. His team had been assigned to the Galactica specifically to handle the ship's chronic software issues. In addition to getting the Galactica's systems back up, they had also – or were supposed to have been – analyzing the CNP, the seeming source of the hacking.

"Admiral, it's just as you... just as everyone thinks," Wallis told him. "The CNP does indeed have a back door in it and that back door was designed to try to kill all systems networked to it on any ship that used it. It's just like the show, and I'm still having trouble believing it's real."

"And how the hell did this back door go undetected for better than twenty years?" Adama demanded.

"It's partly because it's run so well and for so long and so flawlessly that we've never had reason to replace it or even try to upgrade it," Wallis said. "Input goes in and the correct output always came out. There was no reason ever to mess with it, especially since every error even vaguely associated with the CNP always originated from newer software trying to interface with it. And because it worked so flawlessly, no one's ever really had a reason to go look at it in depth."

"Until now," Sharon said.

"Until now," Wallis agreed with a nod. "But the real reason? The real reason is that the entire CNP is written in spaghetti code."

"What the hell is spaghetti code?" Adama demanded.

"It's slang for computer code that's deliberately written to be has hard to read as possible," Gaeta explained. "Isn't that right, Doctor?"

"Yes, Commander," Wallis confirmed, nodding again. "Normal, well written code is written in as clean and concise manner as possible. Every line does one thing. Every function does one thing. Notes are included everywhere to tell the reader what each bit of code does. That makes the code easy to troubleshoot, especially for people who didn't originally write it.

"Spaghetti code does the opposite," Wallis continued. "Every line does multiple things as does every function... if it even has separate functions in the first place. There are no notes to tell anyone what any bit of code does. As you might imagine, spaghetti code is difficult to troubleshoot for anyone who didn't write it, even more difficult to make error free, and only the truly brilliant could write something as complex as the CNP in spaghetti code and have it work flawlessly. And when spaghetti code works, it works far better than a more cleanly written program simply because it does more with fewer lines of code, saving on processor power and memory.

"But because of spaghetti code's complexity and unreadability, it's far easier to hide backdoors in it than it would be in a more cleanly written program. In fact, the only reason we can even find the CNP's backdoor even now is that we've been trying to analyze the CNP for twenty years."

"Wait, I thought you just said there was no reason to look at it?" Adama said.

"What I meant to say is that there's no official reason to look at it," Wallis told him. "Officially looking at it means that Baltar Inc would have to pay us to do it. But the CNP was such a brilliantly written piece of code that analyzing it or developing a replacement was considered a waste of money. But many of us programmers inside Baltar Inc just analyzed it for fun on our personal time, trying to figure out its secrets. By now, we have a pretty good idea of what most of the CNP does... or at least, if you gave us the raw input data, we could reasonably calculate what the CNP will spit out. Once we had the record of the Cylon's transmitted code, we could trace the logic of how the CNP turned the input into a series of shutdown commands."

"Can you remove the backdoor?" Sharon asked. "The other Battlestars can load older software from archival backups to replace the CNP, but the Galactica's navigational systems are too new for that. They're designed from the ground up for the CNP and can't run software from older Battlestars. I want my ship to actually be able to fight, Doctor."

"Unfortunately no," Wallis admitted. "We've made several attempts to do so, but the CNP just quits working completely whenever we make the slightest change to it. We do have a work around though. We now know what the key input combinations are to trigger the back door. All we have to do is write a simple script to look for that key, and make sure it's filtered out before it gets to the CNP. There's just one problem..."

"If there's another key that you don't know about it, your script won't catch it," Adama concluded. He was no programmer, not even a novice one, but even he could spot the obvious. "Next question: why did the Galactica stand up to the CNP so much better than the other Battlestars and ships in the fleet?"

"I can answer that one," Sharon said. "It's because..." She hung her head in shame and sighed. "It's because many of the Galactica's systems are brand new, poorly programmed, bug ridden messes that never played well with the CNP to begin with, and thus couldn't properly follow the CNP's shutdown commands."

"Well, yes, that's pretty much the case," Wallis said, embarrassed of the poor quality of his company's work.

"I have a question," Gaeta said, raising his hand. At Adama's nod, he continued. "How the hell did the CNP even get approved in the first place? One of the Tech Committee's standing regulations is that all computer code must be written as cleanly as possible so that it can be vetted for unexpected side effects that might result in another Cylon rebellion. Spaghetti code, especially for government and military systems, flies in the face of that."

"Commander Gaeta, I'm sorry to inform you that there has never been a member of the Tech Committee who has been able to read a single line of programming, let alone comprehend what an entire program actually does," Wallis told him. "It used to be that members of the tech committee were anti-computing systems ideologues traumatized by the horrors of the Cylon War, and that they wouldn't even pass a simple 'Hello World' program if they didn't have to. But over time, they were replaced by Quorum appointees who reviewed technological advancements through the lens of political advantage rather than ideology or even what the tech actually was. In short, our CEO probably knew the right people and greased the right palms to get the CNP adopted by the Colonial Fleet."

"Okay, but why spaghetti code?" Gaeta asked. "Look, I know for all his moral and legal troubles, Gaius Baltar was still brilliant enough to write the CNP. But spaghetti code strikes me as completely over the top simply because it'd make it harder to get past the Tech Committee because even if no on the Committee can read code, they'd have people who can. At the very least, I'd expect spaghetti code to vastly inflate the bribes or whatever Baltar needed to get the CNP passed."

"Well, most of us always figured it was a form to copyright to make it near impossible for competitors to steal copies of the CNP and improve on it," Wallis told him. "As I said, you can't change anything about the CNP without making it stop working. But there were rumors..."

"Rumors?" Adama repeated.

"There's been stories floating around Baltar Inc that Gaius Baltar didn't write the CNP himself," Wallis said nervously. "The story goes was that there was a personal assistant he was bedding, a woman, who he foisted all of the CNP writing work onto. She wrote the CNP in spaghetti code as a form of job security because obviously, she would be the only one who knew how it worked and would be the only one who would know how to fix anything that went wrong. But then she disappeared one day without a trace, not even a resignation letter. No one knows why. Some say she just left because Baltar took credit for her work. Others say he fired her – or even had her murdered - because the CNP was so flawless that she was no longer needed."

Adama squeezed the bridge of his nose. "Doctor, are you suggesting that a certain TV show was real?" he asked slowly. "That this woman really was a Cylon masquerading as a human?"

"Well we know now that the Cylons have been in and out of the Colonies," Wallis began. "Maybe they just kidnapped her for the secrets of the CNP? I mean, the only way to actually know about the back door is to either write it yourself, or analyze the code well enough spot it. I imagine Cylons would be better at the latter , but there were no big break ins at Baltar Inc that I know of like what happened with the Arrow of Apollo and the Delphi Museum."

"Dammit, too many possibilities and ultimately not our concern," Adama said shortly. Squeezing the bridge of his nose again. "That's a job for the Colonial intel and internal security services. Everyone, start writing up reports of everything we've learned so far after this meeting. We're going to send it all back home on a courier as soon as possible. The government is going to need all this information."

Because they might very well have Cylon spies in our midsts. Adama didn't need to say it but Sharon could hear it loud and clear. As could many others in the room.

"Commander Tyrol!"

"Yes, Admiral?" Sharon said, startled as paranoia started welling up inside her. Did he suspect her? He had watched that damned show after all and now part of it had been proven to be true!

"The Galactica is still vulnerable because of the CNP," Adama told her. "I don't trust Wallis script to prevent another shutdown. You've served under my father on the old Galactica. Can you take a page out of his play book?"

"Run everything unnetworked?" Sharon's paranoia eased as she was given an actual problem she could work on. She rubbed her chin thoughtfully. "Certainly, because battle damage is a thing and communication lines can be cut. It's going to be manpower intensive especially if we're running it all day everyday instead of in emergencies, maybe too much so. Although now that I think about it, that may not be needed depending on how much we can isolate the navigation systems from everything else. I'm going to need to confer with my department heads on this and see if we can come up with a workable plan, but I think we can isolate the guns and most of the Dradis arrays from the navigational systems, so even if the Cylons kill our maneuverability, we'd at least still be able to FIGHT."

"Good," Adama said satisfied. "I'd hate to have to send my flagship home early."

"Actually, Commander, Admiral," Wallis interrupted, "I've had a moment to think about it and we might be able to do one better than that." At their look, he continued. "We might be able to rewrite the Galactica's entire network to ignore the CNP's commands. Or at least create a white list of commands that we know are safe and ignore anything else the CNP tries to tell them to do."

"You can DO that?" Sharon asked in surprise. "There's thousands of those systems throughout the Galactica!"

"Ma'am, what do you think running down all the Galactica's software problems entails?" Wallis asked confidently. "We haven't just been changing port settings. We've been rewriting bits of code for everything over and over since we came on board to the point where all of the Galactica's programming is looking pretty spaghettified by now, but at least we've kept notes of all the changes we've made. Rewriting system software to filter the CNP's commands is just more of the same. It's just... well, doing all the systems at once is going to be a lot of time and work and we're paid by monthy salary, not by the hour."

A ripple of laughter passed through the room.

"Well, now that we have all that in order," Adama said with a smile. "Does anyone have any other business before we adjourn?"

"Uh, yes sir," Gaeta spoke up again. "Are we at war with the Cylons?" The entire room went still, except for...

"What? Of course we are!" Sharon exclaimed. "They vandalized my ship!"

"Commander!" Adama snapped at Sharon. Sharon settled down, glowering. "And no, I don't think we are."

"But... we killed one of their fighters and shot at the other one when we didn't have to," Gaeta pointed out.

"Yes, and those shots were ineffective," Adama replied. He nodded to Sharon. "And yes, they did vandalize your ship... with weapons that shouldn't have been powerful enough to do it. And yes, a Cylon raider took the best a Mark X Viper had to offer on the chin and walked it off like it was nothing! And the Cylons have done nothing to us since." He looked around. "Make no mistake people, what the Cylons did to us several days ago wasn't just a recon mission. It was a show. It was a show to rub in our collective noses just how far behind them we've fallen technologically. It was a show telling us that they don't need the CNP anymore to crush the Colonies, and that if we annoy them enough, they will do just that. That's why they haven't attacked us again yet; they don't think we're worth their time."

"Sir, are you saying we should just turn around and go home?" Sharon asked. She couldn't believe he was suggesting such a thing.

"No, but I am establishing what's at stake here," Adama replied. "Right now, the Twelve Colonies live or die at the Cylons' whim. If the Colonies are ever going to be safe again, we need to level the playing field. We're playing catch up, ladies and gentlemen, and right now, the only way to do that is push forward with our mission. We're still going to Earth, we have to find out what the Cylons discovered, and if we have to go through the Cylons to do it, so be it."