Skip to content

Commit a56d761

Browse files
committed
[v15.4] New PS3 features & updated downloads
- All changes can be found on the v15.4 release page
1 parent 6f39693 commit a56d761

32 files changed

+3674
-1894
lines changed

LatestBuild.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
15.3.1
1+
15.4.0
Lines changed: 87 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,122 @@
11
Imports System.IO
22
Imports System.Security.Cryptography
3+
Imports System.Text
34

45
Public Class AESEngine
56

67
Public Shared Function Encrypt(clearData As Byte(), Key As Byte(), IV As Byte(), cipherMode As CipherMode, paddingMode As PaddingMode) As Byte()
7-
Dim ms As New MemoryStream()
8-
Dim alg As Rijndael = Rijndael.Create()
9-
10-
alg.Mode = cipherMode
11-
alg.Padding = paddingMode
12-
alg.Key = Key
13-
alg.IV = IV
14-
15-
Dim cs As New CryptoStream(ms, alg.CreateEncryptor(), CryptoStreamMode.Write)
16-
cs.Write(clearData, 0, clearData.Length)
17-
cs.Close()
18-
19-
Dim encryptedData As Byte() = ms.ToArray()
20-
21-
Return encryptedData
8+
Using ms As New MemoryStream()
9+
Using alg As Aes = Aes.Create()
10+
alg.Mode = cipherMode
11+
alg.Padding = paddingMode
12+
alg.Key = Key
13+
alg.IV = IV
14+
15+
Using cs As New CryptoStream(ms, alg.CreateEncryptor(), CryptoStreamMode.Write)
16+
cs.Write(clearData, 0, clearData.Length)
17+
End Using
18+
End Using
19+
Return ms.ToArray()
20+
End Using
2221
End Function
2322

2423
Public Shared Function Encrypt(clearText As String, Password As String, cipherMode As CipherMode, paddingMode As PaddingMode) As String
25-
Dim clearBytes As Byte() = Text.Encoding.Unicode.GetBytes(clearText)
26-
Dim pdb As New PasswordDeriveBytes(Password, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76})
27-
Dim encryptedData As Byte() = Encrypt(clearBytes, pdb.GetBytes(32), pdb.GetBytes(16), cipherMode, paddingMode)
24+
Dim clearBytes As Byte() = Encoding.Unicode.GetBytes(clearText)
25+
Dim salt As Byte() = New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76}
26+
Dim pdb As New Rfc2898DeriveBytes(Password, salt, 10000, HashAlgorithmName.SHA256) ' New overload using SHA256
2827

28+
Dim encryptedData As Byte() = Encrypt(clearBytes, pdb.GetBytes(32), pdb.GetBytes(16), cipherMode, paddingMode)
2929
Return Convert.ToBase64String(encryptedData)
3030
End Function
3131

3232
Public Shared Function Encrypt(clearData As Byte(), Password As String, cipherMode As CipherMode, paddingMode As PaddingMode) As Byte()
33-
Dim pdb As New PasswordDeriveBytes(Password, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76})
33+
Dim salt As Byte() = New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76}
34+
Dim pdb As New Rfc2898DeriveBytes(Password, salt, 10000, HashAlgorithmName.SHA256)
3435
Return Encrypt(clearData, pdb.GetBytes(32), pdb.GetBytes(16), cipherMode, paddingMode)
3536
End Function
3637

3738
Public Shared Sub Encrypt(fileIn As String, fileOut As String, Password As String, cipherMode As CipherMode, paddingMode As PaddingMode)
38-
' First we are going to open the file streams
39-
Dim fsIn As New FileStream(fileIn, FileMode.Open, FileAccess.Read)
40-
Dim fsOut As New FileStream(fileOut, FileMode.OpenOrCreate, FileAccess.Write)
41-
42-
' Then we are going to derive a Key and an IV from the
43-
' Password and create an algorithm
44-
45-
Dim pdb As New PasswordDeriveBytes(Password, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, _
46-
&H65, &H64, &H76, &H65, &H64, &H65, _
47-
&H76})
48-
49-
Dim alg As Rijndael = Rijndael.Create()
50-
51-
alg.Mode = cipherMode
52-
alg.Padding = paddingMode
53-
alg.Key = pdb.GetBytes(32)
54-
alg.IV = pdb.GetBytes(16)
55-
56-
' Now create a crypto stream through which we are going
57-
' to be pumping data.
58-
' Our fileOut is going to be receiving the encrypted bytes.
59-
60-
Dim cs As New CryptoStream(fsOut, alg.CreateEncryptor(), CryptoStreamMode.Write)
61-
62-
' Now will will initialize a buffer and will be processing
63-
' the input file in chunks.
64-
' This is done to avoid reading the whole file (which can
65-
' be huge) into memory.
66-
67-
Dim bufferLen As Integer = 4096
68-
Dim buffer As Byte() = New Byte(bufferLen - 1) {}
69-
Dim bytesRead As Integer
70-
71-
Do
72-
' read a chunk of data from the input file
73-
bytesRead = fsIn.Read(buffer, 0, bufferLen)
74-
75-
' encrypt it
76-
cs.Write(buffer, 0, bytesRead)
77-
Loop While bytesRead <> 0
78-
79-
cs.Close()
80-
fsIn.Close()
39+
Dim salt As Byte() = New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76}
40+
Dim pdb As New Rfc2898DeriveBytes(Password, salt, 10000, HashAlgorithmName.SHA256)
41+
Using fsIn As New FileStream(fileIn, FileMode.Open, FileAccess.Read),
42+
fsOut As New FileStream(fileOut, FileMode.OpenOrCreate, FileAccess.Write)
43+
Using alg As Aes = Aes.Create()
44+
alg.Mode = cipherMode
45+
alg.Padding = paddingMode
46+
alg.Key = pdb.GetBytes(32)
47+
alg.IV = pdb.GetBytes(16)
48+
49+
Using cs As New CryptoStream(fsOut, alg.CreateEncryptor(), CryptoStreamMode.Write)
50+
Dim bufferLen As Integer = 4096
51+
Dim buffer As Byte() = New Byte(bufferLen - 1) {}
52+
Dim bytesRead As Integer
53+
54+
Do
55+
bytesRead = fsIn.Read(buffer, 0, bufferLen)
56+
If bytesRead > 0 Then
57+
cs.Write(buffer, 0, bytesRead)
58+
End If
59+
Loop While bytesRead <> 0
60+
End Using
61+
End Using
62+
End Using
8163
End Sub
8264

