Giter Site home page Giter Site logo

sys-botbase's Introduction

sys-botbase

A Nintendo Switch (CFW) sys-module that allows users to remote control their switch via sockets as well as read and write to a games memory. This can be used to create bots for games and other fun automation projects.

Features:

Remote Control:

  • Set controller state
  • Simulate buttons press, hold, and release
  • Simulate touch screen drawing

Memory Reading and Writing:

  • Read/write x amount bytes of consecutive memory from RAM based on:
    1. Absolute memory address
    2. Address relative to main nso base
    3. Address relative to heap base

Screen Capture:

  • Capture current screen and return as JPG

Disclaimer:

This project was created for the purpose of development for bot automation. The creators and maintainers of this project are not liable for any damages caused or bans received. Use at your own risk.

Installation

Download latest release and extract into your Nintendo Switch SD card. Restart your switch.

When installed correctly, sys-botbase will make your docked joy-con's home button glow on switch bootup. If this does not happen, sys-botbase is not installed correctly.

Credits

  • Big thank you to jakibaki for a great sysmodule base to learn and work with, as well as being helpful on the Reswitched discord!
  • Thanks to RTNX on discord for bringing to my attention a nasty little bug that would very randomly cause RAM poking to go bad and the switch (sometimes) crashing as a result.
  • Thanks to Anubis for stress testing!

sys-botbase's People

Contributors

3096 avatar 6a-realm avatar amel-am avatar architdate avatar berichan avatar draconicneo avatar ely3m avatar jakibaki avatar jfmherokiller avatar lincoln-lm avatar lusamine avatar olliz0r avatar thatnerdypikachu avatar www avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sys-botbase's Issues

Your code is being paywalled

There's a youtuber called BLAINES that used your code, put a discord bot on his server, and paywalled it so you can only use it if you "join" his youtube channel or become a twitch sub. Did you give him permission to do this?
Link to the video: https://youtu.be/cOO4kEeK_RU

setStick extremely slow to take effect

First off - thank you so much for building this, I adore this library and it's helped me make some really fun projects. The base of one of those projects is building something that proxies controller input from a Linux PC to the Switch using sys-botbase. I've got everything working without any noticeable delay, except for the stick movement.

I've confirmed that I'm receiving stick events the moment they happen on my end and going through the socket immediately, but they take a few seconds to actually reflect on the switch. Buttons and d-pad functionality work great and are reflected instantaneously.

I believe this is because the library is trying to slide between stick values instead of jumping immediately? But I could be wrong.

Can't get pixelPeek working

I can't seem te get pixelPeek working. Am i doing something wrong?

import socket
import sys
import time
import binascii


def sendCommand(s, content):
    print(content)
    content += '\r\n' #important for the parser on the switch side
    s.sendall(content.encode())

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.178.75", 6000))

sendCommand(s, 'pixelPeek')
res = s.recv(512000)

print(sys.getsizeof(res))

f = open('test.jpeg', 'wb')
f.write(res)
f.close()

Pre release no good

Why is the pre release of 211 still causing my Switch to crash as soon as I get to the home menu if it supports 14.0?

Breaks local play

Hi, I installed sys-botbase a moment ago, and immediately went to local play on ACNH. Sometimes I will get a communication error but otherwise it just says no islands can be found. The gate will open, but the other person also gets no islands can be found.
Wifi stays connected through it even though it says it is disconnecting from wireless.
If I manually turn off wifi through airplane mode the issue persists.

Maybe not something that can be fixed - but it is something I wanted to bring attention to.
Thanks :)

can't inject ek8 in example code

I'm running sys-botbase on emuMMC and i don't use any other cheat homebrews like Edizon.
My game doesn't get ek8 data from toInject.ek8 files, all other function seems doing well tho,
so I think I have sth wrong in below line

sendCommand(s, f"poke 0x4293D8B0 0x{pokemonToInject}")

Could you give me a piece of advice?

Use of sys-bot-based cfw online

I'm looking into creating a discord bot for pokemon seed checking in sword and shield. It's uses sysbot-base.

Since the game will have to go online to trade what steps do I take in my cfw switch to go online without getting banned

Not working in game

