-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d040abe
commit 46d13c3
Showing
36 changed files
with
2,033 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.27130.2010 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PS4 Payload Sender", "PS4 Payload Sender\PS4 Payload Sender.csproj", "{6D5D7510-5751-4D2F-BCBB-F21445FB7AE3}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{6D5D7510-5751-4D2F-BCBB-F21445FB7AE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{6D5D7510-5751-4D2F-BCBB-F21445FB7AE3}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{6D5D7510-5751-4D2F-BCBB-F21445FB7AE3}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{6D5D7510-5751-4D2F-BCBB-F21445FB7AE3}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {3B855644-8A59-4885-8636-AAFA598FF105} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> | ||
</startup> | ||
</configuration> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
using System; | ||
using System.Net; | ||
using System.Net.Sockets; | ||
using System.Windows.Forms; | ||
|
||
namespace PS4_Payload_Sender | ||
{ | ||
public partial class Form1 : Form | ||
{ | ||
public Form1() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void button1_Click(object sender, EventArgs e) | ||
{ | ||
if (textBox1.Text == "") | ||
{ | ||
MessageBox.Show("Please enter an IP address."); | ||
} | ||
else | ||
{ | ||
bool result = Connect2PS4(textBox1.Text, textBox2.Text); | ||
if (!result) | ||
{ | ||
MessageBox.Show("Error while connecting.\n" + Exception); | ||
} | ||
else | ||
{ | ||
groupBox1.Enabled = false; | ||
groupBox2.Enabled = true; | ||
} | ||
} | ||
} | ||
|
||
public static Socket _psocket; | ||
public static bool pDConnected; | ||
public static string Exception; | ||
|
||
public static bool Connect2PS4(string ip, string port) | ||
{ | ||
try | ||
{ | ||
_psocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); | ||
_psocket.ReceiveTimeout = 3000; | ||
_psocket.SendTimeout = 3000; | ||
_psocket.Connect(new IPEndPoint(IPAddress.Parse(ip), Int32.Parse(port))); | ||
pDConnected = true; | ||
return true; | ||
} | ||
catch (Exception ex) | ||
{ | ||
pDConnected = false; | ||
Exception = ex.ToString(); | ||
return false; | ||
} | ||
} | ||
|
||
public static bool SendPayload(string filename) | ||
{ | ||
_psocket.SendFile(filename); | ||
return true; | ||
} | ||
|
||
public static bool DisconnectPayload() | ||
{ | ||
pDConnected = false; | ||
_psocket.Close(); | ||
return true; | ||
} | ||
|
||
private void Form1_Load(object sender, EventArgs e) | ||
{ | ||
groupBox2.Enabled = false; | ||
groupBox3.Enabled = false; | ||
} | ||
|
||
public static string path; | ||
|
||
private void button2_Click(object sender, EventArgs e) | ||
{ | ||
openFileDialog1.ShowDialog(); | ||
path = openFileDialog1.FileName; | ||
button2.Text = path; | ||
groupBox2.Enabled = false; | ||
groupBox3.Enabled = true; | ||
} | ||
|
||
private void button3_Click(object sender, EventArgs e) | ||
{ | ||
try | ||
{ | ||
SendPayload(path); | ||
DisconnectPayload(); | ||
MessageBox.Show("Payload sent!"); | ||
} | ||
catch (Exception ex) | ||
{ | ||
MessageBox.Show("Error!\n"+ ex); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.