Commit d37d65f2 authored by Giovanni's avatar Giovanni 🖥

houseplant 2020 rtcp trivia writeup

parent aedc626b
Pipeline #140025981 passed with stages
in 25 seconds
This diff is collapsed.
This diff is collapsed.
Java.perform(function () {
var SecretKeySpec = Java.use('javax.crypto.spec.SecretKeySpec');
SecretKeySpec.$init.overload('[B', 'java.lang.String').implementation = function(p0, p1) {
console.log('SecretKeySpec.$init("' + bytes2hex(p0) + '", "' + p1 + '")');
return this.$init(p0, p1);
};
});
function bytes2hex(array) {
var result = '';
console.log('len = ' + array.length);
for(var i = 0; i < array.length; ++i)
result += ('0' + (array[i] & 0xFF).toString(16)).slice(-2);
return result;
}
console.log("loaded successful");
Java.perform(function x() {
Java.deoptimizeEverything()
var json;
var done = 1;
var b64 = Java.use('android.util.Base64');
var stringJava = Java.use('java.lang.String');
var nwClass = Java.use('nw');
var jsonObject = Java.use('org.json.JSONObject');
jsonObject.$init.overload('java.lang.String').implementation = function(s) {
console.log("calling jsonObject, with arg:" + s);
// duplicate this object for later use outside the overload
json = Java.retain(this);
return this.$init(s);
}
var cipher = Java.use('javax.crypto.Cipher');
cipher.init.overload('int', 'java.security.Key', 'java.security.spec.AlgorithmParameterSpec').implementation = function(a1, a2, a3) {
console.log("calling cipher, with arg:");
var a = this.init(a1, a2, a3);
console.log("a");
var dec = this.doFinal(b64.decode(json.getString("correctAnswer"), 0));
var answer = stringJava.$new(dec);
console.log("done: " + done);
done = done + 1;
nwClass.a().a("{\"method\":\"answer\",\"answer\":" + answer + "}");
return a;
};
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment