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

Use the PPPoE password to determine the system version #56

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

lordfriky
Copy link

All these changes were made by CelesteBlue, I'm just doing the PR since Celeste doesn't have a GitHub account anymore.

pppwn.py Outdated
if pkt[PPP_PAP_Request].passwd_len != 0:
pwd = pkt[PPP_PAP_Request].password.decode("ascii")
print("PAP password:", pwd)
if pwd in ('750', '751', '755')\
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewrite to not repeat the same list of fws

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we really need to know from where the firmware was selected, so I removed the check altogether. I can rewrite the other way if you prefer it.

lordfriky and others added 3 commits May 8, 2024 02:57
In case offsets differ from retail/devkit, for example.
- < 5.50 needs less patching for copyin/copyout/copyinstr
- < 6.50 did not need veri patches
- < 6.50 does not require changes for ud2 instruction
@Al-Azif
Copy link
Contributor

Al-Azif commented May 8, 2024

Opened a PR with checks for multi FW stuff for lower FWs on this branch.

@lordfriky
Copy link
Author

Opened a PR with checks for multi FW stuff for lower FWs on this branch.

Merged, thank you!

Comment on lines +154 to +173
def getOffsets(sys_ver):
if sys_ver in ('750', '751', '755'):
return OffsetsFirmware_750_755()
elif sys_ver in ('800', '801', '803'):
return OffsetsFirmware_800_803()
elif sys_ver in ('850', '852'):
return OffsetsFirmware_850_852()
elif sys_ver == '900':
return OffsetsFirmware_900()
elif sys_ver in ('903', '904'):
return OffsetsFirmware_903_904()
elif sys_ver in ('950', '951', '960'):
return OffsetsFirmware_950_960()
elif sys_ver in ('1000', '1001'):
return OffsetsFirmware_1000_1001()
elif sys_ver in ('1050', '1070', '1071'):
return OffsetsFirmware_1050_1071()
elif sys_ver == '1100':
return OffsetsFirmware_1100()
return None

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def getOffsets(sys_ver):
if sys_ver in ('750', '751', '755'):
return OffsetsFirmware_750_755()
elif sys_ver in ('800', '801', '803'):
return OffsetsFirmware_800_803()
elif sys_ver in ('850', '852'):
return OffsetsFirmware_850_852()
elif sys_ver == '900':
return OffsetsFirmware_900()
elif sys_ver in ('903', '904'):
return OffsetsFirmware_903_904()
elif sys_ver in ('950', '951', '960'):
return OffsetsFirmware_950_960()
elif sys_ver in ('1000', '1001'):
return OffsetsFirmware_1000_1001()
elif sys_ver in ('1050', '1070', '1071'):
return OffsetsFirmware_1050_1071()
elif sys_ver == '1100':
return OffsetsFirmware_1100()
return None
def getOffsets(sys_ver):
match sys_ver:
case '750' | '751' | '755':
return OffsetsFirmware_750_755()
case '800' | '801' | '803':
return OffsetsFirmware_800_803()
case '850' | '852':
return OffsetsFirmware_850_852()
case '900':
return OffsetsFirmware_900()
case '903' | '904':
return OffsetsFirmware_903_904()
case '950' | '951' | '960':
return OffsetsFirmware_950_960()
case '1000' | '1001':
return OffsetsFirmware_1000_1001()
case '1050' | '1070' | '1071':
return OffsetsFirmware_1050_1071()
case '1100':
return OffsetsFirmware_1100()
case _:
return None

Perhaps use a switch statement instead. Improves readability and also gives a slight perf improvement.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use a map string -> function pointer

@@ -205,6 +215,11 @@ class OffsetsFirmware_850_852:

MEMCPY = 0xffffffff825a40f0

# Not available on FW >= 6.50
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you have these comments

Copy link
Contributor

@Al-Azif Al-Azif May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre 6.50 you don't have the ud2 in that gadget, we can actually remove the MOV_CR0_RSI_MOV_EAX_1_RET gadget from FW >=6.50 and the MOV_CR0_RSI_UD2_MOV_EAX_1_RET from FW < 6.50. I just had them there when I was working on stuff so I could keep stuff straight, they're just the base @ ffffffff82200000 as a placeholder.

Or we can remove the conditional when the gadget is used and just use one of them for both (variable name won't match contents).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well please remove them

@@ -65,18 +65,20 @@ On your PS4:
- Go to `Settings` and then `Network`
- Select `Set Up Internet connection` and choose `Use a LAN Cable`
- Choose `Custom` setup and choose `PPPoE` for `IP Address Settings`
- Enter anything for `PPPoE User ID` and `PPPoE Password`
- Enter anything for `PPPoE User ID`
- Enter PS4/PS5 System Software version (e.g 900 for 9.00) for `PPPoE Password`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why PS5??

if key == "sys_ver":
return pwd

def getOffsets(sys_ver):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_offsets

@Andryshik345
Copy link

Andryshik345 commented May 16, 2024

Will that fallback if I'll continue to use --fw parameter and random pppoe username-password?

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

Successfully merging this pull request may close these issues.

6 participants