Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Refresher
A utility for patching LittleBigPlanet games to custom servers.

## Downloading

You can download Refresher for your platform by visiting our Releases.

https://github.com/LittleBigRefresh/Refresher/releases/latest

## Credits/Libraries we use
### UI
- Eto.Forms
Expand All @@ -10,9 +16,10 @@ A utility for patching LittleBigPlanet games to custom servers.
- ELFSharp
- SPRXPatcher
- SCEToolSharp
- Our C# port of jjolano's make_fself

### Connections
- WebMAN (technically?)
- WebMAN (technically)
- FluentFTP

### Infrastructure
Expand Down
4 changes: 3 additions & 1 deletion Refresher.Core/LogType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ public enum LogType : byte
Vita,
RPCS3,
Pipeline,
Patchwork
Patchwork,
Encrypt,
Decrypt,
}
26 changes: 26 additions & 0 deletions Refresher.Core/Native/Elf/Elf64Ehdr.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// This file contains modified & ported code from jjolano's make_fself C project.
// make_fself is licensed under GPL-3.0.
// Find it here: https://github.com/jjolano/make_fself

using System.Runtime.InteropServices;

namespace Refresher.Core.Native.Elf;

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct Elf64Ehdr
{
public unsafe fixed byte e_ident[16];
public ushort e_type;
public ushort e_machine;
public uint e_version;
public ulong e_entry;
public ulong e_phoff;
public ulong e_shoff;
public uint e_flags;
public ushort e_ehsize;
public ushort e_phentsize;
public ushort e_phnum;
public ushort e_shentsize;
public ushort e_shnum;
public ushort e_shstrndx;
}
20 changes: 20 additions & 0 deletions Refresher.Core/Native/Elf/Elf64Phdr.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// This file contains modified & ported code from jjolano's make_fself C project.
// make_fself is licensed under GPL-3.0.
// Find it here: https://github.com/jjolano/make_fself

using System.Runtime.InteropServices;

namespace Refresher.Core.Native.Elf;

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct Elf64Phdr
{
public uint p_type;
public uint p_flags;
public ulong p_offset;
public ulong p_vaddr;
public ulong p_paddr;
public ulong p_filesz;
public ulong p_memsz;
public ulong p_align;
}
17 changes: 17 additions & 0 deletions Refresher.Core/Native/Sce/AppInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// This file contains modified & ported code from jjolano's make_fself C project.
// make_fself is licensed under GPL-3.0.
// Find it here: https://github.com/jjolano/make_fself

using System.Runtime.InteropServices;

namespace Refresher.Core.Native.Sce;

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct AppInfo
{
public ulong auth_id; // 0x1010000001000003
public uint vendor_id; // 0x1000002
public uint self_type; // 0x4 (application)
public ulong version; // 0x0001000000000000
public ulong padding;
}
23 changes: 23 additions & 0 deletions Refresher.Core/Native/Sce/ControlInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// This file contains modified & ported code from jjolano's make_fself C project.
// make_fself is licensed under GPL-3.0.
// Find it here: https://github.com/jjolano/make_fself

using System.Runtime.InteropServices;

