semvec/pypi-packages huggingface dataset:
br4wlst4rs 0.3
Brawl Stars more open source for ios

<h1 align="center">
    br4wlst4rs
    <br>
</h1>

<p align="center">
    <strong>A Python library for interacting with Brawl Stars on jailbroken iOS devices using Frida</strong>
</p>

<p align="center">
    <a href="https://pypi.org/project/br4wlst4rs/">
        <img src="https://badge.fury.io/py/br4wlst4rs.svg" alt="PyPI version">
    </a>
</p>

---

<p align="center">
     ⚠️ : You need to patch the game executable to avoid jailbreak detection before using this
</p>

---

## Installation

```bash
pip install br4wlst4rs
```

## Usage

### Config

JSON config file can be found in `site-packages/br4wlst4rs/config/config.json` :

```json
{
    "lib": {
        "version": 0.3
    },
    "frida-config": {
        "mode": "remote",
        "ip": "127.0.0.1",
        "port": 27042
    },
    "application": {
        "app_name": "com.supercell.laser",
        "main_module": "laser",
        "version": 59.197
    },
    "offsets": {
        "sendto": "0xe01730",
        "rec_post": "0x11f9c"
    }
}
```
if you change mode `remote` to `usb`, `ip` and `port` will be ignored

### Intercept decrypted POST requests

```python
from br4wlst4rs.core import *
from br4wlst4rs.requests import *

def print_data(data):
    print(f"{data}\n\n")

session, config, main_module = start()
base_address = get_base_address(session, main_module)

print("Recording POST requests, press [SPACE] to exit\n")

rec_post(session, base_address, config, callback=print_data)
```

#### Output example :

```markedown
00000000  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000020  00 00 00 10 6c 61 73 65 72 5f 74 72 79 5f 62 75  ....laser_try_bu
00000030  74 74 6f 6e 00 00 00 9d 7b 22 62 75 74 74 6f 6e  tton....{"button
00000040  22 3a 32 2c 22 74 72 61 69 6e 69 6e 67 5f 63 6f  ":2,"training_co
00000050  6e 74 65 78 74 22 3a 32 2c 22 68 65 72 6f 22 3a  ntext":2,"hero":
00000060  31 36 30 30 30 30 38 38 2c 22 68 65 72 6f 5f 6f  16000088,"hero_o
00000070  77 6e 65 64 22 3a 74 72 75 65 2c 22 73 6b 69 6e  wned":true,"skin
00000080  22 3a 32 39 30 30 31 30 34 32 2c 22 73 6b 69 6e  ":29001042,"skin
00000090  5f 6f 77 6e 65 64 22 3a 74 72 75 65 2c 22 68 65  _owned":true,"he
000000a0  72 6f 5f 6c 65 76 65 6c 22 3a 31 31 2c 22 67 61  ro_level":11,"ga
000000b0  64 67 65 74 22 3a 32 33 30 30 30 38 36 39 2c 22  dget":23000869,"
000000c0  73 74 61 72 5f 70 6f 77 65 72 22 3a 32 33 30 30  star_power":2300
000000d0  30 38 36 36 7d                                   0866}
```

## Todo
### Requests
- [X] Function to intercept decrypted POST requests
- [ ] Function to intercept decrypted GET requests
- [ ] Function to modify POST requests before encryption
- [ ] Function to modify GET requests after decryption
- [ ] Function to encrypt custom payload
- [ ] Function to POST encrypted custom payload