good morning you guys since I've been recently waking up at 5 a.m. I thought why not challenge myself and make it an hour earlier and see how 4 o'clock feels because I'm a little insane and I feel like it would be a good video idea so I'm like you know what we're gonna wake up at 4 a.m. and see how it compares to 5 because why not don't worry I don't think I'll go earlier than this like I don't think you'll be seeing that 3 a.m. morning routine but anyways good morning today's gonna be a really fun day because I actually I'm going to like one of my first workout classes that I've like ever done in my life I did like an f45 class in high school before I think I only ever did one but I honestly can't even remember it and it was like so long ago when it's just not the same five is like what I'm gonna do today so this is kind of like my first real workout class we're gonna go downtown today and do a workout class Talia is gonna come meet me here and then we're gonna drive from my place to downtown she's actually been there before and she really likes it so we're just gonna go to the same place that she likes but I'm honestly really excited because it just kind of switches things up from doing what I do every day is like go to the gym and I've been really wanting to try a workout class to experience it just cuz I literally always just go to the gym it's fun to switch things up especially with your workout because working out is something that I sometimes dread and probably a lot of people do as well so if you could switch it up and like do something fun with a friend it's definitely worth it yeah so I'm hoping to get a lot done today since it's so early and I have the whole day ahead of me but I'm feeling pretty tired this morning to be honest like I'm not so horrible but definitely I'm lacking that one hour of sleep because I went to bed at 9 because I knew I just couldn't fall asleep at 8 o'clock that's just so early yeah maybe I'll just take a nap later but we'll see today's gonna be a fun adventure I was reading my comments on my video that I did when I woke up at 5 a.m. for a week and a lot of you guys wake up at 5 or earlier I was like damn like wow I didn't know so many people did that Natalia isn't coming until 8 30 because our class is at 9 30 so I still have so many hours right now I'm just gonna go and make my bone broth and do my morning routine this is my all-time favorite setup in the morning you guys I five minute journal I have my bone broth my journal if I want to write anything and then I also have my book it's just like such a peaceful layout to have in the morning I'm just gonna do my hair probably just like sleep it back into a low pony brush you guys is honestly the best thing ever I think it's not like a bore bristle brush and not exactly sure but it's so good if you want to do like a sleep back look like just like putting your hair back I don't know what I'm gonna do without this like I wouldn't be able to actually sleep back my hair like this thing is actually the best thing ever but it's from the brand goodie okay guys it's about 12 30 and I just go back from the workout class it was honestly so much fun and I can see why people love going to workout classes and kind of get addicted to them because you're kind of in a room with everybody who's working out and holding you accountable rather than working out yourself where you're the only one holding yourself accountable so you it's easier to quit it's easier not to go as hard because you don't have somebody yelling at you 24-7 and saying like hyping you up you don't have music blaring I guess you can have music blaring but like you know what I mean and also seeing the other people like doing really good like motivates you to like keep going and push through it and I don't know it's so much fun like I wish I tried a workout class sooner because I had a lot of fun especially doing it with a friend like it was so much fun and making a date out of it like when a coffee after and if I did a workout class every day I'd be so excited to workout like are you kidding me that was amazing now I understand why people prefer that over just going to the gym I mean to be fair it is a lot more expensive to do a class every day than go to a gym but I can see why people are willing to spend the money because it's so worth it like just so motivating in there if you guys can if you have the resources around you um definitely go in and try a workout class even if it's just like you pop in and do one like grab a friend and a lot of the times when you sign up they have like a deal like oh get your first class free or whatever I've been missing out and I wish I did it sooner but but yeah anyways I'm so glad that I did that such a fun morning so I'm just gonna take a shower and then we'll get on with the rest of our day okay guys so I just showered and I'm just getting ready to go out to a cafe I'm gonna go out with my sister and we're gonna have a bit of an editing date so I'm just gonna do my makeup and then get ready for the day I just got us a four package in the mail I ordered this makeup by mario it's called a soft sculpt transforming skin enhancer in shade light medium so I'm gonna try it I think I just put my brush in and then oh my god okay ooh this is so good I've been looking for just a cream bronzer exactly like this I was thinking of buying the Chanel one but then I saw this one and I'm like ooh may as well try this one out because sometimes I don't really feel like contouring and this just makes it so much easier I don't really like using powdered bronzer this is actually really good because I don't do heavy makeup anyway so I'm not a big contourer like I don't know how to contour my face this makes it so easy my eczema around my eyes is starting flare again it was doing good for a while I don't know if I have a new viewer and they're like what is that eyeshadow on your eyes I just want to make sure that you don't think I just wear pink eyeshadow for fun but I've been really into going to cafes to edit lately because I feel like I'm so productive when I go to a cafe because I have no distractions like at home I have so many distractions like oh I'm gonna go clean the kitchen I'm gonna go make some food or whatever because everything is around you but when I edit in a cafe I just can't go anywhere like I have no distractions so it kind of just forces me to put my head into work and just get shit done but last night I literally had a mental breakdown pretty much because I am so stressed this month you guys will find out what soon but this month is so stressful for me and I was freaking out last night and then I just kind of had to remind myself that we're on a floating earth in the middle of space just take it day by day just breathe and everything is going to be okay you just have to realize that as long as you focus on your next step rather than like looking at the whole picture it's not that stressful but anyways I just bought this two-faced blush in the shade cloud crush and it looks like the most pretty blush ever oh it matches me actually I didn't even do this on purpose oh my god that is so cute this is like the cutest blush ever are you getting I'm just gonna put a bit of that so pretty I'm obsessed with blush it's actually an addiction this is the cutest packaging ever and I'm obsessed with it I forgot to put on setting powder I'm just like trying to rush Brittany's waiting for me I'm just gonna put some mascara on real quick that is the final makeup just very simple I literally just put concealer and then use all the rest okay guys so it is time to get ready for the day I'm gonna pick out an outfit but first I would love to thank pepper for sponsoring this video so if you guys are part of the itty bitty titty committee or have small boobs and you should definitely check them out because they are a bra company who specialize in providing bras for small busted beautiful bodies and they range from size a a a and then to be so if you guys don't wear bras because they're uncomfortable you don't like to fit of them I can relate because I haven't worn a bra for like I'm not even kidding probably a year or longer now because I don't know I just find them usually so uncomfortable because I haven't been able to find bras that I actually feel comfortable in so as you can see this one fits me so nicely and it's just seamless there's no wires digging into my skin I just feel like it's perfectly catered to my size and all I have to do is go online they have like a measurement chart there where you guys can measure yourselves to figure out what your perfect size is going to be this is their lift-up bra and usually when I wear a bra that has extra padding I find them so uncomfortable and I just refuse to wear them because I feel like I can never move with my bras like I feel like I'm like that but with this one I'm like I feel so comfortable and I feel like I can just move and actually go about my day without this bothering me and feeling the need to rip it off 30 minutes after putting it on but I have actually napped in their bras like I didn't even feel the need to take it off when I napped and that is huge for me the fabric of these bras are just so soft and that's a part of what makes them feel so comfortable they're just so I don't even know describe it like plushy and supportive and smooth you can wear them lounging around the house putting it under one of your t-shirts or even a tank top I've been wearing them just with everything around the house when I go out they're honestly so flattering they have an ultra flattering lift and scoop now after discovering them I am throwing out all my other bras even though I haven't worn them in so long I'm just going to throw them out because what's the point of keeping them when they don't make me feel good and they don't make me feel comfortable and from now on I'm literally just going to have the bras that they gifted me because I know that whichever bra I go and choose it's going to be comfortable it's going to fit me right and I'm actually going to be able to wear it all day and so yeah if you guys want to shop them you guys can use the link in my description and use my code mckill20 to get yourself 20 off on their website and I'll have all the bras that I'm wearing in this video also linked down below for you guys but anyways let's get ready for the day I'm just going to keep this bra on because it honestly this bra makes me feel super confident because it gives my boobs a bit of a lift but I kind of want to go for a cozy vibe today so I think I'm just going to put on a crew neck and then just leave these sweatpants on because I'm just going to go edit at the cafe I think this is going to be the little lazy fit for today I just got so much editing done at the cafe I was going ham we were there for like I don't know four or five hours we were there for so long and I feel so productive but now I'm just going to stop off at the grocery store before going home because I just need to get a couple of things for my smoothies in the morning that I'm running out of and I also kind of want to get a kombucha so I'm going to do that and I also want to stop in at shoppers because I really want to get new like headbands I want like a gray one because I only have black like I just look in my car oh he's putting tags on the wheels anyways I really want to get headbands because I only have a black and a white one but I want to get a gray one because headbands are just so convenient and mine are kind of like really old and I don't know I just want to see if I can buy just a pack of like two or something at shoppers and see if they have anything I tried to look on Amazon and they don't have good selection I'm like what it might just be Amazon Canada but literally they had like one two pack of like black but it's like I don't I want a gray one too so we're gonna go in and see what they have and yeah just shop around so yeah let's go in it's currently I think about like four o'clock or four thirty right now okay I just got back inside so I ended up getting two of these pink vitamin waters because they're so cute and I don't know I always get kombucha so I'm like why not switch it up and this pink flavor is so good so I just bought one for me and then went to bring home to Joel and then at shoppers I was looking at their headbands and they didn't really have that good of a selection so I'm just gonna see if I can like find some elsewhere or maybe another website online but I decided to pick up this palmers skin therapy cleansing oil but apparently palmers is actually a really good affordable brand so I'm like you know what may as well start here and try their cleansing oil because I just actually bought their skin serum their face oil so and this is their cleansing oil it's their cocoa butter formula with vitamin e so I feel like this is gonna be really hydrating especially with my eczema so I'm like really excited to try this it was only like ten dollars and then I just got cucumber and ginger but yeah these pink vitamin waters are so rare so whenever I see one now I just have to buy it because they're always sold out I feel like okay let's go home okay so I just got home but I thought that I'd show you guys my Sephora haul since I didn't show everything before so I got the makeup by mario the bronzer skin perfecter then I got the two faced blush which I absolutely love these two and then I just got a refill of my oak cleansing balm from the inky list and then I decided to try out this tower 28 lip gloss in the shade pistachio it's actually went viral on tiktok so I just had to try it because it finally came back in stock and I've been wanting to try it for so long so I got that and then I just got this k-18 I just used my points to get this because I really wanted to try the full size but I just decided to go with the sample just to see how I like it before committing because it is quite expensive it's like a hundred dollars for the full size apparently this stuff is so good so I'm really excited to try it I'll let you guys know how I like it and then I just got this Moroccan oil hair oil then I just got the ordinary um multi peptide lash and brow serum I've been using this for like a few months now so this is just a re-stock but I absolutely love it and yeah this is my little haul I was just watching love island watch a good an hour of it now it's time to get ready for bed it's currently 8 30 it's honestly not worth it waking up before it's just too early okay like I have nothing to wake up before for like I don't have to clock in at work I make my own hour so there's really no point to it I feel like waking about five is like good for me because I get that extra one hour so I can get eight hours of sleep I mean if I had to wake up before for work it would definitely be more motivating to do it because I have to do it but other than that you know what I'll pass and I'll continue waking up at five like I thought that extra hour of the day would do something for me but it really didn't if I'm honest it honestly just made me super tired and yeah I just want to do it again but if you guys are feeling stressed right now because I was feeling really stressed yesterday and if you're in the same boat as me we're feeling stressed right now one thing that really helps me like I was saying earlier just realizing that we are on a floating planet in the middle of space like just zoom out a bit and realize that things are not that serious and although something may seem like a big deal in the moment and right now when you feel like you have a lot on your plate and there's not enough time to get everything done if you feel that way just realize that like all you have to do right now like all there is to do and all you could do is take the next step and that's it so whatever that that next step is that's all you should be worrying about instead of scaring yourself and kind of trying to accomplish everything you need to accomplish and everything you're stressed about all at once you kind of got to do little baby steps if you have a big task it's really daunting and you're stressing about it break it up into little tasks and work on it every single day even if you do like 20 minutes a day at least you're working towards it because i'm somebody who procrastinates big tasks because they scare me but if i just break them down and i realize look i can do this spread out into a week two weeks and as long as i'm doing something small for it every day then it's going to get done but you just have to realize that okay all i have to do right now is just the next step i don't need to do the last step i don't need to do the middle step i just need to do the next step and that's the best i can do right now and there's no point of stressing because when i was stressing last night i'm like i was just feeling like shit but it didn't do anything for me it didn't make this stuff i was stressing about disappear it really didn't do anything for me except make me anxious so just know that stressing about it is not doing anything positive it's just harming your mindset and it's causing your body stress so there's no point you just got to zoom out you guys that's what works for me every single time it's just really realize it like shit we really are on a floating planet in the middle of the universe like what is life about at the end of the day it really just helps me see how i should have be stressing about something so small when i know that everything is going to be okay and in a year's time i'm not even gonna remember you know anyways i hope that helps you guys if you're stressing right now as well just i mean it could be about anything something small something big but just know that it's okay and we're chilling okay everything will work out in the end okay i know i literally look crazy because my xima cream but i just wanted to end off today's video here and say thank you guys so much for watching i hope you guys enjoyed this video subscribe if you guys want to see more content from me because there is a huge announcement coming soon so don't forget to put on your bell notification so you guys know when i post and also go follow me on instagram but i'm so excited you guys finally let you know what's happening i just wanted to also say thank you guys so much for the extra i feel like i've been getting extra love and support on my recent videos and i just wanted to say i appreciate every single one of you who like my video who watch it who comment every little interaction every comment i see and i just want to say thank you so much and i appreciate it from the bottom of my heart but anyways i love you guys so much and i will see you in my next video


