1 00:00:00,000 --> 00:00:06,760 Hey, guys. Thank you for coming to my talk. My name is Ryan O'Neill. My talk, 2 00:00:07,340 --> 00:00:13,160 Revolutionizing Elf Binary Patching with Shiva. So let me take a moment just to introduce 3 00:00:13,160 --> 00:00:18,980 myself. My name is Ryan O'Neill. I'm also the author of the book Learning Linux Binary 4 00:00:18,980 --> 00:00:25,400 Analysis, which is a book on elf hacking and related topics. I've published in a lot of 5 00:00:25,400 --> 00:00:33,280 journals over the years, different hacker journals, FRAC, POCR, GTFO, VX7, TempOut. And I'm 6 00:00:33,280 --> 00:00:37,640 also the founder of bitlackies.org, which is where I published a lot of my independent 7 00:00:37,640 --> 00:00:44,060 research for many years up until about 2019, still up. I'm also the founder of Arcana 8 00:00:44,060 --> 00:00:49,920 Research, computer security research and development. This is actually this website where 9 00:00:49,920 --> 00:00:55,380 you can read more about Shiva, arcanaresearch.io. And arcanatechnologies.io, which is 10 00:00:55,400 --> 00:01:02,460 a Linux threat detection technology for detecting various types of threats within elf 11 00:01:02,460 --> 00:01:08,300 artifacts. Before I get too deep into the talk, I want to take a moment to talk about the 12 00:01:08,300 --> 00:01:13,480 DARPA AMP program, since Shiva was in part born out of this program. This is a really 13 00:01:13,480 --> 00:01:19,620 unique program created by Sergey Bratis. It's the Assured Micropatching Program by DARPA. 14 00:01:20,020 --> 00:01:25,380 And this program is really cool. It's all about, you know, taking some brilliant, you know, 15 00:01:25,380 --> 00:01:32,360 creative minds who want to raise the state of the art in reverse engineering technologies and 16 00:01:32,360 --> 00:01:39,300 elf binary patching technologies. There's also an effort to be able to do formal verification of 17 00:01:39,300 --> 00:01:44,420 these patches. So after the patch is installed, can it be called safe? So there's a number of 18 00:01:44,420 --> 00:01:49,240 different facets to the project. And throughout the number of different performers, there's quite 19 00:01:49,240 --> 00:01:54,300 a number of CPU architectures that are being targeted right now. Although I'm only specifically 20 00:01:55,380 --> 00:02:01,440 talking about my project today. But just the AMP program as a whole is really cool. So what is 21 00:02:01,440 --> 00:02:07,300 Shiva? So Shiva is a state of the art binary patching solution for elf. It's essentially a 22 00:02:07,300 --> 00:02:12,320 custom dynamic linker that's been highly specialized to load and relocate object files and 23 00:02:12,320 --> 00:02:18,420 transform the program at runtime. I've written a lot of linkers and loaders over the years, from 24 00:02:18,420 --> 00:02:24,460 computer viruses to kernel root kits to all kinds of things, binary protectors that require 25 00:02:24,460 --> 00:02:30,000 different types of custom linkers and loaders. And this is definitely the pinnacle of my research 26 00:02:30,760 --> 00:02:39,000 after about 16 or 17 years of elf binary hacking. So what makes Shiva special? So Shiva has 27 00:02:39,000 --> 00:02:45,380 innovated quite a number of different new linking concepts. So the elf ABI has been extended to 28 00:02:45,380 --> 00:02:51,040 support more advanced linking and relocation operations that allow for program transformation at 29 00:02:51,040 --> 00:02:54,440 runtime. And Shiva's, you know, I'm not going to go into too much detail about Shiva, but it's a 30 00:02:54,460 --> 00:02:59,840 one of its primary goals is to make patching binaries approachable. Meaning you can do it in C, 31 00:03:00,020 --> 00:03:04,880 almost just like you'd program anything else. Trying to bridge the gap between the developer and 32 00:03:04,880 --> 00:03:09,700 the reverse engineer. Because patching binaries is often clunky and difficult. Shiva allows 33 00:03:09,700 --> 00:03:16,480 developers to write nuanced patches with quite a bit of ease. So how can Shiva help you? So if 34 00:03:16,480 --> 00:03:22,060 you're an organization or a company, generally speaking, there's usually legacy software that no 35 00:03:22,060 --> 00:03:24,440 longer has source code. And a bug that's going to be a problem is the fact that it's not going to 36 00:03:24,440 --> 00:03:28,240 fix it. So if a bug comes up, whether it's a security vulnerability or some kind of other bug, how 37 00:03:28,240 --> 00:03:33,600 does one fix that if there's no longer source code? And oftentimes, you know, a team of people might 38 00:03:33,600 --> 00:03:40,180 get together to try to fix a simple bug and it's clunky. And there's no, there's no, like, 39 00:03:41,380 --> 00:03:46,460 development workflow for that that's really been put into our industry yet. So from a hacker's 40 00:03:46,460 --> 00:03:51,480 perspective, Shiva can do all kinds of things as well. It's an advanced instrumentation engine. You 41 00:03:51,480 --> 00:03:54,420 can use it to create black box fuzzing harnesses. I used it to create black box fuzzing harnesses. I used it to 42 00:03:54,440 --> 00:04:01,220 fuzz the dynamic linker. One dynamic linker fuzzing another dynamic linker. But I can't really get 43 00:04:01,220 --> 00:04:04,120 through a lot of the stuff I want to get through today. So I'm going to blast through these slides, 44 00:04:04,620 --> 00:04:10,040 unfortunately, a little quicker than I might want. So the origins of Shiva. About three and a 45 00:04:10,040 --> 00:04:14,220 half, four years ago, I had an itch to write a custom elf interpreter. Everybody here know what an 46 00:04:14,220 --> 00:04:19,580 elf interpreter is? Basically, usually the dynamic linker. But writing an elf interpreter is an 47 00:04:19,580 --> 00:04:24,420 interesting thought because, well, there's a lot of innovative concepts that can be, you know, you can 48 00:04:25,320 --> 00:04:26,100 write an elf interpreter, but you can't write an elf interpreter without a dynamic linker. And so 49 00:04:26,100 --> 00:04:31,540 this led to a concept called interpreter chaining, where I chained two dynamic linkers together into 50 00:04:31,540 --> 00:04:36,540 the same process image, my custom dynamic linker, which was evil, and then the real dynamic 51 00:04:36,540 --> 00:04:43,120 linker. My evil dynamic linker loaded a modular relocatable object, virus, into memory. And so 52 00:04:43,120 --> 00:04:48,180 this was actually my first implementation of a custom dynamic linker for elf or a custom elf 53 00:04:48,180 --> 00:04:52,700 interpreter. And you can actually read that algorithm for interpreter chaining and the whole 54 00:04:52,700 --> 00:04:59,180 virus and everything is published in temp out issue two, article six there. And this, you know, 55 00:04:59,220 --> 00:05:05,040 modular elf virus loader interpreter ultimately loaded or ultimately morphed into the first 56 00:05:05,040 --> 00:05:11,260 version of Shiva, which was originally for x8664. I actually gave a talk about it a year ago, but 57 00:05:11,260 --> 00:05:15,220 it's a completely different beast than what I'm talking about today. But just giving you a little 58 00:05:15,220 --> 00:05:21,700 history there. And so the original Shiva was for loading elf micro programs. So it was a custom 59 00:05:22,700 --> 00:05:26,100 algorithm that allowed you to load elf micro programs to implement security features and such 60 00:05:26,100 --> 00:05:31,140 into the process address space, like control flow integrity hardening or whatever. You could do a 61 00:05:31,140 --> 00:05:36,000 lot with it. It was an instrumentation dream toy for a reverse engineer. And that's still 62 00:05:36,000 --> 00:05:39,960 available. I actually just open sourced that today. We're going to get into this in a moment 63 00:05:39,960 --> 00:05:46,320 here. But the current version of Shiva is Shiva alpha version 0.11, and it was forked off that 64 00:05:46,320 --> 00:05:52,680 original version. So just to clarify. And it was heavily modified to meet the requirements of the 65 00:05:53,800 --> 00:06:02,480 DARPA AMP program, specifically NASA. And so but with that said, it's I'm not going to get too 66 00:06:02,480 --> 00:06:08,440 far ahead, actually. So let me stick with the slide. So rewind 25 years. Who was originally 67 00:06:08,440 --> 00:06:15,380 trying to patch elf binaries? And for what purpose? And this brings us to the awesome era of 68 00:06:15,380 --> 00:06:22,680 early Unix virus research. And Silvio Caesar, who is a good friend of mine and mentor, is a 69 00:06:22,700 --> 00:06:28,800 scientist. He published this research, you know, through about 97 to 99, this very early elf 70 00:06:28,800 --> 00:06:34,740 research. Unix and elf parasites in 1998 and a number of other papers I could list. But you have 71 00:06:34,740 --> 00:06:39,720 to understand at the time this was super esoteric stuff. Nobody was doing this in 98. Who the 72 00:06:39,720 --> 00:06:46,460 hell knew what elf was? An elf? But I saw that paper when I was 15, and it definitely enamored 73 00:06:46,460 --> 00:06:52,160 me, compelled me into wanting to work on that stuff. But, yeah, just a ton of other research. 74 00:07:01,740 --> 00:07:07,400 It's really the same thing as elf instrumentation. Coming from somebody who has written a 75 00:07:07,400 --> 00:07:13,940 number of computer viruses for elf, the programmatic techniques that go into it are very much 76 00:07:13,940 --> 00:07:18,720 the same as instrumenting a binary with any other code. It doesn't matter if it's a parasite or 77 00:07:18,720 --> 00:07:22,680 if it's security code. The point is you need to make room within the elf binary to be able to 78 00:07:22,700 --> 00:07:28,460 use the binary. Often times the techniques aren't trivial for restructuring a binary, depending 79 00:07:28,460 --> 00:07:33,480 on the technique, you know, text segment padding infection, reverse text infection, so all kinds of 80 00:07:33,480 --> 00:07:38,380 ways. And then that code has to be relinked in some way, whether it's through PLT hooks, inline 81 00:07:38,380 --> 00:07:43,880 hooks, relocation poisoning or some other means. Also, we know that, of course, you know, hackers 82 00:07:43,880 --> 00:07:49,720 like to inject viruses into memory. So P-trace is often used. And it's often used for just 83 00:07:49,720 --> 00:07:52,680 instrumentation in general. You look at many different techniques, you know, you can look at 84 00:07:52,700 --> 00:07:57,940 technologies out there, Dynamo Rio, a bunch of them use P-trace. I've used P-trace a bunch to 85 00:07:57,940 --> 00:08:03,140 instrument. But on the same token, you know, security technologies use this as well for 86 00:08:03,140 --> 00:08:08,860 injecting patches into memory or instrumenting memory like Valgrind does. In a way, Shiva is 87 00:08:08,860 --> 00:08:12,380 kind of similar probably to Valgrind in how it works in terms of the just in time kind of 88 00:08:12,380 --> 00:08:21,000 aspect of it. Basically all the elf research was coming out of the underground scene. In the 89 00:08:21,000 --> 00:08:22,680 early, in the late 90s and early 2000s, there was a lot of research that was coming out of the 90 00:08:22,700 --> 00:08:28,080 2000s. There were a few major players in that area. One of them was the GRUC. The GRUC designed 91 00:08:28,080 --> 00:08:33,960 the user land exec implementation, which is a user land function that can execute another 92 00:08:33,960 --> 00:08:39,120 program. So you don't have to use the exec V system call and trap into the kernel. One user 93 00:08:39,120 --> 00:08:43,600 land program can execute another user land program. It has all kinds of insane uses. He was 94 00:08:43,600 --> 00:08:48,480 using it for anti forensics. I've used it for binary protectors and now I'm using it for Shiva 95 00:08:48,910 --> 00:08:52,680 because it's a loader. And so very, very important research by the GRUC. And it's a very, very 96 00:08:52,680 --> 00:08:56,640 cool project. And he did other cool stuff, too. And of course we have Mayhem, who was the chief 97 00:08:56,640 --> 00:09:01,420 editor of frack around the time. And he had this incredible project, the elf reverse 98 00:09:01,420 --> 00:09:06,920 engineering software interface, which I really can't say enough about. Truly profound work, 99 00:09:07,380 --> 00:09:13,060 especially in 2002. Just the sheer level of innovation and work that went into it is 100 00:09:13,060 --> 00:09:19,680 impressive. And there's a number of other people that worked with Mayhem on that project, other 101 00:09:19,680 --> 00:09:22,660 aspects of it. But very brilliant work and very informative. And I think that's what we're going to 102 00:09:23,360 --> 00:09:26,500 talk about in a little bit. And then another really influential piece of work that came from the 103 00:09:26,500 --> 00:09:31,800 early underground, probably 99, was Silvio's he wrote a version of insmod that could install a 104 00:09:31,800 --> 00:09:36,820 kernel module through dev KMM by handling all the relocations and stuff manually. It was the 105 00:09:36,820 --> 00:09:40,500 first implementation I'd seen of a hacker writing a linker or a loader at the time. But it 106 00:09:40,500 --> 00:09:45,560 really seemed very profound to me. And so that's some really these are some real formative 107 00:09:45,560 --> 00:09:51,620 pieces of work that definitely inspired me over the years. And there's also some really 108 00:09:51,620 --> 00:09:56,800 interesting stuff that's come from the academic space in terms of elf binary patching. Firstly, 109 00:09:56,940 --> 00:10:02,840 what comes to mind is Katana, which is a DORF aware hot patching framework for elf. And it was 110 00:10:02,840 --> 00:10:07,540 designed by Sergey Bratis and James Oakley, I think it was about 13 years ago. And a couple of 111 00:10:07,540 --> 00:10:13,400 really good white papers came out of it. Pebble, I don't know as much about, but I've kind of 112 00:10:13,400 --> 00:10:18,440 paid attention to it over the years on GitHub. And it's an elf instrumentation framework. I think 113 00:10:18,440 --> 00:10:21,600 it's primarily used for software profiling, but it does some degree of function. So it's kind of a 114 00:10:21,600 --> 00:10:27,620 function relocation. And then we have this really great research called Weird Machines in Elf by 115 00:10:27,620 --> 00:10:32,920 Rebecca Shapiro and Sergey Bratis. And this was, I think there was even a talk at DEF CON maybe in 116 00:10:32,920 --> 00:10:39,300 2011. But it was all about using the dynamic linkers relocation computations as a Turing 117 00:10:39,300 --> 00:10:44,100 complete machine. So you can program the dynamic linker to do a lot. And just through metadata, 118 00:10:44,380 --> 00:10:49,700 you know, relocations, whatever. And this is something Shiva does a lot. And so these are just, 119 00:10:49,860 --> 00:10:51,300 yeah, this is great stuff here. 120 00:10:51,600 --> 00:10:55,820 Yeah. So take a look at some of the research tied to it. So, you know, we could say elf binary 121 00:10:56,460 --> 00:11:00,280 instrumentation is a double edged sword. There's a lot to be learned from the hackers and the 122 00:11:00,280 --> 00:11:05,480 underground community who were first putting this information out before 25 years later rolls 123 00:11:05,480 --> 00:11:12,420 around and here we are needing to design advanced binary patching technologies. And Shiva has 124 00:11:12,420 --> 00:11:17,440 done that, but it's very much based in knowledge that I've had preexisting, you know, in the 125 00:11:17,440 --> 00:11:21,580 underground scene. And so we're like, okay, well, binary patching is pretty old. It goes all to the 126 00:11:21,600 --> 00:11:27,160 the way back to computer viruses. But really, it goes back to the beginning of Elf, which 127 00:11:27,160 --> 00:11:34,840 became the Unix standard in 1995 executable format for Unix, Linux. And, you know, having 128 00:11:34,840 --> 00:11:38,360 been somebody who's done a lot of Elf binary hacking over the years, I put a lot of thought 129 00:11:38,360 --> 00:11:43,200 into this project. And I started, you know, looking at Elf and saying, really, it's 130 00:11:43,200 --> 00:11:48,960 already equipped mostly with what it needs. It's already equipped to do a lot of patching 131 00:11:48,960 --> 00:11:53,660 just with its own relocation symbol information. And I started looking at, you know, say, 132 00:11:53,780 --> 00:12:00,360 LDLinux.so. It's already a JIT micro patching engine. It does simple patches, but it's still a 133 00:12:00,360 --> 00:12:05,980 hot patching system. And then we have BinLD. LD links relocatable objects into an 134 00:12:05,980 --> 00:12:13,020 executable using really granular Elf relocation metadata. And so just kind of looking and 135 00:12:13,020 --> 00:12:17,540 meditating on these things, how can I take what's already done so beautifully and well and 136 00:12:17,540 --> 00:12:18,780 extrapolate on that? 137 00:12:18,780 --> 00:12:18,940 Yeah. 138 00:12:18,960 --> 00:12:24,800 To make an advanced binary patching system that allows people to patch binaries in C. So I 139 00:12:24,800 --> 00:12:29,440 started to realize, yeah, there's a lot of power in writing an interpreter and what you can do 140 00:12:29,440 --> 00:12:34,080 with it. Started out as writing a modular virus just to be, you know, cool and creative. But I 141 00:12:34,080 --> 00:12:39,580 knew it was going to extrapolate into something a little bit more formal. And so you guys, most of 142 00:12:39,580 --> 00:12:44,360 you are probably familiar with Elf. The PT insert segment holds the path to LDLinux.so or the 143 00:12:44,360 --> 00:12:48,040 dynamic linker. That gets replaced with lib Shiva. And 144 00:12:48,040 --> 00:12:54,560 the interpreter generally speaking sets up the finer details of the process image. And the 145 00:12:54,560 --> 00:12:59,020 interpreter has instrumentation precedence because it runs before even the real dynamic linker. 146 00:13:00,300 --> 00:13:05,760 So another strong aspect of it is, you know, patching memory with P trace is slow because 147 00:13:05,760 --> 00:13:10,640 you're in another process and there's a lot of context switching and things that happen. If the 148 00:13:11,400 --> 00:13:18,020 patching, you know, engine is in the same address space of the program it's patching, it's much faster. And so, you know, if you're in a 149 00:13:18,020 --> 00:13:22,620 different place, you're going to have to do a lot of things. So this is something exploring a different time and more depth. But 150 00:13:23,360 --> 00:13:29,640 essentially I started thinking, well, an Elf relocatable objects have really great metadata, enough relocation 151 00:13:29,640 --> 00:13:36,500 information to build a process image out of. And so really Shiva is somewhat of a hybrid between LD and LDLinux.so. 152 00:13:38,820 --> 00:13:48,000 So it draws wisdom from both linkers. You know, it's flexible, it's modular, like the dynamic linker, LDLinux.so, but it has a 153 00:13:48,020 --> 00:13:59,240 nuance of LD because it uses that really granular relocation information that's in those Elf object files. So to kind of 154 00:13:59,240 --> 00:14:07,420 further just show how it fits into the existing Elf linking components, you've got LD, it's an Elf linker. You've got LDLinux.so, 155 00:14:07,640 --> 00:14:13,980 that's a linker and a loader because it loads shared libraries and knows how to load executables. And then you have LibShiva, 156 00:14:14,080 --> 00:14:17,580 which is an Elf linker, loader, and a transformer. And we're going to get more into 157 00:14:18,020 --> 00:14:27,660 transformation, transforms, how they fit on top of relocations a little bit later. But or maybe right now. So Shiva's 158 00:14:27,660 --> 00:14:34,400 innovation in linking concepts. Shiva, just in the research and development of it, you know, I created a number of new 159 00:14:34,400 --> 00:14:41,260 techniques that are necessary to kind of bring this all together. One of them I touched on briefly, interpreter chaining, 160 00:14:42,120 --> 00:14:47,720 Elf transforms. In fact, I'm not even going to go through the whole list right now. But each one of these 161 00:14:48,020 --> 00:14:56,940 is something that's either brand new or being used in a new way. Generally, this is all pretty new concepts that fit really 162 00:14:56,940 --> 00:15:05,580 nicely into the existing Elf ABI. We're going to talk deeper about them. Shiva's built on top of LibElf master. It's a library I wrote in 163 00:15:05,580 --> 00:15:12,720 like 2018. It forensically reconstructs broken binaries under the hood. So if a binary has no section headers or symbol tables, 164 00:15:12,920 --> 00:15:18,000 it will reconstruct those based on, you know, the EH frame, the dynamic segment, other things. It's a very, very, very well-known 165 00:15:18,000 --> 00:15:23,360 thing. And we create the symbol table internally. So even though Shiva's symbolically driven, it can still work on 166 00:15:23,360 --> 00:15:29,300 stripped binaries because of that. So I thought that might be a question that comes up. So let's take a look at Shiva's Elf linking 167 00:15:29,300 --> 00:15:37,380 workflow. So on the very left, we have just, you know, two object files, main.o and foo.o being linked into a program, my 168 00:15:37,380 --> 00:15:46,020 program. In the middle, we see that that program is now being executed and it has the LD Linux interpreter loading libc.so into 169 00:15:46,020 --> 00:15:47,980 memory. That's just, you know, the job. 170 00:15:48,000 --> 00:15:54,380 That's the general kind of linking workflow. You move over to the very far right, and there's a diagram illustrating that Shiva and LD 171 00:15:54,380 --> 00:16:01,840 Linux.so are cooperating together in the same address space to transform the program with both the patch and the shared libraries. 172 00:16:02,800 --> 00:16:09,660 So the standard Elf dynamic linking workflow essentially looks like this. You've got the kernel is trying to execute a program 173 00:16:09,660 --> 00:16:17,620 called test. But first it loads test interpreter, which is LD Linux.so, passes control to it. The dynamic linker loads libc or 174 00:16:17,620 --> 00:16:25,960 whatever it's loading, and then passes control to bin test. Actually passes control to the underscore start function. With 175 00:16:26,580 --> 00:16:33,680 linker chaining, where you're linking multiple dynamic linkers into the same address space, you have both lib Shiva and LD Linux.so 176 00:16:34,660 --> 00:16:41,000 cooperating together. The kernel loads Shiva, since that's the interpreter, passes control to it. Shiva loads, links, and 177 00:16:41,000 --> 00:16:47,600 transforms this patch, and then it actually user land execs, essentially, LD Linux.so and libc.so. And then it actually loads the 178 00:16:47,620 --> 00:16:53,360 memory, maps all the segments into memory, passes control to the real dynamic linker, just like the kernel would. The dynamic 179 00:16:53,360 --> 00:17:01,360 linker then loads its shared libraries, and then finally passes control to test. That's actually a simple workflow. We'll get deeper 180 00:17:01,360 --> 00:17:09,760 later. But I mentioned that Elf patches are compiled as just regular relocatable objects. You can use clang or gcc. In the 181 00:17:09,760 --> 00:17:17,320 future I plan to write a compiler wrapper. But essentially, you know, relocatable objects are great for patches. They contain rich 182 00:17:17,620 --> 00:17:26,540 symbolic metadata for both relocations, all the symbol names. And I have extended some of it. But generally speaking, the object files are 183 00:17:26,540 --> 00:17:34,100 really nice. You have to build them with a large code model. That way an internal got is used for absolute addresses so that you don't run into a 184 00:17:34,100 --> 00:17:40,900 situation where you're further than four gigabytes away from the executable that you need to relink with. So there's that. But I 185 00:17:40,900 --> 00:17:47,580 definitely recommend checking out the Shiva module loader function in Shiva underscore module dot C. It's definitely where all the, my 186 00:17:47,620 --> 00:17:55,960 most probably interesting code is. Also, you know, after an Elf relocatable object is, so an Elf relocatable object basically gets loaded into 187 00:17:55,960 --> 00:18:02,160 memory. Shiva creates a text segment, data segment, BSS for all the patch information, all the sections are put in their appropriate 188 00:18:02,160 --> 00:18:10,040 places. All the relocations for the patches are handled. But then the executable itself needs to be relinked to use the new patch code and data. 189 00:18:10,300 --> 00:18:17,600 Well, that's a little difficult because Elf executables don't have relocation data that describe how to relocate a patch. You just need to 190 00:18:17,600 --> 00:18:22,880 relocate their own text section. They have a little bit of dynamic linking information, but that's different. They don't have the 191 00:18:22,880 --> 00:18:30,280 information that was in the original Elf object files because it's not needed anymore. It would be nice. But what Shiva does is it generates a 192 00:18:30,280 --> 00:18:38,040 control flow graph and based off that it generates relocations on the fly for the Elf executable because there's a lot of relinking and 193 00:18:38,040 --> 00:18:45,940 reencoding of instructions that has to be done if you splice new code in, for instance. All the offsets change, everything changes. And so 194 00:18:45,940 --> 00:18:47,580 we're able to handle all that pretty easily. 195 00:18:47,600 --> 00:18:56,800 Pretty nicely, fluently. So I mentioned briefly Shiva's user land exec functionality. And this is just used kind of like any interpreter with 196 00:18:56,800 --> 00:19:05,260 Python. You can call Python directly. Same with Shiva. This is really good for testing a patch. Let's say you want to make no metadata 197 00:19:05,860 --> 00:19:12,360 modifications to the binary, just leave the binary completely untouched, you just specify the patch object in the Shiva module path 198 00:19:12,360 --> 00:19:17,580 environment variable, and then you run Shiva and the program you're trying to execute. And it will load and you can see how it works. And if you 199 00:19:17,600 --> 00:19:23,840 and install the patches all at run time. If you want the program to be patched every time 200 00:19:23,840 --> 00:19:27,640 you run it without having to execute Shiva, you have to use the Shiva pre-linker. We'll 201 00:19:27,640 --> 00:19:31,680 get into that in a minute. But it updates the PT interp segment with the correct interpreter 202 00:19:31,680 --> 00:19:35,080 and also adds a new dynamic segment, a couple of other little things. 203 00:19:35,580 --> 00:19:40,980 So can everybody see here the requesting program interpreter is lib Shiva in this program instead 204 00:19:40,980 --> 00:19:46,320 of LD Linux? So that's just kind of illustrating for you what the program looks like after 205 00:19:46,320 --> 00:19:51,660 it's been pre-linked. And then if the dynamic segment here, we can see the last three entries 206 00:19:51,660 --> 00:19:56,660 towards the bottom here, Shiva needed. And I don't know why you can't see that. Hold on here. 207 00:19:57,980 --> 00:20:02,680 There's like something in front of it there. But that's the base name to the patch object, 208 00:20:02,920 --> 00:20:08,160 Shiva needed. So the needed patch objects. The search right here is the search path to where 209 00:20:08,160 --> 00:20:12,940 all the object files are stored. Just like with the dynamic linker, they're usually stored in 210 00:20:12,940 --> 00:20:15,940 lib. And then it gives the path to the original. 211 00:20:17,140 --> 00:20:22,320 So that Shiva knows which path the interpreter is to load and link into memory. Because it will 212 00:20:22,320 --> 00:20:28,580 map the dynamic linker into memory once it's done. So I want to talk about elf symbol interposition 213 00:20:28,580 --> 00:20:34,820 here for a moment. So is anybody familiar with what that term means, elf symbol interposition? 214 00:20:35,120 --> 00:20:40,380 Okay, yeah. So essentially, though, think LD preload. It's where you can overwrite one symbol 215 00:20:40,380 --> 00:20:44,520 with another symbol because it has the same name based on the precedence of the object that's 216 00:20:44,520 --> 00:20:44,800 loaded. 217 00:20:46,320 --> 00:20:51,240 And Shiva, one of its really strong features is that it allows you to rewrite any code and data 218 00:20:51,240 --> 00:20:56,720 just by name. You know, as long as there's symbolic data attached to it, any global data, any 219 00:20:56,720 --> 00:21:01,160 global functions, even local functions, although it needs about two days of work to do that. 220 00:21:01,260 --> 00:21:07,620 But essentially, anything symbolically can be rewritten. It's actually really easy. And so 221 00:21:08,020 --> 00:21:12,040 instead of just rewriting functions like with LD preload, you can rewrite anything by name 222 00:21:12,040 --> 00:21:13,800 essentially in the executable itself. 223 00:21:14,640 --> 00:21:16,300 I want to give just a little example here. I'm going to give you a little example here. If you 224 00:21:16,300 --> 00:21:22,400 see, we're running hello. It says hello world. Can you guys see that okay? It's kind of small, 225 00:21:22,520 --> 00:21:27,280 but. And then I look at the symbol table and I see there's a string called hello underscore string 226 00:21:27,280 --> 00:21:35,420 that lives in the RO data section. And if we, let's say we want to change that program. The 227 00:21:35,420 --> 00:21:39,300 program's called hello. And we want to make it so that it prints hello DEFCON 31. So we 228 00:21:39,300 --> 00:21:45,400 literally have a very simple patch. We just redefine that constant string by name. We compile it 229 00:21:45,400 --> 00:21:52,100 into a L3 locatable object with a large code model. And then on this slide, we're going to show you 230 00:21:52,100 --> 00:21:58,440 how it works. So running hello just runs hello world. But if we set the shiva module path to the 231 00:21:58,440 --> 00:22:04,160 patch object, and then run shiva on hello, it installs the patch at runtime. But then if you 232 00:22:04,160 --> 00:22:15,380 just run it without shiva 233 00:22:15,400 --> 00:22:20,600 do is use the Shiva pre-linker. It's called Shiva LD. And it essentially just installs the 234 00:22:21,100 --> 00:22:27,140 original interpreter information, the patch metadata such as the location of the patch into 235 00:22:27,140 --> 00:22:31,940 the new data segment that it creates in the binary. So the executable code and data isn't 236 00:22:31,940 --> 00:22:36,640 changed at all. It's just metadata. So that the new binary uses the correct interpreter path 237 00:22:36,920 --> 00:22:42,440 and all that. So we can see we run hello directly now that we pre-linked it and it's 238 00:22:42,440 --> 00:22:50,080 printing hello DEFCON 31. So just a simple patch and see. So transformations. I mentioned 239 00:22:50,080 --> 00:22:55,580 these earlier. So this is transformations begin where relocations leave off. I think the 240 00:22:55,580 --> 00:23:00,640 dynamic linker is just brilliant. It's a brilliant hot patching mechanism. We can learn a 241 00:23:00,640 --> 00:23:06,320 lot from it. Why not take it and utilize it for micro patching binaries. Something of that 242 00:23:06,320 --> 00:23:12,420 nature. The same concept. Extrapolating on it. So if elf relocations are what are the 243 00:23:12,440 --> 00:23:17,280 metadata that describe simple patching operations, then elf transformations would be the 244 00:23:17,280 --> 00:23:22,420 metadata that describe complex patching operations. Such as function splicing. Things of 245 00:23:22,420 --> 00:23:30,400 that nature. So function splicing is the ability to splice C code into any function at any 246 00:23:30,400 --> 00:23:35,300 given point within the function. Fully relocatable code. Fully symbolically rich access to 247 00:23:35,300 --> 00:23:42,160 all the shared library symbols, functions. And this is very complicated. There's a lot of 248 00:23:42,160 --> 00:23:48,060 relinking. Many, many magical things have to happen under the hood. But the end result is we 249 00:23:48,060 --> 00:23:53,020 have these transform macros that developers can use to splice code in and out of a function. 250 00:23:54,700 --> 00:24:01,580 So this is just kind of a crude example here. But essentially we have on the left a program 251 00:24:02,040 --> 00:24:07,880 that you stir copy. And it's a function called copy string. And let's say we want to modify 252 00:24:07,880 --> 00:24:12,140 that function so that it uses stern copy. You know? Make sure the string, by the way, is 253 00:24:12,160 --> 00:24:18,680 null terminated. So on the left you can see the code that's being removed from 7BC down to 254 00:24:19,100 --> 00:24:25,200 7C8. Which will make our stopping address 7CC, by the way. But we want to splice this code, 255 00:24:25,300 --> 00:24:30,920 which is larger, into this little area there. We want to make it look like this on the right. 256 00:24:31,020 --> 00:24:35,920 So how would we do that? So this is actually a transformation patch right here. I'll give you an 257 00:24:35,920 --> 00:24:42,140 example. So up here we have this macro. Shiva T splice function. Copy string. This is the 258 00:24:43,540 --> 00:24:49,680 offset, 7BC to 7CC. Now these three lines of code are pretty simple. The first line, because 259 00:24:49,680 --> 00:24:55,040 the argument stored in the X0 register, because it's ARM, we create a source pointer variable, 260 00:24:55,240 --> 00:24:59,480 because it's the argument of the function copy string. And then the destination buffer was at 261 00:24:59,480 --> 00:25:05,040 base pointer plus 32. So Shiva gives you macros to access live variables and registers as 262 00:25:05,040 --> 00:25:11,300 needed. And then it just does stern copy. This actually compiles into an object file that looks 263 00:25:11,300 --> 00:25:18,400 like this. And I unfortunately don't have all the time I'd like to go on that tangent. But 264 00:25:18,400 --> 00:25:24,060 generally speaking, in the text section here, we have this function. Shiva splice FN name copy 265 00:25:24,060 --> 00:25:29,300 string. That tells Shiva, okay, this function right here is actually code that's going to be 266 00:25:29,300 --> 00:25:34,200 spliced into a function called copy string. By the way, it won't copy the procedure prolog and 267 00:25:34,200 --> 00:25:38,840 epilog. That's not splice code. But ARM doesn't respect the naked attribute, apparently. 268 00:25:40,600 --> 00:25:45,240 So overflow crashes. So this is a program called overflow. It's the one that I showed you. 269 00:25:45,280 --> 00:25:50,340 It's vulnerable. It's got stir copy. We can see that when we pass it four A's, it works. When we 270 00:25:50,340 --> 00:25:56,700 pass it like over 16 A's, it crashes. So we prelink our patch. This one I showed you right 271 00:25:56,700 --> 00:26:02,240 here. We compile into a relocatable object. Prelink it to the vulnerable program overflow. And 272 00:26:02,240 --> 00:26:08,280 then we run overflow. And we can see that it works. It's not crashing anymore. That's because it's 273 00:26:08,280 --> 00:26:13,420 using stern copy and properly null terminating the string. But just showing how ‑‑ that's a very 274 00:26:13,420 --> 00:26:18,900 simple example. You can splice into any function. That's just to make it palatable in a talk. 275 00:26:19,180 --> 00:26:23,060 So spliceable code has some interesting characteristics. I kind of covered some of them. 276 00:26:23,160 --> 00:26:29,280 It's fully relocatable, a very rich symbolic access with natural C development. There's no limit 277 00:26:29,280 --> 00:26:36,440 or size to the amount of code you can splice into an existing function. And, yeah, I mean, you 278 00:26:36,440 --> 00:26:38,260 can ‑‑ and then, of course, there's massive amount of code that you can splice into an 279 00:26:38,280 --> 00:26:40,740 existing function. And then there's a lot of macros for gaining access to the live variables 280 00:26:40,740 --> 00:26:47,920 and registers on the stack and whatnot. So confluent linking technology. So this is a 281 00:26:47,920 --> 00:26:51,920 terminology I've kind of coined, which just means two dynamic linkers working together 282 00:26:51,920 --> 00:26:57,320 coherently within one process image to build, transform, and relink the program at run time. 283 00:26:57,720 --> 00:27:02,580 And there are a lot of cases ‑‑ so there's a couple new things here. Cross relocations. 284 00:27:02,760 --> 00:27:07,960 This is actually where one dynamic linker relies on another dynamic linker to solve its own 285 00:27:07,960 --> 00:27:08,260 relocations. So this is where one dynamic linker relies on another dynamic linker to solve its own 286 00:27:08,280 --> 00:27:12,660 relocation. And so an example of this is let's say you write a patch that has a new BSS 287 00:27:12,660 --> 00:27:16,720 variable. It's overwriting another BSS variable in the original program. This is the new 288 00:27:16,720 --> 00:27:20,140 version of the variable that should be used. Maybe you had to extend a buffer size or 289 00:27:20,140 --> 00:27:27,060 something. Those BSS variables are often accessed indirectly through the got. There's a 290 00:27:27,060 --> 00:27:32,520 relative relocation, at least in PI executables, that fixes up the got to the correct BSS 291 00:27:32,520 --> 00:27:37,040 address. So when she ‑‑ when somebody has a patch with a new BSS variable, for instance, 292 00:27:37,040 --> 00:27:45,560 they will ‑‑ sorry, I'm looking at the time here. They will ‑‑ Shiva will instruct the other 293 00:27:45,560 --> 00:27:52,140 dynamic linker to essentially patch it by modifying the relocation metadata in memory. So you 294 00:27:52,140 --> 00:27:55,940 can basically tell the dynamic linker to do whatever you want. You give it a script. The 295 00:27:55,940 --> 00:28:02,060 script is the ELF sections that ‑‑ and the values in the dynamic segment that are read by the 296 00:28:02,060 --> 00:28:06,740 dynamic linker. We also have delayed relocations, which we ‑‑ therefore we have the Shiva 297 00:28:06,740 --> 00:28:12,780 post linker, which actually handles some relocations after LD Linux.SO. So Shiva will load, 298 00:28:12,880 --> 00:28:17,200 link the patch, pass control to the dynamic linker, and then when the dynamic linker is done, 299 00:28:17,360 --> 00:28:22,500 oftentimes it passes control back to a function called Shiva post linker. We actually update the 300 00:28:22,500 --> 00:28:27,300 AT entry value in the auxiliary vector, which normally points to the start function of the 301 00:28:27,300 --> 00:28:33,740 program, so that it jumps back to the Shiva post linker. The Shiva post linker then finishes 302 00:28:33,740 --> 00:28:36,720 handling any delayed relocations and then passes control back to the dynamic linker. 303 00:28:39,100 --> 00:28:47,620 Shiva was just made open‑source today. I am excited, grateful to be able to share it with 304 00:28:47,620 --> 00:28:52,700 everybody. Please, you know, and there's a user manual. There's quite a bit of documentation. 305 00:28:54,780 --> 00:29:00,080 But let's see, what time is it here? So let me go into this demo real quick for you guys, okay? 306 00:29:00,120 --> 00:29:06,720 I want to ‑‑ all right. So let me go into this demo real quick for you guys, okay? Let's 307 00:29:09,480 --> 00:29:09,960 see. 308 00:29:09,960 --> 00:29:10,720 I hope you like Chopin. 309 00:29:13,680 --> 00:29:20,740 All righty. So I want to illustrate an example of symbol interposition and how it can be used to 310 00:29:20,740 --> 00:29:26,500 rewrite global code and data on the fly with Shiva in a way that's natural for C developers. 311 00:29:26,940 --> 00:29:29,880 So let's take a look at this simple program, test food. 312 00:29:30,680 --> 00:29:36,720 And for the sake of illustrating this scenario, I'm going to show you the original source code so we can 313 00:29:36,740 --> 00:29:44,920 see that main simply calls foo and then prints the return value. Foo prints I am the original foo function 314 00:29:44,920 --> 00:29:50,800 and then it prints the value of lucky number. Lucky number is an initialized global variable so it would live 315 00:29:50,800 --> 00:29:59,720 in the data section. So let's say we wanted to rewrite this function and also modify this variable. 316 00:29:59,840 --> 00:30:04,580 In fact, we actually want to redeclare this variable. Let's take a look over here on the right side of the screen. 317 00:30:04,680 --> 00:30:06,400 And this is the actual patch code itself. 318 00:30:06,740 --> 00:30:13,860 So as you can see, we've redeclared lucky number as an uninitialized global variable. 319 00:30:14,120 --> 00:30:23,080 In Shiva, we call this, you know, redefinition or redeclaration of storage type or storage type redeclaration. 320 00:30:23,540 --> 00:30:27,380 And then down here, we have rewritten foo. 321 00:30:28,420 --> 00:30:34,420 And this is showing how we can drive our patching through symbolic references. 322 00:30:34,600 --> 00:30:36,380 So these symbols exist. 323 00:30:36,740 --> 00:30:37,900 Within the target binary. 324 00:30:37,940 --> 00:30:41,880 And so we're able to rewrite them using symbol interposition. 325 00:30:44,580 --> 00:30:47,760 Now, right here, we set the value of lucky number. 326 00:30:47,940 --> 00:30:50,420 It's now initialized to 31337. 327 00:30:50,720 --> 00:30:52,600 We print I am the new function foo. 328 00:30:52,840 --> 00:30:54,780 We print the value of lucky number. 329 00:30:55,000 --> 00:31:05,900 And then right here, we're demonstrating how Shiva patches are able to resolve shared library functions that don't already have a PLT entry in the executable that we're patching. 330 00:31:05,900 --> 00:31:10,920 And so right here, we're calling system to cat this shiva.ancy file. 331 00:31:11,100 --> 00:31:12,380 And then we return dead beef. 332 00:31:12,520 --> 00:31:14,720 So we have rewritten foo. 333 00:31:14,940 --> 00:31:18,840 And we have redeclared lucky number as an uninitialized variable. 334 00:31:19,200 --> 00:31:23,060 So let's say we want to take this patch and we want to compile it. 335 00:31:23,160 --> 00:31:33,020 So we would, sorry, we would build it just like a relocatable object with a large code model. 336 00:31:33,240 --> 00:31:35,500 Which we have to use no pick. 337 00:31:35,500 --> 00:31:36,180 And then. 338 00:31:39,580 --> 00:31:41,860 So we have a relocatable object now. 339 00:31:43,500 --> 00:31:46,880 You can see the relocations in it. 340 00:31:48,420 --> 00:31:49,200 Symbol table. 341 00:31:50,560 --> 00:31:54,440 And if we want to install this patch, there's two ways to do it. 342 00:31:54,520 --> 00:32:03,880 So firstly, in many cases, we just want to try the patch out or just test it once without making any modification at all to the target binary. 343 00:32:04,220 --> 00:32:05,480 And so test first. 344 00:32:05,500 --> 00:32:07,000 Test foo without a patch. 345 00:32:07,300 --> 00:32:09,700 And now test foo with a patch. 346 00:32:10,140 --> 00:32:13,760 We specify the shiva module path environment variable. 347 00:32:16,220 --> 00:32:17,280 Export it. 348 00:32:17,440 --> 00:32:20,860 And then we simply invoke shiva directly. 349 00:32:22,380 --> 00:32:24,340 And now it runs the patch version. 350 00:32:25,040 --> 00:32:32,760 So it has been, the executable has been relinked in memory to use the code and data specified in our patch. 351 00:32:33,420 --> 00:32:35,480 Prince, I am the new function free. 352 00:32:35,480 --> 00:32:38,560 It then prints 31337 is the lucky number. 353 00:32:38,740 --> 00:32:40,820 It prints the shiva ANSI banner. 354 00:32:41,060 --> 00:32:43,720 And then prints the return value of dead beef. 355 00:32:44,240 --> 00:32:48,700 Now if we wanted to install this patch permanently, we would have to use the shiva prelinker. 356 00:32:48,760 --> 00:32:54,060 Which installs some metadata such as the path to shiva into the interp segment. 357 00:32:54,420 --> 00:32:58,420 And it updates the dynamic segment of the executable and adds a few new entries. 358 00:32:58,580 --> 00:33:00,360 So let's take a look at that. 359 00:33:00,640 --> 00:33:01,560 Let me clear the screen. 360 00:33:02,000 --> 00:33:04,280 Shiva LD works like this. 361 00:33:04,280 --> 00:33:06,320 And so give an example. 362 00:33:06,380 --> 00:33:09,760 Dash E is the executable which is test foo. 363 00:33:10,100 --> 00:33:13,620 The patch base name is foopatch.o. 364 00:33:14,040 --> 00:33:16,280 The interpreter path is lib shiva. 365 00:33:16,440 --> 00:33:19,400 And the search path is opt shiva modules. 366 00:33:19,980 --> 00:33:22,740 And then we will rename it the same name. 367 00:33:23,720 --> 00:33:28,900 So if we were to look at the program segments of test foo. 368 00:33:29,040 --> 00:33:31,600 We can see that lib shiva is now the interpreter. 369 00:33:32,060 --> 00:33:34,200 We also see there is an extra load segment. 370 00:33:34,280 --> 00:33:36,700 And that is to make room for the new dynamic segment. 371 00:33:37,060 --> 00:33:38,940 So let's take a look at the dynamic segment. 372 00:33:39,140 --> 00:33:40,000 How it has been modified. 373 00:33:40,700 --> 00:33:43,300 So the dynamic segment is actually the same. 374 00:33:43,600 --> 00:33:46,160 Except it has three new entries at the bottom here. 375 00:33:46,300 --> 00:33:50,000 Which readelf hasn't been modified to print what these are. 376 00:33:50,140 --> 00:33:53,180 But this is the addresses to the patch base name. 377 00:33:53,300 --> 00:33:55,940 The address to the patch search path. 378 00:33:56,380 --> 00:34:00,000 And then the address to the path of the original interpreter. 379 00:34:00,180 --> 00:34:01,460 Which is ldlinux.so 380 00:34:01,460 --> 00:34:05,060 And we also have to move the patch. 381 00:34:05,260 --> 00:34:06,180 Or copy the patch. 382 00:34:06,900 --> 00:34:10,040 Into the opt shiva modules directory. 383 00:34:10,220 --> 00:34:12,700 Because that is the search path that we specified. 384 00:34:13,800 --> 00:34:14,840 So in any case. 385 00:34:14,880 --> 00:34:16,180 Now when we run test foo. 386 00:34:16,380 --> 00:34:18,360 It is patched every single time. 387 00:34:18,580 --> 00:34:20,480 Because of that metadata that has been installed. 388 00:34:20,800 --> 00:34:23,760 The only difference between test foo now and before. 389 00:34:23,980 --> 00:34:25,820 Is that the dynamic segment has been updated. 390 00:34:26,040 --> 00:34:28,840 And the ptinterf segment has been updated. 391 00:34:29,220 --> 00:34:29,680 And so. 392 00:34:29,680 --> 00:34:31,960 Another neat little feature. 393 00:34:32,120 --> 00:34:33,920 Is if you call shiva directly again. 394 00:34:33,980 --> 00:34:35,960 With the dash u flag on test foo. 395 00:34:36,320 --> 00:34:38,380 It will actually run test foo. 396 00:34:38,560 --> 00:34:41,240 And it will run it without installing all the patches. 397 00:34:41,920 --> 00:34:43,660 So that is kind of a neat feature. 398 00:34:45,340 --> 00:34:47,320 And next we are going to look at. 399 00:34:49,020 --> 00:34:50,920 Transformations with function splicing. 400 00:34:55,860 --> 00:34:56,560 Thank you. 401 00:34:56,660 --> 00:34:57,480 There is more. 402 00:35:00,520 --> 00:35:01,480 Thank you. 403 00:35:02,840 --> 00:35:04,860 Okay so I am going to try to demonstrate. 404 00:35:05,080 --> 00:35:08,320 Elf transformations as concisely as I can. 405 00:35:08,400 --> 00:35:09,020 In this example. 406 00:35:09,040 --> 00:35:10,960 With a program called testprog. 407 00:35:14,180 --> 00:35:16,960 So let's take a quick look at the original source code. 408 00:35:17,400 --> 00:35:19,280 So we have this function foo here. 409 00:35:19,960 --> 00:35:22,080 Foo is called down here in main. 410 00:35:22,980 --> 00:35:24,280 And foo says. 411 00:35:24,500 --> 00:35:26,820 If this first argument num is equal to 7. 412 00:35:27,020 --> 00:35:28,180 Then go to done. 413 00:35:29,040 --> 00:35:29,520 Otherwise. 414 00:35:29,520 --> 00:35:30,920 Copy banner. 415 00:35:31,160 --> 00:35:35,760 Which is this const pointer to this string elfmaster. 416 00:35:36,180 --> 00:35:37,820 Over into global buff. 417 00:35:38,080 --> 00:35:40,900 Global buff is a bss buffer. 418 00:35:41,300 --> 00:35:44,360 And then it prints the value of this argument string. 419 00:35:45,040 --> 00:35:46,180 And so. 420 00:35:46,700 --> 00:35:51,040 What we want to do here is actually overwrite this function. 421 00:35:51,460 --> 00:35:52,700 Called printf. 422 00:35:53,080 --> 00:35:57,420 With some code that first checks to see if str is equal to null. 423 00:35:57,680 --> 00:35:58,900 And if it is not. 424 00:35:58,900 --> 00:35:59,860 Then it will print it. 425 00:36:00,040 --> 00:36:00,980 And then also. 426 00:36:02,400 --> 00:36:03,720 We want our code. 427 00:36:03,840 --> 00:36:04,680 Our patch code. 428 00:36:04,800 --> 00:36:06,340 To print the value of global buff. 429 00:36:06,660 --> 00:36:07,180 And so. 430 00:36:07,260 --> 00:36:08,280 Let's take a look here. 431 00:36:08,540 --> 00:36:10,520 There is a number of things happening in this patch. 432 00:36:11,140 --> 00:36:13,040 So we are actually going to start at the bottom. 433 00:36:13,220 --> 00:36:13,820 So firstly. 434 00:36:14,720 --> 00:36:15,820 Over here on the left. 435 00:36:15,860 --> 00:36:16,580 In the original source. 436 00:36:16,820 --> 00:36:17,320 We have bar. 437 00:36:17,680 --> 00:36:18,920 And in our patch code. 438 00:36:19,040 --> 00:36:19,820 We rewrite bar. 439 00:36:20,060 --> 00:36:20,840 As we can see. 440 00:36:21,640 --> 00:36:23,380 It adds the value of. 441 00:36:23,620 --> 00:36:24,760 Two global variables. 442 00:36:25,060 --> 00:36:26,360 That were added in this patch. 443 00:36:26,540 --> 00:36:27,420 This data val. 444 00:36:27,840 --> 00:36:28,880 It adds the value of. 445 00:36:28,880 --> 00:36:30,240 The variables together. 446 00:36:30,320 --> 00:36:31,420 And then prints the sum. 447 00:36:32,320 --> 00:36:33,780 And then up here. 448 00:36:34,960 --> 00:36:37,260 So bar is being completely rewritten. 449 00:36:37,320 --> 00:36:38,360 With symbol interposition. 450 00:36:38,760 --> 00:36:39,860 And then moving up here. 451 00:36:39,940 --> 00:36:40,940 We have the actual. 452 00:36:42,600 --> 00:36:43,320 Splice code. 453 00:36:43,580 --> 00:36:44,340 The splice patch. 454 00:36:44,660 --> 00:36:45,380 This is how. 455 00:36:45,900 --> 00:36:46,720 Transformations work. 456 00:36:46,980 --> 00:36:48,700 When developing shiva patches. 457 00:36:49,240 --> 00:36:50,800 That need to splice code. 458 00:36:50,900 --> 00:36:52,040 Into an existing function. 459 00:36:52,520 --> 00:36:53,100 And so. 460 00:36:53,240 --> 00:36:54,800 This macro right here is used. 461 00:36:54,960 --> 00:36:57,340 So we are splicing into the function foo. 462 00:36:58,120 --> 00:36:58,640 The. 463 00:36:58,660 --> 00:36:58,860 Batch code. 464 00:36:58,860 --> 00:37:00,520 The address to start patching at. 465 00:37:00,600 --> 00:37:01,140 Is 818. 466 00:37:01,860 --> 00:37:03,440 And the stop address. 467 00:37:03,800 --> 00:37:04,100 Is. 468 00:37:04,960 --> 00:37:05,440 828. 469 00:37:06,140 --> 00:37:06,880 And so. 470 00:37:07,020 --> 00:37:08,240 Coming down into the actual. 471 00:37:08,320 --> 00:37:08,920 Splice code. 472 00:37:10,060 --> 00:37:11,460 Let's start right here. 473 00:37:11,660 --> 00:37:13,880 We have if str is not equal to null. 474 00:37:14,720 --> 00:37:16,040 Then print the string. 475 00:37:16,340 --> 00:37:17,480 And if you notice. 476 00:37:17,520 --> 00:37:18,620 We are using fprintf. 477 00:37:18,740 --> 00:37:19,940 Instead of printf. 478 00:37:20,080 --> 00:37:21,200 Which was in the original program. 479 00:37:21,400 --> 00:37:21,880 And this is again. 480 00:37:21,940 --> 00:37:22,680 Just illustrating. 481 00:37:22,920 --> 00:37:24,460 Strong global symbol resolution. 482 00:37:24,940 --> 00:37:26,180 And then after that. 483 00:37:26,260 --> 00:37:27,480 We use fprintf. 484 00:37:27,500 --> 00:37:28,360 To print the value. 485 00:37:28,420 --> 00:37:28,840 Of global variables. 486 00:37:28,840 --> 00:37:28,980 So we have global. 487 00:37:28,980 --> 00:37:29,060 Buff. 488 00:37:29,760 --> 00:37:30,640 Which illustrates. 489 00:37:30,700 --> 00:37:31,640 Our patch. 490 00:37:31,900 --> 00:37:32,740 Ability to. 491 00:37:32,820 --> 00:37:33,600 Use the extern. 492 00:37:33,820 --> 00:37:34,220 Keyword. 493 00:37:34,460 --> 00:37:35,820 So you were using the extern. 494 00:37:35,960 --> 00:37:36,280 Keyword. 495 00:37:36,360 --> 00:37:37,140 To get a hold of global. 496 00:37:37,320 --> 00:37:37,660 Buff. 497 00:37:38,320 --> 00:37:39,020 Which is. 498 00:37:39,140 --> 00:37:39,860 A global variable. 499 00:37:39,960 --> 00:37:40,560 From the program. 500 00:37:40,720 --> 00:37:41,640 That we are patching. 501 00:37:41,920 --> 00:37:42,640 And so. 502 00:37:43,100 --> 00:37:43,800 After that. 503 00:37:43,880 --> 00:37:44,240 We call. 504 00:37:44,340 --> 00:37:44,660 Bar. 505 00:37:44,880 --> 00:37:46,200 And this is illustrating. 506 00:37:46,240 --> 00:37:47,200 How our patch code. 507 00:37:47,560 --> 00:37:48,360 Will link. 508 00:37:48,420 --> 00:37:49,380 To the new function. 509 00:37:49,460 --> 00:37:49,780 Bar. 510 00:37:50,620 --> 00:37:52,260 Instead of the original function. 511 00:37:52,400 --> 00:37:52,680 Bar. 512 00:37:53,100 --> 00:37:54,140 And when main. 513 00:37:54,300 --> 00:37:54,740 Calls. 514 00:37:54,740 --> 00:37:55,040 Bar. 515 00:37:55,040 --> 00:37:56,500 It will also link to our new function. 516 00:37:58,840 --> 00:37:58,960 So. 517 00:37:58,980 --> 00:37:59,960 Back up to this. 518 00:38:00,480 --> 00:38:00,920 Transformation. 519 00:38:01,080 --> 00:38:01,520 Macro. 520 00:38:02,400 --> 00:38:03,460 We want to patch. 521 00:38:03,480 --> 00:38:03,920 818. 522 00:38:04,200 --> 00:38:04,600 Let's. 523 00:38:04,600 --> 00:38:05,360 Take a quick look. 524 00:38:05,420 --> 00:38:05,700 At why. 525 00:38:05,880 --> 00:38:06,180 So. 526 00:38:06,300 --> 00:38:07,320 We'll look at the program. 527 00:38:08,920 --> 00:38:09,360 Assembly. 528 00:38:09,560 --> 00:38:10,180 Down here. 529 00:38:10,200 --> 00:38:10,560 At function. 530 00:38:10,660 --> 00:38:11,020 Foo. 531 00:38:11,740 --> 00:38:12,820 We're going to be patching. 532 00:38:12,820 --> 00:38:13,320 From here. 533 00:38:14,380 --> 00:38:15,120 To here. 534 00:38:16,160 --> 00:38:16,600 Actually. 535 00:38:16,660 --> 00:38:17,300 To right here. 536 00:38:17,500 --> 00:38:18,540 So our start address. 537 00:38:18,640 --> 00:38:19,200 Is 818. 538 00:38:19,700 --> 00:38:20,480 And the last. 539 00:38:21,080 --> 00:38:21,520 Address. 540 00:38:21,580 --> 00:38:21,980 That we patch. 541 00:38:22,100 --> 00:38:22,680 Is 824. 542 00:38:23,720 --> 00:38:25,140 Which makes our stop address. 543 00:38:25,360 --> 00:38:25,800 828. 544 00:38:26,180 --> 00:38:26,620 And. 545 00:38:27,040 --> 00:38:27,480 828. 546 00:38:28,840 --> 00:38:29,080 Is the. 547 00:38:29,080 --> 00:38:29,460 After it. 548 00:38:29,580 --> 00:38:31,040 Will be shifted forward. 549 00:38:31,220 --> 00:38:31,880 As needed. 550 00:38:31,940 --> 00:38:32,880 Based on the size. 551 00:38:33,100 --> 00:38:34,500 Of the code being spliced in. 552 00:38:34,600 --> 00:38:35,140 And in our case. 553 00:38:35,180 --> 00:38:35,740 We're splicing. 554 00:38:35,960 --> 00:38:37,680 A larger amount of code in. 555 00:38:38,620 --> 00:38:39,060 To. 556 00:38:39,140 --> 00:38:39,620 Let's just. 557 00:38:40,040 --> 00:38:40,940 Build our patch. 558 00:38:41,100 --> 00:38:41,560 Real quickly. 559 00:38:41,960 --> 00:38:43,840 And now we have a relocatable object. 560 00:38:43,940 --> 00:38:44,480 Called patch. 561 00:38:44,600 --> 00:38:44,860 O. 562 00:38:45,320 --> 00:38:46,620 These are the relocations. 563 00:38:46,620 --> 00:38:47,140 For it. 564 00:38:47,480 --> 00:38:47,920 And. 565 00:38:48,000 --> 00:38:48,640 If we look at. 566 00:38:49,080 --> 00:38:50,240 Use object dump. 567 00:38:52,600 --> 00:38:53,440 You can see. 568 00:38:53,520 --> 00:38:54,660 This is the splice code. 569 00:38:54,880 --> 00:38:55,200 This. 570 00:38:55,500 --> 00:38:56,340 Whole function. 571 00:38:56,380 --> 00:38:56,840 Right here. 572 00:38:57,420 --> 00:38:57,860 And. 573 00:38:58,840 --> 00:39:00,000 Is a special symbol name. 574 00:39:00,100 --> 00:39:01,420 Called Shiva splice. 575 00:39:01,420 --> 00:39:02,080 FN name. 576 00:39:02,320 --> 00:39:03,160 And then the function. 577 00:39:03,420 --> 00:39:04,280 That's being spliced. 578 00:39:04,280 --> 00:39:04,680 Is foo. 579 00:39:04,900 --> 00:39:06,000 This directs Shiva. 580 00:39:06,220 --> 00:39:06,980 To use the. 581 00:39:07,020 --> 00:39:07,760 Function splicing. 582 00:39:07,840 --> 00:39:08,320 Capabilities. 583 00:39:08,760 --> 00:39:09,380 And so. 584 00:39:09,440 --> 00:39:10,000 Shiva will. 585 00:39:11,300 --> 00:39:11,780 Splice. 586 00:39:12,220 --> 00:39:13,100 All of this. 587 00:39:13,180 --> 00:39:13,640 Code in. 588 00:39:13,800 --> 00:39:15,280 The procedure prologue. 589 00:39:15,300 --> 00:39:15,880 And epilogue. 590 00:39:16,140 --> 00:39:17,020 Won't be included. 591 00:39:17,440 --> 00:39:18,580 All of this code. 592 00:39:18,740 --> 00:39:19,140 Will be. 593 00:39:19,380 --> 00:39:19,860 Relocated. 594 00:39:20,100 --> 00:39:20,580 And. 595 00:39:22,360 --> 00:39:22,840 Transformed. 596 00:39:22,860 --> 00:39:23,300 Essentially. 597 00:39:23,560 --> 00:39:24,180 It will be. 598 00:39:24,500 --> 00:39:24,980 Inserted. 599 00:39:25,000 --> 00:39:25,700 And spliced. 600 00:39:25,740 --> 00:39:26,880 Into the function foo. 601 00:39:27,780 --> 00:39:28,260 Again. 602 00:39:28,840 --> 00:39:29,020 Into. 603 00:39:30,060 --> 00:39:30,860 This location. 604 00:39:30,860 --> 00:39:31,440 Right here. 605 00:39:31,560 --> 00:39:31,780 So. 606 00:39:31,860 --> 00:39:32,320 We're actually adding. 607 00:39:32,420 --> 00:39:33,200 Quite a bit of code. 608 00:39:33,820 --> 00:39:34,220 And. 609 00:39:35,980 --> 00:39:36,380 So. 610 00:39:36,520 --> 00:39:36,800 This will. 611 00:39:38,280 --> 00:39:38,680 Rewrite. 612 00:39:38,720 --> 00:39:39,140 The entire. 613 00:39:39,400 --> 00:39:40,120 Function foo. 614 00:39:40,220 --> 00:39:40,960 It will actually be. 615 00:39:41,020 --> 00:39:41,420 Rewritten. 616 00:39:41,420 --> 00:39:41,920 From scratch. 617 00:39:42,180 --> 00:39:42,960 In a different area. 618 00:39:43,140 --> 00:39:43,560 In memory. 619 00:39:44,000 --> 00:39:45,140 And the reason that. 620 00:39:45,800 --> 00:39:46,900 In the source code. 621 00:39:47,200 --> 00:39:48,120 I included this. 622 00:39:48,180 --> 00:39:48,640 If num. 623 00:39:48,740 --> 00:39:49,460 Is equal to seven. 624 00:39:49,580 --> 00:39:49,860 Go to. 625 00:39:49,960 --> 00:39:50,220 Done. 626 00:39:50,560 --> 00:39:51,440 Is to illustrate. 627 00:39:51,920 --> 00:39:52,260 How. 628 00:39:52,580 --> 00:39:53,640 It will have to be. 629 00:39:53,680 --> 00:39:54,380 The assembly code. 630 00:39:54,480 --> 00:39:54,680 For that. 631 00:39:54,680 --> 00:39:55,180 Will have to be. 632 00:39:55,500 --> 00:39:55,980 Relinked. 633 00:39:56,200 --> 00:39:57,220 In the binary. 634 00:39:57,380 --> 00:39:57,560 Or. 635 00:39:57,620 --> 00:39:58,160 In memory. 636 00:39:58,380 --> 00:39:59,700 Once our patch code. 637 00:40:00,020 --> 00:40:00,920 Is inserted. 638 00:40:01,180 --> 00:40:01,500 Here. 639 00:40:02,020 --> 00:40:03,080 Because the patch code. 640 00:40:03,160 --> 00:40:03,720 Is much larger. 641 00:40:04,020 --> 00:40:04,340 And so. 642 00:40:04,420 --> 00:40:05,480 For this to jump down. 643 00:40:05,540 --> 00:40:05,960 To done. 644 00:40:06,320 --> 00:40:07,400 The offsets. 645 00:40:07,400 --> 00:40:07,800 Will change. 646 00:40:07,960 --> 00:40:08,340 So this. 647 00:40:08,760 --> 00:40:09,240 Also. 648 00:40:09,640 --> 00:40:10,500 Patching this program. 649 00:40:10,600 --> 00:40:11,060 Also illustrates. 650 00:40:11,440 --> 00:40:12,060 Shiva's ability. 651 00:40:12,340 --> 00:40:12,680 To. 652 00:40:13,540 --> 00:40:14,020 Relink. 653 00:40:14,600 --> 00:40:15,080 The. 654 00:40:15,740 --> 00:40:16,220 Executable. 655 00:40:16,360 --> 00:40:16,960 As needed. 656 00:40:17,220 --> 00:40:18,340 When the patch code. 657 00:40:18,860 --> 00:40:19,760 Extends the size. 658 00:40:19,800 --> 00:40:20,340 Of the function. 659 00:40:21,000 --> 00:40:21,480 And. 660 00:40:21,480 --> 00:40:22,160 This works. 661 00:40:22,240 --> 00:40:22,720 By Shiva. 662 00:40:23,180 --> 00:40:23,520 Generating. 663 00:40:23,520 --> 00:40:24,060 On the fly. 664 00:40:24,520 --> 00:40:24,860 Relocations. 665 00:40:25,000 --> 00:40:26,140 For the executable. 666 00:40:26,220 --> 00:40:26,680 By looking. 667 00:40:26,780 --> 00:40:27,180 At a control. 668 00:40:27,280 --> 00:40:27,700 Flow graph. 669 00:40:28,480 --> 00:40:29,060 And so. 670 00:40:29,260 --> 00:40:29,600 Anyhow. 671 00:40:29,640 --> 00:40:30,160 Let's just try. 672 00:40:30,240 --> 00:40:30,520 To install. 673 00:40:30,600 --> 00:40:31,000 This patch. 674 00:40:31,220 --> 00:40:31,380 And. 675 00:40:31,480 --> 00:40:32,000 See how. 676 00:40:32,120 --> 00:40:32,460 It works. 677 00:40:32,500 --> 00:40:32,840 So. 678 00:40:33,320 --> 00:40:33,660 Again. 679 00:40:34,680 --> 00:40:35,020 Test. 680 00:40:35,140 --> 00:40:35,400 Prob. 681 00:40:35,540 --> 00:40:35,820 Looks. 682 00:40:35,860 --> 00:40:36,020 Like. 683 00:40:36,020 --> 00:40:36,200 This. 684 00:40:36,200 --> 00:40:36,320 When. 685 00:40:36,400 --> 00:40:36,460 We. 686 00:40:36,500 --> 00:40:36,700 Run. 687 00:40:36,700 --> 00:40:36,820 It. 688 00:40:37,200 --> 00:40:37,540 Now. 689 00:40:37,600 --> 00:40:37,780 Let's. 690 00:40:51,480 --> 00:40:51,720 Run. 691 00:40:52,220 --> 00:40:52,520 Execute. 692 00:40:52,520 --> 00:40:52,740 Test. 693 00:40:52,760 --> 00:40:53,060 Proc. 694 00:40:53,620 --> 00:40:53,920 Now. 695 00:40:54,040 --> 00:40:54,180 We. 696 00:40:54,200 --> 00:40:54,400 See. 697 00:40:54,540 --> 00:40:54,760 It's. 698 00:40:54,860 --> 00:40:55,140 Working. 699 00:40:55,860 --> 00:40:56,160 As. 700 00:40:56,400 --> 00:40:56,700 Expected. 701 00:40:56,740 --> 00:40:56,920 It. 702 00:40:56,960 --> 00:40:57,180 Only. 703 00:40:57,300 --> 00:40:57,600 Prints. 704 00:40:58,300 --> 00:40:58,600 The. 705 00:40:58,740 --> 00:40:59,040 Argument. 706 00:40:59,100 --> 00:40:59,240 We. 707 00:40:59,260 --> 00:40:59,500 Pass. 708 00:40:59,500 --> 00:40:59,700 It. 709 00:40:59,720 --> 00:40:59,880 When. 710 00:41:00,000 --> 00:41:00,060 We. 711 00:41:00,080 --> 00:41:00,280 Actually. 712 00:41:00,360 --> 00:41:00,620 Pass. 713 00:41:00,660 --> 00:41:00,780 It. 714 00:41:00,840 --> 00:41:00,880 In. 715 00:41:01,000 --> 00:41:01,300 Argument. 716 00:41:03,840 --> 00:41:04,140 See. 717 00:41:05,160 --> 00:41:05,460 And. 718 00:41:05,460 --> 00:41:05,620 If. 719 00:41:05,900 --> 00:41:06,140 We. 720 00:41:06,820 --> 00:41:07,060 Don't. 721 00:41:07,140 --> 00:41:07,360 Pass. 722 00:41:07,360 --> 00:41:07,500 It. 723 00:41:07,580 --> 00:41:07,620 In. 724 00:41:07,760 --> 00:41:08,000 Argument. 725 00:41:10,240 --> 00:41:10,480 Doesn't. 726 00:41:10,940 --> 00:41:11,180 And. 727 00:41:11,260 --> 00:41:11,320 If. 728 00:41:11,440 --> 00:41:11,500 We. 729 00:41:11,520 --> 00:41:11,680 Put. 730 00:41:12,000 --> 00:41:12,240 Seven. 731 00:41:12,600 --> 00:41:12,840 Arguments. 732 00:41:15,540 --> 00:41:15,780 It. 733 00:41:15,880 --> 00:41:16,060 Jumps. 734 00:41:16,120 --> 00:41:16,260 Right. 735 00:41:16,360 --> 00:41:16,580 Down. 736 00:41:16,660 --> 00:41:16,760 To. 737 00:41:16,900 --> 00:41:17,140 Done. 738 00:41:17,660 --> 00:41:17,900 And. 739 00:41:18,060 --> 00:41:18,300 Doesn't. 740 00:41:18,300 --> 00:41:18,480 Print. 741 00:41:19,320 --> 00:41:19,560 Doesn't. 742 00:41:19,580 --> 00:41:19,640 Do. 743 00:41:19,760 --> 00:41:19,840 Any. 744 00:41:19,940 --> 00:41:20,020 Of. 745 00:41:20,060 --> 00:41:20,120 The. 746 00:41:20,180 --> 00:41:20,260 Other. 747 00:41:20,260 --> 00:41:20,480 Stuff. 748 00:41:20,640 --> 00:41:20,780 That. 749 00:41:20,820 --> 00:41:20,840 It. 750 00:41:20,880 --> 00:41:20,980 Was. 751 00:41:21,000 --> 00:41:21,140 Doing. 752 00:41:21,160 --> 00:41:21,300 So. 753 00:41:21,420 --> 00:41:21,480 It's. 754 00:41:21,820 --> 00:41:22,060 Actually. 755 00:41:22,160 --> 00:41:22,400 Working. 756 00:41:22,660 --> 00:41:22,900 Exactly. 757 00:41:23,140 --> 00:41:23,380 How. 758 00:41:23,520 --> 00:41:23,640 We. 759 00:41:23,820 --> 00:41:24,060 Modified. 760 00:41:24,080 --> 00:41:24,240 The. 761 00:41:24,260 --> 00:41:24,460 Program. 762 00:41:24,600 --> 00:41:24,720 To. 763 00:41:24,880 --> 00:41:25,120 Behave. 764 00:41:25,540 --> 00:41:25,780 Now. 765 00:41:25,940 --> 00:41:26,180 Again. 766 00:41:26,560 --> 00:41:26,800 If. 767 00:41:26,900 --> 00:41:26,960 We. 768 00:41:27,020 --> 00:41:27,140 Run. 769 00:41:27,240 --> 00:41:27,460 Test. 770 00:41:27,620 --> 00:41:27,860 Prog. 771 00:41:27,860 --> 00:41:28,040 Without. 772 00:41:28,140 --> 00:41:28,380 Shiva. 773 00:41:28,560 --> 00:41:28,800 Still. 774 00:41:28,940 --> 00:41:29,160 Does. 775 00:41:29,220 --> 00:41:29,340 The. 776 00:41:29,340 --> 00:41:29,460 Same. 777 00:41:29,560 --> 00:41:29,740 Old. 778 00:41:29,820 --> 00:41:30,100 Behavior. 779 00:41:30,880 --> 00:41:31,160 If. 780 00:41:31,480 --> 00:41:31,520 Want. 781 00:41:31,600 --> 00:41:31,780 To. 782 00:41:31,800 --> 00:41:32,020 Link. 783 00:41:32,300 --> 00:41:32,580 The. 784 00:41:32,620 --> 00:41:32,860 Program. 785 00:41:33,260 --> 00:41:33,540 Permanently. 786 00:41:33,660 --> 00:41:33,880 Then. 787 00:41:33,960 --> 00:41:34,040 We. 788 00:41:34,120 --> 00:41:34,220 Use. 789 00:41:34,260 --> 00:41:34,340 The. 790 00:41:34,500 --> 00:41:34,560 Shiva. 791 00:41:34,620 --> 00:41:34,760 Pre. 792 00:41:34,900 --> 00:41:35,180 Linker. 793 00:41:35,180 --> 00:41:35,400 As. 794 00:41:35,740 --> 00:41:36,020 Demonstrated. 795 00:41:36,060 --> 00:41:36,300 Before. 796 00:41:41,380 --> 00:41:41,660 Shiva. 797 00:41:41,800 --> 00:41:41,920 Is. 798 00:41:41,980 --> 00:41:42,060 The. 799 00:41:42,320 --> 00:41:42,600 Interpreter. 800 00:41:42,640 --> 00:41:42,900 Search. 801 00:41:43,060 --> 00:41:43,320 Path. 802 00:41:43,400 --> 00:41:43,580 Is. 803 00:41:43,580 --> 00:41:43,740 Off. 804 00:41:43,800 --> 00:41:44,080 Shiva. 805 00:41:59,480 --> 00:41:59,540 The. 806 00:41:59,620 --> 00:41:59,800 Program. 807 00:42:00,200 --> 00:42:00,520 Directly. 808 00:42:02,400 --> 00:42:02,720 It. 809 00:42:02,840 --> 00:42:03,040 Works. 810 00:42:03,060 --> 00:42:03,260 Every. 811 00:42:03,340 --> 00:42:03,580 Time. 812 00:42:03,600 --> 00:42:03,740 It's. 813 00:42:03,820 --> 00:42:04,140 Patched. 814 00:42:04,840 --> 00:42:05,160 And. 815 00:42:05,500 --> 00:42:05,820 Again. 816 00:42:05,980 --> 00:42:06,220 The. 817 00:42:06,460 --> 00:42:06,780 Program's. 818 00:42:07,200 --> 00:42:07,520 Metadata. 819 00:42:07,780 --> 00:42:07,960 Has. 820 00:42:08,020 --> 00:42:08,120 Been. 821 00:42:08,380 --> 00:42:08,700 Modified. 822 00:42:09,680 --> 00:42:10,000 We. 823 00:42:10,200 --> 00:42:10,520 See. 824 00:42:10,560 --> 00:42:10,880 That. 825 00:42:10,880 --> 00:42:11,120 Shiva. 826 00:42:11,220 --> 00:42:11,360 Is. 827 00:42:11,380 --> 00:42:11,460 The. 828 00:42:11,640 --> 00:42:11,960 Interpreter. 829 00:42:12,220 --> 00:42:12,540 Etc. 830 00:42:15,140 --> 00:42:15,460 So. 831 00:42:15,520 --> 00:42:15,740 That. 832 00:42:15,740 --> 00:42:15,900 Is. 833 00:42:29,560 --> 00:42:29,800 What. 834 00:42:30,500 --> 00:42:30,680 Happened. 835 00:42:30,720 --> 00:42:30,780 To. 836 00:42:31,180 --> 00:42:31,420 Slides. 837 00:42:31,440 --> 00:42:31,660 There. 838 00:42:34,200 --> 00:42:34,440 So. 839 00:42:36,220 --> 00:42:36,460 Just. 840 00:42:36,580 --> 00:42:36,760 I. 841 00:42:36,840 --> 00:42:36,860 Got. 842 00:42:36,940 --> 00:42:37,000 A. 843 00:42:37,040 --> 00:42:37,120 Couple. 844 00:42:37,240 --> 00:42:37,480 Minutes. 845 00:42:37,540 --> 00:42:37,680 Left. 846 00:42:37,740 --> 00:42:37,900 Here. 847 00:42:37,940 --> 00:42:38,060 Let. 848 00:42:38,140 --> 00:42:38,200 Me. 849 00:42:38,200 --> 00:42:38,380 Pop. 850 00:42:38,480 --> 00:42:38,640 The. 851 00:42:38,860 --> 00:42:39,100 Slides. 852 00:42:39,100 --> 00:42:39,320 Back. 853 00:42:39,420 --> 00:42:39,660 Up. 854 00:42:41,220 --> 00:42:41,460 And. 855 00:42:43,960 --> 00:42:44,200 Not. 856 00:42:44,820 --> 00:42:45,060 Real. 857 00:42:45,160 --> 00:42:45,400 Familiar. 858 00:42:45,460 --> 00:42:45,600 With. 859 00:42:45,700 --> 00:42:45,940 Adobe. 860 00:42:46,460 --> 00:42:46,700 But. 861 00:42:46,700 --> 00:42:46,800 Whatever. 862 00:42:51,420 --> 00:42:51,700 Let's. 863 00:42:51,780 --> 00:42:51,880 See. 864 00:42:52,040 --> 00:42:52,160 Here. 865 00:42:59,880 --> 00:43:00,160 Sorry. 866 00:43:04,300 --> 00:43:04,580 I. 867 00:43:04,620 --> 00:43:04,760 Don't. 868 00:43:04,840 --> 00:43:04,940 Know. 869 00:43:06,800 --> 00:43:07,080 Yeah. 870 00:43:07,200 --> 00:43:07,360 Let. 871 00:43:07,460 --> 00:43:07,560 Me. 872 00:43:08,020 --> 00:43:08,300 Good. 873 00:43:08,480 --> 00:43:08,660 Idea. 874 00:43:11,120 --> 00:43:11,400 That's. 875 00:43:11,420 --> 00:43:11,700 Still. 876 00:43:12,240 --> 00:43:12,520 That's. 877 00:43:12,780 --> 00:43:13,060 Well. 878 00:43:13,180 --> 00:43:13,280 There. 879 00:43:13,380 --> 00:43:13,520 Really. 880 00:43:13,620 --> 00:43:13,900 Wasn't. 881 00:43:13,960 --> 00:43:14,180 There's. 882 00:43:14,300 --> 00:43:14,580 One. 883 00:43:14,740 --> 00:43:15,020 Last. 884 00:43:15,200 --> 00:43:15,480 Slide. 885 00:43:15,540 --> 00:43:15,740 Here. 886 00:43:15,760 --> 00:43:15,880 Give. 887 00:43:15,960 --> 00:43:16,000 Me. 888 00:43:16,000 --> 00:43:16,100 Just. 889 00:43:16,800 --> 00:43:16,900 Um. 890 00:43:24,760 --> 00:43:25,200 What's. 891 00:43:28,060 --> 00:43:28,500 Control. 892 00:43:28,700 --> 00:43:28,920 L. 893 00:43:30,220 --> 00:43:30,660 Hmm. 894 00:43:33,980 --> 00:43:34,420 Well. 895 00:43:35,960 --> 00:43:36,400 Yes. 896 00:43:36,540 --> 00:43:36,760 Thank. 897 00:43:36,920 --> 00:43:37,040 You. 898 00:43:40,320 --> 00:43:40,760 Look. 899 00:43:41,080 --> 00:43:41,200 Me. 900 00:43:41,240 --> 00:43:41,580 Here. 901 00:43:41,600 --> 00:43:41,700 I. 902 00:43:41,760 --> 00:43:41,880 Am. 903 00:43:43,340 --> 00:43:43,780 Thank. 904 00:43:45,460 --> 00:43:45,900 You. 905 00:43:48,860 --> 00:43:49,060 Okay. 906 00:43:49,240 --> 00:43:49,440 This. 907 00:43:49,540 --> 00:43:49,560 Is. 908 00:43:49,840 --> 00:43:50,040 Last. 909 00:43:50,420 --> 00:43:50,620 Slide. 910 00:43:51,640 --> 00:43:51,840 That. 911 00:43:52,080 --> 00:43:52,100 I. 912 00:43:52,180 --> 00:43:52,200 Would. 913 00:43:52,300 --> 00:43:52,420 Like. 914 00:43:52,440 --> 00:43:52,560 To. 915 00:43:52,600 --> 00:43:52,800 Just. 916 00:43:52,860 --> 00:43:53,000 Leave. 917 00:43:53,080 --> 00:43:53,220 Up. 918 00:43:53,260 --> 00:43:53,360 For. 919 00:43:53,420 --> 00:43:53,460 A. 920 00:43:53,580 --> 00:43:53,680 Moment. 921 00:43:53,760 --> 00:43:53,900 If. 922 00:44:01,200 --> 00:44:01,400 So. 923 00:44:01,560 --> 00:44:01,740 I. 924 00:44:01,820 --> 00:44:01,880 Guess. 925 00:44:01,920 --> 00:44:01,960 You. 926 00:44:01,980 --> 00:44:02,040 Can. 927 00:44:02,260 --> 00:44:02,460 Specify. 928 00:44:02,500 --> 00:44:02,640 The. 929 00:44:02,640 --> 00:44:02,720 Slide. 930 00:44:02,940 --> 00:44:02,980 To. 931 00:44:03,080 --> 00:44:03,240 I. 932 00:44:03,300 --> 00:44:03,340 Think. 933 00:44:03,380 --> 00:44:03,520 It's. 934 00:44:03,580 --> 00:44:03,700 Like. 935 00:44:03,760 --> 00:44:03,920 Slide. 936 00:44:04,200 --> 00:44:04,380 51. 937 00:44:05,160 --> 00:44:05,340 That. 938 00:44:05,820 --> 00:44:06,000 I'm. 939 00:44:06,040 --> 00:44:06,160 Looking. 940 00:44:06,280 --> 00:44:06,460 For. 941 00:44:09,880 --> 00:44:10,060 Ah. 942 00:44:10,240 --> 00:44:10,400 There. 943 00:44:10,460 --> 00:44:10,540 You. 944 00:44:10,600 --> 00:44:10,720 Go. 945 00:44:10,740 --> 00:44:10,920 Okay. 946 00:44:10,940 --> 00:44:11,080 Up. 947 00:44:11,240 --> 00:44:11,420 Until. 948 00:44:12,940 --> 00:44:13,120 If. 949 00:44:14,280 --> 00:44:14,420 Close. 950 00:44:14,560 --> 00:44:14,640 Your. 951 00:44:14,660 --> 00:44:14,800 Eyes. 952 00:44:14,840 --> 00:44:14,940 I. 953 00:44:14,960 --> 00:44:15,000 Don't. 954 00:44:15,040 --> 00:44:15,120 Want. 955 00:44:15,120 --> 00:44:15,140 To. 956 00:44:15,200 --> 00:44:15,340 Close. 957 00:44:15,340 --> 00:44:15,400 Any. 958 00:44:15,660 --> 00:44:15,820 Seizures. 959 00:44:18,900 --> 00:44:19,060 All. 960 00:44:19,240 --> 00:44:19,360 Right. 961 00:44:19,820 --> 00:44:19,980 Thank. 962 00:44:20,080 --> 00:44:20,240 You. 963 00:44:20,360 --> 00:44:20,520 So. 964 00:44:20,780 --> 00:44:20,940 First. 965 00:44:21,020 --> 00:44:21,120 I. 966 00:44:21,200 --> 00:44:21,240 Just. 967 00:44:21,420 --> 00:44:21,480 To. 968 00:44:21,740 --> 00:44:21,900 Thank. 969 00:44:21,920 --> 00:44:22,020 You. 970 00:44:22,060 --> 00:44:22,180 To. 971 00:44:22,240 --> 00:44:22,280 My. 972 00:44:22,340 --> 00:44:22,440 Son. 973 00:44:22,700 --> 00:44:22,860 Jaden. 974 00:44:22,920 --> 00:44:23,000 For. 975 00:44:23,100 --> 00:44:23,200 Helping. 976 00:44:23,240 --> 00:44:23,320 Me. 977 00:44:23,340 --> 00:44:23,400 With. 978 00:44:23,440 --> 00:44:23,500 The. 979 00:44:23,620 --> 00:44:23,780 Video. 980 00:44:23,980 --> 00:44:24,140 Editing. 981 00:44:24,200 --> 00:44:24,360 It's. 982 00:44:24,400 --> 00:44:24,440 Not. 983 00:44:24,540 --> 00:44:24,620 My. 984 00:44:24,620 --> 00:44:24,740 Strong. 985 00:44:24,940 --> 00:44:25,140 Suit. 986 00:44:25,440 --> 00:44:25,640 For. 987 00:44:25,760 --> 00:44:25,840 The. 988 00:44:25,940 --> 00:44:26,140 Demo. 989 00:44:26,220 --> 00:44:26,420 Thank. 990 00:44:26,500 --> 00:44:26,560 You. 991 00:44:26,640 --> 00:44:26,840 Jaden. 992 00:44:28,040 --> 00:44:28,240 Appreciate. 993 00:44:28,460 --> 00:44:28,660 That. 994 00:44:29,340 --> 00:44:29,540 Gamer. 995 00:44:29,740 --> 00:44:29,940 Tries. 996 00:44:29,980 --> 00:44:30,180 On. 997 00:44:30,260 --> 00:44:30,460 YouTube. 998 00:44:31,220 --> 00:44:31,420 And. 999 00:44:31,540 --> 00:44:31,560 I. 1000 00:44:31,640 --> 00:44:31,660 Want. 1001 00:44:31,740 --> 00:44:31,760 To. 1002 00:44:31,940 --> 00:44:32,100 Thank. 1003 00:44:32,120 --> 00:44:32,200 You. 1004 00:44:32,200 --> 00:44:32,280 To. 1005 00:44:32,300 --> 00:44:32,340 My. 1006 00:44:32,460 --> 00:44:32,660 Wife. 1007 00:44:32,720 --> 00:44:32,920 Teresa. 1008 00:44:33,040 --> 00:44:33,360 O'Neill. 1009 00:44:33,500 --> 00:44:33,700 For. 1010 00:44:33,760 --> 00:44:33,900 Being. 1011 00:44:33,940 --> 00:44:34,120 Such. 1012 00:44:34,420 --> 00:44:34,660 Powerhouse. 1013 00:44:34,800 --> 00:44:35,000 Behind. 1014 00:44:35,080 --> 00:44:35,260 Me. 1015 00:44:36,500 --> 00:44:36,740 Thank. 1016 00:44:36,860 --> 00:44:36,920 You. 1017 00:44:36,960 --> 00:44:37,100 Honey. 1018 00:44:37,340 --> 00:44:37,580 And. 1019 00:44:37,660 --> 00:44:37,780 My. 1020 00:44:37,900 --> 00:44:38,140 Mother. 1021 00:44:38,460 --> 00:44:38,700 My. 1022 00:44:38,840 --> 00:44:39,020 Mother. 1023 00:44:39,040 --> 00:44:39,240 Bought. 1024 00:44:39,320 --> 00:44:39,400 Me. 1025 00:44:39,400 --> 00:44:39,600 Every. 1026 00:44:39,660 --> 00:44:39,860 Book. 1027 00:44:40,020 --> 00:44:40,260 By. 1028 00:44:40,900 --> 00:44:41,140 What's. 1029 00:44:41,200 --> 00:44:41,240 His. 1030 00:44:41,340 --> 00:44:41,500 Name. 1031 00:44:41,780 --> 00:44:42,020 Richard. 1032 00:44:42,540 --> 00:44:42,780 Stevenson. 1033 00:44:43,020 --> 00:44:43,260 By. 1034 00:44:43,360 --> 00:44:43,380 The. 1035 00:44:43,480 --> 00:44:43,500 Time. 1036 00:44:43,560 --> 00:44:43,600 I. 1037 00:44:43,660 --> 00:44:43,680 Was. 1038 00:44:43,960 --> 00:44:44,200 On. 1039 00:44:46,160 --> 00:44:46,400 It. 1040 00:44:46,740 --> 00:44:46,940 She. 1041 00:44:47,060 --> 00:44:47,160 Was. 1042 00:44:47,500 --> 00:44:47,580 It. 1043 00:44:47,620 --> 00:44:47,780 To. 1044 00:44:47,820 --> 00:44:47,900 Help. 1045 00:44:48,000 --> 00:44:48,140 Me. 1046 00:44:48,180 --> 00:44:48,380 Get. 1047 00:44:48,800 --> 00:44:49,000 Educated. 1048 00:44:49,020 --> 00:44:49,140 On. 1049 00:44:49,180 --> 00:44:49,300 What. 1050 00:44:49,340 --> 00:44:49,380 I. 1051 00:44:49,500 --> 00:44:49,600 Wanted. 1052 00:44:49,640 --> 00:44:49,720 To. 1053 00:44:49,740 --> 00:44:49,880 Learn. 1054 00:44:50,020 --> 00:44:50,220 So. 1055 00:44:50,260 --> 00:44:50,460 Thanks. 1056 00:44:50,460 --> 00:44:50,580 Mom. 1057 00:44:50,880 --> 00:44:51,080 Love. 1058 00:44:51,160 --> 00:44:51,240 You. 1059 00:44:51,900 --> 00:44:52,100 And. 1060 00:44:52,300 --> 00:44:52,500 Thanks. 1061 00:44:52,540 --> 00:44:52,640 To. 1062 00:44:52,660 --> 00:44:52,740 My. 1063 00:44:52,820 --> 00:44:52,920 Son. 1064 00:44:53,020 --> 00:44:53,220 Mick. 1065 00:44:53,280 --> 00:44:53,400 For. 1066 00:44:53,440 --> 00:44:53,580 Being. 1067 00:45:05,920 --> 00:45:06,120 Here. 1068 00:45:06,120 --> 00:45:06,220 For. 1069 00:45:06,220 --> 00:45:06,240 You. 1070 00:45:06,400 --> 00:45:06,460 Any. 1071 00:45:06,900 --> 00:45:07,100 Problems. 1072 00:45:08,820 --> 00:45:09,020 There's. 1073 00:45:09,060 --> 00:45:09,140 The. 1074 00:45:09,300 --> 00:45:09,400 The. 1075 00:45:09,500 --> 00:45:09,620 User. 1076 00:45:09,800 --> 00:45:10,000 Manual. 1077 00:45:10,880 --> 00:45:11,080 Still. 1078 00:45:11,420 --> 00:45:11,480 A. 1079 00:45:11,680 --> 00:45:11,760 In. 1080 00:45:11,820 --> 00:45:12,020 Progress. 1081 00:45:12,240 --> 00:45:12,420 But. 1082 00:45:12,480 --> 00:45:12,640 It. 1083 00:45:12,760 --> 00:45:12,920 Gets. 1084 00:45:13,420 --> 00:45:13,620 Deeper. 1085 00:45:14,840 --> 00:45:15,040 There's. 1086 00:45:15,120 --> 00:45:15,280 Also. 1087 00:45:15,320 --> 00:45:15,420 Some. 1088 00:45:15,560 --> 00:45:15,760 Design. 1089 00:45:16,300 --> 00:45:16,500 Specifications. 1090 00:45:16,640 --> 00:45:16,840 That. 1091 00:45:16,880 --> 00:45:16,920 Are. 1092 00:45:16,980 --> 00:45:17,040 In. 1093 00:45:17,040 --> 00:45:17,080 The. 1094 00:45:17,200 --> 00:45:17,400 Shiva. 1095 00:45:18,880 --> 00:45:19,080 Repository. 1096 00:45:19,300 --> 00:45:19,500 That. 1097 00:45:20,220 --> 00:45:20,420 They're. 1098 00:45:20,480 --> 00:45:20,540 A. 1099 00:45:20,820 --> 00:45:21,020 Behind. 1100 00:45:21,140 --> 00:45:21,340 Date. 1101 00:45:21,480 --> 00:45:21,680 But. 1102 00:45:22,200 --> 00:45:22,400 If. 1103 00:45:22,500 --> 00:45:22,520 You. 1104 00:45:22,580 --> 00:45:22,640 Want. 1105 00:45:22,700 --> 00:45:22,740 To. 1106 00:45:22,780 --> 00:45:22,820 Learn. 1107 00:45:22,900 --> 00:45:22,980 More. 1108 00:45:23,040 --> 00:45:23,160 About. 1109 00:45:23,200 --> 00:45:23,320 It. 1110 00:45:23,340 --> 00:45:23,460 Go. 1111 00:45:23,540 --> 00:45:23,640 To. 1112 00:45:23,680 --> 00:45:23,760 The. 1113 00:45:23,820 --> 00:45:23,940 Web. 1114 00:45:24,060 --> 00:45:24,260 Site. 1115 00:45:24,480 --> 00:45:24,680 Arcana. 1116 00:45:24,820 --> 00:45:25,020 Research. 1117 00:45:25,220 --> 00:45:25,420 I. 1118 00:45:25,620 --> 00:45:25,760 O. 1119 00:45:26,160 --> 00:45:26,360 Shiva. 1120 00:45:27,140 --> 00:45:27,340 And. 1121 00:45:27,340 --> 00:45:27,840 Feel. Free. 1122 00:45:27,860 --> 00:45:27,960 To. 1123 00:45:28,020 --> 00:45:28,100 Reach. 1124 00:45:28,140 --> 00:45:28,280 Out. 1125 00:45:28,340 --> 00:45:28,440 To. 1126 00:45:28,460 --> 00:45:28,580 Me. 1127 00:45:28,580 --> 00:45:28,740 For. 1128 00:45:28,820 --> 00:45:28,900 Any. 1129 00:45:29,060 --> 00:45:29,320 Questions. 1130 00:45:29,980 --> 00:45:30,240 About. 1131 00:45:30,380 --> 00:45:30,520 It. 1132 00:45:31,220 --> 00:45:31,480 And. 1133 00:45:31,820 --> 00:45:32,080 Thank. 1134 00:45:32,260 --> 00:45:32,360 You. 1135 00:45:32,540 --> 00:45:32,800 Grateful. 1136 00:45:32,900 --> 00:45:33,040 For. 1137 00:45:33,140 --> 00:45:33,400 Everybody. 1138 00:45:33,620 --> 00:45:33,880 Being. 1139 00:45:33,980 --> 00:45:34,240 Present. 1140 00:45:34,300 --> 00:45:34,440 Is. 1141 00:45:34,540 --> 00:45:34,580 There. 1142 00:45:34,620 --> 00:45:34,680 Any. 1143 00:45:34,740 --> 00:45:34,940 Questions. 1144 00:45:35,100 --> 00:45:35,260 For. 1145 00:45:35,280 --> 00:45:35,500 30. 1146 00:45:35,760 --> 00:45:36,020 Seconds. 1147 00:45:36,900 --> 00:45:37,160 You. 1148 00:45:40,100 --> 00:45:40,360 Got. 1149 00:45:40,500 --> 00:45:40,580 Three. 1150 00:45:40,860 --> 00:45:41,120 Seconds.