1 00:00:00,000 --> 00:00:02,880 All right, we finally made it. This is the last talk of the day. 2 00:00:03,180 --> 00:00:07,760 You survived, you're still awake, and we're ready to wrap it up here today. 3 00:00:08,140 --> 00:00:11,140 And we're ending with a really fun talk today. 4 00:00:11,580 --> 00:00:14,780 It's a thing about Zelda using After Free. 5 00:00:15,020 --> 00:00:18,520 Let's show some really cool stuff. A little robot doing some awesome, fun stuff. 6 00:00:18,860 --> 00:00:22,200 And there you go. All right. 7 00:00:23,000 --> 00:00:24,960 Hello, everyone. Can you hear me all right? Yes. 8 00:00:25,080 --> 00:00:28,100 I see a few people with Taskbot shirts out here. I love that. 9 00:00:28,100 --> 00:00:32,160 So if you have not met me before, I am Duango AC, Keeper of Taskbot. 10 00:00:32,260 --> 00:00:34,940 I'm just going to slightly adjust this mic because I'm not that short. 11 00:00:36,300 --> 00:00:39,220 With me today are some amazing folks. First of all, I have... 12 00:00:39,220 --> 00:00:42,200 Soren. Hi. Yeah, I guess I'm audible. 13 00:00:42,800 --> 00:00:45,480 I'm a tools developer and music arranger for the N64 community, 14 00:00:45,680 --> 00:00:49,280 and I was the director of Triforce Percent. Also with us... 15 00:00:49,280 --> 00:00:54,320 My name is M-Link, or Liam. I'm here to speedrun Ocarina of Time, 16 00:00:54,420 --> 00:00:55,860 and I love speedrunning, so... 17 00:00:57,140 --> 00:00:58,020 Before we get started, 18 00:00:58,100 --> 00:01:01,680 there's a couple quick things to say. First of all, this was all made possible 19 00:01:01,680 --> 00:01:04,840 by a huge team of people behind us. It's not just us. 20 00:01:04,960 --> 00:01:08,000 There are so many different people that are part of making this happen. 21 00:01:08,600 --> 00:01:11,980 We're here to talk about The Legend of Zelda Use After Free, 22 00:01:12,480 --> 00:01:16,440 which is basically a way of saying how Taskbot glitches the future into OOT. 23 00:01:17,380 --> 00:01:18,680 Yes, alliteration. I can't help it. 24 00:01:20,020 --> 00:01:25,900 We're going to have a human runner, M-Link over here, start playing on a brand new file. 25 00:01:26,520 --> 00:01:27,580 It's going to start from scratch. 26 00:01:27,580 --> 00:01:28,620 You're going to hear some game audio. 27 00:01:28,740 --> 00:01:31,280 We'll have that kind of hanging around in the background there for a little bit. 28 00:01:32,360 --> 00:01:33,240 So you can hear that. 29 00:01:34,580 --> 00:01:37,400 And this is an unmodified Ocarina of Time cartridge. 30 00:01:37,520 --> 00:01:40,040 This is not a flash cart, no ROM changes. This is the real game. 31 00:01:40,260 --> 00:01:41,200 Kind of real N64. 32 00:01:41,440 --> 00:01:43,580 Yep, the only thing that's going on to give you a nice crisp image, 33 00:01:43,700 --> 00:01:47,780 I have an RGB mod and an RGB upscaler here, so we can get a nice clean image. 34 00:01:48,100 --> 00:01:51,880 I'm doing everything through OBS, so if anything goes wrong and you see things splashed on the 35 00:01:51,880 --> 00:01:57,480 screen, it's my fault. So there's a bunch of things I could say, but we're going to get under 36 00:01:57,480 --> 00:02:01,500 weight with the actual game, so let's get started. What M-Link is going to be doing is 37 00:02:01,500 --> 00:02:06,820 setting up an arbitrary code execution by using a few different glitches, but first we're going 38 00:02:06,820 --> 00:02:10,700 to hop into some slides. I'm just going to move this mic to the other side. 39 00:02:10,700 --> 00:02:11,780 I can see. It's fine. It's fine. 40 00:02:12,140 --> 00:02:12,740 All right. 41 00:02:13,180 --> 00:02:18,140 So yeah, this is DEF CON. We're all hackers in one form or another, so why do we hack? 42 00:02:18,260 --> 00:02:22,840 It depends on who you are, right? So most people, a lot of people, 43 00:02:22,860 --> 00:02:26,640 depending on what hat you are, a lot of people will do it for money. Some people will do it for 44 00:02:27,480 --> 00:02:30,600 purposes. Some people will do it to be the person that others are defending against. 45 00:02:31,100 --> 00:02:39,240 Everybody does it for fun, right? But what about creating an arbitrary code execution, 46 00:02:39,460 --> 00:02:44,540 a remote code execution payload for emotional impact? We're not talking about the emotional 47 00:02:44,540 --> 00:02:51,020 impact of, like, oh, my God, all my files are gone. So what hat would you take? 48 00:02:51,320 --> 00:02:57,280 I might think of it as a white hat. Nintendo probably thinks of it as a black hat. 49 00:03:07,600 --> 00:03:09,280 You want to have a black hat. 50 00:03:12,880 --> 00:03:14,340 But we're not doing that. 51 00:03:14,420 --> 00:03:17,480 We have arbitrary code execution on the video game console. 52 00:03:17,840 --> 00:03:22,240 And the reason we have a human runner here, Mlink here, is because Mlink is holding a 53 00:03:22,240 --> 00:03:27,460 real controller connected to controller part one, and we have our friend Taspat here connected to three самات here, connected to threetı 54 00:03:27,460 --> 00:03:31,600 controller courts 2, 3, and 4 for most of this. Briefly he'll connect to all four at the same time. 55 00:03:32,220 --> 00:03:37,120 And there's a little bit to unpack here. So first of all, this is Taskbot. He has been around for 56 00:03:37,120 --> 00:03:41,720 almost 10 years now, raising money at games and quick charity events and other things. 57 00:03:42,280 --> 00:03:47,400 He is currently holding a replay device made by Onasaurus with code from Rasteri and additional 58 00:03:47,400 --> 00:03:55,620 code from Sorin here as well. And that allows us to pretend to be a controller. You might consider 59 00:03:55,620 --> 00:04:00,520 this a little bit of an evil maid attack, because we look like we're completely innocent, we're just 60 00:04:00,520 --> 00:04:05,360 plugging into a normal port, but our intentions are not necessarily what Nintendo had in mind. 61 00:04:06,600 --> 00:04:12,020 But the Taskbot is really just putting in normal compliant controller input into the controller 62 00:04:12,020 --> 00:04:15,620 ports as if you had three people with controllers pressing buttons really really quickly. 63 00:04:15,860 --> 00:04:21,140 Exactly. By the way, I'm very very thankful that Sorin is here for two reasons. First of all, 64 00:04:21,160 --> 00:04:24,920 he'll keep me from forgetting anything on the talk, I guarantee that, and second of 65 00:04:24,920 --> 00:04:25,600 all he was the director. He is right there, and he's going to talk to you at the end of the talk. 66 00:04:25,600 --> 00:04:29,140 director of the project that you're seeing here, and without his expertise, this would 67 00:04:29,140 --> 00:04:30,000 not have happened, so. 68 00:04:31,220 --> 00:04:34,960 Okay, so let's talk about aces in video games. 69 00:04:35,120 --> 00:04:39,160 So the first arbitrary code execution that beat the game quickly was one by MasterJune 70 00:04:39,160 --> 00:04:44,460 back in 2012, and it managed to complete Super Mario World in two and a half minutes by using 71 00:04:44,460 --> 00:04:49,420 what was then called a corrupts memory glitch that had to do with moving things around in 72 00:04:49,420 --> 00:04:51,340 the object attribute map on Super Mario World. 73 00:04:51,340 --> 00:04:57,200 That was followed up with another game in glitch by Lord Tom and Tompa back in 2014, 74 00:04:57,880 --> 00:05:04,460 but along the same lines, Seth Bling figured out how to do an ace with human ability alone, 75 00:05:04,820 --> 00:05:06,300 and this was pretty incredible. 76 00:05:06,440 --> 00:05:11,760 It took a little longer, but arbitrary code execution, same method in Super Mario World, 77 00:05:11,920 --> 00:05:15,300 using the object attribute map to overload a bunch of different things. 78 00:05:15,360 --> 00:05:18,620 If you want to know how this works, Retro Game Mechanics Explained, who we'll be mentioning 79 00:05:18,620 --> 00:05:21,320 a little bit later, has a video on how this works. 80 00:05:21,320 --> 00:05:24,780 So if you're interested, you can go check out Retro Game Mechanics Explained. 81 00:05:24,940 --> 00:05:29,340 So that was doing an ace, but now with human input only. 82 00:05:30,840 --> 00:05:37,820 Well, I got involved all the way back in 2013, preparing for a AGDQ 2014, a charity 83 00:05:37,820 --> 00:05:39,760 fundraiser at that time for the Prevent Cancer Foundation. 84 00:05:40,120 --> 00:05:43,540 There I am with a lot less facial hair. 85 00:05:45,160 --> 00:05:46,580 And a lot less sprinkles. 86 00:05:46,880 --> 00:05:47,780 Oh, man! 87 00:05:48,340 --> 00:05:49,220 Words hurt! 88 00:05:49,660 --> 00:05:50,240 Anyway. 89 00:05:51,580 --> 00:05:58,060 We were presenting at AGDQ 2014, and we did something more than just beat the game quickly. 90 00:05:58,300 --> 00:06:01,680 We took advantage of the fact that we could do arbitrary code execution to put Pong and 91 00:06:01,680 --> 00:06:03,060 Snake inside of the game. 92 00:06:03,500 --> 00:06:06,860 Master June put together this amazing payload that took the world by storm. 93 00:06:07,060 --> 00:06:10,880 Ars Technica covered it, and it kind of exploded from there, and that's where TASBOT started. 94 00:06:11,420 --> 00:06:16,480 You can see the picture of that's the original TASBOT based on a ROB robot, and we've come 95 00:06:16,480 --> 00:06:17,560 a long way since then. 96 00:06:18,460 --> 00:06:20,220 There's also some interesting large sketches. 97 00:06:20,220 --> 00:06:23,000 There's some detail payloads that happened with some other games. 98 00:06:23,200 --> 00:06:24,980 Not everything is just on a Super Nintendo. 99 00:06:25,220 --> 00:06:26,620 This was Pokemon Yellow. 100 00:06:27,160 --> 00:06:30,140 This was Mr. Wint in 2017, February 2017. 101 00:06:30,540 --> 00:06:34,400 He used some item manipulation and a few other glitches in the game to turn it into 102 00:06:34,400 --> 00:06:35,460 Pokemon Gold version. 103 00:06:35,680 --> 00:06:37,280 He shoved Tetris in there. 104 00:06:37,440 --> 00:06:39,240 He shoved Super Mario Bros. in there. 105 00:06:39,380 --> 00:06:44,060 He added portal references, and then he really pushed it over the edge by showing actual 106 00:06:44,060 --> 00:06:47,860 video on a Game Boy Color full-frame video. 107 00:06:48,320 --> 00:06:49,600 It's pretty impressive. 108 00:06:50,220 --> 00:06:51,840 I highly recommend watching this. 109 00:06:51,940 --> 00:06:54,600 You can go to TASVideos.org and see this run there. 110 00:06:55,380 --> 00:06:58,620 But we wanted to really ratchet things up. 111 00:06:58,720 --> 00:07:00,700 We knew we could do anything with Ace. 112 00:07:00,860 --> 00:07:05,940 So the TASBOT community that I lead went a little bit crazy. 113 00:07:06,340 --> 00:07:12,320 We found arbitrary code executions for a Nintendo game, Super Mario Bros. 3, another Nintendo 114 00:07:12,320 --> 00:07:17,440 game, in that case Mega Man, and Legend of Zelda Link to the Past. 115 00:07:17,820 --> 00:07:19,440 We used all three of them. 116 00:07:20,260 --> 00:07:25,000 We had some rather stupid trickery to place a Skype call over the consoles. 117 00:07:25,760 --> 00:07:27,400 This was silly. 118 00:07:27,880 --> 00:07:31,980 I wouldn't recommend it, but we had James Chen wandering around making a Skype call 119 00:07:31,980 --> 00:07:32,680 over a Super Nintendo. 120 00:07:33,980 --> 00:07:37,580 Obviously a Super Nintendo does not have the processing capability to do this. 121 00:07:37,660 --> 00:07:41,760 We did use some trickery, and we were shoving full frames of video through the Super Nintendo 122 00:07:41,760 --> 00:07:44,280 and using the two Nintendo consoles as the audio sources. 123 00:07:44,840 --> 00:07:47,500 We got to this point, like, how do we go any farther? 124 00:07:47,680 --> 00:07:49,980 We've done the most technical things we possibly can. 125 00:07:49,980 --> 00:07:51,500 Where do we take this next? 126 00:07:52,440 --> 00:07:57,240 Along the same time, by the way, large-scale Ace payloads started happening even with human 127 00:07:57,240 --> 00:07:57,520 runners. 128 00:07:57,680 --> 00:08:03,700 Seth Ling went on to make a Flappy Bird version, a clone, entirely with just human input. 129 00:08:03,860 --> 00:08:07,220 So he turned Super Mario World into Flappy Bird. 130 00:08:08,840 --> 00:08:10,360 Credit for that man's ingenuity. 131 00:08:10,460 --> 00:08:11,560 I've met him in person several times. 132 00:08:11,640 --> 00:08:12,240 He's a great guy. 133 00:08:12,740 --> 00:08:14,140 You should check him out. 134 00:08:14,560 --> 00:08:17,260 I'm going to hand it over to him, to Soren, for the next part. 135 00:08:17,460 --> 00:08:17,760 Yeah. 136 00:08:17,760 --> 00:08:23,040 So all of those examples of large-scale Ace payloads that we showed were sort of meme-y. 137 00:08:23,180 --> 00:08:24,580 You take over the game. 138 00:08:24,720 --> 00:08:28,380 You're basically just using the game as an entry point to take over the console and then 139 00:08:28,380 --> 00:08:31,060 put in some exploit that does something unrelated. 140 00:08:31,520 --> 00:08:36,160 But how about exploiting the game in order to change the game's plot in a way that is 141 00:08:36,160 --> 00:08:38,500 actually meaningful in the context of the original game? 142 00:08:38,880 --> 00:08:41,120 So Mr. Cheese came up with this in 2017. 143 00:08:41,680 --> 00:08:45,700 In Pokemon Blue, there was an urban legend that if you went to this particular place, 144 00:08:45,820 --> 00:08:47,740 and used a Pokemon's ability to push this. 145 00:08:47,760 --> 00:08:48,060 This truck. 146 00:08:48,180 --> 00:08:49,780 You could find Mew under the truck. 147 00:08:50,020 --> 00:08:54,220 And this wasn't in the game until you had arbitrary code execution. 148 00:08:54,500 --> 00:08:56,060 And then it was in the game. 149 00:08:56,360 --> 00:08:58,480 And so he made that. 150 00:08:58,620 --> 00:09:02,520 And he made, because it's not ROM changes, it's sort of within the game. 151 00:09:02,720 --> 00:09:03,840 It's just gameplay. 152 00:09:04,020 --> 00:09:04,540 It's just input. 153 00:09:05,440 --> 00:09:07,440 So he did that in 2017. 154 00:09:07,860 --> 00:09:10,860 And I saw that video and posted this comment on it. 155 00:09:11,100 --> 00:09:14,620 Using Ace to recreate what should have been in a game is one of the best things to do 156 00:09:14,620 --> 00:09:14,880 with it. 157 00:09:14,920 --> 00:09:15,400 I am a Joe. 158 00:09:15,400 --> 00:09:19,420 I'm just waiting for Ace in Ocarina of Time so we can program in a cutscene where Link 159 00:09:19,420 --> 00:09:22,040 gets the Triforce and put two decades of rumors to rest. 160 00:09:22,520 --> 00:09:24,200 So what am I talking about here? 161 00:09:24,900 --> 00:09:30,440 In 1997, before Ocarina of Time came out, Nintendo showed, like, advertisements on TV 162 00:09:30,980 --> 00:09:33,640 about that contained this scene of Link getting the Triforce. 163 00:09:33,800 --> 00:09:35,240 This was not in the final game. 164 00:09:35,420 --> 00:09:39,040 But people had seen it on TV, and then they got the game, and then they wanted to do it, 165 00:09:39,080 --> 00:09:39,700 and it wasn't there. 166 00:09:39,960 --> 00:09:43,600 And so people wanted to figure out how to do that, and there was all these little pieces 167 00:09:43,600 --> 00:09:44,660 of, like, beta content. 168 00:09:45,400 --> 00:09:46,100 References to things. 169 00:09:46,240 --> 00:09:50,580 So people thought it might have still been some secret buried in the game this whole 170 00:09:50,580 --> 00:09:50,880 time. 171 00:09:51,300 --> 00:09:56,100 In 1999, somebody made a hoax about getting the Triforce with some Photoshopped images. 172 00:09:56,380 --> 00:09:58,820 Nowadays, this would not pass muster for Photoshop quality. 173 00:09:59,180 --> 00:10:02,820 But in 1998, this was, like, a big deal, and people were all believing this. 174 00:10:04,120 --> 00:10:04,700 And yeah. 175 00:10:04,800 --> 00:10:06,480 So that was all... 176 00:10:06,480 --> 00:10:08,900 That was two years before Ace was found in Ocarina of Time. 177 00:10:09,060 --> 00:10:11,800 It was found in 2019 by... 178 00:10:11,800 --> 00:10:13,360 Several people worked on this. 179 00:10:13,420 --> 00:10:14,580 The names are listed here. 180 00:10:15,400 --> 00:10:17,220 And so then I posted on that video. 181 00:10:17,580 --> 00:10:19,540 Now we just have to use Ace to get the Triforce. 182 00:10:20,100 --> 00:10:23,560 So two and a half years later, that is exactly what we did. 183 00:10:23,680 --> 00:10:28,100 We made a large-scale Ace payload that creates a completely new plot within Ocarina of Time 184 00:10:28,100 --> 00:10:32,760 injected entirely through controller input that has little pieces of beta content and 185 00:10:32,760 --> 00:10:34,600 little pieces of urban legends and other things. 186 00:10:34,740 --> 00:10:37,900 And it leads to Link getting the Triforce, and then it leads a little further beyond 187 00:10:37,900 --> 00:10:38,960 that we'll talk about at the end. 188 00:10:41,800 --> 00:10:44,480 So arbitrary code execution sort of has two main components. 189 00:10:44,980 --> 00:10:45,380 Components of the Triforce. 190 00:10:45,380 --> 00:10:49,740 Component one is you have to somehow get your code onto the target system in some fashion. 191 00:10:50,120 --> 00:10:53,420 And then component two is you have to get that code to get executed. 192 00:10:53,680 --> 00:10:53,920 Yes. 193 00:10:55,680 --> 00:10:57,820 It's not an easy setup. 194 00:10:57,920 --> 00:10:58,820 Sometimes it goes wrong. 195 00:10:59,180 --> 00:11:02,360 Somehow you have to get the code executed on the target system. 196 00:11:04,140 --> 00:11:05,180 So what... 197 00:11:05,180 --> 00:11:10,300 In the N64 context, what that means is we somehow have to get some amount of the N64's 198 00:11:10,300 --> 00:11:13,620 memory to be new MIPS machine code. 199 00:11:13,620 --> 00:11:18,000 That is something that we write for whatever we want to do with it. 200 00:11:18,080 --> 00:11:21,720 And then we have to somehow get the program counter pointed to that MIPS machine code 201 00:11:21,720 --> 00:11:22,680 to execute it. 202 00:11:22,820 --> 00:11:27,880 And what that basically boils down to is sufficient control of memory and breaching the separation 203 00:11:27,880 --> 00:11:31,640 of code and data, which normally is, you know, an important part of how a computer works. 204 00:11:31,840 --> 00:11:34,040 So those two things are accomplished through... 205 00:11:34,040 --> 00:11:36,820 We encode certain data in rotation values. 206 00:11:37,540 --> 00:11:42,380 In other speed runs, they use Link's name in Japanese to encode two MIPS assembly instructions. 207 00:11:42,820 --> 00:11:43,300 Okay. 208 00:11:43,620 --> 00:11:48,240 So in this one, what we're mainly focusing on is memory holding the state of all of the 209 00:11:48,240 --> 00:11:51,700 buttons on all the controllers, the buttons and control sticks, because that is memory 210 00:11:51,700 --> 00:11:54,620 that we have a pretty easy way to manipulate the values of the memory. 211 00:11:55,040 --> 00:11:59,180 And then breaching the separation of code and data happens through a use after free 212 00:11:59,180 --> 00:12:01,040 bug, which is what the title of this talk is about. 213 00:12:01,460 --> 00:12:06,220 And the manipulation of that use after free bug in the speed running community is called 214 00:12:06,220 --> 00:12:07,220 stale reference manipulation. 215 00:12:07,960 --> 00:12:11,820 And both of these things are accomplished through a combination of speed running tricks 216 00:12:11,820 --> 00:12:13,200 and heap manipulation. 217 00:12:13,200 --> 00:12:14,600 Which is what we're going to talk about next. 218 00:12:16,240 --> 00:12:16,980 All right. 219 00:12:17,120 --> 00:12:19,680 This is the part where OBS goes wrong. 220 00:12:20,000 --> 00:12:21,880 Oh, I love the confidence. 221 00:12:22,600 --> 00:12:25,500 This is actually more like the part where I go wrong, but that's okay. 222 00:12:26,840 --> 00:12:30,180 So let's see what happens when I show this. 223 00:12:31,040 --> 00:12:31,740 All right. 224 00:12:32,580 --> 00:12:35,700 So this is the wrong location for this. 225 00:12:35,840 --> 00:12:37,400 This should be over here instead. 226 00:12:37,900 --> 00:12:38,980 Let's make that over there. 227 00:12:39,660 --> 00:12:40,460 All right. 228 00:12:40,520 --> 00:12:40,860 There we go. 229 00:12:41,020 --> 00:12:41,380 I told you. 230 00:12:41,920 --> 00:12:43,440 I forgot to relocate. 231 00:12:43,440 --> 00:12:43,500 It's fine. 232 00:12:43,760 --> 00:12:43,980 It's fine. 233 00:12:44,400 --> 00:12:44,940 It's okay. 234 00:12:46,280 --> 00:12:49,280 So RGME, retro game mechanics explained by Isofreeze. 235 00:12:49,540 --> 00:12:51,280 There's a whole video about this. 236 00:12:51,380 --> 00:12:52,420 I am using this with permission. 237 00:12:52,620 --> 00:12:53,760 Thank you very much to him for that. 238 00:12:54,740 --> 00:12:57,640 There's a lot of information you're going to see on the screen now that I'm not going 239 00:12:57,640 --> 00:12:58,080 to get into. 240 00:12:58,600 --> 00:13:02,940 This part of the talk is kind of like running on a treadmill. 241 00:13:04,060 --> 00:13:09,260 I'm going to have to keep up with all of these notes and it's not exactly easy. 242 00:13:09,880 --> 00:13:10,620 All right. 243 00:13:11,380 --> 00:13:15,500 So first of all, right now it's a video explaining how the controller input works. 244 00:13:15,640 --> 00:13:16,480 We're not going to go through all of that. 245 00:13:16,660 --> 00:13:21,240 But what I am going to go into is the heap. 246 00:13:21,560 --> 00:13:22,040 Okay. 247 00:13:22,260 --> 00:13:27,540 So if you're unfamiliar, a heap is an area of dynamically allocated memory where data 248 00:13:27,540 --> 00:13:32,320 blocks of different sizes are reserved for use by various objects and functions. 249 00:13:32,660 --> 00:13:36,560 So in Ocarina of Time there's a specific heap called the actor heap that contains code and 250 00:13:36,560 --> 00:13:39,180 data for all of the actors that are currently loaded in the game. 251 00:13:39,760 --> 00:13:41,280 So an actor in this context. 252 00:13:41,280 --> 00:13:46,700 It's any sort of object or entity, link, for instance, rupees, hidden objects and triggers 253 00:13:46,700 --> 00:13:47,080 like that. 254 00:13:47,500 --> 00:13:50,820 There are two main kinds of things held in the actor heap. 255 00:13:51,020 --> 00:13:53,380 There's actor overlays and the actors themselves. 256 00:13:53,960 --> 00:13:58,980 Actor overlays contain the code that is run for each type of actor. 257 00:13:59,120 --> 00:14:03,060 In other words, how they behave, let me move it forward a little bit, there we go. 258 00:14:04,820 --> 00:14:05,480 There we go. 259 00:14:05,580 --> 00:14:11,260 So things like how a particular object type behaves and things like that. 260 00:14:11,260 --> 00:14:15,380 Whereas the individual actors are instances of that actor. 261 00:14:15,980 --> 00:14:19,640 So as actors are loaded into the game, they're allocated into memory on the heap. 262 00:14:19,780 --> 00:14:23,720 So the game starts searching from the top, finds an empty spot, drops it in, as you can 263 00:14:23,720 --> 00:14:24,480 see in this graphic here. 264 00:14:24,740 --> 00:14:28,020 So it will find the first spot that it will fit in and it drops it there. 265 00:14:29,900 --> 00:14:34,140 So if a new type of actor is loaded, the corresponding actor overlay is also loaded. 266 00:14:34,680 --> 00:14:38,480 And when you transition to a new area, all of the actors in the new area are allocated 267 00:14:38,480 --> 00:14:39,080 to the heap. 268 00:14:39,140 --> 00:14:41,240 Before all of the old actors are loaded. 269 00:14:41,240 --> 00:14:41,540 They are freed. 270 00:14:41,800 --> 00:14:46,340 So this results in actors and overlays being assigned memory locations that aren't consistent. 271 00:14:46,600 --> 00:14:50,480 In other words, the location and memory will depend on exactly how many actors were already 272 00:14:50,480 --> 00:14:53,180 loaded and how they were organized within the heap structure. 273 00:14:54,020 --> 00:14:59,440 This signpost actor you see here may be located there at the moment, but if you were to leave 274 00:14:59,440 --> 00:15:01,720 the area and come back, it might be somewhere completely different. 275 00:15:02,200 --> 00:15:08,920 So some actors need to keep a pointer or a reference to another actor in their data. 276 00:15:09,080 --> 00:15:10,520 For instance, right here. 277 00:15:10,520 --> 00:15:15,100 There's this boomerang that needs to keep a reference to the actor it's grabbed, such 278 00:15:15,100 --> 00:15:15,740 as this rupee. 279 00:15:15,920 --> 00:15:20,680 So under a normal circumstance, if an actor references a second actor, the second actor 280 00:15:20,680 --> 00:15:26,000 should not unload or be freed from the heap until or before the first actor is either 281 00:15:26,000 --> 00:15:28,520 unreferenced or is unloaded by itself. 282 00:15:28,900 --> 00:15:31,500 If this were to happen, we'd call it a stale reference, right? 283 00:15:31,860 --> 00:15:35,500 Means that the pointer that this actor has is not pointing to a memory location that 284 00:15:35,500 --> 00:15:36,380 is not being used anymore. 285 00:15:36,720 --> 00:15:40,200 That means that if another actor were to be allocated to the heap. 286 00:15:40,520 --> 00:15:44,880 In the location where that old actor used to be, like this chest, then it might be pointing 287 00:15:44,880 --> 00:15:46,420 to an actor it probably shouldn't have access to. 288 00:15:46,600 --> 00:15:50,060 So if we use the boomerang as an example, by unloading the actor it has grabbed, the rupee, 289 00:15:50,180 --> 00:15:54,180 and going into a room transition while it's off screen, a different actor will take its 290 00:15:54,180 --> 00:15:54,400 spot. 291 00:15:54,760 --> 00:15:59,580 This causes the boomerang to modify that new actor's position instead, which can cause 292 00:15:59,580 --> 00:16:02,600 some really unusual behavior such as objects teleporting around. 293 00:16:02,780 --> 00:16:04,500 This was actually how this was first discovered. 294 00:16:04,820 --> 00:16:10,500 So this is an example of an actor being allocated in the same memory location as an older actor. 295 00:16:10,520 --> 00:16:11,300 Okay. 296 00:16:11,780 --> 00:16:16,540 So what would happen if an actor overlay loaded into this memory location instead? 297 00:16:16,760 --> 00:16:21,780 In other words, when the boomerang modifies an actor's position, what is it actually doing? 298 00:16:22,700 --> 00:16:28,040 So for all actors, their X, Y, and Z coordinates in the world space are held at offsets that 299 00:16:28,040 --> 00:16:28,880 you see on the screen. 300 00:16:29,300 --> 00:16:34,320 And the boomerang will take the addresses of the pointer to the actor it's holding, 301 00:16:34,520 --> 00:16:37,940 add those values to it, and write data at those memory locations. 302 00:16:38,260 --> 00:16:39,940 This basically means that it's... 303 00:16:40,540 --> 00:16:44,120 This would effectively modify the X, Y, and Z coordinates of the actor it's holding. 304 00:16:44,560 --> 00:16:51,580 If it had a stale reference that is now pointing to an actor overlay instead, some really strange 305 00:16:51,580 --> 00:16:52,260 things happen. 306 00:16:52,600 --> 00:16:53,360 Really strange things. 307 00:16:53,620 --> 00:16:57,120 So first of all, each actor overlay is different, but the important thing is that the blocks 308 00:16:57,120 --> 00:16:58,520 of code... 309 00:16:58,520 --> 00:17:00,620 We're now looking at blocks of code instead of blocks of data. 310 00:17:00,920 --> 00:17:05,060 So the boomerang is still going to obliviously write to those same data offsets, but it's 311 00:17:05,060 --> 00:17:09,700 going to be writing 32-bit float data into where 32-bit MIPS assembly instructions are 312 00:17:09,700 --> 00:17:10,280 supposed to be held. 313 00:17:10,620 --> 00:17:14,220 Now, if the code that this overlay gets executed... 314 00:17:14,980 --> 00:17:19,320 Or for this overlay gets executed after the boomerang modifies it, it'll usually just 315 00:17:19,320 --> 00:17:24,680 flat-out crash, since the code has been overwritten with data that is unlikely to be valid or 316 00:17:24,680 --> 00:17:24,960 sensible. 317 00:17:25,400 --> 00:17:30,440 But if we could control what values were being written by the actor, and in other words, 318 00:17:30,460 --> 00:17:35,680 exactly which instructions from the actor were being overwritten, we could effectively 319 00:17:35,680 --> 00:17:38,040 modify the code that the game executes. 320 00:17:38,040 --> 00:17:39,840 And we could make it do whatever we like. 321 00:17:39,960 --> 00:17:45,800 This is basically the essence of what we refer to as a stale reference manipulation exploit. 322 00:17:47,120 --> 00:17:50,740 So this is a use-after-free bug, but with a little bit of extra stuff in there. 323 00:17:51,280 --> 00:17:55,100 In the Triforce percent run, we achieve this by... 324 00:17:55,100 --> 00:17:56,820 And you might have seen this on the screen a little bit ago. 325 00:17:56,980 --> 00:18:00,360 We achieve this by having Link pick up an item while it's cold. 326 00:18:00,420 --> 00:18:03,240 In this case, not being drawn off screen. 327 00:18:03,860 --> 00:18:07,560 Then without allowing the item to be unculled, we pass through a loading zone so the item, 328 00:18:07,560 --> 00:18:09,860 the item unloads and Link has a stale reference. 329 00:18:10,700 --> 00:18:11,700 That's the important part. 330 00:18:11,940 --> 00:18:15,580 We then come back through the loading zone to get a particular actor overlay to occupy 331 00:18:15,580 --> 00:18:19,460 the memory that was originally taken up by the item that Link was holding. 332 00:18:20,360 --> 00:18:21,860 So let me just jump in here. 333 00:18:21,900 --> 00:18:28,420 So the bugs that we're using are camera bugs to manipulate where the camera goes. 334 00:18:28,700 --> 00:18:32,400 Because we can have Link holding an object that is so far away from the camera that it 335 00:18:32,400 --> 00:18:33,140 gets culled. 336 00:18:33,240 --> 00:18:37,540 And then the other bug, which you could say is a bug, is that they didn't check when the 337 00:18:37,560 --> 00:18:37,640 camera goes. 338 00:18:37,640 --> 00:18:39,720 And then something unculls whether it is being held. 339 00:18:40,000 --> 00:18:43,140 And to have Link let go of the thing if it's being held. 340 00:18:43,380 --> 00:18:47,400 But that wouldn't happen in normal game way without the camera bugs because Link is always 341 00:18:47,400 --> 00:18:49,600 on screen in front of the camera. 342 00:18:50,900 --> 00:18:51,340 Yeah. 343 00:18:51,560 --> 00:18:56,160 So RGME, Isofreeze on his RGME channel made a really cool memory map. 344 00:18:56,260 --> 00:18:59,180 This is a map of all of memory in... 345 00:18:59,720 --> 00:19:00,580 All of the actor. 346 00:19:00,680 --> 00:19:01,240 All the actor. 347 00:19:01,420 --> 00:19:01,560 Yeah. 348 00:19:01,660 --> 00:19:01,940 Yeah. 349 00:19:01,960 --> 00:19:02,260 The whole thing. 350 00:19:02,340 --> 00:19:07,320 So I'm probably getting a little off of my location here, but that's all right. 351 00:19:07,360 --> 00:19:07,540 All right. 352 00:19:07,540 --> 00:19:14,280 So basically, by collecting various items like rupees, we prevent them from loading 353 00:19:14,280 --> 00:19:16,020 back in each time the loading zone is triggered. 354 00:19:16,260 --> 00:19:22,400 And since Mido is nearby, you just saw him on screen a little bit ago, the direction 355 00:19:22,400 --> 00:19:23,760 that the camera is facing is important. 356 00:19:24,100 --> 00:19:27,760 Because if the camera is facing towards the main room, Mido won't unload, which causes 357 00:19:27,760 --> 00:19:30,640 his overlay to stay put while his actor instance moves around in memory. 358 00:19:30,920 --> 00:19:34,500 So we're switching the direction of the camera while walking back and forth over the loading 359 00:19:34,500 --> 00:19:34,760 zone. 360 00:19:35,060 --> 00:19:37,520 And all of the actors and actor overlays in the heap are getting culled. 361 00:19:37,540 --> 00:19:39,360 They're being shuffled around in a very specific way. 362 00:19:39,460 --> 00:19:43,000 That's why you saw M-Link going back through the doors so many times. 363 00:19:43,500 --> 00:19:49,260 If you're wondering how we found that set of actions that lead to this particular shuffling 364 00:19:49,260 --> 00:19:53,820 of memory, a bunch of the people who worked on this wrote scripts to like programmatically... 365 00:19:54,840 --> 00:19:57,460 Basically programmatically do those actions and see what would happen. 366 00:19:57,860 --> 00:19:58,660 Yeah, exactly. 367 00:19:58,940 --> 00:20:02,400 So basically, we're using a glitch here to force the camera to always stay behind Link, 368 00:20:02,560 --> 00:20:06,620 then using another item glitch to move around while a text box is open. 369 00:20:07,540 --> 00:20:11,400 And that allows us to get the camera very far away from Link, which will cull away any 370 00:20:11,400 --> 00:20:12,300 actors that are nearby him. 371 00:20:12,360 --> 00:20:13,960 You're going to see that in just a second here. 372 00:20:14,020 --> 00:20:14,820 So he's going to hit this rock. 373 00:20:15,460 --> 00:20:16,680 And the camera angle... 374 00:20:16,680 --> 00:20:18,140 Let me fast forward a little bit here. 375 00:20:18,920 --> 00:20:20,320 So that rock is kind of important. 376 00:20:20,500 --> 00:20:25,900 So here you're going to see that as Link smacks that rock, the camera pulls way, way away. 377 00:20:27,660 --> 00:20:29,780 So that culls any actors that are near him. 378 00:20:29,900 --> 00:20:33,380 And because of the heap manipulation we did earlier, we know exactly where in the heap 379 00:20:33,380 --> 00:20:35,800 that data for that rock actor is. 380 00:20:36,200 --> 00:20:37,520 So when Link is culled... 381 00:20:37,520 --> 00:20:40,620 When Link is carrying an actor, he's updating the position and rotation of that actor so 382 00:20:40,620 --> 00:20:42,420 that it appears in his hands above his head. 383 00:20:43,080 --> 00:20:44,260 This gets pretty interesting. 384 00:20:44,640 --> 00:20:49,380 So in other words, the rotation of an actor, which is a 16-bit value, is stored at that 385 00:20:49,380 --> 00:20:49,660 offset. 386 00:20:50,260 --> 00:20:54,260 If the rock is stored at that address, we know that that address is the one that will 387 00:20:54,260 --> 00:20:54,940 be modified. 388 00:20:55,820 --> 00:20:58,740 And in this case, it's the rotation value written as... 389 00:20:58,740 --> 00:21:01,240 It's just Link's rotation value that's written in. 390 00:21:01,940 --> 00:21:06,120 Since it's pretty easy to control what angle Link is facing just by walking around, it 391 00:21:06,120 --> 00:21:07,500 means that this value can be used... 392 00:21:07,500 --> 00:21:09,040 It can be used to write an arbitrary data. 393 00:21:09,200 --> 00:21:15,380 We're literally using Link's, either his actual position or the camera's position to 394 00:21:15,380 --> 00:21:15,860 manipulate this. 395 00:21:16,580 --> 00:21:19,460 I'm going to fast-forward a little bit, unless there's anything you want to say about 396 00:21:19,460 --> 00:21:19,560 that. 397 00:21:20,760 --> 00:21:25,100 So there's a specific item called the wonder item, and I could get into a lot more specifics 398 00:21:25,100 --> 00:21:25,460 here. 399 00:21:26,020 --> 00:21:32,360 We're basically overwriting the offset of a branch instruction to get the code to branch 400 00:21:32,360 --> 00:21:35,220 to somewhere else that we can control by setting what this rotation is. 401 00:21:35,380 --> 00:21:36,460 So you can just skip a few. 402 00:21:36,520 --> 00:21:36,660 Yeah. 403 00:21:37,500 --> 00:21:40,480 There's a bunch of extra things that you should go watch the RGME video about to get 404 00:21:40,480 --> 00:21:41,080 some more details. 405 00:21:41,680 --> 00:21:45,360 Everything is linked on our website, which is on the lower bottom of the screen here. 406 00:21:45,500 --> 00:21:45,660 Yep. 407 00:21:45,660 --> 00:21:47,700 Get Triforce.Link for the rest of this. 408 00:21:47,700 --> 00:21:47,960 Oh, wait. 409 00:21:47,960 --> 00:21:48,560 They can't see that. 410 00:21:48,920 --> 00:21:49,240 Oh. 411 00:21:49,440 --> 00:21:50,180 Yeah, it's off the screen. 412 00:21:50,540 --> 00:21:51,660 It's because the video is up. 413 00:21:51,760 --> 00:21:52,160 That's why. 414 00:21:52,320 --> 00:21:53,140 The video is covering it. 415 00:21:53,200 --> 00:21:53,540 Oh, yeah, yeah. 416 00:21:53,540 --> 00:21:54,960 Once we go back to the slides, it'll be up there. 417 00:21:55,000 --> 00:21:55,420 Oh, yeah, that's right. 418 00:21:55,500 --> 00:21:55,660 Yeah, yeah. 419 00:21:55,700 --> 00:21:57,000 Because I kind of got moved off screen. 420 00:21:57,740 --> 00:22:01,620 I actually think that for purposes of time, I think we should keep moving forward. 421 00:22:01,800 --> 00:22:02,060 Yeah. 422 00:22:02,840 --> 00:22:05,060 But you can watch the rest of this. 423 00:22:05,180 --> 00:22:07,480 The RGME video does go into great detail of exactly... 424 00:22:07,480 --> 00:22:11,060 Exactly what the rock angle is and what Link's angle needs to be. 425 00:22:11,400 --> 00:22:12,540 But we're gonna switch back... 426 00:22:12,540 --> 00:22:13,440 Switch back to the slides, yeah. 427 00:22:13,480 --> 00:22:13,660 Yep. 428 00:22:13,740 --> 00:22:15,120 Back to the slides here. 429 00:22:18,500 --> 00:22:19,200 All right. 430 00:22:19,260 --> 00:22:19,380 Oops. 431 00:22:19,440 --> 00:22:20,420 Let me go to... 432 00:22:20,420 --> 00:22:21,140 That's the wrong one. 433 00:22:21,240 --> 00:22:21,760 Here we go. 434 00:22:22,740 --> 00:22:23,360 All right. 435 00:22:23,620 --> 00:22:24,060 Okay. 436 00:22:27,020 --> 00:22:27,460 So... 437 00:22:27,460 --> 00:22:27,740 Right. 438 00:22:27,780 --> 00:22:28,140 So... 439 00:22:28,140 --> 00:22:28,920 We're... 440 00:22:29,520 --> 00:22:29,960 Basically... 441 00:22:29,960 --> 00:22:35,100 We don't have time to go over the entire chain of where execution goes, but the... 442 00:22:35,100 --> 00:22:37,420 It goes from this rock rotation... 443 00:22:37,420 --> 00:22:38,100 To Link's rotation. 444 00:22:38,340 --> 00:22:40,620 It goes from Link's rotation to the controller input. 445 00:22:40,820 --> 00:22:44,900 We start executing the controller, the memory containing the state of all the buttons and 446 00:22:44,900 --> 00:22:48,200 control sticks as code that runs one instruction per frame. 447 00:22:50,180 --> 00:22:55,320 That collection of one instruction per frame over many frames is bootstrapper one. 448 00:22:55,500 --> 00:22:58,200 The function of bootstrapper one is to write bootstrapper two into memory. 449 00:22:58,800 --> 00:23:02,740 Then we run one controller input as code to jump to bootstrapper two. 450 00:23:02,900 --> 00:23:06,380 That changes how controllers are pulled, changes a few things. 451 00:23:06,380 --> 00:23:09,680 It's only a few dozen bytes of code, so it's not a lot. 452 00:23:09,800 --> 00:23:13,580 But then we do, again, one instruction per frame, which is bootstrapper three. 453 00:23:13,680 --> 00:23:15,740 The function of that is to write bootstrapper four into memory. 454 00:23:16,040 --> 00:23:19,220 We then jump to bootstrapper four repeatedly over and over. 455 00:23:19,420 --> 00:23:23,220 And what bootstrapper four does is it takes the rest of the controller input and writes 456 00:23:23,220 --> 00:23:24,180 that to memory. 457 00:23:24,420 --> 00:23:29,380 And what that is is the first big part of the payload, which is called the hyperspeed 458 00:23:29,380 --> 00:23:29,780 loader. 459 00:23:29,980 --> 00:23:31,740 And at the end of... 460 00:23:31,740 --> 00:23:34,740 And once that has all been written, then we jump to that once. 461 00:23:34,740 --> 00:23:39,440 That turns off all the arbitrary code execution, sort of puts everything back to normal, and 462 00:23:39,440 --> 00:23:44,260 then starts listening on controller ports two, three, and four for combinations of controller 463 00:23:44,260 --> 00:23:49,700 input that represent packets that describe arbitrary memory writes, arbitrary function 464 00:23:49,700 --> 00:23:53,020 calls, and basically we can do whatever we want from that point. 465 00:23:53,240 --> 00:23:58,020 So we are up to the point where the human speedrunner is done, MLink is done, and we 466 00:23:58,020 --> 00:24:02,620 switch to TaskBot to play in a short task movie file over all four controller ports. 467 00:24:02,800 --> 00:24:04,720 So this is going to be TaskBot manipulable. 468 00:24:04,720 --> 00:24:07,140 I'm manipulating the controller input, which will be executed as code. 469 00:24:07,340 --> 00:24:08,360 So I'm switching... 470 00:24:10,860 --> 00:24:13,160 Switched controller one to be controlled by TaskBot. 471 00:24:13,260 --> 00:24:16,680 So all four controllers are being controlled by TaskBot. 472 00:24:16,800 --> 00:24:17,840 And let's hope this works. 473 00:24:18,040 --> 00:24:19,620 And we can have a little bit more game volume now. 474 00:24:26,260 --> 00:24:29,140 So this wiggling around is wiggling, but it's also code. 475 00:24:35,480 --> 00:24:37,700 And there's faster wiggling, which is faster code. 476 00:24:39,700 --> 00:24:41,620 And you see the little green bar in the corner? 477 00:24:41,760 --> 00:24:43,020 That means the game is pwned. 478 00:24:43,200 --> 00:24:43,600 Yes. 479 00:24:52,320 --> 00:24:53,840 Well done, MLink, by the way. 480 00:24:53,860 --> 00:24:54,580 That is not easy. 481 00:24:54,680 --> 00:24:58,340 The human portion of this was actually one of the scariest parts of doing this talk. 482 00:24:59,540 --> 00:25:00,060 Thank you. 483 00:25:00,280 --> 00:25:04,160 So the reason it's a green bar is that the game has its own crash debugger. 484 00:25:04,720 --> 00:25:08,300 And when the game crashes and the crash debug gets activated, it puts a yellow bar in the 485 00:25:08,300 --> 00:25:08,520 corner. 486 00:25:08,680 --> 00:25:11,440 And so we made a green bar to mean it's pwned. 487 00:25:11,460 --> 00:25:14,180 But it's also that that's being done by the hyperspeed loader. 488 00:25:14,280 --> 00:25:16,260 So I've changed controller one back to MLink. 489 00:25:16,320 --> 00:25:18,620 If you could go walk towards my house, but not enter it. 490 00:25:19,760 --> 00:25:25,840 And what I'm going to do next is run a script that will now basically send messages to this 491 00:25:25,840 --> 00:25:26,580 hyperspeed loader. 492 00:25:26,640 --> 00:25:30,120 It's pulling controllers eight times per frame at 60 frames per second for a total 493 00:25:30,120 --> 00:25:34,700 speed of 5,400 bytes per second of memory transfer, or whatever we want it to be. 494 00:25:35,080 --> 00:25:40,740 And what I'm going to be injecting is this is stuff that is linked to statically assigned 495 00:25:40,740 --> 00:25:43,660 addresses in memory, as opposed to later is going to be files. 496 00:25:43,780 --> 00:25:45,060 And I'll talk about that in a couple of slides. 497 00:25:46,280 --> 00:25:47,180 But that's done. 498 00:25:47,440 --> 00:25:48,560 That just took a few seconds. 499 00:25:48,640 --> 00:25:51,160 And now what I'm going to run is the rest of the injection. 500 00:25:51,280 --> 00:25:56,300 So this is going to start dumping files and all kinds of changes we want to make to the 501 00:25:56,300 --> 00:25:57,640 game into the game's memory. 502 00:25:57,820 --> 00:26:00,980 By the way, you're wondering where do we get all this memory from? 503 00:26:01,420 --> 00:26:04,380 We have an expansion pack installed, which is an extra four megabytes of RAM. 504 00:26:04,540 --> 00:26:04,700 So we're going to run that. 505 00:26:04,700 --> 00:26:06,680 And so the game only uses the first four megabytes. 506 00:26:06,740 --> 00:26:09,260 We have the upper four megabytes to just do whatever we want with. 507 00:26:10,260 --> 00:26:11,380 So I've started that. 508 00:26:11,480 --> 00:26:12,640 If you could go into the house, please. 509 00:26:13,200 --> 00:26:16,580 So we need to go into a house to clear out some residual glitches that are still active 510 00:26:16,580 --> 00:26:17,440 and leave again. 511 00:26:17,880 --> 00:26:22,960 And then if you pause and press L. So this is the first thing that we would show during 512 00:26:22,960 --> 00:26:23,820 the Triforce Percent run. 513 00:26:23,920 --> 00:26:24,740 This is the inventory editor. 514 00:26:24,880 --> 00:26:29,440 This was created by the developers to set up link state and test the game. 515 00:26:29,760 --> 00:26:33,000 And we just need to, because we're not going to show the full thing today, we don't have 516 00:26:33,000 --> 00:26:33,440 enough time. 517 00:26:33,440 --> 00:26:35,660 We're just going to give ourselves a couple of things here. 518 00:26:35,820 --> 00:26:36,740 So yeah, that's right. 519 00:26:37,340 --> 00:26:41,940 And the next thing that we would show is the R-Wing. 520 00:26:44,240 --> 00:26:45,680 So, oh, what did you? 521 00:26:46,540 --> 00:26:47,840 I did L and D-pad down. 522 00:26:49,220 --> 00:26:50,420 I did L and D-pad down. 523 00:26:50,620 --> 00:26:51,400 And nothing else? 524 00:26:51,680 --> 00:26:52,220 Nothing else. 525 00:26:55,620 --> 00:26:57,220 Well, that's never happened before. 526 00:26:57,640 --> 00:26:59,080 That has never happened before. 527 00:27:00,440 --> 00:27:00,840 Yeah. 528 00:27:00,960 --> 00:27:01,360 Okay. 529 00:27:04,320 --> 00:27:04,960 Are you sure? 530 00:27:05,020 --> 00:27:05,160 Okay. 531 00:27:05,280 --> 00:27:05,600 Whatever. 532 00:27:05,960 --> 00:27:08,040 Let's see if it crashes after you exit yourself. 533 00:27:09,720 --> 00:27:10,140 All right. 534 00:27:10,140 --> 00:27:11,260 Now we see what happens. 535 00:27:11,340 --> 00:27:11,620 Yeah. 536 00:27:11,680 --> 00:27:12,700 That's how sane the game is. 537 00:27:13,220 --> 00:27:13,960 We should be okay. 538 00:27:14,100 --> 00:27:14,200 Yeah. 539 00:27:14,200 --> 00:27:16,860 Actually, what you should just do is just don't advance it at all. 540 00:27:17,160 --> 00:27:21,220 And we'll just try to warp to the ending at the end and see if that succeeds. 541 00:27:21,520 --> 00:27:21,960 So, okay. 542 00:27:22,100 --> 00:27:22,420 Sorry. 543 00:27:22,540 --> 00:27:23,840 We can't show you much of the R-Wing. 544 00:27:23,920 --> 00:27:27,080 But, oh, well, I don't know exactly what happened. 545 00:27:27,280 --> 00:27:29,500 Maybe you hit one of, like, D left or D right. 546 00:27:29,640 --> 00:27:29,900 Okay. 547 00:27:29,900 --> 00:27:30,180 Okay. 548 00:27:30,340 --> 00:27:30,640 Whatever. 549 00:27:30,640 --> 00:27:31,800 I've never seen that before. 550 00:27:31,920 --> 00:27:36,180 Basically, they left the R-Wing on the cartridge, and that was the shtick we used to present 551 00:27:36,180 --> 00:27:37,080 this at GameStop Quick. 552 00:27:37,160 --> 00:27:37,180 It did. 553 00:27:37,220 --> 00:27:38,780 It was saying that it was a beta showcase. 554 00:27:39,100 --> 00:27:41,100 Hey, this is all beta content that's on the cartridge. 555 00:27:41,400 --> 00:27:45,180 And any time there really was beta content on the cartridge, we called it out. 556 00:27:45,800 --> 00:27:49,340 Unfortunately, a lot of people got really upset about the time we started introducing 557 00:27:49,340 --> 00:27:54,020 other elements because when we didn't say, this isn't beta content on the cartridge, 558 00:27:54,580 --> 00:27:56,200 the message didn't quite get through. 559 00:27:56,400 --> 00:27:56,640 Right. 560 00:27:56,740 --> 00:27:58,760 You know, we put a bunch of things on screen. 561 00:27:58,760 --> 00:28:02,400 We say, this one 3D model is beta content left on the cartridge, and everything else 562 00:28:02,400 --> 00:28:03,220 is made up by us. 563 00:28:03,380 --> 00:28:06,000 And then people heard, oh, it's all left on the cartridge. 564 00:28:06,220 --> 00:28:10,520 But, anyway, so, yeah, so this is still dumping data into memory. 565 00:28:10,640 --> 00:28:11,840 We'll continue for a few minutes. 566 00:28:12,020 --> 00:28:13,640 And we're going to go back to... 567 00:28:13,640 --> 00:28:13,740 Yeah. 568 00:28:13,760 --> 00:28:14,380 We've got the slides back here. 569 00:28:14,380 --> 00:28:14,900 We can take the... 570 00:28:14,900 --> 00:28:16,840 We can have the volume bit low on the game. 571 00:28:16,940 --> 00:28:17,940 And we're going to switch back to slides. 572 00:28:18,260 --> 00:28:18,620 Yeah. 573 00:28:18,660 --> 00:28:19,060 All right. 574 00:28:19,100 --> 00:28:23,940 So what we're doing with this hyperspeed loader, I mentioned some static data. 575 00:28:24,020 --> 00:28:25,680 The first one is a debugger. 576 00:28:25,740 --> 00:28:28,640 So this is, like, another debugger that sits on top of the game's one. 577 00:28:28,640 --> 00:28:33,140 You can see this is an example where one of the threads crashed, and we say, press C 578 00:28:33,140 --> 00:28:33,820 right to pay respects. 579 00:28:33,980 --> 00:28:37,660 That's because on the original, like, beta N64 controller, the buttons were A, B, C, 580 00:28:37,680 --> 00:28:39,500 D, E, F. And so C right was the F button. 581 00:28:41,620 --> 00:28:43,880 Next thing is DMA patching system. 582 00:28:44,140 --> 00:28:47,260 So, you know, the cartridge has ROM in it. 583 00:28:47,340 --> 00:28:48,340 We can't modify the ROM. 584 00:28:48,600 --> 00:28:54,100 But we can modify the OS data, the OS code that will load from ROM, and we can have it 585 00:28:54,100 --> 00:28:55,240 load from other places instead. 586 00:28:55,640 --> 00:28:57,680 And so there's three ways of doing that. 587 00:28:57,680 --> 00:29:00,920 If you actually change the address to load from to a RAM address, it'll copy from RAM. 588 00:29:01,320 --> 00:29:06,220 We made another map from, like, an extra part of the cartridge, virtual cartridge, to RAM 589 00:29:06,220 --> 00:29:06,980 that it can load from. 590 00:29:07,140 --> 00:29:11,060 And then also, if it loads from something from the cartridge before returning that to 591 00:29:11,060 --> 00:29:15,260 the code that called it, it can go through a list of binary patches and sort of apply 592 00:29:15,260 --> 00:29:17,040 a binary diff to change the data. 593 00:29:18,220 --> 00:29:21,220 The third thing is the rest of the statics, which I'll talk about in a minute. 594 00:29:21,260 --> 00:29:26,440 And then just a bunch of assets for totally new stuff, whatever we wanted to create in 595 00:29:26,440 --> 00:29:26,680 the game. 596 00:29:28,120 --> 00:29:30,020 So, this is the really technical part. 597 00:29:30,400 --> 00:29:33,740 If the first part wasn't too technical, I'm going to go very briefly over some of the 598 00:29:33,740 --> 00:29:37,220 stuff that is in all of the statics files, because this is DEF CON, and I think you might 599 00:29:37,220 --> 00:29:37,960 like it. 600 00:29:38,620 --> 00:29:40,720 But, you know, don't worry if you don't catch every detail. 601 00:29:40,880 --> 00:29:44,180 All of our code that we've created for this is up on our GitHub, which is linked from 602 00:29:44,180 --> 00:29:45,940 our website, which is on the screen here. 603 00:29:46,080 --> 00:29:46,700 Yeah, it's on the screen. 604 00:29:48,080 --> 00:29:51,960 So, statics contains some one-time code patches for various things. 605 00:29:52,360 --> 00:29:56,300 There's an update function that gets run on the 60 frames per second DI tick. 606 00:29:56,740 --> 00:29:57,420 There's update. 607 00:29:57,680 --> 00:29:59,180 That gets patched into links actor. 608 00:30:00,080 --> 00:30:06,580 There is a mechanism for registering further static data, like audio and interface patches. 609 00:30:07,300 --> 00:30:10,940 There are random patches for other things that we couldn't fit where they needed to 610 00:30:10,940 --> 00:30:15,040 be, and so we just put them here and then had the patch code to call in here and then 611 00:30:15,040 --> 00:30:15,400 call back. 612 00:30:16,520 --> 00:30:20,280 This is the code for the R-Wing, which you saw and then something happened with. 613 00:30:20,580 --> 00:30:25,580 But yeah, this is checking for some buttons and then looking for an R-Wing, and if it's 614 00:30:25,580 --> 00:30:26,600 not there, then spawn one. 615 00:30:27,080 --> 00:30:27,480 Yeah. 616 00:30:28,040 --> 00:30:33,340 This is some scene patches, so this is like a cutscene terminator, so at the end of one 617 00:30:33,340 --> 00:30:34,340 cutscene, where does it go next? 618 00:30:34,720 --> 00:30:39,920 This is the entrance table, so for example, normally if you go from Granny's Potion Shop 619 00:30:39,920 --> 00:30:44,200 to Kakariko Village, we replace that with a route from Chamber of Sages to Triforce 620 00:30:44,200 --> 00:30:44,380 Room. 621 00:30:45,220 --> 00:30:51,280 This is changing the object heap size, depending on which scene you're in, based on how much 622 00:30:51,280 --> 00:30:51,980 stuff you need to load. 623 00:30:52,160 --> 00:30:55,220 This is some graphics code for scrolling textures in the Chamber of Sages. 624 00:30:56,080 --> 00:30:57,220 For interface changes. 625 00:30:57,220 --> 00:31:05,160 We would be loading custom icons and stuff on the GUI, and those get loaded from memory. 626 00:31:06,020 --> 00:31:10,020 Since we want to make sure that things don't crash live, we have to check for, if things 627 00:31:10,020 --> 00:31:12,780 are out of bounds, whatever, default to frog for the item icon. 628 00:31:14,520 --> 00:31:19,680 When we equip medallions, which is a beta feature that we reconstructed, the medallion 629 00:31:19,680 --> 00:31:24,160 has to fly across the screen onto the GUI, and so this is the code for that. 630 00:31:24,740 --> 00:31:25,920 We have custom items. 631 00:31:25,920 --> 00:31:29,180 We have to patch the function for loading the custom item name texture. 632 00:31:30,320 --> 00:31:33,380 There's changes we made to the magic bar, that it renders twice as large. 633 00:31:34,380 --> 00:31:38,840 There's changes to the message and text system, so we have a whole bunch of custom dialogue 634 00:31:38,840 --> 00:31:40,520 for this totally custom plot that we showed. 635 00:31:41,840 --> 00:31:43,480 And again, loading messages. 636 00:31:43,820 --> 00:31:50,940 We actually hooked into some code left over for the N64DD expansion to OOT, also called 637 00:31:50,940 --> 00:31:54,740 Uruz Zelda, which is like DLC that Nintendo was going to make in 1998. 638 00:31:55,380 --> 00:31:55,900 And this is the final version. 639 00:31:55,900 --> 00:31:59,500 And so we just hooked into their existing text patching code. 640 00:31:59,900 --> 00:32:02,240 Again, if something is out of bounds, default to Frog. 641 00:32:02,420 --> 00:32:03,620 This is Frog, by the way. 642 00:32:07,160 --> 00:32:10,740 So we made audio changes, custom sound effects, custom music. 643 00:32:11,160 --> 00:32:12,740 Audio has a separate way of DMing, 644 00:32:12,800 --> 00:32:13,560 so we had to patch that. 645 00:32:14,080 --> 00:32:15,960 This is manipulating what happens 646 00:32:15,960 --> 00:32:17,020 when you play a new Warp song. 647 00:32:17,920 --> 00:32:20,300 For the finale scene, we had to make 648 00:32:20,300 --> 00:32:23,880 a new set of environmental chirps for birds and stream 649 00:32:23,880 --> 00:32:26,740 sound for that scene that didn't exist in the game before. 650 00:32:27,600 --> 00:32:30,560 We had to change Ocarina playback for plot reasons, 651 00:32:30,800 --> 00:32:32,320 and so we had to re-encode Ocarina songs. 652 00:32:32,600 --> 00:32:34,560 We had to change how Ocarina buttons were handled, 653 00:32:34,640 --> 00:32:35,780 and then a whole bunch of assembly patches 654 00:32:35,780 --> 00:32:38,280 for the graphical rendering of the Ocarina system. 655 00:32:39,900 --> 00:32:42,080 Link has custom animations at the end, 656 00:32:42,120 --> 00:32:44,220 and those are streamed from ROM, and so we had to make 657 00:32:44,220 --> 00:32:45,540 it be able to stream them from RAM. 658 00:32:46,200 --> 00:32:50,700 We changed how the game does animation interpolation. 659 00:32:50,740 --> 00:32:52,660 It used Euler angles to interpret animations, 660 00:32:53,120 --> 00:32:55,080 and we changed it to use quaternions globally, 661 00:32:55,920 --> 00:32:58,180 because we had some problems with the Euler angles 662 00:32:58,180 --> 00:33:01,480 in our custom models, so we just fixed it for the whole game. 663 00:33:01,700 --> 00:33:03,280 This is an example of an action table 664 00:33:03,280 --> 00:33:06,280 where we copied in our table, overwrite most of it 665 00:33:06,280 --> 00:33:08,400 with the existing data, and then have our appended stuff, 666 00:33:08,500 --> 00:33:09,760 because you can't just shift everything, 667 00:33:09,960 --> 00:33:12,380 because everything is linked to where it is in ROM. 668 00:33:12,720 --> 00:33:15,020 And we even have hair physics for the ending 669 00:33:15,020 --> 00:33:17,440 that you'll see in a bit, hopefully, if things don't crash. 670 00:33:19,000 --> 00:33:22,400 Yeah, and so this is an actual numerical integrator 671 00:33:22,400 --> 00:33:25,200 for the double pendulum problem for Link hair. 672 00:33:25,860 --> 00:33:29,600 And that's, yeah, the CPU has plenty of power available 673 00:33:29,600 --> 00:33:31,820 compared to the graphics hardware, so there's usually 674 00:33:31,820 --> 00:33:34,480 CPU available for us to do this kind of stuff with. 675 00:33:35,560 --> 00:33:37,180 I want to talk a little bit about the assets. 676 00:33:37,340 --> 00:33:38,560 So we made a whole bunch of custom assets. 677 00:33:38,680 --> 00:33:39,700 You'll see some of them in a bit. 678 00:33:39,800 --> 00:33:41,820 This is making the Triforce scene in Blender. 679 00:33:42,300 --> 00:33:45,200 The black things that you see are camera keyframes, 680 00:33:45,300 --> 00:33:46,860 basically, for the camera motion. 681 00:33:47,420 --> 00:33:51,180 And this is all done through some plugins for Blender 682 00:33:51,180 --> 00:33:51,920 called FES64. 683 00:33:51,920 --> 00:33:54,000 FES64, which many people worked on, including myself. 684 00:33:55,300 --> 00:34:00,060 For custom music, we use sort of normal music tools 685 00:34:00,460 --> 00:34:01,920 for creating midis and then importing 686 00:34:01,920 --> 00:34:02,960 those midis into the game. 687 00:34:03,140 --> 00:34:05,220 This is actually the way I got into the N64 community, 688 00:34:05,380 --> 00:34:08,000 is I worked on that software back in 2014, and then 689 00:34:08,000 --> 00:34:11,620 since then, we did some instrument set changes also. 690 00:34:12,440 --> 00:34:13,820 This is some of the custom text. 691 00:34:13,900 --> 00:34:15,660 So this is the text for You Got the Triforce. 692 00:34:15,880 --> 00:34:18,480 And you may notice that the text ID for this 693 00:34:18,480 --> 00:34:20,520 is hex A-C-E for arbitrary code execution. 694 00:34:21,920 --> 00:34:23,360 This is some custom actor codes. 695 00:34:23,480 --> 00:34:26,640 This is Beru, one of the custom actors that we see. 696 00:34:26,720 --> 00:34:28,600 This is some animations that she's talking to Link. 697 00:34:29,180 --> 00:34:30,520 This is the Running Man boss. 698 00:34:30,760 --> 00:34:31,660 This is some of his code. 699 00:34:31,880 --> 00:34:33,700 There's a sort of a humorous thing 700 00:34:33,700 --> 00:34:36,360 where this side character turns into a secret boss. 701 00:34:36,640 --> 00:34:38,120 This is some of his code. 702 00:34:38,840 --> 00:34:40,500 I mentioned a patching system. 703 00:34:40,900 --> 00:34:43,580 So this is a patch written in text, 704 00:34:43,900 --> 00:34:46,860 and then this is the same patch written in binary. 705 00:34:47,140 --> 00:34:50,260 So it's like, go to this address and patch this one byte, 706 00:34:50,340 --> 00:34:51,560 and go to this address and patch 707 00:34:51,560 --> 00:34:54,140 this short, and this is an example that includes data, 708 00:34:54,260 --> 00:34:55,900 and this is an example that has assembly instructions. 709 00:34:56,480 --> 00:34:57,880 This is the patch for Link. 710 00:34:58,040 --> 00:35:01,120 So it's a bunch of just patch out this and patch out this. 711 00:35:02,440 --> 00:35:03,980 And so we're going back to the game here. 712 00:35:06,180 --> 00:35:09,440 So what we did with all this, again, we 713 00:35:09,440 --> 00:35:10,840 made a plot that leads to the Triforce. 714 00:35:10,900 --> 00:35:11,800 We don't have time to show everything, 715 00:35:11,920 --> 00:35:14,100 so we're going to just warp to the Triforce scene, hopefully. 716 00:35:14,560 --> 00:35:15,880 Can you do that in the middle of a cut scene? 717 00:35:16,380 --> 00:35:16,720 Yeah. 718 00:35:17,100 --> 00:35:17,640 All right. 719 00:35:17,720 --> 00:35:18,820 Well, let's see what happens. 720 00:35:19,220 --> 00:35:19,560 Oh! 721 00:35:19,960 --> 00:35:20,300 Oh! 722 00:35:21,560 --> 00:35:22,560 I guess there was something wrong. 723 00:35:22,660 --> 00:35:23,100 I don't know. 724 00:35:26,340 --> 00:35:26,820 All right. 725 00:35:26,840 --> 00:35:27,700 Do you have the flash cart with you? 726 00:35:27,760 --> 00:35:28,420 Yeah, I have the flash cart. 727 00:35:28,620 --> 00:35:29,200 There's my backpack. 728 00:35:29,560 --> 00:35:29,960 Thank you. 729 00:35:32,060 --> 00:35:32,760 All right. 730 00:35:32,900 --> 00:35:34,940 So live demos sometimes go wrong. 731 00:35:35,060 --> 00:35:36,300 Here's what we're going to do. 732 00:35:36,740 --> 00:35:40,520 We're just going to very briefly cheat. 733 00:35:40,820 --> 00:35:41,280 Cheat, yeah. 734 00:35:41,460 --> 00:35:42,680 This is a flash cart. 735 00:35:48,960 --> 00:35:50,500 I've got that off screen for a second. 736 00:35:50,540 --> 00:35:51,260 It's only over there. 737 00:35:51,560 --> 00:35:51,820 OK. 738 00:35:52,420 --> 00:35:54,560 But should we do, like, because we still 739 00:35:54,560 --> 00:35:56,520 have to wait for it to inject everything, which 740 00:35:56,520 --> 00:35:57,200 is like six minutes. 741 00:35:57,580 --> 00:35:59,700 Oh, you don't have the, uh, the, uh. 742 00:35:59,700 --> 00:36:04,080 I do, but I don't know if the Twitch will work with that. 743 00:36:04,420 --> 00:36:05,660 Oh, well, we might not be doing chat. 744 00:36:05,780 --> 00:36:06,020 We'll see. 745 00:36:06,640 --> 00:36:07,720 We can try it. 746 00:36:07,940 --> 00:36:08,220 All right. 747 00:36:08,640 --> 00:36:09,120 Let's see. 748 00:36:10,820 --> 00:36:13,560 I think this one, this, we did not rehearse this. 749 00:36:13,700 --> 00:36:14,900 We did not rehearse this back up. 750 00:36:14,980 --> 00:36:16,840 Things might go wrong here. 751 00:36:17,020 --> 00:36:17,380 We'll see. 752 00:36:17,500 --> 00:36:19,220 This is what happens when you do live demos. 753 00:36:19,300 --> 00:36:21,440 Now, luckily, this went correctly at Austin, 754 00:36:21,560 --> 00:36:22,720 so we'll see if we can get some games done quick, 2022, 755 00:36:23,040 --> 00:36:24,000 or summer games done quick, 2022. 756 00:36:25,520 --> 00:36:27,560 So we may or may not have chat working. 757 00:36:27,720 --> 00:36:28,260 We'll find out. 758 00:36:30,200 --> 00:36:31,020 Give it a second. 759 00:36:31,240 --> 00:36:31,700 There we go. 760 00:36:34,300 --> 00:36:35,740 I forget if this had a. 761 00:36:40,000 --> 00:36:42,000 I don't know how we got warped to that weird area. 762 00:36:42,660 --> 00:36:43,020 Right. 763 00:36:43,100 --> 00:36:45,600 This is, uh, we have to sit through the intro. 764 00:36:45,820 --> 00:36:46,400 Oh, no. 765 00:36:46,940 --> 00:36:47,300 Yeah. 766 00:36:47,640 --> 00:36:48,240 Oh, no. 767 00:36:48,240 --> 00:36:50,280 But let's just, let's just finish our talk. 768 00:36:50,480 --> 00:36:50,620 Yeah. 769 00:36:51,560 --> 00:36:53,240 And then we can, uh, yeah. 770 00:36:53,600 --> 00:36:53,920 Yeah. 771 00:36:53,920 --> 00:36:54,100 So. 772 00:36:54,100 --> 00:36:54,420 Yeah. 773 00:36:54,540 --> 00:36:55,520 We will not be watching the outro. 774 00:36:55,620 --> 00:36:58,280 So there's a couple of things that he needs to say 775 00:36:58,280 --> 00:36:59,180 and a couple of things I need to say. 776 00:36:59,260 --> 00:36:59,740 And I'll let you start. 777 00:36:59,900 --> 00:37:00,100 Yeah. 778 00:37:00,180 --> 00:37:01,020 So sorry about that. 779 00:37:01,340 --> 00:37:02,880 But I don't, I don't know what happened. 780 00:37:03,820 --> 00:37:06,260 We, you know, we practiced, but, you know, live demo. 781 00:37:06,720 --> 00:37:07,040 Yeah. 782 00:37:07,160 --> 00:37:09,920 So what we showed at, you know, with this, 783 00:37:09,920 --> 00:37:12,840 with this people grew up with this game 784 00:37:12,840 --> 00:37:14,320 and people grew up on the internet 785 00:37:14,320 --> 00:37:15,220 with these urban legends 786 00:37:15,220 --> 00:37:18,020 and sort of wanting to get the Triforce and all of the, 787 00:37:18,080 --> 00:37:20,020 you know, knew about all these little pieces of the game. 788 00:37:20,060 --> 00:37:21,300 And these were all sort of, 789 00:37:21,300 --> 00:37:23,860 part of what the, what everybody knew about the game, 790 00:37:23,920 --> 00:37:25,680 but wasn't ever part of the actual game. 791 00:37:26,260 --> 00:37:28,740 But arbitrary code execution is in the game, 792 00:37:28,860 --> 00:37:30,540 even though it wasn't intended by the developers. 793 00:37:30,800 --> 00:37:32,680 And so using these exploits, 794 00:37:32,720 --> 00:37:35,160 we can make those things happen. 795 00:37:35,640 --> 00:37:39,600 And, uh, you know, we, people have different opinions about, 796 00:37:39,620 --> 00:37:41,340 you know, how valid that is in a game. 797 00:37:41,460 --> 00:37:43,040 And certainly once we've switched to a flash card, 798 00:37:43,120 --> 00:37:44,760 it's, you know, it's just a ROM hack. 799 00:37:44,980 --> 00:37:48,580 Um, but, uh, this really made a lot of people feel, 800 00:37:48,620 --> 00:37:50,600 and this was sort of the idea, um, 801 00:37:50,600 --> 00:37:53,480 feel that this was, like, resolving their childhood 802 00:37:53,860 --> 00:37:56,060 in a way, um, because, you know, 803 00:37:56,060 --> 00:37:57,220 these are things that they always wanted 804 00:37:57,220 --> 00:37:59,260 and, like, a chapter of their childhood, 805 00:37:59,420 --> 00:38:00,380 uh, can you go from there? 806 00:38:01,580 --> 00:38:03,540 Once you get control, then give the correct idea. 807 00:38:04,800 --> 00:38:07,940 Um, yeah, so, um, we had a lot of people telling us 808 00:38:07,940 --> 00:38:09,780 that, you know, this had a big impact on them. 809 00:38:10,000 --> 00:38:13,340 And what you'll see, if we can make the ending work, 810 00:38:13,560 --> 00:38:16,220 um, there's a little more to it than that, 811 00:38:16,280 --> 00:38:18,580 but, um, yeah, I'll wait, I'll wait for that. 812 00:38:18,940 --> 00:38:20,040 And you can talk about the, 813 00:38:20,040 --> 00:38:21,300 the other parts of the impact here. 814 00:38:21,440 --> 00:38:24,320 So, for me, this was the biggest thing we had ever done. 815 00:38:24,400 --> 00:38:26,660 I showed you a slide earlier where we had taken 816 00:38:26,660 --> 00:38:28,240 a bunch of different consoles, 817 00:38:28,940 --> 00:38:30,460 cobbled them together, uh, 818 00:38:30,560 --> 00:38:32,280 with a huge amount of help from Micro 500 819 00:38:32,280 --> 00:38:33,740 and a ton of other people, 820 00:38:33,860 --> 00:38:36,360 uh, and we made a Skype call over a Super Nintendo. 821 00:38:36,560 --> 00:38:37,660 And it was technically interesting, 822 00:38:38,380 --> 00:38:40,620 uh, but we weren't sure where we were gonna go next. 823 00:38:40,740 --> 00:38:42,320 And where we ended up going next 824 00:38:42,320 --> 00:38:45,660 was Sorin putting a huge amount of heart 825 00:38:45,660 --> 00:38:48,540 and effort and years of, of direction 826 00:38:49,080 --> 00:38:50,020 into making, uh, 827 00:38:50,020 --> 00:38:51,800 making what we, what we ended up showing as 828 00:38:51,800 --> 00:38:54,540 Legend of, Legend of Zelda Ocarina of Time Beta Showcase. 829 00:38:55,560 --> 00:38:58,740 He put a ton of effort into making an emotional story. 830 00:38:58,920 --> 00:39:01,540 The impact of that at Games Done Quick, 831 00:39:01,640 --> 00:39:02,460 Summer Games Done Quick 2020, 832 00:39:02,700 --> 00:39:04,860 2022 was incredible. 833 00:39:05,220 --> 00:39:08,120 Uh, we helped raise over $228,000 834 00:39:08,120 --> 00:39:10,640 for Doctors Without Borders in one hour of content. 835 00:39:20,020 --> 00:39:20,700 So why do we hack? 836 00:39:20,860 --> 00:39:23,320 It's not just to find use-after-free flaws 837 00:39:23,320 --> 00:39:26,480 or, or stale reference manipulation in video games 838 00:39:26,480 --> 00:39:27,260 or anything else. 839 00:39:27,340 --> 00:39:29,580 We're doing it because we're able to showcase these 840 00:39:29,580 --> 00:39:32,320 at big events and raise money for charity. 841 00:39:32,500 --> 00:39:34,580 Uh, if you have any interest, go to, uh, 842 00:39:34,700 --> 00:39:36,180 European Speedrunner Assembly in Europe, 843 00:39:36,360 --> 00:39:38,400 uh, Games Done Quick here in the United States, 844 00:39:38,540 --> 00:39:40,340 uh, we've done other events as well, 845 00:39:40,500 --> 00:39:42,080 uh, RPG Limit Break, 846 00:39:42,260 --> 00:39:43,680 uh, even MAGFest runs them. 847 00:39:43,820 --> 00:39:46,040 Uh, very, very worthwhile checking them out. 848 00:39:46,120 --> 00:39:49,720 Um, so, for me, this was the biggest thing 849 00:39:50,020 --> 00:39:50,560 we had ever done. 850 00:39:50,720 --> 00:39:53,300 Uh, we've now helped raise over $1.3 million 851 00:39:53,300 --> 00:39:54,700 with TASPAC content. 852 00:39:54,900 --> 00:39:55,680 It's been really amazing. 853 00:39:55,860 --> 00:39:57,420 Let's make a save as soon as we get control. 854 00:40:03,220 --> 00:40:05,580 So, I'm hopeful that we'll be able to show you 855 00:40:05,580 --> 00:40:07,220 what the ending of this looks like. 856 00:40:07,300 --> 00:40:08,940 No, no guarantees on the chat part, but... 857 00:40:08,940 --> 00:40:10,500 So, I realize there won't be chat, 858 00:40:10,600 --> 00:40:12,860 because the chat comes in through the hyperspeed loader, 859 00:40:12,880 --> 00:40:15,340 and there's no hyperspeed loader in a ROM hack. 860 00:40:15,580 --> 00:40:16,040 Ah, okay. 861 00:40:16,200 --> 00:40:17,920 So, but we can, um, 862 00:40:19,140 --> 00:40:22,420 we can hopefully make the rest of this work. 863 00:40:26,080 --> 00:40:28,460 So, this is Link in the Triforce Room scene. 864 00:40:28,660 --> 00:40:30,320 This is what we were trying to work to. 865 00:40:39,240 --> 00:40:41,520 So, everything you're seeing on screen here was injected, 866 00:40:41,620 --> 00:40:43,560 except, well, this is a ROM hack, 867 00:40:43,700 --> 00:40:46,580 but it would have been if things hadn't gone wrong. 868 00:40:50,300 --> 00:40:52,540 So, you know, we said, oh, well, this is... 869 00:40:53,380 --> 00:40:55,220 Right, we wanted to make sure that the text 870 00:40:55,220 --> 00:40:57,100 that was on screen with Link getting the Triforce 871 00:40:57,100 --> 00:40:59,220 was text that couldn't possibly have been in the ROM, 872 00:40:59,340 --> 00:41:00,980 because it's referencing the time. 873 00:41:01,100 --> 00:41:03,060 I should have updated to 24 years now. 874 00:41:03,240 --> 00:41:03,780 I know, right? 875 00:41:03,880 --> 00:41:04,220 I forgot. 876 00:41:04,280 --> 00:41:05,580 I made so many other changes, 877 00:41:05,680 --> 00:41:07,400 and this is not going to have the right credits in it. 878 00:41:07,520 --> 00:41:08,240 I know, right? 879 00:41:08,380 --> 00:41:09,600 Because I updated that. 880 00:41:09,600 --> 00:41:10,320 I didn't update this. 881 00:41:10,380 --> 00:41:11,420 I'm so sorry about this. 882 00:41:11,500 --> 00:41:13,760 But, anyway, um, yeah. 883 00:41:13,880 --> 00:41:16,060 So, you know, with that moment at GDQ, 884 00:41:16,200 --> 00:41:17,900 we had the eyes of 100,000 people, 885 00:41:17,900 --> 00:41:20,800 we got the Triforce, we made their dreams come true, 886 00:41:20,960 --> 00:41:23,700 and then what do we do with that, you know, 887 00:41:23,700 --> 00:41:25,280 attention and goodwill of the audience? 888 00:41:26,180 --> 00:41:27,620 We took it a little farther, 889 00:41:27,920 --> 00:41:30,780 and this is Link talking to the goddesses, 890 00:41:30,780 --> 00:41:32,520 the goddesses of the Triforce. 891 00:41:34,340 --> 00:41:35,980 Before we get to the next scene, 892 00:41:36,560 --> 00:41:39,360 everything you're seeing is on the real console normally, 893 00:41:39,480 --> 00:41:40,340 the real cartridge normally. 894 00:41:40,740 --> 00:41:43,540 This is only just using a different cartridge in this case, 895 00:41:43,600 --> 00:41:47,540 but there's all kinds of audible things that you'll hear here, 896 00:41:48,180 --> 00:41:50,640 there's several different unique aspects. 897 00:41:50,760 --> 00:41:51,440 Graphical features. 898 00:41:51,780 --> 00:41:51,920 Yeah. 899 00:41:52,120 --> 00:41:53,880 But I think we're generally going to be silent 900 00:41:53,880 --> 00:41:55,900 and let you guys experience the emotional impact 901 00:41:55,900 --> 00:41:58,300 of what Link is able to do here. 902 00:42:16,720 --> 00:42:18,580 So, Link gets a wish from the Triforce, 903 00:42:18,680 --> 00:42:20,860 and we sort of convinced the GDQ audience 904 00:42:20,860 --> 00:42:22,560 to have us pick See the Future, 905 00:42:22,720 --> 00:42:24,360 because that's the only one we implemented. 906 00:42:50,260 --> 00:42:50,820 See the Future. 907 00:42:50,820 --> 00:42:52,180 We'll get a little bit more game volume here, 908 00:42:52,240 --> 00:42:53,060 you're going to want to hear this. 909 00:43:21,180 --> 00:43:22,020 See the Future. 910 00:43:22,020 --> 00:43:23,340 So, yes, this is not a video. 911 00:43:23,540 --> 00:43:24,680 This is the N64. 912 00:43:26,120 --> 00:43:27,260 Myself and Glank, 913 00:43:27,360 --> 00:43:28,280 who is one of the, like, 914 00:43:28,300 --> 00:43:32,440 greats of N64 stuff worked on the cell shading and made a cell shading algorithm for N64, 915 00:43:32,600 --> 00:43:37,560 which wasn't previously thought to be possible. Also, these models are much higher poly than 916 00:43:37,560 --> 00:43:42,060 normally for the N64. They're substantially reduced from the versions on the Switch. 917 00:43:57,740 --> 00:44:05,320 Link! It seems you managed to get together a great number of people. I'm so happy to see this. 918 00:44:06,180 --> 00:44:11,540 I knew they were out there, but it would be nice if we could see them, don't you think? 919 00:44:12,220 --> 00:44:13,680 Yeah, yeah, it would be. 920 00:44:18,960 --> 00:44:22,920 Unfortunately, we don't have the chat because it's not live. 921 00:44:23,160 --> 00:44:28,420 But yeah, so you can imagine the sky filled with chat messages. 922 00:44:48,540 --> 00:44:53,620 We've made it go for a pretty long time to make sure a lot of people got to see their messages on screen. 923 00:44:53,940 --> 00:44:57,440 Also, at GDQ, it was a subscriber-only chat, so we told everybody, 924 00:44:57,600 --> 00:45:01,620 hey, you gotta subscribe, which all that money went to Doctors Without Borders also. 925 00:45:02,320 --> 00:45:08,320 But imagine this sky filled with people saying, we're here together after a pandemic of not being 926 00:45:08,320 --> 00:45:12,040 able to be together, not being able to be in person. Everyone around the world is here. 927 00:45:12,040 --> 00:45:15,660 Imagine the world connecting and tightening here together. No matter where they were, 928 00:45:15,800 --> 00:45:17,840 that connectedness had a huge impact. 929 00:45:19,500 --> 00:45:21,520 There's one more bit of a finale here. 930 00:45:21,680 --> 00:45:23,960 Yeah, one more, 10 more seconds here. 931 00:45:31,940 --> 00:45:35,780 Thank you, Link, for all you have done for us. 932 00:45:38,060 --> 00:45:39,860 Zelda-hime, arigatou. 933 00:45:41,400 --> 00:45:42,020 Zelda-hime, arigatou. 934 00:45:42,020 --> 00:45:43,240 Zelda-hime, arigatou. 935 00:45:45,380 --> 00:45:49,840 So we wonder if DEFCON actually stole their theme for this event from 936 00:45:49,840 --> 00:45:52,540 Triforce Percent, the whole let us create the future together. 937 00:45:52,840 --> 00:45:57,160 That was in summer 2022 when we showed this, and it lined up pretty well. 938 00:45:57,260 --> 00:45:59,620 So thank you so much to DEFCON for having us here. 939 00:45:59,780 --> 00:46:00,400 Yeah, absolutely. 940 00:46:00,560 --> 00:46:03,100 Hey, we are going to come to a close because we're at the end of our time, 941 00:46:03,220 --> 00:46:05,740 but I recently got laid off. 942 00:46:05,800 --> 00:46:07,740 So if you are looking for a hacker for hire, 943 00:46:18,620 --> 00:46:20,040 you can find me on Twitter. 944 00:46:20,040 --> 00:46:24,600 I don't know how to get paid for doing this kind of stuff, 945 00:46:24,680 --> 00:46:27,040 so I'm doing security consulting on the side or just test engineering. 946 00:46:27,200 --> 00:46:27,800 Hit me up afterward. 947 00:46:28,120 --> 00:46:32,040 I cannot thank M-Link enough and Sauron enough for making this happen. 948 00:46:32,200 --> 00:46:34,380 Thank you very much to DEFCON for having us, 949 00:46:34,440 --> 00:46:36,460 and I hope to see you again in the near future. 950 00:46:42,020 --> 00:46:42,420 Thank you.