Can Someone help me make sense of this.
Below is a snippet of some code in an unknown language, what is your best guess as to what its purpose is, and
what is your reasoning?
when l ~= 97 .. 109 or 65 .. 77
l.raw + 0x0D
when l ~= 110 .. 122 or 78 .. 90
l.raw - 0x0D
w[*] do |l|
message = input.split(32)
if dw(message) == 'gimmie' and message.len == 4 and message.len >= 3
rtr = dw(message)
if rtr == '2po2qj4;as94kd'
Okay, that is definitely Ruby code.
What is it doing? The
dw() functions both implement a very poor cipher, roughly equivalent to this python code:
def cipher(s): rc = "" for ch in s: if ch in "abcdefghijklm" or ch in "ABCDEFGHIJKLM": v = ord(ch) + 13 rc += chr(v) elif ch in "nopqrstuvwxyz" or ch in "NOPQRSTUVWXYZ": v = ord(ch) - 13 rc += chr(v) else: rc += ch return rc
It is looking for a command that would look roughly like:
tvzzr **enciphered-filename** 2cb2dw4;nf94xq
Where the third word is an enciphered password and the second word is the filename to grab.
Unfortunately there appears to be a bug in the code, since it looks for a match with "gimme" (enciphered as "tvzzr") but expects the length to be 4, when it should be 6. So I don't this code can do anything unless I have missed something.
I am not sure if this is availible on repl. if you look closely you see that if statements don't have an end mark like : or ; so it cant be correct otherwise beside TCP.Raw.Fin and end I would say a wonk version of python. Maybe like an old version maybe 1.4