about summary refs log tree commit diff stats
path: root/README.md
blob: 04a2f9ac4486cbceaebe5ad9e2d8f44b10ffeab1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# gen4uploader

This is a tool that reads data from a fourth generation handheld Pokemon game (Diamond, Pearl, Platinum, HeartGold, SoulSilver), and uploads it to a website ([pokeviewer](https://code.fourisland.com/pokeviewer)) for viewing. It does this by spoofing a wireless connection to My Pokemon Ranch. More information about why I've chosen to do this can be found at the repository for [gen3uploader](https://code.fourisland.com/gen3uploader/about/), which is the corresponding tool for the third generation games.

This tool is not exactly trivial to set up and use, because it requires a wireless card that can operate in monitor mode, as well as a second network connection (usually Ethernet) to send the read data over. It is also written in C using libraries that are not cross-platform (unlike most of my other projects), mostly because I thought it'd be fun to try to write something in C when it would be much less tedious to do so in C++. Therefore, you need to use a computer running Linux.

## Compiling

There is a submodule dependency, so make sure to either clone the repo recursively, or initialize the submodules after cloning.

Building is done with CMake. You will also need to install `libpcap-dev`.

## Setting up your network card

I use a Raspberry Pi for this. The Broadcom wireless cards that are shipped with the Raspberry Pi do not allow use of monitor mode by default. You have to use a patched firmware/driver to make this work. The [nexmon](https://github.com/seemoo-lab/nexmon) project is invaluable for this. My personal setup involves using a Raspberry Pi 4 Model B with Debian Bullseye installed (Bookworm did not work in my testing). I also attempted to install Linux kernel 5.4, as nexmon's documentation seemed to indicate I would need to, but I'm not sure this was necessary or if it even worked because uname reports 6.1. You can follow the instructions on the linked page. I used the bcm43455c0 patch with firmware version 7\_45\_206, but these values may vary based on the specific hardware you have. At the end of these instructions, you should have a network interface called mon0 that is in monitor mode.

If you are not using a Raspberry Pi, but you do have a wireless card that supports monitor mode, you can run the following commands:

```
# Replace wlo1 with your interface's name
sudo iw phy phy0 interface add mon0 type monitor
sudo ip link set wlo1 down
sudo ip link set mon0 up
```

Regardless of which device you're using, you will also need to set the wireless channel. This tool uses channel 13. You can set it like this:

```
sudo iw dev mon0 set channel 13
```

If this doesn't work, try using the name of your original interface instead of mon0.

If you are using Ubuntu, you will need to disable Network Manager first, because otherwise it will try to manage the interface on its own.

```
sudo nmcli networking off
```

Other distributions may require similar commands.

On a Raspberry Pi, you may get an error saying that you are not permitted to use channel 13 because of wireless regulations. You can get around this by changing the country code:

```
sudo iw reg set JP
```