namespace Refresher.Core.Native.Sce;

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct ControlInfo
{
public uint type; // 0x2
public uint size; // 0x40
public ulong next; // 0x0

[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[] digest1;

[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[] digest2;

public ulong padding;
}
19 changes: 19 additions & 0 deletions Refresher.Core/Native/Sce/SceHeader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// This file contains modified & ported code from jjolano's make_fself C project.
// make_fself is licensed under GPL-3.0.
// Find it here: https://github.com/jjolano/make_fself

using System.Runtime.InteropServices;

namespace Refresher.Core.Native.Sce;

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SceHeader
{
public uint magic; // 0x53434500
public uint version; // 0x2
public ushort keyrev; // 0x8000 (devkit)
public ushort type; // 0x1 (self)
public uint meta_off; // generated from ELF
public ulong head_len; // generated from ELF
public ulong data_len;
}
22 changes: 22 additions & 0 deletions Refresher.Core/Native/Sce/SceVersionData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// This file contains modified & ported code from jjolano's make_fself C project.
// make_fself is licensed under GPL-3.0.
// Find it here: https://github.com/jjolano/make_fself

using System.Runtime.InteropServices;

namespace Refresher.Core.Native.Sce;

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SceVersionData
{
public ushort unknown1;
public ushort unknown2; // 0x1
public uint unknown3; // 0x30
public uint unknown4; // 0x0
public uint unknown5; // 0x1
public ulong offset; // 0x0
public ulong size; // 0x0

[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] control_flags;
}
16 changes: 16 additions & 0 deletions Refresher.Core/Native/Sce/SceVersionInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This file contains modified & ported code from jjolano's make_fself C project.
// make_fself is licensed under GPL-3.0.
// Find it here: https://github.com/jjolano/make_fself

using System.Runtime.InteropServices;

namespace Refresher.Core.Native.Sce;

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SceVersionInfo
{
public uint subheader_type; // 0x1
public uint present; // 0x0
public uint size; // 0x10
public uint unknown4; // 0x0
}
18 changes: 18 additions & 0 deletions Refresher.Core/Native/Sce/SegmentInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This file contains modified & ported code from jjolano's make_fself C project.
// make_fself is licensed under GPL-3.0.
// Find it here: https://github.com/jjolano/make_fself

using System.Runtime.InteropServices;

namespace Refresher.Core.Native.Sce;

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SegmentInfo
{
public ulong offset;
public ulong size;
public uint compressed;
public uint unknown1;
public uint unknown2;
public uint encrypted;
}
22 changes: 22 additions & 0 deletions Refresher.Core/Native/Sce/SelfHeader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// This file contains modified & ported code from jjolano's make_fself C project.
// make_fself is licensed under GPL-3.0.
// Find it here: https://github.com/jjolano/make_fself

using System.Runtime.InteropServices;

namespace Refresher.Core.Native.Sce;

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SelfHeader
{
public ulong header_type; // 0x3 (self)
public ulong appinfo_offset; // 0x70
public ulong elf_offset; // 0x90
public ulong phdr_offset; // generated from ELF
public ulong shdr_offset; // generated from ELF
public ulong section_info_offset; // generated from ELF
public ulong sceversion_offset; // generated from ELF
public ulong controlinfo_offset; // generated from ELF
public ulong controlinfo_length; // generated from ELF
public ulong padding;
}
40 changes: 40 additions & 0 deletions Refresher.Core/Pipelines/Lbp/LbpRPCS3PatchPipeline.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Refresher.Core.Accessors;
using Refresher.Core.Pipelines.Steps;

namespace Refresher.Core.Pipelines.Lbp;

public class LbpRPCS3PatchPipeline : Pipeline
{
public override string Id => "lbp-rpcs3-patch";
public override string Name => "LBP RPCS3 Patch";

protected override Type SetupAccessorStepType => typeof(SetupEmulatorAccessorStep);
public override bool ReplacesEboot => true;

public override string GuideLink => "https://docs.littlebigrefresh.com/rpcs3";

public override IEnumerable<string> GameNameFilters => ["littlebigplanet", "lbp"];

protected override List<Type> StepTypes =>
[
// Info gathering stage
typeof(ValidateGameStep),
typeof(DownloadParamSfoStep),
typeof(DownloadGameEbootStep),
typeof(ReadEbootContentIdStep),
typeof(DownloadGameLicenseStep),

// Decryption and patch stage
typeof(PrepareSceToolStep),
typeof(DecryptGameEbootStep),
typeof(ApplySprxPatchToEbootStep),

// Encryption and upload stage
typeof(FakeEncryptGameEbootStep),
typeof(PrintInfoForEncryptedGameEbootStep),
typeof(BackupGameEbootBeforeReplaceStep),
typeof(UploadPatchworkSprxStep),
typeof(UploadPatchworkConfigurationStep),
typeof(UploadGameEbootStep),
];
}
9 changes: 9 additions & 0 deletions Refresher.Core/Pipelines/Lbp/PatchworkRPCS3ConfigPipeline.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Refresher.Core.Pipelines.Steps;

namespace Refresher.Core.Pipelines.Lbp;

public class PatchworkRPCS3ConfigPipeline : PatchworkConfigPipeline
{
protected override string ConsoleName => "RPCS3";
protected override Type? SetupAccessorStepType => typeof(SetupEmulatorAccessorStep);
}
Loading
Loading