Skip to content

Commit

Permalink
first commit yeah
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazky committed Dec 8, 2023
1 parent 33efa5b commit 58fb498
Show file tree
Hide file tree
Showing 32 changed files with 1,702 additions and 0 deletions.
37 changes: 37 additions & 0 deletions PSXRF.sln
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34031.279
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "PSXRFD", "PSXRFD\PSXRFD.vbproj", "{398074AB-7871-4AD9-872F-BE56DD2E6D49}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "PSXRF", "PSXRF\PSXRF.vbproj", "{9457B5FC-914B-4854-94EA-733D06FBD972}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "rftest", "rftest\rftest.vbproj", "{A006C977-5441-4943-A72B-CFAC1AEEE87F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{398074AB-7871-4AD9-872F-BE56DD2E6D49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{398074AB-7871-4AD9-872F-BE56DD2E6D49}.Debug|Any CPU.Build.0 = Debug|Any CPU
{398074AB-7871-4AD9-872F-BE56DD2E6D49}.Release|Any CPU.ActiveCfg = Release|Any CPU
{398074AB-7871-4AD9-872F-BE56DD2E6D49}.Release|Any CPU.Build.0 = Release|Any CPU
{9457B5FC-914B-4854-94EA-733D06FBD972}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9457B5FC-914B-4854-94EA-733D06FBD972}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9457B5FC-914B-4854-94EA-733D06FBD972}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9457B5FC-914B-4854-94EA-733D06FBD972}.Release|Any CPU.Build.0 = Release|Any CPU
{A006C977-5441-4943-A72B-CFAC1AEEE87F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A006C977-5441-4943-A72B-CFAC1AEEE87F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A006C977-5441-4943-A72B-CFAC1AEEE87F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A006C977-5441-4943-A72B-CFAC1AEEE87F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {ED036679-2D53-4D63-BACE-F9447AEEB2CA}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions PSXRF/App.config
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
69 changes: 69 additions & 0 deletions PSXRF/Module1.vb
@@ -0,0 +1,69 @@
Imports System.IO
Imports System.Text.RegularExpressions

Module Module1
Sub Main()
If My.Application.CommandLineArgs.Count < 1 Then
Console.WriteLine("Usage: PSXRF <FilePath>")
Return
End If

Dim filePath As String = My.Application.CommandLineArgs(0)

Dim matchingString As String = IDFinder(filePath)

' Check if the console is empty
If Console.CursorLeft = 0 AndAlso Console.CursorTop = 0 Then
Console.WriteLine("No matching string found in the binary file.")
End If
End Sub

Function IDFinder(filePath As String) As String
Dim result As String = Nothing

Try
Dim pattern As String = "(SCUS|SLES|SLUS|SCPS|SCKA|SCED|SCEL|SCAS|SCAA|SCAJ|SLPS)-\d{5}"
Dim regex As New Regex(pattern)

Using fs As New FileStream(filePath, FileMode.Open, FileAccess.Read)
Dim buffer(4096) As Byte
Dim bytesRead As Integer
Dim totalBytesRead As Long = 0
Dim fileLength As Long = fs.Length
Dim remainingText As String = String.Empty

Do
bytesRead = fs.Read(buffer, 0, buffer.Length)
totalBytesRead += bytesRead

Dim text As String = remainingText & System.Text.Encoding.UTF8.GetString(buffer, 0, bytesRead)
remainingText = String.Empty

Dim matches As MatchCollection = regex.Matches(text)
If matches.Count > 0 Then
Dim lastIndex As Integer = matches(matches.Count - 1).Index + matches(matches.Count - 1).Length
remainingText = text.Substring(lastIndex)

For Each match As Match In matches
Dim matchValue As String = match.Value
If result Is Nothing Then
result = matchValue
Console.WriteLine($"Found: {result}")
End If
Next
End If

If result IsNot Nothing Then
Exit Do
End If

Loop While bytesRead > 0
End Using

Catch ex As Exception
Console.WriteLine("Error: " & ex.Message)
End Try

Return result
End Function
End Module
13 changes: 13 additions & 0 deletions PSXRF/My Project/Application.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions PSXRF/My Project/Application.myapp
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>2</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>
35 changes: 35 additions & 0 deletions PSXRF/My Project/AssemblyInfo.vb
@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices

' Les informations générales relatives à un assembly dépendent de
' l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
' associées à un assembly.

' Vérifiez les valeurs des attributs de l'assembly

<Assembly: AssemblyTitle("PSXRF")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("PSXRF")>
<Assembly: AssemblyCopyright("Copyright © 2023")>
<Assembly: AssemblyTrademark("")>

<Assembly: ComVisible(False)>

'Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
<Assembly: Guid("bd804e12-6d13-4d10-9ef3-38a27ac32fc9")>

' Les informations de version pour un assembly se composent des quatre valeurs suivantes :
'
' Version principale
' Version secondaire
' Numéro de build
' Révision
'
' Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
' en utilisant '*', comme indiqué ci-dessous :
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
63 changes: 63 additions & 0 deletions PSXRF/My Project/Resources.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

117 changes: 117 additions & 0 deletions PSXRF/My Project/Resources.resx
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

0 comments on commit 58fb498

Please sign in to comment.