Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This fixes LBP games connecting to Custom Server #11233

Closed
wants to merge 2 commits into from

Conversation

FridiNaTor1
Copy link

This patch was made by jvyden This makes it possible to connect LBP games to a custom server. Otherwise it will always disconnect you.

This fixes LBP games connecting to a custom server
@kd-11
Copy link
Contributor

kd-11 commented Dec 6, 2021

This is a hack at best. No effort is made to document what functionality is missing, only tries to make problems "go away" by sweeping them under the rag.

@Kilowog01
Copy link
Contributor

Kilowog01 commented Dec 6, 2021

Every time a new server appears, a custom build with this hack also appears. From what I see in the community, the socket type used in LBP games is RAW, which supposedly is the only socket that doesn't have a check and therefore "there would be no problem removing this". I don't know what a socket type raw is, how it works or what it eats. I'm just bringing the info. Maybe one of you guys can add the check for socket type raw, I don't know...
EDIT: Maybe #11065 is a solution

@kd-11
Copy link
Contributor

kd-11 commented Dec 6, 2021

Every time a new server appears, a custom build with this hack also appears. From what I see in the community, the socket type used in LBP games is RAW, which supposedly is the only socket that doesn't have a check and therefore "there would be no problem removing this". I don't know what a socket type raw is, how it works or what it eats. I'm just bringing the info. Maybe one of you guys can add the check for socket type raw, I don't know... EDIT: Maybe #11065 is a solution

Seems to be the same hack. Also why not add the required error codes to the list of known error codes? With some little effort this patch could be improved drastically.
As for raw socket and why it is missing, only @RipleyTom can answer that.

@RipleyTom
Copy link
Contributor

Raw sockets aren't associated with a protocol and let you basically forge IP headers.
The problem is it requires Administrator on windows or root on Linux(or a flag that has to be set by root on the executable) so it can't really be implemented.

@FridiNaTor1
Copy link
Author

That can't be right. I can open up RPCS3 without any Administrative rights, and it will work with this patch.

@RipleyTom
Copy link
Contributor

Yes because you ignore the fact that it is not implemented and then you ignore the error that inevitably happen because you don't have the rights.
It's an absolutely terrible hack.

@RipleyTom RipleyTom closed this Dec 6, 2021
@FridiNaTor1
Copy link
Author

Yes because you ignore the fact that it is not implemented and then you ignore the error that inevitably happen because you don't have the rights. It's an absolutely terrible hack.

Maybe it would be possible to let it only use ports above 1024 I think those don't require Administrative rights, would that not be implementable somehow? It sounds odd to me. That it can't be implemented, but ignoring the error as you say it, makes it work?

@RipleyTom
Copy link
Contributor

RipleyTom commented Dec 6, 2021

it has nothing to do with port number and everything to do with SOCK_RAW as I explained(though ports < 1024 also require admin rights).
What you're doing here is basically

    if (type == SYS_NET_SOCK_RAW)
    {
        return CELL_OK;
    }

in a function that should return a socket fd.
Presumably the caller only checks for < 0 for error and so it continues, no socket having been created(and all further functions trying to use that socket will fail but just with a SYS_NET_EBADF.

My guess is the game creates RAW socket to generate ICMP packets to ping other users and determine latency.
My suggestion would be to patch LBP directly with our patch system(just patch the check after the socket creation in LBP itself and it should work the same as this PR).

@FridiNaTor1
Copy link
Author

it has nothing to do with port number and everything to do with SOCK_RAW as I explained(though ports < 1024 also require admin rights). What you're doing here is basically

    if (type == SYS_NET_SOCK_RAW)
    {
        return CELL_OK;
    }

in a function that should return a socket fd. Presumably the caller only checks for < 0 for error and so it continues, no socket having been created(and all further functions trying to use that socket will fail but just with a SYS_NET_EBADF.

My guess is the game creates RAW socket to generate ICMP packets to ping other users and determine latency. My suggestion would be to patch LBP directly with our patch system(just patch the check after the socket creation in LBP itself and it should work the same as this PR).

Patch system? I did not know about this. Could you inform me a bit :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants