#Vim (Cracked by Bruce Forte)
Vim (Cracked by Bruce Forte)
This is a patched version of my previous approach
:for i in split('Qq@:=+!','\zs')
exe 'map '.i.' <nop>'
exe 'map! '.i.' <nop>'
endfo
Plus 3 bytes for the -Z
flag.
You can Try it online!, but keep in mind that some things are slightly different online, since this is a V interpreter, not a vim interpreter. Most notably, the -Z
flag in vim is translated to the --safe
flag in V. Of course, your crack may not rely on any V-specific features.
Input is to the buffer like this:
3
4
And output is to the buffer.
What's evil about it?
First off, the -Z
flag prevents you from running any external commands (such as bash, python, awk, etc.). Any cracks must run in pure vim. Also, to clarify, an answer like :q<cr>read a;read b; echo $((a+b))
is not valid, because that is no longer a vim answer. The input and output must happen inside of one vim session
Then it makes it so that the following characters cannot be used:
Qq@:=+!
Disabling
Q
and:
prevents you from running ex commands.Disabling
q
prevents a workaround forq:
entering ex mode, and removes your ability to create/run macros.Disabling
@
prevents you from deleting text, and running that as a macro (the shortest way to add two numbers).Disabling
!
prevents you from using filters.And lastly, disabling
=
and+
makes it so you can't use the evaluation register.
For reference, my solution is 23 keystrokes long. Have fun cracking!