Part 39: U.S. Government
Part 39 - U.S. GovernmentLast time, I completed the final hacker battle.
=== U.S. Government - FEMA Genetic Database ===
So you're officially the best now?
All unanimous votes today.
Of this little group, anyway.
Don't undercut yourself.
That's a great accomplishment.
You're one of the best at what you do.
Go on and take a compliment.
I still need your prefrontal cortex lit up.
And flooded with dopamine.
Next, there was a cutscene of Ember talking about her supercomputer powers. Afterwards there are some unread messages in the chat.
Looks like Ember wants me to hack the US Government.
How do you think people would react if they knew their elected officials didn't represent their interests?
Another clear outcome.
I think most people already feel that way...
Think so?
That's the subject of our experiment today.
We're going to make people believe their leaders are genetic clones of each other.
What?
Do you want to know the truth or not?
It takes a certain amount of courage.
Good thing there's a centralized government DNA database.
I wonder who thought that was a good idea.
You plant the evidence and I'll take care of the rest.
OST: Behind the Scenes
Okay, so I'm in the FEMA Genetic Database. Ember prepared a small file for me with two names. Other than that, that file 200 contains names followed by sequences of numbers. All other files in all hosts (including other files also numbered 200) seem to contain snippets of DNA sequences.
The assignment:
- Overwrite the genetic sequence of SEN WALKER CAINE JR with the genetic sequence of PRES WALKER CAINE so that it looks like the younger politician is actually a clone of the older politician.
- The name of these two politicians are available in file 300.
- Note that you may need to overwrite a data chunk with another data chunk from the same file.
- For more information see "Accessing Data in Legacy Storage Systems" in the first issue of the zine.
The first issue, huh?
All the way back in part 12, I shared the left half of this article. I never even needed the right half until this time. I believe you've now finally seen all of the first zine.
Okay, so every number in that file 200 refers to a chunk of data, by giving the drive number, then the file, and then the offset in the file. I can handle this but it sounds a bit complex. Let's get started.
First, some code to find the right offset in the right file. XA just sends the name of the president to XB so XB can do a simple file lookup. Once XB find the name, it'll start sending data in a particular way. First the value of the hundreds digit in the ones place for the disk, then the value of the tens digit in the ones place for the file, and finally the value of the ones digit in the tens place for the offset. Currently, XC simply goes find the data.
I struggled a bit on the next part. There's lots of approaches. Probably, it would be fast to have one EXA read and another write the DNA information right away. This would work for all cases except when you have to write to the same file, which needs special handling.
I decided to not go for that - instead I'll write the entire DNA profile to a temporary file and then do another round to overwrite the senator's DNA. Of course, copying between files requires a lot of M communication, which is always tricky to get lined up. In the end I came up with a rather slow - but correct - solution.
I only define two EXAs at the start, so they do a lot of work. Let's start with XB, which was XC in the code above.
code:
;XB
NOOP
NOOP
NOOP
NOOP
LINK 800
MARK FINDNEXT
ADDI 800 M X
LINK X
ADDI 200 M X
GRAB X
SEEK M
MODE
COPY 10 T
MARK SENDMORE
COPY F M
SUBI T 1 T
TJMP SENDMORE
DROP
LINK -1
MODE
JUMP FINDNEXT
code:
;XA
GRAB 300
LINK 800
REPL INDEX
COPY F M
SEEK 9999
MODE
MARK MAINLP
First, the INDEX EXA.
code:
MARK INDEX
LINK 801
GRAB 200
COPY M X
MARK SEEKPRES
TEST F = X
FJMP SEEKPRES
MARK SEND
COPY F X
SWIZ X 3 M
SWIZ X 2 M
SWIZ X 10 M
JUMP SEND
Let's go back to the MAINLP, which writes the DNA to the temporary file.
So, I can't use global M for it, because the INDEX EXA is already sending the next value through that and it would become a mess.
code:
MARK MAINLP
LINK 801
TEST MRD
TJMP COPY
LINK -1
LINK 802
TEST MRD
TJMP COPY
LINK -1
LINK 803
TEST MRD
TJMP COPY
LINK -1
LINK 804
TEST MRD
TJMP COPY
LINK -1
LINK 805
TEST MRD
TJMP COPY
LINK -1
JUMP MAINLP
code:
MARK COPY
COPY 10 T
MARK COPYMORE
COPY M F
SUBI T 1 T
TJMP COPYMORE
code:
ADDI 1 X X
LINK -1
TEST X = 10
FJMP MAINLP
SEEK -9999
SEEK 1
MODE
KILL
REPL INDEX
COPY F M
REPL WRITER
MODE
This EXA does a KILL to get rid of XB (which is waiting to read more data from files, but there's nothing left to read - if I kept it alive it'd keep using up M communication which is a problem.
It then makes a NEW INDEX EXA, this time to copy the addresses of the senator's DNA chunks. The two SEEK steps and the COPY F M in global mode get this INDEX EXA started.
XA then makes a WRITER and switches itself back to local mode to get ready to copy its DNA to the WRITER.
code:
MARK WRITER
ADDI 800 M X
LINK X
ADDI 200 M X
GRAB X
SEEK M
MODE
COPY 0 M
COPY 10 T
MARK OVERWRITE
COPY M F
SUBI T 1 T
TJMP OVERWRITE
DROP
MODE
LINK -1
JUMP WRITER
code:
MARK COPYLP
LINK 801
TEST MRD
TJMP COPYFROM
LINK -1
LINK 802
TEST MRD
TJMP COPYFROM
LINK -1
LINK 803
TEST MRD
TJMP COPYFROM
LINK -1
LINK 804
TEST MRD
TJMP COPYFROM
LINK -1
LINK 805
TEST MRD
TJMP COPYFROM
LINK -1
JUMP COPYLP
code:
MARK COPYFROM
VOID M
COPY 10 T
MARK NEXT
COPY F M
SUBI T 1 T
TJMP NEXT
LINK -1
TEST EOF
FJMP COPYLP
KILL
LINK -1
Here is the entire program to see everything in context.
code:
;XA
GRAB 300
LINK 800
REPL INDEX
COPY F M
SEEK 9999
MODE
MARK MAINLP
LINK 801
TEST MRD
TJMP COPY
LINK -1
LINK 802
TEST MRD
TJMP COPY
LINK -1
LINK 803
TEST MRD
TJMP COPY
LINK -1
LINK 804
TEST MRD
TJMP COPY
LINK -1
LINK 805
TEST MRD
TJMP COPY
LINK -1
JUMP MAINLP
MARK COPY
COPY 10 T
MARK COPYMORE
COPY M F
SUBI T 1 T
TJMP COPYMORE
ADDI 1 X X
LINK -1
TEST X = 10
FJMP MAINLP
SEEK -9999
SEEK 1
MODE
KILL
REPL INDEX
COPY F M
REPL WRITER
MODE
MARK COPYLP
LINK 801
TEST MRD
TJMP COPYFROM
LINK -1
LINK 802
TEST MRD
TJMP COPYFROM
LINK -1
LINK 803
TEST MRD
TJMP COPYFROM
LINK -1
LINK 804
TEST MRD
TJMP COPYFROM
LINK -1
LINK 805
TEST MRD
TJMP COPYFROM
LINK -1
JUMP COPYLP
MARK COPYFROM
VOID M
COPY 10 T
MARK NEXT
COPY F M
SUBI T 1 T
TJMP NEXT
LINK -1
TEST EOF
FJMP COPYLP
KILL
LINK -1
MARK INDEX
LINK 801
GRAB 200
COPY M X
MARK SEEKPRES
TEST F = X
FJMP SEEKPRES
MARK SEND
COPY F X
SWIZ X 3 M
SWIZ X 2 M
SWIZ X 10 M
JUMP SEND
MARK WRITER
ADDI 800 M X
LINK X
ADDI 200 M X
GRAB X
SEEK M
MODE
COPY 0 M
COPY 10 T
MARK OVERWRITE
COPY M F
SUBI T 1 T
TJMP OVERWRITE
DROP
MODE
LINK -1
JUMP WRITER
;XB
NOOP
NOOP
NOOP
NOOP
LINK 800
MARK FINDNEXT
ADDI 800 M X
LINK X
ADDI 200 M X
GRAB X
SEEK M
MODE
COPY 10 T
MARK SENDMORE
COPY F M
SUBI T 1 T
TJMP SENDMORE
DROP
LINK -1
MODE
JUMP FINDNEXT
At 1642/131/407 this isn't a great score. The top percentiles sit at 469, 82 and 22 respectively.
In fact, I think an activity score of only 6 might just be possible. Squeezing it into the 150 lines limit might be hard though. Send one EXA into each hard drive, make sure each one knows which it is and send every request over M and have them fight it out for which EXA it's meant.
I already mentioned that if you skip the intermediate file whenever possible (if the from and to files aren't the same), the solution would be much faster.
However, considering how much time it's now taking me to get working solutions beyond the first one, and because I do want to finish this LP some time, I'll leave any improvements as an exercise to the reader.
Wow. Are you seeing this?
After the information was released, the senator simply admitted to being a clone of the President.
I guess you were just setting it back to the way it was before.
Processing.
Still processing.
That's quite the coincidence.
Not very realistic, if you ask me.
What is going on?
Instead, let's go to the first vote.
Remember the friend I was looking for?
I finally found its hideout.
This choice doesn't matter.
Hideout?
Looks like there are some protections in place.
We need to disable those so I can get in and say hi.
The second vote.