rafi1212122 / SCHALE.GameServer

😭😭😭
211 stars 71 forks source link

Club chat commands doesn't work #17

Open SyauqiMA opened 1 month ago

SyauqiMA commented 1 month ago

I am running the server with mitmproxy, everything that has been implemented works fine so far, except the club chat command. Opening club UI and typing /help doesn't give back any response, only sends a "NetworkTime_Sync" Protocol packet (seeing this file, I'm pretty sure you have to enter club to use commands)

image

Running the server in debug mode, it seems like there is a log that says "TcpClient is trying to connect..." everytime I go to the club screen. Is this "TcpClient" being stuck causes the problem? Is there anything I missed?

image

Endergreen12 commented 1 month ago

apparently the game cannot connect to the club chat if it is redirected to the server using mitmproxy so you need to redirect the game to the server using frida

as you know since you look have tried it once with frida, the game detects that the memory has been rewritten by frida and exits the game so you need to use a script that avoids that detection at the same time: https://github.com/apkunpacker/AntiFrida_Bypass/blob/main/AntiFrida_Google.js

use this command to run scripts at same time: frida -U "ブルアカ" -l .\ba.js -l .\AntiFrida_Google.js --realm=emulated

i don't know why, but sometimes it can avoid detection and sometimes it detected it's a game of luck so try it many times

also, root is detected, so it is necessary to apply MagiskHide to the game with Magisk Kitsune before doing so

if successful, you will be greeted by Arona image

DennouNeko commented 1 month ago

I've managed to get the chat to work on mitmproxy. Need to launch it with --ignore 'x.x.x.x', where x.x.x.x is IP of machine that runs SCHALE.GameServer. That way the IRC connection will be passed through without any kind of processing. Full command line:

mitmweb -m wireguard --no-http2 -s redirect_server.py --set termlog_verbosity=warn --ignore x.x.x.x
DennouNeko commented 1 month ago

apparently the game cannot connect to the club chat if it is redirected to the server using mitmproxy so you need to redirect the game to the server using frida

as you know since you look have tried it once with frida, the game detects that the memory has been rewritten by frida and exits the game so you need to use a script that avoids that detection at the same time: https://github.com/apkunpacker/AntiFrida_Bypass/blob/main/AntiFrida_Google.js

use this command to run scripts at same time: frida -U "ブルアカ" -l .\ba.js -l .\AntiFrida_Google.js --realm=emulated

i don't know why, but sometimes it can avoid detection and sometimes it detected it's a game of luck so try it many times

also, root is detected, so it is necessary to apply MagiskHide to the game with Magisk Kitsune before doing so

if successful, you will be greeted by Arona image

btw, how do you get rid of censorship? I'd be fine with it if only mesages received by client were censored, but can't even send the "setaccount" command because "account" gets censored in outgoing message too.

Endergreen12 commented 1 month ago

apparently the game cannot connect to the club chat if it is redirected to the server using mitmproxy so you need to redirect the game to the server using frida as you know since you look have tried it once with frida, the game detects that the memory has been rewritten by frida and exits the game so you need to use a script that avoids that detection at the same time: https://github.com/apkunpacker/AntiFrida_Bypass/blob/main/AntiFrida_Google.js use this command to run scripts at same time: frida -U "ブルアカ" -l .\ba.js -l .\AntiFrida_Google.js --realm=emulated i don't know why, but sometimes it can avoid detection and sometimes it detected it's a game of luck so try it many times also, root is detected, so it is necessary to apply MagiskHide to the game with Magisk Kitsune before doing so if successful, you will be greeted by Arona image

btw, how do you get rid of censorship? I'd be fine with it if only mesages received by client were censored, but can't even send the "setaccount" command because "account" gets censored in outgoing message too.

i can't guess what censorship you means is, sorry do you mean that you send a message and get nothing back? or that you can't type?

DennouNeko commented 1 month ago

btw, how do you get rid of censorship? I'd be fine with it if only mesages received by client were censored, but can't even send the "setaccount" command because "account" gets censored in outgoing message too.

i can't guess what censorship you means is, sorry do you mean that you send a message and get nothing back? or that you can't type?

Parts of messages get turned into asterisks. Both sent by the server and sent to the server. I did print out the message content in the server's log and it did receive it as /set******* Unless I did let it connect to official server by accident and that's why it got the filters in the first place... 2024-08-15 16_52_59-Window

Endergreen12 commented 1 month ago

wow, i've never seen this phenomenon before I don't know why this happens, sorry i once did this with a client that connected to the official server once, but this should not have happened

DennouNeko commented 1 month ago

I see. Thanks anyways.

KisegamiUSTH commented 4 weeks ago

I've managed to get the chat to work on mitmproxy. Need to launch it with --ignore 'x.x.x.x', where x.x.x.x is IP of machine that runs SCHALE.GameServer. That way the IRC connection will be passed through without any kind of processing. Full command line:

mitmweb -m wireguard --no-http2 -s redirect_server.py --set termlog_verbosity=warn --ignore x.x.x.x

I have try ignore as much ip as i know but somehow it still show TcpClient is trying to connect... I don't know which is wrong but it should be the same as SERVER_HOST right?

DennouNeko commented 4 weeks ago

I've managed to get the chat to work on mitmproxy. Need to launch it with --ignore 'x.x.x.x', where x.x.x.x is IP of machine that runs SCHALE.GameServer. That way the IRC connection will be passed through without any kind of processing. Full command line:

mitmweb -m wireguard --no-http2 -s redirect_server.py --set termlog_verbosity=warn --ignore x.x.x.x

I have try ignore as much ip as i know but somehow it still show TcpClient is trying to connect... I don't know which is wrong but it should be the same as SERVER_HOST right?

Yes, it should be the same. Worked for me both with mitmproxy running on same machine as the server and with redirecting to another machine.

I was trying to check if it could be part of the python script, but so far couldn't find a way to do it...

DennouNeko commented 4 weeks ago

Just remembered... On first launch the server will try to figure out the machine's IP address by trying to pick one of network adapters. You should check the Config.json and adjust IRCAddress if it's not the same as SERVER_HOST.

Endergreen12 commented 3 weeks ago

i noticed that frida's script includes a process to remove restrictions on prohibited terms in chat

image

therefore, using the frida script allows to escape the prohibition, but due to the update just yesterday, it is no longer redirected to the server even if used the frida script

the method of redirecting by mitmweb still seems to work

it may be possible to remove the prohibition by redirecting the “ProhibitedWordBlackListUri” so that the list of restricted terms cannot be retrieved

Endergreen12 commented 3 weeks ago

the blacklist appears to be obtained from prod-notice.bluearchiveyostar.com

i was able to get around the prohibiting by adding that address to the REWRITE_HOST_LIST

image

image

DennouNeko commented 3 weeks ago

I decided to just kill the request instead xD Added this after the REWRITE_HOST_LIST:

KILL_FLOW_LIST = [
    'prod-notice.bluearchiveyostar.com',
]

And this in the request function, between conditions for the log and REWRITE_HOST_LIST:

        if flow.request.pretty_host in KILL_FLOW_LIST:
            flow.kill()
            return

But good to know it's not stored anywhere. And thanks for pointing it out, this helps a lot.

Endergreen12 commented 3 weeks ago

yeah, that looks better