Timebomb

Prompt

Reverse engineer a program to find out when it activates.

Walk-Through

This challenge requires you to decompile a .class file and extract its original source code and review it for its logic.

To start, a quick Google search should help you understand what kind of file this is, a .class file in the context of programming languages is indicative of a Java bytecode file. This should help with identifying the programming language that is used to create this file. From here, we need to look at how we can reverse engineer this file to figure out its original source code. Luckily, Java bytecode files are easily decompiled back into its original source code using tools such as JD-GUI which is actually written using Java itself! If you are not able to execute Java on your computer or want to use a browser based tool, you can also try javadecompilers.com which provides a fast and easy solution as well!

Once decompiled, you’ll find that the original source code looks like this:

public class Timebomb {
   public static void main(String[] var0) {
      double var1 = (double)System.currentTimeMillis();
      if (var1 > 1.65806352E12D) {
         System.out.println("Boom");
         System.exit(0);
      } else {
         System.out.println("It isn't time yet");
         System.exit(10);
      }
   }
}
Decompiled source code

If you’re familiar with Java syntax, then you’re welcome to read the code and figure out its logic and answer the questions.

If you’re not familiar with the syntax, that’s quite okay actually. Luckily for English language speakers, most programming languages use English as its syntax and function names. Try to read the above code snippet as effectively logical English and imagine what it might be doing. If you’re still unsure, the below snippets provide an explanation of the key lines of code.

double var1 = (double)System.currentTimeMillis();

This line create a variable called “var1” and set it to the current system time in milliseconds since the Unix epoch.

      if (var1 > 1.65806352E12D) {
         System.out.println("Boom");

These lines indicate that if var1, the current system time, is greater than the number 1.65806352E12D, which means 1.65806352 x 10^12 in scientific notation (the number 1658063520000), then the program goes “Boom”.

      } else {
         System.out.println("It isn't time yet");
         System.exit(10);
      }

If it is otherwise not time yet, then it will tell you that and exit the program with an exit code of 10.

Questions

What programming language is the program written in?

See above file format explanation

What exit code does the program exit with when it is not time?

See above code snippet explanation

What time (in UTC) does the software go "Boom"?

In order to find out the time that the program goes “Boom”, we need to convert the number into an actual timestamp, so we can go a converter website such as currentmillis.com and enter 1658063520000 into the “Convert milliseconds” input box, we can find out exactly when will the program go “Boom”!

©️ 2024 Cyber Skyline. All Rights Reserved. Unauthorized reproduction or distribution of this copyrighted work is illegal.