Transformers in Disguise (Robbers' Thread)

4

1

The cop's thread is here

The robber's task is to find a program of size equal to or less than the cop's program, which, when given an itself as input, produces the same output as the cop's program.

Additionally, even if a cop's answer is provisionally marked Safe and has been revealed, you can still crack it by finding an input that is not the same as the given source code, but still produces the same output.

Rules:

  • Submissions consist of
    • Language name + flags
    • Username of the cop with a link to the original post
    • The cracked program
  • An explanation would be appreciated
  • Your goal is to crack the most Cop's programs

Some Examples:

brainfuck, xxx's submission

[,[>,]<[.<]]

Try It Online!

This program simply reverses the input

Good luck!

Jo King

Posted 2018-11-06T06:00:09.063

Reputation: 38 234

Answers

5

Node.js v10.9.0, Arnauld

o=>[...o].sort(n=>16&(j+=13),j=9).join``

Try it online!

This outputs this particular permutation of itself when using Node's current sorting algorithm:

&`nij.9=j.,)r31n=+(=ooj`[o.o.)1.s](>=6>t

An insightful comment by l4m2 gave me a headstart, but I had to write a brute-forcer to figure out which permutation of digits gives the correct output...

ETHproductions

Posted 2018-11-06T06:00:09.063

Reputation: 47 880

Note. Why the output should be unique: input length = output length, the compare function output (and the permutation) is independent of the array elements, and the permutation is invertible. – user202729 – 2018-11-15T04:25:17.260

4

JavaScript Firefox, l4m2

btoa

btoa(btoa) encodes the following string (including linefeeds):

function btoa() {
    [native code]
}

which gives:

"ZnVuY3Rpb24gYnRvYSgpIHsKICAgIFtuYXRpdmUgY29kZV0KfQ=="

Arnauld

Posted 2018-11-06T06:00:09.063

Reputation: 111 334

3

Python 3.6+, agtoever

print("".join([f"{ord(c)^170}" for c in input()]))

Since the byte count was 50 and there were 150 digits, I split it into groups of 3, and then guessed that some XOR had been applied to the ASCII representations of the characters so iterated over all possible XORs.

Try it online!

boboquack

Posted 2018-11-06T06:00:09.063

Reputation: 2 017

2

Perl 6, donaldh

bag(get.comb).kv.sort.join.say

Try it online!

(This produces the same output for all permutations of the input, for example ().....aabbceggijkmnooorssttvy, but I strongly suspect that this is donaldh's program.)

nwellnhof

Posted 2018-11-06T06:00:09.063

Reputation: 10 037

It's a fair cop. Busted. It really was too crude. – donaldh – 2018-11-07T11:57:05.963

2

A Pear Tree, ais523

eval(x=q[print"eval(x=q[$x])"ne$_||exit|UPNR])

Try it online!

user202729

Posted 2018-11-06T06:00:09.063

Reputation: 14 620

2

Pepe, u_ndefined

Bit late back to this, but this looks to be simply add the character index to the char value

REEerEEReEeREEEEEeeeree

You can try it here. The permalink forces in breaks, but it should still work.

MickyT

Posted 2018-11-06T06:00:09.063

Reputation: 11 735

Link: https://soaku.github.io/Pepe/#TELS1* - you have to click on the "compressed" link and then copy the page URL

– RedClover – 2018-12-13T10:12:29.023

@RedClover Tried that, but it put additional spaces in the code for me, so I left it for copy paste. – MickyT – 2018-12-16T17:58:56.373

That's the expected behavior. I might improve the tool in the future, but I think it's good as it is now. – RedClover – 2018-12-17T14:31:41.977