Hello,

I have downloaded and installed the sys-botbase with atomsphere 10.3 and tested the controls on the home screen of the switch. Everything on the home screen is working great. However when i open a game (pokemon) and try the controls in the game i am getting a connection timeout.
Any ideas why this is happening?

Installing the nsp with any sort of installer makes sys-botbase unusable

I figured this out the hard way and can’t use livehex or acnhpoker anymore.Solutions I tried but are ineffective are reinstalling both the program that will connect to sys-botbase and sys-botbase itself,I can’t find a solution anywhere because I’m probably the only one who thought the nsp was an installer.

Not working on 10.0.1 Panic occurred while running Atmosphere (latest)

After installing sys-botbase on the latest atmosphere and 10.0.1 it crashes when I run any game.

On the screen it shows me
Paninc occurred while running atmosphere.

Title ID: 010041544D530000
Error Desc: Std: :abort() (0xFFE)

Report saved to /atmosphere/fatal_error/report_0265b10f0.bin

I tried to upload the file here, it won't let me since github does not allow it.

This is not an issue

Im very very interested by these item's Transparent PNG Images, How can
I get these?

Examples for using L Control stick

Thank you for creating this useful tool.

I was wondering if there was a way of using the L Control Stick, I didn't see an example for how to use it within the python script.

If you could explain how to use it that would be great!

Cheers

Failed to read NSP metadata

When installing using Tinfoil or Goldleaf.

manually copied files to atmosphere folder, when launching the exefs.nsp I receive the same error.

I have updated Atmosphere, Tinfoil, and sigpatches.

Feature Request: NFC Support

As the title states, having the ability to give NFC data to the sysbot for it to scan the nfc data on the switch.

Compatibility issues with atmosphere 0.15.0

Anyone else having issues with running sys-botbase on the latest version of atmosphere? It seems to work fine on 0.14.4, but on 0.15.0, atmosphere crashes once I hit the switch home menu.

Any idea what might be causing the crash? My switch is currently on 10.2.0.

Error: 54273

I get every time the same data out when I do a peek.
peek main work without an error.
Also, I when I do a getHeapBase I get a value.
EdiZon is detached, and I don't have any cheat files.

svcReadDebugProcessMemory: 54273

7 and 8 freeze

Why would sysbot 6 work fine but 7 and 8 freeze? It makes no sense.

Switch 13.1.0 and Current sys-bot Version not working

I have CFW 13.1.0 on AMS 1.2.4 and when I install the current package (Following the instructions); I can't get the current sys-botbase to activate. I was was wondering is there a 13.1.0 version coming or am I doing something wrong?

Also, when I check the sysmodules it is not showing up.

Any guidance would be appreciated.

Thank You

Error code 2144-0001 (0x290)

20210430_080454
Every time I go in to the album the switch crashes. When I delete sysbot it loads

12.0.1 AMS M. 19.0 S
Project Clean theam

Problem with FailValidate

Hi, I have a problem with FailValidate, tried your provided tips in FAQ and Troubleshooting but the issue is still not solved, everything is updated.
=>If that fails, you can turn off validation in the settings and try reading RAM again and see if you get the correct inventory values.=Not working
=>If you have plugins loaded, are using cheats=Not working
=>If you have an offset error... =No Idea

