1 00:00:05,060 --> 00:00:12,880 Hey, thanks everybody for showing up so early. So, yeah, I talk about extensor-based Qualcomm 2 00:00:12,880 --> 00:00:20,300 Wi-Fi chips and so why even looking at Wi-Fi chips? So, my opinion, these Wi-Fi chips are 3 00:00:20,300 --> 00:00:25,820 pretty powerful chips, so even though they are just intended to be to run, to do your Wi-Fi 4 00:00:25,820 --> 00:00:32,800 stuff, right, they are still general purpose CPUs, so you in theory can run any software on it, 5 00:00:32,960 --> 00:00:39,980 but the problem is the proprietary binaries which come with those chips, they make it difficult to 6 00:00:39,980 --> 00:00:46,980 run your own code. And why would we even want to run our own code? So, what we could do is enable 7 00:00:46,980 --> 00:00:54,840 additional functionality, I have a few examples in a few seconds, and we could also make security 8 00:00:54,840 --> 00:00:55,720 research easier. 9 00:00:55,820 --> 00:01:04,780 So, in case we manage to enable dynamic analysis, security researchers have it easier to identify 10 00:01:04,780 --> 00:01:14,660 bugs and report them to the vendors. So, some examples for additional features which we want 11 00:01:14,660 --> 00:01:20,740 to enable is, for example, we can enable monitor mode on chips which is not available by default. 12 00:01:21,040 --> 00:01:25,480 For example, this is monitor mode on a Qualcomm-based chip running on a Nexus 5. 13 00:01:25,820 --> 00:01:32,640 Which is not available by default, and then you can use your standard Wi-Fi tools like 14 00:01:32,640 --> 00:01:41,660 AeroDump and so on. We could also build a complete state machine for Berkeley packet 15 00:01:41,660 --> 00:01:49,760 filtering inside the firmware, and then compile our rules for packet filtering on the user space, 16 00:01:50,040 --> 00:01:55,160 upload them via the kernel to the firmware, and run them directly into firmware. So, that way we 17 00:01:56,180 --> 00:02:00,880 save some power when we do monitor mode, basically. 18 00:02:02,140 --> 00:02:10,220 And if we have access to even deeper layer firmware code, we can also implement stuff 19 00:02:10,780 --> 00:02:15,660 which is closer to the physical layer of Wi-Fi. So, here's an example of a pilot tone jammer, 20 00:02:15,680 --> 00:02:24,740 which only jams the pilot tone of OFDM to be very power efficient. So, now that we have all these 21 00:02:25,820 --> 00:02:32,980 great goals in mind, so let's take a few steps back and look at the bigger picture. 22 00:02:33,400 --> 00:02:38,800 So, in general, there are two kinds of Wi-Fi chips, so, FullMEC and SoftMEC chips. 23 00:02:39,360 --> 00:02:46,400 We will look at FullMEC chips in this talk. The biggest difference is that FullMEC chips run the 24 00:02:46,400 --> 00:02:53,180 MEC layer inside the firmware. This means, if you want to change something in the VMware or the 25 00:02:53,180 --> 00:02:55,800 MEC layer, you have to to change the F dried web func to the F persisting. The most frequent toi 26 00:02:56,540 --> 00:03:05,520 so those it's not possible to do these changes on the driver itself so the examples I have shown in 27 00:03:05,520 --> 00:03:14,220 the previous slides of stuff which we could want to enable this was based on on the the next one 28 00:03:14,220 --> 00:03:22,880 framework so this was I developed this or together as a colleague of mine again my time at the 29 00:03:22,880 --> 00:03:30,000 University so this enables us to so this framework will be used to modify procom chips and we even 30 00:03:30,000 --> 00:03:37,040 managed to get deep modifications working as this this Gemma I should earlier and you can you can get 31 00:03:37,040 --> 00:03:44,480 it at next month at org and apart from procom there was also work done on bracket 2020 about 32 00:03:44,480 --> 00:03:51,160 Intel based chips and there was also a talk about Hexabon hexagon based Qualcomm chips on Defcon 33 00:03:51,160 --> 00:03:52,500 27 and bracket 2019 34 00:03:52,880 --> 00:03:58,840 but this talk is the first talk to explain extensor based Qualcomm Wi-Fi firmware 35 00:04:01,200 --> 00:04:10,380 so some background how to do how our Wi-Fi socks structured so normally you have an application 36 00:04:10,380 --> 00:04:19,580 core and then you separately you have your Wi-Fi core so and optionally in some cases you also 37 00:04:19,580 --> 00:04:22,600 have like a real-time core which 38 00:04:22,880 --> 00:04:27,620 handles like time critical stuff like the distributed coordination function in Wi-Fi 39 00:04:29,120 --> 00:04:36,180 um and now for the the chip which we will look at um there are like several drivers 40 00:04:36,180 --> 00:04:43,580 um available so uh there's adh 10k by Qualcomm directly and also a corresponding firmware with 41 00:04:43,580 --> 00:04:51,420 that and then there's adh 10k CT by candela tech so this is interesting so candela tech bought the 42 00:04:51,420 --> 00:04:52,120 rights from 43 00:04:52,880 --> 00:04:59,100 Qualcomm a time ago some time ago and they have their own driver and their own firmware so they 44 00:04:59,100 --> 00:05:06,260 got the source code somehow from from Qualcomm and added additional features and so basically you 45 00:05:06,260 --> 00:05:14,020 have a complete separate kind of driver and firmware in addition to the original Qualcomm 46 00:05:14,020 --> 00:05:22,320 driver and firmware and lastly there's also the QCL QCA CLT driver by Qualcomm this is used for a 47 00:05:22,320 --> 00:05:30,600 factory processes and also what you can do is you can use the candela tech driver and run the 48 00:05:30,600 --> 00:05:38,440 qualcomm firmware that is also possible so this is the chip and the board I have looked at it's the 49 00:05:38,440 --> 00:05:47,820 IPQ 4019 it's based on a development board by eight devices this board is called habanero and 50 00:05:47,820 --> 00:05:51,680 in the middle of it you can see the the the jpr 51 00:05:52,360 --> 00:05:57,980 we are interested in and this is basically a development board for wi-fi enabled home routers 52 00:05:59,200 --> 00:06:07,340 so um what does this port so this chip look like from the inside so as i said this is um used for 53 00:06:07,920 --> 00:06:14,420 for wi-fi enabled home routers and one of the big vendors in germany is also using it so this is avm 54 00:06:14,420 --> 00:06:22,700 the fritz box and apart from this the chip consists of as i explained before also of an 55 00:06:22,700 --> 00:06:28,720 application core multiple wi-fi cores and the application core runs on openwrt in this case 56 00:06:28,720 --> 00:06:34,600 with a pretty old kernel and for wi-fi they have one core for 2.4 gigahertz and one for 57 00:06:35,100 --> 00:06:39,260 five gigahertz and they use a pcie to communicate with each other 58 00:06:41,300 --> 00:06:43,160 so now to the firmware itself 59 00:06:44,660 --> 00:06:54,360 as i said it's a extensa based firmware extensa is initially was initially developed by tensilica 60 00:06:54,740 --> 00:07:04,640 but now it was bought for by by cadence and it's on a little indian firmware it comes it consists 61 00:07:04,640 --> 00:07:12,100 of a rom part and a ram part the ram part of this firmware is stored in the file system of the open 62 00:07:12,100 --> 00:07:13,660 wrt and 63 00:07:14,420 --> 00:07:20,800 contains multiple segments one that later and it's lc77 compressed the rom can be patched 64 00:07:21,340 --> 00:07:27,100 and there is also a code swap mechanism which allows you to uh which allows the wi-fi core 65 00:07:27,100 --> 00:07:33,820 to evict code from its own memory space to the host memory space and of course there is no 66 00:07:33,820 --> 00:07:38,100 security enabled by default so no secure put no stack can raise no addressing randomization 67 00:07:40,360 --> 00:07:43,020 um what's also nice is that there is already 68 00:07:44,420 --> 00:07:51,320 comes this debug.fs which you can compile into your driver and this allows you to get 69 00:07:51,320 --> 00:07:57,720 direct memory access via this mem value file so you can directly read and write memory 70 00:07:58,300 --> 00:08:04,280 directly into the chip. There is also a debug mask which is very useful which you can set 71 00:08:04,280 --> 00:08:10,100 for example during initialization of the kernel module to increase the verbosity of 72 00:08:10,100 --> 00:08:17,140 the driver itself. Also the interfaces which are used between basically the application 73 00:08:17,140 --> 00:08:23,100 core and the Wi-Fi core, so there are two interfaces, the PMI interface, the bootloader 74 00:08:23,100 --> 00:08:27,540 management and messaging interface is used during boot up and it's implemented in ROM 75 00:08:27,540 --> 00:08:33,360 so basically during boot up this is used to start up the chip, then after boot up the 76 00:08:33,360 --> 00:08:40,080 WMI is used to communicate with the chip and this is mostly done to send a message to the 77 00:08:40,100 --> 00:08:44,740 driver and commands like please now start Wi-Fi scanning, do channel configuration and 78 00:08:44,740 --> 00:08:52,080 stuff like that. So this is how the loading looks like, so the driver offers two methods 79 00:08:52,080 --> 00:09:01,460 for loading firmware either via the PMI method or via a copy engine and because in our case 80 00:09:01,460 --> 00:09:06,840 we have a compressed firmware we need to use the PMI method and what's basically happening 81 00:09:06,840 --> 00:09:10,080 is that the firmware from the file system is being sent to the driver and then the 82 00:09:10,100 --> 00:09:15,940 firmware is passed through the driver via PMI to the Wi-Fi core and is then uncompressed 83 00:09:15,940 --> 00:09:24,760 on the Wi-Fi core itself. So this is the file structure of the firmware file, so basically 84 00:09:24,760 --> 00:09:30,920 there are two big parts, like this upper one and this lower one, they are identified 85 00:09:30,920 --> 00:09:38,160 with an IE header and then after this there is the segment header and this is identified 86 00:09:38,160 --> 00:09:39,200 with these maps. 87 00:09:40,100 --> 00:09:42,740 So if you look at the magic values here, it will tell you if it's compressed or not 88 00:09:42,740 --> 00:09:47,880 and on which address it should be loaded into the chip and it will also tell you what's 89 00:09:47,880 --> 00:09:55,480 the decompressed size of this segment. And if you notice already there are in this case 90 00:09:55,480 --> 00:10:01,860 the first part and the second part have the same address, so this means that they get 91 00:10:01,860 --> 00:10:09,700 overwritten. And then apart from the segment header there is also the submitter data as 92 00:10:10,100 --> 00:10:14,480 I just explained and then basically after this the real data starts and then it's compressed 93 00:10:14,900 --> 00:10:21,180 and after this the next metadata starts in the next part of the firmware data, which 94 00:10:21,180 --> 00:10:29,880 is also compressed. So basically why these two separate parts is, my assumption is that 95 00:10:29,880 --> 00:10:38,440 the first part is just needed for boot up and you can also see it's much smaller in 96 00:10:38,440 --> 00:10:40,080 size than the second part. 97 00:10:40,100 --> 00:10:46,180 And after this we can basically override it with the real firmware code. 98 00:10:47,080 --> 00:10:53,540 And if you look at the driver logs you will see this whole process being done twice and 99 00:10:53,540 --> 00:10:58,700 I assume this is done to load up the first Wi-Fi core and the second Wi-Fi core. 100 00:11:00,960 --> 00:11:10,020 If you look at the memory layout we can see that it's repeating. So if you just do a long 101 00:11:10,100 --> 00:11:16,420 enough read of your address space you will see these patterns and my assumption is that 102 00:11:16,420 --> 00:11:24,440 this is used to realize different memory access rights. So you can have the same memory 103 00:11:24,440 --> 00:11:30,240 on different offsets and depending on offset you can realize different access rights. 104 00:11:33,820 --> 00:11:40,080 Then to the extensor architecture, so there are two major things I want to point out. 105 00:11:40,080 --> 00:11:48,540 About this architecture, which were new to me and which also came with some problems. 106 00:11:48,820 --> 00:11:54,420 So the first one is the use of literal pools. So each load instruction, so this is just 107 00:11:54,420 --> 00:12:00,560 a load instruction, instead of being PC dependent it's basically independent of that and you 108 00:12:00,560 --> 00:12:06,620 just calculate an offset to a fixed literal base to get an immediate value. 109 00:12:07,540 --> 00:12:10,060 And in addition to that there is also a lot of other things that you can do. 110 00:12:14,080 --> 00:12:21,560 There are also like windowed registers and so this means that, so that way I explain 111 00:12:21,560 --> 00:12:29,120 it in a second, but what it's used for is basically to not needing to store and to save 112 00:12:29,120 --> 00:12:34,440 and restore your registers when you call a function. So here in this example you can, 113 00:12:34,700 --> 00:12:40,060 it's using call eight, so there can be different values here. 114 00:12:40,060 --> 00:12:48,860 Four or twelve or whatever. But my firmware used call eight and if you load a value in A10 115 00:12:48,860 --> 00:12:52,300 and you call a function it will be available in A2 of the callee. 116 00:12:55,400 --> 00:13:01,220 Okay, so this is how these window registers look like. So basically you have these overlapping 117 00:13:01,220 --> 00:13:09,220 sections in your memory space and you have like way more registers than you need for one 118 00:13:10,060 --> 00:13:15,780 function and that way they can just shift the window for each function call if you have nested 119 00:13:15,780 --> 00:13:25,680 functions and they can basically just rename it and make it accessible to the next function. 120 00:13:28,380 --> 00:13:36,540 This is how literal pools work. So now the memory space is horizontal. So assuming we have a function 121 00:13:36,540 --> 00:13:46,900 myPatch which wants to call a function wlanMain. So here we, this will also be, so the 122 00:13:46,900 --> 00:13:52,300 assembler for this will look like this first load instruction which loads intermediate value into a 123 00:13:52,300 --> 00:14:00,900 register and then the call is just using this register to call the function. And if we want to get this 124 00:14:00,900 --> 00:14:06,080 immediate value we need to know the literal base. 125 00:14:06,540 --> 00:14:12,080 And then we can look up the offset for this function we want to call, here wlanMain in this case 126 00:14:12,080 --> 00:14:16,740 and then we get the actual address of the function. So for example here. 127 00:14:17,660 --> 00:14:19,780 And this is done for each load instruction. 128 00:14:21,580 --> 00:14:28,720 So this means, what's also the case is that this literal base needs to be set up somewhere and this is 129 00:14:28,720 --> 00:14:34,520 usually done at the very beginning of the firmware and this is a fixed value so for me it was 130 00:14:37,120 --> 00:14:45,140 x48001 and this is the code how it looks like. So you basically have the start of this literal pool 131 00:14:45,140 --> 00:14:51,740 and its size and then you store it into A2 and write this to the special register, the base. 132 00:14:52,120 --> 00:15:00,300 And so actually the offsets are negative. This is why you add the whole size to it and then a load 133 00:15:00,300 --> 00:15:02,740 instruction later on will have a negative offset. 134 00:15:04,520 --> 00:15:11,240 So basically the existing firmware does expect that this literal pool is used so if we want 135 00:15:11,240 --> 00:15:16,320 and this has some, this comes with some problems if you want to patch existing code. 136 00:15:18,040 --> 00:15:23,360 Another problem was that this lit base is not supported by disassemblers. 137 00:15:23,560 --> 00:15:31,960 So for example IDA77 added support for extensa but has, does ignore the lit base call. 138 00:15:32,740 --> 00:15:38,360 For Chitra there is an extensa plugin but it didn't support a lit base either. 139 00:15:39,340 --> 00:15:48,480 Radar2 ignored lit base, has support for extensa and there's also a binary ninja plugin but it ignored lit base as well. 140 00:15:49,420 --> 00:15:55,280 So what I need to do is create some patches for binary ninja in this case. 141 00:15:55,500 --> 00:16:01,720 So in this patch I just ignore the dependency of the program counter. 142 00:16:01,960 --> 00:16:05,720 And directly use this fixed lit base. 143 00:16:06,380 --> 00:16:09,040 And I have a similar, so this is the patch for binary ninja. 144 00:16:09,900 --> 00:16:14,160 And there's also, this is the patch for Chitra which works the same way. 145 00:16:14,740 --> 00:16:22,880 And I have a link to a git repository later on where you can find these patches. 146 00:16:25,420 --> 00:16:31,860 So now if you actually want to change some code in the firmware I decided to use this. 147 00:16:31,960 --> 00:16:34,140 The next one framework I have shown earlier. 148 00:16:34,480 --> 00:16:42,540 And I wanted to basically modify it to support qualcomm based wifi chips. 149 00:16:42,960 --> 00:16:46,640 And so this is how the framework looks like. 150 00:16:46,780 --> 00:16:55,780 It's pretty complicated but we only need a subset of this to make it work. 151 00:16:56,180 --> 00:17:01,260 So what we could do with the original next one was we could extract the ROM, flash patches. 152 00:17:01,260 --> 00:17:04,520 The RAM, U code for qualcomm based wifi chips. 153 00:17:04,760 --> 00:17:08,360 And we could use C to write our patches. 154 00:17:08,580 --> 00:17:12,080 And of course we could call existing firmware functions. 155 00:17:12,540 --> 00:17:17,380 And then in the end with this whole framework we were able to create a firmware file. 156 00:17:17,540 --> 00:17:20,940 Which we could then run on qualcomm based wifi chips. 157 00:17:22,180 --> 00:17:26,260 So how does this next one framework work on a high level? 158 00:17:26,560 --> 00:17:31,240 So we have our own patches which are in patch.com. 159 00:17:31,260 --> 00:17:41,900 We have a wrapper.c which is used to have some stubs for the functions which are already existing in the firmware. 160 00:17:42,240 --> 00:17:47,800 And we use gcc and a gcc plugin to compile the .o files. 161 00:17:48,120 --> 00:17:53,680 And also the plugin will help to create this next one .pre file. 162 00:17:53,980 --> 00:17:59,000 And this next one .pre file basically contains some metadata which we use later on. 163 00:17:59,580 --> 00:18:01,140 And for example. 164 00:18:01,140 --> 00:18:04,800 We can use this file with an .org script to create some linker scripts. 165 00:18:05,160 --> 00:18:10,220 And then we can use the linker scripts and the .o file to create an overall patch file. 166 00:18:10,500 --> 00:18:13,200 So this patch file basically includes everything which we need. 167 00:18:14,360 --> 00:18:22,240 And now after this we can use another .make file and the .elf file. 168 00:18:22,540 --> 00:18:28,360 To create basically a blueprint to copy out the relevant section of this .elf file. 169 00:18:28,660 --> 00:18:31,060 So we might not need everything. 170 00:18:31,140 --> 00:18:33,620 Just the patch we want to introduce. 171 00:18:36,160 --> 00:18:40,660 And some stuff we might want to override in the original function. 172 00:18:41,260 --> 00:18:42,600 And the original firmware. 173 00:18:43,180 --> 00:18:49,100 So now we have this .elf file and this .make file. 174 00:18:49,220 --> 00:18:51,280 Which is basically the blueprint for object copy. 175 00:18:51,500 --> 00:18:53,640 We can copy out the relevant sections. 176 00:18:53,940 --> 00:18:55,860 Then we can DD them into the firmware. 177 00:18:56,720 --> 00:18:57,880 The firmware binary. 178 00:18:58,600 --> 00:19:01,480 So this is how the original next one worked. 179 00:19:01,720 --> 00:19:05,700 So I need to do some changes to make it work for Qualcomm. 180 00:19:05,920 --> 00:19:09,840 So first of all there was no support for decompression. 181 00:19:10,020 --> 00:19:13,420 The Qualcomm based firmware had no compression. 182 00:19:13,720 --> 00:19:15,260 It was just the whole memory. 183 00:19:15,700 --> 00:19:20,800 The whole RAM of the chip basically uncompressed. 184 00:19:21,600 --> 00:19:25,420 It also needed to add support for multiple binaries. 185 00:19:25,420 --> 00:19:27,680 So as we have seen earlier. 186 00:19:27,940 --> 00:19:31,640 The firmware consists of multiple segments. 187 00:19:32,160 --> 00:19:33,980 And I needed to add support for that. 188 00:19:34,360 --> 00:19:39,040 And we also needed support for the lid base I mentioned earlier. 189 00:19:40,560 --> 00:19:42,760 And then if we make this happen. 190 00:19:42,920 --> 00:19:45,200 What we could do is compile and link our own patches. 191 00:19:45,540 --> 00:19:50,680 We could patch the second segment I showed earlier. 192 00:19:51,000 --> 00:19:54,300 And then we can compress it back into the second segment. 193 00:19:54,300 --> 00:19:55,620 Add some padding bytes. 194 00:19:55,920 --> 00:20:00,760 And then write the firmware file basically. 195 00:20:01,020 --> 00:20:02,320 So this is the plan. 196 00:20:03,540 --> 00:20:06,360 So I will not explain the decompression. 197 00:20:06,560 --> 00:20:08,380 This is pretty straight forward to implement. 198 00:20:08,760 --> 00:20:12,020 I will start with the support for multiple binaries. 199 00:20:12,380 --> 00:20:15,420 So I needed to extend the GCC plugin. 200 00:20:16,120 --> 00:20:18,800 Which creates this metadata file. 201 00:20:18,920 --> 00:20:19,840 The next one.prefile. 202 00:20:21,160 --> 00:20:22,360 So basically. 203 00:20:22,360 --> 00:20:25,060 What this GCC plugin does. 204 00:20:25,260 --> 00:20:27,620 It looks for this attribute in the source code. 205 00:20:28,000 --> 00:20:33,540 And this attribute tells basically where the following. 206 00:20:33,740 --> 00:20:35,720 The code after this goes into the firmware. 207 00:20:35,960 --> 00:20:37,840 In which chip this is used. 208 00:20:38,100 --> 00:20:40,320 And in which firmware version this is used. 209 00:20:40,600 --> 00:20:47,480 And I extended this basically to also include the target firmware file. 210 00:20:47,620 --> 00:20:50,600 So after compiling where should this go to. 211 00:20:50,600 --> 00:20:56,300 So which segment of the firmware file should this go into. 212 00:20:59,940 --> 00:21:03,380 So basically then after we compile everything. 213 00:21:03,680 --> 00:21:07,120 We have this new next one.prefile. 214 00:21:07,380 --> 00:21:11,620 And it basically contains the address which is here. 215 00:21:12,020 --> 00:21:14,000 Where our code should go. 216 00:21:14,280 --> 00:21:15,640 It has basically the type. 217 00:21:15,800 --> 00:21:16,720 So here it is a patch. 218 00:21:17,000 --> 00:21:18,120 Then if it is a dummy. 219 00:21:18,120 --> 00:21:20,780 It is basically an existing function in the firmware. 220 00:21:21,140 --> 00:21:24,380 The next column is the .o file. 221 00:21:24,660 --> 00:21:26,000 But this will be compiled into. 222 00:21:26,280 --> 00:21:28,900 This is the name of the text section in the .l file. 223 00:21:29,280 --> 00:21:30,780 And now we also added this. 224 00:21:32,280 --> 00:21:34,980 The name of this bin file. 225 00:21:35,120 --> 00:21:39,020 Where the compiled code should later on be copied into VRDD. 226 00:21:41,160 --> 00:21:44,800 So with this I already wanted to compile some patches. 227 00:21:45,300 --> 00:21:47,220 So my goal was to. 228 00:21:47,220 --> 00:21:49,480 Use this pretty simple patch. 229 00:21:49,680 --> 00:21:52,420 So just jump into some code. 230 00:21:52,560 --> 00:21:53,620 Into this function. 231 00:21:53,960 --> 00:21:56,280 And then write 1, 2, 3, 4. 232 00:21:56,380 --> 00:21:57,800 Basically into this memory location. 233 00:21:58,080 --> 00:22:00,660 And then jump to the original code. 234 00:22:00,760 --> 00:22:02,360 Which is wlan main in this case. 235 00:22:03,420 --> 00:22:07,160 I could use the ESP32 GCC compiler. 236 00:22:07,500 --> 00:22:10,900 To compile my stuff. 237 00:22:11,380 --> 00:22:14,500 And load it into the chip. 238 00:22:15,460 --> 00:22:17,080 And I used the debugfs. 239 00:22:17,220 --> 00:22:18,400 Which I have shown earlier. 240 00:22:18,540 --> 00:22:20,920 To check basically after the chip was up. 241 00:22:21,040 --> 00:22:25,220 If the memory address has changed accordingly. 242 00:22:26,280 --> 00:22:27,840 But this didn't work. 243 00:22:29,520 --> 00:22:30,680 And the reason is. 244 00:22:30,960 --> 00:22:32,280 This LID base. 245 00:22:32,900 --> 00:22:35,520 This LID base I have explained earlier. 246 00:22:36,240 --> 00:22:38,340 So basically all the load instructions. 247 00:22:38,860 --> 00:22:41,720 Expect this LID base to be set at the very beginning. 248 00:22:41,800 --> 00:22:43,340 Of the firmware code. 249 00:22:44,200 --> 00:22:45,480 So this means like. 250 00:22:45,480 --> 00:22:49,680 The chip which runs the existing firmware code. 251 00:22:49,840 --> 00:22:51,640 Expects a load to. 252 00:22:51,960 --> 00:22:53,940 To all notice this LID base. 253 00:22:54,240 --> 00:22:57,400 And I need basically now some way. 254 00:22:57,740 --> 00:22:59,780 To tell my code. 255 00:23:01,420 --> 00:23:02,580 Either like. 256 00:23:02,680 --> 00:23:04,720 There is this existing LID base. 257 00:23:04,820 --> 00:23:05,440 Please use this. 258 00:23:05,560 --> 00:23:07,580 And it's like already this filled up. 259 00:23:08,580 --> 00:23:10,440 But unfortunately there is like. 260 00:23:10,520 --> 00:23:11,200 No such parameter. 261 00:23:12,230 --> 00:23:13,200 Existing in GCC. 262 00:23:14,120 --> 00:23:16,280 So we need to do something else. 263 00:23:16,820 --> 00:23:18,600 And I just highlighted here. 264 00:23:18,700 --> 00:23:19,680 All the load instructions. 265 00:23:19,980 --> 00:23:20,560 Which are problematic. 266 00:23:20,960 --> 00:23:21,820 As I said. 267 00:23:23,180 --> 00:23:24,880 The offsets are not right. 268 00:23:25,060 --> 00:23:28,620 They need to use this LID base. 269 00:23:29,900 --> 00:23:31,720 So what we could do as an alternative. 270 00:23:31,960 --> 00:23:33,400 Is just avoid load instructions. 271 00:23:33,780 --> 00:23:36,100 And handcraft our assembly ourselves. 272 00:23:36,480 --> 00:23:38,240 So we just avoid all the references. 273 00:23:39,140 --> 00:23:41,520 And have basically no immediate value. 274 00:23:41,660 --> 00:23:42,980 So this is obviously. 275 00:23:43,200 --> 00:23:44,260 Not something we want to do. 276 00:23:44,380 --> 00:23:44,740 In the long run. 277 00:23:47,440 --> 00:23:48,540 So I came up with. 278 00:23:48,660 --> 00:23:49,500 Two possible solutions. 279 00:23:50,560 --> 00:23:51,840 Either as I said earlier. 280 00:23:51,940 --> 00:23:53,740 We can tell the linker somehow. 281 00:23:55,600 --> 00:23:57,140 Where the existing LID base is. 282 00:23:57,260 --> 00:23:57,900 And how full it is. 283 00:23:58,240 --> 00:24:01,140 Or we can use our own LID base value. 284 00:24:01,520 --> 00:24:02,940 So I decided to go with. 285 00:24:03,000 --> 00:24:03,620 The second option. 286 00:24:04,000 --> 00:24:05,580 I felt like this is more. 287 00:24:07,440 --> 00:24:08,800 More flexible in the long run. 288 00:24:10,120 --> 00:24:12,260 And what this implies. 289 00:24:12,540 --> 00:24:13,080 Is basically. 290 00:24:13,200 --> 00:24:15,480 That I set the LID base to zero. 291 00:24:15,540 --> 00:24:17,960 At the entry of every function. 292 00:24:18,300 --> 00:24:19,260 This can be done. 293 00:24:19,320 --> 00:24:20,680 Using the GCC plugin. 294 00:24:21,340 --> 00:24:22,860 And at the function exit. 295 00:24:22,960 --> 00:24:24,820 I need to reset it to its original value. 296 00:24:25,560 --> 00:24:27,540 And I needed to do this. 297 00:24:27,780 --> 00:24:28,840 Into the. 298 00:24:29,280 --> 00:24:30,040 Assembler itself. 299 00:24:30,960 --> 00:24:32,140 Because there is this. 300 00:24:32,420 --> 00:24:33,660 Target dependent feature. 301 00:24:33,820 --> 00:24:34,900 Which is called relaxation. 302 00:24:35,940 --> 00:24:38,660 So if you have a call to a function. 303 00:24:38,920 --> 00:24:41,260 This assembler will basically relax this. 304 00:24:41,420 --> 00:24:42,680 To a load and a call. 305 00:24:43,200 --> 00:24:44,380 And then we have again a call. 306 00:24:44,480 --> 00:24:45,060 Which is problematic. 307 00:24:47,760 --> 00:24:49,000 So how does this look like. 308 00:24:49,140 --> 00:24:49,900 In the assembly. 309 00:24:50,680 --> 00:24:51,540 So as I said. 310 00:24:51,560 --> 00:24:52,740 This relaxation is problematic. 311 00:24:54,280 --> 00:24:55,900 And after relaxation. 312 00:24:56,140 --> 00:24:57,080 We basically have these. 313 00:24:57,320 --> 00:25:00,040 A call is extended to two instructions. 314 00:25:00,520 --> 00:25:01,580 This load and this call. 315 00:25:02,660 --> 00:25:04,400 And the thing is. 316 00:25:04,560 --> 00:25:07,060 That in between those two. 317 00:25:07,160 --> 00:25:08,240 Basically we need to reset. 318 00:25:09,320 --> 00:25:11,180 The LID base to its original value. 319 00:25:11,460 --> 00:25:12,260 So that then. 320 00:25:13,200 --> 00:25:14,700 We can call the existing function. 321 00:25:15,020 --> 00:25:17,620 That the remaining code. 322 00:25:17,760 --> 00:25:19,640 Can run as intended. 323 00:25:20,360 --> 00:25:20,800 And. 324 00:25:21,920 --> 00:25:22,360 Yeah. 325 00:25:22,460 --> 00:25:23,660 It took me a while to find out. 326 00:25:23,720 --> 00:25:26,380 That I cannot manipulate this behavior in GCC. 327 00:25:26,840 --> 00:25:28,980 It needs to be patched in the assembler directly. 328 00:25:29,180 --> 00:25:30,080 Because it is target dependent. 329 00:25:32,120 --> 00:25:33,160 So how does this. 330 00:25:33,480 --> 00:25:35,000 Relaxation look like in the assembler. 331 00:25:35,320 --> 00:25:36,580 So basically you have this. 332 00:25:36,780 --> 00:25:38,200 Sort of a look up table. 333 00:25:38,580 --> 00:25:39,600 On the left hand side. 334 00:25:39,740 --> 00:25:41,500 It is looking for a pattern like this. 335 00:25:43,200 --> 00:25:43,920 It is looking for a call 8. 336 00:25:44,120 --> 00:25:46,920 And if it finds this kind of pattern. 337 00:25:47,080 --> 00:25:48,780 It will be relaxed to a load. 338 00:25:48,920 --> 00:25:50,460 And a call X8. 339 00:25:52,020 --> 00:25:52,520 So. 340 00:25:52,640 --> 00:25:54,500 What I basically need to do is. 341 00:25:55,360 --> 00:25:57,340 Find a place in the assembler. 342 00:25:57,580 --> 00:25:58,840 Where this. 343 00:26:00,020 --> 00:26:00,520 These. 344 00:26:00,960 --> 00:26:01,740 Build instructions. 345 00:26:02,260 --> 00:26:04,060 So basically the right hand side here. 346 00:26:04,360 --> 00:26:05,520 These are called build instructions. 347 00:26:06,040 --> 00:26:06,940 Where those are. 348 00:26:10,000 --> 00:26:11,300 Are iterated through. 349 00:26:11,420 --> 00:26:12,780 And then they are applied. 350 00:26:13,200 --> 00:26:14,200 And pushed on a stack. 351 00:26:14,500 --> 00:26:16,440 And all I did is basically. 352 00:26:16,600 --> 00:26:19,300 To look like is the current opcode. 353 00:26:19,440 --> 00:26:20,080 A call X. 354 00:26:20,380 --> 00:26:22,900 And was the previous opcode. 355 00:26:22,960 --> 00:26:23,540 A load instruction. 356 00:26:24,060 --> 00:26:25,320 And if this is the case. 357 00:26:25,540 --> 00:26:26,800 Then I can basically add. 358 00:26:27,740 --> 00:26:29,000 An additional instruction. 359 00:26:29,180 --> 00:26:30,980 Which will reset the lid base. 360 00:26:31,180 --> 00:26:33,320 With an WSR instruction. 361 00:26:35,080 --> 00:26:37,280 So now that we know all of this. 362 00:26:37,380 --> 00:26:38,940 And we have patched our assembler. 363 00:26:39,140 --> 00:26:41,100 We can go back to our original. 364 00:26:41,980 --> 00:26:42,700 Patching code. 365 00:26:43,200 --> 00:26:45,080 And we can use this. 366 00:26:45,100 --> 00:26:45,720 GCC plugin. 367 00:26:46,100 --> 00:26:49,380 And the patched assembler. 368 00:26:49,440 --> 00:26:50,360 To compile this. 369 00:26:50,420 --> 00:26:52,480 Much easier to look at code. 370 00:26:53,600 --> 00:26:54,340 Which is. 371 00:26:54,620 --> 00:26:55,460 Pretty nice. 372 00:26:55,920 --> 00:26:58,960 So this is how the assembly looks like basically. 373 00:26:59,840 --> 00:27:00,820 After we have. 374 00:27:00,940 --> 00:27:01,580 Saved our. 375 00:27:03,340 --> 00:27:03,900 Parameters. 376 00:27:04,080 --> 00:27:06,660 We will save. 377 00:27:06,780 --> 00:27:08,440 The current lid base. 378 00:27:08,520 --> 00:27:09,060 Into A15. 379 00:27:09,400 --> 00:27:11,640 We will write 0 into A14. 380 00:27:13,200 --> 00:27:15,240 Into the lid base value. 381 00:27:16,040 --> 00:27:17,100 And then we can do. 382 00:27:17,200 --> 00:27:18,280 All of our load instructions. 383 00:27:18,580 --> 00:27:20,320 And at the end we reset. 384 00:27:21,020 --> 00:27:22,980 Or we copy back. 385 00:27:23,200 --> 00:27:24,900 The value which we have. 386 00:27:24,960 --> 00:27:26,000 Stored in A15. 387 00:27:26,280 --> 00:27:27,400 Into the lid base value. 388 00:27:27,500 --> 00:27:28,900 Before we do the final call out. 389 00:27:31,000 --> 00:27:31,940 So there are still. 390 00:27:32,060 --> 00:27:33,620 Some open problems with this. 391 00:27:33,840 --> 00:27:35,880 So this implementation is not. 392 00:27:36,100 --> 00:27:37,180 Very good obviously. 393 00:27:38,360 --> 00:27:40,300 I take away two registers. 394 00:27:40,860 --> 00:27:42,040 For the assembler. 395 00:27:43,200 --> 00:27:44,200 It would be better to have this. 396 00:27:44,400 --> 00:27:46,040 Based on the stack. 397 00:27:46,580 --> 00:27:47,460 Based implementation. 398 00:27:49,100 --> 00:27:49,620 Also. 399 00:27:50,760 --> 00:27:51,700 There is like. 400 00:27:52,020 --> 00:27:54,040 This support of disassemblers. 401 00:27:54,140 --> 00:27:55,120 Which I mentioned earlier. 402 00:27:55,680 --> 00:27:58,080 So I have these patches. 403 00:27:58,340 --> 00:27:58,780 But still. 404 00:27:59,800 --> 00:28:01,620 For example you cannot use IDA. 405 00:28:01,680 --> 00:28:02,240 If you want to. 406 00:28:03,540 --> 00:28:05,600 And also there is no support. 407 00:28:05,760 --> 00:28:07,800 In this GCC I am using. 408 00:28:07,900 --> 00:28:09,100 For naked functions. 409 00:28:09,680 --> 00:28:10,580 So this is a problem. 410 00:28:13,660 --> 00:28:15,200 You need some way to. 411 00:28:15,600 --> 00:28:16,660 Sometimes to override. 412 00:28:16,800 --> 00:28:17,700 An existing call. 413 00:28:19,680 --> 00:28:20,640 To even. 414 00:28:20,780 --> 00:28:21,800 Get to your patch. 415 00:28:22,880 --> 00:28:24,140 Either you are lucky. 416 00:28:24,400 --> 00:28:24,860 And it is like. 417 00:28:25,940 --> 00:28:28,000 They are using the literal pool. 418 00:28:28,300 --> 00:28:29,300 Then you can just override. 419 00:28:29,380 --> 00:28:30,260 The value in the literal pool. 420 00:28:30,620 --> 00:28:31,060 But if not. 421 00:28:31,120 --> 00:28:32,160 If it is like a direct call. 422 00:28:32,480 --> 00:28:34,060 Then you need some way to. 423 00:28:34,980 --> 00:28:36,920 Just compile like a call. 424 00:28:37,080 --> 00:28:37,960 To your own code. 425 00:28:43,200 --> 00:28:43,520 So it is like a GCC version. 426 00:28:45,000 --> 00:28:46,620 GCC for extensor at least. 427 00:28:46,680 --> 00:28:48,320 Does not have this option. 428 00:28:48,960 --> 00:28:49,860 For naked functions. 429 00:28:51,560 --> 00:28:52,440 And also. 430 00:28:52,640 --> 00:28:54,020 What is also missing right now. 431 00:28:54,180 --> 00:28:56,120 Is that there is no text console. 432 00:28:57,160 --> 00:28:58,580 So you cannot. 433 00:28:58,740 --> 00:28:59,880 Just do a printf. 434 00:29:00,160 --> 00:29:02,500 And somehow dump this. 435 00:29:02,980 --> 00:29:04,400 In your host system. 436 00:29:04,700 --> 00:29:06,200 To do some basic debugging. 437 00:29:06,500 --> 00:29:08,260 But we could implement this ourselves now. 438 00:29:09,880 --> 00:29:11,000 So basically. 439 00:29:11,860 --> 00:29:13,180 I have this. 440 00:29:13,200 --> 00:29:14,400 Very creative name now. 441 00:29:14,520 --> 00:29:15,200 For my framework. 442 00:29:15,280 --> 00:29:16,180 Which is called QCAMON. 443 00:29:16,300 --> 00:29:17,100 Instead of Nexmon. 444 00:29:18,880 --> 00:29:20,820 So this is how the folder structure looks like. 445 00:29:21,600 --> 00:29:22,660 At the very top. 446 00:29:22,780 --> 00:29:24,720 You have some build tools. 447 00:29:25,420 --> 00:29:27,540 Then the disassembler patches. 448 00:29:27,800 --> 00:29:28,720 Which I mentioned earlier. 449 00:29:29,040 --> 00:29:31,140 For Chitra and Banner Ninja. 450 00:29:31,560 --> 00:29:34,020 And then there is a folder for the original filmwares. 451 00:29:34,200 --> 00:29:36,760 And a folder for our patches. 452 00:29:36,800 --> 00:29:37,460 Which we want to apply. 453 00:29:38,720 --> 00:29:40,580 The build tools contain. 454 00:29:41,620 --> 00:29:43,180 The patched assembly. 455 00:29:43,200 --> 00:29:44,340 And GCC. 456 00:29:44,540 --> 00:29:46,220 And also the GCC plugin. 457 00:29:48,120 --> 00:29:49,320 The firmware. 458 00:29:50,040 --> 00:29:50,640 Folders. 459 00:29:50,960 --> 00:29:52,860 Basically contains the original. 460 00:29:54,080 --> 00:29:54,680 Firmware. 461 00:29:54,820 --> 00:29:56,800 And it already comes with a structure. 462 00:29:56,900 --> 00:29:57,580 Which would allow. 463 00:29:58,380 --> 00:29:59,580 Different chips. 464 00:29:59,680 --> 00:30:00,660 And different firmware versions. 465 00:30:01,140 --> 00:30:03,020 And there is also a make file. 466 00:30:03,120 --> 00:30:05,560 Which already extracts the relevant parts. 467 00:30:05,780 --> 00:30:06,780 And decompresses them. 468 00:30:08,740 --> 00:30:09,840 And then at the end. 469 00:30:09,880 --> 00:30:10,820 We have our patch folder. 470 00:30:13,200 --> 00:30:14,920 And our source code. 471 00:30:15,060 --> 00:30:16,520 Which we want to introduce into the firmware. 472 00:30:17,720 --> 00:30:19,720 So now to a brief demo. 473 00:30:23,720 --> 00:30:25,320 So this will basically show. 474 00:30:25,680 --> 00:30:27,640 The code. 475 00:30:27,780 --> 00:30:28,980 I had in my slides earlier. 476 00:30:30,020 --> 00:30:31,840 So we just want to. 477 00:30:32,220 --> 00:30:33,280 Set like. 478 00:30:34,620 --> 00:30:35,180 1234. 479 00:30:35,640 --> 00:30:37,100 Or store 1234. 480 00:30:37,640 --> 00:30:38,940 Into this memory address. 481 00:30:39,360 --> 00:30:40,880 And then jump to the original code. 482 00:30:41,300 --> 00:30:42,440 And in addition to. 483 00:30:43,200 --> 00:30:43,520 What we had shown earlier. 484 00:30:43,660 --> 00:30:45,200 We also need these two lines. 485 00:30:45,440 --> 00:30:47,680 To basically have an entry point. 486 00:30:47,780 --> 00:30:50,860 Into our firmware code. 487 00:30:51,060 --> 00:30:52,380 So all I'm doing here is. 488 00:30:53,480 --> 00:30:54,340 Creating basically. 489 00:30:55,380 --> 00:30:56,280 Overwriting stuff. 490 00:30:56,380 --> 00:30:57,460 In the literal pool. 491 00:30:57,640 --> 00:30:59,640 To point to my code. 492 00:31:06,520 --> 00:31:08,840 So everything is prepared. 493 00:31:10,200 --> 00:31:11,460 In the repository. 494 00:31:11,560 --> 00:31:13,020 You just need to run. 495 00:31:13,200 --> 00:31:13,760 Make. 496 00:31:13,980 --> 00:31:15,820 And this will already. 497 00:31:16,360 --> 00:31:18,260 Compile the C files. 498 00:31:18,400 --> 00:31:18,940 And .O files. 499 00:31:19,500 --> 00:31:21,720 It will also compile the wrapper. 500 00:31:22,140 --> 00:31:23,400 It will create the linker scripts. 501 00:31:23,800 --> 00:31:25,360 And create a .L file. 502 00:31:25,820 --> 00:31:28,060 And then use this blueprint. 503 00:31:28,860 --> 00:31:30,220 Make file I mentioned earlier. 504 00:31:30,400 --> 00:31:32,240 To copy out the relevant parts. 505 00:31:32,940 --> 00:31:33,600 In files. 506 00:31:33,920 --> 00:31:35,880 Then we can start reassembling. 507 00:31:35,880 --> 00:31:37,880 The whole firmware file. 508 00:31:38,180 --> 00:31:39,480 We are compressing it. 509 00:31:39,620 --> 00:31:41,740 Adding some padding bytes. 510 00:31:44,200 --> 00:31:45,160 Basically creating. 511 00:31:45,440 --> 00:31:46,780 The firmware file. 512 00:31:46,860 --> 00:31:48,400 How it is expected. 513 00:31:48,560 --> 00:31:51,160 By the WiFi chip. 514 00:31:51,360 --> 00:31:52,060 So here it is called. 515 00:31:52,180 --> 00:31:53,460 Firmware-5.bin 516 00:31:55,380 --> 00:31:56,800 And we can. 517 00:31:57,020 --> 00:31:58,480 I will now SSH into. 518 00:31:58,780 --> 00:32:00,800 This board. 519 00:32:00,960 --> 00:32:01,800 I have shown earlier. 520 00:32:02,400 --> 00:32:04,700 And in order to access the debug. 521 00:32:04,820 --> 00:32:06,080 We first need to set up. 522 00:32:07,020 --> 00:32:08,400 The WLAN0 interface. 523 00:32:08,940 --> 00:32:10,920 Now we can go into the debug. 524 00:32:11,040 --> 00:32:11,520 And. 525 00:32:13,200 --> 00:32:14,380 Look at the memory. 526 00:32:15,700 --> 00:32:16,260 Location. 527 00:32:16,800 --> 00:32:18,760 Basically without any modifications. 528 00:32:19,640 --> 00:32:21,320 So for this I can just use. 529 00:32:22,500 --> 00:32:23,060 DD. 530 00:32:23,560 --> 00:32:24,440 DD to. 531 00:32:24,540 --> 00:32:26,020 Copy out the relevant section. 532 00:32:26,340 --> 00:32:28,060 And use xdump to look at it. 533 00:32:29,300 --> 00:32:30,680 So here we see that. 534 00:32:30,780 --> 00:32:32,160 The first few bytes are. 535 00:32:32,380 --> 00:32:33,440 Not 1234. 536 00:32:34,600 --> 00:32:36,940 And now we install our. 537 00:32:37,380 --> 00:32:38,200 Modified firmware. 538 00:32:39,100 --> 00:32:40,840 Just copy it over via SCP. 539 00:32:41,180 --> 00:32:42,800 And we will. 540 00:32:44,060 --> 00:32:44,780 Need to. 541 00:32:46,160 --> 00:32:47,280 Remove and add. 542 00:32:47,440 --> 00:32:49,360 The PCIe driver. 543 00:32:50,240 --> 00:32:50,680 To. 544 00:32:51,340 --> 00:32:52,180 Apply the changes. 545 00:32:53,140 --> 00:32:55,080 Now we can SSH back. 546 00:32:55,140 --> 00:32:55,740 Into the router. 547 00:32:56,960 --> 00:32:59,180 Just checking the kernel log. 548 00:32:59,240 --> 00:32:59,600 Real quick. 549 00:32:59,780 --> 00:33:02,460 So here it is already setting up the regulatory domain. 550 00:33:02,880 --> 00:33:03,880 So it just looks quite good. 551 00:33:04,060 --> 00:33:05,220 So it did not crash on us. 552 00:33:06,240 --> 00:33:08,400 And we can go back into the debug. 553 00:33:08,460 --> 00:33:11,180 Set up the WLAN0. 554 00:33:11,360 --> 00:33:11,720 First. 555 00:33:13,200 --> 00:33:14,340 Go back to the debug. 556 00:33:14,400 --> 00:33:17,200 Then basically. 557 00:33:19,320 --> 00:33:20,160 We can. 558 00:33:20,340 --> 00:33:21,260 Copy out the. 559 00:33:22,400 --> 00:33:23,620 The same memory location. 560 00:33:23,840 --> 00:33:25,320 Which we just did a second ago. 561 00:33:25,840 --> 00:33:27,000 And have a look at it. 562 00:33:27,080 --> 00:33:27,840 Via the hexdump. 563 00:33:32,580 --> 00:33:34,540 As you can see here. 564 00:33:34,720 --> 00:33:36,560 We modified two whole bytes. 565 00:33:41,640 --> 00:33:43,020 So with this. 566 00:33:44,100 --> 00:33:45,120 A quick summary. 567 00:33:45,260 --> 00:33:45,880 And future work. 568 00:33:46,640 --> 00:33:48,420 I was able to modify. 569 00:33:49,140 --> 00:33:50,280 The next one framework. 570 00:33:52,100 --> 00:33:53,260 To make it work. 571 00:33:53,380 --> 00:33:54,580 With the Qualcomm based. 572 00:33:55,080 --> 00:33:55,560 Firmwares. 573 00:33:55,980 --> 00:33:57,440 I have the demo patch. 574 00:33:58,100 --> 00:33:58,560 I have shown. 575 00:33:59,900 --> 00:34:01,800 You can get it via this. 576 00:34:02,940 --> 00:34:03,900 This location. 577 00:34:04,380 --> 00:34:05,860 There is also the. 578 00:34:06,600 --> 00:34:08,080 The patches for binary ninja. 579 00:34:08,340 --> 00:34:09,160 And GDraw in there. 580 00:34:09,160 --> 00:34:10,480 The GCC plugin. 581 00:34:10,940 --> 00:34:12,300 And already a precompiled. 582 00:34:12,360 --> 00:34:13,060 Version of GCC. 583 00:34:14,000 --> 00:34:15,500 And also the patch. 584 00:34:17,260 --> 00:34:18,820 For the assembler. 585 00:34:19,800 --> 00:34:21,000 So this shows. 586 00:34:21,140 --> 00:34:22,000 That it is possible. 587 00:34:22,500 --> 00:34:25,560 To make modifications. 588 00:34:25,600 --> 00:34:27,040 On Qualcomm based firmwares. 589 00:34:27,340 --> 00:34:29,140 There are still some improvements. 590 00:34:29,400 --> 00:34:29,960 Which I need to do. 591 00:34:30,040 --> 00:34:31,280 To make modifications. 592 00:34:31,300 --> 00:34:32,240 Even more easier. 593 00:34:32,680 --> 00:34:34,220 I also want to look at this. 594 00:34:34,260 --> 00:34:35,340 Production software. 595 00:34:39,340 --> 00:34:39,980 At the beginning. 596 00:34:40,160 --> 00:34:42,340 So this QCA CLT. 597 00:34:42,580 --> 00:34:43,960 So this is basically using. 598 00:34:44,080 --> 00:34:45,560 This QDAL software. 599 00:34:45,840 --> 00:34:47,060 On a PC. 600 00:34:47,260 --> 00:34:48,520 To communicate. 601 00:34:49,000 --> 00:34:50,760 And you can get it from. 602 00:34:50,820 --> 00:34:52,700 Some sketchy Chinese servers. 603 00:34:53,180 --> 00:34:55,260 And then I want to see. 604 00:34:55,340 --> 00:34:57,360 If I can maybe enable. 605 00:34:57,480 --> 00:34:58,580 Some features which are used. 606 00:34:58,680 --> 00:34:59,540 In this production software. 607 00:35:00,880 --> 00:35:02,260 Also by myself. 608 00:35:02,700 --> 00:35:04,280 And I also want to look into. 609 00:35:04,380 --> 00:35:05,640 This code swap feature. 610 00:35:09,160 --> 00:35:10,640 I want to thank Martin Kort. 611 00:35:10,820 --> 00:35:12,040 AKA Problem Kaput. 612 00:35:12,260 --> 00:35:13,800 So he did some awesome. 613 00:35:14,140 --> 00:35:15,500 Gameboy Advance reverse engineering. 614 00:35:16,580 --> 00:35:17,980 And I had some. 615 00:35:18,160 --> 00:35:19,860 He helped me out in some cases. 616 00:35:20,060 --> 00:35:20,840 So it turns out. 617 00:35:20,920 --> 00:35:22,740 That he did not even reverse engineer. 618 00:35:23,140 --> 00:35:25,740 The main processor of the Gameboy Advance. 619 00:35:26,000 --> 00:35:26,920 But also like the. 620 00:35:27,380 --> 00:35:29,220 The WiFi chip used there. 621 00:35:29,340 --> 00:35:30,820 And this turns out to be like an older. 622 00:35:31,260 --> 00:35:33,000 Atheros based WiFi chip. 623 00:35:33,260 --> 00:35:35,740 Which he also reverse engineered. 624 00:35:35,900 --> 00:35:36,920 And Atheros later on. 625 00:35:39,500 --> 00:35:41,200 I think like lots of knowledge. 626 00:35:41,240 --> 00:35:42,380 From back there. 627 00:35:42,540 --> 00:35:43,840 Still went into their products. 628 00:35:44,360 --> 00:35:46,200 And I also want to thank Roku. 629 00:35:46,520 --> 00:35:47,800 AKA Arcane Nibble. 630 00:35:48,000 --> 00:35:49,120 I used her script to. 631 00:35:50,220 --> 00:35:52,080 To do the unzipping of. 632 00:35:52,300 --> 00:35:53,940 The firmware file. 633 00:35:55,060 --> 00:35:56,680 Yeah that's it from my side. 634 00:35:56,880 --> 00:35:58,260 Thanks everybody if you want to reach out. 635 00:35:58,540 --> 00:35:59,220 Here is my email address. 636 00:36:05,020 --> 00:36:06,460 Yeah if you have any questions. 637 00:36:07,040 --> 00:36:07,480 Shoot. 638 00:36:09,160 --> 00:36:10,540 I have also one more note. 639 00:36:11,140 --> 00:36:12,700 I have found. 640 00:36:12,880 --> 00:36:15,020 A firmware file. 641 00:36:15,180 --> 00:36:16,520 Which contains all debug symbols. 642 00:36:16,740 --> 00:36:18,820 For this IPQ 4019 chip. 643 00:36:19,240 --> 00:36:20,720 I have no easy way. 644 00:36:20,780 --> 00:36:21,580 To distribute this. 645 00:36:21,900 --> 00:36:24,460 Without the original repository. 646 00:36:24,600 --> 00:36:25,640 Being taken down. 647 00:36:26,340 --> 00:36:29,220 But if you want to poke it at yourself. 648 00:36:30,240 --> 00:36:31,140 Reach out to me. 649 00:36:31,200 --> 00:36:32,100 I will send you the link. 650 00:36:37,180 --> 00:36:38,220 Any questions? 651 00:36:42,020 --> 00:36:42,580 No? 652 00:36:42,700 --> 00:36:43,320 Okay then. 653 00:36:43,560 --> 00:36:44,340 Thanks everybody.