Lion Cipher Lab

Read Java bytecode with javap and recover a licence check without the source

Why it matters

Reverse engineering means working out what a program does when you do not have its source. Managed languages such as Java and C# are where most people should start, because the compiled form keeps names and structure, so you can practise the habits (find the entry point, follow the data, rebuild the rule, test your theory) without fighting machine code. The same habits carry over to native binaries later. It also teaches an uncomfortable truth defenders need: anything you ship to a user's machine can be read. Licence checks, hard-coded keys and client-side validation are understandable by…

What you'll learn

Steps in this lab

  1. What you are about to do, and why Java first
  2. Compile the program you will pretend you do not have
  3. Move the source away and look at the header
  4. List what the class contains with plain javap
  5. Read the static initializer: where the data comes from
  6. Read check(), the length and prefix rules
  7. Read the loop and the final test
  8. Prove your reading: build a key and test it
  9. Measure how weak the check is
  10. What this teaches defenders, and the limits of what you did
  11. Clean up

Open the full interactive lab →

Keep learning