1 00:00:11,430 --> 00:00:12,530 All right, everybody. 2 00:00:12,530 --> 00:00:13,570 We are back. 3 00:00:13,610 --> 00:00:14,370 Hello. 4 00:00:14,630 --> 00:00:18,570 We are here with the second to last match of the whole tournament. 5 00:00:18,570 --> 00:00:21,590 This is the finals of the lower bracket of the live CTF. 6 00:00:21,590 --> 00:00:23,490 So these are teams who have all lost once. 7 00:00:23,490 --> 00:00:29,550 They are playing back for the chance to come back into the final match, which will be the very next match that will happen right after this. 8 00:00:29,550 --> 00:00:31,230 Again, I'm CypherTex. 9 00:00:31,270 --> 00:00:32,730 Hello, I'm Zeta2. 10 00:00:33,030 --> 00:00:36,650 And we're looking to see if we're about ready for the countdown. 11 00:00:36,650 --> 00:00:38,110 So let's go ahead and prepare. 12 00:00:38,110 --> 00:00:39,570 We're going to count the teams in. 13 00:00:39,570 --> 00:00:41,490 They know it's time to go. 14 00:00:42,330 --> 00:00:46,330 Five, four, three, two, one. 15 00:00:46,330 --> 00:00:47,030 Go. 16 00:00:47,030 --> 00:00:47,890 All right. 17 00:00:47,990 --> 00:00:48,950 All right. 18 00:00:49,230 --> 00:00:51,110 Oh, a quick lead. 19 00:00:51,410 --> 00:00:52,090 Tell Straw Hat. 20 00:00:52,090 --> 00:00:52,910 Tell Straw Hat. 21 00:00:52,910 --> 00:00:53,230 Yeah. 22 00:00:53,230 --> 00:00:53,670 There we go. 23 00:00:53,670 --> 00:00:54,090 All right. 24 00:00:54,090 --> 00:00:54,630 Okay. 25 00:00:54,630 --> 00:00:55,670 We're on. 26 00:00:55,670 --> 00:00:56,390 We're on. 27 00:00:56,730 --> 00:00:57,130 Right. 28 00:00:57,130 --> 00:00:58,210 So who do you want to look at first? 29 00:00:58,450 --> 00:01:00,790 Let's go with Straw Hat. 30 00:01:00,790 --> 00:01:01,370 All right. 31 00:01:01,370 --> 00:01:04,330 And so, as we said, lower bracket finals. 32 00:01:04,330 --> 00:01:08,770 We have Team Straw Hat versus the Maple Mallard Magistrates, or MMM. 33 00:01:08,770 --> 00:01:09,510 Or Mighty Ducks. 34 00:01:09,510 --> 00:01:10,390 Mighty Ducks. 35 00:01:10,390 --> 00:01:11,550 Or whatever name. 36 00:01:11,550 --> 00:01:13,430 Those people. 37 00:01:15,090 --> 00:01:20,450 And this is, yeah, you know, we're down to the final three teams. 38 00:01:20,450 --> 00:01:25,690 So whoever wins here will go to the grand finals facing off against Hypeboi. 39 00:01:26,130 --> 00:01:28,030 Who's really just had such a run. 40 00:01:28,030 --> 00:01:29,690 This entire tournament, Hypeboi has just been flowing through it. 41 00:01:29,790 --> 00:01:31,810 Really, really impressive. 42 00:01:33,190 --> 00:01:37,390 So we can see here opening up the challenge in Ida. 43 00:01:37,570 --> 00:01:40,670 Doing some analysis here. 44 00:01:40,670 --> 00:01:44,370 But we do actually have Ghidra as well on the other side. 45 00:01:44,370 --> 00:01:44,550 Right. 46 00:01:44,550 --> 00:01:46,630 So this is, I haven't seen a whole lot of other things. 47 00:01:46,630 --> 00:01:47,850 It's been mostly Ida so far. 48 00:01:47,850 --> 00:01:49,050 Mostly Ida. 49 00:01:49,290 --> 00:01:50,650 But we eventually got to Ghidra. 50 00:01:50,650 --> 00:01:51,370 Yep. 51 00:01:51,370 --> 00:01:52,030 Yep. 52 00:01:52,130 --> 00:01:55,170 And the way this challenge. 53 00:01:55,170 --> 00:01:56,310 The way this challenge. 54 00:01:56,310 --> 00:01:56,950 Yeah, right, right. 55 00:01:56,950 --> 00:01:57,770 Let's clarify. 56 00:01:57,770 --> 00:01:59,090 What's the name of this challenge? 57 00:01:59,090 --> 00:02:01,210 So this challenge is called The Way. 58 00:02:01,210 --> 00:02:02,010 This is The Way. 59 00:02:02,010 --> 00:02:06,370 It's actually the only challenge that I have created for this event. 60 00:02:06,370 --> 00:02:06,950 I only have one too. 61 00:02:06,950 --> 00:02:08,030 So you did infrastructure. 62 00:02:08,030 --> 00:02:09,090 I did streaming stuff. 63 00:02:09,090 --> 00:02:09,370 Yeah. 64 00:02:09,370 --> 00:02:10,530 So we were busy with other stuff. 65 00:02:10,530 --> 00:02:11,570 But I have one challenge. 66 00:02:11,570 --> 00:02:12,290 And this is the one. 67 00:02:12,290 --> 00:02:13,270 And this is The Way. 68 00:02:14,010 --> 00:02:15,650 And this is a reversing challenge. 69 00:02:15,650 --> 00:02:16,930 We've seen mostly. 70 00:02:17,230 --> 00:02:17,930 Actually, funny. 71 00:02:17,930 --> 00:02:18,590 The two of us. 72 00:02:18,590 --> 00:02:19,970 We made the two reverse. 73 00:02:19,970 --> 00:02:22,570 The two non-pawn challenges in this tournament. 74 00:02:22,570 --> 00:02:22,770 Yeah. 75 00:02:22,770 --> 00:02:24,630 So this is another reversing challenge. 76 00:02:25,850 --> 00:02:28,930 And we can get back a little bit into the details in a bit. 77 00:02:28,930 --> 00:02:31,930 Let's keep looking here at what they're doing. 78 00:02:31,930 --> 00:02:35,910 So MMM is just doing some initial reversing. 79 00:02:35,950 --> 00:02:37,330 Renaming some variables. 80 00:02:38,490 --> 00:02:41,350 We have kept the symbols in this. 81 00:02:41,350 --> 00:02:42,210 We have the function names. 82 00:02:42,210 --> 00:02:43,030 And what do we tell the team? 83 00:02:43,030 --> 00:02:45,790 So we have categories for each of these matches on the bracket. 84 00:02:45,790 --> 00:02:48,830 We told them, in this case, every day the day before. 85 00:02:49,670 --> 00:02:52,170 We told them all of the categories for each of the challenges. 86 00:02:52,170 --> 00:02:54,010 So what do they know about this one? 87 00:02:54,010 --> 00:02:54,290 Right. 88 00:02:54,290 --> 00:02:55,930 So they know that it's a reversing challenge. 89 00:02:55,930 --> 00:02:58,550 And they know that it's around algorithms. 90 00:02:58,550 --> 00:03:01,410 So they were given reverse engineering algorithms. 91 00:03:01,410 --> 00:03:04,170 Did we tell them specifically, I think, Optimize Me, Even Me? 92 00:03:04,350 --> 00:03:04,930 Right. 93 00:03:04,930 --> 00:03:09,250 We said Optimize Me, which may be a good time to explain what this is. 94 00:03:09,250 --> 00:03:17,410 So in the reverse engineering category, there are various standard formats of challenges. 95 00:03:17,610 --> 00:03:21,870 Maybe the most commonly known is the Crack Me, where you send in a flag as an input. 96 00:03:21,870 --> 00:03:24,690 And the program will tell you whether it's correct or not. 97 00:03:24,690 --> 00:03:29,530 And you need to work your way backwards from the verifier to figure out what the input should be. 98 00:03:29,530 --> 00:03:30,910 And Optimize Me... 99 00:03:30,910 --> 00:03:32,390 That was what my challenge was, essentially. 100 00:03:32,390 --> 00:03:33,150 It was a bunch of checks. 101 00:03:33,150 --> 00:03:33,730 You gave an input. 102 00:03:33,730 --> 00:03:34,690 It verified at the end. 103 00:03:34,690 --> 00:03:37,190 You had to reverse those or invert those or solve through those. 104 00:03:37,190 --> 00:03:42,630 So the constraints, they define the unique input that gives the solution. 105 00:03:43,250 --> 00:03:52,270 In the case of an Optimize Me, you have some computation that is implemented in a terribly inefficient way. 106 00:03:52,270 --> 00:03:57,950 So you have a program that usually takes no input, and it just calculates the flag for you. 107 00:03:57,950 --> 00:03:59,110 All you do is just run it. 108 00:03:59,110 --> 00:04:03,430 You run it, except it will take to the end of the universe before the computation finishes. 109 00:04:03,470 --> 00:04:10,930 So you need to understand what the algorithm is trying to do and optimize the computation so that you can actually complete it. 110 00:04:10,930 --> 00:04:12,170 I remember playing back. 111 00:04:12,170 --> 00:04:14,210 I think it was Plaid CTF. 112 00:04:14,850 --> 00:04:18,630 Several years ago, it had a whole category that they called their supercomputer category. 113 00:04:18,630 --> 00:04:25,550 And the same idea was that you would need a supercomputer to run this as it is and to get anything out of it. 114 00:04:25,550 --> 00:04:31,750 But you could also be more efficient if you wanted to do it like the algorithmic solution. 115 00:04:31,750 --> 00:04:35,590 So we're expecting them to do just kind of a lot. 116 00:04:35,590 --> 00:04:36,250 There we go. 117 00:04:37,030 --> 00:04:40,850 CallMysteryAlgorithm, I think I saw, was the name over on Straw Hat. 118 00:04:40,850 --> 00:04:43,610 So we have this. 119 00:04:43,790 --> 00:04:45,970 So there's a bunch in the main function. 120 00:04:45,970 --> 00:04:49,510 We try to separate out the things that they should not care about. 121 00:04:49,510 --> 00:04:50,670 We try to guide them. 122 00:04:51,350 --> 00:04:51,750 Oh , right. 123 00:04:51,750 --> 00:04:52,930 This is interesting. 124 00:04:56,630 --> 00:04:58,070 Oh, my God. 125 00:04:58,070 --> 00:05:02,970 It's actually making the correct answer. 126 00:05:03,230 --> 00:05:05,070 It doesn't give them the name. 127 00:05:05,930 --> 00:05:10,450 So to explain here, just go back a few steps. 128 00:05:10,450 --> 00:05:13,650 They basically, they're trying to identify what algorithm this is. 129 00:05:13,650 --> 00:05:16,610 And they asked over chat about this. 130 00:05:16,610 --> 00:05:26,050 And you could see there that it said like it's calculating the shortest path from this to this using this. 131 00:05:26,050 --> 00:05:28,230 And this is actually completely correct. 132 00:05:28,230 --> 00:05:32,770 This is the Floyd-Warshall. 133 00:05:32,770 --> 00:05:39,050 It's actually not the Floyd-Warshall algorithm because it's the unoptimized computation. 134 00:05:39,050 --> 00:05:42,690 If they replaced it with the textbook version of the algorithm, that would be... 135 00:05:42,690 --> 00:05:43,270 Right. 136 00:05:43,330 --> 00:05:56,950 So this is like when you come up with or when you prove the Floyd-Warshall algorithm, this is like the recursion relationship you start with and then you turn and use dynamic programming to make it efficient. 137 00:05:56,950 --> 00:06:01,330 This is just a recursion relationship without the dynamic programming applied. 138 00:06:01,330 --> 00:06:05,730 So this has like a time complexity of like 3 to the N or something like this. 139 00:06:06,890 --> 00:06:08,270 So great move. 140 00:06:08,270 --> 00:06:11,710 It looks like they got a fantastic hint certainly from chat. 141 00:06:12,110 --> 00:06:19,330 I'm really impressed by this because one of our test solvers actually tried this and they did not get it to work. 142 00:06:19,330 --> 00:06:24,450 Or like they did after like already knowing the solution and kind of like... 143 00:06:24,450 --> 00:06:27,390 So that's really impressive. 144 00:06:27,390 --> 00:06:29,650 Well , that was before you added symbols I believe too maybe, right? 145 00:06:29,650 --> 00:06:36,030 Yeah, but the only symbol that is relevant here is just I called it mystery algorithm. 146 00:06:36,030 --> 00:06:36,950 Oh , right. 147 00:06:36,950 --> 00:06:38,750 This is called the getEdge function. 148 00:06:38,750 --> 00:06:39,710 That's true. 149 00:06:40,170 --> 00:06:54,450 So I used this helper function to, you know, you have this matrix of like distance from A to B and just this helper function to give you a pointer to the relevant entry in the matrix. 150 00:06:55,590 --> 00:06:56,910 Yeah, so... 151 00:06:56,910 --> 00:07:00,470 So I think that was... it looks like that may have been just enough to get it to produce it. 152 00:07:00,470 --> 00:07:02,610 And we've actually got... so yeah, you want to go back over to... 153 00:07:02,610 --> 00:07:08,490 Yeah, because I just saw there if we can switch over... we can't see the code yet, but if we switch back to this, I think the... 154 00:07:09,190 --> 00:07:15,470 Yeah, so here is the... this is really cool because this is the other approach you can take to this. 155 00:07:15,470 --> 00:07:24,430 So you can see over on the straw hat side, they were kind of trying to identify the specific algorithm and then use, you know, knowledge... 156 00:07:24,430 --> 00:07:25,890 Go find a textbook version of that or re-implement that, drop it in place. 157 00:07:25,890 --> 00:07:26,790 Right, right, something. 158 00:07:26,790 --> 00:07:39,750 But if we go back to MMM, here you can see that the player is re-implementing the function in Python and you can see this little at cache annotation for the function, which is... 159 00:07:39,750 --> 00:07:46,270 It will, like, look at all the function arguments and then use that as a key and then cache the return value. 160 00:07:46,270 --> 00:07:49,470 Out code those values because it's, you know, fixed input, fixed output. 161 00:07:49,470 --> 00:07:52,070 Exactly, it's a pure function. 162 00:07:52,070 --> 00:07:52,330 Yeah . 163 00:07:52,510 --> 00:08:01,610 So, and this is actually the kind of trick for those who know a little bit about dynamic programming in, like, algorithm construction. 164 00:08:02,030 --> 00:08:11,570 Usually the way you approach is that you start with a recursion and then you identify that many or most of the various recursive calls actually are the same. 165 00:08:11,570 --> 00:08:12,650 They're, like, a big overlap. 166 00:08:12,650 --> 00:08:15,650 So then you only have to do it once and then you just do a lookup for the remainder. 167 00:08:15,650 --> 00:08:16,150 Right. 168 00:08:16,150 --> 00:08:26,790 And then normally, like, if you do it, like, kind of properly, you do it all the way and, like, flip it all around and compute it, like, bottom up. 169 00:08:26,850 --> 00:08:33,010 But you can skip that stuff and keep it as a recursive relationship but add a cache to it. 170 00:08:33,010 --> 00:08:33,450 Interesting . 171 00:08:33,450 --> 00:08:39,670 And so there's literally just an annotation in Python that lets you, like, a decorator that they can add in that says, yeah, please cache this. 172 00:08:40,490 --> 00:08:43,610 It's in the functools library. 173 00:08:43,610 --> 00:08:49,030 I believe you can give it some parameters with, like, the size of the cache and stuff, but I think the default should be plenty enough. 174 00:08:49,030 --> 00:08:49,690 Might actually work well for this. 175 00:08:49,690 --> 00:09:02,150 So if they implement this correctly, they just need to properly translate from the disassemble or the decompile code into the Python and add this annotation and run it and they should get the answer. 176 00:09:02,150 --> 00:09:07,490 And I wonder now if going into this, they specifically chose Ghidra or Ida based on what they knew about the problem, too. 177 00:09:07,490 --> 00:09:13,350 I don't remember if we've seen, I think this was Robert from NNM who's playing, like, have we seen him use one or the other before? 178 00:09:13,350 --> 00:09:18,170 But it could be that he just feels like maybe I've seen better decompilation for very algorithmic things. 179 00:09:18,170 --> 00:09:24,210 And I'm just curious if that factored into it because it is interesting to see that he's doing that approach. 180 00:09:24,210 --> 00:09:28,490 But, yeah, so I love that we've got two kind of very different approaches, each equally viable, right? 181 00:09:28,490 --> 00:09:32,390 Both of these should absolutely be proper ways of solving this problem. 182 00:09:32,390 --> 00:09:33,490 And it kind of makes sense. 183 00:09:33,490 --> 00:09:35,330 They knew the category going into it. 184 00:09:35,330 --> 00:09:36,230 It wasn't a surprise. 185 00:09:36,230 --> 00:09:38,310 And these are sort of standard ways of doing it. 186 00:09:38,490 --> 00:09:39,530 Let's go back and look over. 187 00:09:39,530 --> 00:09:41,170 We've got more chat, GPT from Straw Hat. 188 00:09:41,170 --> 00:09:42,970 Are they just looking up? 189 00:09:42,970 --> 00:09:44,810 Shortest path in a graph. 190 00:09:45,990 --> 00:09:51,850 And you see the keyword here, dynamic programming is a keyword here. 191 00:09:52,870 --> 00:09:59,070 And this function calculates the combined path or cost from A1 to A2 going via A3. 192 00:09:59,070 --> 00:10:00,690 And this is completely correct. 193 00:10:00,690 --> 00:10:02,530 This is exactly what it's doing. 194 00:10:02,530 --> 00:10:04,810 I'm actually kind of blown away. 195 00:10:04,810 --> 00:10:09,070 So I will admit that I'm a little bit of an AI skeptic. 196 00:10:09,230 --> 00:10:12,730 You see a lot of hype and not a lot of... 197 00:10:12,730 --> 00:10:15,470 I believe there's a bit of an overhype. 198 00:10:15,470 --> 00:10:22,730 And especially in these reverse engineering scenarios, people have been claiming, oh, you can just put the code in here and it will tell you what it is. 199 00:10:22,730 --> 00:10:25,990 And I've been thinking, well, can you actually, though? 200 00:10:25,990 --> 00:10:27,750 But this is really impressive. 201 00:10:27,750 --> 00:10:28,210 Yeah . 202 00:10:28,770 --> 00:10:31,290 So here we can see the big... 203 00:10:31,290 --> 00:10:34,830 This is the matrix of all of the edges and the... 204 00:10:34,830 --> 00:10:40,590 Right, so this is the matrix defining the individual, the cost or the distances between the nodes. 205 00:10:40,590 --> 00:10:43,070 And you have this full FFFF or minus one. 206 00:10:43,070 --> 00:10:48,550 And this is like a marker for there being no edge between those two nodes. 207 00:10:48,550 --> 00:10:54,750 And this is why you had all of those if statements in the algorithm, where it's checking if it's minus one. 208 00:10:56,430 --> 00:10:58,330 It's a dead end, essentially. 209 00:10:58,330 --> 00:11:06,670 And then I fortunately had to add in a little bit because checking for overflow when adding two costs together and stuff like this. 210 00:11:06,670 --> 00:11:11,130 So this made the code a tad messier than what it could have been. 211 00:11:11,130 --> 00:11:12,930 So let's talk about the hints we've got. 212 00:11:12,930 --> 00:11:15,150 Because I know a lot of the challenges, the hints have been super useful. 213 00:11:15,150 --> 00:11:17,490 They've really come down and made a difference. 214 00:11:18,050 --> 00:11:21,110 How much hints do we have for them? 215 00:11:21,110 --> 00:11:23,370 Are we just going to tell them the algorithm at some point? 216 00:11:23,370 --> 00:11:25,350 Or what comes through there? 217 00:11:25,370 --> 00:11:27,910 Yeah, I'm trying to remember the exact hint. 218 00:11:27,910 --> 00:11:36,610 But I know that the second hint that they get says, like, this is an unoptimized version of the Floyd-Werschel shortest path algorithm or something like this. 219 00:11:36,610 --> 00:11:44,850 So theoretically, we hopefully won't need a sudden death because if worst case comes to worst, they should be able to just look up that implementation of an efficient version of that algorithm. 220 00:11:44,850 --> 00:11:45,290 Right. 221 00:11:45,290 --> 00:11:55,030 And if we go back over to MMM here, you can see the player looking here at this function called decrypt flag with the solution. 222 00:11:55,330 --> 00:11:59,110 So once they have calculated this whole thing. 223 00:11:59,190 --> 00:12:08,450 So what this algorithm does is that you give it a graph with nodes and you tell the distance between all the nodes. 224 00:12:08,450 --> 00:12:16,930 And the algorithm will then produce a new matrix with the total shortest distance from each node to each node. 225 00:12:16,930 --> 00:12:17,170 Oh , wow. 226 00:12:17,170 --> 00:12:20,370 So it fully characterizes every possible path. 227 00:12:20,370 --> 00:12:20,590 Right. 228 00:12:20,590 --> 00:12:27,790 I don't know if you have one of those old map book or something that's saying if you want to travel from this city to this city, it's this long and so on. 229 00:12:27,790 --> 00:12:29,670 It builds up this matrix. 230 00:12:29,730 --> 00:12:39,050 And then this function, it will just take that whole matrix and serialize it into a long sequence of bytes and use that as a decryption key to get the flag. 231 00:12:39,170 --> 00:12:39,290 Okay . 232 00:12:39,290 --> 00:12:43,690 So they have to get it perfectly right because that whole resulting value is... 233 00:12:43,690 --> 00:12:44,950 and it is a deterministic algorithm. 234 00:12:44,950 --> 00:12:47,250 It's not like it's a heuristic that can produce different results. 235 00:12:47,250 --> 00:12:54,150 It is going to be there is one correct answer and the algorithm will... which makes sense then because graph traversal, that's a hard problem. 236 00:12:54,490 --> 00:13:00,290 So it makes sense then that this would be done inefficiently, would not be possible at all in the scope of this. 237 00:13:00,290 --> 00:13:01,730 How long does your solution take to run? 238 00:13:01,730 --> 00:13:02,590 If you have your implementation... 239 00:13:03,150 --> 00:13:05,090 I mean, it's pretty much instant. 240 00:13:05,090 --> 00:13:05,970 Yeah, yeah. 241 00:13:05,970 --> 00:13:08,670 So the algorithm is... 242 00:13:08,670 --> 00:13:09,530 Is it even in Python then? 243 00:13:09,530 --> 00:13:10,490 It's in Python. 244 00:13:10,490 --> 00:13:11,130 Okay. 245 00:13:11,130 --> 00:13:13,350 So it's the optimized version. 246 00:13:13,350 --> 00:13:18,930 So I said the unoptimized version is like 3 to the n, so exponential, like it goes up completely. 247 00:13:18,970 --> 00:13:23,650 The optimized version is cubic, so n to the power of 3. 248 00:13:24,350 --> 00:13:29,030 There are faster algorithms for this, but yeah, anyway, this is what we went for. 249 00:13:29,670 --> 00:13:33,170 So, which is still pretty bad for like a polynomial. 250 00:13:33,170 --> 00:13:35,030 Like cubic is still... 251 00:13:35,030 --> 00:13:36,690 How many nodes do we have? 252 00:13:36,690 --> 00:13:40,710 Right, so it's a 50 node, so it's a 50 by 50 grid. 253 00:13:40,710 --> 00:13:46,830 So I made it small enough that, you know, like 50 cubed is still a very small number. 254 00:13:47,670 --> 00:13:52,870 And you can see there, like you saw on the screen, that he was running... 255 00:13:52,870 --> 00:13:54,450 Was that running a debugger dumping out things? 256 00:13:54,630 --> 00:13:56,250 I don't think it was a debugger. 257 00:13:56,250 --> 00:14:02,070 He was just, I think he was just running it and printing values maybe? 258 00:14:02,330 --> 00:14:04,330 Or I'm trying to... 259 00:14:04,330 --> 00:14:07,750 I want to see the terminal output again. 260 00:14:09,350 --> 00:14:13,690 So I haven't seen a whole lot of people actually writing like scripts for this. 261 00:14:13,690 --> 00:14:21,030 Like all the solutions so far have been standalone scripts that really haven't interacted directly with the binaries for the matches I've casted, so I've definitely missed some of them. 262 00:14:21,030 --> 00:14:25,450 But I'm seeing some IDA API here to pull out the values. 263 00:14:26,250 --> 00:14:27,450 This is kind of interesting. 264 00:14:27,450 --> 00:14:32,570 They are, it seems like they're generating C code from the Python scripts. 265 00:14:32,570 --> 00:14:35,610 Do you think they're just not convinced that their implementation is going to be efficient enough? 266 00:14:35,610 --> 00:14:35,730 Yeah. 267 00:14:35,730 --> 00:14:37,690 It's going to lose some native performance out of it probably? 268 00:14:37,730 --> 00:14:42,990 Might be, which is a bit of a premature optimization. 269 00:14:43,010 --> 00:14:43,430 Yeah , yeah . 270 00:14:43,450 --> 00:14:47,030 Get it working first and then decide if you need that, yeah. 271 00:14:47,030 --> 00:14:47,730 Yeah. 272 00:14:47,950 --> 00:15:01,390 I guess the tricky thing here is that it's kind of hard to tell, no, actually, he's just doing test values. 273 00:15:01,390 --> 00:15:02,110 That's fine. 274 00:15:02,110 --> 00:15:07,390 So if you don't get the correct answer, you don't quite know what's wrong. 275 00:15:07,470 --> 00:15:10,590 Because if you have the wrong decryption key, you will just get garbage. 276 00:15:10,590 --> 00:15:10,930 Right , right. 277 00:15:10,930 --> 00:15:12,090 There's no close. 278 00:15:12,090 --> 00:15:13,410 There's only done and not done. 279 00:15:13,410 --> 00:15:14,290 Yeah, exactly. 280 00:15:14,290 --> 00:15:23,990 Well, I mean, of course, you can always try to convince yourself that your algorithm is correct by creating a smaller test case that you can do with pen and paper. 281 00:15:24,370 --> 00:15:33,210 So when I was doing this, when I was implementing this, I actually had a bug in the code, and something was off. 282 00:15:33,850 --> 00:15:49,870 And I solved this by having a very small, like I had a three-by-three matrix or something, and I worked it out by hand and eventually found that the Wikipedia article that I was referencing, they were using one indexing and I was using zero-based indexing. 283 00:15:49,870 --> 00:15:50,470 Ah , that makes sense. 284 00:15:50,470 --> 00:15:50,970 Yeah. 285 00:15:52,610 --> 00:15:53,950 So let's go back to the straw hat. 286 00:15:53,950 --> 00:15:59,550 Just for a second there, they actually, I've seen two different things that were interesting for both of the solutions so far. 287 00:15:59,570 --> 00:16:06,870 So if I pull back up their script again, or maybe we'll have to go back over to MMM. 288 00:16:07,110 --> 00:16:11,730 Yeah, MMM is, if we switch back to MMM, they are also using ChatGPT. 289 00:16:11,730 --> 00:16:11,990 Ah , there we go . 290 00:16:12,350 --> 00:16:14,910 And then, right. 291 00:16:14,910 --> 00:16:19,530 And this is basically the output that our tester got. 292 00:16:19,530 --> 00:16:20,390 So interesting. 293 00:16:20,390 --> 00:16:20,990 Right. 294 00:16:20,990 --> 00:16:22,270 It's not able to produce now. 295 00:16:22,270 --> 00:16:24,350 They did feed in the output from different decompilers. 296 00:16:24,350 --> 00:16:29,330 So it could be that Ghita's output versus Ida's output is different enough that we'd have to test that, go back and watch. 297 00:16:29,330 --> 00:16:30,570 Oh , that's so interesting. 298 00:16:30,570 --> 00:16:32,990 That very small difference in the inputs. 299 00:16:32,990 --> 00:16:37,530 Just the formatting or even the, these are non-deterministic systems. 300 00:16:37,530 --> 00:16:37,870 Right. 301 00:16:37,870 --> 00:16:44,350 So maybe there is some input training data out there that just happens to look... 302 00:16:44,350 --> 00:16:45,490 Looks more like this. 303 00:16:45,490 --> 00:16:47,110 Yeah, it's entirely possible. 304 00:16:47,390 --> 00:16:49,410 Which is pretty cool. 305 00:16:49,410 --> 00:16:50,710 That's very interesting. 306 00:16:50,710 --> 00:16:53,330 I think this is the... 307 00:16:53,330 --> 00:16:58,810 We might have seen a little bit of chat GPT in some of the other... 308 00:16:58,810 --> 00:16:59,230 We have. 309 00:16:59,230 --> 00:17:02,030 This one is where it seems to have been actually useful. 310 00:17:02,030 --> 00:17:02,830 Let's look at Straw Hat. 311 00:17:02,830 --> 00:17:04,630 We've actually seen now the output of the script. 312 00:17:05,230 --> 00:17:08,010 So they're actually generating values that they've... 313 00:17:08,010 --> 00:17:09,130 Are these pulling out... 314 00:17:09,130 --> 00:17:11,950 Are they just using this to dump the data? 315 00:17:11,990 --> 00:17:12,710 Yeah. 316 00:17:12,710 --> 00:17:15,130 So the minus one, I think, is the initial state. 317 00:17:15,130 --> 00:17:20,230 So when the algorithm starts, it creates the memory to hold the results. 318 00:17:20,230 --> 00:17:21,490 Well, I see 50 lines. 319 00:17:21,490 --> 00:17:22,110 So 50 lines. 320 00:17:22,110 --> 00:17:24,250 This is just essentially... 321 00:17:24,250 --> 00:17:28,130 I think they're dumping the raw values of the grid. 322 00:17:28,130 --> 00:17:28,170 Right . 323 00:17:28,170 --> 00:17:33,630 So all the minus one, that's like the initial state before filling out the values. 324 00:17:33,630 --> 00:17:36,090 Yeah, but so some of the rows were minus ones and some of the rows were not. 325 00:17:36,090 --> 00:17:38,950 No, no, but there was this big block, right, of minus ones. 326 00:17:38,950 --> 00:17:39,690 And then there's... 327 00:17:39,690 --> 00:17:46,810 So I think in my code that generates the problem, about every fifth edge is a minus one. 328 00:17:47,250 --> 00:17:48,070 I think that's like... 329 00:17:48,070 --> 00:17:51,590 I randomly generated the input graph. 330 00:17:52,330 --> 00:17:54,530 So, yeah. 331 00:17:54,530 --> 00:17:57,850 Although you can see there in this Google search history, torque. 332 00:17:59,310 --> 00:18:00,670 Poor CTF players. 333 00:18:00,670 --> 00:18:04,910 In the main event, one of the challenges is a torque 3D engine script. 334 00:18:04,910 --> 00:18:08,270 So I know that a lot of people suddenly became familiar with the 3D engine. 335 00:18:08,270 --> 00:18:09,730 They weren't beforehand. 336 00:18:09,830 --> 00:18:10,510 Yeah. 337 00:18:11,690 --> 00:18:12,130 And... 338 00:18:12,130 --> 00:18:13,150 Oh, no. 339 00:18:13,150 --> 00:18:14,410 Verify that you are human. 340 00:18:14,410 --> 00:18:15,230 Yeah, I was kidding. 341 00:18:15,230 --> 00:18:16,150 You typed too fast. 342 00:18:16,150 --> 00:18:17,710 We're going to see a capture. 343 00:18:17,710 --> 00:18:18,410 Yeah. 344 00:18:18,490 --> 00:18:25,270 And while we were looking a little bit more into this, I saw earlier that I was looking... 345 00:18:25,270 --> 00:18:26,050 I was reading the chat. 346 00:18:26,050 --> 00:18:29,890 So, unfortunately, we don't have the YouTube chat in front of us. 347 00:18:29,890 --> 00:18:39,970 But I saw previously looking from the stream that someone asked about if we could, you know, explain a little bit more about, like, the setup and the environment that we have here. 348 00:18:41,490 --> 00:18:41,930 But... 349 00:18:41,930 --> 00:18:45,050 So we have behind us... 350 00:18:45,550 --> 00:18:49,250 Behind this wall, we have the players sitting across each other at a table. 351 00:18:49,250 --> 00:18:52,410 So, like, they are really, like, face-to-face with their laptops. 352 00:18:52,410 --> 00:18:54,430 They are on a isolated... 353 00:18:54,430 --> 00:18:56,270 Well, kind of isolated network. 354 00:18:56,270 --> 00:18:57,570 They can reach the Internet. 355 00:18:57,570 --> 00:19:01,650 They can reach the game servers that we have on that network. 356 00:19:02,390 --> 00:19:09,750 By the way, I want to go back and really get the straw hat because they just asked ChatGPT to optimize it, and it used a memo approach, actually. 357 00:19:09,750 --> 00:19:10,750 And it suggested... 358 00:19:10,750 --> 00:19:11,290 Oh, nice. 359 00:19:11,870 --> 00:19:15,670 Suggested essentially doing really what that hash was doing on the other side in the Python. 360 00:19:15,670 --> 00:19:16,050 Yeah. 361 00:19:16,050 --> 00:19:20,830 But using, like, a massive array instead of, like, a hash table or something like this. 362 00:19:20,950 --> 00:19:21,330 Right . 363 00:19:21,370 --> 00:19:23,270 So it's kind of a similar concept. 364 00:19:23,270 --> 00:19:24,030 So it is... 365 00:19:24,030 --> 00:19:28,350 I've got to say the ChatGPT hints that Straw Hat's getting out seem to be pretty good. 366 00:19:28,350 --> 00:19:30,470 They're, like, certainly not bad advice, bad ideas. 367 00:19:30,470 --> 00:19:31,790 No, it's very valid. 368 00:19:31,790 --> 00:19:35,210 And if we go over to MMM, I saw... 369 00:19:35,790 --> 00:19:37,750 Let's see if we can get this again. 370 00:19:37,750 --> 00:19:43,830 You can see there in the terminal there was a lot of, like... 371 00:19:43,830 --> 00:19:45,910 It was running it in a debugger. 372 00:19:45,910 --> 00:19:47,690 Okay, so that was a debugger we saw earlier. 373 00:19:47,690 --> 00:19:51,610 And I think he's, like, validating that his... 374 00:19:51,610 --> 00:19:55,770 Well, this is, you know, a little bit of speculation from my side, but this is what I would do. 375 00:19:55,770 --> 00:20:08,430 Like, even though the calculation that's being done in the program, even though it's slow, you can probably still, like, do a little bit of debugging and just checking that, like, things are, like, agreeing with your values. 376 00:20:08,430 --> 00:20:10,450 Your first couple of results of calculation maybe. 377 00:20:10,450 --> 00:20:13,370 I was going to ask earlier if the problem is dividable enough that you could do that. 378 00:20:13,370 --> 00:20:16,370 So you can go... I think you can... 379 00:20:16,370 --> 00:20:21,190 Yeah, yeah, I think you can bottom out in, like, one branch and get that result. 380 00:20:21,190 --> 00:20:22,410 And then just compare it to what you have. 381 00:20:22,410 --> 00:20:26,090 Yeah, so you can get a little bit of information out to do a little bit of validation. 382 00:20:26,090 --> 00:20:28,410 By the way, Newbie Edge on the chat, thank you for chiming in. 383 00:20:28,410 --> 00:20:33,750 We did pull that up now, pointed out that we've got chat GPT-3 and chat GPT-4. 384 00:20:33,750 --> 00:20:39,090 So MMM is using GPT-3.5, and we've got Straw Hat using 4. 385 00:20:39,090 --> 00:20:40,090 3.5. 386 00:20:40,170 --> 00:20:42,730 Yeah, so we've got MMM using 3.5. 387 00:20:42,730 --> 00:20:45,150 And we've got Straw Hat using GPT-4. 388 00:20:45,150 --> 00:20:49,690 So it is entirely possible that's actually just the difference in terms of which version they were using. 389 00:20:49,690 --> 00:20:51,090 Oh, that's really cool. 390 00:20:51,530 --> 00:20:56,130 Newbie Edge, by the way, is one of the players in Norse Code who did play a match earlier. 391 00:20:56,210 --> 00:21:01,210 Unfortunately lost to MMM, but they did really well in the tournament. 392 00:21:01,210 --> 00:21:02,990 Had a really great run there. 393 00:21:02,990 --> 00:21:09,250 Well, they can take some pleasure in knowing that the person that defeated them is being stumped by the old version that they caught on stream. 394 00:21:09,250 --> 00:21:10,650 They saw the difference. 395 00:21:10,650 --> 00:21:11,230 Thank you for pointing that out. 396 00:21:11,230 --> 00:21:19,470 So here we do see the debugger and checking some value, dumping out some memory of this. 397 00:21:19,870 --> 00:21:20,230 Oh, right. 398 00:21:20,230 --> 00:21:22,210 So here we also see a dump of this. 399 00:21:22,330 --> 00:21:26,470 So W is the name of the table with all the edges. 400 00:21:26,470 --> 00:21:29,130 So this is what's being dumped out here. 401 00:21:29,590 --> 00:21:36,450 Even just having symbols helps with that too when you're in the debugger and you've got symbols, being able to global variable names and whatnot is a nice convenience. 402 00:21:36,450 --> 00:21:38,450 So I did a little bit of a give and take. 403 00:21:38,450 --> 00:21:46,390 So we made it a little bit easier where we kept the symbols, but I did choose to... 404 00:21:46,390 --> 00:21:50,450 So that variable was initially called distance matrix or something like this. 405 00:21:50,450 --> 00:21:52,210 So I did choose to just... 406 00:21:52,210 --> 00:21:54,290 A couple of things were sort of anonymized a little bit. 407 00:21:54,470 --> 00:21:57,950 So the algorithm is called mystery algorithm instead of the actual name. 408 00:21:57,950 --> 00:22:01,230 The table is called just W instead of distance matrix. 409 00:22:01,230 --> 00:22:06,310 And then they get all the other symbols to tell them, hey, you don't really need to look at these other functions. 410 00:22:06,730 --> 00:22:08,310 So we are seeing... 411 00:22:08,830 --> 00:22:12,350 They both feel like they've got... 412 00:22:12,770 --> 00:22:16,050 Certainly the beginnings of code, they could be doing this. 413 00:22:17,290 --> 00:22:18,410 But let's see. 414 00:22:18,410 --> 00:22:20,410 So again, we went with the C approach. 415 00:22:20,410 --> 00:22:30,210 Now we've got to fix up all the errors from our auto-generated code in our chat GPG output that are not valid C potentially. 416 00:22:30,290 --> 00:22:33,930 But that looks a little bit like IDA output actually with the comments, with the stack. 417 00:22:33,930 --> 00:22:37,850 Well, they generated it from an IDA script. 418 00:22:37,850 --> 00:22:44,150 So their IDA Python script actually generated both the header file that they're using, that W dot H is literally just W. 419 00:22:44,150 --> 00:22:46,110 So those are the values that they dump from there. 420 00:22:46,230 --> 00:22:48,330 Although again, I am thinking about this though. 421 00:22:48,330 --> 00:22:51,130 You said about every fifth edge was negative one. 422 00:22:51,130 --> 00:22:55,590 But we saw in that W dot H a bunch of rows of all negative ones. 423 00:22:55,590 --> 00:22:58,690 What I think it was was that they dumped stuff in the debugger. 424 00:22:58,930 --> 00:23:08,890 So the big thing with all the minus one, that's if you would dump the kind of the state variable before it goes into the algorithm. 425 00:23:09,630 --> 00:23:10,990 Or they just made a mistake. 426 00:23:10,990 --> 00:23:13,010 But there's no reason they should have received that. 427 00:23:13,010 --> 00:23:14,610 It should be pretty straightforward, yeah. 428 00:23:14,990 --> 00:23:18,790 So I think that was just a, you know, we kind of misread that, I think. 429 00:23:18,930 --> 00:23:19,330 Could be. 430 00:23:19,330 --> 00:23:20,450 We'll have to see if it comes back up again. 431 00:23:25,150 --> 00:23:28,190 Let's move over to MMM. 432 00:23:28,190 --> 00:23:31,410 And we can see there is like some calculations going on. 433 00:23:31,950 --> 00:23:34,410 In the background. 434 00:23:34,410 --> 00:23:37,210 And you can see it looks like this is going. 435 00:23:37,210 --> 00:23:39,610 So you see kind of these pairs of numbers. 436 00:23:39,810 --> 00:23:41,050 One is going pretty fast. 437 00:23:41,050 --> 00:23:44,150 And then one is taking up 15 and so on. 438 00:23:44,610 --> 00:23:45,890 That's actually a counter. 439 00:23:45,890 --> 00:23:47,250 That could be pretty close to itself. 440 00:23:47,250 --> 00:23:49,470 And I will say earlier they had an RC4 script. 441 00:23:49,470 --> 00:23:52,510 They were already pulling it there to say they copied and pasted their RC4. 442 00:23:54,270 --> 00:23:56,390 So they've got the code. 443 00:23:56,390 --> 00:23:59,410 I mean, it's entirely possible that this is a working solution. 444 00:23:59,410 --> 00:24:01,530 We won't really know, just like they won't, until they run it right. 445 00:24:01,530 --> 00:24:02,290 As you were saying earlier. 446 00:24:02,290 --> 00:24:05,870 And then, of course, you also have to be very careful here how you... 447 00:24:05,870 --> 00:24:13,850 So in Python, because you have these S integers and you need to pack them, you know, make sure you get the ndns correct there. 448 00:24:14,510 --> 00:24:15,990 There's a lot of little fiddly bits. 449 00:24:16,250 --> 00:24:17,510 Yeah , this is like the... 450 00:24:18,090 --> 00:24:19,330 Oh, there's the flag. 451 00:24:19,330 --> 00:24:19,910 That's the flag. 452 00:24:19,910 --> 00:24:20,690 Yeah, yeah, yeah. 453 00:24:20,810 --> 00:24:25,250 So now it just needs to connect to the server and submit this. 454 00:24:25,290 --> 00:24:28,650 And that's the solution. 455 00:24:28,650 --> 00:24:29,230 That is it. 456 00:24:29,310 --> 00:24:30,110 Congratulations. 457 00:24:30,370 --> 00:24:34,490 We've got a win from MMM right their way into the final. 458 00:24:34,490 --> 00:24:35,890 Really well done. 459 00:24:36,530 --> 00:24:38,210 All right, let them know we've got a winner. 460 00:24:38,210 --> 00:24:40,070 Yeah, that's really, really cool. 461 00:24:40,410 --> 00:24:41,830 Yeah, that was impressive. 462 00:24:41,830 --> 00:24:44,890 I think it was really cool to see both the different approaches. 463 00:24:44,890 --> 00:24:46,410 It was cool to see... 464 00:24:46,410 --> 00:24:53,670 I mean, I will admit, even though, you know, my skepticism, it was cool to see it did work, even though they didn't win. 465 00:24:53,670 --> 00:24:57,170 I think just the speed of it came down, so they just kind of got beat on speed. 466 00:24:57,170 --> 00:24:58,590 But the approach was sound. 467 00:24:58,590 --> 00:25:02,690 And they may not have even honestly been that far off just looking at where they were and looking at what they had done. 468 00:25:02,690 --> 00:25:03,490 No, totally. 469 00:25:04,850 --> 00:25:10,030 So, yeah, I think... I don't know if there is anything else to add at the moment. 470 00:25:10,030 --> 00:25:10,750 Not for this round. 471 00:25:10,750 --> 00:25:15,010 So just as a reminder for the bracket for folks, this now is one match left. 472 00:25:15,010 --> 00:25:16,230 We have the final event. 473 00:25:16,230 --> 00:25:26,110 The teams that score, the number one team, the individual scores for their team will be getting 1,337 points in the main CTF. 474 00:25:26,110 --> 00:25:28,730 So I think, though, they've blacked out the scoreboard. 475 00:25:28,730 --> 00:25:33,590 They've brought us actually up on the projector just now to see the end of the game. 476 00:25:33,590 --> 00:25:38,910 So for this last match, if you're in the Capture the Flag room, we'll be showing the match in here. 477 00:25:38,910 --> 00:25:39,730 All the teams will be done. 478 00:25:39,730 --> 00:25:44,650 Because our last match happens in 30 minutes, which is actually after the main CTF ends. 479 00:25:44,650 --> 00:25:48,110 So it is the last possible points you can score for your team. 480 00:25:48,470 --> 00:25:51,030 Although I think MMM had a pretty solid lead yesterday. 481 00:25:51,030 --> 00:25:52,450 So depending on what happened today... 482 00:25:52,450 --> 00:25:54,490 Yeah, they are in a very good spot. 483 00:25:54,510 --> 00:25:55,910 Also, they are in the Grand Finals here. 484 00:25:55,910 --> 00:25:58,510 So even... I mean, of course, you know, of course you want to win. 485 00:25:58,550 --> 00:26:01,310 But even if they lose, they still get a good amount of points. 486 00:26:01,310 --> 00:26:02,910 I think the difference between 1 and 2 here... 487 00:26:02,910 --> 00:26:05,770 And again, I don't remember where Straw Hat was on the scoreboard before it... 488 00:26:05,770 --> 00:26:07,570 They were in a good position, but... 489 00:26:07,570 --> 00:26:09,310 Yeah, they may have been like 4th or 3rd or so. 490 00:26:09,350 --> 00:26:11,390 So they're both, you know, kind of solid teams. 491 00:26:11,390 --> 00:26:15,570 But really what would have mattered is one of the 2nd or 3rd place teams that was behind MMM at the time. 492 00:26:15,570 --> 00:26:18,710 If they had come into 1st and MMM had ended up last... 493 00:26:18,710 --> 00:26:21,350 That's really where you might have seen Live CTF impact the main event. 494 00:26:21,350 --> 00:26:22,830 But it's unlikely. 495 00:26:22,830 --> 00:26:24,890 That said, I'm really excited to see DRAMA. 496 00:26:24,890 --> 00:26:28,230 We've got a really fun challenge, I think, for the Finals. 497 00:26:28,230 --> 00:26:31,350 I'm looking forward to seeing how teams approach it. 498 00:26:31,350 --> 00:26:32,250 It's going to be really cool. 499 00:26:32,250 --> 00:26:36,590 So we will have the Grand Finals of the Live CTF coming up in about 30 minutes. 500 00:26:36,590 --> 00:26:40,690 We will have MMM against Hypeboy. 501 00:26:40,690 --> 00:26:43,710 It's going to be a really cool match. 502 00:26:43,950 --> 00:26:46,130 And yeah, looking forward to it. 503 00:26:46,130 --> 00:26:48,630 So we will be back in about 30 minutes. 504 00:26:48,630 --> 00:26:49,050 We'll see you then. 505 00:26:49,050 --> 00:26:49,450 Take care. 506 00:26:49,450 --> 00:26:49,850 Bye.