= Time bomb = We extract the tar.gz containing "Tasks" directory which seems to be the working directory of someone who designed a timebomb. We can imagine we are a counter-terrorist, that we have obtained this directory from the computer of a terrorist and we want to know when and where this bomb will explode. == The three detonators and their locations == we open Time bomb.DSN is ISIS (Proteus) and we see the schematics of the bomb (screenshot "time bomb.png"). It shows the 3 detonators, their timings, and their PIN on BS1: - Boiler room 750ms -> PIN6 - Hall 0ms -> PIN5 - Server 1000ms -> PIN4 == The time trigger == Then we see two interesting files: 1. timeclk.bas BASIC source code of the timeclock (BS1) 2. TIMECLK.PRN compilation log, showing again the BASIC source code step by step In the BASIC source code (1) we see that showTime triggers explosion at 12:48:25. showTime: IF hours = 12 AND minutes = 48 AND seconds = 25 THEN # but it's not this time However, in the compilation log (2), we see that what has been compiled onto the chip is a different timing: 03:04:09. 4A:0 11000 IF 0055 IF hours = 3 AND minutes = 4 AND seconds = 9 THEN We can imagine that the terrorist has scheduled the trigger to be 03:04:09, compiled, and loaded the code on the chip. Then he modified the BASIC source with a different trigger to leave us with a wrong answer. == How the detonators are triggered == When this is triggered, the rest of the code is: SEROUT LCD,N2400,(I,clr) SEROUT LCD,N2400,(I,timepos-6) LET signal=1 LET signa2=1 LET signa3=1 SEROUT LCD,N2400,("Explode!!!") SEROUT LCD,N2400,(I,timepos-5) SEROUT LCD,N2400,("Time ate:") PAUSE 18/10 => wait 1.8msec LET signa3=0 => signa3=PIN6 => Boiler 750ms PAUSE 145 => wait 145msec LET signal=0 => signal=PIN5 => Hall 0ms PAUSE 30000 => wait 30sec LET signa2=0 => signa2=PIN4 => Server 1000ms Detonators are activated (signal<-1), then when they go back to 0, I assume it triggers their explosion (which takes different timings as seen above). In this code we see that: 1. it waits 1.8msec then fires signa3 (PIN6) in Boiler which takes 750ms before blowing 2. it waits 145msec then fires signal (PIN5) in Hall which takes 0ms before blowing 3. it waits 30sec then fires signa2 (PIN4) in Server which takes 1sec before blowing According to this, I conclude that Boiler doesn't have the time to blow, the Hall blows first. == How are counted the hours == Interesting to note, hours are counted from 1 to 12 like in the AM/PM, so there is no hour 0. incHours: LET hours = hours + 1 IF hours < 13 THEN done LET hours = 1 == Our answer == According to this analysis, we thought that the bomb was scheduled to explode at 03:04:09 in the Hall. tik... tak... tik... tak... KABOOOM! Wrong answer! The correct answer seemed to be 12:48:25 in the Boiler room (but we do not understand why).