All right, and I set it up to automatically record while it's streaming. Let's see how we doing. Can somebody let us know if we're actually live on the Twitch, and then we'll continue. Yep. Okay, ah, nobody's there. Cool, I'm there. That's the only thing that matters. Okay, sweet. All right, so as you all know, of course, because you're following along with the course, the assembly crash course is due Friday at midnight. We'll launch another module after that. Due date, TBD, I'm gonna see kind of how this goes. I want you to have enough time, but now we're gonna put, so you've been learning assembly. After this, you're gonna be putting that knowledge in action and actually writing programs that do things instead of just moving data around, right? We talked about, we want our assembly programs to actually do things. Before I do that, let's do what people were asking before class, we can do, let's say 20 minutes of maybe talking through one of the levels. I actually don't wanna solve it all the way, like I did last time, but how to approach some of them. Anybody have a favorite level that is in the teens that they would like to be level six? Level six, all right, register sizes. What are the sizes of registers? 16, 32, 64. There's one more. Eight. Eight, yeah, eight-bit size registers. What, before we even tackle that, we should remember these slides on registers. And let's just queue up, oh, there we go. Cool, so this, if we're talking about register sizes that's before even looking at the level or what it's asking for. We have the slides on all the partial access to all of the different registers, right, in this. Cool, let's just keep that in our back pocket. Actually, let's go there. And then we can go, Kimberly, can you read that in the back? The text, at least on the left, cool. Challenge run, let me wait. Okay, the interactions instructions which you already know about, cause we talked about then, for this level we'll be working with registers, yay. You will now set some values in memory dynamically. We will, so the challenge is gonna set values in memory. On each run, the values will change. Why does it do this? You don't think as you're reading these, why? Why does it do this? Why is it changing the values in the registers before it runs our code? Yeah, so we can't hard code the answer and say, well, the thing told me it's expecting 10 here so I'm just gonna move 10 in there rather than actually doing what the assignment says. Cool. We will tell you which registers to set beforehand and where you should put the results. In most cases, it's gonna be our friend, R-A-X. Okay, we have some background knowledge but we've actually already got all of this from the chat we've been having in the slides. So we already know, we just talked about, right, register sizes for the R-A-X register referring to the all 64 bits as R-A-X. The lower 32 bits is E-A-X. The lower 16 bits is A-X. And of that, the upper eight bits of A-X is A-H and the lower eight bits of A-X is A-L. Cool, okay, so it says, using only the following instructions, move. We only have one instruction to use, cool. Please compute the following. Set R-A-X to be RDI modulo 256. R-B-X as RDI module modulo 6-5-5-3-6. And we'll set the values so it's telling you what values we'll set. Send it some As. Error, it did not like all of my As, that's fine because that's nothing in there, cool. Okay, so what's it asking us to do? What's the modulo operation for assembly? Yeah. Remainder. Remainder, can we use it? Yeah, we can only use move. So actually, it doesn't matter. Maybe there's the exact instruction that we can specify exactly how much module to do, but we only have move, yeah. Well, I thought the idea was you use div and then div you'll end up with a quotient. Sure, can we use div? Well, in this case, no. Correct, then we can't use div. We can only use move. So I must mean there's some way to do this without using div. Move the lower bits to each other. Move the lower bits to each other, why? So one thing to do is always look at this and do it by hand, right? If we can't actually do this math on our own without writing a program to do it, it's gonna be really difficult for us to write a program that can do it. So we have RDI is hex D967 and we have the task of compute RDI modulo 256. So someone remind us what's the modulo operator mean basically, it's the remainder left after division. Yeah, exactly, cool. So, let's use our handy calculator. Let me quit out of all this stuff to reduce the possibility of things popping up. Sure, that's good enough. Okay, so we have, how do I even do mod on this calculator? It's a great question. Let's use Python. Ipython is interactive Python so I can type in Python extractions here and it will show me the output. I can do a classic hello world program. This is just a nice way to kind of interact with Python when I can do things without needing to use a calculator. There's a lot of stuff you can do on here. Okay, so in Python and in, I believe most programming languages, right? C, C++ and Java. What's the modulo operator? Percent. So I do percent then what? 256, thank you. Okay, so I need the result to be 103. So, yeah, perfect. Okay, so looking at that number, it's actually hex 67. How's that in relation to our original number? It's the close, yeah, lower one byte, right? Two hexadecimal digits are one byte. So it's the lower two bytes, why? That seems like magic. Yeah, 256 is two to the eighth power. So we can actually just looking at this lob off. The only digits we care about here is gonna be the last digits here, right now this 67. So, I guess is this universal? How do we test this, our theory out? Let's try some more mods, see what they do. 10, 97, 67, that's 103. 12, I think we can keep going, right? So this is only, the modulo here is actually like a little shortcut where it's actually just the last, it's essentially only keeping the lower eight bits here when we do the mod operation. So, if that's what we wanna do, so let's, what do I have, I'm gonna use emacs now, cool. Okay, so let's say, so what is it, RDI? So, I don't know, let's just move into RDI X10, boom, run it. I guess I should be showing you the cool things of emacs while I'm doing this, huh? Let's make the Vim people mad, okay. Okay, so we moved 10 into RDI, was this gonna give me the flag? No, why? Yeah, because A, I need to set RIX, I changed RDI, but I didn't change RIX, the, we have to remember to keep the description in mind. So, but what I'm doing this is showing that we failed in the following way, so RIX was expected to be F9, and we can actually look and verify if RIX was F9 and we kind of derived for ourselves that, hey, modulo 256 is the last eight bits, then that double checks, and then if we pass this check we should not see this again, we shouldn't see that it failed because of RIX. So, what's our goal with the code here? We want to set RIX to what? To the remainder, let's do an e-show, work like this, but there we go. Okay, where was my freaking moon? So we know this shouldn't work, so my target register is RIX, what I wanna move from RDI, I wanna move the last what bits, the lower, the lower byte, yeah, eight bits. We look at our handy table here and we say, okay, Mr. RDI, if I wanted to refer to your lower bits, that is DIL, so move DIL into RIX, rerun it. Okay, great, why did this fail? Yeah, because RIX is 64 bits, so I'm trying to move eight bits into a 64-bit register. There could be junk in RIX, so how can I clear RIX first? Move zero into RIX, move zero into RIX, now I know RIX is zero, now I'm just gonna move, which byte do I want to move DL into? AH or AL? AL, what if I moved it into AH, why is that wrong? It's the upper eight bits, and then it will look and say, that's like saying is 10 the same value as 10, as a thousand? Right, it's just the 10 moved over two decimals places? No, it's a completely different number, just because the digits are the same. They're in the wrong place, right? Exactly, so we wanna move this into the lower bits, let's try it. All right, is this good, do we get the flag? No, do we expect to get the flag? No. Also no, but did we do what we wanted to? Yeah. Why? We passed the RIX check, now to double check this, how can we absolutely be confident that the right value is in RIX? In three, we can add a debug statement, right? To show us, this will show us the values in the registers and we can confirm with our eyeballs that RIX correctly has the lower eight bits of RDI. All right, we got the thing here. So RIX is AC, let's look, we didn't change RDI, so RDI here is DDAC, so we have successfully changed the lower eight bits of RIX to AC, and we've successfully done our modulo operator. So if we're going forward, and now we need to set RBX to RSI, do we do the exact same thing? No, I see some head shaking, why not? Because it's a different modulo number, so we would do the same thing again, figure that out and go forwards, which is I think all I'm gonna do here. Cool? Oh, shoot, I said 20 minutes, but I wasn't keeping track. Okay, five minute approach on one other level. 19, that was slightly unanimous, did you guys find that? 19, oh, 19's a fun one. All right, we got Emacs, and we want a shell to look at some stuff, run the challenge, read the challenge, so it's not just running it, right? Okay, normal instructions. In this level, we'll be working with control flow manipulations. Great, what should we be thinking about with control flow manipulations? What instruction, all together now? Jump, thank you, yes, we should be thinking jumps. This involves using instructions to both indirectly and directly control the special register, RIP, the instruction pointer. We'll use instructions like jump, call, compare, to implement the requested behavior. All right, we're testing multiple times with dynamic values, okay, great. Wait, did I, what just happened there? Oh, I didn't know you could do that. Oh, okay, sorry, I'm getting familiar with this. Okay, the last set of jump tables is the, okay, what's going on? Is this just cut off normally? Seems bad. Nobody's mentioned this? I think I'm inside the key places. Yeah, okay, well, let me know, I can fix it. Shouldn't be like this. All right, maybe that's the keys right after here. Okay, the last set of jump types is the indirect jump, which is often used for switch statements in the real world. Switch statements are a special case of if statements that only use numbers to determine where the control flow will go. Here is an example, switch number. So if number is zero, so we've seen switch statements, C, C++, and Java, I'll have these. I think Python, does new version of Python have them? Switch statements? Case statements, kind of the same. Okay, so switch on a number, if it's zero, then jump to do thing zero. If it's one, jump to do thing one. If it's two, jump to do thing two. Default, jump to the default. The switch in this example is working on number, which can either be zero, one, two. In the case that number is not one of those numbers, then default happens. So it's kind of an if-else statement. We're using numbers. So it's no surprise if we can make statements based on something being an exact number. In addition, if we know the range of numbers, take for instance the existence of a jump table. A jump table is a continuous section of memory that holds addresses of places to jump. In the above example, the jump table could look like this. So at this memory address, the address of do thing one, at this plus eight, the address of do thing one, how come this is eight bytes above the first address? What is eight bytes long? Memory is very large. Memory can be terabytes large, but you're very close. Yes, the address of a memory location is max eight bytes large. Yes, so that's why, if it's an address, it has to be eight bytes. This was a double check, right? As you're reading this, you can ask yourself, does this make sense that this other thing is eight bytes after this other thing? So the next address, and what's the difference between these two addresses? But these two memory locations. Eight bytes again, how come it's not two? It looks like it should be two. It's in hex, so we gotta be careful about that, right? So it's a hexadecimal, so this looks like 10, but in hex 10 is what? 16, yeah, it's one of the easiest ones to memorize, right? Because every digit is 16, so one is 16 to the zero, and the next decimal place of a one would be 16 to the one, and the next one would be 16 to the two, and so on. So anyway, that's just the easy thing you do. Then this 18 address of do default thing, using the jump table, we can greatly reduce the amount of compares we need. Now all we need to check is if number is greater than two. If it is, then we can do jump to the last one. So this is checking the default case, otherwise jump at an indirect location, so not known at runtime, depending on what the number is, jump to the jump table address plus the number times eight. All right, so the goal is implement the following logic. If RDI is zero, then jump to this location. If it's one jump here, if it's two jump here, if it's three jump here, otherwise jump here. Okay, assume RDI will not be negative, so we don't have to worry about negative numbers, great. Only use one compare instruction, what's that preventing us from doing?  So it's kind of actually forcing you to do what it's asking. No more than three jumps. We'll provide you with the number to switch on an RDI, so RDI is gonna be the number in this case, and we'll provide you with the jump table base address in RSI, so the great thing is we don't even need to worry about the jump table. It's going to give it to us here in RSI, so this would mean RSI would have at the start this memory location, and this should be, wow, okay, I don't know my hex that well, but I assume, it's super weird that that's not on an eight-byte boundary, but that's okay, I assume the difference between hex C and hex four is eight. That's probably right, yeah, so make sense, these are consecutive memory addresses. Again, we know that a memory address is there, so it has to be eight bytes, so we can double-check, and so these specific addresses here will change, so we should not hard-code in these addresses, we should be using this jump table, okay, cool. So we have that in here, let me, oh, AS, let's get that whole thing, let's write, why did you not copy, that's not fun, it's the problem when the keyboard shortcut is exactly the same as your, okay, so we want to, gonna grab that, I just want that command to run, waiting for my input, that's why I did that, okay, now I'm gonna actually copy this into my desktop, so that I can paste that, it should be exactly the same, okay, should this work, why not? Yeah, because it was, literally it was the wrong thing, okay, so it was the solution to the other level, so let's look back at what we need to do, switch on number, so I would say one thing I would actually do is, I would do here is, oh, I need to kill this, I usually don't do the terminal here, anyways, what I'd probably do is copy and paste this thing of what we actually need to do, which is technically down here, okay, so number, so let's keep track, number is RDI, jump, jump table is in our SI, yep, okay, and we'll need to implement this logic, so what's the first check I'm gonna wanna do? If it's greater than three, why? Yeah, so this is the default check, so the thing said I should do the default check, and the default check, so if it's assuming it's negative, the cases are it's either zero, it's one, it's two, it's three, or it's greater than three, and so if it's greater than three, we will jump to the last place in our jump table, so we would compare RDI with, what do I wanna do, three, and I'd probably do what's the, now this is where I'd go back, because I definitely don't remember all of the instructions here for jump tables, but we have this handy dandy stuff here of the slides that I'd go back here, I would say which lecture was that, oh yeah, that was the last lecture, this was on control flow, so we could go looking around, oh there we go, so we want to, we use three, so we wanna be greater than, right, we don't want it to be equal to, so jump greater than, JG, jump if greater than, where do we wanna jump to, so if I just did RSI, so I jumped if greater than RSI, where would that go to, that's the first one, which one do we actually want, one, two, three, four, five, the fifth one, can I do five times eight, valid use of register, type mismatch, because I can't use that, okay, there's a couple possibilities, maybe I can't do the multiply, so what's five times eight, 40, okay, another valid use of registers, yep, okay, that's what I figured, okay, so I shouldn't really do this, right, can I not do offsets of registers, no, so I need to compute something, great, okay, so I need a temporary register, move into RAX RSI, so I'm gonna move whatever the address was into RAX, I'm then gonna add to RAX what, 40, and then I'm gonna jump to RAX, I will also, why do I need to move my compare down, I need to write before the jump, specifically because this addition will actually change the flags, so that'll mess things up, okay, wait, why is it saying that, that we'll learn something new together, grand type mismatch, okay, jump if greater signed, ooh, that's okay, that's a bad sign, so one thing is we're using a signed comparison, jump if greater than, which is a bad sign, why? Yeah, it's guaranteed to not be negative, although I guess does that mean it won't have the highest bit set, or it won't, okay, but I can only use JG with a, that's interesting, x86, JG, okay, this is where, towards a signed comparison, okay, let's do this, so that doesn't work, so I think basically what I'm inferring from reading all this, and from here, is that to jump to an absolute location, we need a direct jump, right, jump and operand, whereas jumping to a label is an offset, so what I would do is then go back here, and say, okay, so I can't jump to here, that means I will need to jump to a label, something like that, default, and we can define that label, where should default jump to? Yeah, what I did here, so I should move that down there, because that doesn't really matter, so now I'm moving at an offset here, but this one takes a while to execute, because it's doing like 1000 executions, is that right? Yeah, okay, okay, what if it was not, so in the case that it's not greater than or equal to, or greater than three, then what do we want to have that happen, is that again? Jump equal to what? Yeah, but where do we want to jump, right? So if we look back at the example, we could see if number is, in this example, if number is greater than two, then jump to that fixed location, otherwise jump to the jump table address plus the number times eight, so otherwise, so this is the case that we're in now, we want to jump to jump table address plus number times eight, so how do we know what's the number? What was it? It's RDI, so move into Rax, let's say RDI, so now Rax has it, what do we then need to do with the number? Yeah, multiplying it by eight, so we could use, you've studied the multiply instruction, we can use the multiply instruction to multiply by eight, but there's actually a better way to do it, powers of two multiplications, yeah. Bitwise shift, if you move, because of the way binary works, if you shift the bits one bit to the left, that multiplies it by two, if you do that again, it's another times two multiplication, and is eight the power of two, how many powers of two? Three, so we can shift it left three times, and that's the exact same thing as multiplying it by three, or multiplying it by eight, and actually if you look at the decompilation of your C code, if you do something like multiply an integer by a value of a power of two, it will use this trick and use bit shifts instead of actually doing multiplication. Cool, okay, so what is it, SH, which way do we wanna shift? Left, shift left Rax three, so at this point we should have multiplied it by eight, now we want to add Rax to what? Rsi, so we wanna take, so Rsi is the jump table address, so we wanna take the jump table address, add it to the number times eight, store it in Rax, and then jump to it. Okay, let's see if we, this last one failed. Ah, error fetch unmatched, cool. Okay, invalid memory access, all right. Cool, I was just talking to something about this. Okay, another thing I'd like to do, I like to do is to read the code here, kinda helps if there's any weirdness, so compare RDI to three, if it's greater than three, so one thing we did notice as we were doing this was that the JG may not be exactly what we want, that's a jump if greater sign, so let's make sure we do an unsigned, so jump if above, so JA, so let's change that to a JA, just cause we thought, hey, maybe that is a problem. Okay, compare RDI to three, if it's above that, jump to 12, 12 here is move RSI, and RSI is the jump table into Rax. Ah, I see, hex 28 to Rax, and then jump to Rax, cool. So let's look at, so let's add an int three here, before that call, I wanna see what that value is that we're going to, okay? Did not break there, let's do here, cool. So now we know where that value is, okay, now we can look in here, so we're jumping to Rax, right? That was exactly what our code did, this is the value in Rax, 40, 30, a zero, let's go look at our code, 40, 43, a zero, that is completely wrong, okay? So double checking everything, so RDI, so in this example, RDI is one, so let's go back up here, so if RDI is one, where should we be jumping to? 40, 30, FD, which is stored at 40, 40, 65, okay? So FD, 65, but we are going to the wrong place, so we're jumping to 40, 43, a zero, so the question, of course, is why? And we actually have enough information here to debug this, so let's see. So RDI into Rax, so RDI is one, so after this, it's one, shift left three, let's see, I can use my calculator here, I can save one, I can shift left one, two, three, so it's eight, which it should be, that's one times eight, everyone agree? Is eight, yes, cool. Okay, add RSI to Rax and move into Rax, so RSI is this memory location here, 43.98, okay? Great, so now we can do that, so plus, plus, paste did not work. That's because I tried to copy it within Emacs, but I am without, okay. 40, 43, a zero, what's the value in Rax? 40, 43, a zero, so what's the problem? The RSI is what, say it again? The RSI register was given to us, so we have to assume that it's correct. So at some value that was given to us, we didn't, that would be one thing is working backwards and saying, did we change it at all? But we can see from here to here, we didn't change it and we even debugging it, we can see this RSI, we can see this Rax, if we go up, we can see here's an example table, so how do I read this example table? And on this example table, and on this example table, which value is given to us? When the thing, when it says that it'll provide you with the jump table base address in RSI, there's one, two, three, four, five, there's 10 different memory addresses here, which one is it going to give us? Which one? The first one, the very first one, right? So this is saying in memory at address 404398, the eight bytes that are at that memory address will be the memory address of where to go reference. And then eight bytes after that will be another memory address and then eight bytes after that one will be another memory address for 48, I guess, contiguous bytes. So when we say jump Rax, what are we doing here? Let's take something else. Let's walk through the code. This is our code. We all wrote this together. Notice how I'm distributing blame to you. Not just on me. Okay. So we said in this example, let's say we, let's say the number is zero. And in this case, we know that so RDI will be zero and our SI will be this address right here because this is what we're given the start address of the jump table. So we compare it is zero above three. No. So we'll go to the next line, move RDI, which is zero into Rax. What happens when you shift to zero left three bits? Still zero. Thank you. We add RSI to zero and sort into Rax. Remember RSI is this value here. 40405D. So what's that value going to be 40405D. And then we jump to 40405D. So what does the CPU start doing? So the instruction pointer here was at, what's this? 40,011. What's the instruction pointer going to be after executing this? 40405D. What's that 40405D? Yeah. It's these, these bytes will be in memory. And we actually know because you'd be looked at end in this exactly the way they'll be laid out. The right at this memory address of 5D will be 2D and then three zero and, or three zero and then four zero and then zero zero and then zero zero, which when you do a jump and it sets RIP to that address, it attempts to start executing whatever code is at that memory location. So it's treating what is an address here as x8664 code. What is this decode to as x8664 code? I have absolutely no idea. Not what we want. Yes, exactly. Not what we want. What's the problem that we're missing here? We want to actually dereference RAX and jump to the memory address that RAX that is inside of RAX, right? So if you think about it at the C level, we missed a pointer dereference. We're actually saying jump to a memory location, but we really want to do is jump to whatever is, where this memory location points to. Everyone see the difference? Yeah. Yeah. So we could see if we could do that. So I'd say, hmm, we can do it two ways. We can do, I think we can do it like this. We'll test it. I don't know if you can do this on a jump operation. You definitely could with like a move. So let's try that. Hey, there's some output. Okay. Something happened, but let's go back. There we go. Keyboard interrupt. Cause I don't want all that debug output now. That's what's slowing everything down. And now that I know that we can, what? Oh, there was an in three at the last one. That's right. Get rid of this. So do I expect that this works? Oh, you guys con me out of, don't worry. We have 25 minutes. It's all on assembly. So this is just hanging. If it gets in an internet loop. Yeah. I think it's in an internet loop. I think this, well, it just so happens that whatever. So if you notice, we change, this one, we did not change this guy. And so whatever that instruction is, whatever instructions that it's executing here might be an infinite loop where it's just continuing to loop forever. Which I was hoping it would actually show us that it's wrong. Which is a great, because I didn't want to solve this. I wanted you to solve this. So that's good. But now we can see that. So, we're going to go back to this. So, that's good. But now we can see that we definitely saw it together, right? That we were first crashing. We couldn't even pass any of the first test cases because this first condition was wrong. Now that we did this and made this change, now this can, now that condition works, but now we're failing somewhere else. So we'd probably add some other debug things in threes to figure out where exactly we are. There's only one other place, the default condition that we need to look at. Cool. Questions? Let's go learn. I am going to not do these slides. We're going to switch over to Connor's slides. Okay. So, what we're going to do is be putting, so you're learning x8664 assembly. You've learned how to move data around, move it in and out of memory. You've learned how to compute on that data. You've learned how to branch based on that data. But how do you get it to actually do stuff? It's kind of like a philosophical question, right? If data exists in a CPU register or some computation happened on a CPU register, does it actually make an impact or a sound? So we want to build, we want to use assembly to do things. And that's why we're now marrying. So what you first learned about in the first module was how does HTTP work from the client's perspective? Then what you're going to be doing in the next module and then you learned assembly, now what you're going to be doing is actually building a web server, something that understands HTTP using assembly from the other side. But to get there, we need to actually be able to talk to the real world. So another kind of representation of what we've been doing with the layout of x8664 code here, the memory locations here. So again, this is what we were talking about, right? At this memory address, there are these bytes, I would assume these are eight. So yeah, 0, 8, 10, 0, 8, 10 is another way to look. These are all hex, even without the 0x, I think we can all see that these are hex. All the registers that we care about are important, R-A-X, B-X, R-I-P. Cool. Okay, first instruction, move the bytes 1, 3, 3, 7 into R-I-X. And then after that instruction, so the R-I-P is updated to the next instruction, R-A-X is then set to this value. This is again just a catch up for what you already know because you've been studying this. Then move this long memory address into R-B-X. So now after this instruction executes, R-I-P register will be updated to the next instruction and R-B-X will now have this hex value in here. We then want to move R-A-X to... So what does this... Somebody remind us what this brackets are around R-B-X? What does this mean? As an address. So write out the eight bytes at R-A-X, store them in memory at the memory address of whatever's in R-B-X. We know exactly what R-B-X is. It is 4-0-0-0, which is here at the top. Sorry, I couldn't spot that. Which is here at the top. So we should go through it and say, okay, what are the bytes going to be there? And we also know because of the way in saying the little indianness is, the littlest byte is written first. So actually in memory here, we have 3-7-13-0-0-0-0-0. Whereas in the register, we had the value 0-0-0-0-0, and then hex 13 and then hex 37. Then we can do things like add 42 to R-A-X. So now the value inside R-A-X is 1379. And then push R-A-X. So that will change. So how do we know? How do we know what push R-A-X? So push R-A-X will change some memory. How do we know what memory? The stack pointer, RSP. RSP tells us. So the stack pointer is currently pointing here at 10. So push R-A-X will decrement the stack pointer by 8 bytes. So it'll point to 0-0-8 and then write the value there. So our value will now be at FE 0-0-8, right here where it's in red. And again, because of little indian, the bytes will be in memory 39-13-0-0-0. Cool, right? This is all the stuff you've known. You can all do this. Awesome. But now we want to actually, so yes, to my philosophical question, but if you can't actually see any of these registers or anything in memory, who cares, right? We gave you the ability, this level is kind of special of this assembly module because you can have that int3 that allows you and dumps out some memory, but normally you don't have that. You have to actually get your programs to do stuff. So this is where hardware comes in. So we have our CPU. We want our CPU and our programs to be able to do things like send data through the router, send a packet out, print this on the user's screen, which is a physical thing. Print something. And so if we wanted to do this, the hardware actually tells us no. So if you don't know this is Linus, the guy who created Linux. So this is the entire purpose of an operating system is to prevent you from talking to the hardware directly. Why? Otherwise hacking would be too easy. Yes. In some sense security, right? So if you think about there's there's different types of SSD of hard drives. Anybody have like a spinning this hard drive in a desktop machine? Nobody has that in one person. You have two people. Yeah. You can have literally like 18 terabytes on a drive. You can have a super fast two terabyte SSD drive. You can have a like an SD card that has 256 gigs on it. How to actually talk to that physical hardware drive to get it to store the bytes you want is different depending on the device and maybe different depending on the device manufacturer in crazy cases. And the idea is the operating system should be handling that for you. So it's actually a nice abstraction layer so that you can just tell the operating system store this data to this file. And the operating system goes great. What device is this file this location tied to? Is it a hard drive? Is it an SSD? Is it this thing? And then it will figure that out. So this is why you're not allowed to touch things directly. It also gets into like then if you have multiple programs let's say they all wanted to write files directly to a hard drive at once. Who wins? Right? So that's why you need the operating system to act as the mediator there. So this is exactly the purpose is we need the operating system to do stuff and to do everything for us. It is not just talking to files it's sending packets out on the network it's talking to USB devices it's literally printing out to you. So whenever you see something on the console the program had to ask the operating system print this to the user. If the program does not do that it just stays in the memory process of the program and does nothing. So this is where there's a special instruction called the sys call. So you can think of it as a system call I guess it would be you're calling into the operating system and this is the way for your X8664 program to say hey do something please operating system. Now it's just a single instruction called the sys call. So you have to have a way of telling the operating system what you want. Do you want to write to a file? Do you want to read from a file? Do you want to quit and stop executing? You actually have to ask the operating system yo I'm done like please stop me. And so we'll get into there's a specific calling convention just like we saw with when you're calling functions in a program calling into the operating system kernel is exactly another type of calling convention. In this case I believe it's RAX that's used to specify the exact one. What's 42? It's a nice number and it's connected. Okay it's not something you just use on its own I hope it was like exit or something or a no argument sys call. Anyways. It's good okay great so we have 42 into RAX we call sys call and then the operating system will read the values and registers and figure out what we actually wanted to do. So in this case we can ask the operating system hey do something and then it can go from our CPU to the actual physical hardware like in a router and make it do things like blink if that's like something that your hardware can do. And that is where we're going so to do that we need to understand how processes work and other types of programs. So we're going to go in and learn a little bit more about how the operating system manages all of this by going through and understanding different system calls. This is the ORC correct order right? I didn't check the number. So very important system call is read. So the read system call will so we'll talk about FDs or file descriptors basically this is a very special number that the operating system gives you. And then you can give it back and says hey read from this file descriptor count number of bytes into this memory location into buff. And so depending on what the file descriptor actually is if it's the hard drive it will if it's a file on a hard drive it will do all the dirty work of talking to the hard drive if it's a can you read on a network connection? Maybe? Is it only stream based though? Yes it could be a you could be reading from a file you could be reading from a network connection and so depending on the semantics of the operating system it also may hang because you may ask for some data and the operating system goes great I will give you back if there's no data available wait for it if it's your hard drive your hard drive needs to spin and figure out the exact place that everything goes other ones so there's the analog so it kind of I always have to re-examine what these functions actually mean in my mind when you're reading you're reading from something like a file or oh the other way that you read and write is from the user so standard input output like we've been talking about so you can read from standard input so a read reads from a data source and writes it to your program's memory so this is the important thing to keep in mind a read actually writes to your memory and changes your process of memory where does it change? Whatever the address is that's in the buff and we have the reverse so we may want to write to a file and write into a file reads from our memory so write says write to this file descriptor at the address located in the variable buff count number of bytes this is all you literally need to do to read and write files and the other important thing what we're talking about here is literally at the operating system later so you may have used other things to output data like print s maybe I used print s before right handy dandy very nice you do not need to specify when you use print f how many bytes you want to write because print f is in a library and the library handles everything does it and then calls write for you so it's a wrapper or an abstraction layer on top of the underlying file system concepts but we want to actually get files how do we get a file descriptor we'll see there's actually three special file descriptors that are past to your program standard input, standard output, standard error these are some things that I don't think we'll talk about right here but definitely memorize that like standard input is file descriptor zero standard output is file descriptor one and standard error is file descriptor two on all unixy systems let's say because I don't know how general that is and we can also ask the operating system to create a file for us this is the open system call opens the file so you specify a string as the path and again this is an address in memory so it's some bytes in memory that how does the operating system know when it's reached the end of a string or any C program a zero byte yeah so strings in C and in the operating system are terminated by a null byte so zero so it will try to open up that you can specify different flags of different things to do you can specify so O create will create a file if it doesn't exist mode will be what kind of mode you want to read the file, write the file and write the file and what it returns is an integer which is the file descriptor and you can then pass to read and write system calls to do stuff with these three things open any file, read it and write it and now boom, your program the x86 assembly code you're writing can now talk to the file system so to manage, oh what is a file descriptor great, glad you asked to your program it's literally nothing but a number so you can see the type here in terms of types as an integer the int that is returned by open is exactly a file descriptor what it means actually doesn't matter to you as we'll see the operating system keeps track of what files you asked and it maps oh, file descriptor 5 for your program means this file on disk whereas another process may have the exact same file descriptor number but it means something completely different the other crazy thing is you can use the shell you can when you execute a program you can change all kinds of stuff about file descriptors and there's a lot of complexity there that you can do so if we actually like dig into the file into the operating system to see what's going on under the hood in Linux every process that's executing has this data structure you don't even memorize this the point is that it's there because if you just like start learning oh okay open read write file descriptors they become these really opaque processes or a process but you should understand what's actually happening under the hood of why these things actually exist so here we have some task structure this is actually like a C struct that you can go look at all of the definitions here here we've abstracted it out so a process has a PID so the process identifier this should be unique number on the system that identifies that process PT ID is I believe the parent ID the real user ID effective user ID when we come back to access control we'll study this more but this is basically what user on the system who's running this process is root the admin running this is it a normal user and then the thing that we care about here right now is the file descriptor table so this is showing file descriptor 0 through 1024 and the operating system when your process first loads if you're running it from the terminal so this dev PTS is I believe a pseudo terminal that's what the PTS is it just means the user's like he's at a terminal and interfacing with it when you do things like use the pipe operator or we showed when you do like slash command or slash challenge slash run and then use the angle bracket to say give it some file like we did that with an assembly file what this actually does is the operating system runs it and changes let's see standard input as 0 to be that file so it actually reads from that file but for our purposes right now we just have to know that there is data that the operating system stores about which file descriptor matches to a specific to an actual underlying file and that information has to be there so the operating system can act on our behalf cool okay so open call so question how do we know how to do an open call and this gets into the calling convention x8664 syscall we'll have links to these I like Ryan Chapman has a great system call table Connor prefers a different one and that's okay but so the way to use this table is like we said rax is the register that tells the operating system which of all of these if you've never looked at this before linux has over 300 different system calls that you can call you will not need to memorize or know all 300 of these it's okay but so so the way to read this is what do I put in rax depends on which system call you want if you want to call read it needs to be 0 if you want to call write it needs to be 1 if you want to call open it should be 2 close 3 and these are actually if you look at that's kind of nice the things that we talked about are literally well we didn't talk about close but the opposite of open then these are the registers that you put in the arguments so we saw that literally so if we go back to the slides if we go back to the slides if we go back to the slides there we go so if we went to open and we go back to here open takes a character pointer path name an int flags and a mode and if we go back to the syscall table we'd say open takes a file name so that pointer to some file name that we want to to the bytes of the file name needs to be an rdi the flags are in rsi and the mode is in rdx and that's how we look this up so we say okay if we wanted to call open give it a specific file name we would first figure out where the bytes are we would get the bytes of our file name into memory we'd put that memory location into rdi flags into rsi, mode into rdi rdi sorry rdx and then 2 into rax and then call a syscall that's it so we can look in an example of this so here we have in memory we are doing a syscall we can work backwards a little bit to figure out what syscall this is so at the top here is the c code so we want to call the open syscall we want to open the file slash flag we want to pass in a flag oread only and the mode is zero how do we figure out what this oread only means we read the documentation he said answering his own question so one thing to know is that all syscalls in the man page are in section what they call section 2 I think if you just did open oh you'll get that but if you did read if you did man what ok there we go write so if I did man write this parentheses one means section one which is I believe has to do with bash in the shell itself so this write allows us to write messages to another user but that's not what I'm interested in I'm interested in the system call so I would do man to write and I would get the entire thing you'll see that this uh this function signature is exactly the same as the one we showed in the slides we are interested in open we were using open path name flags mode so is last not here now you just said just like a normal Linux distribution that I've literally never had to do that before ok so we're interested in flags the open system call opens the file specified by path name if the file name does not exist it may optionally if o create a specified in flags be created by open there we go the argument flags must include one of the following access modes o read only o write only or o read write these requests open the file in read only, write only, read write so this then the operating system is doing the permissions and if we open a file for read only and we try to write to it the operating system will tell us no you can't write to this file we can open a file for reading only where we can't for writing where we can't actually read to it so that's where we can find that in here so let's walk through this so our assembly code is first going to move this 4000 into rdi it so that's in that register it will move this value into rax it's then going to move rax and write it into rdi so which byte in this value is going to be the most is going to be written at exactly this memory location with the endian nest here 2f which is what in ASCII I know it because I do this stuff a lot but there's like one of the things that actually comes up a lot 2f it's a slash it kind of makes sense we're opening a file slash if you had to put money on it what'd you say 6x is 6c l 6 1 a 6 7 g and 0 is the null byte let's see if we are correct so if we're correct then after this instruction executes at this memory location of 54 which should be up here we should see slash f l a g and this on the right is showing us the ASCII values of these bytes move 0 into rsi 0 into rdx so it turns out o read only is 0 we'll show how to actually look that up later and then we move 2 into rax why are we moving 2 into rax because that's what the syscall table told us so open corresponds to 2 we will call syscall and then that goes into the operating system the operating system will then with our process read the bytes that we pass in for the first memory address here it will read it actually from our process which is kinda cool and it will say oh slash f l a g is what they're trying to execute and it will return 3 as the file descriptor in this example and so after that yeah that's actually seen here so after the syscall so the operating system does some complex stuff then it goes back and our program resumes control and now rax has the value of 3 which is the file descriptor that the operating system wants us to use so this is part of the syscall the syscall calling convention is it puts the return value in rax that we can then use ok cool oh yeah look at all them system calls and that's how we can get stuff done alright thank you sorry I went late


