mirror of
https://github.com/manos555555/PS5-Suite.git
synced 2026-10-06 18:00:31 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45afca892c | ||
|
|
f065b79b33 | ||
|
|
4403d86be5 | ||
|
|
af252efc9a | ||
|
|
2da27aed13 | ||
|
|
264ad6210d | ||
|
|
db48bc6fb2 | ||
|
|
4ac43ebb8b | ||
|
|
20caced5f4 | ||
|
|
285279788f | ||
|
|
70d174cecc | ||
|
|
f128c6a6b4 | ||
|
|
c211c086ac | ||
|
|
4ca30876c7 | ||
|
|
5ae3c1709e | ||
|
|
3374e87bfe |
No files matched your search
-60
@@ -1,60 +0,0 @@
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio cache/options
|
||||
.vs/
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# Build results
|
||||
*.dll
|
||||
*.exe
|
||||
*.pdb
|
||||
*.cache
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# Files built by Visual Studio
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Caches
|
||||
*.swp
|
||||
*~
|
||||
|
||||
# OS generated files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
# Temporary files
|
||||
*.tmp
|
||||
*.log
|
||||
*.bak
|
||||
*.old
|
||||
|
||||
# PowerShell script
|
||||
convert_to_ico.ps1
|
||||
+147
@@ -1,5 +1,152 @@
|
||||
# Changelog - PS5 Upload Suite
|
||||
|
||||
## Version 3.2.0 - Mobile Improvements & Bug Fixes (January 24, 2026)
|
||||
|
||||
### 🎯 Improvements
|
||||
|
||||
#### 💾 Accurate Storage Display
|
||||
- **Storage now matches PS5 UI** - Shows ~848 GB instead of raw 872 GB
|
||||
- **Accounts for reserved space** - Same calculation as PS5 system
|
||||
- Uses proper calculation: `(total_blocks - reserved) * block_size`
|
||||
|
||||
#### 📱 Mobile App Improvements
|
||||
- **Multi-select mode** - Toggle button (☑️/✅) to select multiple files/folders
|
||||
- **Folder browser** - Visual folder picker for Copy/Move destinations with recursive navigation
|
||||
- **Sorted file list** - Folders always displayed at top, then files (alphabetically)
|
||||
- **Exit confirmation** - Prompt dialog when pressing back button
|
||||
- **Delete folders** - Now supports folder deletion (not just files)
|
||||
- **Batch operations** - Delete/download multiple items at once
|
||||
|
||||
#### 3. 🐛 Bug Fixes
|
||||
- **Fixed empty folder deletion** - No more "Unexpected response" error when deleting empty directories
|
||||
- **Fixed Copy/Move crash** - No longer crashes when selecting destination folder (saved file info before browsing)
|
||||
- **Fixed multi-select count** - Correct item count in delete confirmation dialog
|
||||
- **Fixed folder navigation** - Can enter folders after actions complete (auto-exit multi-select mode)
|
||||
|
||||
---
|
||||
|
||||
## Version 3.1.0 - Parallel Chunked Uploads (January 2026)
|
||||
|
||||
### 🚀 Performance Improvements
|
||||
|
||||
#### 1. ⚡ Parallel Chunked Uploads (104 MB/s!)
|
||||
- **Large files (>100MB)** are now split into 500MB chunks
|
||||
- **4 parallel connections** upload chunks simultaneously
|
||||
- **Result:** ~104 MB/s upload speed (2x faster than before!)
|
||||
- **Fixed race condition:** First chunk creates file before others start
|
||||
- **Fixed closure bug:** Correct offset/size capture for parallel tasks
|
||||
|
||||
#### 2. 📊 Real-time Progress Display
|
||||
- **Speed display** now updates in real-time during chunked uploads
|
||||
- **ETA display** shows accurate time remaining
|
||||
- **Progress bar** correctly shows 0-100% for chunked files
|
||||
- No more speed dropping to 0 during large file uploads
|
||||
|
||||
#### 3. 💾 Storage Display Improvements
|
||||
- **Changed label** to "Data Storage (/data)" for clarity
|
||||
- **Uses statfs with f_bavail** for more accurate available space
|
||||
- **Real-time updates** every 5 seconds when connected
|
||||
|
||||
---
|
||||
|
||||
## Version 3.0.0 - Mobile Client & Path Fixes (January 2026)
|
||||
|
||||
### 🐛 Critical Bug Fixes
|
||||
|
||||
#### 1. 🔧 Path Normalization Fix
|
||||
- **Fixed:** Double-slash paths (`//mnt/ext1/...`) that caused directory creation to fail
|
||||
- **Affected:** All file operations (upload, download, delete, rename, copy, move)
|
||||
- **Solution:** Added `NormalizePath()` function in both client and server
|
||||
- **Result:** 100% reliable directory creation and file uploads
|
||||
|
||||
#### 2. 📱 Android Mobile Client
|
||||
- **NEW:** Full-featured Android app for PS5 file management
|
||||
- **Multi-PS5 Profiles** - Save and switch between multiple PS5 consoles
|
||||
- Upload files from phone to PS5
|
||||
- Download files from PS5 with Share option
|
||||
- Browse PS5 filesystem
|
||||
- Create new folders
|
||||
- Rename files/folders
|
||||
- Copy files/folders
|
||||
- Move files/folders
|
||||
- Delete files
|
||||
- Favorites for quick navigation
|
||||
- Debug Log with Copy to clipboard
|
||||
- Transfer History tracking
|
||||
|
||||
#### 3. 🛠️ Server Improvements
|
||||
- Path normalization in all handler functions
|
||||
- More robust error handling
|
||||
- Improved stability for parallel uploads
|
||||
|
||||
---
|
||||
|
||||
## Version 2.1.0 - Performance & History (January 2026)
|
||||
|
||||
### 🚀 Performance Optimizations
|
||||
|
||||
#### 1. ⚡ Massive Upload Speed Boost (88-110 MB/s)
|
||||
- **Server-side:** Replaced `fwrite()` with direct `write()` syscalls
|
||||
- **Client-side:** 8 parallel large file uploads (optimal for PS5 disk)
|
||||
- **Result:** 80-110 MB/s aggregate upload speed on Gigabit Ethernet
|
||||
- **Peak bursts:** Up to 2.05 GB/s when hitting disk cache
|
||||
- **Per-file:** 11-14 MB/s sustained per connection
|
||||
|
||||
#### 2. 📊 Transfer History
|
||||
- Complete history of all uploads and downloads
|
||||
- Success/Failed status tracking with error messages
|
||||
- Speed statistics (average, min, max)
|
||||
- Export to CSV/JSON for analysis
|
||||
- Persistent storage across sessions
|
||||
|
||||
#### 3. 🔄 Auto-Clear History on Startup
|
||||
- Optional checkbox to clear history automatically
|
||||
- Useful for keeping UI clean between sessions
|
||||
- Setting saved in `ps5_upload_settings.json`
|
||||
|
||||
#### 4. 🖥️ Maximized Window UI
|
||||
- Application opens in full-screen mode by default
|
||||
- Better visibility for large file transfers
|
||||
- Can be resized/restored as needed
|
||||
|
||||
### Technical Improvements
|
||||
- ✅ **16MB socket buffers** (up from 4MB) for maximum throughput
|
||||
- ✅ **Per-file mutex locking** - Parallel writes without race conditions
|
||||
- ✅ **File pre-allocation** - Reduces disk fragmentation for large files
|
||||
- ✅ **Direct syscalls** - Bypasses stdio buffering overhead
|
||||
|
||||
---
|
||||
|
||||
## Version 2.0.0 - Download & Multi-PS5 (January 2026)
|
||||
|
||||
### 🎉 4 Major New Features
|
||||
|
||||
#### 1. 📥 Download Files (PS5 → PC)
|
||||
- Right-click any file → "⬇️ Download to PC"
|
||||
- Save file dialog for destination selection
|
||||
- Real-time progress tracking with speed display
|
||||
- Optimized with sendfile for maximum speed
|
||||
|
||||
#### 2. 🔍 File Search
|
||||
- Search box in PS5 Files panel
|
||||
- Real-time filtering as you type
|
||||
- Case-insensitive search
|
||||
- Quick "Clear" button to reset
|
||||
|
||||
#### 3. ⭐ Favorites/Bookmarks
|
||||
- Save frequently used PS5 paths
|
||||
- Quick dropdown navigation
|
||||
- Add/Remove favorite paths
|
||||
- Persistent storage in JSON
|
||||
|
||||
#### 4. 🎮 Multi-PS5 Support
|
||||
- Save multiple PS5 profiles (IP + name)
|
||||
- Quick switch between different PS5 consoles
|
||||
- Dropdown profile selector
|
||||
- Persistent profile storage
|
||||
|
||||
---
|
||||
|
||||
## Version 1.3.0 - Stable Release (January 13, 2026)
|
||||
|
||||
### 🎯 Major Achievement
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
# PS5 Upload Suite v2.0.0 - Feature-Rich Release
|
||||
|
||||
## 🎉 What's New - 4 Major Features Added!
|
||||
|
||||
### 1. 📥 Download Files (PS5 → PC)
|
||||
- Right-click any file → "⬇️ Download to PC"
|
||||
- Save file dialog for destination
|
||||
- Real-time progress with speed tracking
|
||||
- Optimized with sendfile for maximum speed
|
||||
|
||||
### 2. 🔍 File Search
|
||||
- Search box in PS5 Files panel
|
||||
- Real-time filtering as you type
|
||||
- Case-insensitive search
|
||||
- Quick "Clear" button
|
||||
|
||||
### 3. ⭐ Favorites/Bookmarks
|
||||
- Save frequently used PS5 paths
|
||||
- Quick dropdown navigation
|
||||
- Add/Remove favorite paths
|
||||
- Persistent JSON storage
|
||||
|
||||
### 4. 🎮 Multi-PS5 Support
|
||||
- Save multiple PS5 profiles (IP + name)
|
||||
- Quick switch between consoles
|
||||
- Dropdown profile selector
|
||||
- Persistent profile storage
|
||||
|
||||
---
|
||||
|
||||
## 📦 Installation
|
||||
|
||||
### Server (PS5)
|
||||
1. Copy `ps5_upload_server.elf` to `/data/etaHEN/payloads/`
|
||||
2. Load with elfldr
|
||||
3. Server starts on port 9113
|
||||
|
||||
### Client (Windows)
|
||||
1. Download `PS5Upload.exe`
|
||||
2. Run on Windows 10/11
|
||||
3. Enter PS5 IP and connect
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Performance
|
||||
|
||||
- **Upload Speed:** 100-120 MB/s (Gigabit Ethernet)
|
||||
- **Download Speed:** Same high-speed protocol
|
||||
- **Stability:** Zero connection drops (from v1.3.0)
|
||||
- **Tested:** 42,801+ files uploaded successfully
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Technical Details
|
||||
|
||||
### New Protocol Command
|
||||
- `CMD_DOWNLOAD_FILE` (0x13) - Download files from PS5
|
||||
|
||||
### Server Changes
|
||||
- Added sendfile-based download handler
|
||||
- Fixed LIST_DIR to return actual file sizes
|
||||
- Zero-copy file transfer
|
||||
|
||||
### Client Changes
|
||||
- 4 new UI panels (Search, Favorites, Profiles, Download)
|
||||
- JSON-based persistence (ps5_profiles.json, ps5_favorites.json)
|
||||
- Custom dark theme for all ComboBox dropdowns
|
||||
- ~500+ lines of new code
|
||||
|
||||
---
|
||||
|
||||
## ⬆️ Upgrading from v1.3.0
|
||||
|
||||
1. Replace server: Copy new `ps5_upload_server.elf` to PS5
|
||||
2. Replace client: Download new `PS5Upload.exe`
|
||||
3. Your settings will be preserved
|
||||
|
||||
**New files created:**
|
||||
- `ps5_profiles.json` - Saved PS5 profiles
|
||||
- `ps5_favorites.json` - Saved favorite paths
|
||||
|
||||
---
|
||||
|
||||
## 📋 Files in This Release
|
||||
|
||||
- `ps5_upload_server.elf` (129 KB) - PS5 server payload
|
||||
- `PS5Upload.exe` (8.2 MB) - Windows client (self-contained)
|
||||
|
||||
---
|
||||
|
||||
## 🙏 Credits
|
||||
|
||||
**By Manos**
|
||||
|
||||
Special thanks to the PS5 homebrew community!
|
||||
|
||||
---
|
||||
|
||||
**Enjoy the new features!** 🚀
|
||||
-83
@@ -1,83 +0,0 @@
|
||||
# PS5 Upload Protocol Specification
|
||||
|
||||
## Overview
|
||||
Custom binary protocol for high-speed file transfers between PC and PS5.
|
||||
Port: 9113
|
||||
|
||||
## Message Format
|
||||
|
||||
All messages follow this structure:
|
||||
```
|
||||
[Command (1 byte)][Data Length (4 bytes)][Data (variable)]
|
||||
```
|
||||
|
||||
## Commands
|
||||
|
||||
### Client → Server
|
||||
|
||||
| Command | Value | Description | Data Format |
|
||||
|---------|-------|-------------|-------------|
|
||||
| PING | 0x01 | Test connection | None |
|
||||
| LIST_STORAGE | 0x02 | Get storage info | None |
|
||||
| LIST_DIR | 0x03 | List directory | Path (null-terminated string) |
|
||||
| CREATE_DIR | 0x04 | Create directory | Path (null-terminated string) |
|
||||
| DELETE_FILE | 0x05 | Delete file | Path (null-terminated string) |
|
||||
| DELETE_DIR | 0x06 | Delete directory | Path (null-terminated string) |
|
||||
| START_UPLOAD | 0x10 | Start file upload | Path (null-terminated) + File size (8 bytes) |
|
||||
| UPLOAD_CHUNK | 0x11 | Upload file chunk | Chunk data (raw bytes) |
|
||||
| END_UPLOAD | 0x12 | Finish upload | None |
|
||||
| SHUTDOWN | 0xFF | Shutdown server | None |
|
||||
|
||||
### Server → Client
|
||||
|
||||
| Response | Value | Description | Data Format |
|
||||
|----------|-------|-------------|-------------|
|
||||
| OK | 0x01 | Success | Optional message |
|
||||
| ERROR | 0x02 | Error occurred | Error message (null-terminated) |
|
||||
| DATA | 0x03 | Response data | Variable format |
|
||||
| READY | 0x04 | Ready for next chunk | None |
|
||||
| PROGRESS | 0x05 | Upload progress | Bytes written (8 bytes) |
|
||||
|
||||
## Data Formats
|
||||
|
||||
### LIST_STORAGE Response
|
||||
```
|
||||
[Drive count (4 bytes)]
|
||||
For each drive:
|
||||
[Path length (2 bytes)][Path][Total space (8 bytes)][Free space (8 bytes)]
|
||||
```
|
||||
|
||||
### LIST_DIR Response
|
||||
```
|
||||
[Entry count (4 bytes)]
|
||||
For each entry:
|
||||
[Type (1 byte: 0=file, 1=dir)][Name length (2 bytes)][Name][Size (8 bytes)][Timestamp (8 bytes)]
|
||||
```
|
||||
|
||||
## Flow Examples
|
||||
|
||||
### Upload File
|
||||
```
|
||||
Client: START_UPLOAD "/data/test.bin" size=1048576
|
||||
Server: READY
|
||||
Client: UPLOAD_CHUNK [4MB data]
|
||||
Server: PROGRESS bytes=4194304
|
||||
Client: UPLOAD_CHUNK [remaining data]
|
||||
Server: PROGRESS bytes=1048576
|
||||
Client: END_UPLOAD
|
||||
Server: OK
|
||||
```
|
||||
|
||||
### List Directory
|
||||
```
|
||||
Client: LIST_DIR "/data"
|
||||
Server: DATA [directory listing]
|
||||
```
|
||||
|
||||
## Performance Optimizations
|
||||
|
||||
- 4MB socket buffers
|
||||
- SO_NOSIGPIPE enabled
|
||||
- TCP_NODELAY for low latency
|
||||
- Direct disk writes (no temp files)
|
||||
- Streaming chunks (no full file buffering)
|
||||
Binary file not shown.
@@ -2,41 +2,45 @@
|
||||
|
||||
**By Manos**
|
||||
|
||||
**Version 2.0.0 - Feature-Rich Release**
|
||||
**Version 3.2.0 - Mobile Improvements & Bug Fixes**
|
||||
|
||||
Custom high-speed file transfer system for PS5 with etaHEN. Achieves **100+ MB/s** transfer speeds using a custom binary protocol.
|
||||
Custom high-speed file transfer system for PS5 with etaHEN. Achieves **104+ MB/s** upload speeds for large files using parallel chunked uploads!
|
||||
|
||||
⭐ **NEW in v2.0.0:** 4 Major Features Added - Download Files, File Search, Favorites/Bookmarks, Multi-PS5 Support!
|
||||
⭐ **NEW in v3.2.0:** Accurate storage display (848 GB), mobile multi-select, folder browser, bug fixes!
|
||||
|
||||

