Protected Password 4

Discussion of challenges you have already solved
Post Reply
trofi
Posts: 23
Joined: Mon Oct 14, 2013 7:20 pm

Protected Password 4

Post by trofi »

I've hand-edited .class a bit to remove "strange" jsr/pop pair to nop/nop
and ran a soot disassembler on it (soot didn't know jsr).

Some manual bit shifting cleaning and original algorithm is clear:

Code: Select all

    [ 'a' + i + 2 * j
    | i <- [0 ..2]
    , j <- [0..2]
    ]
User avatar
Hippo
Posts: 339
Joined: Sat Feb 01, 2014 12:05 am
Location: Praha 5

Post by Hippo »

I have studied the bytecode and tried several decompilers.
The main problem was ishl where I tested on longs how it behaves ... the modulus of shiftamount ...
and on ints it uses another modulus.

Yes, the 0x200041 and so looked strange, but I were not sure the byte codes generated were ok ...
adark
Posts: 9
Joined: Fri Nov 20, 2015 2:04 pm
Contact:

Post by adark »

I used the FernFlower decompiler and it worked perfectly fine - everything else I tried choked, though.

De-obfuscated the various `stop` and `run` calls, but it turns out the actual math didn't need any de-obfuscation at all: the first loop creates the correct sequence in a 3x3 grid and the second must just run a comparison.

Lots of unnecessary loops and try/catch blocks in the original code, this challenge would have been a lot more difficult if FernFlower didn't exist. :P
Post Reply