Skip to content

Commit

Permalink
Added Payloads to installer and fixed a bug with loading payloads.
Browse files Browse the repository at this point in the history
  • Loading branch information
OSM-Made committed Oct 16, 2020
1 parent 2174a2a commit 75ccd2f
Show file tree
Hide file tree
Showing 37 changed files with 61 additions and 142 deletions.
42 changes: 0 additions & 42 deletions Executables/InstallUtil.InstallLog

This file was deleted.

Binary file removed Executables/OrbisLibCPP.dll
Binary file not shown.
Binary file modified Executables/OrbisModuleManager.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion Executables/OrbisModuleManager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.423.0")]
[assembly: AssemblyVersion("2.0.443.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
Binary file modified Executables/OrbisNeighborhood.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion Executables/OrbisNeighborhood/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.352")]
[assembly: AssemblyVersion("2.0.372")]
[assembly: AssemblyFileVersion("1.0.0")]
42 changes: 0 additions & 42 deletions Executables/OrbisSuiteService.InstallLog

This file was deleted.

Binary file modified Executables/OrbisSuiteService.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion Executables/OrbisSuiteService/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.129.0")]
[assembly: AssemblyVersion("1.0.131.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file modified Executables/OrbisTargetSettings.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion Executables/OrbisTargetSettings/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.349.0")]
[assembly: AssemblyVersion("2.0.369.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file modified Executables/OrbisTaskbarApp.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion Executables/OrbisTaskbarApp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.344.0")]
[assembly: AssemblyVersion("2.0.345.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file removed Executables/OrbisWindowsServiceLib.dll
Binary file not shown.
Binary file modified Libraries/OrbisLib.dll
Binary file not shown.
28 changes: 17 additions & 11 deletions Libraries/OrbisLib/Classes/Target/Payload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ public Payload(Target Target)
}

/// <summary>
/// Sends Orbis Suite Payloads to Playstation 4 Console. Payloads are read from the Orbis Suite Appdata folder with the format Payload-{Firmware}.bin ex. Payload-505.bin.
/// Sends Orbis Suite Payloads to Playstation 4 Console. Payloads are read from the Orbis Suite Appdata folder with the format OrbisLib-{Firmware}.bin ex. Payload-505.bin.
/// </summary>
/// <param name="IP">PlayStation 4 IP address</param>
/// <param name="KernelVersion">PlayStation 4 Kernel Version Ex:5.05</param>
/// <param name="Port">Port used to recieve payload default value is 9020</param>
public bool InjectPayload(int Port = 9020)
public bool InjectPayload()
{
try
{
Socket socket;

socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.ReceiveTimeout = 200;
socket.SendTimeout = 200;
IAsyncResult result = socket.BeginConnect(new IPEndPoint(IPAddress.Parse(Target.Info.IPAddr), Target.Info.PayloadPort), null, null);
socket.ReceiveTimeout = 1000;
socket.SendTimeout = 1000;
IAsyncResult result = socket.BeginConnect(Target.Info.IPAddr, Target.Info.PayloadPort, null, null);

result.AsyncWaitHandle.WaitOne(1000, true);
result.AsyncWaitHandle.WaitOne(3000, true);

if (!socket.Connected)
{
Expand All @@ -45,7 +45,10 @@ public bool InjectPayload(int Port = 9020)
return false;
}

FileStream fPayload = File.Open(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Orbis Suite\\Payload-" + Target.Info.Firmware + ".bin", FileMode.Open);
// we have connected
socket.EndConnect(result);

FileStream fPayload = File.Open($"{Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}\\Orbis Suite\\OrbisLib-{(Convert.ToDouble(Target.Info.Firmware) * 100).ToString()}.bin", FileMode.Open);

if (!fPayload.CanRead)
{
Expand Down Expand Up @@ -95,11 +98,11 @@ public bool InjectPayload(byte[] PayloadBuffer)
Socket socket;

socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.ReceiveTimeout = 200;
socket.SendTimeout = 200;
IAsyncResult result = socket.BeginConnect(new IPEndPoint(IPAddress.Parse(Target.Info.IPAddr), Target.Info.PayloadPort), null, null);
socket.ReceiveTimeout = 1000;
socket.SendTimeout = 1000;
IAsyncResult result = socket.BeginConnect(Target.Info.IPAddr, Target.Info.PayloadPort, null, null);

result.AsyncWaitHandle.WaitOne(1000, true);
result.AsyncWaitHandle.WaitOne(3000, true);

if (!socket.Connected)
{
Expand All @@ -109,6 +112,9 @@ public bool InjectPayload(byte[] PayloadBuffer)
return false;
}

// we have connected
socket.EndConnect(result);

//Send Payload
socket.Send(PayloadBuffer);

Expand Down
2 changes: 1 addition & 1 deletion Libraries/OrbisLib/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.435")]
[assembly: AssemblyVersion("2.0.456")]
[assembly: AssemblyFileVersion("2")]
Binary file modified Libraries/OrbisLibCPP.dll
Binary file not shown.
Binary file modified Libraries/OrbisWindowsServiceLib.dll
Binary file not shown.
18 changes: 7 additions & 11 deletions Libraries/OrbisWindowsServiceLib/ServiceClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ VOID ServiceClient::CommandClientThread(LPVOID lpParameter, SOCKET Client) {
switch (CommandPacket->CommandIndex) //TODO: Add Command For changing Print Socket Port and COM Port
{
default:
socketprint("[Error] Client Command Thread Recieve Invalid Command Index!\n");
printf("[Error] Client Command Thread Recieve Invalid Command Index!\n");
break;

case CMD_CLIENT_CONNECT:
Expand All @@ -31,13 +31,13 @@ VOID ServiceClient::CommandClientThread(LPVOID lpParameter, SOCKET Client) {
case CMD_CLIENT_HEARTBEAT:
if ((serviceClient->ClientInfo[CommandPacket->Index].Used == false) || (GetTickCount() - serviceClient->ClientInfo[CommandPacket->Index].LastUpdateTime) > 10000)
{
socketprint("Client has timed out Sending reconnect request.\n");
printf("Client has timed out Sending reconnect request.\n");
int Status = 1;
send(Client, (char*)&Status, sizeof(int), 0);
}
else
{
socketprint("Client heart beat Packet took %dms to respond\n", (GetTickCount() - serviceClient->ClientInfo[CommandPacket->Index].LastUpdateTime));
printf("Client heart beat Packet took %dms to respond\n", (GetTickCount() - serviceClient->ClientInfo[CommandPacket->Index].LastUpdateTime));

serviceClient->ClientInfo[CommandPacket->Index].LastUpdateTime = GetTickCount();

Expand All @@ -58,7 +58,7 @@ DWORD ServiceClient::SocketAliveCheck(LPVOID ptr)
{
if (serviceClient->ClientInfo[i].Used && ((GetTickCount() - serviceClient->ClientInfo[i].LastUpdateTime) > 10000))
{
socketprint("No response from Client %i in > 10000ms. Timed out!\n", i);
printf("No response from Client %i in > 10000ms. Timed out!\n", i);

serviceClient->ClientInfo[i].Used = false;
serviceClient->ClientInfo[i].LastUpdateTime = 0;
Expand All @@ -73,7 +73,7 @@ DWORD ServiceClient::SocketAliveCheck(LPVOID ptr)
}

ServiceClient::ServiceClient(unsigned short CommandListenerPort) {
socketprint("ServiceClient Initialization...\n");
printf("ServiceClient Initialization...\n");

//Initialize Struct
for (int i = 0; i < MAX_CLIENTS; i++)
Expand All @@ -96,7 +96,7 @@ ServiceClient::ServiceClient(unsigned short CommandListenerPort) {
}

ServiceClient::~ServiceClient() {
socketprint("ServiceClient Destruction...\n");
printf("ServiceClient Destruction...\n");

//Notify Thread to close
this->ServiceRunning = false;
Expand All @@ -117,7 +117,7 @@ int ServiceClient::AddClient() {

//Make sure we found a free client
if (NewClient == -1) {
socketprint("[Error] No Free Client!\n");
printf("[Error] No Free Client!\n");
}
else {
//Mark ClientInfo as used
Expand All @@ -140,17 +140,13 @@ void ServiceClient::ForwardPacket(TargetCommandPacket_s* TargetCommandPacket)
ClientInfo_s* ClientInfo = &this->ClientInfo[i];
if (ClientInfo->Used)
{
socketprint("Sending Packet to 127.0.0.1:%d...\n", ClientInfo->Port);

Sockets* Socket = new Sockets("127.0.0.1", ClientInfo->Port);

if (!Socket->Connect()) {
socketprint("Failed to Connect on 127.0.0.1:%d\n", ClientInfo->Port);
continue;
}

if (!Socket->Send((char*)TargetCommandPacket, sizeof(TargetCommandPacket_s))) {
socketprint("Failed to Send Command Packet.\n");
free(Socket);
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions Libraries/OrbisWindowsServiceLib/ServiceTargetWatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void ServiceTargetWatcher::WatcherChildThread(int index)
{
if (LastTargetValue[index] == false)
{
socketprint("Target: %s Available.\n", orbisLib->TargetManagement->Targets[index].Name);
printf("Target: %s Available.\n", orbisLib->TargetManagement->Targets[index].Name);

//Set up packet to send.
TargetCommandPacket_s TargetCommandPacket;
Expand All @@ -27,7 +27,7 @@ void ServiceTargetWatcher::WatcherChildThread(int index)
{
if (LastTargetValue[index] == true)
{
socketprint("Target: %s no longer Available.\n", orbisLib->TargetManagement->Targets[index].Name);
printf("Target: %s no longer Available.\n", orbisLib->TargetManagement->Targets[index].Name);

//Set up packet to send.
TargetCommandPacket_s TargetCommandPacket;
Expand Down
10 changes: 5 additions & 5 deletions Libraries/OrbisWindowsServiceLib/SocketListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DWORD WINAPI SocketListener::ListenerThread() {

//Bind our socket
if (bind(this->ServerSocket, (sockaddr*)&addr, sizeof(addr)) == SOCKET_ERROR) {
socketprint("Failed to bind Listener to Port %i\n", this->ListenPort);
printf("Failed to bind Listener to Port %i\n", this->ListenPort);

closesocket(this->ServerSocket);
WSACleanup();
Expand All @@ -45,7 +45,7 @@ DWORD WINAPI SocketListener::ListenerThread() {

//Start listening for incoming socket connections
if (listen(this->ServerSocket, SOMAXCONN) == SOCKET_ERROR) {
socketprint("[Error] Failed to start listen on Socket\n");
printf("[Error] Failed to start listen on Socket\n");

closesocket(this->ServerSocket);
WSACleanup();
Expand Down Expand Up @@ -119,7 +119,7 @@ DWORD WINAPI ThreadStartHack(LPVOID ptr)

SocketListener::SocketListener(VOID(*ClientCallBack)(LPVOID, SOCKET), LPVOID lpParameter, unsigned short ListenPort)
{
socketprint("SocketListener Initialization!\n");
printf("SocketListener Initialization!\n");

//Store Our input varibales locally
this->ClientCallBack = ClientCallBack;
Expand All @@ -137,12 +137,12 @@ SocketListener::SocketListener(VOID(*ClientCallBack)(LPVOID, SOCKET), LPVOID lpP

SocketListener::~SocketListener()
{
socketprint("SocketListener Destruction!\n");
printf("SocketListener Destruction!\n");

//Signal Clean up
this->ServerRunning = false;

while (this->ThreadCleanedUp == false) {}

socketprint("Destruction sucessful.\n");
printf("Destruction sucessful.\n");
}
4 changes: 2 additions & 2 deletions Libraries/OrbisWindowsServiceLib/Sockets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bool Sockets::Connect() {
iResult = ioctlsocket(Socket, FIONBIO, &iMode);

if (iResult != NO_ERROR) {
socketprint("Failed to Set to NON Blocking Mode!\n");
printf("Failed to Set to NON Blocking Mode!\n");
return false;
}

Expand Down Expand Up @@ -78,7 +78,7 @@ bool Sockets::Connect() {
iResult = ioctlsocket(Socket, FIONBIO, &iMode);

if (iResult != NO_ERROR) {
socketprint("Failed to Set to Blocking Mode!\n");
printf("Failed to Set to Blocking Mode!\n");
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion Libraries/OrbisWindowsServiceLib/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ VOID TargetClientThread(LPVOID lpParameter, SOCKET Socket)
}
}

socketprint("Command Recieved: %d(%s)\n", TargetCommandPacket->CommandIndex, TargetCommandsStr[TargetCommandPacket->CommandIndex]);
printf("Command Recieved: %d(%s)\n", TargetCommandPacket->CommandIndex, TargetCommandsStr[TargetCommandPacket->CommandIndex]);

//Forward the packet to all the connected children processes.
Client->ForwardPacket(TargetCommandPacket);
Expand Down
31 changes: 11 additions & 20 deletions Orbis Suite Installer/Assets/License.rtf
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
MIT License
Copyright (c) 2020 OSM
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 Courier;}}
{\colortbl;\red255\green0\blue0;\red0\green0\blue255;}
\widowctrl\hyphauto

{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Orbis Suite\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: \par}
{\pard \ql \f0 \sa180 \li0 \fi0 \par}
{\pard \ql \f0 \sa180 \li0 \fi0 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. \par}
{\pard \ql \f0 \sa180 \li0 \fi0 \par}
{\pard \ql \f0 \sa180 \li0 \fi0 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\par}
}
Binary file not shown.
Binary file modified Orbis Suite Installer/Assets/Program Data/OrbisLibCPP.dll
Binary file not shown.
Binary file not shown.
Binary file modified Orbis Suite Installer/Assets/Program Files x64/OrbisLib.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 75ccd2f

Please sign in to comment.