Skip to content

Commit 331b338

Browse files
committed
Added support for integrating DeathRGH/frame4's PS4 debugger library into this program
1. The firmware versions supported by DeathRGH/frame4 are 5.05, 9.00, and 11.00. 2. Place the downloaded "Frame4.bin" file in the \Path\to\PS4CheaterNeo\payloads\ path. 3. When launching this program, select Frame4 as the PS4 debugger library type when executing SendPayload.
1 parent e23b866 commit 331b338

37 files changed

+4788
-52
lines changed

PS4CheaterNeo/Main.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2105,8 +2105,8 @@ public void CheatGridViewRowCountUpdate(bool virtualMode = true)
21052105
/// <returns>return whether the initialization was successful</returns>
21062106
public bool InitSections(string processName, bool force = false)
21072107
{
2108-
libdebug.ProcessMap pMap = null;
2109-
libdebug.ProcessInfo processInfo = PS4Tool.GetProcessInfo(processName);
2108+
ProcessMap pMap = null;
2109+
ProcessInfo processInfo = PS4Tool.GetProcessInfo(processName);
21102110

21112111
if (processInfo.pid == 0 || processInfo.name != processName)
21122112
{

PS4CheaterNeo/PS4CheaterNeo.csproj

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@
5858
<Reference Include="GroupGridView">
5959
<HintPath>lib\GroupGridView.dll</HintPath>
6060
</Reference>
61-
<Reference Include="libdebug">
62-
<HintPath>lib\libdebug.dll</HintPath>
63-
</Reference>
6461
<Reference Include="OptionTreeView">
6562
<HintPath>lib\OptionTreeView.dll</HintPath>
6663
</Reference>
@@ -93,7 +90,19 @@
9390
</Compile>
9491
<Compile Include="common\Constant.cs" />
9592
<Compile Include="common\LanguageJson.cs" />
96-
<Compile Include="common\PS4Tool.cs" />
93+
<Compile Include="common\ps4dbg\IPS4DBG.cs" />
94+
<Compile Include="common\ps4dbg\libdebug\PS4DBG.Console.cs" />
95+
<Compile Include="common\ps4dbg\libdebug\PS4DBG.cs" />
96+
<Compile Include="common\ps4dbg\libdebug\PS4DBG.Debug.cs" />
97+
<Compile Include="common\ps4dbg\libdebug\PS4DBG.Proc.cs" />
98+
<Compile Include="common\ps4dbg\libframe4\FRAME4.Console.cs" />
99+
<Compile Include="common\ps4dbg\libframe4\FRAME4.cs" />
100+
<Compile Include="common\ps4dbg\libframe4\FRAME4.Debug.cs" />
101+
<Compile Include="common\ps4dbg\libframe4\FRAME4.Kernel.cs" />
102+
<Compile Include="common\ps4dbg\libframe4\FRAME4.Proc.cs" />
103+
<Compile Include="common\ps4dbg\Process.cs" />
104+
<Compile Include="common\ps4dbg\Registers.cs" />
105+
<Compile Include="common\ps4dbg\PS4Tool.cs" />
97106
<Compile Include="common\BitsDictionary.cs" />
98107
<Compile Include="common\SectionTool.cs" />
99108
<Compile Include="common\Self.cs" />

PS4CheaterNeo/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.2.9")]
36-
[assembly: AssemblyFileVersion("1.0.2.9")]
35+
[assembly: AssemblyVersion("1.0.3.0")]
36+
[assembly: AssemblyFileVersion("1.0.3.0")]

PS4CheaterNeo/Properties/Settings.Designer.cs

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PS4CheaterNeo/Properties/Settings.settings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<Setting Name="PS4FWVersion" Type="OptionTreeView.Option&lt;string&gt;" Scope="User">
1212
<Value Profile="(Default)">|1_General|1_SendPayload|Enter PS4 FW Version (Confirm the fw version only when perform sendpayload)</Value>
1313
</Setting>
14+
<Setting Name="PS4DBGType" Type="OptionTreeView.Option&lt;PS4CheaterNeo.PS4DebugLibType&gt;" Scope="User">
15+
<Value Profile="(Default)">0|1_General|1_SendPayload|Decide the type of PS4 debugger library: the original ps4debug(and ps5) or DeathRGH/frame4, \nChanges may require a restart to take effect. \nDefault is ps4debug.</Value>
16+
</Setting>
1417
<Setting Name="UILanguage" Type="OptionTreeView.Option&lt;PS4CheaterNeo.LanguageCodes&gt;" Scope="User">
1518
<Value Profile="(Default)">0|1_General|2_UI|Determine the language displayed. Default english.</Value>
1619
</Setting>

PS4CheaterNeo/Query.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,10 @@ private void GetProcessesBtn_Click(object sender, EventArgs e)
313313
int selectedIdx = 0;
314314
string DefaultProcess = Properties.Settings.Default.DefaultProcess.Value;
315315
ProcessesBox.Items.Clear();
316-
libdebug.ProcessList procList = PS4Tool.GetProcessList();
316+
ProcessList procList = PS4Tool.GetProcessList();
317317
for (int pIdx = 0; pIdx < procList.processes.Length; pIdx++)
318318
{
319-
libdebug.Process process = procList.processes[pIdx];
319+
Process process = procList.processes[pIdx];
320320
int idx = ProcessesBox.Items.Add(new ComboItem(process.name, process.pid));
321321
if (process.name == DefaultProcess) selectedIdx = idx;
322322
}
@@ -1358,7 +1358,7 @@ private void RefreshBtn_Click(object sender, EventArgs e)
13581358
{
13591359
ComboItem process = (ComboItem)ProcessesBox.SelectedItem;
13601360
int pid = (int)process.Value;
1361-
libdebug.ProcessMap pMap = PS4Tool.GetProcessMaps(pid);
1361+
ProcessMap pMap = PS4Tool.GetProcessMaps(pid);
13621362
if (pMap.entries == null) return;
13631363
}
13641364

PS4CheaterNeo/SendPayload.Designer.cs

Lines changed: 20 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PS4CheaterNeo/SendPayload.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public SendPayload(Main mainForm)
1616
InitializeComponent();
1717
ApplyUI(mainForm.langJson);
1818
VersionComboBox.Items.AddRange(Constant.Versions);
19+
PS4DBGTypeComboBox.DataSource = Enum.GetValues(typeof(PS4DebugLibType));
20+
PS4DBGTypeComboBox.SelectedItem = Properties.Settings.Default.PS4DBGType.Value;
1921
}
2022

2123
public void ApplyUI(LanguageJson langJson)
@@ -102,10 +104,10 @@ private void SendPayloadBtn_Click(object sender, EventArgs e)
102104
string patchName = "ps5debug.elf";
103105
if (!File.Exists(patchPath + patchName))
104106
{
105-
patchName = "ps4debug.bin";
107+
patchName = ((PS4DebugLibType)PS4DBGTypeComboBox.SelectedItem).ToString() + ".bin"; // ps4debug.bin or Frame4.bin
106108
if (!File.Exists(patchPath + patchName)) patchPath = string.Format(@"{0}\payloads\{1}\", Application.StartupPath, VersionComboBox.SelectedItem);
107109
if (!File.Exists(patchPath + patchName)) throw new ArgumentException(string.Format("payload not found! ({0})\n" +
108-
"You must manually place the downloaded ps4debug.bin or ps5debug.elf in the folder \n\\Path\\to\\PS4CheaterNeo\\payloads\\", payloadsPath));
110+
"You must manually place the downloaded ps4debug.bin or ps5debug.elf or Frame4.bin in the folder \n\\Path\\to\\PS4CheaterNeo\\payloads\\", payloadsPath));
109111
}
110112
SendPayLoad(IpBox.Text, Convert.ToInt32(PortBox.Text), patchPath + patchName);
111113
Thread.Sleep(1000);
@@ -149,6 +151,7 @@ private void SendPayload_FormClosing(object sender, FormClosingEventArgs e)
149151
if ((VersionBox.Text ?? "") != "") Properties.Settings.Default.PS4FWVersion.Value = VersionBox.Text;
150152
if ((IpBox.Text ?? "") != "") Properties.Settings.Default.PS4IP.Value = IpBox.Text;
151153
if ((PortBox.Text ?? "") != "") Properties.Settings.Default.PS4Port.Value = Convert.ToUInt16(PortBox.Text);
154+
Properties.Settings.Default.PS4DBGType.Value = (PS4DebugLibType)PS4DBGTypeComboBox.SelectedItem;
152155
Properties.Settings.Default.Save();
153156
}
154157
catch (Exception ex)