I guess it just depends on where you get your energy. Some people get their energy from other people.  Some people, other people drain their energy so they just can't be around other people. Like they gotta, me personally, I like to recharge my batteries like inside. Like I can't be outside. The moment I'm outside too much, my discomfort start to show. What about people that say, you know, they get the energy from the earth and from the sun and all that. You believe in that? Yeah, I mean this is where we, this is where we live, you know what I'm saying? This is where we come from earth. That's me, I'm one with the earth. I'm brother nature. I don't believe in this. I'm brother nature. I go sit in the back yard.  Nah, nah, look, because every other organism get their energy from the sun. From the sun.  I'm brother nature. So I gotta do things like that.


So I thought every week let's do that. During the NFL's postseason era, when people are fighting for a Playoff spot, let's just pick the favorites based off of what Vegas is saying, what are the odds, who's favorite to win each game, and then see how that updates the Playoff picture. So for week 16, let me go ahead and flip this over to my computer and show you guys this Playoff Simulator right over here. Okay, so we've got the Thursday night game, right, between the 49ers and the Titans. According to Vegas right now, the favorites are the 49ers to win on the road. Surprisingly, three and a half point favorites, so let's go ahead and click them to win, right? How does that update the Playoff picture? Well, now you've got the 49ers down here at nine and six at the sixth seed, and then the Titans at third seed. So it doesn't really affect it that much just based off of one game. That just gives you an idea of, okay, how this little Playoff Simulator works. Now let's go over to Christmas Day, however, with the Browns and the Packers. Looking at those games, we've got the Packers as seven point favorites in that game. So they win, they stay atop as the number one seed in the NFC. For the Browns, though, they're not an AFC Playoff contention right now, and if they lose this game, it's going to be very, very hard for them to get into the AFC wild card moving forward. And then for the Colts and Cardinals, in that game, the Cardinals are a favorite to win, but only by one point. So the Colts are actually favorited to keep this game kind of close, but the Cardinals are going to win, and that updates their record. And again, nothing really is happening in this Playoff Simulator right now. So after Thursday, after Saturday's games, after Christmas, it's not going to be affected by that much. But then you get into Sunday, then you get into Monday. Let's just pick those games and see who's going to win and what are the odds, like what's going to happen after these games were to occur. So first I'll start off with the Lions and the Falcons. The Falcons are six-point favorites. Let's pick them, right? Then the Bucks and the Panthers. We've got the Bucks as 11-point favorites. Pick them to win. All of a sudden, they move up to the second seed. Okay, okay, okay. And then we've got the Ravens and the Bengals, AFC North Battle. Between this game, we've got the Bengals as the favorites. So if we pick them, currently, the Bengals are the fourth seed. We pick them, they move on up to the third seed after the outcome of that game if they were to beat the Baltimore Ravens. Between the Chargers and the Texans in that game, we've got the Chargers as nine-and-a-half point favorites. Pick them to win. They move up. Actually, no, they stay at the fifth seed right there. Between the Rams and the Vikings, that should be a good game. I think it might be more high-scoring. The Rams and the Vikings, I think the Rams are the favorites right here. Yeah, three-point favorites. So they win. Minnesota now loses their seventh seed, which is big, and the Rams continue to make a statement in the wildcard race. You've got the Bills on the Patriots in that rematch. It won't be that windy anymore, so hopefully the Bills have a chance of winning. But the Patriots are still the favorited ones to win in this game. So the Patriots, two-and-a-half point favorites, they move on up to the second seed. That does affect the wildcard picture for the Bills, because if the Bills were to win this game, that affects the seventh seed. You've got Pittsburgh now moving up. The Bills are up in the fourth seed. So even just by one single loss, the Patriots win. The Bills automatically are out of the AFC wildcard race if the playoffs were to start after week 16. Between the Jaguars and the Jets, and our power rankings is number 32 versus number 31, who's favorited to win in this game? In this game, we've got the Jets actually as the favorites. So let's pick them. It doesn't really affect the AFC playoff picture, because both teams are eliminated at that point. Now we've got the Giants and the Eagles to play in the early window, and the Eagles are big favorites, 10-point favorites, and they continue to ride as the seventh seed. And so that's your early afternoon window right there. This is what the playoff picture would look like if all those games went to the favorited ones. And now let's transition into the late afternoon games. You've got three of them. You've got the Bears and the Seahawks, and in this game, the favorited wins are the Seahawks. Let's see by how many points, yep, minus six and a half. So if we picked them to win, how does that affect the NFC playoff race? It doesn't really affect it. The Bears are eliminated. The Seahawks need a lot of help to get into the playoffs. Now for the Sears and the Chiefs, this is big for seeding and for the Steelers that are 7, 6, and 1, the Chiefs are 8.5-point favorites. So if we picked them to win, all of a sudden you've got the Steelers going outside of the NFC playoff picture. So this is, you could consider it a must win for the Steelers going into week 16. The Chiefs stay on top of the first seed. For the Broncos and the Raiders, I believe the Raiders are the favorite in this game because Drew Locke is going to be starting, and yes, but it's only by one point. So if we picked the Raiders to win, even if it's by a point, how does that affect? Yep, Las Vegas now moves up to the 7th seed, and for the Broncos, it makes it more and more tough to make the AFC playoff picture. So that's after the late afternoon window games. Now you've got the 7-9 football game between Washington and the Cowboys. You could consider this a must win for Washington at this point, so they got 6-8 for the Cowboys. The 10-4, they look kind of pretty in the lead with the NFC East, but if they're the favorites to win in this game, which they are 10-1 half point favorites, then you've got them now moving up to the 2nd seed. So it was the Bucks and the Cardinals that were number 2 and number 3. The Cowboys immediately move up from the number 4 seed to the number 2 seed, inching closer and closer to the number 1 seed, which Green Bay is kind of running away with it. But let's see what happens after week 16. And then the Monday night football game between the Dolphins and the Saints. It does affect the playoff picture just a bit, but in this game we've got the Saints as the 3-point favorites, Dolphins on a little bit of a win streak, but Saints are favorite to win. And after all the simulations, all the favorites are winning, it doesn't really affect the playoff picture. So after week 16, if the favorites were to win this game, this is what it would look like. You've got the Chiefs and the Packers still on top of the number 1 seeds of the respective conferences. Now for the playoff picture, you've got Las Vegas down jumping up into the wild card race. Cincinnati is just making a claim and they're moving up and up and up. And then the Colts as well, even though they were to lose this game, they will still stay at the 6th seed. Over on the NFC side, you've got the Cowboys. Again, the biggest thing is they move up to the 2nd seed and the Buccaneers and the Cardinals drop down. Even if they were to win the respective games, the Cowboys would move on up because of tiebreakers and things of that nature, even though they're all 11 and 4. But that is your playoff simulator if all the games were to be simulated and won by the favorites this week in week 16. We're going to come out with our weekly picks where we ask the fans and we give you our opinions on who we think is going to win, but this is just based off the favorites. So leave your thoughts in the comments down below.


