Submission ready state achieved (#8)

This commit is contained in:
cato
2024-01-29 17:37:10 +01:00
committed by GitHub
parent 01934af8be
commit b8c0cbbb98
10 changed files with 144 additions and 21 deletions

View File

@@ -19,7 +19,8 @@ class ExploitTest(unittest.TestCase):
def __check_extract_activation_key__(self, is_debug: bool):
port = DEBUG_PORT if is_debug else RELEASE_PORT
key = exploit.extract_premium_key(is_debug, port)
exploit.PORT = port
key = exploit.extract_premium_key(is_debug)
self.assertEqual(key, __get_activation_key__())
def test_extract_activation_key_debug(self):
@@ -30,7 +31,8 @@ class ExploitTest(unittest.TestCase):
def __check_get_flag__(self, is_debug: bool):
port = DEBUG_PORT if is_debug else RELEASE_PORT
p = exploit.connect(__get_activation_key__(), True, port)
exploit.PORT = port
p = exploit.connect(__get_activation_key__(), True)
flag = exploit.get_flag(p, is_debug)
self.assertRegex(flag, "flag_[0-9a-f]{32}")
@@ -42,8 +44,9 @@ class ExploitTest(unittest.TestCase):
def __check_combined__(self, is_debug: bool):
port = DEBUG_PORT if is_debug else RELEASE_PORT
activation_key = exploit.extract_premium_key(is_debug, port)
p = exploit.connect(activation_key, True, port)
exploit.PORT = port
activation_key = exploit.extract_premium_key(is_debug)
p = exploit.connect(activation_key, True)
flag = exploit.get_flag(p, is_debug)
self.assertRegex(flag, "flag_[0-9a-f]{32}")