Fix psp architecture value

This commit is contained in:
jvyden 2022-07-26 21:50:15 -04:00
parent 4b566c35fa
commit 159dd9f3cc
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
2 changed files with 6 additions and 6 deletions

View file

@ -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)

View file

@ -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;