Hi and welcome to the session. I am Asha and I am going to help you with the following question that says Find the 28th term of the series 2 into 4 plus 4 into 6 plus 6 into 8 plus so on to n terms Now let us start with the solution and let us denote the sum where s which is 2 into 4 plus 4 into 6 plus 2 n terms Now the nth term of the series will be 2n into, first let us replace n by 1 so it can be written as 2 into 1 into 2 into 1 plus 2 The second term can be written as 2 into 2 into 2 into 2 into 2 plus 2 So the nth term can be written as 2 into n into 2n plus 2 or it can further be written as 2n into 2 times n plus 1 which is equal to 4 n into n plus 1 so this is the nth term and we have to find the 20th term So replacing n by 20 we have 4 into 20 into 20 plus 1 which is equal to 4 into 20 into 21 or 4 into 20 is 80 into 21 which is equal to 1680 therefore the 20th term is equal to 1680 This completes the session, take care and have a good day


I welcome members to the 10th meeting in 2015 of the Delegated Powers and Law Reform Committee and ask members to send off mobile phones, please. Agender item one is a decision on taking business in private. It's proposed that we take item five in private. This is consideration of the committee's third quarterly report for the parliamentary year 2014-15. Does the committee agree to take this item in private, please? Agender item two is instrument subject to affirmative procedure. No points have been raised by our legal advisers on the Scottish Marine region's order 2015 draft. There is, however, an issue which, while not a matter for this committee, the committee may wish to draw to the attention of the lead committee. The boundary between Scottish and English waters within the territorial sea is set out in the Scottish adjacent waters boundaries order 1999, and this forms the boundary of the Scottish marine area under the Marine Scotland Act 2010, which is the parent act under which the present order is made. The order therefore uses the 1999 order to describe the limit of the Solway marine region. In conceptual terms, the landward limit of the territorial sea is the mean high water mark of spring tides. It is a recognised feature of estuary areas such as the river S within the Solway area. This limit can change from time to time. One of the purposes of the 1999 order was to provide a defined boundary which would not change. However, I am examining the high resolution map of the area as it now stands. The boundary line set up in the 1999 order no longer extends fully to the point now reached by the mean high spring tide. It appears that the 1999 order boundary is out of date in this respect. The effect appears to be that there is a small part of the boundary line for the sea within the Solway marine region, which cannot be fully delineated by this order. Does the committee agree to draw this matter to the attention of the lead committee? We certainly should. I do make the observation that, just before coming down to the committee, I looked up the map because I wanted to explore it in more detail. I find that an additional line has been inscribed on the map, which takes the current end of the line, which is a couple of hundred metres short of meeting the Scotland-England border, and joins that point to an extension of the boundary that comes down the River Sark, thus filling that gap on the map. I recognise that there is no effect on the legislative expression of the boundary, which we are talking about, but at least it suggests that the issue that we are talking about appears to be recognised and an attempt on the map to reflect what would be sensible is there. We should make sure that, when we communicate with our committee, as I agree, we should do, we at least draw that to their attention. That might enable them to pursue on what basis officials have added that bit of line, which is sensible in practice, if not necessarily in law. I agree with Stuart Stevenson on that regard. I think that we should write to the Rural Affairs Committee. I commend the investigative qualities of my colleague Stuart Stevenson for having been so diligent as to discover this fact, but 200 metres is quite in law a significant distance, and it is entirely appropriate that this is very much drawn to the attention of the Rural Affairs Committee. Dender Item 3, instruments subject to negative procedure, the local government pension scheme Scotland amendment regulations 2015, SSI 2015-87. A number of points have been raised on this instrument by our legal advisers. Firstly, the drafting appears to be defective, and that there are two errors which the Scottish Government has acknowledged to be errors, and which the committee may consider impede the intent to operation of the instrument or fail to give effect to the policy intention. The committee may therefore wish to report the instrument on ground I as its drafting appears to be defective. Secondly, there are two further provisions, the meaning of which could be clearer, and the committee may accordingly wish to report the instrument under reporting ground H. Finally, there are further five drafting errors which on balance the committee may consider do not impede the delivery of the Government's policy, but which fall to be reported under the general ground. Does the committee therefore agree to draw the instrument to the attention of the Parliament under reporting grounds I, H, and the general reporting ground? Thank you. The committee may wish to note however the Scottish Government has indicated that the errors will be corrected by an amending instrument to be made after the 1st of April 2015, but having retrospective effect from that date. The Reservoirs Scotland Regulations 2015, SSI 2015-90. Regulation 10 specifies the period of appointment of engineers as additional information that must be set out in the controlled reservoirs registered. However, section 92F of the Reservoirs Scotland Act 2011 already requires this information to be included on the register. Specification of an existing legal requirement as additional is not necessary and called course confusion. The committee may consider that there is a statutory charge is imposed, sorry, that where a statutory charge is imposed, the person on whom it is to be imposed should be clearly identified. Regulation 17-2 could more clearly distinguish the liability of the former manager for payment of the cessation fee from the liability of the new manager for the payment of the new manager fee. Does the committee therefore agree to draw the instrument to the attention of the Parliament under reporting ground H, as the meaning of Regulations 10 and 17 could be clearer? Jim. Can I just convene the Regulation 17.2? I'm not certain if the Government is intending to do anything about this, which I find disappointing, because this is quite a serious error in as much as the liability for who pays what is definitely unclear. I'm disappointed that the Government apparently, from my understanding of the situation, are not prepared to do anything to address that. It may be that we could roll them up because Regulation 8 is intended to specify the structures which are road and railway embankments. However, the expression roads and railway embankments, which has a different natural meaning, is used in error. Does the committee therefore agree to draw the instrument to the attention of the Parliament under general ground as there has been a drafting error in Regulation 8? The Government has agreed to address the matters reported in relation to Regulations 8 and 10 at the next opportunity. The committee, following what John Lewis just said, may wish to ask the Government to clarify the drafting of Regulation 17.2 at the same time. The National Health Service pension scheme Scotland Regulations 2015, SSI 2015-94, and a number of points have been raised on this instrument by our legal advisers. Firstly, the drafting of the instrument appears to be defective in that there are seven errors that the Scottish Government has acknowledged to be errors and which the committee may consider to impede the intended operation of the instrument or fail to give effect to the policy intention. The committee may therefore wish to report the instrument on ground I as its drafting appears to be defective. There is a further provision, the meaning of which could be clearer, and the committee may accordingly wish to report the instrument under reporting ground H. There are also further seven drafting errors, which on balance the committee may consider to do not impede delivery of the policy intention, but which fall to be reported under the general ground. Does the committee therefore agree to draw the instrument to the attention of the Parliament under reporting grounds I, H, and the general reporting ground? Committee may wish to note, however, that the Scottish Government has indicated that the errors will be corrected by an amending instrument to be made after the first of April 2015, but having retrospective effect from that date. The committee may also wish to note that while the Scottish Government has explained in its response the limited timing available for the drafting and commission of these regulations, it is very unsatisfactory for the instruments to have been laid before the Parliament containing the number of errors identified above. In particular, several of the errors related to discrepancies in defined expressions, the omission of definitions or omitted or patently incorrect wording, which it appears should have been picked up by the Scottish Government checking procedures. Do members have any comments? John? Yes, I mean, you use the phrase limited timing available and I just wonder, I'm assuming that that starts off with the treasury, that this is not entirely under the control of the Scottish Government, and that doesn't entirely excuse them, I accept, and others might want to comment on that, but I just wonder, if we're recognising that the treasury has not allowed sufficient time going forward, how can we encourage the treasury to allow sufficient time in future? What's fairly made, any other? I feel it would be not without wishing to be unreasonable. I think it's fair to say nonetheless that this is the Scottish Government's liability to get it right. This workload in terms of the whole pension provision, not just in this instrument, but on others, was entirely foreseeable, and it would have been reasonable, in my view, to have made provision for these instruments to be properly checked. In that regard, at the appropriate time, albeit a short or even a truncated timescale, it is nonetheless the Scottish Government's liability. I think it would be fair to say that these instruments are a mess, that the quality control procedures do not appear to have either been put in place at all or they're not working, take your pick. It appears to be falling to our very valued clerks and legal advisers to be picking up the obvious elementary mistakes that the quality control procedures put in place allegedly by the Scottish Government should be picking up, and that that should not be a burden that's placed on our legal advisers to do. Was I asking a question? How can we change this for the future, or is it just totally out with our control? Can we encourage the Government to speak to the Treasury or, presumably, we can't speak to the Treasury directly? I think that your suggestion about us encouraging the Government is basically right, because clearly the Treasury is not responsible to us and it needs not respond to us. The obvious thing to do is simply to write to the Minister for Parliamentary Business, pointing out things that he will, of course, already know, and encouraging him to see if he can get a better working relationship with the UK Government. But, fundamentally, it is about timing, isn't it? Are members agreed that we're going to write about the collection of errors across the whole of this to the Minister for Parliament as well? Yes, certainly that would be my view for the committee, of course, to agree, but there are a succession and a series of not hugely complicated errors throughout all of these orders, as I think I said before, that should have been picked up in the quality control process, do not appear to have been picked up, which leads me to the conclusion that the quality control process has not been used. In which case we will write accordingly. The national health service pension scheme transitional and consequential provisions Scotland regulations 2015, SSI 2015 at 95. The regulations contain a minor drafting error as regulation 38.1 refers to transitional member in two places rather than transition member, which is the expression defined in regulation 2. Does the committee therefore agree to draw the regulations to the attention of the Parliament on the general ground? Committee may wish to note, however, the Government has undertaken to address by way of an amending instrument, as and when the regulations are subsequently amended for another purpose. The national health service superannuation scheme miscellaneous amendments Scotland regulations 2015, SSI 2015 at 96. The drafting of this instrument appears to be defective in two places. Firstly, in regulation 25a there is an error as the provision should have substituted for the scheme year 2015-16 in place of for the scheme year 2014-2015 instead of inserting the formal words in regulation 2c2 of the national health service superannuation scheme 2008 sections Scotland regulations 2013. Secondly, regulation 25c omits regulation 2c23 and 4 of those principle 2013 regulations. There is an error as this has retained regulation 2c25, which refers to the determination of pay bans and contribution rates by the Scottish ministers in respect of each scheme year in accordance with the omitted provision in regulation 2c24. Regulation 2c25 provides that, before determining those rates or bans, the Scottish ministers must consider the advice of the scheme actually. Does the committee therefore agree to draw the regulations to the attention of the Parliament on reporting ground i as drafting appears to be defective? The committee may wish to note that Scottish Government is undertaken to correct the errors by means of an instrument which would further amend the national health service superannuation scheme 2008 section Scotland regulations 2013. The instrument would be made after 1 April but would have retrospective effect from that date. The teachers pension scheme Scotland amendment regulations 2015, SSI 2015-97 in the amendment made by regulation 32a of this instrument, the reference to if sub paragraph 1 or 2 applies, should read if sub paragraph 1a or 1b applies. That is the committee therefore agrees to draw the instrument to the attention of the Parliament on the general reporting ground as it contains a minor drafting error. I agree with that. I would be grateful if this could be also corrected. The note that we have suggests that it is undertaken to correct. All of these instruments should be corrected at the same time and not in a hap hazard way as the difference responses of the different notes that we have at NRE appears to suggest that some will be corrected as a matter of urgency and some won't. That could I just suggest that we're all reviewed and all corrected at the same time and then we'd have pension schemes that are fit for purpose. Indeed, I'm sure the member will recognise that it won't all come through in the same amending regulation but I take this point. Thank you. The teachers superannuation Scotland amendment regulations 2015, SSI 2015-98, three minor drafting errors have been identified in relation to this instrument by our legal advisers. Firstly, in the amendment made by regulation 5, the incentive text should read regulations G6, G12, G17 or G23 instead of regulations G6, G12, G17 and G23. Secondly, the amendment made by regulation 11B should substitute a reference to regulation G9, G14, G21 or G24, not regulation G82, G13, G22 or G24. Finally, regulation G28 inserted by regulation 13 should have said regulation G24 inserted by regulation 13 should cross revert to part 3 of schedule 12 and not part 2 of that schedule. Does the committee therefore agree to draw the instrument to the attention of the Parliament on general reporting ground as it contains three minor drafting errors? The committee may wish to note however that the Scottish Government has undertaken to address these errors by way of an amending instrument. Turning now to the Food Scotland Act 2015, consequential and transitional provisions order 2015, SSI 2015-100. Article 2, when read with paragraph 8 of the schedule directs an amendment to the definition of the agency in regulation 21 of the genetically modified organisms deliberate release Scotland regulations 2002. It appears that the amendment should however be to the definition of the food standards agency. It further appears that to substitute the term food standards Scotland for food standards agency within that definition renders it insensible. This is because the food standards agency is defined by the Food Standards Agency as established under section 1 of the Food Standards Act 1999. The definition does not work with the substituted words Food Standards Scotland as the latter body is established under the Food Standards Act 2015. Does the committee therefore agree to draw the instrument to the Parliament's attention under reporting ground I as it appears to be defectively drafted? Some further points have been raised on this instrument by illegal advisers. Firstly, article 2 defines the terms the act, the 2015 act, the 1991 act and the agency. Did I say something different? The 1999 act. I do apologise, it's one of those mornings and the agency none of those terms are used further in the order and therefore superfluous. Secondly, article 2 provides that the regulations specified in the schedule are amended by substituting Food Standards Scotland for Food Standards Agency. The reference to Food Standards Agency should be to the Food Standards Agency in order that the amended regulations read sensibly. Finally, paragraph 26 of the schedule read in accordance with article 2 directs an amendment to regulation 13 to A2. I'm not having a good morning am I? How can I read 16 as 30? 16 to A2 of the transmissible spongiform encephalopathies Scotland Regulations 2010. However, no such regulation exists. It appears the reference is a duplication of the latter reference to paragraph 16 to A2 or schedule 7 to the 2010 regulations and is therefore Otis. Does the committee therefore agree to draw the instrument to the Parliament's attention under the general reporting ground? Thank you, convener. You've just illustrated the difficulty, of course, in doing what we do and drafters doing what they do and the difficulty of being accurate. Nonetheless, article 2 in this instrument does not appear to be anyone's finest hour as it ranges from the supplier for us to a lack of making sense completely. I would just encourage everyone to go back and have another go at making sense of article 2. We'd also need to draw this to the attention of the Parliament. No points have been raised by our legal advisers on the national health service, clinical negligence and other risks in demnity scheme Scotland amendment regulations 2015, SSI 2015, 102, nor on the alien and locally absent species in aquaculture Scotland regulations 2015, SSI 2015, 103. Is the committee content with these instruments, please? Which brings us to agenda item 4, instruments not subject to any parliamentary procedure. The Food Scotland Act 2015 Commencement Order 2015, SSI 2015, 99. Article 2 specifies the first of April as the date on which the Food Scotland Act 2015 will come into force, so far as it is not already in force. However, it does not include a year. Specifying an incomplete date, the instrument fails to fully achieve its policy objective. Does the committee therefore agree to do all the instruments of the Parliament under a reporting grant, I, as it is defectively drafted? My understanding is that the Government does not intend to do anything other than issue a correction slip in this regard, which I feel is inadequate. I feel that another instrument should not be laid, given that the instrument, as it stands, fails to achieve its policy objective, notwithstanding a correction slip. I will just make a plea for doing it properly when we are doing it. I do think that this is relatively serious in that it could be interpreted in other ways. It could be 2015, 2016, 2017 or whatever. Other amendments or errors, sometimes there is no other meaning, but in this case I think there could be another meaning, which makes it more serious in my opinion. The other thing that I bring to the committee's attention is that I understand that this actually brings into force sanctions, although they are not criminal offences. They will feel a bit like them to be in any way uncertain as to whether or not they have been introduced seems to me to be, well, frankly, bad law and something that we should encourage the Government to avoid. The committee makes it to that it is highly unsatisfactory that the Government has proposed to amend this by way of a correction slip and may therefore wish to call on the Government to lay a further instrument to correct this error as a matter of law before the intended commencement date on the 1st of April. Are we agreed with that? I think we are. Yes, thank you. No points have been raised by our legal advisers on the Children and Young People Scotland Act 2014, commencement number eight and saving provision order 2015, society 2015, 104. Is the committee content with that instrument, please? Yes. Thank you. Well, it brings us to the end of agenda item four and therefore the public part of this meeting. Thank you.