8365
Public Shared Function Decrypt(cipherData As Byte(), Key As Byte(), IV As Byte(), cipherMode As CipherMode, paddingMode As PaddingMode) As Byte()
84-
Dim ms As New MemoryStream()
85-
Dim alg As Rijndael = Rijndael.Create()
86-
87-
alg.Mode = cipherMode
88-
alg.Padding = paddingMode
89-
alg.Key = Key
90-
alg.IV = IV
91-
92-
Dim cs As New CryptoStream(ms, alg.CreateDecryptor(), CryptoStreamMode.Write)
93-
94-
cs.Write(cipherData, 0, cipherData.Length)
95-
cs.Close()
96-
97-
Dim decryptedData As Byte() = ms.ToArray()
98-
99-
Return decryptedData
66+
Using ms As New MemoryStream()
67+
Using alg As Aes = Aes.Create()
68+
alg.Mode = cipherMode
69+
alg.Padding = paddingMode
70+
alg.Key = Key
71+
alg.IV = IV
72+
73+
Using cs As New CryptoStream(ms, alg.CreateDecryptor(), CryptoStreamMode.Write)
74+
cs.Write(cipherData, 0, cipherData.Length)
75+
End Using
76+
End Using
77+
Return ms.ToArray()
78+
End Using
10079
End Function
10180

10281
Public Shared Function Decrypt(cipherText As String, Password As String, cipherMode As CipherMode, paddingMode As PaddingMode) As String
10382
Dim cipherBytes As Byte() = Convert.FromBase64String(cipherText)
104-
Dim pdb As New PasswordDeriveBytes(Password, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76})
83+
Dim salt As Byte() = New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76}
84+
Dim pdb As New Rfc2898DeriveBytes(Password, salt, 10000, HashAlgorithmName.SHA256)
10585
Dim decryptedData As Byte() = Decrypt(cipherBytes, pdb.GetBytes(32), pdb.GetBytes(16), cipherMode, paddingMode)
106-
107-
Return Text.Encoding.Unicode.GetString(decryptedData)
86+
Return Encoding.Unicode.GetString(decryptedData)
10887
End Function
10988

11089
Public Shared Function Decrypt(cipherData As Byte(), Password As String, cipherMode As CipherMode, paddingMode As PaddingMode) As Byte()
111-
Dim pdb As New PasswordDeriveBytes(Password, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76})
112-
90+
Dim salt As Byte() = New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76}
91+
Dim pdb As New Rfc2898DeriveBytes(Password, salt, 10000, HashAlgorithmName.SHA256)
11392
Return Decrypt(cipherData, pdb.GetBytes(32), pdb.GetBytes(16), cipherMode, paddingMode)
114-
11593
End Function
11694

