Skip to content

Commit

Permalink
Corrected ELF Header Check.
Browse files Browse the repository at this point in the history
Changed the ELF Header compare Routine to my own compare function in
case of MSs Equal routine throw fals positive on byte arrays. Additional
i patched a bug in my own compare routine.
  • Loading branch information
cfwprpht committed Feb 14, 2018
1 parent f651deb commit 5ad61a5
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 2 deletions.
Binary file modified .vs/free-ps2-pub-gen/v15/.suo
Binary file not shown.
Binary file modified .vs/free-ps2-pub-gen/v15/Server/sqlite3/storage.ide
Binary file not shown.
2 changes: 2 additions & 0 deletions ReadMe.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@
Removed the PS4 TitleID and replaced it with the PS2 TitleID to avoid conflicts with real TitleIDs.
THX to @littlebalup for letting me know.

Patched byte compare routine of the ELF Header Check to my own written one cause......"Equals()" function of MS is shit. :P

-Have Fun- cfwprpht
2 changes: 1 addition & 1 deletion free-ps2-pub-gen/Fakeps2pkggen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ private bool IsElfDecrypted() {
using (BinaryReader binReader = new BinaryReader(new FileStream(elf, FileMode.Open, FileAccess.Read))) {
byte[] fmagic = new byte[4];
binReader.Read(fmagic, 0, 4);
if (!magic.Equals(fmagic)) return false;
if (!magic.Contains(fmagic)) return false;
binReader.Close();
}
}
Expand Down
2 changes: 1 addition & 1 deletion free-ps2-pub-gen/SwissKnife.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public static bool Contains<T>(this T[] source, T value) {
public static bool Contains<T>(this T[] source, T[] range) {
if (source == null) throw new FormatException("Null Refernce", new Exception("The Array to check for a value existens is not Initialized."));
for (int i = 0; i < source.Length; i++) {
if (source[i].Equals(range[0])) {
if (source[i].Equals(range[i])) {
if ((source.Length - i) >= range.Length) {
int match = 1;
for (int j = 1; j < range.Length; j++) {
Expand Down
Binary file modified free-ps2-pub-gen/bin/Release/free-ps2-pub-gen.pdb
Binary file not shown.

0 comments on commit 5ad61a5

Please sign in to comment.