PS4CheaterNeo/common/Constant.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
namespace PS4CheaterNeo
44
{
5+
public enum PS4DebugLibType
6+
{
7+
ps4debug,
8+
Frame4,
9+
}
510
public enum LanguageCodes
611
{
712
English,

PS4CheaterNeo/common/LanguageJson.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,9 @@ public partial class OptionForm
569569
[System.Runtime.Serialization.DataMemberAttribute()]
570570
public string PS4FWVersion;
571571

572+
[System.Runtime.Serialization.DataMemberAttribute()]
573+
public string PS4DBGType;
574+
572575
[System.Runtime.Serialization.DataMemberAttribute()]
573576
public string CollapsibleContainer;
574577

@@ -806,6 +809,9 @@ public partial class OptionForm
806809
[System.Runtime.Serialization.DataMemberAttribute()]
807810
public string description_PS4FWVersion;
808811

812+
[System.Runtime.Serialization.DataMemberAttribute()]
813+
public string description_PS4DBGType;
814+
809815
[System.Runtime.Serialization.DataMemberAttribute()]
810816
public string description_UILanguage;
811817

PS4CheaterNeo/common/ScanTool.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,12 +1028,12 @@ public static (string gameID, string gameVer) GameInfo(string FWVer)
10281028
string gameVer = null;
10291029
(string processName, string sectionName, uint sectionProt, ulong idOffset, ulong versionOffset) = SectionGameInfo(FWVer);
10301030

1031-
libdebug.ProcessMap pMap = PS4Tool.GetProcessMaps(processName);
1032-
if (pMap == null || pMap.entries == null || pMap.entries.Length == 0) throw new Exception(string.Format("{0}: Process({1}) Map is null.", processName, pMap.pid));
1031+
ProcessMap pMap = PS4Tool.GetProcessMaps(processName);
1032+
if (pMap == null || pMap.entries == null || pMap.entries.Length == 0) throw new Exception(string.Format("{0}: Process({1}) Map is null.", processName, pMap != null ? pMap.pid.ToString() : ""));
10331033

10341034
for (int eIdx = 0; eIdx < pMap.entries.Length; eIdx++)
10351035
{
1036-
libdebug.MemoryEntry entry = pMap.entries[eIdx];
1036+
MemoryEntry entry = pMap.entries[eIdx];
10371037
if ((entry.prot & 0x1) != 0x1) continue;
10381038
if (entry.name != sectionName && entry.name != sectionName + "[0]" || entry.prot != sectionProt) continue;
10391039
gameID = Encoding.Default.GetString(PS4Tool.ReadMemory(pMap.pid, entry.start + idOffset, 16));

PS4CheaterNeo/common/SectionTool.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public SectionTool(Main mainForm)
202202
/// 4. Start address is from small to large,
203203
/// 5. Finally, it is sorted by name
204204
/// </summary>
205-
private int CompareMemoryEntry(libdebug.MemoryEntry e1, libdebug.MemoryEntry e2)
205+
private int CompareMemoryEntry(MemoryEntry e1, MemoryEntry e2)
206206
{
207207
int result = 0;
208208
if (e1.name == "" || e2.name == "") result = e1.name.CompareTo(e2.name);
@@ -228,7 +228,7 @@ private int CompareMemoryEntry(libdebug.MemoryEntry e1, libdebug.MemoryEntry e2)
228228
/// <exception cref="Exception"></exception>
229229
public void InitSections(string processName)
230230
{
231-
libdebug.ProcessInfo processInfo = PS4Tool.GetProcessInfo(processName);
231+
ProcessInfo processInfo = PS4Tool.GetProcessInfo(processName);
232232

233233
if (processInfo.pid == 0) throw new Exception(string.Format("{0}: ProcessInfo is null.", processName));
234234

@@ -243,7 +243,7 @@ public void InitSections(string processName)
243243
/// <exception cref="Exception"></exception>
244244
public void InitSections(int processID, string processName)
245245
{
246-
libdebug.ProcessMap pMap = PS4Tool.GetProcessMaps(processID);
246+
ProcessMap pMap = PS4Tool.GetProcessMaps(processID);
247247

248248
if (pMap == null || pMap.entries == null || pMap.entries.Length == 0) throw new Exception(string.Format("{0}: Process({1}) Map is null.", processName, processID));
249249

@@ -255,11 +255,11 @@ public void InitSections(int processID, string processName)
255255
/// Retrieve all MemoryEntry objects from ProcessMap, calculate a unique ID (SID) for each,
256256
/// and then generate Section objects and store them in SectionDict.
257257
/// </summary>
258-
/// <param name="pMap">libdebug.ProcessMap</param>
258+
/// <param name="pMap">ProcessMap</param>
259259
/// <param name="processID">specified process id</param>
260260
/// <param name="processName">specified process name</param>
261261
/// <exception cref="Exception"></exception>
262-
public void InitSections(libdebug.ProcessMap pMap, int processID, string processName)
262+
public void InitSections(ProcessMap pMap, int processID, string processName)
263263
{
264264
if (pMap == null || pMap.entries == null || pMap.entries.Length == 0) throw new Exception(string.Format("{0}: Process({1}) Map is null.", processName, processID));
265265

@@ -278,11 +278,11 @@ public void InitSections(libdebug.ProcessMap pMap, int processID, string process
278278
(uint sIdx, uint ProtCnt) v1 = (0, 0);
279279
(uint sIdx, uint ProtCnt) v2 = (0, 0);
280280
(uint HighBits, uint TypeCode, uint Prot) tmp = (0, 0, 0);
281-
libdebug.MemoryEntry tmpEntry = null;
281+
MemoryEntry tmpEntry = null;
282282
Array.Sort(pMap.entries, CompareMemoryEntry); //Sort MemoryEntry in order to calculate SID
283283
for (int eIdx = 0; eIdx < pMap.entries.Length; eIdx++)
284284
{
285-
libdebug.MemoryEntry entry = pMap.entries[eIdx];
285+
MemoryEntry entry = pMap.entries[eIdx];
286286
if ((entry.prot & 0x1) != 0x1) continue;
287287
if (tmpEntry != null && tmpEntry.start == entry.start && tmpEntry.end == entry.end) continue;
288288
ulong start = entry.start;

0 commit comments

Comments
 (0)