|
||||

|
||||
📱 **Android Mobile Client available!**
|
||||
|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
## 📦 What's Included
|
||||
## 📦 Downloads
|
||||
|
||||
Download the latest release from the [Releases](https://github.com/manos555555/PS5-Upload-Suite/releases) page:
|
||||
|
||||
### 1. PS5 Server Payload
|
||||
- **File:** `payload/ps5_upload_server.elf`
|
||||
- **File:** `ps5_upload_server.elf`
|
||||
- **Port:** 9113
|
||||
- **Protocol:** Custom binary (optimized for speed)
|
||||
- **Features:**
|
||||
- 4MB socket buffers
|
||||
- SO_NOSIGPIPE enabled
|
||||
- TCP_NODELAY for low latency
|
||||
- Direct disk writes (no temp files)
|
||||
- Multi-threaded client handling
|
||||
- High-speed custom binary protocol
|
||||
- 16MB socket buffers for maximum throughput
|
||||
- Multi-threaded client handling
|
||||
|
||||
### 2. Windows GUI Client
|
||||
- **File:** `client/bin/Release/net6.0-windows/win-x64/publish/PS5Upload.exe`
|
||||
- **Framework:** .NET 6.0 WPF
|
||||
- **Features:**
|
||||
- Modern dark theme UI
|
||||
- Drag & drop file/folder upload
|
||||
- Browse PS5 filesystem
|
||||
- Real-time upload progress
|
||||
- Speed indicator (MB/s)
|
||||
- Storage space display
|
||||
- Recursive folder upload
|
||||
- **File:** `PS5Upload.exe`
|
||||
- Self-contained executable (no .NET installation required)
|
||||
- Modern dark theme UI
|
||||
- Drag & drop file/folder upload
|
||||
- Real-time upload progress with speed tracking
|
||||
- Transfer History with success/failed tracking
|
||||
- Storage space display
|
||||
|
||||
### 3. 📱 Android Mobile Client
|
||||
- **File:** `PS5UploadMobile.apk`
|
||||
- Upload/download files from your phone
|
||||
- Multi-PS5 Profiles support
|
||||
- Browse PS5 filesystem
|
||||
- Favorites for quick navigation
|
||||
|
||||
---
|
||||
|
||||
@@ -44,17 +48,13 @@ Custom high-speed file transfer system for PS5 with etaHEN. Achieves **100+ MB/s
|
||||
|
||||
### Step 1: Load PS5 Payload
|
||||
|
||||
1. Copy `payload/ps5_upload_server.elf` to your PS5:
|
||||
```
|
||||
/data/etaHEN/payloads/ps5_upload_server.elf
|
||||
```
|
||||
1. Download `ps5_upload_server.elf` from the [Releases](https://github.com/manos555555/PS5-Upload-Suite/releases) page
|
||||
|
||||
2. Load the payload with elfldr
|
||||
2. Copy it to your PS5: `/data/etaHEN/payloads/ps5_upload_server.elf`
|
||||
|
||||
3. You should see notification:
|
||||
```
|
||||
PS5 Upload Server: 192.168.0.XXX:9113 - By Manos
|
||||
```
|
||||
3. Load the payload with elfldr
|
||||
|
||||
4. You should see notification: `PS5 Upload Server: 192.168.0.XXX:9113 - By Manos`
|
||||
|
||||
### Step 2: Run Windows Client
|
||||
|
||||
@@ -80,86 +80,45 @@ Custom high-speed file transfer system for PS5 with etaHEN. Achieves **100+ MB/s
|
||||
✅ **Robust Error Handling** - Graceful failures
|
||||
|
||||
### Windows Client
|
||||
✅ **Modern UI** - Dark theme, clean design
|
||||
✅ **Modern UI** - Dark theme, maximized window for better visibility
|
||||
✅ **Drag & Drop** - Files and folders
|
||||
✅ **Browse PS5** - Navigate filesystem
|
||||
✅ **Real-time Progress** - Speed & percentage
|
||||
✅ **Real-time Progress** - Speed & percentage tracking
|
||||
✅ **Optimized Upload** - 8 parallel connections for 88-110 MB/s aggregate speed (NEW v2.1)
|
||||
✅ **Transfer History** - Track all uploads/downloads with success/failed status (NEW v2.1)
|
||||
✅ **Auto-Clear History** - Optional auto-clear on startup (NEW v2.1)
|
||||
✅ **Folder Upload** - Recursive directory upload
|
||||
✅ **Storage Info** - Free space display
|
||||
✅ **Download Files** - Download from PS5 to PC (NEW v2.0)
|
||||
✅ **File Search** - Real-time filtering of PS5 files (NEW v2.0)
|
||||
✅ **Favorites/Bookmarks** - Quick navigation to saved paths (NEW v2.0)
|
||||
✅ **Multi-PS5 Support** - Save and switch between multiple PS5 profiles (NEW v2.0)
|
||||
✅ **Download Files** - Download from PS5 to PC (v2.0)
|
||||
✅ **File Search** - Real-time filtering of PS5 files (v2.0)
|
||||
✅ **Favorites/Bookmarks** - Quick navigation to saved paths (v2.0)
|
||||
✅ **Multi-PS5 Support** - Save and switch between multiple PS5 profiles (v2.0)
|
||||
|
||||
---
|
||||
|
||||
## 📊 Performance
|
||||
|
||||
### v1.3.0 Tested Results:
|
||||
- ✅ **42,801 files** uploaded successfully
|
||||
- ✅ **Zero errors** - 100% success rate
|
||||
- ✅ **60-150 MB/s** sustained throughput
|
||||
- ✅ **Peak:** 190 MB/s per connection
|
||||
### v3.1.0 Optimized Results:
|
||||
- ✅ **104+ MB/s** upload speed for large files (parallel chunked uploads)
|
||||
- ✅ **4 parallel chunk connections** for maximum throughput
|
||||
- ✅ **500MB chunks** - optimal size for PS5 disk performance
|
||||
- ✅ **Real-time progress** - Speed/ETA updates during upload
|
||||
- ✅ **Zero chunk failures** - Fixed race conditions
|
||||
- ✅ **Fully responsive UI** throughout upload
|
||||
- ✅ **No memory leaks** - stable operation
|
||||
|
||||
| Network | Expected Speed |
|
||||
|---------|----------------|
|
||||
| **Gigabit Ethernet** | 100-120 MB/s |
|
||||
| **WiFi 6 (5GHz)** | 60-80 MB/s |
|
||||
| **WiFi 5 (5GHz)** | 40-60 MB/s |
|
||||
### Previous Results (v1.3.0):
|
||||
- ✅ **42,801 files** uploaded successfully
|
||||
- ✅ **60-150 MB/s** sustained throughput
|
||||
|
||||
**Note:** Speeds depend on network quality and PS5 disk performance.
|
||||
| Network | Expected Upload Speed | Expected Download Speed |
|
||||
|---------|----------------------|------------------------|
|
||||
| **Gigabit Ethernet** | 88-110 MB/s (aggregate) | 100-120 MB/s |
|
||||
| **WiFi 6 (5GHz)** | 32-70 MB/s (aggregate) | 60-80 MB/s |
|
||||
| **WiFi 5 (5GHz)** | 20-50 MB/s (aggregate) | 40-60 MB/s |
|
||||
|
||||
---
|
||||
**Note:** Upload speeds depend on network quality and PS5 disk write performance. WiFi has ~40-60% overhead compared to Ethernet.
|
||||
|
||||
## 🔧 Building from Source
|
||||
|
||||
### PS5 Payload
|
||||
|
||||
Requirements:
|
||||
- PS5 SDK (prospero-clang)
|
||||
- WSL or Linux
|
||||
|
||||
```bash
|
||||
cd payload
|
||||
bash compile.sh
|
||||
```
|
||||
|
||||
### Windows Client
|
||||
|
||||
Requirements:
|
||||
- .NET 6.0 SDK or later
|
||||
- Windows 10/11
|
||||
|
||||
```cmd
|
||||
cd client
|
||||
build.bat
|
||||
```
|
||||
|
||||
Or manually:
|
||||
```cmd
|
||||
dotnet publish -c Release -r win-x64 --self-contained true
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📋 Protocol Specification
|
||||
|
||||
See [PROTOCOL.md](PROTOCOL.md) for detailed protocol documentation.
|
||||
|
||||
### Commands
|
||||
- `PING` - Test connection
|
||||
- `LIST_STORAGE` - Get storage info
|
||||
- `LIST_DIR` - List directory contents
|
||||
- `CREATE_DIR` - Create directory
|
||||
- `DELETE_FILE` - Delete file
|
||||
- `DELETE_DIR` - Delete directory
|
||||
- `START_UPLOAD` - Begin file upload
|
||||
- `UPLOAD_CHUNK` - Upload file chunk
|
||||
- `END_UPLOAD` - Finish upload
|
||||
- `DOWNLOAD_FILE` - Download file from PS5 (NEW v2.0)
|
||||
- `SHUTDOWN` - Shutdown server
|
||||
|
||||
---
|
||||
|
||||
@@ -191,6 +150,117 @@ See [PROTOCOL.md](PROTOCOL.md) for detailed protocol documentation.
|
||||
|
||||
---
|
||||
|
||||
## 📝 What's New in v3.2.0
|
||||
|
||||
### 🎯 Improvements:
|
||||
|
||||
#### 1. 💾 Accurate Storage Display
|
||||
- **Storage now matches PS5 UI** - Shows ~848 GB instead of raw 872 GB
|
||||
- **Accounts for reserved space** - Same calculation as PS5 system
|
||||
|
||||
#### 2. 📱 Mobile App Improvements
|
||||
- **Multi-select mode** - Toggle button to select multiple files/folders
|
||||
- **Folder browser** - Visual folder picker for Copy/Move destinations
|
||||
- **Sorted file list** - Folders always displayed at top
|
||||
- **Exit confirmation** - Prompt when pressing back button
|
||||
- **Delete folders** - Now supports folder deletion (not just files)
|
||||
- **Batch operations** - Delete/download multiple items at once
|
||||
|
||||
#### 3. 🐛 Bug Fixes
|
||||
- **Fixed empty folder deletion** - No more "Unexpected response" error
|
||||
- **Fixed Copy/Move crash** - No longer crashes when selecting destination
|
||||
- **Fixed multi-select count** - Correct item count in delete confirmation
|
||||
- **Fixed folder navigation** - Can enter folders after actions complete
|
||||
|
||||
---
|
||||
|
||||
## 📝 What's New in v3.1.0
|
||||
|
||||
### 🚀 Performance Improvements:
|
||||
|
||||
#### 1. ⚡ Parallel Chunked Uploads (104 MB/s!)
|
||||
- **Large files (>100MB)** are now split into 500MB chunks
|
||||
- **4 parallel connections** upload chunks simultaneously
|
||||
- **Result:** ~104 MB/s upload speed (2x faster than before!)
|
||||
- **Fixed race condition:** First chunk creates file before others start
|
||||
- **Fixed closure bug:** Correct offset/size capture for parallel tasks
|
||||
|
||||
#### 2. 📊 Real-time Progress Display
|
||||
- **Speed display** now updates in real-time during chunked uploads
|
||||
- **ETA display** shows accurate time remaining
|
||||
- **Progress bar** correctly shows 0-100% for chunked files
|
||||
- No more speed dropping to 0 during large file uploads
|
||||
|
||||
#### 3. 💾 Storage Display Improvements
|
||||
- **Changed label** to "Data Storage (/data)" for clarity
|
||||
- **Uses statfs with f_bavail** for more accurate available space
|
||||
- **Real-time updates** every 5 seconds when connected
|
||||
|
||||
---
|
||||
|
||||
## 📝 What's New in v3.0.0
|
||||
|
||||
### 🐛 Critical Bug Fixes:
|
||||
|
||||
#### 1. 🔧 Path Normalization Fix
|
||||
- **Fixed:** Double-slash paths (`//mnt/ext1/...`) that caused directory creation to fail
|
||||
- **Affected:** All file operations (upload, download, delete, rename, copy, move)
|
||||
- **Solution:** Added `NormalizePath()` function in both client and server
|
||||
- **Result:** 100% reliable directory creation and file uploads
|
||||
|
||||
#### 2. 📱 Android Mobile Client
|
||||
- **NEW:** Full-featured Android app for PS5 file management
|
||||
- **Multi-PS5 Profiles** - Save and switch between multiple PS5 consoles
|
||||
- Upload files from phone to PS5
|
||||
- Download files from PS5 with Share option
|
||||
- Browse PS5 filesystem
|
||||
- Favorites for quick navigation
|
||||
- Debug Log with Copy to clipboard
|
||||
- Transfer History tracking
|
||||
|
||||
#### 3. 🛠️ Server Improvements
|
||||
- Path normalization in all handler functions
|
||||
- More robust error handling
|
||||
- Improved stability for parallel uploads
|
||||
|
||||
---
|
||||
|
||||
## 📝 What's New in v2.1.0
|
||||
|
||||
### 🚀 Performance Optimizations:
|
||||
|
||||
#### 1. ⚡ Massive Upload Speed Boost (88-110 MB/s)
|
||||
- **Server-side:** Replaced `fwrite()` with direct `write()` syscalls
|
||||
- **Client-side:** 8 parallel large file uploads (optimal for PS5 disk)
|
||||
- **Result:** 80-110 MB/s aggregate upload speed on Gigabit Ethernet
|
||||
- **Peak bursts:** Up to 2.05 GB/s when hitting disk cache
|
||||
- **Per-file:** 11-14 MB/s sustained per connection
|
||||
|
||||
#### 2. 📊 Transfer History
|
||||
- Complete history of all uploads and downloads
|
||||
- Success/Failed status tracking with error messages
|
||||
- Speed statistics (average, min, max)
|
||||
- Export to CSV/JSON for analysis
|
||||
- Persistent storage across sessions
|
||||
|
||||
#### 3. 🔄 Auto-Clear History on Startup
|
||||
- Optional checkbox to clear history automatically
|
||||
- Useful for keeping UI clean between sessions
|
||||
- Setting saved in `ps5_upload_settings.json`
|
||||
|
||||
#### 4. 🖥️ Maximized Window UI
|
||||
- Application opens in full-screen mode by default
|
||||
- Better visibility for large file transfers
|
||||
- Can be resized/restored as needed
|
||||
|
||||
### Technical Improvements:
|
||||
- ✅ **16MB socket buffers** (up from 4MB) for maximum throughput
|
||||
- ✅ **Per-file mutex locking** - Parallel writes without race conditions
|
||||
- ✅ **File pre-allocation** - Reduces disk fragmentation for large files
|
||||
- ✅ **Direct syscalls** - Bypasses stdio buffering overhead
|
||||
|
||||
---
|
||||
|
||||
## 📝 What's New in v2.0.0
|
||||
|
||||
### 🎉 4 Major New Features:
|
||||
@@ -229,7 +299,7 @@ See [PROTOCOL.md](PROTOCOL.md) for detailed protocol documentation.
|
||||
|
||||
## 📝 License
|
||||
|
||||
MIT License - Free to use and modify
|
||||
This software is provided as-is for personal use.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,166 +0,0 @@
|
||||
# 🎉 PS5 Upload Suite v2.0.0 - Feature-Rich Release
|
||||
|
||||
## 🚀 What's New
|
||||
|
||||
This is a **major feature release** adding 4 powerful new capabilities to the PS5 Upload Suite!
|
||||
|
||||
---
|
||||
|
||||
## ✨ New Features
|
||||
|
||||
### 1. 📥 Download Files (PS5 → PC)
|
||||
|
||||
Finally! You can now download files from your PS5 back to your PC.
|
||||
|
||||
**How to use:**
|
||||
- Right-click any file in PS5 Files panel
|
||||
- Select "⬇️ Download to PC"
|
||||
- Choose where to save the file
|
||||
- Watch the progress with real-time speed tracking
|
||||
|
||||
**Technical Details:**
|
||||
- Uses sendfile optimization for maximum speed
|
||||
- Zero-copy transfer on PS5 side
|
||||
- Same high-speed protocol as uploads
|
||||
- Full progress tracking
|
||||
|
||||
---
|
||||
|
||||
### 2. 🔍 File Search
|
||||
|
||||
Quickly find files in large directories without scrolling.
|
||||
|
||||
**How to use:**
|
||||
- Type in the Search box below Current Path
|
||||
- Files are filtered in real-time as you type
|
||||
- Case-insensitive search
|
||||
- Click "✖ Clear" to reset
|
||||
|
||||
**Perfect for:**
|
||||
- Finding specific game saves
|
||||
- Locating config files
|
||||
- Searching through large mod folders
|
||||
|
||||
---
|
||||
|
||||
### 3. ⭐ Favorites/Bookmarks
|
||||
|
||||
Save your frequently used PS5 paths for instant navigation.
|
||||
|
||||
**How to use:**
|
||||
- Navigate to any path (e.g., `/data/games`)
|
||||
- Click "⭐ Add" to save it
|
||||
- Use the Favorites dropdown to quickly jump to saved paths
|
||||
- Click "🗑️ Remove" to delete a favorite
|
||||
|
||||
**Saved paths persist between sessions!**
|
||||
|
||||
---
|
||||
|
||||
### 4. 🎮 Multi-PS5 Support
|
||||
|
||||
Manage multiple PS5 consoles with ease.
|
||||
|
||||
**How to use:**
|
||||
- Enter a PS5 IP address
|
||||
- Click "💾 Save Profile" and give it a name (e.g., "Living Room PS5")
|
||||
- Use the Profile dropdown to quickly switch between PS5s
|
||||
- Click "🗑️ Delete Profile" to remove saved profiles
|
||||
|
||||
**Perfect for:**
|
||||
- Users with multiple PS5 consoles
|
||||
- Testing on different systems
|
||||
- Switching between home and friend's PS5
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Technical Improvements
|
||||
|
||||
### Server-Side (payload)
|
||||
- Added `CMD_DOWNLOAD_FILE` (0x13) command
|
||||
- Implemented sendfile-based download handler
|
||||
- Fixed `LIST_DIR` to return actual file sizes (not 0)
|
||||
- Zero-copy file transfer for downloads
|
||||
|
||||
### Client-Side
|
||||
- Added `DownloadFileAsync()` method to Protocol
|
||||
- Implemented search filtering with `ObservableCollection`
|
||||
- Added JSON-based profile and favorites persistence
|
||||
- Custom ComboBox templates for dark theme consistency
|
||||
- Improved UI responsiveness
|
||||
|
||||
---
|
||||
|
||||
## 📊 Statistics
|
||||
|
||||
**Lines of Code Added:** ~500+ lines
|
||||
**New Protocol Commands:** 1 (DOWNLOAD_FILE)
|
||||
**New UI Elements:** 3 panels (Search, Favorites, Profiles)
|
||||
**Persistent Storage Files:** 2 (ps5_profiles.json, ps5_favorites.json)
|
||||
|
||||
---
|
||||
|
||||
## 🎨 UI Improvements
|
||||
|
||||
- All ComboBox dropdowns now have proper dark theme
|
||||
- All buttons show full text without cutoff
|
||||
- Consistent styling across all new features
|
||||
- Responsive layout that adapts to content
|
||||
|
||||
---
|
||||
|
||||
## 📦 Files Included
|
||||
|
||||
### Server
|
||||
- `payload/ps5_upload_server.elf` - Updated with download support
|
||||
|
||||
### Client
|
||||
- `client/bin/Release/net6.0-windows/win-x64/PS5Upload.exe` - Full v2.0 client
|
||||
|
||||
---
|
||||
|
||||
## ⬆️ Upgrading from v1.3.0
|
||||
|
||||
1. **Replace server payload:**
|
||||
- Copy new `ps5_upload_server.elf` to `/data/etaHEN/payloads/`
|
||||
- Reload with elfldr
|
||||
|
||||
2. **Replace client:**
|
||||
- Close old PS5Upload.exe
|
||||
- Replace with new version
|
||||
- Your settings will be preserved
|
||||
|
||||
**Note:** v2.0 creates two new files:
|
||||
- `ps5_profiles.json` - Saved PS5 profiles
|
||||
- `ps5_favorites.json` - Saved favorite paths
|
||||
|
||||
---
|
||||
|
||||
## 🐛 Known Issues
|
||||
|
||||
None reported yet! This is a stable release built on top of the rock-solid v1.3.0 foundation.
|
||||
|
||||
---
|
||||
|
||||
## 🔮 Future Features (Not in v2.0)
|
||||
|
||||
Still on the roadmap:
|
||||
- Disk Space Warning before upload
|
||||
- Duplicate File Detection
|
||||
- File Verification (SHA256)
|
||||
- Resume Interrupted Uploads
|
||||
- Queue Management (reorder, pause)
|
||||
- Transfer History
|
||||
- Scheduled Uploads
|
||||
|
||||
---
|
||||
|
||||
## 🙏 Thanks
|
||||
|
||||
Special thanks to the PS5 homebrew community for testing and feedback!
|
||||
|
||||
---
|
||||
|
||||
**Enjoy the new features!** 🚀
|
||||
|
||||
**- Manos**
|
||||
@@ -1,8 +0,0 @@
|
||||
<Application x:Class="PS5Upload.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -1,61 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace PS5Upload
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
private static readonly string LogFilePath = Path.Combine(
|
||||
AppDomain.CurrentDomain.BaseDirectory,
|
||||
$"ps5upload_{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.log");
|
||||
|
||||
private static readonly object _logLock = new object();
|
||||
|
||||
public App()
|
||||
{
|
||||
// Global exception handlers
|
||||
this.DispatcherUnhandledException += App_DispatcherUnhandledException;
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
||||
|
||||
LogToFile("=== Application Started ===");
|
||||
}
|
||||
|
||||
private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||
{
|
||||
LogToFile($"DISPATCHER EXCEPTION: {e.Exception}");
|
||||
e.Handled = true; // Prevent crash, but log it
|
||||
|
||||
MessageBox.Show($"Error: {e.Exception.Message}\n\nCheck log file: {LogFilePath}",
|
||||
"PS5 Upload Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
|
||||
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
var ex = e.ExceptionObject as Exception;
|
||||
LogToFile($"UNHANDLED EXCEPTION: {ex}");
|
||||
}
|
||||
|
||||
private void TaskScheduler_UnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
|
||||
{
|
||||
LogToFile($"TASK EXCEPTION: {e.Exception}");
|
||||
e.SetObserved(); // Prevent crash
|
||||
}
|
||||
|
||||
public static void LogToFile(string message)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (_logLock)
|
||||
{
|
||||
string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
File.AppendAllText(LogFilePath, $"[{timestamp}] {message}\n");
|
||||
}
|
||||
}
|
||||
catch { /* Ignore logging errors */ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
<Window x:Class="PS5Upload.DuplicateFileDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="File Already Exists"
|
||||
Height="320"
|
||||
Width="550"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
ResizeMode="NoResize"
|
||||
Background="#1E1E1E">
|
||||
|
||||
<Window.Resources>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Background" Value="#2D2D30"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="BorderBrush" Value="#3F3F46"/>
|
||||
<Setter Property="Padding" Value="15,8"/>
|
||||
<Setter Property="Margin" Value="5"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#3E3E42"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Margin="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Icon and Message -->
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,15">
|
||||
<TextBlock Text="⚠️" FontSize="32" Margin="0,0,15,0"/>
|
||||
<TextBlock x:Name="MessageTextBlock"
|
||||
Text="This file already exists on PS5:"
|
||||
Foreground="White"
|
||||
FontSize="14"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- File Name -->
|
||||
<TextBlock Grid.Row="1"
|
||||
x:Name="FileNameTextBlock"
|
||||
Foreground="#4EC9B0"
|
||||
FontSize="13"
|
||||
FontWeight="Bold"
|
||||
Margin="0,0,0,10"
|
||||
TextWrapping="Wrap"/>
|
||||
|
||||
<!-- File Info -->
|
||||
<StackPanel Grid.Row="2" Margin="0,0,0,20">
|
||||
<TextBlock x:Name="LocalSizeTextBlock"
|
||||
Foreground="#9CDCFE"
|
||||
FontSize="12"
|
||||
Margin="0,0,0,5"/>
|
||||
<TextBlock x:Name="RemoteSizeTextBlock"
|
||||
Foreground="#9CDCFE"
|
||||
FontSize="12"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Row="4" Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,10">
|
||||
<Button Content="Replace" Width="120" Click="Replace_Click"/>
|
||||
<Button Content="Skip" Width="120" Click="Skip_Click"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Button Content="Replace All" Width="120" Click="ReplaceAll_Click"/>
|
||||
<Button Content="Skip All" Width="120" Click="SkipAll_Click"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,67 +0,0 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace PS5Upload
|
||||
{
|
||||
public partial class DuplicateFileDialog : Window
|
||||
{
|
||||
public enum FileAction
|
||||
{
|
||||
Replace,
|
||||
Skip,
|
||||
ReplaceAll,
|
||||
SkipAll
|
||||
}
|
||||
|
||||
public FileAction UserAction { get; private set; }
|
||||
|
||||
public DuplicateFileDialog(string fileName, long localSize, long remoteSize)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
FileNameTextBlock.Text = fileName;
|
||||
LocalSizeTextBlock.Text = $"Local file: {FormatFileSize(localSize)}";
|
||||
RemoteSizeTextBlock.Text = $"Remote file: {FormatFileSize(remoteSize)}";
|
||||
}
|
||||
|
||||
private void Replace_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UserAction = FileAction.Replace;
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void Skip_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UserAction = FileAction.Skip;
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void ReplaceAll_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UserAction = FileAction.ReplaceAll;
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void SkipAll_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UserAction = FileAction.SkipAll;
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private string FormatFileSize(long bytes)
|
||||
{
|
||||
string[] sizes = { "B", "KB", "MB", "GB", "TB" };
|
||||
double len = bytes;
|
||||
int order = 0;
|
||||
while (len >= 1024 && order < sizes.Length - 1)
|
||||
{
|
||||
order++;
|
||||
len = len / 1024;
|
||||
}
|
||||
return $"{len:0.##} {sizes[order]}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,753 +0,0 @@
|
||||
<Window x:Class="PS5Upload.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="PS5 Upload - High-Speed File Transfer" Height="600" Width="1200"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Background="#1E1E1E"
|
||||
Icon="ps5_logo.png">
|
||||
|
||||
<Window.Resources>
|
||||
<!-- Override system colors for ComboBox dropdown -->
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="#2D2D30"/>
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.WindowColorKey}" Color="#2D2D30"/>
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#2D2D30"/>
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.ControlColorKey}" Color="#2D2D30"/>
|
||||
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Background" Value="#007ACC"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Padding" Value="15,8"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
CornerRadius="4"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#1C97EA"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Background" Value="#3E3E42"/>
|
||||
<Setter Property="Foreground" Value="#666666"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="TextBox">
|
||||
<Setter Property="Background" Value="#2D2D30"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="BorderBrush" Value="#3E3E42"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Padding" Value="8"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="ListBox">
|
||||
<Setter Property="Background" Value="#2D2D30"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="BorderBrush" Value="#3E3E42"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Margin="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Header -->
|
||||
<StackPanel Grid.Row="0" Margin="0,0,0,20" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Image Source="ps5_logo.png"
|
||||
Width="80"
|
||||
Height="80"
|
||||
Margin="0,0,15,0"
|
||||
VerticalAlignment="Center"/>
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<TextBlock Text="PS5 Upload - High-Speed File Transfer"
|
||||
FontSize="24"
|
||||
FontWeight="Bold"
|
||||
Foreground="#007ACC"/>
|
||||
<TextBlock Text="By Manos"
|
||||
FontSize="12"
|
||||
Foreground="#999999"
|
||||
Margin="0,5,0,0"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Connection Panel -->
|
||||
<Border Grid.Row="1"
|
||||
Background="#252526"
|
||||
BorderBrush="#3E3E42"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4"
|
||||
Padding="15"
|
||||
Margin="0,0,0,15">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- PS5 Profile Selection -->
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<TextBlock Text="PS5 Profile:"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,10,0"/>
|
||||
<ComboBox x:Name="PS5ProfileComboBox"
|
||||
Width="200"
|
||||
VerticalAlignment="Center"
|
||||
SelectionChanged="PS5ProfileComboBox_SelectionChanged"
|
||||
Background="#2D2D30"
|
||||
Foreground="White"
|
||||
BorderBrush="#3E3E42">
|
||||
<ComboBox.Template>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<Grid>
|
||||
<ToggleButton Name="ToggleButton"
|
||||
Grid.Column="2"
|
||||
Focusable="false"
|
||||
IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ClickMode="Press"
|
||||
Background="#2D2D30"
|
||||
BorderBrush="#3E3E42"
|
||||
BorderThickness="1"/>
|
||||
<ContentPresenter Name="ContentSite"
|
||||
IsHitTestVisible="False"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
|
||||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
|
||||
Margin="5,3,23,3"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"/>
|
||||
<Popup Name="Popup"
|
||||
Placement="Bottom"
|
||||
IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||
AllowsTransparency="True"
|
||||
Focusable="False"
|
||||
PopupAnimation="Slide">
|
||||
<Grid Name="DropDown"
|
||||
SnapsToDevicePixels="True"
|
||||
MinWidth="{TemplateBinding ActualWidth}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
||||
<Border Name="DropDownBorder"
|
||||
Background="#2D2D30"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#3E3E42"/>
|
||||
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
|
||||
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained"/>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</ComboBox.Template>
|
||||
<ComboBox.ItemContainerStyle>
|
||||
<Style TargetType="ComboBoxItem">
|
||||
<Setter Property="Background" Value="#2D2D30"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Padding" Value="5"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBoxItem">
|
||||
<Border Name="Border"
|
||||
Background="#2D2D30"
|
||||
Padding="5">
|
||||
<ContentPresenter/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="#007ACC"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="#007ACC"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ComboBox.ItemContainerStyle>
|
||||
</ComboBox>
|
||||
<Button Content="💾 Save Profile"
|
||||
Click="SaveProfileButton_Click"
|
||||
Width="140"
|
||||
Margin="10,0,0,0"
|
||||
Background="#28A745"/>
|
||||
<Button Content="🗑️ Delete Profile"
|
||||
Click="DeleteProfileButton_Click"
|
||||
Width="150"
|
||||
Margin="5,0,0,0"
|
||||
Background="#DC3545"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- IP Address and Connect -->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="PS5 IP Address:"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,10,0"/>
|
||||
|
||||
<TextBox Grid.Column="1"
|
||||
x:Name="IpAddressTextBox"
|
||||
Text="192.168.0.160"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,10,0"/>
|
||||
|
||||
<Button Grid.Column="2"
|
||||
x:Name="ConnectButton"
|
||||
Content="Connect"
|
||||
Click="ConnectButton_Click"
|
||||
Width="100"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Main Content -->
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="15"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="15"/>
|
||||
<ColumnDefinition Width="300"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Local Files -->
|
||||
<Border Grid.Column="0"
|
||||
Background="#252526"
|
||||
BorderBrush="#3E3E42"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0"
|
||||
Background="#2D2D30"
|
||||
Padding="10"
|
||||
BorderBrush="#3E3E42"
|
||||
BorderThickness="0,0,0,1">
|
||||
<TextBlock Text="📁 Local Files"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"/>
|
||||
</Border>
|
||||
|
||||
<ListBox Grid.Row="1"
|
||||
x:Name="LocalFilesListBox"
|
||||
BorderThickness="0"
|
||||
AllowDrop="True"
|
||||
Drop="LocalFilesListBox_Drop"
|
||||
DragEnter="LocalFilesListBox_DragEnter"
|
||||
MouseRightButtonUp="LocalFilesListBox_RightClick">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock Text="{Binding Icon}"
|
||||
FontSize="16"
|
||||
Margin="0,0,10,0"/>
|
||||
<TextBlock Text="{Binding Name}"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<ListBox.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="🗑️ Remove" Click="RemoveLocalFile_Click"/>
|
||||
</ContextMenu>
|
||||
</ListBox.ContextMenu>
|
||||
</ListBox>
|
||||
|
||||
<StackPanel Grid.Row="2"
|
||||
Orientation="Horizontal"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Center">
|
||||
<Button Content="Browse Files"
|
||||
Click="BrowseFilesButton_Click"
|
||||
Margin="0,0,5,0"/>
|
||||
<Button Content="Browse Folder"
|
||||
Click="BrowseFolderButton_Click"
|
||||
Margin="0,0,5,0"/>
|
||||
<Button Content="Clear All"
|
||||
Click="ClearLocalFiles_Click"
|
||||
Background="#DC3545"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- PS5 Files -->
|
||||
<Border Grid.Column="2"
|
||||
Background="#252526"
|
||||
BorderBrush="#3E3E42"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0"
|
||||
Background="#2D2D30"
|
||||
Padding="10"
|
||||
BorderBrush="#3E3E42"
|
||||
BorderThickness="0,0,0,1">
|
||||
<TextBlock Text="🎮 PS5 Files"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"/>
|
||||
</Border>
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Margin="10"
|
||||
Background="#2D2D30">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
|
||||
<TextBlock Text="Current Path:"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,10,0"/>
|
||||
<TextBox x:Name="CurrentPathTextBox"
|
||||
Text="/data"
|
||||
Width="200"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,10,0"/>
|
||||
<Button Content="Go"
|
||||
Click="GoButton_Click"
|
||||
Width="60"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
|
||||
<TextBlock Text="⭐ Favorites:"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,10,0"/>
|
||||
<ComboBox x:Name="FavoritesComboBox"
|
||||
Width="200"
|
||||
VerticalAlignment="Center"
|
||||
SelectionChanged="FavoritesComboBox_SelectionChanged"
|
||||
Background="#2D2D30"
|
||||
Foreground="White"
|
||||
BorderBrush="#3E3E42">
|
||||
<ComboBox.Template>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<Grid>
|
||||
<ToggleButton Name="ToggleButton"
|
||||
Grid.Column="2"
|
||||
Focusable="false"
|
||||
IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ClickMode="Press"
|
||||
Background="#2D2D30"
|
||||
BorderBrush="#3E3E42"
|
||||
BorderThickness="1"/>
|
||||
<ContentPresenter Name="ContentSite"
|
||||
IsHitTestVisible="False"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
|
||||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
|
||||
Margin="5,3,23,3"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"/>
|
||||
<Popup Name="Popup"
|
||||
Placement="Bottom"
|
||||
IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||
AllowsTransparency="True"
|
||||
Focusable="False"
|
||||
PopupAnimation="Slide">
|
||||
<Grid Name="DropDown"
|
||||
SnapsToDevicePixels="True"
|
||||
MinWidth="{TemplateBinding ActualWidth}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
||||
<Border Name="DropDownBorder"
|
||||
Background="#2D2D30"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#3E3E42"/>
|
||||
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
|
||||
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained"/>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</ComboBox.Template>
|
||||
<ComboBox.ItemContainerStyle>
|
||||
<Style TargetType="ComboBoxItem">
|
||||
<Setter Property="Background" Value="#2D2D30"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Padding" Value="5"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBoxItem">
|
||||
<Border Name="Border"
|
||||
Background="#2D2D30"
|
||||
Padding="5">
|
||||
<ContentPresenter/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="#007ACC"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="#007ACC"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ComboBox.ItemContainerStyle>
|
||||
</ComboBox>
|
||||
<Button Content="⭐ Add"
|
||||
Click="AddFavoriteButton_Click"
|
||||
Width="90"
|
||||
Margin="10,0,0,0"
|
||||
Background="#28A745"/>
|
||||
<Button Content="🗑️ Remove"
|
||||
Click="RemoveFavoriteButton_Click"
|
||||
Width="110"
|
||||
Margin="5,0,0,0"
|
||||
Background="#DC3545"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="🔍 Search:"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,10,0"/>
|
||||
<TextBox x:Name="SearchTextBox"
|
||||
Width="250"
|
||||
VerticalAlignment="Center"
|
||||
TextChanged="SearchTextBox_TextChanged"
|
||||
Background="#1E1E1E"
|
||||
Foreground="White"
|
||||
BorderBrush="#3E3E42"/>
|
||||
<Button Content="✖ Clear"
|
||||
Click="ClearSearchButton_Click"
|
||||
Width="100"
|
||||
Margin="5,0,0,0"
|
||||
Background="#3E3E42"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<ListBox Grid.Row="2"
|
||||
x:Name="PS5FilesListBox"
|
||||
BorderThickness="0"
|
||||
SelectionMode="Extended"
|
||||
MouseDoubleClick="PS5FilesListBox_MouseDoubleClick">
|
||||
<ListBox.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="⬇️ Download to PC" Click="DownloadMenuItem_Click"/>
|
||||
<Separator/>
|
||||
<MenuItem Header="📝 Rename" Click="RenameMenuItem_Click"/>
|
||||
<MenuItem Header="📋 Copy" Click="CopyMenuItem_Click"/>
|
||||
<MenuItem Header="✂️ Move" Click="MoveMenuItem_Click"/>
|
||||
<Separator/>
|
||||
<MenuItem Header="🗑️ Delete" Click="DeleteMenuItem_Click"/>
|
||||
<MenuItem Header="🗑️ Delete Selected" Click="DeleteSelectedMenuItem_Click"/>
|
||||
</ContextMenu>
|
||||
</ListBox.ContextMenu>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock Text="{Binding Icon}"
|
||||
FontSize="16"
|
||||
Margin="0,0,10,0"/>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Name}"
|
||||
FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{Binding SizeText}"
|
||||
FontSize="11"
|
||||
Foreground="#999999"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<Border Grid.Row="3"
|
||||
Background="#2D2D30"
|
||||
BorderBrush="#3E3E42"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4"
|
||||
Margin="10"
|
||||
Padding="10">
|
||||
<StackPanel>
|
||||
<TextBlock Text="💾 PS5 Storage"
|
||||
FontSize="12"
|
||||
FontWeight="Bold"
|
||||
Foreground="#007ACC"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,0,0,8"/>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||
Text="Free:"
|
||||
FontSize="11"
|
||||
Foreground="#999999"
|
||||
Margin="0,0,8,4"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1"
|
||||
x:Name="StorageFreeText"
|
||||
Text="--"
|
||||
FontSize="11"
|
||||
Foreground="#4EC9B0"
|
||||
FontWeight="Bold"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,0,4"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0"
|
||||
Text="Used:"
|
||||
FontSize="11"
|
||||
Foreground="#999999"
|
||||
Margin="0,0,8,4"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1"
|
||||
x:Name="StorageUsedText"
|
||||
Text="--"
|
||||
FontSize="11"
|
||||
Foreground="#CE9178"
|
||||
FontWeight="Bold"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,0,4"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0"
|
||||
Text="Total:"
|
||||
FontSize="11"
|
||||
Foreground="#999999"
|
||||
Margin="0,0,8,4"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1"
|
||||
x:Name="StorageTotalText"
|
||||
Text="--"
|
||||
FontSize="11"
|
||||
Foreground="White"
|
||||
FontWeight="Bold"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,0,4"/>
|
||||
|
||||
<!-- Progress Bar -->
|
||||
<ProgressBar Grid.Row="3" Grid.ColumnSpan="2"
|
||||
x:Name="StorageProgressBar"
|
||||
Height="6"
|
||||
Margin="0,6,0,0"
|
||||
Minimum="0"
|
||||
Maximum="100"
|
||||
Value="0"
|
||||
Foreground="#CE9178"
|
||||
Background="#3E3E42"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Log Panel -->
|
||||
<Border Grid.Column="4"
|
||||
Background="#252526"
|
||||
BorderBrush="#3E3E42"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0"
|
||||
Background="#2D2D30"
|
||||
Padding="10"
|
||||
BorderBrush="#3E3E42"
|
||||
BorderThickness="0,0,0,1">
|
||||
<TextBlock Text="📋 Debug Log"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"/>
|
||||
</Border>
|
||||
|
||||
<TextBox Grid.Row="1"
|
||||
x:Name="LogTextBox"
|
||||
Text=""
|
||||
FontFamily="Consolas"
|
||||
FontSize="11"
|
||||
Foreground="#CCCCCC"
|
||||
Background="#1E1E1E"
|
||||
BorderThickness="0"
|
||||
Padding="10"
|
||||
TextWrapping="Wrap"
|
||||
IsReadOnly="True"
|
||||
IsReadOnlyCaretVisible="False"
|
||||
Focusable="False"
|
||||
Cursor="Arrow"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Auto"/>
|
||||
|
||||
<StackPanel Grid.Row="2"
|
||||
Orientation="Horizontal"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Center">
|
||||
<Button Content="📋 Copy Log"
|
||||
Click="CopyLogButton_Click"
|
||||
Margin="0,0,10,0"
|
||||
Background="#28A745"/>
|
||||
<Button Content="Clear Log"
|
||||
Click="ClearLogButton_Click"
|
||||
Background="#3E3E42"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- Upload Progress -->
|
||||
<Border Grid.Row="3"
|
||||
Background="#252526"
|
||||
BorderBrush="#3E3E42"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4"
|
||||
Padding="15"
|
||||
Margin="0,15,0,0"
|
||||
x:Name="ProgressPanel"
|
||||
Visibility="Collapsed">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Files Remaining Counter -->
|
||||
<TextBlock Grid.Row="0"
|
||||
x:Name="FilesRemainingText"
|
||||
Text="Files: 0 / 0 (0 remaining)"
|
||||
FontSize="13"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="#FFC107"
|
||||
Margin="0,0,0,8"/>
|
||||
|
||||
<!-- Total Folder Progress -->
|
||||
<TextBlock Grid.Row="1"
|
||||
x:Name="TotalProgressText"
|
||||
Text="Total: 0 / 0 files"
|
||||
FontSize="14"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="#28A745"
|
||||
Margin="0,0,0,5"/>
|
||||
|
||||
<ProgressBar Grid.Row="2"
|
||||
x:Name="TotalProgressBar"
|
||||
Height="20"
|
||||
Minimum="0"
|
||||
Maximum="100"
|
||||
Value="0"
|
||||
Foreground="#17A2B8"
|
||||
Background="#2D2D30"
|
||||
BorderBrush="#3E3E42"
|
||||
Margin="0,0,0,10"/>
|
||||
|
||||
<!-- Current File -->
|
||||
<TextBlock Grid.Row="3"
|
||||
x:Name="UploadFileNameText"
|
||||
Text="Uploading: filename.bin"
|
||||
FontSize="13"
|
||||
Margin="0,0,0,5"/>
|
||||
|
||||
<ProgressBar Grid.Row="4"
|
||||
x:Name="UploadProgressBar"
|
||||
Height="20"
|
||||
Minimum="0"
|
||||
Maximum="100"
|
||||
Value="0"
|
||||
Foreground="#28A745"
|
||||
Background="#2D2D30"
|
||||
BorderBrush="#3E3E42"/>
|
||||
|
||||
<!-- Speed and Progress -->
|
||||
<Grid Grid.Row="5" Margin="0,8,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0"
|
||||
x:Name="UploadSpeedText"
|
||||
Text="Speed: 0 MB/s | Avg: 0 MB/s"
|
||||
FontSize="12"
|
||||
Foreground="#999999"/>
|
||||
|
||||
<TextBlock Grid.Column="1"
|
||||
x:Name="UploadProgressText"
|
||||
Text="0 / 0 MB (0%)"
|
||||
FontSize="12"
|
||||
Foreground="#999999"/>
|
||||
</Grid>
|
||||
|
||||
<!-- ETA -->
|
||||
<TextBlock Grid.Row="6"
|
||||
x:Name="UploadETAText"
|
||||
Text="ETA: Calculating..."
|
||||
FontSize="12"
|
||||
Foreground="#999999"
|
||||
Margin="0,5,0,0"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Upload Buttons -->
|
||||
<Grid Grid.Row="4" Margin="0,15,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="150"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Grid.Column="0"
|
||||
x:Name="UploadButton"
|
||||
Content="⬆️ Upload to PS5"
|
||||
Click="UploadButton_Click"
|
||||
Height="45"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"
|
||||
IsEnabled="False"/>
|
||||
|
||||
<Button Grid.Column="2"
|
||||
x:Name="CancelButton"
|
||||
Content="❌ Cancel"
|
||||
Click="CancelButton_Click"
|
||||
Height="45"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"
|
||||
Background="#DC3545"
|
||||
IsEnabled="False"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,29 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<AssemblyName>PS5Upload</AssemblyName>
|
||||
<RootNamespace>PS5Upload</RootNamespace>
|
||||
<Version>1.0.0</Version>
|
||||
<Authors>Manos</Authors>
|
||||
<Description>High-Speed File Upload Tool for PS5</Description>
|
||||
<Copyright>Copyright © 2026 Manos</Copyright>
|
||||
<Nullable>enable</Nullable>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<SelfContained>true</SelfContained>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<PublishReadyToRun>true</PublishReadyToRun>
|
||||
<ApplicationIcon>ps5_logo_fixed.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="ps5_logo.png" />
|
||||
<None Include="ps5_logo.ico">
|
||||
<Link>ps5_logo.ico</Link>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,633 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PS5Upload
|
||||
{
|
||||
// Protocol commands
|
||||
public enum Command : byte
|
||||
{
|
||||
Ping = 0x01,
|
||||
ListStorage = 0x02,
|
||||
ListDir = 0x03,
|
||||
CreateDir = 0x04,
|
||||
DeleteFile = 0x05,
|
||||
DeleteDir = 0x06,
|
||||
Rename = 0x07,
|
||||
CopyFile = 0x08,
|
||||
MoveFile = 0x09,
|
||||
StartUpload = 0x10,
|
||||
UploadChunk = 0x11,
|
||||
EndUpload = 0x12,
|
||||
DownloadFile = 0x13,
|
||||
Shutdown = 0xFF
|
||||
}
|
||||
|
||||
// Protocol responses
|
||||
public enum Response : byte
|
||||
{
|
||||
Ok = 0x01,
|
||||
Error = 0x02,
|
||||
Data = 0x03,
|
||||
Ready = 0x04,
|
||||
Progress = 0x05
|
||||
}
|
||||
|
||||
public class PS5Protocol : IDisposable
|
||||
{
|
||||
private TcpClient? _client;
|
||||
private NetworkStream? _stream;
|
||||
private const int BufferSize = 4 * 1024 * 1024; // 4MB chunks - MUST match payload BUFFER_SIZE
|
||||
|
||||
public bool IsConnected => _client?.Connected ?? false;
|
||||
|
||||
public async Task<bool> ConnectAsync(string ipAddress, int port = 9113)
|
||||
{
|
||||
try
|
||||
{
|
||||
_client = new TcpClient();
|
||||
_client.ReceiveBufferSize = 64 * 1024 * 1024; // 64MB for maximum TCP throughput
|
||||
_client.SendBufferSize = 64 * 1024 * 1024; // 64MB for maximum TCP throughput
|
||||
_client.NoDelay = true;
|
||||
_client.LingerState = new System.Net.Sockets.LingerOption(false, 0);
|
||||
|
||||
// BUG FIX #1: Add 5 second timeout for connection to fail fast on wrong IP
|
||||
var connectTask = _client.ConnectAsync(ipAddress, port);
|
||||
var timeoutTask = Task.Delay(5000); // 5 second timeout
|
||||
|
||||
var completedTask = await Task.WhenAny(connectTask, timeoutTask);
|
||||
|
||||
if (completedTask == timeoutTask)
|
||||
{
|
||||
// Timeout occurred
|
||||
_client?.Close();
|
||||
_client?.Dispose();
|
||||
_client = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if connection actually succeeded
|
||||
if (!_client.Connected)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
_stream = _client.GetStream();
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
_client?.Close();
|
||||
_client?.Dispose();
|
||||
_client = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Disconnect()
|
||||
{
|
||||
_stream?.Dispose();
|
||||
_client?.Dispose();
|
||||
_stream = null;
|
||||
_client = null;
|
||||
}
|
||||
|
||||
private async Task SendCommandAsync(Command cmd, byte[]? data = null)
|
||||
{
|
||||
if (_stream == null) throw new InvalidOperationException("Not connected");
|
||||
|
||||
byte[] header = new byte[5];
|
||||
header[0] = (byte)cmd;
|
||||
|
||||
uint dataLen = data != null ? (uint)data.Length : 0;
|
||||
BitConverter.GetBytes(dataLen).CopyTo(header, 1);
|
||||
|
||||
await _stream.WriteAsync(header, 0, 5);
|
||||
if (data != null && data.Length > 0)
|
||||
{
|
||||
await _stream.WriteAsync(data, 0, data.Length);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<(Response response, byte[] data)> ReceiveResponseAsync()
|
||||
{
|
||||
if (_stream == null) throw new InvalidOperationException("Not connected");
|
||||
|
||||
byte[] header = new byte[5];
|
||||
await ReadExactAsync(header, 5);
|
||||
|
||||
Response response = (Response)header[0];
|
||||
uint dataLen = BitConverter.ToUInt32(header, 1);
|
||||
|
||||
byte[] data = new byte[dataLen];
|
||||
if (dataLen > 0)
|
||||
{
|
||||
await ReadExactAsync(data, (int)dataLen);
|
||||
}
|
||||
|
||||
return (response, data);
|
||||
}
|
||||
|
||||
private async Task ReadExactAsync(byte[] buffer, int count, int timeoutMs = 120000)
|
||||
{
|
||||
if (_stream == null) throw new InvalidOperationException("Not connected");
|
||||
|
||||
int offset = 0;
|
||||
using var cts = new CancellationTokenSource(timeoutMs);
|
||||
|
||||
try
|
||||
{
|
||||
while (offset < count)
|
||||
{
|
||||
int read = await _stream.ReadAsync(buffer, offset, count - offset, cts.Token);
|
||||
if (read == 0)
|
||||
{
|
||||
// Give PS5 a moment to recover before declaring connection dead
|
||||
await Task.Delay(100);
|
||||
read = await _stream.ReadAsync(buffer, offset, count - offset, cts.Token);
|
||||
if (read == 0) throw new IOException("Connection closed");
|
||||
}
|
||||
offset += read;
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
throw new TimeoutException("Read timeout");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> PingAsync()
|
||||
{
|
||||
await SendCommandAsync(Command.Ping);
|
||||
var (response, _) = await ReceiveResponseAsync();
|
||||
return response == Response.Ok;
|
||||
}
|
||||
|
||||
public async Task<StorageInfo[]> ListStorageAsync()
|
||||
{
|
||||
await SendCommandAsync(Command.ListStorage);
|
||||
var (response, data) = await ReceiveResponseAsync();
|
||||
|
||||
if (response != Response.Data) return Array.Empty<StorageInfo>();
|
||||
|
||||
using var ms = new MemoryStream(data);
|
||||
using var br = new BinaryReader(ms);
|
||||
|
||||
int count = br.ReadInt32();
|
||||
var result = new StorageInfo[count];
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
ushort pathLen = br.ReadUInt16();
|
||||
string path = Encoding.UTF8.GetString(br.ReadBytes(pathLen));
|
||||
long total = br.ReadInt64();
|
||||
long free = br.ReadInt64();
|
||||
|
||||
result[i] = new StorageInfo { Path = path, TotalBytes = total, FreeBytes = free };
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<FileEntry[]> ListDirAsync(string path)
|
||||
{
|
||||
byte[] pathBytes = Encoding.UTF8.GetBytes(path + "\0");
|
||||
await SendCommandAsync(Command.ListDir, pathBytes);
|
||||
var (response, data) = await ReceiveResponseAsync();
|
||||
|
||||
if (response != Response.Data) return Array.Empty<FileEntry>();
|
||||
|
||||
using var ms = new MemoryStream(data);
|
||||
using var br = new BinaryReader(ms);
|
||||
|
||||
int count = br.ReadInt32();
|
||||
|
||||
// Handle empty directory
|
||||
if (count <= 0) return Array.Empty<FileEntry>();
|
||||
|
||||
var result = new FileEntry[count];
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
byte type = br.ReadByte();
|
||||
ushort nameLen = br.ReadUInt16();
|
||||
string name = Encoding.UTF8.GetString(br.ReadBytes(nameLen));
|
||||
long size = br.ReadInt64();
|
||||
long timestamp = br.ReadInt64();
|
||||
|
||||
// Clamp timestamp to valid DateTimeOffset range
|
||||
DateTime dt;
|
||||
try
|
||||
{
|
||||
if (timestamp < -62135596800 || timestamp > 253402300799)
|
||||
{
|
||||
dt = DateTime.Now; // Use current time for invalid timestamps
|
||||
}
|
||||
else
|
||||
{
|
||||
dt = DateTimeOffset.FromUnixTimeSeconds(timestamp).DateTime;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
dt = DateTime.Now;
|
||||
}
|
||||
|
||||
result[i] = new FileEntry
|
||||
{
|
||||
Name = name,
|
||||
IsDirectory = type == 1,
|
||||
Size = size,
|
||||
Timestamp = dt
|
||||
};
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<bool> CreateDirAsync(string path)
|
||||
{
|
||||
byte[] pathBytes = Encoding.UTF8.GetBytes(path + "\0");
|
||||
await SendCommandAsync(Command.CreateDir, pathBytes);
|
||||
var (response, _) = await ReceiveResponseAsync();
|
||||
return response == Response.Ok;
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteFileAsync(string path)
|
||||
{
|
||||
byte[] pathBytes = Encoding.UTF8.GetBytes(path + "\0");
|
||||
await SendCommandAsync(Command.DeleteFile, pathBytes);
|
||||
var (response, _) = await ReceiveResponseAsync();
|
||||
return response == Response.Ok;
|
||||
}
|
||||
|
||||
public event Action<string>? OnProgressMessage;
|
||||
|
||||
public async Task<bool> DeleteDirAsync(string path)
|
||||
{
|
||||
byte[] pathBytes = Encoding.UTF8.GetBytes(path + "\0");
|
||||
await SendCommandAsync(Command.DeleteDir, pathBytes);
|
||||
|
||||
// Receive initial OK response
|
||||
var (response, _) = await ReceiveResponseAsync();
|
||||
if (response != Response.Ok)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Now listen for progress messages synchronously
|
||||
// Keep reading until we get the final OK/ERROR response
|
||||
bool deletionComplete = false;
|
||||
|
||||
try
|
||||
{
|
||||
while (!deletionComplete)
|
||||
{
|
||||
var (progressResponse, progressData) = await ReceiveResponseAsync();
|
||||
|
||||
if (progressResponse == Response.Progress)
|
||||
{
|
||||
string message = Encoding.UTF8.GetString(progressData).TrimEnd('\0');
|
||||
OnProgressMessage?.Invoke(message);
|
||||
}
|
||||
else if (progressResponse == Response.Ok)
|
||||
{
|
||||
// Final OK response received - deletion complete
|
||||
OnProgressMessage?.Invoke("🔚 Received final OK - deletion complete");
|
||||
deletionComplete = true;
|
||||
}
|
||||
else if (progressResponse == Response.Error)
|
||||
{
|
||||
// Error response received
|
||||
OnProgressMessage?.Invoke("❌ Received error response");
|
||||
deletionComplete = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unexpected response - log it
|
||||
OnProgressMessage?.Invoke($"⚠️ Unexpected response: {progressResponse}");
|
||||
deletionComplete = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Connection closed - log it
|
||||
OnProgressMessage?.Invoke($"⚠️ Connection closed: {ex.Message}");
|
||||
}
|
||||
|
||||
// Give server a moment to fully close the deletion thread
|
||||
// CRITICAL: Increased delay to prevent race condition with next delete
|
||||
await Task.Delay(500);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<bool> RenameAsync(string oldPath, string newPath)
|
||||
{
|
||||
byte[] oldBytes = Encoding.UTF8.GetBytes(oldPath + "\0");
|
||||
byte[] newBytes = Encoding.UTF8.GetBytes(newPath + "\0");
|
||||
byte[] data = new byte[oldBytes.Length + newBytes.Length];
|
||||
Array.Copy(oldBytes, 0, data, 0, oldBytes.Length);
|
||||
Array.Copy(newBytes, 0, data, oldBytes.Length, newBytes.Length);
|
||||
|
||||
await SendCommandAsync(Command.Rename, data);
|
||||
var (response, _) = await ReceiveResponseAsync();
|
||||
return response == Response.Ok;
|
||||
}
|
||||
|
||||
public async Task<bool> CopyFileAsync(string srcPath, string dstPath)
|
||||
{
|
||||
byte[] srcBytes = Encoding.UTF8.GetBytes(srcPath + "\0");
|
||||
byte[] dstBytes = Encoding.UTF8.GetBytes(dstPath + "\0");
|
||||
byte[] data = new byte[srcBytes.Length + dstBytes.Length];
|
||||
Array.Copy(srcBytes, 0, data, 0, srcBytes.Length);
|
||||
Array.Copy(dstBytes, 0, data, srcBytes.Length, dstBytes.Length);
|
||||
|
||||
await SendCommandAsync(Command.CopyFile, data);
|
||||
var (response, _) = await ReceiveResponseAsync();
|
||||
return response == Response.Ok;
|
||||
}
|
||||
|
||||
public async Task<bool> MoveFileAsync(string srcPath, string dstPath)
|
||||
{
|
||||
byte[] srcBytes = Encoding.UTF8.GetBytes(srcPath + "\0");
|
||||
byte[] dstBytes = Encoding.UTF8.GetBytes(dstPath + "\0");
|
||||
byte[] data = new byte[srcBytes.Length + dstBytes.Length];
|
||||
Array.Copy(srcBytes, 0, data, 0, srcBytes.Length);
|
||||
Array.Copy(dstBytes, 0, data, srcBytes.Length, dstBytes.Length);
|
||||
|
||||
await SendCommandAsync(Command.MoveFile, data);
|
||||
var (response, _) = await ReceiveResponseAsync();
|
||||
return response == Response.Ok;
|
||||
}
|
||||
|
||||
public async Task<bool> UploadFileAsync(string localPath, string remotePath, IProgress<UploadProgress>? progress = null, CancellationToken cancellationToken = default, long chunkOffset = 0, long chunkSize = 0)
|
||||
{
|
||||
FileInfo fileInfo = new FileInfo(localPath);
|
||||
if (!fileInfo.Exists) return false;
|
||||
|
||||
// Determine actual upload size
|
||||
long uploadSize = chunkSize > 0 ? chunkSize : fileInfo.Length;
|
||||
|
||||
// Send START_UPLOAD with optional chunk offset
|
||||
byte[] pathBytes = Encoding.UTF8.GetBytes(remotePath);
|
||||
byte[] startData = new byte[pathBytes.Length + 1 + 8 + 8]; // path + null + size + offset
|
||||
Array.Copy(pathBytes, 0, startData, 0, pathBytes.Length);
|
||||
BitConverter.GetBytes(fileInfo.Length).CopyTo(startData, pathBytes.Length + 1);
|
||||
BitConverter.GetBytes(chunkOffset).CopyTo(startData, pathBytes.Length + 9);
|
||||
|
||||
await SendCommandAsync(Command.StartUpload, startData);
|
||||
var (response, _) = await ReceiveResponseAsync();
|
||||
|
||||
if (response != Response.Ready) return false;
|
||||
|
||||
// Upload chunks - simple async approach
|
||||
long totalSent = 0;
|
||||
var startTime = DateTime.Now;
|
||||
double avgSpeed = 0;
|
||||
|
||||
byte[] sendBuffer = new byte[5 + BufferSize];
|
||||
sendBuffer[0] = (byte)Command.UploadChunk;
|
||||
|
||||
using (FileStream fs = new FileStream(localPath, FileMode.Open, FileAccess.Read, FileShare.Read, BufferSize, FileOptions.SequentialScan))
|
||||
{
|
||||
// Seek to chunk offset if specified
|
||||
if (chunkOffset > 0)
|
||||
{
|
||||
fs.Seek(chunkOffset, SeekOrigin.Begin);
|
||||
}
|
||||
|
||||
int chunksSent = 0;
|
||||
int bytesRead;
|
||||
long bytesRemaining = uploadSize;
|
||||
|
||||
while (bytesRemaining > 0 && (bytesRead = await fs.ReadAsync(sendBuffer, 5, (int)Math.Min(BufferSize, bytesRemaining), cancellationToken)) > 0)
|
||||
{
|
||||
if (cancellationToken.IsCancellationRequested) return false;
|
||||
|
||||
BitConverter.GetBytes((uint)bytesRead).CopyTo(sendBuffer, 1);
|
||||
|
||||
if (_stream == null) return false;
|
||||
|
||||
// FIX: Add timeout to WriteAsync to prevent hanging if PS5 becomes unresponsive
|
||||
// 30 second timeout per chunk write - should be more than enough for 4MB
|
||||
using var writeTimeout = new CancellationTokenSource(TimeSpan.FromSeconds(30));
|
||||
using var linkedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, writeTimeout.Token);
|
||||
|
||||
try
|
||||
{
|
||||
await _stream.WriteAsync(sendBuffer, 0, 5 + bytesRead, linkedCts.Token);
|
||||
}
|
||||
catch (OperationCanceledException) when (writeTimeout.IsCancellationRequested)
|
||||
{
|
||||
// Write timeout - PS5 is unresponsive
|
||||
return false;
|
||||
}
|
||||
|
||||
totalSent += bytesRead;
|
||||
bytesRemaining -= bytesRead;
|
||||
chunksSent++;
|
||||
|
||||
if (chunksSent % 5 == 0 || bytesRemaining == 0)
|
||||
{
|
||||
var elapsed = DateTime.Now - startTime;
|
||||
double currentSpeed = elapsed.TotalSeconds > 0 ? totalSent / elapsed.TotalSeconds : 0;
|
||||
avgSpeed = currentSpeed;
|
||||
|
||||
TimeSpan eta = currentSpeed > 0
|
||||
? TimeSpan.FromSeconds(bytesRemaining / currentSpeed)
|
||||
: TimeSpan.Zero;
|
||||
|
||||
progress?.Report(new UploadProgress
|
||||
{
|
||||
BytesSent = chunkOffset + totalSent,
|
||||
TotalBytes = fileInfo.Length,
|
||||
SpeedBytesPerSecond = currentSpeed,
|
||||
AverageSpeedBytesPerSecond = avgSpeed,
|
||||
ElapsedTime = elapsed,
|
||||
EstimatedTimeRemaining = eta,
|
||||
CurrentFileName = fileInfo.Name
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Send END_UPLOAD and wait for response
|
||||
// CRITICAL: Must wait for response to avoid protocol desync on chunked uploads
|
||||
try
|
||||
{
|
||||
await SendCommandAsync(Command.EndUpload);
|
||||
var (endResponse, _) = await ReceiveResponseAsync();
|
||||
return endResponse == Response.Ok;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false; // Connection issue means upload failed
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> DownloadFileAsync(string remotePath, string localPath, IProgress<UploadProgress>? progress = null, CancellationToken cancellationToken = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Send download command
|
||||
byte[] pathBytes = Encoding.UTF8.GetBytes(remotePath);
|
||||
await SendCommandAsync(Command.DownloadFile, pathBytes);
|
||||
|
||||
// Receive response header (5 bytes: 1 response + 4 data_len)
|
||||
byte[] header = new byte[5];
|
||||
await ReadExactAsync(header, 5);
|
||||
|
||||
Response response = (Response)header[0];
|
||||
uint dataLen = BitConverter.ToUInt32(header, 1);
|
||||
|
||||
// Check if error response
|
||||
if (response == Response.Error)
|
||||
{
|
||||
if (dataLen > 0)
|
||||
{
|
||||
byte[] errorMsg = new byte[dataLen];
|
||||
await ReadExactAsync(errorMsg, (int)dataLen);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Expecting RESP_DATA with 8-byte file size
|
||||
if (response != Response.Data || dataLen != 8)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read file size (8 bytes)
|
||||
byte[] sizeBytes = new byte[8];
|
||||
await ReadExactAsync(sizeBytes, 8);
|
||||
long fileSize = BitConverter.ToInt64(sizeBytes, 0);
|
||||
|
||||
// Now read raw file data directly from socket
|
||||
using var fs = new FileStream(localPath, FileMode.Create, FileAccess.Write, FileShare.None, BufferSize);
|
||||
|
||||
byte[] buffer = new byte[BufferSize];
|
||||
long totalReceived = 0;
|
||||
var startTime = DateTime.Now;
|
||||
|
||||
while (totalReceived < fileSize)
|
||||
{
|
||||
if (cancellationToken.IsCancellationRequested) return false;
|
||||
|
||||
int toRead = (int)Math.Min(BufferSize, fileSize - totalReceived);
|
||||
int received = await _stream!.ReadAsync(buffer, 0, toRead, cancellationToken);
|
||||
|
||||
if (received == 0) break;
|
||||
|
||||
await fs.WriteAsync(buffer, 0, received, cancellationToken);
|
||||
totalReceived += received;
|
||||
|
||||
// Report progress every 5MB or at completion
|
||||
if (totalReceived % (5 * 1024 * 1024) < BufferSize || totalReceived == fileSize)
|
||||
{
|
||||
var elapsed = DateTime.Now - startTime;
|
||||
double speed = elapsed.TotalSeconds > 0 ? totalReceived / elapsed.TotalSeconds : 0;
|
||||
|
||||
progress?.Report(new UploadProgress
|
||||
{
|
||||
BytesSent = totalReceived,
|
||||
TotalBytes = fileSize,
|
||||
SpeedBytesPerSecond = speed,
|
||||
AverageSpeedBytesPerSecond = speed,
|
||||
ElapsedTime = elapsed,
|
||||
EstimatedTimeRemaining = speed > 0 ? TimeSpan.FromSeconds((fileSize - totalReceived) / speed) : TimeSpan.Zero,
|
||||
CurrentFileName = Path.GetFileName(localPath)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return totalReceived == fileSize;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"Download error: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
public class StorageInfo
|
||||
{
|
||||
public string Path { get; set; } = "";
|
||||
public long TotalBytes { get; set; }
|
||||
public long FreeBytes { get; set; }
|
||||
}
|
||||
|
||||
public class FileEntry
|
||||
{
|
||||
public string Name { get; set; } = "";
|
||||
public bool IsDirectory { get; set; }
|
||||
public long Size { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
}
|
||||
|
||||
public class UploadProgress
|
||||
{
|
||||
public long BytesSent { get; set; }
|
||||
public long TotalBytes { get; set; }
|
||||
public double SpeedBytesPerSecond { get; set; }
|
||||
public double AverageSpeedBytesPerSecond { get; set; }
|
||||
public TimeSpan ElapsedTime { get; set; }
|
||||
public TimeSpan EstimatedTimeRemaining { get; set; }
|
||||
public string CurrentFileName { get; set; } = "";
|
||||
|
||||
// For folder progress
|
||||
public int CurrentFileIndex { get; set; }
|
||||
public int TotalFiles { get; set; }
|
||||
public long TotalFolderBytes { get; set; }
|
||||
public long TotalFolderBytesSent { get; set; }
|
||||
}
|
||||
|
||||
// High-speed parallel uploader using multiple connections
|
||||
public class ParallelUploader : IDisposable
|
||||
{
|
||||
private readonly string _ipAddress;
|
||||
private readonly int _port;
|
||||
private readonly int _connectionCount;
|
||||
private const int ChunkSize = 4 * 1024 * 1024; // 4MB chunks per connection
|
||||
|
||||
public ParallelUploader(string ipAddress, int port = 9113, int connectionCount = 4)
|
||||
{
|
||||
_ipAddress = ipAddress;
|
||||
_port = port;
|
||||
_connectionCount = connectionCount;
|
||||
}
|
||||
|
||||
public async Task<bool> UploadFileAsync(string localPath, string remotePath, IProgress<UploadProgress>? progress = null, CancellationToken cancellationToken = default)
|
||||
{
|
||||
FileInfo fileInfo = new FileInfo(localPath);
|
||||
if (!fileInfo.Exists) return false;
|
||||
|
||||
// For small files, use single connection
|
||||
if (fileInfo.Length < ChunkSize * 2)
|
||||
{
|
||||
using var protocol = new PS5Protocol();
|
||||
if (!await protocol.ConnectAsync(_ipAddress, _port)) return false;
|
||||
return await protocol.UploadFileAsync(localPath, remotePath, progress, cancellationToken);
|
||||
}
|
||||
|
||||
// For large files, use parallel connections
|
||||
// This requires server support for chunked/parallel uploads
|
||||
// For now, fall back to single connection
|
||||
using var proto = new PS5Protocol();
|
||||
if (!await proto.ConnectAsync(_ipAddress, _port)) return false;
|
||||
return await proto.UploadFileAsync(localPath, remotePath, progress, cancellationToken);
|
||||
}
|
||||
|
||||
public void Dispose() { }
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
@echo off
|
||||
echo ================================================
|
||||
echo PS5 Upload Client - Building
|
||||
echo By Manos
|
||||
echo ================================================
|
||||
echo.
|
||||
|
||||
echo [+] Building Windows GUI Client...
|
||||
dotnet publish -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||
|
||||
if exist "bin\Release\net6.0-windows\win-x64\publish\PS5Upload.exe" (
|
||||
echo.
|
||||
echo ================================================
|
||||
echo [+] SUCCESS! Built PS5Upload.exe
|
||||
echo ================================================
|
||||
echo.
|
||||
echo Location: bin\Release\net6.0-windows\win-x64\publish\PS5Upload.exe
|
||||
echo.
|
||||
echo Copy PS5Upload.exe to any location and run it!
|
||||
) else (
|
||||
echo.
|
||||
echo ================================================
|
||||
echo [-] BUILD FAILED
|
||||
echo ================================================
|
||||
echo.
|
||||
echo Make sure .NET 6.0 SDK is installed:
|
||||
echo https://dotnet.microsoft.com/download/dotnet/6.0
|
||||
exit /b 1
|
||||
)
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 155 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 40 KiB |
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "================================================"
|
||||
echo "PS5 Upload Server - Compilation"
|
||||
echo "By Manos"
|
||||
echo "================================================"
|
||||
echo ""
|
||||
|
||||
echo "[+] Compiling..."
|
||||
rm -f ps5_upload_server.elf
|
||||
/opt/ps5-payload-sdk/bin/prospero-clang -Wall -O3 -pthread -o ps5_upload_server.elf main.c
|
||||
|
||||
if [ -f "ps5_upload_server.elf" ]; then
|
||||
echo ""
|
||||
echo "================================================"
|
||||
echo "[+] SUCCESS! Compiled ps5_upload_server.elf"
|
||||
echo "================================================"
|
||||
echo ""
|
||||
ls -lh ps5_upload_server.elf
|
||||
file ps5_upload_server.elf
|
||||
echo ""
|
||||
echo "Upload to PS5 and run with elfldr"
|
||||
echo "Server will listen on port 9113"
|
||||
else
|
||||
echo ""
|
||||
echo "================================================"
|
||||
echo "[-] COMPILATION FAILED"
|
||||
echo "================================================"
|
||||
exit 1
|
||||
fi
|
||||
-1282
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 93 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 87 KiB |
Reference in new issue
Block a user