Piedak 2023. We're talking to Rebecca Hunter. She's with Forum Energy Metals. Rebecca, how are you today? Very good. Thank you. Now, Forum Energy, I was actually just sent an email about you this morning from our publisher, Chris Thompson. Can you tell us, can you tell our audience, along with me, who is Forum Energy? And by the way, your second person today that has brought up Forum Energy to my attention. Okay, well, we're primarily a uranium company, but we also have energy metals. So we've kind of pivoted a little bit. So we have a really good copper project and we have some cobalt nickel all in Saskatchewan, one small project in Idaho, and then Nunavut. We have also a uranium project up there. Actually, that is very, very interesting to me. So what was your most recent news release that the company has put out? The most recent news release has been our Grease River. We're in an option agreement with another company, Traction Uranium. And so we're working with them to look at a kind of a new kind of frontier sort of structure on the north end of the Athabasca basin. There's a lot of companies out there in the critical mineral sector right now in North America. So I like to ask companies, you got a lot of investors out there on the tarmac. You're undoubtedly an intriguing company. Like I said, I've received two emails about you and a couple of people have told me I need to find out more about your company. What would you say is one of the most competitive reasons why a shareholder or an investor should be watching your company? I think it's because of our portfolio and like one of our energy metal ones that's really good is our copper project, Janus Lake. And so just a really underexplored district with a really good copper potential. And then the rest of our Athabasca, we've been like Rick, started the company in 2004. We've been working in Uranium since then. And so we just have a really good portfolio. And then again, our new acquisition in the Thelon basin is super exciting. Well, I'll tell you, Rebecca, I look forward when I get back to my office after PDAC to get more information on the company, we'll follow up with you. It sounds very interesting. Thank you. Thank you for joining us today. Thank you.