[00:00.000 --> 00:01.360] Oh, I can start? [00:01.640 --> 00:02.780] Oh, sorry, I thought we were... [00:03.260 --> 00:05.620] All right, we can start. [00:06.360 --> 00:08.280] All right, thanks everyone for coming. [00:08.280 --> 00:13.540] I know there are a bazillion other things you could be doing here at DEF CON, and I appreciate you giving me your time. [00:13.900 --> 00:17.260] So, today I want to talk to you about the Power Glove. [00:17.380 --> 00:20.360] This guy is... how do you pronounce it? [00:22.120 --> 00:24.240] Diogenes, and he lived in a barrel. [00:25.240 --> 00:27.900] He's probably the most accurate of the Asian Greek philosophers. [00:27.900 --> 00:33.060] I love these old paintings because they're beautiful. [00:33.060 --> 00:34.220] There's so many of them. [00:34.220 --> 00:36.860] They're not AI-generated, and they don't have copyright. [00:36.860 --> 00:50.040] Like for these, for example, even if there's a gate, you won't see it in the bottom right, but the museum has released it on like a CC1 copyright, so you can just use it wherever you want. [00:50.180 --> 00:52.200] Today we're going to talk about this. [00:52.400 --> 00:57.700] Instead of using a clicker or a keyboard or whatever you want, we're going to use a Nintendo Power Glove. [00:57.900 --> 01:02.800] So I can do this, and go to the next slide. [01:03.260 --> 01:03.840] That's it. [01:03.840 --> 01:09.160] If you want to leave now, you're good to go. [01:09.160 --> 01:15.520] But in general, I want people to be able to see what I'm going to talk about in case they want to go and be somewhere else. [01:15.520 --> 01:20.760] I don't want to get to the end and say, that guy just wasted my time or whatever. [01:20.760 --> 01:35.820] So I'm going to talk about a bunch of these, why I'm doing this, what is a Power Glove, how it works, what other people have done, because it's pretty popular, what I did to do the dev stuff, and in the end, if this still works, we're going to have a demo. [01:36.020 --> 01:41.420] If you were in the Bug Bounty talk that I had yesterday, this is a free-for-all CTF. [01:41.580 --> 01:44.000] You will know when someone captures the flag. [01:44.160 --> 01:48.500] If no one captures the flag, we'll talk about it in the end, about why. [01:49.500 --> 01:51.840] So my name is Parsia, I work at Microsoft. [01:52.320 --> 01:53.960] This is my third DEF CON. [01:53.960 --> 01:58.020] Originally, my first ever talk was DEF CON 2018. [01:58.620 --> 02:00.600] 2020, I did recording. [02:00.700 --> 02:05.580] And this year, I did my third, which was yesterday, and this is my fourth talk. [02:06.060 --> 02:12.980] So in my second time at DEF CON, it's been seven years, or as something I would like to say, seven years of famine. [02:14.440 --> 02:19.620] 2016, I bought this Power Glove for a Hacker Man cosplay from the movie Kong Fury. [02:19.660 --> 02:27.260] And I won 50 bucks, which is the first and last time I've actually bought I'm sorry, won anything in a corporate environment, so that was good. [02:28.040 --> 02:29.920] Does anyone recognize this guy? [02:30.900 --> 02:34.460] He is from a sitcom called Third Rock from the Sun. [02:34.760 --> 02:36.380] It's one of my favorite ones. [02:36.560 --> 02:42.520] So this is independent research, not affiliated with my employer or yours or anyone else's. [02:43.160 --> 02:45.880] It's just something that I did that I think was cool. [02:45.900 --> 02:47.240] So why did I want to do this? [02:47.240 --> 02:52.120] In 20, not 2013, but a couple of years ago, I watched a talk by Haroon Mir. [02:52.120 --> 02:56.280] Haroon is a South African hacker and one of the people that I really, really like. [02:56.760 --> 03:01.220] Not only he is technically great, but he's also a kind human being. [03:01.220 --> 03:08.920] So he had this talk about why do we have so many enforced conferences, which is ironic because we are already at DEF CON. [03:09.380 --> 03:13.180] And they let everyone speak at DEF CON these days, like me. [03:13.580 --> 03:19.880] And he was like, we're doing entertainment, so people want to be entertained, so we are doing all of this. [03:20.780 --> 03:26.160] And in order to be remorable, I learned all the wrong lessons from Haroon. [03:26.340 --> 03:31.400] Fortunately for him and me, he's not here, so he left after Black Hat. [03:31.400 --> 03:32.700] So you're not going to see this. [03:32.700 --> 03:40.300] But in my opinion, if you want your presentation to be memorable, you need to have at least one of these three, possibly all three. [03:40.600 --> 03:45.980] So first, you really have to be technically advanced, so technically advanced that the audience thinks it's magic. [03:46.840 --> 03:49.120] Second, you need to have charisma or risk. [03:49.120 --> 03:51.020] And as you can see, I don't have any. [03:51.020 --> 03:56.260] And the third, you have to do these hijinks with this, so people can remember, oh, I remember that guy. [03:56.260 --> 03:57.740] He has a power glove. [03:57.880 --> 04:05.000] So I remember I joined a company, and I was going around, it was a game launch, and I was going around the game launch with this. [04:05.080 --> 04:08.480] And then people were like, who is that guy with a power glove? [04:10.140 --> 04:20.360] A talk that I look up to very idyllically that had all three was the late Barnaby Jacks talk here in Vegas at Black Hat. [04:20.360 --> 04:23.120] So 2013, he put a bunch of ATMs up there. [04:23.280 --> 04:26.080] And it's so advanced because people don't know how ATMs work. [04:26.080 --> 04:27.760] They are just money machines. [04:27.760 --> 04:34.220] So he started popping bills out of it, and they even coined a term called jackpotting for him. [04:34.320 --> 04:39.920] So he's technically advanced, he has charisma, and then he's putting an ATM on it, and this money is coming out of it. [04:39.920 --> 04:42.940] So that is my ideal thing that I wanted to do. [04:42.940 --> 04:46.500] But the Nintendo Power Glove is something super old. [04:46.560 --> 04:48.480] It was released in 1989. [04:49.400 --> 04:57.440] If you are older than this, and that includes me, be sure to stretch and think about that shingles vaccine in a little bit. [04:58.560 --> 05:03.880] I got shingles at 29, so I don't have to worry about that, but I don't know. [05:04.000 --> 05:12.460] It was released at around like $100, which is $200 current inflation inflated, but we all know that you could have probably bought a house, right? [05:12.460 --> 05:15.940] By then, it wasn't actually created by Nintendo. [05:16.160 --> 05:28.900] So I was talking to someone today and they told me that Nintendo wanted to get into the US market, and I hadn't heard it before, but they didn't want to do toy, they didn't want to do video games, because video games are bad and for kids. [05:29.280 --> 05:30.940] So they wanted to do toys. [05:31.120 --> 05:34.000] So as a result, they had this as a toy. [05:34.540 --> 05:39.720] So it wasn't created by Nintendo, it was designed by a different company, and even produced by a different company. [05:39.720 --> 05:42.400] Like in Japan, it's called Pax Famicom Glove. [05:42.460 --> 05:45.160] Famicom is the name of NES in Japan. [05:45.300 --> 05:46.620] In the US, it was created by... [05:47.700 --> 05:52.020] I used to pronounce it Mattel, but a friend of mine, Amber, said, no, it's Motel. [05:52.180 --> 05:53.800] So I'll go with this. [05:54.620 --> 05:57.480] So as a result, the Motel is a company that makes Barbie. [05:57.760 --> 06:00.900] As a result, well, this is a Barbie, I guess. [06:02.280 --> 06:13.300] So the idea is that Plato said a man is a featherless bipedal, and Diogenes grabbed a chicken, plucked all the feathers, and said, behold, a man. [06:13.980 --> 06:15.720] And the guy in the barrel, of course, did it. [06:15.720 --> 06:18.360] The original joke was that I am a Barbie. [06:18.580 --> 06:22.840] And then my wife looked at me and said, seriously, listen to yourself. [06:23.180 --> 06:25.620] As you can see, there's stark, like, difference. [06:25.920 --> 06:31.120] All I can say is, like, to borrow from the TV show, thank God that love is blind, habibi. [06:31.780 --> 06:32.680] But, yeah. [06:34.720 --> 06:37.660] So it became, it was actually very, very popular. [06:37.660 --> 06:39.140] It had really cool ads. [06:39.140 --> 06:40.520] We saw one of the ads. [06:40.600 --> 06:43.340] And it was also because of this movie called The Wizard. [06:43.520 --> 06:49.720] So you see a young Fritz Savage traveling across the country to compete in a video game tournament. [06:50.660 --> 06:53.360] And it is a walking, talking ad for Nintendo. [06:53.360 --> 06:58.720] Now, he has a power glove on his left hand, which is a lie, because I never made a left-handed version of it. [06:58.720 --> 07:00.060] It's just right-handed. [07:00.980 --> 07:02.640] So at some point, they see Billy. [07:02.640 --> 07:04.660] Billy is the main bad guy. [07:04.660 --> 07:09.900] And Billy is playing, takes out the power glove out of a suitcase with, like, huge plum. [07:10.520 --> 07:12.680] And then starts playing Red Racer. [07:13.040 --> 07:14.820] Power glove would have different mods. [07:14.820 --> 07:17.760] So for Red Racer, you could put a mod and hold it like a wheel. [07:17.940 --> 07:19.220] And you could, like, do this. [07:19.320 --> 07:21.980] For, like, Mike Tyson's punch up, you could do, like, punch. [07:21.980 --> 07:23.160] And you could do, like, uppercut. [07:23.160 --> 07:25.240] So it looks very, very cool. [07:25.720 --> 07:29.220] But in the end, he says the iconic quote, like, I love the power glove. [07:29.260 --> 07:31.300] It is so bad. [07:31.380 --> 07:32.580] And it is. [07:32.880 --> 07:33.700] Don't get me wrong. [07:33.700 --> 07:35.880] If you want to make it work, it won't work. [07:35.880 --> 07:37.360] Today, I met someone. [07:37.520 --> 07:40.200] And he said, does the power glove work? [07:40.200 --> 07:41.260] And I said, yes. [07:41.260 --> 07:42.780] And he said, well, I had one as a kid. [07:42.780 --> 07:44.060] And it barely worked. [07:44.220 --> 07:45.680] And I said, OK, let me rephrase that. [07:45.680 --> 07:46.800] It's functional. [07:50.320 --> 07:54.380] So the way it works is, you have these sensors you put around your TV. [07:54.520 --> 07:56.480] And I'm, like, putting this thing. [07:56.480 --> 07:59.340] And we saw it, like, a couple of slides ago. [08:01.120 --> 08:04.700] You can see the sensors around the TV that Billy's playing. [08:05.580 --> 08:08.080] And then these are essentially microphones. [08:08.080 --> 08:09.600] They're glorified microphones. [08:09.780 --> 08:11.160] And it's the thing with the hardware people. [08:11.160 --> 08:13.220] The good thing, the hardware hacking people are not here. [08:13.220 --> 08:14.440] I mean, a couple of them are here. [08:14.440 --> 08:16.680] But we can do that. [08:16.960 --> 08:19.040] They are really... [08:20.160 --> 08:21.880] they name things differently. [08:21.880 --> 08:23.200] Like, so these are not microphones. [08:23.200 --> 08:24.360] These are sensors. [08:25.040 --> 08:26.560] So you put them around your TV. [08:26.560 --> 08:28.840] And there's this junction box at the bottom. [08:28.900 --> 08:29.320] Oops. [08:29.740 --> 08:30.980] Did I go to the next slide? [08:30.980 --> 08:31.440] No. [08:31.540 --> 08:35.060] And this junction box, that DB9 connector goes into there. [08:35.060 --> 08:36.080] There's Power Glove. [08:36.080 --> 08:38.520] And that 7-pin connector is your Nintendo connector. [08:38.520 --> 08:39.800] It goes to the NES. [08:39.940 --> 08:41.460] And then now it works. [08:41.580 --> 08:43.040] You sit in front of it. [08:43.740 --> 08:45.080] Sometimes it does that. [08:45.080 --> 08:45.820] There we go. [08:45.820 --> 08:50.000] And this, you can see, it is from here, it starts sending out sound waves. [08:50.000 --> 08:56.460] So when I talk to people here at DEF CON or, like, Blue Hats or anywhere else, they were, like, oh, is this, like, a gyrometer or, like, accelerometer? [08:56.460 --> 08:58.340] No, it's just sound waves. [08:58.340 --> 09:00.000] They don't have any of that. [09:00.560 --> 09:02.700] So if, unfortunately, you can't hear it. [09:02.700 --> 09:08.700] But if you listen, you can hear this very rapid tick, tick, tick, tick sound of, like, hypersonic sounds going out. [09:08.860 --> 09:10.020] And you sit in front of it. [09:10.020 --> 09:11.620] And then the sound's going. [09:11.620 --> 09:14.020] And you can use the Doppler effect and the sensors. [09:14.020 --> 09:16.840] You can do, like, up and down, left and right, and forward and backward. [09:17.200 --> 09:19.040] But it doesn't really work great. [09:21.160 --> 09:22.280] As you can see. [09:23.420 --> 09:26.520] So Ben Heck, in 2016, like, did a teardown. [09:26.520 --> 09:31.320] He tried to figure out what can we do to make it a mouse. [09:32.420 --> 09:40.100] So if you put a... if you connect it to an NES with a Power Glove-enabled game, it would start, like, working the Power Glove mode. [09:40.100 --> 09:45.160] And it would start sending, like, four bytes, which is X, Y, Z, and then the buttons that you have here. [09:45.160 --> 09:46.760] So you can also do, like, A. [09:46.760 --> 09:48.240] And you can also do B. [09:48.280 --> 09:50.940] Unfortunately for me, these sensors do not work. [09:51.060 --> 09:53.680] I bought a second one, and the sensors on that didn't work. [09:53.680 --> 09:57.520] So maybe after all these years, the sensors have stopped working. [09:58.160 --> 09:59.680] So we tried to make it a mouse. [09:59.680 --> 10:03.720] And that is... and then tried to draw in MS Paint, and that's what it did. [10:03.840 --> 10:06.100] So you can't really... it doesn't really work. [10:06.200 --> 10:07.180] The other guy, Dr. [10:07.180 --> 10:09.940] Ben... unfortunately, it didn't release any code. [10:10.040 --> 10:10.380] Dr. [10:10.380 --> 10:14.020] Benjamin Blondo did a similar thing to what I did. [10:14.020 --> 10:20.020] But instead of a Bluetooth keyboard, he created a joystick. [10:22.080 --> 10:23.560] A wired joystick. [10:23.560 --> 10:28.100] Unfortunately for me, the code that he released also didn't work. [10:28.260 --> 10:30.440] For some reason, I don't know why, but I had to redo it. [10:30.440 --> 10:37.140] But he gave me this great information, that pinout for the DB9 or DE9 pin, whatever you want to call it. [10:37.140 --> 10:41.540] So you have... the green ones are supposedly wiggles for the sensors. [10:41.740 --> 10:44.120] Again, for mine, it doesn't work, so I just gave up. [10:44.640 --> 10:46.000] And then you have five volts. [10:46.000 --> 10:48.020] It works... all the electronic works on five volts. [10:48.020 --> 10:50.340] And a ground and latch and a bunch of other things. [10:50.340 --> 10:52.020] So now I have the pinout. [10:52.020 --> 10:53.540] I can start reading what's coming out. [10:53.560 --> 10:55.100] I also found this other thing. [10:55.100 --> 10:58.160] This is a connector from RetroUSB. [10:58.160 --> 11:02.840] So I bought like ten of these, but none of them except this worked with a power glove. [11:02.840 --> 11:14.140] If you connect this to the power glove, not this, but the sensors and junction box, it will act as a USB joystick on Windows, which has great backwash compatibility. [11:14.140 --> 11:17.340] And I don't say this because I work there, but it is great. [11:17.340 --> 11:18.600] I love it for gaming. [11:19.100 --> 11:21.080] So now I have... I know how to pinout. [11:21.080 --> 11:22.360] I need to read those pinouts. [11:22.360 --> 11:26.020] The first thing I need to figure out is like, what can I do? [11:26.020 --> 11:28.700] And then my idea was that I want to have a Bluetooth keyboard. [11:29.140 --> 11:33.320] And in this day and age, if you want to have a microcontroller with a Bluetooth, you do an ESP32. [11:33.320 --> 11:35.060] So ESP32, this is a dev board. [11:35.240 --> 11:36.820] ESP32 is that chip. [11:36.980 --> 11:38.500] It's called a system on a chip. [11:38.500 --> 11:42.480] It has Bluetooth, Wi-Fi, and a kind of beefy CPU. [11:42.500 --> 11:50.520] The cheapest one I could find had like 140 megahertz CPU, like 8 megabytes of flash, which is really great. [11:50.520 --> 11:58.440] And then you can also have expansion boards that exposes more pins and gives you like more power supply, like a barrel jack and USB-C and all that. [11:58.560 --> 12:00.020] But there's a huge problem. [12:00.020 --> 12:02.560] These are 3.3 pins. [12:02.680 --> 12:07.080] And internally, the CPUs actually work lower, like 1.8 volts. [12:07.580 --> 12:11.440] And I would expect that the voltages for the boards actually... [12:11.440 --> 12:15.940] dev boards actually drop in the future because they're more energy efficient and just better. [12:15.940 --> 12:19.120] Now, what happens when you send a 5-volt signal to a 3.3 pin? [12:20.780 --> 12:24.260] If you are unlucky, nothing happens. [12:24.260 --> 12:26.360] If you're unlucky, the pin dies. [12:26.380 --> 12:30.220] But if you're very unlucky, the CPU dies and then like the magic smoke comes out. [12:30.260 --> 12:33.980] And I killed a bunch of those ones on the left. [12:34.360 --> 12:36.020] Okay, so what now we need to do? [12:36.020 --> 12:41.440] We need to find a board that has Bluetooth, what we want, and also 5-volt resistance. [12:41.440 --> 12:42.260] And I found this thing. [12:42.260 --> 12:46.020] This is an Arduino Uno R4 Wi-Fi. [12:46.020 --> 12:47.880] And it's a freak of nature. [12:48.520 --> 12:50.980] Because you have that ESP32 there. [12:51.400 --> 12:55.780] And it also has its own CPU, which is an ARM Cortex 41 megahertz something, something. [12:55.800 --> 13:01.260] So you talk to the ARM Cortex and that talks to the ESP32 to set up Bluetooth and whatever. [13:01.480 --> 13:04.040] But unfortunately, there were like no libraries, like nothing. [13:04.040 --> 13:06.200] They just released it and there was nothing else. [13:06.220 --> 13:09.200] But the pins are 24-volt resistance, so that was good. [13:09.940 --> 13:11.460] But there was nothing for me to do. [13:11.460 --> 13:14.580] But someone had actually created something that you could do a... [13:14.580 --> 13:24.020] short a couple of pins and then flash the firmware and just talk to the ESP32 directly, which is kind of like an oxymoron because you already have a CPU there. [13:24.520 --> 13:25.840] And I tried and it didn't work. [13:25.840 --> 13:27.260] And I was like, okay, what can I do? [13:27.660 --> 13:28.520] So look at something else. [13:28.520 --> 13:31.920] I found this other thing called a level shifter, this red thing on the left. [13:31.920 --> 13:34.300] So it's a very interesting piece of tech. [13:34.480 --> 13:36.080] Now, we are dealing with signals. [13:36.080 --> 13:37.640] It's not like constant power. [13:37.640 --> 13:40.640] And signals are, in this case, we're looking at the digital signals. [13:40.660 --> 13:45.220] So a signal is high if it's over a certain amount of voltage for a certain amount of time. [13:45.220 --> 13:48.200] But other than that, it's just a signal. [13:48.540 --> 13:52.980] So you supply the five, the high and low, and the ground. [13:52.980 --> 13:57.280] And then every signal from one side gets converted to the other one, which is really great. [13:57.900 --> 14:01.600] Now, that's like a bunch of pins that I wanted to solder and I don't know how to solder. [14:01.920 --> 14:02.660] And then I was... [14:02.660 --> 14:06.900] Blue Hat, a team member of mine, was running the soldering station. [14:06.900 --> 14:09.740] So I asked him to solder these for me. [14:09.740 --> 14:12.260] And then I guilt-tripped him into soldering these for him. [14:12.260 --> 14:13.640] And that guy is Reid. [14:14.020 --> 14:17.400] I asked for his permission to ask for his name. [14:17.400 --> 14:19.500] So everyone say, thank you, Reid. [14:21.240 --> 14:21.880] Thank you. [14:21.880 --> 14:24.420] And then tomorrow, we'll start working on counting. [14:26.100 --> 14:30.120] So the other thing that this is, the other one I found, this is from TIDA Electronics. [14:30.120 --> 14:31.980] So TIDA is a Taiwanese shop. [14:32.400 --> 14:33.080] It is... [14:33.080 --> 14:42.240] I used to make fighting game sticks, like custom fighting game sticks, which are basically like a wooden box with an Xbox controller or something. [14:42.240 --> 14:44.980] With a bunch of wires going to the buttons. [14:44.980 --> 14:49.940] And they were very popular in the guitar pedal and custom fighting game community. [14:49.940 --> 14:52.460] So I found these for like $7 before tariffs. [14:52.500 --> 14:54.520] These are 5 volt resistance. [14:54.880 --> 15:00.160] And they also have like a battery slot at the bottom that you can put an 18650 battery on it. [15:00.160 --> 15:01.220] And that was great. [15:01.220 --> 15:02.500] So I started using those. [15:02.500 --> 15:06.020] Now an 18650 battery, we all know what it is. [15:06.020 --> 15:09.400] It's 18 millimeters diameter, 65 millimeters length. [15:09.400 --> 15:12.100] And the zero in the end means it's round. [15:12.100 --> 15:14.660] You should not over discharge it. [15:14.680 --> 15:15.980] You should not overcharge it. [15:15.980 --> 15:19.800] And then you can have like these charger modules, a TP456 to do that. [15:19.800 --> 15:21.960] And that board has all of those. [15:22.080 --> 15:25.160] So I started using the 5 volt pin on that for this. [15:25.240 --> 15:26.520] But I had a bigger problem. [15:26.820 --> 15:32.180] Because if you are on battery, that 5 volt pin, the red line at the bottom, is connected to that micro USB. [15:33.020 --> 15:35.160] So it only gives you like less than a volt. [15:35.300 --> 15:36.860] So you can't rely on the battery. [15:37.240 --> 15:42.080] You can do another thing that at the corner of the bottom left corner, the pin is 3.3. [15:42.100 --> 15:45.680] So you can grab a step-up module and then convert 3.3 to 5. [15:45.680 --> 15:46.800] And then you're good to go. [15:47.280 --> 15:49.660] But then I said, okay, maybe I should do something else. [15:49.660 --> 15:51.780] So I find these battery packs. [15:51.780 --> 15:54.800] They give you like whatever you want, a micro USB. [15:54.800 --> 15:56.000] And then you connect it and that. [15:56.000 --> 15:58.040] And now you have like a 5 volt from there. [15:58.040 --> 15:58.880] From the 5 volt. [15:58.880 --> 16:01.080] So right now I'm connected to the computer. [16:01.080 --> 16:03.000] I have the battery pack if you want to. [16:03.060 --> 16:05.900] But if you want to do a step-up module with like just one battery. [16:06.420 --> 16:10.560] That the power consumption is very, very minimal. [16:11.220 --> 16:14.640] Especially when you're not just, you know, running it. [16:14.640 --> 16:17.080] I mean that the sounds are working, but other than that. [16:17.080 --> 16:21.840] Like I've made it run overnight with one 18650 of like 23 mega amp hour. [16:21.840 --> 16:24.060] I'm sorry, milliamp hour, I wish. [16:24.120 --> 16:25.720] Mega, milliamp hour. [16:25.720 --> 16:27.780] It was running overnight and was still working. [16:28.500 --> 16:28.740] All right. [16:28.740 --> 16:33.140] So now we have something that doesn't die. [16:33.580 --> 16:35.600] And then now we need to start like development. [16:35.600 --> 16:38.100] And I was very, I've never, never done this before. [16:38.100 --> 16:40.340] So it was very, very much easier than I was thinking. [16:40.340 --> 16:43.100] You can use Arduino IDE, platform IO that I never use. [16:43.100 --> 16:45.540] Or EPA, ESP, IDF. [16:46.180 --> 16:49.760] The great thing about Suppressive, the company that makes this, these chips. [16:49.760 --> 16:51.520] And they're making these by the hundreds of millions. [16:51.520 --> 16:53.940] And they're made by TSMC. [16:54.260 --> 16:57.220] Is that they release a lot of code that's called unlicensed. [16:57.240 --> 17:02.220] As in like, it is good for, it has a license and it's called unlicensed. [17:02.240 --> 17:03.540] You can use it for whatever you want. [17:03.540 --> 17:05.120] There is, they're not a software company. [17:05.120 --> 17:06.300] They can give you this code. [17:06.300 --> 17:08.780] You can start modifying this code and they can do whatever you want. [17:08.780 --> 17:10.300] But they don't have a lot of answers. [17:10.340 --> 17:12.660] All right, so we know how to read. [17:12.660 --> 17:15.260] We know how to use a controller to read. [17:15.260 --> 17:16.540] How do we do that? [17:16.540 --> 17:19.500] And this is essentially an NES gamepad, right? [17:20.020 --> 17:24.260] So in order to read an NES gamepad, the protocol is very well documented. [17:24.680 --> 17:26.760] What we do is we had a latch. [17:26.760 --> 17:28.680] So we pulse the latch. [17:28.680 --> 17:32.400] Which is another one of the things that hardware people say instead of putting a signal up. [17:32.440 --> 17:37.440] They also call like screws, fasteners, motors or actuators and so on. [17:38.140 --> 17:42.660] You pulse the latch and then you read one bit from the data pin. [17:42.680 --> 17:46.280] If the button is pressed, the pin is zero. [17:46.280 --> 17:47.500] If not, it's one. [17:47.500 --> 17:49.680] And the first button is the A. [17:50.100 --> 17:55.720] And then you pulse the clock seven more times and then read data after after. [17:55.720 --> 17:58.300] And then you read A, B, start, select. [17:58.640 --> 18:02.100] And then like, you know, the arrow keys and then that's it. [18:02.100 --> 18:08.200] One thing that I almost burned my power glove with is that NES has a 1.79 megahertz CPU. [18:08.200 --> 18:11.620] So the power glove is not expecting rapid polling. [18:11.700 --> 18:16.940] I read somewhere, I'm not sure if it's true, that it only expects like 20 reads a second. [18:16.940 --> 18:18.260] Like 20 hertz. [18:18.420 --> 18:20.980] But I felt a little bit of experimentation. [18:20.980 --> 18:25.720] I almost burned it because my CPU on the ESP32 is 140. [18:25.720 --> 18:27.620] So I was just doing it very quickly. [18:28.000 --> 18:31.000] So I had to like add some delay in between the reading. [18:31.000 --> 18:32.740] Well, it's not really that bad. [18:32.740 --> 18:34.860] So it almost died, but it didn't. [18:34.920 --> 18:39.780] So you do a bit of delay and now you have read one byte, which gives you all the buttons that you have. [18:40.680 --> 18:41.860] And then now we have a button. [18:41.860 --> 18:44.540] The next thing I wanted to do, I want to create a Bluetooth mouse. [18:44.680 --> 18:48.080] And when you create a Bluetooth mouse, there are libraries out there that create one for you. [18:48.080 --> 18:51.880] The only thing you need to supply is, okay, where am I? [18:51.880 --> 18:54.280] And you supply four bytes. [18:54.440 --> 18:59.400] So you supply the buttons, which goes by bits. [19:00.020 --> 19:03.620] First bit is one, right-click, left-click, and then so on. [19:03.760 --> 19:05.300] And then you do the x. [19:05.580 --> 19:08.720] So x is going to positive, x is going to be right here. [19:09.040 --> 19:12.280] So if you're going up, you're going minus, minus y, and so on. [19:12.280 --> 19:19.040] And then you will also supply a wheel, the wheel of the mouse, which is zero in what I'm doing. [19:19.380 --> 19:22.040] Another thing you could do is that I did, it was very slow. [19:22.040 --> 19:27.200] So I had to add what's called a step, which is your mouse sensitivity, your mouse sensitivity on your machine. [19:27.200 --> 19:30.200] Everything is multiplied by that, so it's going faster. [19:30.440 --> 19:34.740] And I created a mouse, and it's the world's clunkiest etch-a-sketch. [19:35.280 --> 19:40.980] So I'm using the arrow keys as a mouse, and you have to hold A for right-click. [19:40.980 --> 19:47.840] And as you can do this, it's very, very well, very clunky, but better than nothing. [19:47.840 --> 19:49.660] Okay, so we have a mouse. [19:49.660 --> 19:51.740] Next thing I wanted to do is I wanted to create a keyboard. [19:51.740 --> 19:59.640] And when you are using a keyboard, you would assume that you're going to be sending ASCII hex code to the Bluetooth as it has a HID. [19:59.920 --> 20:01.100] But it's not. [20:01.340 --> 20:06.520] So you send eight bytes, but only the first and third, zero and two, are being used. [20:06.520 --> 20:12.560] The first one is the actual key, and the number three, I'm sorry, number two is the modifier. [20:13.300 --> 20:16.460] I'm sorry, the first one is the modifier, number two is the actual key. [20:16.460 --> 20:21.480] So instead of sending the ASCII hex code, for A you send four, and then you O up to Z. [20:21.480 --> 20:26.120] If you want to do capital A, you do exactly as you were doing when you were typing. [20:26.120 --> 20:32.240] You do shift as modifier and an A, and that the keyboard thinks, oh yeah, I've gotten a capital A for you. [20:32.400 --> 20:34.040] So I guess maybe that's like that. [20:34.880 --> 20:44.400] And then, so I created these mappings and said, okay, if I'm reading, if I see right being selected, I go right and left and up and down. [20:44.400 --> 20:49.180] And you can also add the media keys if you want, like you don't want to pop calc or so on and so forth. [20:49.180 --> 20:51.800] This is essentially what it does. [20:52.120 --> 20:59.360] And then at the end, what we do is you create a Bluetooth keyboard, you grab it by, I've found a library that basically does most of it for you, which is really fun. [20:59.500 --> 21:03.880] And then there was, and then you read whatever is coming from the buttons. [21:04.220 --> 21:08.200] Now there was this huge problem, I guess this is dying because this is faulty electronics. [21:08.200 --> 21:14.600] Yesterday when I called it a CTF at the Bug Bounty Village, it suddenly started going all the way to the left. [21:14.600 --> 21:16.660] And I thought maybe someone has messed with it. [21:16.660 --> 21:19.120] But it seems like just the electronics were dying. [21:19.120 --> 21:25.180] So last night I connected it to my machine and it was just popping calcs over and over again, which is the select key for me. [21:25.400 --> 21:30.760] So I had to add some code that, okay, if nothing is pressed, which everything is one, ignore it. [21:30.760 --> 21:36.940] If everything is pressed, which sometimes it does, also ignore it because I'm not going to be pressing all the keys together. [21:36.940 --> 21:40.480] And everything other than that, if I've created one of the arrow keys, do that mapping. [21:40.480 --> 21:43.700] If I've created one of the other one's keys, do that mapping. [21:43.700 --> 21:46.860] Another problem is I didn't put a delay here. [21:46.860 --> 21:51.080] So if I would write, it would just immediately go up until to the next. [21:52.380 --> 21:54.740] So that was pretty much it. [21:55.160 --> 21:57.920] And then I did it for my wife and he said, well, where's the demo? [21:58.440 --> 22:01.620] And I looked at her and said, yes, you have been looking at the demo. [22:02.220 --> 22:05.160] And then she all just rolled her eyes. [22:05.160 --> 22:11.220] So if you want some unsolicited marriage advice, she will let you make the joke if you're persistent. [22:14.320 --> 22:19.600] But yeah, I'm very lucky that I'm being able to use this as the demo thing. [22:19.600 --> 22:21.540] So I don't have to have a demo in the end. [22:21.540 --> 22:29.480] But in order for it to happen, I did a similar, like a demo, a quick demo at the hotel last night. [22:29.480 --> 22:32.880] So it was just, you know, you can go to the next slide, previous slide. [22:32.940 --> 22:36.700] And then if you press select, it should be able to pop cap for you. [22:38.920 --> 22:40.140] It's really fun. [22:40.300 --> 22:42.180] All right, so what did we learn here today? [22:42.180 --> 22:50.040] We can use the power glove as a gimmick. [22:50.160 --> 22:51.300] And that is great. [22:51.900 --> 23:00.120] And next year, I better see people putting using some janky shirts as a presentation thought. [23:00.180 --> 23:08.020] It would be great if you go into your boardroom and then instead of like typing on a keyboard like a nerd, you press something and the shirt pops up. [23:08.060 --> 23:11.580] The boardroom will remember you as the guy with the power glove or whatever it is. [23:11.580 --> 23:13.080] That popped the show. [23:13.160 --> 23:16.460] And thank you very much for your time and have a great rest of the call.