 So I'm going to talk about my fight, my personal fight with modern laptops, which you might say is a bit of a quick sci-fi, but that's why I say personal. But before I start, I have to thank my employer for giving me some time to come here. I'm not speaking for them, these are my words, not theirs, but they still gave me some time during the week to prepare for this and come along. And that also being said, if you're interested in working in Hong Kong in finance, I'm hiring. I don't know if this is the right crown, but they asked me to say that. So I'm a developer and a system engineer, and I've been doing that for many years. Which just means that I feel like I want to actually control the hardware I've got. And by doing that, I can make it work the way I want it to work. Part of that means that when things change, they often change in a way that I don't like. So when I go and look for a new laptop, about five years ago, it was when this first happened, I said, hang on, none of the laptops out there are ones that I like. Which may be a little bit grumpy and make me want to say, OK, what can I actually change about this? What can I fix? How can I make myself less grumpy? How do I kind of be productive about this? So what that meant was I look around and I say, what hardware is there? What can I use? What have they done to the features I used to like? What is it that I can change? And looking at all the bits on the laptops that have changed, all the things that have disappeared, like various ports that I used to like and use, there was one thing that stood out as being important. One thing that I could possibly actually address was the keyboard on the laptop. There was this very, very clear change in the way that keyboards on laptops were. And mostly it was a layout, but some of it was the way they felt as well. But it was a small enough thing, keyboards are kind of an isolated part of the laptop, but I thought, OK, let's see if I can change that. Is there a way I can make the laptop better for me by fiddling with the keyboard? And just as an example of some of the things that I saw on the laptops that changed, this, I thought, was a very strange design choice over here where the cat clock key used to be. Now, they didn't do this for many other laptops, but this was the kind of thing I was looking at and going, why would you do that? Who wants this? So I moved on to slightly less controversial changes. On the right, we have the laptop, at the time, was the laptop that I could purchase as my upgrade. And on the left was the laptop that had the features that I actually wanted. And I could see that there was a fairly significant set of changes between these two laptops. Not massive changes, a lot of people would say, but I'd be using that layout for about 10 years when they changed it. And that was all my muscle memory, all my, where my keys and my fingers went. It all changed. So I could deal with some of the changes they made, like they've gone the island keys, which apparently is trendy these days. I don't mind that. It's just a thing. It's the actual layout and the fact that there's a bunch of keys that I used missing. So, oh, look, if you look here on these keys, I'm not going to show that very well on this, but there's a gap around each key. So each key is an island to itself. Whereas over here, it's also a little bit hard for me to tell you. You can see they kind of sloped way to the edges, so there's no gap between each key. And if you look at around about, like I said, about five, six years ago, every laptop changed. Oh, it's like the chicklet. I don't know if chicklet is the right word. I think chicklet is an implementation detail. But physically, they changed the shape. So, and they called it island keys. It was a, I think Apple did it first, so they did it as well. So this was the keyboard that I was looking at. Yes? Yeah. Well, it's got missing keys. So there's an entire row of keys gone on the X230. You look at the top row here, the entire row of keys are gone. And the feel of the keyboard was different, right? I was really used to the feel of the keyboard as well as the layout. So I said, OK, is this something that's possible to change? So I pulled it apart the laptop and discovered that the actual keyboard itself, the connector on the keyboard I liked matched the connector on the motherboard for the new laptop. Oh, well, you know, maybe I could just plug it in. Maybe it'll just work. But they did actually add some new features with the new laptop. See, it turns out you can't just plug it in. You end up with little bits of the circuit board blowing up. If you're lucky. If you're unlucky, big bits of the circuit board blow up and the mouse keys stop working or maybe some of the other keys stop working. The backlight that they put into the keyboard actually had the backlight went through it. And so the old keyboard didn't support the backlight. The new keyboard did. So the new laptop short circuited through the old keyboard and caused a bit of damage. Not, if you're lucky, too much. So I was actually able to carry on with this little pinprick hole burned in the keyboard. Other people said that they had problems. Then we've got the actual differences between the two keyboards. When I plugged it in successfully, a lot of the keys work. But the two differences, the extra row of keys, they're all mapped up. They didn't work properly. And the function key combos you could get on your laptop, they didn't work properly. The decals on the function keys don't match with what the functions actually did anymore. Other people worked out a way of actually fixing this. They got a razor blade and the fine bits of wire and rewired where the keys were on the keyboard. I wasn't going to do that, so I didn't. But the keys that weren't working turned out they're all still physically connected. Found a circuit diagram. It showed me all the connections were there. So all the keys were actually available to be used. It's just they're not plumbed in in software. Which again meant that okay, if it's software, I should be able to just apply a patch and make a change. But this is in the keyboard controller in the embedded firmware on the laptop itself. So it's not something that a lot of people have access to. It turns out I found that there was somebody who had reverse engineered some of their keyboard controller and something that was even older than my laptop that was 10 years old. And it had a keyboard table in there. So I was able to use that to look at the firmware that I had from my new laptop and I had from my old laptop and compare it to the firmware that somebody else had reverse engineered. And they all had exactly the same keyboard table, exactly the same layout. And I was like, oh look, all the keys are there. I just have to patch in the same keyboard map to adjust it so that it had the missing keys featured. It turns out that didn't actually fix the problem because of something else. Quick question. The both laptops physically and both keyboard physically are interchangeable. There was no dimension change. Yeah, no. There's no dimension change. That was part of why I chose this as a simple target that I could actually achieve. So newer laptops have some dimensional changes without changing some of the keyboard connectors. I haven't tried that yet, but later on in the talk. If you want to know what an embedded controller is, it's just another CPU that's on your computer. In this laptop, it controls the battery as well. In a lot of laptops, it probably will. But the primary thing for me was it controlled the keyboard. And I couldn't actually patch it because it's protected by a signature. There's a check sums and there's some encryption in there. So I was kind of stalled at that point. I had a patch that I thought would work, but I couldn't apply it to the keyboard. Until this guy, he was looking at the other part. He was looking at the battery. He said, I want my battery to work, my aftermarket battery to work. So he blogged on how he got that working and wrote a series of articles and some software that allowed me to actually then reflash my embedded controller. So thanks to Matthew for doing that. But even after doing that, it still didn't work. None of the keys that were completely unfunctional became functional after my patch. Some of the keys that were in the wrong spot, I could change around. But the ones that were dead keys remained dead keys. And the ones that were the function combos, they didn't change at all because I hadn't changed that patch. So I had to actually go and have a look a little bit harder and try and do some reverse engineering. The Matthew Chapman's work allowed me to decrypt the firmware, which allowed me to then apply some reverse engineering, which allowed me to use a tool called Radair, which had the ability to reverse engineer the CPU firmware. So this tool allows you to then look closely at it, label the parts you've found, work out how they relate to each other, and move on from there to saying, ah, I figured out where things were. So it's got a bit of a learning curve and it needed a bunch of fixes to make the CPU work. But that was all just took time. It was relatively straightforward stuff. There's plenty of tutorials about that. And amongst the other tools that I used is a thing called VBindiff. It's a very handy tool if you're doing reverse engineering stuff because it's very easy to use. And it can show you the differences between two binary files. So I had the old firmware and I had the new firmware, and I had thought I worked out where the keyboard table was. So I lined them all up in this tool and you can see it showing me right there in red, the places where the keyboard table differs between the two laptops. So I could look at that and I could say, OK, here's how I can structure the kind of patch. My first stock try of the patch was basically just this, copying the data from the old laptop to the new laptop. And then applying that with a hex editor. So I've got another tool that I use called HTE, which is a very handy little bundle of tools. It'll do hex editing. It'll do searching of binaries quite competently. It also has a bit of an assembler and a disassembler in there. It's kind of all in one thing. So it's just a little toolkit to have. And using these three things and a lot of reverse engineering time, I was able to find some structures in the firmware to work out where the things were. So the first thing I found, obviously, was the keysim array, which is the list of where on the keyboard produces what key press. But there was also a bunch of other things. This firmware was a bunch of lists to lists of lists. So there was all kinds of things in there. And some of them were the ones that needed to be touched to fix the rest of it. So I kind of at this point was posting a couple of, hey, has anybody looked at this? And found somebody in Russia called Nitrocaster who said, hey, I can help you with this. So he actually identified there was a bitmap in the firmware of which keys actually worked. So when I applied my patch and some of the keys produced no key press, it was because this bitmap wasn't right. So he found that and he said, why don't you try this? So we added that to the map of structures that it found and then continued on looking. And we both together found where the keyboard table was for the function key presses. Turns out there were two of those. So we found them and tried them as well. There's a lot more of these tables in the firmware. There's quite a lot more. There's about 30 or 40 kilobytes worth of these tables. And this is just, I don't know, maybe a tenth of what I found. I did end up with automated tools to do some of this, especially to produce these diagrams. But this is just the keyboard part. And part of what I was doing is once I'd worked out that there was all these lists, he's going through and saying it's not this. Stop looking at that one. It's not this. Stop looking at that one. But isolating it down to the actual entries that happened to have the firmware patch that I needed to apply. So after doing all that, I did actually successfully patch my keyboard. So I've got the X230 laptop, which was at the time relatively new. And the X220 keyboard successfully in there. And it's like two things that didn't work. There's no caps lock key on the X230. So I couldn't work out a way of, no caps lock light. So I couldn't work out a way of turning the caps lock light on the old keyboard. And one or two other things that are similarly not going to stop me from using it as a day-to-day keyboard. So then we published it. And this is where my situation changed. We went to the ThinkPad forums where people had been whinging about these keyboards for quite some time. And we said, this is what we've done. We've successfully changed the keyboards over. This is exactly what everybody's been asking for. But turns out that what we'd done wasn't something that people could follow. And so we had to actually collect together everything, rather than being a series of, hey, you should try this instructions. We had to put together all the patches we did into a repository and say, here. Here is everything collected together. And I published it again. And that's when I discovered that I didn't actually know who my audience was. My collection of patches that I put together into a GitHub repository and said, here's all the tools you need was suitable for somebody who was perhaps a developer. But most of the people on the forums who were asking for these kind of patches, they weren't developers. They probably didn't even know what Git was, let alone GitHub. So I had to step back and go, right. Rewrite all of these, change the instructions, automate it as much as possible and say, what can I do to make this simple for you? Hand it a little bit by my question of, no, I can't just send you the binary results because this is actually somebody else's copyrighted firmware. And it's a big company and I don't want them angry with me. I want them, in fact, happy with me so they send me more laptops. So that was kind of a difficult thing to do to streamline it. It's gone to the point where I think people can apply it, but it's a learning experience for people who haven't actually touched development environments before. And that led to the next thing. Once it was relatively easy for people to apply, everybody came out of the woodwork and said, but I've got a different laptop. Can you support my laptop? And it turned out we could. There's about seven different laptops that ended up being supported from this ThinkPad range. They're all from the approximate the same era. But there is structure in there for me to try and disassemble laptops from other eras because it's still something I want to be able to do is look at newer laptops. And then asking the question of can I automate it even better for them? Now that I've got all these laptops, wide range of support, how does Lenovo actually apply these patches to the ThinkPad laptops? They have their own software for doing it. I thought maybe if I could reverse engineer what that software is, I could work out a way of automating it completely and saying here is a all-in-one thing that will download everything and then patch your firmware for you. So they had a thing called DOS Flash. They also had a Windows tool. I didn't look at that. The DOS Flash is smaller, simpler, and therefore a little bit easier to inspect when there's one. And it does something to the laptop to tell it to have the firmware. I didn't know what. So I tried to apply some tracing to it to work out how it worked. But you can't easily trace DOS programs. So we ended up writing a framework to wrap around the DOS Flash that captured what it did. Essentially tracing the DOS system calls that it did while it was doing them and trying to show what steps it was doing at the time. It also had the ability to trace things that it did to the hardware as it did them. So I got to the point where I figured out what it was trying to do to the hardware. But I couldn't work out what answer it was looking for back from the hardware. At the time, the only way I thought I could do that, and it's still the case, is that I would need to get real hardware and point this half-hacked-apart, weird version of the firmware update on some real hardware. And I didn't actually have a spare laptop to do that on, so I chose not to go further at that point. I still would like to investigate that a little bit further, but the situation has moved on. Modern laptops don't use the DOS Flash tool. They use a UEFI environment and have a completely different flashing program that is built to work with UEFI. So it's a different way. It probably has a different protocol. If I did this in the future and I expect I still want to be able to fix these problems in the future, I'll be using a different thing to analyze it. And a similar kind of technology, though, pull apart the actual program that's running through firmware and try and see what it's doing to that firmware. So from this point, my next steps were, well, you know, continue to try and work out how to reverse engineer the firmware, enjoy my upgraded laptop, which I did. I was quite happy with it. One of the plans I had for the future, because it was by that point, the X230 was by that point a couple of years old. It wasn't the latest laptop. I did still want a newer laptop, was to take a miniaturized version of a USB keyboard adapter suitable for this physical keyboard and then hide that inside somebody else's laptop. And that would require some physical dimension changes with a Dremel. And I've actually built a prototype of that, but I didn't find another laptop that was worth attacking with some kind of case mod. But that's what I assume I'll be doing in the future. If I do continue trying to apply these keyboard changes, it will be with a USB adapter inside, or perhaps finding a more open laptop that I can actually just attach the keyboard to and tell its firmware, hey, this is the right one. But all in all, the aim was to try and get newer hardware because, well, I do use my computer a lot. I would be nice to have a nice fast computer, which was the state of play around about October last year where the ThinkPad people decided that they had a 25th anniversary event, including releasing a new laptop. The laptop they released had the keyboard I wanted. So finally I was able to buy a laptop I wanted. So the laptop I've got today is a brand new laptop, as of six months ago, which is the first time I've had a new laptop in six years. And so that's a fairly eye-opening how fast they are this case. But it also opens up other possibilities. This laptop has a keyboard in it from a company that is renowned for selling spare parts. I haven't yet purchased one of these keyboards, but theoretically you can buy this keyboard for, it's actually relatively expensive, but you can buy the keyboard in this laptop and put it into another laptop, a modern laptop. I've started investigating, okay, what are the connectors, what does the firmware look like on this laptop if I wanted to apply this limited edition keyboard to one of the normal laptops that will be available easily. And it seems like you can just plug it in. So they've got the right firmware. I can take that keyboard and plug this keyboard into a T470 ThinkPad laptop if I can get the keyboard. So I'm still investigating, I'm still looking forward, I'm still trying to work out what it will be in a year's time or so when I get an urge for a newer laptop. But I don't have any straightforward answers, because it's a personal aim to try and say, no, I want to bend this hardware to my will. So I want to make sure that I can get the computers that I own to work for me. And I want to try and say, this is possible for people to do. Yes, a lot of what I did was complicated, but a lot of what I did was based on a lot of other people's work. The collaborating with them allowed me to get to where I was. And there's a lot more options out there than there used to be for reverse engineering tools and facilities to be able to do this kind of stuff. So I'd like to think that I've inspired somebody else to not necessarily fix their laptop keyboard, but to fix something that they think is not working, fix something that is not working for them and not just use the off-the-shelf model. So any questions? How do you feel about Apple laptops? Well, I thought Apple laptops for many years, right? And I think it's changed that recently. Apple laptops were the best hardware design of any laptop you could get. But the physical layout of the keyboard had even less keys than the one that I had with the ThinkPad. So, you know, I was really disappointed that I couldn't buy an Apple laptop hardware, the motherboard, the screen, with a slightly different keyboard and mouse. And I think their hardware has gone slightly downhill since then. But what about the sort of the top programmable keys that the records hold? So, let's see. If you look at the top right corner there, the X1 Generation 2, it's just before Apple released the keyboard with the screen on it. What's it got in place of its function keys? It's not a screen, but other than that, it's pretty much the same thing. It's a set of soft keys that light up depending on what functions they've got. So, other than being an OLED screen, it's pretty much the same as what the Apple's got. I thought that was crazy. From a point of view of somebody who actually types and uses the function keys as part of touch typing, that's nuts. Why would you ever want to lose the ability to have the haptic feedback of being able to press the function key? So, yeah, that's what I think about the Apple keyboard. It's not a trigger. Question. There's a Russian company, what are they? And they used to have this Optimus keyboard which had an OLED screen. But they actually released a new one, not laptop, it's desktop. What it is, it's one big LCD panel behind a bunch of clear island keys. So, it's just an image full of the screen. I haven't seen that. If you had this for laptops and now your only problem was there were just a bunch of island keys and it was stuck with those. But you could have whatever you wanted on it. Would that actually solve your problem? If the key press was, you know, it felt like you're pressing a keyboard, then probably yes. I mean, there have been a number of keys boards where you could swap the keys around and it's all down to can you remap the keyboard, can you tell the operating system to have the right keys. So, you know, that would certainly help. But I've needed an inform factor of a laptop and what they seem to be aiming for with modern laptops. If you look, they're getting dinner and dinner and dinner and the keyboards are getting less and less good to type on. So, you know, if they did implement what you're suggesting in a laptop form factor, I bet you it wouldn't be nice to type on. Which is disappointing. We've ordered the normal laptops. There is a modification which we can buy the latest hardware to be involved in the score game. Like the latest gen 7 laptops and you want them to do the score game. Okay, right. So, you're talking about the Chinese NB51. So, there's a company that has taken laptops from about eight years ago and has thrown away the motherboard and built their own motherboard for it. The newest one that they've built has the laptop keyboard before the X221. So, I'm just waiting for them to produce one for the X220 with that keyboard. And I'll try it out. The reports are that it's an interesting experience to use one of those laptops. It's not perfectly integrated. It's not great. But, you know, if it's possible for me to buy one, I'll probably try that, yeah. It's certainly the best option if somebody else has decided to build a new laptop inside the old laptop for me. I think we're almost out of time for questions. Yeah, I guess. One minute. One minute. Is there one more question? I have a question for you. What do you want to say? I'll be hanging around, so if you want it, you can grab me afterwards.