Lion Cipher Lab
Read Java bytecode with javap and recover a licence check without the source
- AppSec / DevSecOps
- Intermediate
- ~60 min
- Free · no account required
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
- compiling a Java class and finding its .class file
- recognising the class-file header and what it contains
- listing members with javap and disassembling methods with javap -c
- reading the JVM's stack-machine instructions: loads, constants, compares, branches, returns
- rebuilding a program's rule from bytecode alone and proving it with a test
- measuring how many inputs a weak check accepts, and explaining why client-side checks protect nothing
Steps in this lab
- What you are about to do, and why Java first
- Compile the program you will pretend you do not have
- Move the source away and look at the header
- List what the class contains with plain javap
- Read the static initializer: where the data comes from
- Read check(), the length and prefix rules
- Read the loop and the final test
- Prove your reading: build a key and test it
- Measure how weak the check is
- What this teaches defenders, and the limits of what you did
- Clean up
Open the full interactive lab →