Skip to main content

Integrates into Future Tone on the PS4

Project description

PyPS4debug

ps4debug implementation in python.

Install (pip)

pip install ps4debug

Example usage

import sys
import functools
import ps4debug

def main(ip_address):
  # You may also retrieve the IP address using the find_ps4() function
  ip_address = ip_address or ps4debug.PS4Debug.find_ps4()

  with ps4debug.PS4Debug(ip_address) as ps4:
    # Get processes
    processes = ps4.get_processes()
    
    # Find specific process id
    pid = next((pid for name, pid in processes if name == 'eboot.bin'), None)
    
    # Read memory
    gold = ps4.read_int32(pid, 0xCA88888)
    
    # Write memory
    if ps4.write_int32(pid, 0xCA44444, 9999) != ps4debug.ResponseCode.SUCCESS:
      print('There was an error!')
      
    # Remotely execute code (Code injection)
    with ps4.memory(pid, 4096) as memory:
      # Write your own assembly code to the system
      assembly = b'\x90\x90\x90\x90\xC3\x90'
      memory.write(assembly)
      
      # And call it. Parameters are limited to 48 bytes or 6 values.
      # See https://docs.python.org/3/library/struct.html#format-strings for more information on the '<6Q' part if you're confused.
      rpc_stub = ps4.install_rpc(pid)
      rax = memory.call(1, 2, 3, 4, 5, 6, rpc_stub=rpc_stub, parameter_format='<6Q')
      
      print(f'Thread returned with rax = {rax}')

    # You may also use functools.partial for cleaner calls:
    get_gold = functools.partial(ps4.read_int32, pid=pid, address=0xCA88888)
    set_gold = functools.partial(ps4.write_int32, pid=pid, address=0xCA88888)
    injected_function = functools.partial(ps4.call, pid=pid, rpc_stub=rpc_stub, address=allocated_memory, parameter_format='<6Q')

    gold = get_gold()
    set_gold(gold + 10)
    injected_function(1, 2, 3, 4, 5, 6)

  
if __name__ == '__main__':
  # Normally you would use something like Typer for this
  args = sys.argv[1:]
  ip_address = args[0] if len(args) else input('Enter the IP address of your PS4: ')
  main(ip_address)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ps4debug-0.0.4.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

ps4debug-0.0.4-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file ps4debug-0.0.4.tar.gz.

File metadata

  • Download URL: ps4debug-0.0.4.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.0

File hashes

Hashes for ps4debug-0.0.4.tar.gz
Algorithm Hash digest
SHA256 1018794abd771132998d9661482ca873404afb1ae18127d48075730aab60e9af
MD5 06b7d980da348ad4dfd99d5a802579f3
BLAKE2b-256 7935ec99323aca6d2df927165dac33e9dce6c20bb41c0927586d6f837dd64880

See more details on using hashes here.

File details

Details for the file ps4debug-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: ps4debug-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.0

File hashes

Hashes for ps4debug-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 23d7472d256dea9b4b24d9740be2929f0b3d2c37e741a353cd9d81853eb5c9ec
MD5 10b2c3f5716b08cd436245d5a094862d
BLAKE2b-256 82f5745b9df9a85dbbc1cbadf76e0e227a4420362b4ae8511221051bf95eb728

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page