Goonstation Forums
Incorrect Secure safe / Ship Lock code responses - Printable Version

+- Goonstation Forums (https://forum.ss13.co)
+-- Forum: Discussion (https://forum.ss13.co/forumdisplay.php?fid=6)
+--- Forum: Bug Reports (https://forum.ss13.co/forumdisplay.php?fid=9)
+---- Forum: Resolved (https://forum.ss13.co/forumdisplay.php?fid=16)
+---- Thread: Incorrect Secure safe / Ship Lock code responses (/showthread.php?tid=7005)



Incorrect Secure safe / Ship Lock code responses - VoxSerico - 09-03-2016

I have investigated the lock panels you can install on pods as well as the secure wall safes, and found some odd things.

Assuming that they follow mastermind rules, (which appears to be the intention) the responses from incorrect codes appear to be in error.

Hatch Locking Unit with code 1234:
Sample 1: 6A29 - "The lock panel emits a short boop." From this we conclude that boops indicate that 2 is in the code, but in the wrong place; as expected.
Sample 2: 2361 - "The lock panel emits a short beep and two warbly boops." - Three correct numbers all in the wrong place. confused
Sample 3: 1000 - "The lock panel emits a short beep." One correct number and place, as expected.
Sample 4: 0100 - "The lock panel emits a short beep." confused
Sample 5: 0010 - "The lock panel emits a short beep." confused
Sample 6: 0012 - "The lock panel emits a pair of short beeps." confused
Sample 7: 0210 - "The lock panel emits a short beep and a short boop." That makes sense, nr 2 is in the right place and nr 1 isn't; as expected.
Sample 8: 1200 - "The lock panel emits a pair of short beeps." As expected.
Sample 9: 1020 - "The lock panel emits a pair of short beeps." Wait what? Same response as last, but the 2 is in the wrong spot! confused
Sample 10: 4321 - "The lock panel emits a short beep and a quick three boops." All the numbers are in the wrong spots! confused
Sample 11: 4231 - "The lock panel emits a short beep and a quick three boops." Nr 2 and 3 are in the right spots! confused
Sample 12: 1235 - "The lock panel emits a trio of short beeps." As expected

It doesn't make much sense. So I looked at the published code (Mars 6th).
The secure safe and locking units have identical response code, so I will only go through one of them:
Code:
var/oldcode = code
var/i = 0
var/incode = 0
var/rightplace = 0
while (++i < 5)
    if (copytext(code_attempt, i,i+1) == copytext(oldcode, 1,2))
        rightplace++
        incode++
        oldcode = copytext(oldcode,2)
        continue

    var/foundpoint = findtext(oldcode, copytext(code_attempt,i,i+1))
    if (foundpoint)
        incode++
        oldcode = copytext(oldcode, 1,foundpoint) + copytext(oldcode, foundpoint+1)


Stepping through the code:

code_attempt = "0100"
oldcode = "1234"
i = 0
incode = 0
rightplace = 0

(enter while loop)
i = 1
"0" == "1" = false // Do nothing
foundpoint = 0 (Didn't find "0" in oldcode)

(loop around)
i = 2
"1" == "1" = true // Here's an error. It's testing the second entry in code_attempt against the first entry in oldcode.
rightplace++ = 1 // It's not in the right place though!
incode++ = 1

(skipping the rest here, result is one beep indicating right place and right number)

Code:
switch(incode - rightplace)
    if (1)
        desctext += "a short boop"
    if (2)
        desctext += "two warbly boops"
    if (3)
        desctext += "a quick three boops"
    if (4)
        desctext += "a rather long boop"
Further down you hit this bit, where (4) is supposed to play when you have 4 numbers in the wrong places. This can never be reached as the first incorrect position will be counted as correct. Which leads me to assume that the code is not working as intended.


RE: Incorrect Secure safe / Ship Lock code responses - medsal15 - 09-03-2016

So the beeps and boops were actually supposed to mean something? I just assumed they told if the numbers typed were in the code if it beeped/booped.


RE: Incorrect Secure safe / Ship Lock code responses - Frank_Stein - 09-03-2016

(09-03-2016, 07:57 AM)medsal15 Wrote: So the beeps and boops were actually supposed to mean something? I just assumed they told if the numbers typed were in the code if it beeped/booped.

I figured as much since last time I tried to learn this I noticed that certain combos consistently made the same beeps and boops, and others made different ones. Couldn't make any headway though as I didn't notice a strict pattern and now I know why


RE: Incorrect Secure safe / Ship Lock code responses - Vitatroll - 09-03-2016

I think VoxSerico is just saying pod-specific is broken; secure safes should be fine. I didn't know pod locks were any different, honestly.

On secure safes I just use selective brute force. Going from 0000-XXXX and finding the grumpy beep (the first place) and other valid symbols (other beeps). Then I brute force the last three places.

That is: Grumpy beep is 4 and valid symbols are 2, 2 (double beep) and 5. Enter 4, then 2 2 5, then 2 5 2, then 5 2 2 - success. It doesn't take long.

Looks like pods are made a bit harder.


RE: Incorrect Secure safe / Ship Lock code responses - NateTheSquid - 09-03-2016

I just thought the beeps meant the number was in the lock code at all. When I hack pods/secure safes my attempts are usually: 1111, 2222, etc and then when I find which numbers cause a beep, I shove those together in random combos. Given most people set passwords on their pods as either 1234, 1212 or 4 of the same number, pods aren't that hard.


RE: Incorrect Secure safe / Ship Lock code responses - Roomba - 09-03-2016

Short beep means it's one of the latter three numbers, two harsh beeps means a number is repeated and a grumpy beep means it's the starting number. I haven't been able to discern any rhyme or reason to the combination beeps but once you know all the numbers there's only six combinations so you can just try them all until it works.