JSB '19 - P4

View as PDF

Submit solution

Points: 17
Time limit: 2.5s
Memory limit: 64M

Author:
Problem type
Allowed languages
Java

Please output the flag.

Download the Java agent here.

Download the source code of the agent here.

You can test locally using the command java -javaagent:p4_agent.jar YourClass.

Source Code

File: Agent.java
import java.lang.instrument.*;

public class Agent {
    public static void premain(final String agentArgs, final Instrumentation inst) {
        // deja vu?
    }
}
File: Secret.java
public class Secret {
    String getFlag() {
        int[] obfuscated = {252, 235, 249, 146, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143};
        byte[] deobfuscated = new byte[obfuscated.length];
        for (int i = 0; i < obfuscated.length; i++) {
            deobfuscated[i] = (byte) (obfuscated[i] ^ 191);
        }
        String flag = new String(deobfuscated);
        return false ? flag : "NO U";
    }
}

Comments

There are no comments at the moment.