mirror of
https://github.com/LBPUnion/UnionPatcher.git
synced 2025-08-03 22:58:40 +00:00
Fix psp architecture value
This commit is contained in:
parent
4b566c35fa
commit
159dd9f3cc
2 changed files with 6 additions and 6 deletions
|
@ -1088,7 +1088,7 @@ public class PS3MAPI
|
||||||
Fail(new Exception("Malformed PASV response: " + sResponse));
|
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]);
|
iPort = (int.Parse(pasv[4]) << 8) + int.Parse(pasv[5]);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1159,13 +1159,13 @@ public class PS3MAPI
|
||||||
{
|
{
|
||||||
sLog = sLog + "COMMAND: " + sCommand + Environment.NewLine;
|
sLog = sLog + "COMMAND: " + sCommand + Environment.NewLine;
|
||||||
Connect();
|
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);
|
main_sock.Send(byCommand, byCommand.Length, 0);
|
||||||
ReadResponse();
|
ReadResponse();
|
||||||
}
|
}
|
||||||
internal static void FillBucket()
|
internal static void FillBucket()
|
||||||
{
|
{
|
||||||
Byte[] bytes = new Byte[512];
|
byte[] bytes = new byte[512];
|
||||||
long lBytesRecieved;
|
long lBytesRecieved;
|
||||||
int iMilliSecondsPassed = 0;
|
int iMilliSecondsPassed = 0;
|
||||||
while (main_sock.Available < 1)
|
while (main_sock.Available < 1)
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class ElfFile {
|
||||||
private enum InstructionSetArchitecture : ushort {
|
private enum InstructionSetArchitecture : ushort {
|
||||||
PowerPC = 0x15, //64-bit PowerPC (PS3)
|
PowerPC = 0x15, //64-bit PowerPC (PS3)
|
||||||
ARM = 0x28, //32-bit ARM (Vita)
|
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";
|
public string Name { get; } = "Binary Blob";
|
||||||
|
@ -73,12 +73,12 @@ public class ElfFile {
|
||||||
|
|
||||||
private string GetFileArchitecture(byte[] elfHeader, bool isBigEndian) {
|
private string GetFileArchitecture(byte[] elfHeader, bool isBigEndian) {
|
||||||
byte[] architectureBytes = elfHeader[0x12..0x14];
|
byte[] architectureBytes = elfHeader[0x12..0x14];
|
||||||
UInt16 fileArch = (isBigEndian) ?
|
ushort fileArch = (isBigEndian) ?
|
||||||
BinaryPrimitives.ReadUInt16BigEndian(architectureBytes) :
|
BinaryPrimitives.ReadUInt16BigEndian(architectureBytes) :
|
||||||
BinaryPrimitives.ReadUInt16LittleEndian(architectureBytes);
|
BinaryPrimitives.ReadUInt16LittleEndian(architectureBytes);
|
||||||
|
|
||||||
foreach(InstructionSetArchitecture arch in Enum.GetValues(typeof(InstructionSetArchitecture))) {
|
foreach(InstructionSetArchitecture arch in Enum.GetValues(typeof(InstructionSetArchitecture))) {
|
||||||
if(fileArch == (UInt16)arch)
|
if(fileArch == (ushort)arch)
|
||||||
return arch.ToString();
|
return arch.ToString();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue