mirror of
https://github.com/neokuze/ps5-rust.git
synced 2026-10-29 04:02:20 +01:00
Target fixes (payloads built with the custom target ran nothing): - default-uwtable: keeps the SDK linker script's page-aligned .eh_frame_hdr, so data no longer shares a page with code (which made main non-executable) - relro full: rustc only emits GOT calls (GLOB_DAT) with full relro; partial relro produced PLT JUMP_SLOT relocations unlike the SDK's -fno-plt output New: - ps5::net: blocking IPv4 TcpListener/TcpStream with errno errors - examples/http_server: PS5 serves /info, /notify?msg=, /quit on port 9954 - examples/pc/ps5_client.py + .cmd launchers for the PC side - ps5::http::last_step() names the SDK call that failed Tested on CFI-1215A, fw 13.60: hwinfo, http_test and http_server all run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
"""PC client for the http_server payload. Run: python examples/pc/ps5_client.py
|
|
|
|
Asks for the PS5's IP, then lets you read its info, send it a toast,
|
|
or stop the server.
|
|
"""
|
|
import urllib.error
|
|
import urllib.parse
|
|
import urllib.request
|
|
|
|
PORT = 9954
|
|
|
|
|
|
def call(ip, path):
|
|
url = f"http://{ip}:{PORT}{path}"
|
|
try:
|
|
with urllib.request.urlopen(url, timeout=5) as r:
|
|
return f"[{r.status}] {r.read().decode(errors='replace').strip()}"
|
|
except urllib.error.HTTPError as e:
|
|
return f"[{e.code}] {e.read().decode(errors='replace').strip()}"
|
|
except OSError as e:
|
|
return f"cannot reach {url}: {e}"
|
|
|
|
|
|
def main():
|
|
ip = input("PS5 IP (e.g. 192.168.1.49): ").strip()
|
|
while True:
|
|
print("\n1) info 2) send notification 3) stop server 0) exit")
|
|
choice = input("> ").strip()
|
|
if choice == "1":
|
|
print(call(ip, "/info"))
|
|
elif choice == "2":
|
|
msg = input("message: ")
|
|
print(call(ip, "/notify?msg=" + urllib.parse.quote_plus(msg)))
|
|
elif choice == "3":
|
|
print(call(ip, "/quit"))
|
|
elif choice == "0":
|
|
break
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|