From 159dd9f3cc1b4c797edf6b6345f8e03c9f386dd3 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 26 Jul 2022 21:50:15 -0400 Subject: [PATCH] Fix psp architecture value --- UnionPatcher/Communication/PS3MAPI.cs | 6 +++--- UnionPatcher/ElfFile.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/UnionPatcher/Communication/PS3MAPI.cs b/UnionPatcher/Communication/PS3MAPI.cs index 67b2416..c3d0f69 100644 --- a/UnionPatcher/Communication/PS3MAPI.cs +++ b/UnionPatcher/Communication/PS3MAPI.cs @@ -1088,7 +1088,7 @@ public class PS3MAPI Fail(new Exception("Malformed PASV response: " + sResponse)); } - sServer = String.Format("{0}.{1}.{2}.{3}", pasv[0], pasv[1], pasv[2], pasv[3]); + sServer = string.Format("{0}.{1}.{2}.{3}", pasv[0], pasv[1], pasv[2], pasv[3]); iPort = (int.Parse(pasv[4]) << 8) + int.Parse(pasv[5]); try { @@ -1159,13 +1159,13 @@ public class PS3MAPI { sLog = sLog + "COMMAND: " + sCommand + Environment.NewLine; Connect(); - Byte[] byCommand = Encoding.ASCII.GetBytes((sCommand + "\r\n").ToCharArray()); + byte[] byCommand = Encoding.ASCII.GetBytes((sCommand + "\r\n").ToCharArray()); main_sock.Send(byCommand, byCommand.Length, 0); ReadResponse(); } internal static void FillBucket() { - Byte[] bytes = new Byte[512]; + byte[] bytes = new byte[512]; long lBytesRecieved; int iMilliSecondsPassed = 0; while (main_sock.Available < 1) diff --git a/UnionPatcher/ElfFile.cs b/UnionPatcher/ElfFile.cs index 923ea0f..dcbc2fa 100644 --- a/UnionPatcher/ElfFile.cs +++ b/UnionPatcher/ElfFile.cs @@ -26,7 +26,7 @@ public class ElfFile { private enum InstructionSetArchitecture : ushort { PowerPC = 0x15, //64-bit PowerPC (PS3) ARM = 0x28, //32-bit ARM (Vita) - MipsRS3000, // MIPS RS3000 Big-Endian 32bit (PSP) + MipsRS3000 = 0x08, // MIPS RS3000 Big-Endian 32bit (PSP) } public string Name { get; } = "Binary Blob"; @@ -73,12 +73,12 @@ public class ElfFile { private string GetFileArchitecture(byte[] elfHeader, bool isBigEndian) { byte[] architectureBytes = elfHeader[0x12..0x14]; - UInt16 fileArch = (isBigEndian) ? + ushort fileArch = (isBigEndian) ? BinaryPrimitives.ReadUInt16BigEndian(architectureBytes) : BinaryPrimitives.ReadUInt16LittleEndian(architectureBytes); foreach(InstructionSetArchitecture arch in Enum.GetValues(typeof(InstructionSetArchitecture))) { - if(fileArch == (UInt16)arch) + if(fileArch == (ushort)arch) return arch.ToString(); } return null;