(Actually, my first try was about 3-4 days ago and succeeded, but after I download and install a few tweaks I can not use it again, do I have to re-install fresh atmosphere?

Thanks

Add example for sending captured screenshot

In the readme it states capture current screen and send it (only as shitty jpeg at this time), however, I cannot find an example on how to do it.
Can anyone give a brief introduction? that would help a lot.

error code 2021-0003 (0x615)

I'm getting this error code within 10 seconds of boot... I suspect it happens when my switch connects to the internet.

I have tried turning off all other sysmodules thru the tesla menu (I get a memory allocation error when I don't do this) and deleting sys-botbase and re-installing it. I have browsed around for other solutions and none of them have worked.

I'm running firmware v11.0.1 and atmosphere v0.18.1.

What should I do?

Add examples for touch screen

the example file example_PokemonSwSh_SurpriseTrade.py does not have the usage of touch function, can anyone give a brief introduction? that would help a lot.

Error code 2168-0002 (0X4A8)

Hello,
Currently running atmosphere 0.10.5 with botbase 1.3 and latest commits to sysbot, however atmosphere experiences random crashes within an hour and occurs often. I have tried several fresh installs to atmos 0.10.5 and sys-botbase is the only sysmodule installed on the sd card. Prior to 0.10.5, had no crashes at all while running atmosphere 0.10.3.
I am attaching most recent crash log.

01585431031_430000000000000b.log

If you could please assist me in figuring out why my particular issue keeps occurring that would be greatly appreciated.

peek & poke seems broken in v1.5

Peeking different addresses seems to return the same result -

Command : "peek 0xAC4723D0 160"
Result in string: 50EE469C1C000000C40AC0990200000031A2773EA6928FFE3D32B17B3AD08F54826DA39F000000000000000000000000000060A05500000000400000000000009429FC5202937D7FC8120A53D88E989E00000000000000000000000000000000004060A0550000000000C80300000000C0EE469C1C0000001810C0994900000003000000000000008008E699490000008600000000000000004060A055000000

Command : "peek 0xAC472318 160"
Result in string:
50EE469C1C000000C40AC0990200000031A2773EA6928FFE3D32B17B3AD08F54826DA39F000000000000000000000000000060A05500000000400000000000009429FC5202937D7FC8120A53D88E989E00000000000000000000000000000000004060A0550000000000C80300000000C0EE469C1C0000001810C0994900000003000000000000008008E699490000008600000000000000004060A055000000

However, changing the size will shift the poking addresses -

Command : "peek 0xAC4723D0 161"
Result in string: 08EF469C1C0000005037C2994900000050EE469C1C000000C40AC0990200000031A2773EA6928FFE3D32B17B3AD08F54826DA39F000000000000000000000000000060A05500000000400000000000009429FC5202937D7FC8120A53D88E989E00000000000000000000000000000000004060A0550000000000C80300000000C0EE469C1C0000001810C099490000000300000000000000A008E6994900000086

Command : "peek 0xAC472318 161"
Result in string:
08EF469C1C0000005037C2994900000050EE469C1C000000C40AC0990200000031A2773EA6928FFE3D32B17B3AD08F54826DA39F000000000000000000000000000060A05500000000400000000000009429FC5202937D7FC8120A53D88E989E00000000000000000000000000000000004060A0550000000000C80300000000C0EE469C1C0000001810C099490000000300000000000000A008E6994900000086

In fact, you can give random addresses to get the same result -

Command :peek 0x12345678 161
Result in string:
08EF469C1C0000005037C2994900000050EE469C1C000000C40AC0990200000031A2773EA6928FFE3D32B17B3AD08F54826DA39F000000000000000000000000000060A05500000000400000000000009429FC5202937D7FC8120A53D88E989E00000000000000000000000000000000004060A0550000000000C80300000000C0EE469C1C0000001810C0994900000003000000000000002009E6994900000086

Command :peek 0x12345678 161
Result in string:
08EF469C1C000000**5037C2994900000050EE469C1C000000C40AC0990200000031A2773EA6928FFE3D32B17B3AD08F54826DA39F000000000000000000000000000060A05500000000400000000000009429FC5202937D7FC8120A53D88E989E00000000000000000000000000000000004060A0550000000000C80300000000C0EE469C1C0000001810C0994900000003000000000000002009E6994900000086

Crashes on Atmosphere 0.13.0

When installed on Atmosphere 0.13.0, opening hb apps crashes Atmosphere until sysbot files are removed from sd card.

[Enhancement] Add optional websocket support to the app

I have a few ideas for webapps that allow live editing/controling the switch but sys-botbase doesnt have an accessable websocket port.

I am rn trying to see if i can add that using the wslay library.

for now have a typescript connection example

import {PromiseSocket}  from "promise-socket"
import {Socket} from "net";

async function Peek(socket:PromiseSocket<Socket>, address: number, size: number): Promise<Buffer> {
    await socket.write(PeekCommandConstruct(address,size))
    let buffer = Buffer.from((await socket.read()).toString(),'hex').reverse();
    return buffer
}
async function Poke(socket:PromiseSocket<Socket>,address:number,size:number,data:Buffer) {
    let Command = PokeCommandConstruct(address,size,data);
    await socket.write(Command);
}

async function MySocketFun() {
    const socket = new PromiseSocket();
    await socket.connect({
        port: 6000,
        host: "192.168.1.102",
    });

    //test Simple Commands
    const SimpleCommands = ["getTitleID", "getSystemLanguage", "getHeapBase"];
    for (let Command of SimpleCommands) {
        await socket.write(CommandConstruct(Command));
        const response = (await socket.read()) as Buffer
        console.log(`${Command}:${response.toString().trim()}`);
    }
    //peak test
    let result = await Peek(socket,0xAC3B90C0,1024);
    console.log(result.toString('hex'));
    await socket.end();
    socket.destroy();
    //test Poke
    await Poke(socket,0xAC3B90C4,4,Buffer.from([0,0,0,0]))
}

function CommandConstruct(Command: string) {
    return Command + "\r\n";
}

function PeekCommandConstruct(offset: number, size: number) {
    if (Number.isInteger(offset) && Number.isInteger(size)) {
        const Soffset = `0x${offset.toString(16).toUpperCase()}`;
        const SoffsetAndSize = `${Soffset} ${size.toString()}`;
        const Final = `peek ${SoffsetAndSize}`;
        return CommandConstruct(Final);
    } else {
        throw TypeError;
    }
}

function PokeCommandConstruct(offset: number, size: number, data: Buffer) {
    if (Number.isInteger(offset) && Number.isInteger(size)) {
        const Soffset = `0x${offset.toString(16).toUpperCase()}`;
        const SoffsetAndSize = `${Soffset} ${size.toString()}`;
        const Final = `poke ${SoffsetAndSize} ${data.toString('hex')}`;
        return CommandConstruct(Final);
    } else {
        throw TypeError;
    }
}

MySocketFun().catch(console.error);

Peeking and Poking

I'm not sure if I would call this an issue, but I'm not exactly sure who to reach out to in means of this matter.

When attempting to peek a code, it seems like the script isn't going anywhere. Nor does it do anything in the poking process either.

I'm using sendCommand (s, "peek 0xcode")
and following up with sendCommand (s, "poke 0xcode")

But it's just not writing the code.

Any advice?

sys-botbase.nsp installed

I installed this and extracted the zip file for use with ACNH Mobile Spawner. The app can interact and spawn with items, but I installed the NSP file (a mistake after i installed it after the fact i know (i did through awoo installer using ns usbloader 5.2. how can I uninstall it? I don't see it appearing anywhere as an app. Also I noticed using my album in non applet mode while a another application is running causes switch to freeze. Using album without another application running will bring up homebrew menu as normal and holding R in any case will open normal album as normal. was wondering if this is normal or its because i installed the sys-botbase.nsp by accident.

CFW 13.1.0 on AMS 1.2.4.

not work on firmware 10.0.4

hi thanks for hard work on this plug-in
but i'm using NHSE(on animal crossing) at FW10.0.4,botbase cannot work anymore :(

All peek commands return the same value

Using Switch version: 12.0.3|AMS M.19.4|S
Game: Monster Hunter Rise v3.0 (US)
Based on the demo python code for the Pokemon bot

import time
import binascii
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.1.56", 6000))

def sendAndGet(s, content):
    content += '\r\n'
    s.sendall(content.encode())
    time.sleep(0.5)
    get = s.recv(100) 
    print(get)

sendAndGet(s, "peek 0x0DB3D840 0x8")
sendAndGet(s, "peek 0x0DB3D850 0x8")
sendAndGet(s, "peek 0x12345678 0x8")
sendAndGet(s, "peek 0xFFFFFFFF 0x8")
sendAndGet(s, "peek 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0x8")

Gives the output:

b'10ACE21D1E000000\n'
b'10ACE21D1E000000\n'
b'10ACE21D1E000000\n'
b'10ACE21D1E000000\n'
b'10ACE21D1E000000\n'

Each reboot the value will change, however every search remains the same

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.