11795
Public Shared Sub Decrypt(fileIn As String, fileOut As String, Password As String, cipherMode As CipherMode, paddingMode As PaddingMode)
118-
Dim fsIn As New FileStream(fileIn, FileMode.Open, FileAccess.Read)
119-
Dim fsOut As New FileStream(fileOut, FileMode.OpenOrCreate, FileAccess.Write)
120-
121-
Dim pdb As New PasswordDeriveBytes(Password, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76})
122-
Dim alg As Rijndael = Rijndael.Create()
123-
124-
alg.Mode = cipherMode
125-
alg.Padding = paddingMode
126-
alg.Key = pdb.GetBytes(32)
127-
alg.IV = pdb.GetBytes(16)
128-
129-
Dim cs As New CryptoStream(fsOut, alg.CreateDecryptor(), CryptoStreamMode.Write)
130-
Dim bufferLen As Integer = 4096
131-
Dim buffer As Byte() = New Byte(bufferLen - 1) {}
132-
Dim bytesRead As Integer
133-
134-
Do
135-
bytesRead = fsIn.Read(buffer, 0, bufferLen)
136-
137-
cs.Write(buffer, 0, bytesRead)
138-
Loop While bytesRead <> 0
139-
140-
cs.Close()
141-
fsIn.Close()
96+
Dim salt As Byte() = New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, &H65, &H64, &H76, &H65, &H64, &H65, &H76}
97+
Dim pdb As New Rfc2898DeriveBytes(Password, salt, 10000, HashAlgorithmName.SHA256)
98+
Using fsIn As New FileStream(fileIn, FileMode.Open, FileAccess.Read),
99+
fsOut As New FileStream(fileOut, FileMode.OpenOrCreate, FileAccess.Write)
100+
Using alg As Aes = Aes.Create()
101+
alg.Mode = cipherMode
102+
alg.Padding = paddingMode
103+
alg.Key = pdb.GetBytes(32)
104+
alg.IV = pdb.GetBytes(16)
105+
106+
Using cs As New CryptoStream(fsOut, alg.CreateDecryptor(), CryptoStreamMode.Write)
107+
Dim bufferLen As Integer = 4096
108+
Dim buffer As Byte() = New Byte(bufferLen - 1) {}
109+
Dim bytesRead As Integer
110+
111+
Do
112+
bytesRead = fsIn.Read(buffer, 0, bufferLen)
113+
If bytesRead > 0 Then
114+
cs.Write(buffer, 0, bytesRead)
115+
End If
116+
Loop While bytesRead <> 0
117+
End Using
118+
End Using
119+
End Using
142120
End Sub
143121

144-
End Class
122+
End Class

PS Multi Tools/Classes/MD5Hash.vb

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,25 @@ Imports System.Text
44

55
Public Class MD5Hash
66

7-
Public Shared Function MD5StringHash(Str As String) As String
8-
Dim Data As Byte()
9-
Dim Result As Byte()
10-
Dim Res As String = ""
11-
Dim Temp As String
12-
13-
Data = Encoding.ASCII.GetBytes(Str)
14-
Result = MD5.HashData(Data)
15-
16-
For i As Integer = 0 To Result.Length - 1
17-
Temp = Hex(Result(i))
18-
If Len(Temp) = 1 Then Temp = "0" & Temp
19-
Res += Temp
7+
Public Shared Function MD5StringHash(InputString As String) As String
8+
Dim data As Byte() = Encoding.ASCII.GetBytes(InputString)
9+
Dim hash As Byte() = MD5.HashData(data)
10+
Dim sb As New StringBuilder()
11+
For Each b As Byte In hash
12+
sb.Append(b.ToString("x2"))
2013
Next
21-
Return Res
14+
Return sb.ToString()
2215
End Function
2316

24-
Public Shared Function MD5FileHash(SelFile As String) As String
25-
Dim MD5 As New MD5CryptoServiceProvider
26-
Dim Hash As Byte()
27-
Dim Result As String = ""
28-
Dim Temp As String
29-
30-
Dim NewFileStream As New FileStream(SelFile, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
31-
MD5.ComputeHash(NewFileStream)
32-
NewFileStream.Close()
33-
34-
Hash = MD5.Hash
35-
For i As Integer = 0 To Hash.Length - 1
36-
Temp = Hex(Hash(i))
37-
If Len(Temp) = 1 Then Temp = "0" & Temp
38-
Result += Temp
39-
Next
40-
Return Result
17+
Public Shared Function MD5FileHash(InputFile As String) As String
18+
Using stream As New FileStream(InputFile, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
19+
Dim hash As Byte() = MD5.HashData(stream)
20+
Dim sb As New StringBuilder()
21+
For Each b As Byte In hash
22+
sb.Append(b.ToString("x2"))
23+
Next
24+
Return sb.ToString()
25+
End Using
4126
End Function
4227

4328
End Class

PS Multi Tools/Classes/PS3Game.vb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Public Class PS3Game
2727
Private _ImageWidth As Double
2828
Private _ImageHeight As Double
2929
Private _GameRootLocation As GameLocation
30+
Private _ISOEncryption As String
3031

3132
Public Enum GameFileTypes
3233
Backup
@@ -267,6 +268,15 @@ Public Class PS3Game
267268
End Set
268269
End Property
269270

271+
Public Property ISOEncryption As String
272+
Get
273+
Return _ISOEncryption
274+
End Get
275+
Set
276+
_ISOEncryption = Value
277+
End Set
278+
End Property
279+
270280
#Region "Functions"
271281

272282
Public Shared Function GetCategory(SFOCategory As String) As String

0 commit comments

Comments
 (0)