Toolbox for analyzing and editing pkg application files for psp,ps3, ps4 and ps5, includes the most useful functions you might need.
| 1 | def modify_file_header(pkg_file, offset, new_data): |
| 2 | with open(pkg_file, 'r+b') as f: |
| 3 | f.seek(offset) |
| 4 | f.write(new_data) |
| 5 | return len(new_data) |