├── sources GUI v1.XX
├── WAYLaunchers
│ ├── ApplicationEvents.vb
│ ├── WAYLaunchers.ico
│ ├── teensy_loader_cli.exe
│ ├── App.config
│ ├── My Project
│ │ ├── Settings.settings
│ │ ├── Application.myapp
│ │ ├── AssemblyInfo.vb
│ │ ├── Application.Designer.vb
│ │ ├── Resources.Designer.vb
│ │ ├── Settings.Designer.vb
│ │ └── Resources.resx
│ ├── Module1.vb
│ └── WAY-launchers.vbproj
├── IMG
│ ├── teensy.png
│ ├── teensy_light.gif
│ ├── playstation_4.png
│ └── playstation_3_fat.png
└── WAYLaunchers.sln
├── Releases
├── WAY-launchers v2.05.exe
├── Archives
│ ├── WAY-launchers v1.00.exe
│ ├── WAY-launchers v1.01.exe
│ ├── WAY-launchers v2.00.exe
│ ├── WAY-launchers v2.01.exe
│ ├── WAY-launchers v2.02.exe
│ ├── WAY-launchers v2.03.exe
│ ├── WAY-launchers v2.04.exe
│ └── Console launchers
│ │ ├── NANDway_launcher.exe
│ │ └── NORway_launcher.exe
└── Linux Mac Edition
│ ├── NORway_launcher.sh
│ └── NANDway_launcher.sh
├── sources GUI v2.XX
├── IMG
│ ├── teensy.png
│ ├── teensy_light.gif
│ ├── playstation_4.png
│ └── playstation_3_fat.png
├── WAYLaunchers
│ ├── COMMANDS.EXE
│ ├── WAYLaunchers.ico
│ ├── teensy_loader_cli.exe
│ ├── App.config
│ ├── My Project
│ │ ├── Settings.settings
│ │ ├── Application.myapp
│ │ ├── AssemblyInfo.vb
│ │ ├── Application.Designer.vb
│ │ ├── Resources.Designer.vb
│ │ ├── Settings.Designer.vb
│ │ └── Resources.resx
│ ├── WAY-Launchers.vbproj.user
│ ├── Utilities.vb
│ ├── WAY-launchers.vbproj
│ └── MainForm.vb
└── WAYLaunchers.sln
├── sources console version
├── choice.exe
├── language_FR.bat
├── NORway_launcher.ico
├── NANDway_launcher.ico
├── language_EN.bat
├── NANDway_launcher.bat
└── NORway_launcher.bat
├── NORway MOD
├── NORway_MOD.readme.txt
└── NORway.py
├── README.md
└── LICENCE
/sources GUI v1.XX/WAYLaunchers/ApplicationEvents.vb:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Releases/WAY-launchers v2.05.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/Releases/WAY-launchers v2.05.exe
--------------------------------------------------------------------------------
/sources GUI v1.XX/IMG/teensy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v1.XX/IMG/teensy.png
--------------------------------------------------------------------------------
/sources GUI v2.XX/IMG/teensy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v2.XX/IMG/teensy.png
--------------------------------------------------------------------------------
/sources console version/choice.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources console version/choice.exe
--------------------------------------------------------------------------------
/sources GUI v1.XX/IMG/teensy_light.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v1.XX/IMG/teensy_light.gif
--------------------------------------------------------------------------------
/sources GUI v2.XX/IMG/teensy_light.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v2.XX/IMG/teensy_light.gif
--------------------------------------------------------------------------------
/Releases/Archives/WAY-launchers v1.00.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/Releases/Archives/WAY-launchers v1.00.exe
--------------------------------------------------------------------------------
/Releases/Archives/WAY-launchers v1.01.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/Releases/Archives/WAY-launchers v1.01.exe
--------------------------------------------------------------------------------
/Releases/Archives/WAY-launchers v2.00.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/Releases/Archives/WAY-launchers v2.00.exe
--------------------------------------------------------------------------------
/Releases/Archives/WAY-launchers v2.01.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/Releases/Archives/WAY-launchers v2.01.exe
--------------------------------------------------------------------------------
/Releases/Archives/WAY-launchers v2.02.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/Releases/Archives/WAY-launchers v2.02.exe
--------------------------------------------------------------------------------
/Releases/Archives/WAY-launchers v2.03.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/Releases/Archives/WAY-launchers v2.03.exe
--------------------------------------------------------------------------------
/Releases/Archives/WAY-launchers v2.04.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/Releases/Archives/WAY-launchers v2.04.exe
--------------------------------------------------------------------------------
/sources GUI v1.XX/IMG/playstation_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v1.XX/IMG/playstation_4.png
--------------------------------------------------------------------------------
/sources GUI v2.XX/IMG/playstation_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v2.XX/IMG/playstation_4.png
--------------------------------------------------------------------------------
/sources console version/language_FR.bat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources console version/language_FR.bat
--------------------------------------------------------------------------------
/sources GUI v1.XX/IMG/playstation_3_fat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v1.XX/IMG/playstation_3_fat.png
--------------------------------------------------------------------------------
/sources GUI v2.XX/IMG/playstation_3_fat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v2.XX/IMG/playstation_3_fat.png
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/COMMANDS.EXE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v2.XX/WAYLaunchers/COMMANDS.EXE
--------------------------------------------------------------------------------
/sources console version/NORway_launcher.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources console version/NORway_launcher.ico
--------------------------------------------------------------------------------
/sources console version/NANDway_launcher.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources console version/NANDway_launcher.ico
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers/WAYLaunchers.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v1.XX/WAYLaunchers/WAYLaunchers.ico
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/WAYLaunchers.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v2.XX/WAYLaunchers/WAYLaunchers.ico
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers/teensy_loader_cli.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v1.XX/WAYLaunchers/teensy_loader_cli.exe
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/teensy_loader_cli.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/sources GUI v2.XX/WAYLaunchers/teensy_loader_cli.exe
--------------------------------------------------------------------------------
/Releases/Archives/Console launchers/NANDway_launcher.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/Releases/Archives/Console launchers/NANDway_launcher.exe
--------------------------------------------------------------------------------
/Releases/Archives/Console launchers/NORway_launcher.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/littlebalup/WAY-launchers/HEAD/Releases/Archives/Console launchers/NORway_launcher.exe
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/WAY-Launchers.vbproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | fr-FR
11 | false
12 |
13 |
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | MainForm
5 | false
6 | 0
7 | true
8 | 0
9 | true
10 |
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | MainForm
5 | false
6 | 0
7 | true
8 | 0
9 | true
10 |
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.21005.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WAY-launchers", "WAYLaunchers\WAY-launchers.vbproj", "{9FE1D88D-3D60-40D5-8FD8-D303C6924098}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {9FE1D88D-3D60-40D5-8FD8-D303C6924098}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {9FE1D88D-3D60-40D5-8FD8-D303C6924098}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {9FE1D88D-3D60-40D5-8FD8-D303C6924098}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {9FE1D88D-3D60-40D5-8FD8-D303C6924098}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.21005.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WAY-launchers", "WAYLaunchers\WAY-launchers.vbproj", "{9FE1D88D-3D60-40D5-8FD8-D303C6924098}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {9FE1D88D-3D60-40D5-8FD8-D303C6924098}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {9FE1D88D-3D60-40D5-8FD8-D303C6924098}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {9FE1D88D-3D60-40D5-8FD8-D303C6924098}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {9FE1D88D-3D60-40D5-8FD8-D303C6924098}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports System.Runtime.InteropServices
4 |
5 | ' Les informations générales relatives à un assembly dépendent de
6 | ' l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
7 | ' associées à un assembly.
8 |
9 | ' Passez en revue les valeurs des attributs de l'assembly
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 'Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
21 |
22 |
23 | ' Les informations de version pour un assembly se composent des quatre valeurs suivantes :
24 | '
25 | ' Version principale
26 | ' Version secondaire
27 | ' Numéro de build
28 | ' Révision
29 | '
30 | ' Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
31 | ' en utilisant '*', comme indiqué ci-dessous :
32 | '
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports System.Runtime.InteropServices
4 |
5 | ' Les informations générales relatives à un assembly dépendent de
6 | ' l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
7 | ' associées à un assembly.
8 |
9 | ' Passez en revue les valeurs des attributs de l'assembly
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 'Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
21 |
22 |
23 | ' Les informations de version pour un assembly se composent des quatre valeurs suivantes :
24 | '
25 | ' Version principale
26 | ' Version secondaire
27 | ' Numéro de build
28 | ' Révision
29 | '
30 | ' Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
31 | ' en utilisant '*', comme indiqué ci-dessous :
32 | '
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/NORway MOD/NORway_MOD.readme.txt:
--------------------------------------------------------------------------------
1 | NORway MOD by Littlebalup
2 | =========================
3 |
4 | ------------------------------------------------------------------------
5 | ATTENTION : The use of this program is at your own risk!
6 | The author can not be held responsible for the consequences of its use.
7 | ------------------------------------------------------------------------
8 |
9 | Forked from NORway.py (v0.7) by Judges and modified to write/verify only PerFirmware data
10 | without the need of an extra perfirmware template file. It will directly load the perfirmware
11 | data from your dump file (from offset 0x40000, length 0xE80000), then write/verify them to the NOR.
12 |
13 | Related thread about PerFirmware stuff :
14 | http://www.psx-place.com/forum/downgrading/trick-teensy-2-0-nor-flashing-norway-write-perfirmware-data-2476.html
15 |
16 |
17 | REQUIREMENTS, INSTALLATION & USAGE:
18 |
19 | - Same requirements as the original NORway v0.7 by Judges : https://github.com/hjudges/NORway
20 | - Extra PerFirmware write usage : add "perfw" argument to the end of your write/verify command line.
21 |
22 | Examples :
23 | NORway.py COM1 write d:\mydump.bin perfw
24 | NORway.py COM1 vwriteword d:\mydump.bin perfw
25 | NORway.py COM1 verify d:\mydump.bin perfw
26 |
27 | Run script without arguments to display the complete help screen.
28 |
29 |
30 | -------------------------------------------------------------------------
31 | CHANGE LOG:
32 |
33 | v0.7 MOD 0.1 : First MOD release
34 |
35 | -------------------------------------------------------------------------
36 |
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers/Module1.vb:
--------------------------------------------------------------------------------
1 | Imports System.Reflection
2 | Imports System.IO
3 |
4 | Module Module1
5 | Public Sub SaveToDisk(ByVal resourceName As String, ByVal fileName As String)
6 | ' Get a reference to the running application.
7 | Dim assy As [Assembly] = [Assembly].GetExecutingAssembly()
8 |
9 | ' Loop through each resource, looking for the image name (case-insensitive).
10 | For Each resource As String In assy.GetManifestResourceNames()
11 | If resource.ToLower().IndexOf(resourceName.ToLower) <> -1 Then
12 | ' Get the embedded file from the assembly as a MemoryStream.
13 | Using resourceStream As System.IO.Stream = assy.GetManifestResourceStream(resource)
14 | If resourceStream IsNot Nothing Then
15 | Using reader As New BinaryReader(resourceStream)
16 | ' Read the bytes from the input stream.
17 | Dim buffer() As Byte = reader.ReadBytes(CInt(resourceStream.Length))
18 | Using outputStream As New FileStream(fileName, FileMode.Create)
19 | Using writer As New BinaryWriter(outputStream)
20 | ' Write the bytes to the output stream.
21 | writer.Write(buffer)
22 | End Using
23 | End Using
24 | End Using
25 | End If
26 | End Using
27 | Exit For
28 | End If
29 | Next resource
30 | End Sub
31 | End Module
32 |
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' Ce code a été généré par un outil.
4 | ' Version du runtime :4.0.30319.18444
5 | '
6 | ' Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | ' le code est régénéré.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | 'REMARQUE : ce fichier étant généré automatiquement, ne le modifiez pas directement. Pour apporter des modifications,
18 | ' ou si vous rencontrez des erreurs de build dans ce fichier, accédez au Concepteur de projets
19 | ' (allez dans les propriétés du projet ou double-cliquez sur le noeud My project dans
20 | ' l'Explorateur de solutions), puis apportez vos modifications sous l'onglet Application.
21 | '
22 | Partial Friend Class MyApplication
23 |
24 | _
25 | Public Sub New()
26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
27 | Me.IsSingleInstance = false
28 | Me.EnableVisualStyles = true
29 | Me.SaveMySettingsOnExit = true
30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
31 | End Sub
32 |
33 | _
34 | Protected Overrides Sub OnCreateMainForm()
35 | Me.MainForm = Global.WAYLaunchers.MainForm
36 | End Sub
37 | End Class
38 | End Namespace
39 |
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' Ce code a été généré par un outil.
4 | ' Version du runtime :4.0.30319.18444
5 | '
6 | ' Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | ' le code est régénéré.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | 'REMARQUE : ce fichier étant généré automatiquement, ne le modifiez pas directement. Pour apporter des modifications,
18 | ' ou si vous rencontrez des erreurs de build dans ce fichier, accédez au Concepteur de projets
19 | ' (allez dans les propriétés du projet ou double-cliquez sur le noeud My project dans
20 | ' l'Explorateur de solutions), puis apportez vos modifications sous l'onglet Application.
21 | '
22 | Partial Friend Class MyApplication
23 |
24 | _
25 | Public Sub New()
26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
27 | Me.IsSingleInstance = false
28 | Me.EnableVisualStyles = true
29 | Me.SaveMySettingsOnExit = true
30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
31 | End Sub
32 |
33 | _
34 | Protected Overrides Sub OnCreateMainForm()
35 | Me.MainForm = Global.WAYLaunchers.MainForm
36 | End Sub
37 | End Class
38 | End Namespace
39 |
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' Ce code a été généré par un outil.
4 | ' Version du runtime :4.0.30319.18444
5 | '
6 | ' Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | ' le code est régénéré.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | 'Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
19 | 'à l'aide d'un outil, tel que ResGen ou Visual Studio.
20 | 'Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
21 | 'avec l'option /str ou régénérez votre projet VS.
22 | '''
23 | ''' Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WAYLaunchers.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' Remplace la propriété CurrentUICulture du thread actuel pour toutes
51 | ''' les recherches de ressources à l'aide de cette classe de ressource fortement typée.
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 | End Module
63 | End Namespace
64 |
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' Ce code a été généré par un outil.
4 | ' Version du runtime :4.0.30319.18444
5 | '
6 | ' Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | ' le code est régénéré.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | 'Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
19 | 'à l'aide d'un outil, tel que ResGen ou Visual Studio.
20 | 'Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
21 | 'avec l'option /str ou régénérez votre projet VS.
22 | '''
23 | ''' Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WAYLaunchers.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' Remplace la propriété CurrentUICulture du thread actuel pour toutes
51 | ''' les recherches de ressources à l'aide de cette classe de ressource fortement typée.
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 | End Module
63 | End Namespace
64 |
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' Ce code a été généré par un outil.
4 | ' Version du runtime :4.0.30319.18444
5 | '
6 | ' Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | ' le code est régénéré.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | _
20 | Partial Friend NotInheritable Class MySettings
21 | Inherits Global.System.Configuration.ApplicationSettingsBase
22 |
23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
24 |
25 | #Region "Fonctionnalité Enregistrement automatique My.Settings"
26 | #If _MyType = "WindowsForms" Then
27 | Private Shared addedHandler As Boolean
28 |
29 | Private Shared addedHandlerLockObject As New Object
30 |
31 | _
32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
33 | If My.Application.SaveMySettingsOnExit Then
34 | My.Settings.Save()
35 | End If
36 | End Sub
37 | #End If
38 | #End Region
39 |
40 | Public Shared ReadOnly Property [Default]() As MySettings
41 | Get
42 |
43 | #If _MyType = "WindowsForms" Then
44 | If Not addedHandler Then
45 | SyncLock addedHandlerLockObject
46 | If Not addedHandler Then
47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
48 | addedHandler = True
49 | End If
50 | End SyncLock
51 | End If
52 | #End If
53 | Return defaultInstance
54 | End Get
55 | End Property
56 | End Class
57 | End Namespace
58 |
59 | Namespace My
60 |
61 | _
64 | Friend Module MySettingsProperty
65 |
66 | _
67 | Friend ReadOnly Property Settings() As Global.WAYLaunchers.My.MySettings
68 | Get
69 | Return Global.WAYLaunchers.My.MySettings.Default
70 | End Get
71 | End Property
72 | End Module
73 | End Namespace
74 |
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' Ce code a été généré par un outil.
4 | ' Version du runtime :4.0.30319.18444
5 | '
6 | ' Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | ' le code est régénéré.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | _
20 | Partial Friend NotInheritable Class MySettings
21 | Inherits Global.System.Configuration.ApplicationSettingsBase
22 |
23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
24 |
25 | #Region "Fonctionnalité Enregistrement automatique My.Settings"
26 | #If _MyType = "WindowsForms" Then
27 | Private Shared addedHandler As Boolean
28 |
29 | Private Shared addedHandlerLockObject As New Object
30 |
31 | _
32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
33 | If My.Application.SaveMySettingsOnExit Then
34 | My.Settings.Save()
35 | End If
36 | End Sub
37 | #End If
38 | #End Region
39 |
40 | Public Shared ReadOnly Property [Default]() As MySettings
41 | Get
42 |
43 | #If _MyType = "WindowsForms" Then
44 | If Not addedHandler Then
45 | SyncLock addedHandlerLockObject
46 | If Not addedHandler Then
47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
48 | addedHandler = True
49 | End If
50 | End SyncLock
51 | End If
52 | #End If
53 | Return defaultInstance
54 | End Get
55 | End Property
56 | End Class
57 | End Namespace
58 |
59 | Namespace My
60 |
61 | _
64 | Friend Module MySettingsProperty
65 |
66 | _
67 | Friend ReadOnly Property Settings() As Global.WAYLaunchers.My.MySettings
68 | Get
69 | Return Global.WAYLaunchers.My.MySettings.Default
70 | End Get
71 | End Property
72 | End Module
73 | End Namespace
74 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | WAY-launchers
2 | =============
3 |
4 | New GUI for NORway, NANDway and SPIway from Judges (https://github.com/hjudges/NORway)
5 |
6 | ------------------------------------------------------------------------
7 | ATTENTION : The use of this program is at your own risk!
8 | The author can not be held responsible for the consequences of its use.
9 |
10 | ------------------------------------------------------------------------
11 |
12 | Simple GUI, written in VB.net and batch, to easily launch and work with the
13 | well known NORway, NANDway and SPIway python scripts by Judges for PS3 and PS4
14 | hardware flashing using Teensy++ 2.0.
15 |
16 | ADDITIONAL FEATURES:
17 | - Teensy COM port auto-detection
18 | - Teensy programming (load .hex file by clicking on teensy picture)
19 | - Multiple dumps (you can define a quantity of dumps to perform)
20 | - Binary dumps comparison (if multi-dumps) with log file.
21 | - Options to write or verify "Per Firmware" data only on NOR.
22 | Require my modded NORway.py script. See Installation Instructions for more details.
23 |
24 | SYSTEM REQUIREMENTS:
25 | - Windows XP Professional SP3 + ".NET Framework 3.5 SP1"
26 | (http://www.microsoft.com/en-US/download/details.aspx?id=22)
27 | - Windows Vista SP2 + ".NET Framework 3.5 SP1"
28 | - Windows 7 SP1 (no need to install framework 3.5 as it is embedded)
29 | - Windows 8, 8.1 or 10 with ".NET Framework 3.5" enabled
30 | (http://msdn.microsoft.com/en-US/en-en/library/hh506443%28v=vs.110%29.aspx)
31 |
32 | INSTALLATION INSTRUCTIONS:
33 | - Install python, pyserial, Teensy drivers, scripts... per Judges's instructions
34 | (https://github.com/hjudges/NORway)
35 | - Simply paste the "WAY-launchers.exe" file into the same directory as
36 | NORway.py / NANDway.py / SPIway.py.
37 | - [optional] to enable the NOR options "write/verify PerFirmware data only", replace
38 | the NORway.py file by my modified one available at https://github.com/littlebalup/WAY-launchers/tree/master/NORway%20MOD
39 | - Execute
40 |
41 | -------------------------------------------------------------------------
42 | CHANGE LOG:
43 |
44 | v2.05: - Fixed COM port auto-detection error on Windows 10 due to USB Serial generic drivers.
45 | Now detection is done by searching VID/PID/SERIAL of the device instead of the driver name.
46 | Result is the detection is more efficient, delay is slightly reduced and it is fully driver version independent.
47 | - Fixed bug killing all cmd prompts at closure.
48 |
49 | v2.04: Added extra options to write/verify "Per Firmware" data only on NOR. Those Options require my
50 | modded NORway.py script to be enabled. See Installation Instructions for more details.
51 |
52 | v2.03: Correction of a minor bug concerning errorlevel detection from python scripts.
53 |
54 | v2.02: Added compatibility with the latest USB serial drivers from PRJC:
55 | "Teensy USB Serial" driver now detected as well as the old one.
56 |
57 | v2.01: Bug correction about Multi-dumps and binary checks. (Thanks to Joris 73 from LS)
58 |
59 | v2.00: Removed embedded console due to problems with scripts output redirection.
60 | Now scripts launched in a separate regular console prompt window.
61 | "Save screen" and "Kill process" buttons removed as well. Instead, you can
62 | copy from console to save screen and use Ctrl+C to kill process if needed.
63 |
64 | v1.01: Added Teensy programming feature: can load .hex file by clicking on the teensy picture.
65 | Dump file extension changed: was (*.x.bin), now is (*.bin) if only one dump and (*_x.bin) if multi-dumps.
66 |
67 | v1.00: First release
68 |
69 | -------------------------------------------------------------------------
70 |
71 | Source code available at https://github.com/littlebalup/WAY-launchers
72 |
73 | Thanks to "Judges" for all his work.
74 | Thanks to "Swizzy" for the original idea (ref to WAYgui project : https://github.com/Swizzy/WAYGui)
75 |
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/Utilities.vb:
--------------------------------------------------------------------------------
1 | Imports System.Reflection
2 | Imports System.IO
3 |
4 | Module Utilities
5 | Public Sub SaveToDisk(ByVal resourceName As String, ByVal fileName As String)
6 | ' Get a reference to the running application.
7 | Dim assy As [Assembly] = [Assembly].GetExecutingAssembly()
8 |
9 | ' Loop through each resource, looking for the image name (case-insensitive).
10 | For Each resource As String In assy.GetManifestResourceNames()
11 | If resource.ToLower().IndexOf(resourceName.ToLower) <> -1 Then
12 | ' Get the embedded file from the assembly as a MemoryStream.
13 | Using resourceStream As System.IO.Stream = assy.GetManifestResourceStream(resource)
14 | If resourceStream IsNot Nothing Then
15 | Using reader As New BinaryReader(resourceStream)
16 | ' Read the bytes from the input stream.
17 | Dim buffer() As Byte = reader.ReadBytes(CInt(resourceStream.Length))
18 | Using outputStream As New FileStream(fileName, FileMode.Create)
19 | Using writer As New BinaryWriter(outputStream)
20 | ' Write the bytes to the output stream.
21 | writer.Write(buffer)
22 | End Using
23 | End Using
24 | End Using
25 | End If
26 | End Using
27 | Exit For
28 | End If
29 | Next resource
30 | End Sub
31 |
32 | Public Sub RunCommandCom(command As String, arguments As String)
33 | Dim p As Process = New Process()
34 | Dim pi As ProcessStartInfo = New ProcessStartInfo()
35 | pi.Arguments = arguments
36 | pi.FileName = command
37 | p.StartInfo = pi
38 | p.Start()
39 |
40 | MainForm.TabCommandsNOR.Enabled = False
41 | MainForm.TabCommandsNAND.Enabled = False
42 | MainForm.TabCommandsSPI.Enabled = False
43 | MainForm.StartNORinfoButton.Text = "WAIT..."
44 | MainForm.StartNORdumpButton.Text = "WAIT..."
45 | MainForm.StartNORwriteButton.Text = "WAIT..."
46 | MainForm.StartNORverifyButton.Text = "WAIT..."
47 | MainForm.StartNORreleaseButton.Text = "WAIT..."
48 | MainForm.StartNORerasechipButton.Text = "WAIT..."
49 | MainForm.StartNANDinfoButton.Text = "WAIT..."
50 | MainForm.StartNANDdumpButton.Text = "WAIT..."
51 | MainForm.StartNANDwriteButton.Text = "WAIT..."
52 | MainForm.StartNANDbbButton.Text = "WAIT..."
53 | MainForm.StartSPIinfoButton.Text = "WAIT..."
54 | MainForm.StartSPIdumpButton.Text = "WAIT..."
55 | MainForm.StartSPIwriteButton.Text = "WAIT..."
56 | MainForm.StartSPIerasechipButton.Text = "WAIT..."
57 |
58 | Do While Not p.HasExited
59 | Loop
60 |
61 | MainForm.TabCommandsNOR.Enabled = True
62 | MainForm.TabCommandsNAND.Enabled = True
63 | MainForm.TabCommandsSPI.Enabled = True
64 | MainForm.TeensyBlinkNOR.Visible = False
65 | MainForm.TeensyBlinkNAND.Visible = False
66 | MainForm.TeensyBlinkSPI.Visible = False
67 | MainForm.StartNORinfoButton.Text = "START"
68 | MainForm.StartNORdumpButton.Text = "START"
69 | MainForm.StartNORwriteButton.Text = "START"
70 | MainForm.StartNORverifyButton.Text = "START"
71 | MainForm.StartNORreleaseButton.Text = "START"
72 | MainForm.StartNORerasechipButton.Text = "START"
73 | MainForm.StartNANDinfoButton.Text = "START"
74 | MainForm.StartNANDdumpButton.Text = "START"
75 | MainForm.StartNANDwriteButton.Text = "START"
76 | MainForm.StartNANDbbButton.Text = "START"
77 | MainForm.StartSPIinfoButton.Text = "START"
78 | MainForm.StartSPIdumpButton.Text = "START"
79 | MainForm.StartSPIwriteButton.Text = "START"
80 | MainForm.StartSPIerasechipButton.Text = "START"
81 |
82 | End Sub
83 | End Module
84 |
--------------------------------------------------------------------------------
/sources console version/language_EN.bat:
--------------------------------------------------------------------------------
1 | rem intro
2 | @set "TXT_intro_line1= For the execution of NORway by Judges (www.github.com/hjudges/NORway)."
3 | @set "TXT_intro_line2= Installation Note:"
4 | @set "TXT_intro_line3= - Place this program into the same folder as NORway.py file"
5 | @set "TXT_intro_line4= - Execute"
6 |
7 |
8 | rem disclaimer
9 | @set "TXT_disclaimer_line1= ATTENTION : The use of this program is at your own risk."
10 | @set "TXT_disclaimer_line2= The author can not be held responsible for the consequences of its use."
11 |
12 |
13 | rem commands
14 | @set "TXT_cmd_tittle=Commands:"
15 |
16 | @set "TXT_cmd_INFO=INFO (set tristate, display NOR information)"
17 | @set "TXT_cmd_DUMP=DUMP (dump NOR content)"
18 | @set "TXT_cmd_WRITE=WRITE (flash NOR, buffered programming mode)"
19 | @set "TXT_cmd_VWRITE=VWRITE (flash and verify NOR, buffered programming mode)"
20 | @set "TXT_cmd_WRITEWORD=WRITEWORD (flash NOR, word programming mode)"
21 | @set "TXT_cmd_VWRITEWORD=VWRITEWORD (flash and verify NOR, word programming mode)"
22 | @set "TXT_cmd_WRITEWORDUBM=WRITEWORDUBM (flash NOR, word programming/unlock bypass mode)"
23 | @set "TXT_cmd_VWRITEWORDUBM=VWRITEWORDUBM (flash and verify NOR, word programming/unlock bypass mode)"
24 | @set "TXT_cmd_VERIFY=VERIFY (verify NOR content compared to a dump file)"
25 | @set "TXT_cmd_ERASECHIP=ERASECHIP (erase entire NOR content)"
26 | @set "TXT_cmd_RELEASE=RELEASE (release tristate, so the PS3 can boot)"
27 | @set "TXT_cmd_quit=Quit"
28 |
29 | @set "TXT_cmd_choose=Select a command"
30 |
31 | @set "TXT_cmd_validate1=Start command"
32 | @set "TXT_cmd_validate2=with those settings"
33 |
34 |
35 | rem choice YES or NO
36 | @set "TXT_choiceYN=YN"
37 |
38 |
39 | rem teensy
40 | @set "TXT_teensy_detect=Teensy found on port"
41 | @set "TXT_teensyerror_line1=Error : Teensy not found."
42 | @set "TXT_teensyerror_line2=Command aborted."
43 |
44 |
45 | rem dump
46 | @set "TXT_dump_nbr=Dump quantity"
47 | @set "TXT_dump_name=Dump(s) name (ex: "mydump")"
48 | @set "TXT_dump_saveas=Dump(s) will be saved as"
49 | @set "TXT_dump_savedas=Dump saved as"
50 |
51 | @set "TXT_dump_startcomp=Launch binary comparison of dumps"
52 | @set "TXT_dump_compWait=Please wait..."
53 | @set "TXT_dump_compSame=same as"
54 | @set "TXT_dump_compDiff=different from"
55 | @set "TXT_dump_compOK=Dumps are identical. Details in file compare_log.txt."
56 | @set "TXT_dump_compNOK=Attention : one or more dumps are different. Details in file compare_log.txt."
57 | @set "TXT_dump_compERROR=Error : one or more files not found."
58 |
59 |
60 | rem write
61 | @set "TXT_seefiles=Files available in"
62 | @set "TXT_write_with=Write NOR with file (ex: "mydump.bin")"
63 | @set "TXT_willwrite_with=NOR will be written with file"
64 |
65 |
66 | rem verify
67 | @set "TXT_verify_with=Verify with file (ex: "mydump.bin")"
68 | @set "TXT_willverify_with=NOR content will be verified in comparison to file"
69 |
70 |
71 | rem error
72 | @set "TXT_error=An error occurred. Verify your installation."
73 |
74 | @set "TXT_error_nofile1=Error : File"
75 | @set "TXT_error_nofile2=not found."
76 |
77 | @set "TXT_error_sizefile1=Error : Size of"
78 | @set "TXT_error_sizefile2=is"
79 | @set "TXT_error_sizefile3=Bytes."
80 | @set "TXT_error_sizefile4=Should be 16777216 Bytes (16384 KB)."
81 |
82 | @set "TXT_restart=Try again"
83 |
84 |
85 | rem warning
86 | @set "TXT_warningversion_line1= ---- ATTENTION ----"
87 | @set "TXT_warningversion_line2= This program needs Windows XP(pro)/Vista/7/8."
88 | @set "TXT_warningversion_line3= It is incompatible with your system."
89 | @set "TXT_warningversion_line4= Program will close."
90 | @set "TXT_warningversion_line5= -------------------"
91 |
92 | @set "TXT_warningfiles_line1= ---- ATTENTION ----"
93 | @set "TXT_warningfiles_line2= NORway.py file not found."
94 | @set "TXT_warningfiles_line3= Program will close."
95 | @set "TXT_warningfiles_line4= -------------------"
96 |
97 |
98 |
99 | rem ******************************** specific NANDway *********************************
100 |
101 | rem intro
102 | @set "TXT_NANDintro_line1= For the execution of NANDway (SBE) by Judges (www.github.com/hjudges/NORway)."
103 | @set "TXT_NANDintro_line3= - Place this program into the same folder as NANDway.py file"
104 |
105 | rem commands
106 | @set "TXT_NANDcmd_INFO=INFO (display NAND information)"
107 | @set "TXT_NANDcmd_DUMP=DUMP (dump NAND content)"
108 | @set "TXT_NANDcmd_WRITE=WRITE (flash NAND)"
109 | @set "TXT_NANDcmd_VWRITE=VWRITE (flash and verify NAND)"
110 | @set "TXT_NANDcmd_DIFFWRITE=DIFFWRITE (differential flash NAND)"
111 | @set "TXT_NANDcmd_VDIFFWRITE=VDIFFWRITE (differential flash and verify NAND)"
112 | @set "TXT_NANDcmd_PS3BADBLOCKS=PS3BADBLOCKS (identify bad blocks in a NAND dump file)"
113 |
114 | rem write
115 | @set "TXT_NANDdiff_with=Differential flash file (ex: "DifferenceFileFlash.txt")"
116 | @set "TXT_NANDwillwrite_with=NAND will be written with file"
117 | @set "TXT_NANDwilldiff_with=differentially using file"
118 |
119 | rem badblocks
120 | @set "TXT_NANDbb_with=Identify bad blocks in file (ex: "mydump.bin")"
121 |
122 | rem error
123 | @set "TXT_NANDerror_sizefile4=Should be 138412032 Bytes (135168 KB)."
124 |
125 | rem warning
126 | @set "TXT_NANDwarningfiles_line2= NANDway.py file not found."
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers/My Project/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/My Project/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/WAY-launchers.vbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {9FE1D88D-3D60-40D5-8FD8-D303C6924098}
8 | WinExe
9 | WAYLaunchers.My.MyApplication
10 | WAYLaunchers
11 | WAY-launchers
12 | 512
13 | WindowsForms
14 | v3.5
15 | publier\
16 | true
17 | Disk
18 | false
19 | Foreground
20 | 7
21 | Days
22 | false
23 | false
24 | true
25 | 0
26 | 1.0.0.%2a
27 | false
28 | false
29 | true
30 |
31 |
32 |
33 | AnyCPU
34 | true
35 | full
36 | true
37 | true
38 | bin\Debug\
39 | WAY-launchers.xml
40 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
41 | false
42 |
43 |
44 | AnyCPU
45 | pdbonly
46 | false
47 | true
48 | true
49 | bin\Release\
50 | WAY-launchers.xml
51 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
52 | false
53 |
54 |
55 | On
56 |
57 |
58 | Binary
59 |
60 |
61 | Off
62 |
63 |
64 | On
65 |
66 |
67 | WAYLaunchers.ico
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 | Form
96 |
97 |
98 | MainForm.vb
99 | Form
100 |
101 |
102 |
103 |
104 | True
105 | Application.myapp
106 |
107 |
108 | True
109 | True
110 | Resources.resx
111 |
112 |
113 | True
114 | Settings.settings
115 | True
116 |
117 |
118 |
119 |
120 | MainForm.vb
121 |
122 |
123 | VbMyResourcesResXFileCodeGenerator
124 | Resources.Designer.vb
125 | My.Resources
126 | Designer
127 |
128 |
129 |
130 |
131 | MyApplicationCodeGenerator
132 | Application.Designer.vb
133 |
134 |
135 | SettingsSingleFileGenerator
136 | My
137 | Settings.Designer.vb
138 |
139 |
140 |
141 |
142 |
143 | False
144 | Microsoft .NET Framework 4.5 %28x86 et x64%29
145 | true
146 |
147 |
148 | False
149 | .NET Framework 3.5 SP1 Client Profile
150 | false
151 |
152 |
153 | False
154 | .NET Framework 3.5 SP1
155 | false
156 |
157 |
158 |
159 |
160 | Always
161 |
162 |
163 | Always
164 |
165 |
166 |
167 |
168 |
175 |
--------------------------------------------------------------------------------
/sources GUI v1.XX/WAYLaunchers/WAY-launchers.vbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {9FE1D88D-3D60-40D5-8FD8-D303C6924098}
8 | WinExe
9 | WAYLaunchers.My.MyApplication
10 | WAYLaunchers
11 | WAY-launchers
12 | 512
13 | WindowsForms
14 | v3.5
15 | publier\
16 | true
17 | Disk
18 | false
19 | Foreground
20 | 7
21 | Days
22 | false
23 | false
24 | true
25 | 0
26 | 1.0.0.%2a
27 | false
28 | false
29 | true
30 |
31 |
32 |
33 | AnyCPU
34 | true
35 | full
36 | true
37 | true
38 | bin\Debug\
39 | WAY-launchers.xml
40 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
41 | false
42 |
43 |
44 | AnyCPU
45 | pdbonly
46 | false
47 | true
48 | true
49 | bin\Release\
50 | WAY-launchers.xml
51 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
52 | false
53 |
54 |
55 | On
56 |
57 |
58 | Binary
59 |
60 |
61 | Off
62 |
63 |
64 | On
65 |
66 |
67 | WAYLaunchers.ico
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | Form
97 |
98 |
99 | MainForm.vb
100 | Form
101 |
102 |
103 |
104 |
105 | True
106 | Application.myapp
107 |
108 |
109 | True
110 | True
111 | Resources.resx
112 |
113 |
114 | True
115 | Settings.settings
116 | True
117 |
118 |
119 |
120 |
121 | MainForm.vb
122 |
123 |
124 | VbMyResourcesResXFileCodeGenerator
125 | Resources.Designer.vb
126 | My.Resources
127 | Designer
128 |
129 |
130 |
131 |
132 | Always
133 |
134 |
135 | MyApplicationCodeGenerator
136 | Application.Designer.vb
137 |
138 |
139 | SettingsSingleFileGenerator
140 | My
141 | Settings.Designer.vb
142 |
143 |
144 |
145 |
146 |
147 | False
148 | Microsoft .NET Framework 4.5 %28x86 et x64%29
149 | true
150 |
151 |
152 | False
153 | .NET Framework 3.5 SP1 Client Profile
154 | false
155 |
156 |
157 | False
158 | .NET Framework 3.5 SP1
159 | false
160 |
161 |
162 |
163 |
164 | Always
165 |
166 |
167 |
168 |
169 |
176 |
--------------------------------------------------------------------------------
/Releases/Linux Mac Edition/NORway_launcher.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # default serial port : (to find your teensy serial port, plug or unplug-replug it, then run "dmesg" command. Last lines should give you your ttyACM* port)
4 | default_teensy_port="/dev/ttyACM0"
5 |
6 | build_version="v1.02"
7 |
8 | script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
9 | cd "$script_dir"
10 |
11 | pause ()
12 | {
13 | echo "Press [Enter] to continue... "
14 | read -p "$*"
15 | }
16 |
17 | check_norway ()
18 | {
19 | if [ ! -x "NORway.py" ]
20 | then
21 | warning_norwayfile
22 | fi
23 | md5=($(openssl md5 NORway.py))
24 | if [ ${md5[1]} != "8c634c24f9ae5258e1c11ac0860c4356" ]
25 | then
26 | warning_norwayversion
27 | fi
28 | }
29 |
30 | warning_norwayfile ()
31 | {
32 | clear
33 | echo
34 | echo
35 | echo
36 | echo
37 | echo
38 | echo
39 | echo
40 | echo
41 | echo -e "\033[31m ---- ERROR ----"
42 | echo
43 | echo " NORway.py file not found or not executable."
44 | echo
45 | echo " Program will close."
46 | echo
47 | echo -e " -------------------\033[32m"
48 | echo
49 | echo
50 | echo
51 | echo
52 | echo
53 | echo
54 | echo
55 | echo
56 | echo
57 | pause
58 | clear
59 | exit
60 | }
61 |
62 | warning_norwayversion ()
63 | {
64 | clear
65 | echo
66 | echo
67 | echo
68 | echo
69 | echo
70 | echo
71 | echo
72 | echo
73 | echo -e "\033[33m ---- WARNING ----"
74 | echo
75 | echo " This script has been designed to run NORway v0.7."
76 | echo " Your NORway.py file does not seem to match this version."
77 | echo " So, this script may run correctly... or not."
78 | echo
79 | echo " You can get the correct version from Judges repository:"
80 | echo " (www.github.com/hjudges/NORway)"
81 | echo
82 | echo -e " -------------------\033[32m"
83 | echo
84 | echo
85 | echo
86 | echo
87 | echo
88 | echo
89 | echo
90 | pause
91 | }
92 |
93 | auto_teensy_port()
94 | {
95 | echo
96 | echo "Starting Teensy USB serial port auto-detection (experimental)":
97 | res=1
98 | for port in /dev/ttyACM*
99 | do
100 | ./NORway.py $port &>/dev/null
101 | if [ $? == 0 ]
102 | then
103 | res=0; teensy_port=$port; break;
104 | fi
105 | done
106 | if [ $res == 1 ]
107 | then
108 | for port in /dev/tty.usbmodem*
109 | do
110 | ./NORway.py $port &>/dev/null
111 | if [ $? == 0 ]
112 | then
113 | res=0; teensy_port=$port; break;
114 | fi
115 | done
116 | fi
117 | if [ $res == 0 ]
118 | then
119 | echo -e "Teensy found on port \033[37m"$teensy_port"\033[32m"
120 | echo
121 | echo "Note: If it is not the port you expected, you can change it manually"
122 | echo "choosing \"S\" option at next screen."
123 | echo
124 | pause
125 | commandes
126 | else
127 | echo -e "\033[31mWARNING: Teensy not detected or a problem occurred!\033[32m"
128 | echo
129 | echo -e "So, default \033[37m"$default_teensy_port"\033[32m port will be used."
130 | teensy_port="$default_teensy_port"
131 | while true; do
132 | read -p "Do you want to set it manually now (y/n)? " yn
133 | case $yn in
134 | y|Y ) header; teensy_port;;
135 | n|N ) commandes;;
136 | * ) echo "Please answer y(yes) or n(no).";;
137 | esac
138 | done
139 | fi
140 | }
141 |
142 | teensy_port()
143 | {
144 | echo
145 | echo "You'll have to define your Teensy USB serial port."
146 | echo "Note that you can find which is your port by running \"dmesg\" command just after"
147 | echo "you connected the Teensy. Assuming your Teensy is correctly programmed with the"
148 | echo "right hex files and python + python serial installed."
149 | echo
150 | while true; do
151 | read -p "Do you want to try auto-detection (y/n)? " yn
152 | case $yn in
153 | y|Y ) header; auto_teensy_port;;
154 | n|N ) break;;
155 | * ) echo "Please answer y(yes) or n(no).";;
156 | esac
157 | done
158 | echo
159 | echo -e "List of existing port(s): \033[37m"
160 | ls -d /dev/ttyACM* 2>/dev/null
161 | if [ $? != 0 ]
162 | then
163 | echo "(none)"
164 | fi
165 | echo -e "\033[32m"
166 | echo -e "Teensy USB serial port actually set to: \033[37m"$teensy_port"\033[32m"
167 | if [ ! -c "$teensy_port" ]
168 | then
169 | echo -e "\033[33mWarning: this port does not seem to exist!\033[32m"
170 | fi
171 | while true; do
172 | read -p "Change it (y/n)? " yn
173 | case $yn in
174 | y|Y ) read -p "Enter new serial port: " teensy_port
175 | echo -e "Teensy serial port now set to: \033[37m"$teensy_port"\033[32m"
176 | if [ ! -c "$teensy_port" ]
177 | then
178 | echo -e "\033[33mWarning: this port does not seem to exist!\033[32m"
179 | else
180 | pause
181 | break
182 | fi;;
183 | n|N ) break;;
184 | * ) echo "Please answer y(yes) or n(no).";;
185 | esac
186 | done
187 | commandes
188 | }
189 |
190 | select_file ()
191 | {
192 | echo -e "\033[37m-------------------------------------------------------------------------------"
193 | echo "Available files in `pwd` :"
194 | echo -e "\033[36m"
195 | ls *.bin *.BIN 2>/dev/null
196 | echo -e "\033[37m-------------------------------------------------------------------------------"
197 | echo -e "\033[32m"
198 | count=`ls -1 *.bin *.BIN 2>/dev/null | wc -l`
199 | if [ $count = 0 ]
200 | then
201 | echo "No dump file type *.bin or *.BIN available. Aborted."
202 | pause
203 | commandes
204 | fi
205 | while true; do
206 | read -p "Select a dump file (ex: \"mydump.bin\") : " fn
207 | file_name="`pwd`/$fn"
208 | if [ -f "$file_name" ]
209 | then
210 | if [ $(ls -nl "$file_name" | awk '{print $5}') -eq 16777216 ]
211 | then
212 | break
213 | else
214 | while true; do
215 | echo -e "\033[31mWrong file size. Is $(stat -c%s "$file_name") bytes, must be 16777216 Bytes (16384 KB).\033[32m"
216 | read -p "Try again (y/n)? " yn
217 | case $yn in
218 | y|Y ) break;;
219 | n|N ) commandes;;
220 | * ) echo "Please answer y(yes) or n(no).";;
221 | esac
222 | done
223 | fi
224 | else
225 | while true; do
226 | echo -e "\033[31mFile does not exist.\033[32m"
227 | read -p "Try again (y/n)? " yn
228 | case $yn in
229 | y|Y ) break;;
230 | n|N ) commandes;;
231 | * ) echo "Please answer y(yes) or n(no).";;
232 | esac
233 | done
234 | fi
235 | done
236 | echo
237 | case $cmd in
238 | "verify" ) echo -e "NOR content will be verified against dump file \033[37m$file_name\033[32m";;
239 | *) echo -e "NOR will be written using dump file \033[37m$file_name\033[32m";;
240 | esac
241 | echo
242 | }
243 |
244 | dump_settings ()
245 | {
246 | while true; do
247 | read -p "Dump quantity : " nbr_dump
248 | if ([ $nbr_dump -gt 0 ] && [ $nbr_dump -lt 10 ]) 2>/dev/null
249 | then
250 | break
251 | else
252 | echo "Quantity must be an integer between 1 minimum to 9 maximum. Try again."
253 | fi
254 | done
255 | echo
256 | while true; do
257 | while true; do
258 | read -p "Save dump file(s) as (ex: \"mydump\", without file extention) : " fn
259 | case "$fn" in
260 | *[!A-Za-z0-9_-]*) echo "Invalid input. Only A-Z,a-z,0-9,_,- allowed. Try again.";;
261 | "") true;;
262 | *) break;;
263 | esac
264 | done
265 | file_name="`pwd`/$fn"
266 | var=0
267 | chk_exist=0
268 | while [ $var != $nbr_dump ]; do
269 | var=`expr $var + 1`
270 | set_dumpfilename
271 | if [ -f "$dump_file_name" ]
272 | then
273 | echo -e "File \033[37m"$dump_file_name"\033[32m already exists!"
274 | chk_exist=1
275 | fi
276 | done
277 | if [ $chk_exist == 1 ]
278 | then
279 | while true; do
280 | read -p "Do you want to overwrite file(s) (y/n)? " yn
281 | case $yn in
282 | y|Y|n|N ) break;;
283 | * ) echo "Please answer y(yes) or n(no).";;
284 | esac
285 | done
286 | case $yn in
287 | y|Y ) break;;
288 | n|N ) true;;
289 | esac
290 | else
291 | break
292 | fi
293 | done
294 | echo
295 | echo -e "x"$nbr_dump" dump(s) will be done and saved as:"
296 | var=0
297 | while [ $var != $nbr_dump ]; do
298 | var=`expr $var + 1`
299 | set_dumpfilename
300 | echo -e "\033[37m"$dump_file_name"\033[32m"
301 | done
302 | echo
303 | }
304 |
305 | set_dumpfilename ()
306 | {
307 | if [ $nbr_dump == 1 ]
308 | then
309 | dump_file_name=""$file_name".bin"
310 | else
311 | dump_file_name=""$file_name"_"$var".bin"
312 | fi
313 | }
314 |
315 | confirmation_cmd ()
316 | {
317 | while true; do
318 | read -p "Do you really wish to start \"$(echo $cmd | tr [:lower:] [:upper:])\" command (y/n)? " yn
319 | case $yn in
320 | y|Y ) break;;
321 | n|N ) commandes;;
322 | * ) echo "Please answer y(yes) or n(no).";;
323 | esac
324 | done
325 | echo
326 | }
327 |
328 | error ()
329 | {
330 | echo -e "\033[31mAn error occurred. Verify your installation."
331 | echo -e "\033[32m"
332 | pause
333 | commandes
334 | }
335 |
336 | header ()
337 | {
338 | clear
339 | echo -e "\033[33m*******************************************************************************"
340 | echo " NORway Launcher \"LME\" "$build_version", by littlebalup"
341 | echo "*******************************************************************************"
342 | echo -e "\033[32m"
343 | }
344 |
345 | commandes ()
346 | {
347 | header
348 | echo -e "Teensy USB serial port: \033[37m"$teensy_port"\033[32m"
349 | echo
350 | echo "Commands list:"
351 | echo " 1) INFO (set tristate, display NOR information)"
352 | echo " 2) DUMP (dump NOR content)"
353 | echo " 3) WRITE (flash NOR, buffered programming mode)"
354 | echo " 4) VWRITE (flash and verify NOR, buffered programming mode)"
355 | echo " 5) WRITEWORD (flash NOR, word programming mode)"
356 | echo " 6) VWRITEWORD (flash and verify NOR, word programming mode)"
357 | echo " 7) WRITEWORDUBM (flash NOR, word programming/unlock bypass mode)"
358 | echo " 8) VWRITEWORDUBM (flash and verify NOR, word programming/unlock bypass mode)"
359 | echo " 9) VERIFY (verify NOR content against a dump file)"
360 | echo " E) ERASECHIP (erase entire NOR content)"
361 | echo " R) RELEASE (release tristate, so the PS3 can boot)"
362 | echo " S) Set Teensy USB serial port"
363 | echo " Q) Quit"
364 | echo
365 | file_name=""
366 | dump_file_name=""
367 | while true; do
368 | read -p "Select a command: " n
369 | case $n in
370 | 1) cmd="info"; cmd_type="simple"; scrypt_start;;
371 | 2) cmd="dump"; cmd_type="dump"; scrypt_start;;
372 | 3) cmd="write"; cmd_type="write"; scrypt_start;;
373 | 4) cmd="vwrite"; cmd_type="write"; scrypt_start;;
374 | 5) cmd="writeword"; cmd_type="write"; scrypt_start;;
375 | 6) cmd="vwriteword"; cmd_type="write"; scrypt_start;;
376 | 7) cmd="writewordubm"; cmd_type="write"; scrypt_start;;
377 | 8) cmd="vwritewordubm"; cmd_type="write"; scrypt_start;;
378 | 9) cmd="verify"; cmd_type="write"; scrypt_start;;
379 | e|E) cmd="erasechip"; cmd_type="simple"; scrypt_start;;
380 | r|R) cmd="release"; cmd_type="simple"; scrypt_start;;
381 | s|S) header; teensy_port;;
382 | q|Q) clear; exit;;
383 | *) echo "Invalide command, select again.";;
384 | esac
385 | done
386 | exit
387 | }
388 |
389 | scrypt_start ()
390 | {
391 | echo
392 | case $cmd_type in
393 | "dump") dump_settings;;
394 | "write") select_file;;
395 | esac
396 | confirmation_cmd
397 | if [ "$cmd_type" == "dump" ]
398 | then
399 | var=0
400 | while [ $var != $nbr_dump ]; do
401 | var=`expr $var + 1`
402 | set_dumpfilename
403 | run
404 | done
405 | echo
406 | if [ $nbr_dump -gt 1 ]
407 | then
408 | while true; do
409 | read -p "Perform a binary comparison of dumps (y/n)? " yn
410 | case $yn in
411 | y|Y ) break;;
412 | n|N ) break;;
413 | * ) echo "Please answer y(yes) or n(no).";;
414 | esac
415 | done
416 | echo
417 | echo -------------------------------------------------------------------------------
418 | loop=0; errorresult=0; errorfile=0; errorcode=0
419 | echo "NORway launcher, file compare log dated : "$(date +%x)" at "$(date +%X)"" > compare_log.txt;
420 | while true; do
421 | if [ $loop == $nbr_dump ]
422 | then
423 | break
424 | else
425 | loop=`expr $loop + 1`
426 | VAR=`expr $nbr_dump - \( $nbr_dump - $loop \)`
427 | while true; do
428 | if [ $VAR == $nbr_dump ]
429 | then
430 | break
431 | else
432 | VAR=`expr $VAR + 1`
433 | echo "Please wait..."
434 | echo >> compare_log.txt
435 | echo -e "Comparing \""$file_name"_"$loop".bin\" with \""$file_name"_"$VAR".bin\"\n[Offset] [FileA] [FileB]" >> compare_log.txt
436 | cmp -l "$file_name"_"$loop".bin "$file_name"_"$VAR".bin | awk 'function oct2dec(oct, dec) {for (i = 1; i <= length(oct); i++) {dec *= 8; dec += substr(oct, i, 1)}; return dec} {printf "%08X %02X %02X\n", $1-1, oct2dec($2), oct2dec($3)}' >> compare_log.txt;
437 | errorlevel=${PIPESTATUS[0]}
438 | case $errorlevel in
439 | 0) echo -e "\033[37m"$file_name"_"$loop".bin\033[32m same as \033[37m"$file_name"_"$VAR".bin\033[32m"; echo "Result: files are identical." >> compare_log.txt;;
440 | 1) echo -e "\033[37m"$file_name"_"$loop".bin\033[33m different from \033[37m"$file_name"_"$VAR".bin\033[32m"; echo "Result: files are different." >> compare_log.txt; errorresult=$errorlevel;;
441 | 2) echo "Result: error (missing file(s))." >> compare_log.txt; errorfile=$errorlevel;;
442 | esac
443 | fi
444 | done
445 | fi
446 | done
447 | echo >> compare_log.txt; echo "END" >> compare_log.txt
448 | errorcode=""$errorfile""$errorresult""
449 | echo "Done."
450 | echo -------------------------------------------------------------------------------
451 | echo
452 | case $errorcode in
453 | 00) echo "Dumps are identical. Details in file compare_log.txt.";;
454 | 01) echo -e "\033[33mAttention : one or more dumps are different. Details in file compare_log.txt.\033[32m";;
455 | 2*) echo -e "\033[31mError : one or more files not found.\033[32m";;
456 | esac
457 | echo
458 | fi
459 | else
460 | dump_file_name="$file_name"
461 | run
462 | fi
463 | echo
464 | pause
465 | clear
466 | commandes
467 | }
468 |
469 | run ()
470 | {
471 | echo
472 | echo "Starting :"
473 | echo "./NORway.py "$teensy_port" "$cmd" "$dump_file_name""
474 | echo
475 | echo -e "\033[37m-------------------------------------------------------------------------------"
476 | case $cmd_type in
477 | "simple") ./NORway.py "$teensy_port" "$cmd";;
478 | *) ./NORway.py "$teensy_port" "$cmd" "$dump_file_name";;
479 | esac
480 | errorlevel=$?
481 | echo "-------------------------------------------------------------------------------"
482 | echo -e "\033[32m"
483 | if [ $errorlevel != 0 ]
484 | then
485 | error
486 | fi
487 | }
488 |
489 | #Console Title
490 | title="NORway Launcher"
491 | echo -e '\033]2;'$title'\007'
492 | echo -e "\033[32m"
493 | clear
494 |
495 | echo " Linux & Mac Edition "$build_version""
496 | echo -e "\033[33m _ _ ____ _____"
497 | echo -e " | \ | |/ __ \| __ \ \033[36m .--. \033[33m"
498 | echo -e " | \| | | | | |__) |_ ____ _ _ _ \033[36m |\033[37mo\033[36m\033[33m_\033[37mo\033[36m | \033[33m"
499 | echo -e " | . \` | | | | _ /\ \_/\_/ / _\` | | | | \033[36m |\033[33m\_/\033[36m | \033[33m"
500 | echo -e " | |\ | |__| | | \ \ \ / (_| | |_| | \033[36m /\033[37m/ \ \033[36m\ \033[33m"
501 | echo -e "\033[37m .:' \033[33m |_| \_|\____/|_| \_\ \_/\_/ \__,_|\__, | \033[36m (\033[37m| |\033[36m ) \033[33m"
502 | echo -e "\033[37m __ :'__ \033[33m _ _ __/ | /'\_ _/'\ "
503 | echo -e "\033[37m .'\` \`-' \`\`. \033[33m | | | | |___/ \___)\033[36m-\033[33m(___/ "
504 | echo -e "\033[37m : .-' \033[33m | | __ _ _ _ _ __ ___| |__ ___ _ __ "
505 | echo -e "\033[37m : : \033[33m | |/ _\` | | | | '_ \ / __| '_ \ / _ \ '__| "
506 | echo -e "\033[37m : \`-; \033[33m | | (_| | |_| | | | | (__| | | | __/ | "
507 | echo -e "\033[37m \`.__.-.__.' \033[33m |_|\__,_|\__,_|_| |_|\___|_| |_|\___|_| "
508 | echo
509 | echo -e "\033[32m-------------------------------------------------------------------------------"
510 | echo " Script to easily run NORway by Judges (www.github.com/hjudges/NORway)."
511 | echo " Installation Note:"
512 | echo " - Place this program into the same folder as NORway.py file"
513 | echo " - Execute"
514 | echo -e "\033[31m ATTENTION! : The use of this program is at your own risk."
515 | echo " The author can not be held responsible for the consequences of its use."
516 | echo -e "\033[32m-------------------------------------------------------------------------------"
517 | pause
518 | check_norway
519 | header
520 | auto_teensy_port
521 | exit
522 |
--------------------------------------------------------------------------------
/sources console version/NANDway_launcher.bat:
--------------------------------------------------------------------------------
1 | @title NANDway Launcher
2 | @echo off
3 | set path=%systemroot%\system32;%systemroot%\system32\wbem
4 |
5 | rem deactivate before compile
6 | set MYFILES="%CD%"
7 |
8 | SET language=
9 | FOR /F "tokens=3" %%G in ('reg query hklm\system\controlset001\control\nls\language /v Installlanguage ^| findstr "Installlanguage"') DO (
10 | IF [%%G] EQU [040C] (set language=FR)
11 | IF [%%G] EQU [080C] (set language=FR)
12 | IF [%%G] EQU [0C0C] (set language=FR)
13 | IF [%%G] EQU [100C] (set language=FR)
14 | IF [%%G] EQU [140C] (set language=FR)
15 | )
16 | IF [%language%] EQU [] (set language=EN)
17 |
18 | call %MYFILES%\language_%language%.bat
19 |
20 | color 0A
21 |
22 | echo V1.9
23 | rem ChangeColor 14 0
24 | echo _ _ _ _ _____
25 | echo ^| \ ^| ^| /\ ^| \ ^| ^| __ \
26 | echo ^| \^| ^| / \ ^| \^| ^| ^| ^| ^|_ ____ _ _ _
27 | echo ^| . ` ^| / /\ \ ^| . ` ^| ^| ^| \ \_/\_/ / _` ^| ^| ^| ^|
28 | echo ^| ^|\ ^|/ ____ \^| ^|\ ^| ^|__^| ^|\ / (_^| ^| ^|_^| ^|
29 | echo ^|_^| \_/_/ \_\_^| \_^|_____/ \_/\_/ \__,_^|\__, ^|
30 | echo _ _ __/ ^|
31 | echo ^| ^| ^| ^| ^|___/
32 | echo ^| ^| __ _ _ _ _ __ ___^| ^|__ ___ _ __
33 | echo ^| ^|/ _` ^| ^| ^| ^| '_ \ / __^| '_ \ / _ \ '__^|
34 | echo ^| ^| (_^| ^| ^|_^| ^| ^| ^| ^| (__^| ^| ^| ^| __/ ^|
35 | echo ^|_^|\__,_^|\__,_^|_^| ^|_^|\___^|_^| ^|_^|\___^|_^|
36 | echo.
37 | rem ChangeColor 10 0
38 | echo -------------------------------------------------------------------------------
39 | echo %TXT_NANDintro_line1%
40 | echo %TXT_intro_line2%
41 | echo %TXT_NANDintro_line3%
42 | echo %TXT_intro_line4%
43 | echo.
44 | rem ChangeColor 12 0
45 | echo %TXT_disclaimer_line1%
46 | echo %TXT_disclaimer_line2%
47 | rem ChangeColor 10 0
48 | echo -------------------------------------------------------------------------------
49 | echo.
50 | pause
51 |
52 | if not exist %systemroot%\system32\wbem\wmic.exe goto warning_version
53 |
54 | if not exist NANDway.py goto warning_nandwayfile
55 |
56 | :commandes
57 | cls
58 | rem ChangeColor 14 0
59 | echo *******************************************************************************
60 | echo NANDway Launcher V1.9, by littlebalup
61 | echo *******************************************************************************
62 | echo.
63 | rem ChangeColor 10 0
64 | echo.
65 | echo %TXT_cmd_tittle%
66 | echo 1 = %TXT_NANDcmd_INFO%
67 | echo 2 = %TXT_NANDcmd_DUMP%
68 | echo 3 = %TXT_NANDcmd_WRITE%
69 | echo 4 = %TXT_NANDcmd_VWRITE%
70 | echo 5 = %TXT_NANDcmd_DIFFWRITE%
71 | echo 6 = %TXT_NANDcmd_VDIFFWRITE%
72 | echo 7 = %TXT_NANDcmd_PS3BADBLOCKS%
73 | echo Q = %TXT_cmd_quit%
74 | echo.
75 | %MYFILES%\choice /C:1234567Q /N "%TXT_cmd_choose% : "
76 | if %errorlevel%==1 goto info
77 | if %errorlevel%==2 goto dump
78 | if %errorlevel%==3 goto write
79 | if %errorlevel%==4 goto vwrite
80 | if %errorlevel%==5 goto diffwrite
81 | if %errorlevel%==6 goto vdiffwrite
82 | if %errorlevel%==7 goto ps3badblocks
83 | if %errorlevel%==8 goto end
84 | goto end
85 |
86 | :info
87 | set teensy_port=
88 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
89 | echo.
90 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
91 | echo.
92 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% INFO "
93 | if %errorlevel%==2 goto commandes
94 | rem ChangeColor 7 0
95 | echo.
96 | echo -------------------------------------------------------------------------------
97 | nandway.py %teensy_port% 0 info
98 | echo -------------------------------------------------------------------------------
99 | echo.
100 | if %errorlevel% NEQ 0 goto erreur
101 | rem ChangeColor 10 0
102 | pause
103 | cls
104 | goto commandes
105 |
106 | :dump
107 | set file_name=
108 | set teensy_port=
109 | set nbr_dump=
110 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
111 | echo.
112 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
113 | echo.
114 | :rtn_a
115 | set /p nbr_dump= %TXT_dump_nbr% :
116 | echo %nbr_dump%|findstr /r /c:"^[0-9][0-9]*$" >nul
117 | if "%nbr_dump%" EQU "" goto rtn_a
118 | if %nbr_dump%==0 goto commandes
119 | if %errorlevel%==1 goto rtn_a
120 | :rtn_b
121 | set /p file_name= %TXT_dump_name% :
122 | if "%file_name%" EQU "" goto rtn_b
123 | echo %TXT_dump_saveas% %CD%\%file_name%_*.bin
124 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% DUMP %TXT_cmd_validate2% "
125 | if %errorlevel%==2 goto commandes
126 | set /a VAR=0
127 | :dmpretour
128 | if %VAR%==%nbr_dump% goto dmpfin
129 | set /a VAR=VAR+1
130 | set dump_file_name=%file_name%_%VAR%.bin
131 | rem ChangeColor 7 0
132 | echo.
133 | echo -------------------------------------------------------------------------------
134 | nandway.py %teensy_port% 0 dump %dump_file_name%
135 | echo -------------------------------------------------------------------------------
136 | echo.
137 | if %errorlevel% NEQ 0 goto erreur
138 | rem ChangeColor 10 0
139 | echo %TXT_dump_savedas% %CD%\%dump_file_name%
140 | echo.
141 | goto dmpretour
142 | :dmpfin
143 | echo.
144 | if %nbr_dump% GTR 1 goto dmpchk
145 | pause
146 | cls
147 | goto commandes
148 | :dmpchk
149 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_dump_startcomp% "
150 | if %errorlevel%==2 goto commandes
151 | echo.
152 | rem ChangeColor 7 0
153 | echo -------------------------------------------------------------------------------
154 | set /a loop=0
155 | set /a errorresult=0
156 | set /a errorfile=0
157 | set /a errorcode=0
158 | if exist compare_log.txt del compare_log.txt
159 | echo NANDway launcher, file compare log dated : %date% at %time% >> compare_log.txt
160 | echo. >> compare_log.txt
161 | :chkloop
162 | if %loop%==%nbr_dump% goto chkfin
163 | set /a loop=loop+1
164 | set /a VAR=%nbr_dump%-(%nbr_dump%-%loop%)
165 | :chkretour
166 | if %VAR%==%nbr_dump% goto chkloop
167 | set /a VAR=VAR+1
168 | echo %TXT_dump_compWait%
169 | fc /b %file_name%_%loop%.bin %file_name%_%VAR%.bin >> compare_log.txt
170 | if %errorlevel%==0 echo %file_name%_%loop%.bin %TXT_dump_compSame% %file_name%_%VAR%.bin
171 | if %errorlevel%==1 echo %file_name%_%loop%.bin %TXT_dump_compDiff% %file_name%_%VAR%.bin
172 | if %errorlevel%==1 (set /a errorresult=%errorlevel%)
173 | if %errorlevel%==2 (set /a errorfile=%errorlevel%)
174 | goto chkretour
175 | :chkfin
176 | echo. >> compare_log.txt
177 | echo END >> compare_log.txt
178 | set /a errorcode = %errorfile%%errorresult%
179 | echo Done.
180 | echo -------------------------------------------------------------------------------
181 | rem ChangeColor 10 0
182 | echo.
183 | if %errorcode%==0 echo %TXT_dump_compOK%
184 | rem ChangeColor 12 0
185 | if %errorcode%==1 echo %TXT_dump_compNOK%
186 | if %errorcode%==20 echo %TXT_dump_compERROR%
187 | if %errorcode%==21 echo %TXT_dump_compERROR%
188 | rem ChangeColor 10 0
189 | echo.
190 | pause
191 | cls
192 | goto commandes
193 |
194 | :write
195 | set activecmd=write
196 | set file_name=
197 | set teensy_port=
198 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
199 | echo.
200 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
201 | echo.
202 | rem ChangeColor 7 0
203 | echo -------------------------------------------------------------------------------
204 | echo %TXT_seefiles% %cd% :
205 | echo.
206 | dir /b *.bin
207 | echo -------------------------------------------------------------------------------
208 | rem ChangeColor 10 0
209 | :retour_write
210 | echo.
211 | set /p file_name= %TXT_write_with% :
212 | if not exist "%CD%\%file_name%" goto erreurfichier
213 | if "%file_name%" EQU "" goto erreurfichier
214 | for %%A in (%file_name%) do set filesize=%%~zA
215 | if not %filesize%==138412032 goto erreurtaillefichier
216 | echo %TXT_NANDwillwrite_with% %CD%\%file_name%
217 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% WRITE %TXT_cmd_validate2% "
218 | if %errorlevel%==2 goto commandes
219 | rem ChangeColor 7 0
220 | echo.
221 | echo -------------------------------------------------------------------------------
222 | nandway.py %teensy_port% 0 write %file_name%
223 | echo -------------------------------------------------------------------------------
224 | echo.
225 | if %errorlevel% NEQ 0 goto erreur
226 | rem ChangeColor 10 0
227 | pause
228 | cls
229 | goto commandes
230 |
231 | :vwrite
232 | set activecmd=vwrite
233 | set file_name=
234 | set teensy_port=
235 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
236 | echo.
237 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
238 | echo.
239 | rem ChangeColor 7 0
240 | echo -------------------------------------------------------------------------------
241 | echo %TXT_seefiles% %cd% :
242 | echo.
243 | dir /b *.bin
244 | echo -------------------------------------------------------------------------------
245 | rem ChangeColor 10 0
246 | :retour_vwrite
247 | echo.
248 | set /p file_name= %TXT_write_with% :
249 | if not exist "%CD%\%file_name%" goto erreurfichier
250 | if "%file_name%" EQU "" goto erreurfichier
251 | for %%A in (%file_name%) do set filesize=%%~zA
252 | if not %filesize%==138412032 goto erreurtaillefichier
253 | echo %TXT_NANDwillwrite_with% %CD%\%file_name%
254 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% VWRITE %TXT_cmd_validate2% "
255 | if %errorlevel%==2 goto commandes
256 | rem ChangeColor 7 0
257 | echo.
258 | echo -------------------------------------------------------------------------------
259 | nandway.py %teensy_port% 0 vwrite %file_name%
260 | echo -------------------------------------------------------------------------------
261 | echo.
262 | if %errorlevel% NEQ 0 goto erreur
263 | rem ChangeColor 10 0
264 | pause
265 | cls
266 | goto commandes
267 |
268 | :diffwrite
269 | set activecmd=diffwrite
270 | set file_name=
271 | set diff_file_name=
272 | set teensy_port=
273 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
274 | echo.
275 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
276 | echo.
277 | rem ChangeColor 7 0
278 | echo -------------------------------------------------------------------------------
279 | echo %TXT_seefiles% %cd% :
280 | echo.
281 | dir /b *.bin,*.txt
282 | echo -------------------------------------------------------------------------------
283 | rem ChangeColor 10 0
284 | :retour_diffwrite
285 | echo.
286 | set /p file_name= %TXT_write_with% :
287 | if not exist "%CD%\%file_name%" goto erreurfichier
288 | if "%file_name%" EQU "" goto erreurfichier
289 | for %%A in (%file_name%) do set filesize=%%~zA
290 | if not %filesize%==138412032 goto erreurtaillefichier
291 | :retour_diffwritetxt
292 | set /p diff_file_name= %TXT_NANDdiff_with% :
293 | if not exist "%CD%\%diff_file_name%" goto erreurfichiertxt
294 | if "%diff_file_name%" EQU "" goto erreurfichiertxt
295 | echo %TXT_NANDwillwrite_with% %CD%\%file_name%
296 | echo %TXT_NANDwilldiff_with% %CD%\%diff_file_name%
297 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% DIFFWRITE %TXT_cmd_validate2% "
298 | if %errorlevel%==2 goto commandes
299 | rem ChangeColor 7 0
300 | echo.
301 | echo -------------------------------------------------------------------------------
302 | nandway.py %teensy_port% 0 diffwrite %file_name% %diff_file_name%
303 | echo -------------------------------------------------------------------------------
304 | echo.
305 | if %errorlevel% NEQ 0 goto erreur
306 | rem ChangeColor 10 0
307 | pause
308 | cls
309 | goto commandes
310 |
311 | :vdiffwrite
312 | set activecmd=vdiffwrite
313 | set file_name=
314 | set diff_file_name=
315 | set teensy_port=
316 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
317 | echo.
318 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
319 | echo.
320 | rem ChangeColor 7 0
321 | echo -------------------------------------------------------------------------------
322 | echo %TXT_seefiles% %cd% :
323 | echo.
324 | dir /b *.bin,*.txt
325 | echo -------------------------------------------------------------------------------
326 | rem ChangeColor 10 0
327 | :retour_vdiffwrite
328 | echo.
329 | set /p file_name= %TXT_write_with% :
330 | if not exist "%CD%\%file_name%" goto erreurfichier
331 | if "%file_name%" EQU "" goto erreurfichier
332 | for %%A in (%file_name%) do set filesize=%%~zA
333 | if not %filesize%==138412032 goto erreurtaillefichier
334 | :retour_vdiffwritetxt
335 | set /p diff_file_name= %TXT_NANDdiff_with% :
336 | if not exist "%CD%\%diff_file_name%" goto erreurfichiertxt
337 | if "%diff_file_name%" EQU "" goto erreurfichiertxt
338 | echo %TXT_NANDwillwrite_with% %CD%\%file_name%
339 | echo %TXT_NANDwilldiff_with% %CD%\%diff_file_name%
340 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% VDIFFWRITE %TXT_cmd_validate2% "
341 | if %errorlevel%==2 goto commandes
342 | rem ChangeColor 7 0
343 | echo.
344 | echo -------------------------------------------------------------------------------
345 | nandway.py %teensy_port% 0 vdiffwrite %file_name% %diff_file_name%
346 | echo -------------------------------------------------------------------------------
347 | echo.
348 | if %errorlevel% NEQ 0 goto erreur
349 | rem ChangeColor 10 0
350 | pause
351 | cls
352 | goto commandes
353 |
354 | :ps3badblocks
355 | echo.
356 | rem ChangeColor 7 0
357 | echo -------------------------------------------------------------------------------
358 | echo %TXT_seefiles% %cd% :
359 | echo.
360 | dir /b *.bin
361 | echo -------------------------------------------------------------------------------
362 | rem ChangeColor 10 0
363 | echo.
364 | set /p file_name= %TXT_NANDbb_with% :
365 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% PS3BADBLOCKS "
366 | if %errorlevel%==2 goto commandes
367 | rem ChangeColor 7 0
368 | echo.
369 | echo -------------------------------------------------------------------------------
370 | nandway.py ps3badblocks %file_name%
371 | echo -------------------------------------------------------------------------------
372 | echo.
373 | if %errorlevel% NEQ 0 goto erreur
374 | rem ChangeColor 10 0
375 | pause
376 | cls
377 | goto commandes
378 |
379 | :erreur
380 | rem ChangeColor 12 0
381 | echo %TXT_error%
382 | echo.
383 | rem ChangeColor 10 0
384 | pause
385 | cls
386 | goto commandes
387 |
388 | :erreurteensy
389 | rem ChangeColor 12 0
390 | echo %TXT_teensyerror_line1%
391 | echo %TXT_teensyerror_line2%
392 | echo.
393 | rem ChangeColor 10 0
394 | pause
395 | cls
396 | goto commandes
397 |
398 | :erreurfichier
399 | rem ChangeColor 12 0
400 | echo %TXT_error_nofile1% %CD%\%file_name% %TXT_error_nofile2%
401 | echo.
402 | rem ChangeColor 10 0
403 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_restart% "
404 | if %errorlevel%==1 (goto retour_%activecmd%) else (goto commandes)
405 |
406 | :erreurfichiertxt
407 | rem ChangeColor 12 0
408 | echo %TXT_error_nofile1% %CD%\%diff_file_name% %TXT_error_nofile2%
409 | echo.
410 | rem ChangeColor 10 0
411 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_restart% "
412 | if %errorlevel%==1 (goto retour_%activecmd%txt) else (goto commandes)
413 |
414 | :erreurtaillefichier
415 | rem ChangeColor 12 0
416 | echo %TXT_error_sizefile1% %CD%\%file_name% %TXT_error_sizefile2% %filesize% %TXT_error_sizefile3%
417 | echo %TXT_NANDerror_sizefile4%
418 | echo.
419 | rem ChangeColor 10 0
420 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_restart% "
421 | if %errorlevel%==1 (goto retour_%activecmd%) else (goto commandes)
422 |
423 | :warning_version
424 | cls
425 | rem ChangeColor 12 0
426 | echo.
427 | echo.
428 | echo.
429 | echo.
430 | echo.
431 | echo.
432 | echo.
433 | echo.
434 | echo %TXT_warningversion_line1%
435 | echo.
436 | echo %TXT_warningversion_line2%
437 | echo %TXT_warningversion_line3%
438 | echo.
439 | echo %TXT_warningversion_line4%
440 | echo.
441 | echo %TXT_warningversion_line5%
442 | echo.
443 | echo.
444 | echo.
445 | echo.
446 | echo.
447 | echo.
448 | echo.
449 | echo.
450 | rem ChangeColor 10 0
451 | pause
452 | goto end
453 |
454 | :warning_nandwayfile
455 | cls
456 | rem ChangeColor 12 0
457 | echo.
458 | echo.
459 | echo.
460 | echo.
461 | echo.
462 | echo.
463 | echo.
464 | echo.
465 | echo %TXT_warningfiles_line1%
466 | echo.
467 | echo %TXT_NANDwarningfiles_line2%
468 | echo.
469 | echo %TXT_warningfiles_line3%
470 | echo.
471 | echo %TXT_warningfiles_line4%
472 | echo.
473 | echo.
474 | echo.
475 | echo.
476 | echo.
477 | echo.
478 | echo.
479 | echo.
480 | echo.
481 | rem ChangeColor 10 0
482 | pause
483 | goto end
484 |
485 | :end
486 | exit
487 |
488 |
--------------------------------------------------------------------------------
/Releases/Linux Mac Edition/NANDway_launcher.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # default serial port : (to find your teensy serial port, plug or unplug-replug it, then run "dmesg" command. Last lines should give you your ttyACM* port)
4 | default_teensy_port="/dev/ttyACM0"
5 |
6 | build_version="v1.02"
7 |
8 | script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
9 | cd "$script_dir"
10 |
11 | pause ()
12 | {
13 | echo "Press [Enter] to continue... "
14 | read -p "$*"
15 | }
16 |
17 | check_nandway ()
18 | {
19 | if [ ! -x "NANDway.py" ]
20 | then
21 | warning_nandwayfile
22 | fi
23 | md5=($(openssl md5 NANDway.py))
24 | if [ ${md5[1]} != "3e389a1573d3a3c1d986c90fa00ee545" ]
25 | then
26 | warning_nandwayversion
27 | fi
28 | }
29 |
30 | warning_nandwayfile ()
31 | {
32 | clear
33 | echo
34 | echo
35 | echo
36 | echo
37 | echo
38 | echo
39 | echo
40 | echo
41 | echo -e "\033[31m ---- ERROR ----"
42 | echo
43 | echo " NANDway.py file not found or not executable."
44 | echo
45 | echo " Program will close."
46 | echo
47 | echo -e " -------------------\033[32m"
48 | echo
49 | echo
50 | echo
51 | echo
52 | echo
53 | echo
54 | echo
55 | echo
56 | echo
57 | pause
58 | clear
59 | exit
60 | }
61 |
62 | warning_nandwayversion ()
63 | {
64 | clear
65 | echo
66 | echo
67 | echo
68 | echo
69 | echo
70 | echo
71 | echo
72 | echo
73 | echo -e "\033[33m ---- WARNING ----"
74 | echo
75 | echo " This script has been designed to run NANDway v0.64."
76 | echo " Your NANDway.py file does not seem to match this version."
77 | echo " So, this script may run correctly... or not."
78 | echo
79 | echo " You can get the correct version from Judges repository:"
80 | echo " (www.github.com/hjudges/NORway)"
81 | echo
82 | echo -e " -------------------\033[32m"
83 | echo
84 | echo
85 | echo
86 | echo
87 | echo
88 | echo
89 | echo
90 | pause
91 | }
92 |
93 | auto_teensy_port()
94 | {
95 | echo
96 | echo "Starting Teensy USB serial port auto-detection (experimental)":
97 | res=1
98 | for port in /dev/ttyACM*
99 | do
100 | ./NANDway.py $port 0 &>/dev/null
101 | if [ $? == 0 ]
102 | then
103 | res=0; teensy_port=$port; break;
104 | fi
105 | done
106 | if [ $res == 1 ]
107 | then
108 | for port in /dev/tty.usbmodem*
109 | do
110 | ./NANDway.py $port 0 &>/dev/null
111 | if [ $? == 0 ]
112 | then
113 | res=0; teensy_port=$port; break;
114 | fi
115 | done
116 | fi
117 | if [ $res == 0 ]
118 | then
119 | echo -e "Teensy found on port \033[37m"$teensy_port"\033[32m"
120 | echo
121 | echo "Note: If it is not the port you expected, you can change it manually"
122 | echo "choosing \"S\" option at next screen."
123 | echo
124 | pause
125 | commandes
126 | else
127 | echo -e "\033[31mWARNING: Teensy not detected or a problem occurred!\033[32m"
128 | echo
129 | echo -e "So, default \033[37m"$default_teensy_port"\033[32m port will be used."
130 | teensy_port="$default_teensy_port"
131 | while true; do
132 | read -p "Do you want to set it manually now (y/n)? " yn
133 | case $yn in
134 | y|Y ) header; teensy_port;;
135 | n|N ) commandes;;
136 | * ) echo "Please answer y(yes) or n(no).";;
137 | esac
138 | done
139 | fi
140 | }
141 |
142 | teensy_port()
143 | {
144 | echo
145 | echo "You'll have to define your Teensy USB serial port."
146 | echo "Note that you can find which is your port by running \"dmesg\" command just after"
147 | echo "you connected the Teensy. Assuming your Teensy is correctly programmed with the"
148 | echo "right hex files and python + python serial installed."
149 | echo
150 | while true; do
151 | read -p "Do you want to try auto-detection (y/n)? " yn
152 | case $yn in
153 | y|Y ) header; auto_teensy_port;;
154 | n|N ) break;;
155 | * ) echo "Please answer y(yes) or n(no).";;
156 | esac
157 | done
158 | echo
159 | echo -e "List of existing port(s): \033[37m"
160 | ls -d /dev/ttyACM* 2>/dev/null
161 | if [ $? != 0 ]
162 | then
163 | echo "(none)"
164 | fi
165 | echo -e "\033[32m"
166 | echo -e "Teensy USB serial port actually set to: \033[37m"$teensy_port"\033[32m"
167 | if [ ! -c "$teensy_port" ]
168 | then
169 | echo -e "\033[33mWarning: this port does not seem to exist!\033[32m"
170 | fi
171 | while true; do
172 | read -p "Change it (y/n)? " yn
173 | case $yn in
174 | y|Y ) read -p "Enter new serial port: " teensy_port
175 | echo -e "Teensy serial port now set to: \033[37m"$teensy_port"\033[32m"
176 | if [ ! -c "$teensy_port" ]
177 | then
178 | echo -e "\033[33mWarning: this port does not seem to exist!\033[32m"
179 | else
180 | pause
181 | break
182 | fi;;
183 | n|N ) break;;
184 | * ) echo "Please answer y(yes) or n(no).";;
185 | esac
186 | done
187 | commandes
188 | }
189 |
190 | select_file ()
191 | {
192 | echo -e "\033[37m-------------------------------------------------------------------------------"
193 | echo "Available files in `pwd` :"
194 | echo -e "\033[36m"
195 | if [ $cmd_type == "diffwrite" ]
196 | then
197 | ls *.bin *.BIN *.txt *.TXT 2>/dev/null
198 | else
199 | ls *.bin *.BIN 2>/dev/null
200 | fi
201 | echo -e "\033[37m-------------------------------------------------------------------------------"
202 | echo -e "\033[32m"
203 | count=`ls -1 *.bin *.BIN 2>/dev/null | wc -l`
204 | if [ $count = 0 ]
205 | then
206 | echo "No dump file type *.bin or *.BIN available. Aborted."
207 | pause
208 | commandes
209 | fi
210 | if [ $cmd_type == "diffwrite" ]
211 | then
212 | count=`ls -1 *.txt *.TXT 2>/dev/null | wc -l`
213 | if [ $count = 0 ]
214 | then
215 | echo "No diff. file type *.txt or *.TXT available. Aborted."
216 | pause
217 | commandes
218 | fi
219 | fi
220 | while true; do
221 | read -p "Select a dump file (ex: \"mydump.bin\") : " fn
222 | file_name="`pwd`/$fn"
223 | if [ -f "$file_name" ]
224 | then
225 | if [ $(ls -nl "$file_name" | awk '{print $5}') -eq 138412032 ]
226 | then
227 | break
228 | else
229 | while true; do
230 | echo -e "\033[31mWrong file size. Is $(stat -c%s "$file_name") bytes, must be 138412032 Bytes (135168 KB).\033[32m"
231 | read -p "Try again (y/n)? " yn
232 | case $yn in
233 | y|Y ) break;;
234 | n|N ) commandes;;
235 | * ) echo "Please answer y(yes) or n(no).";;
236 | esac
237 | done
238 | fi
239 | else
240 | while true; do
241 | echo -e "\033[31mFile does not exist.\033[32m"
242 | read -p "Try again (y/n)? " yn
243 | case $yn in
244 | y|Y ) break;;
245 | n|N ) commandes;;
246 | * ) echo "Please answer y(yes) or n(no).";;
247 | esac
248 | done
249 | fi
250 | done
251 | if [ $cmd_type == "diffwrite" ]
252 | then
253 | while true; do
254 | read -p "Select a diff. file (ex: \"DifferenceFileFlash.txt\") : " fn
255 | diff_file_name="`pwd`/$fn"
256 | if [ -f "$diff_file_name" ]
257 | then
258 | break
259 | else
260 | while true; do
261 | echo -e "\033[31mFile does not exist.\033[32m"
262 | read -p "Try again (y/n)? " yn
263 | case $yn in
264 | y|Y ) break;;
265 | n|N ) commandes;;
266 | * ) echo "Please answer y(yes) or n(no).";;
267 | esac
268 | done
269 | fi
270 | done
271 | fi
272 | echo
273 | case $cmd in
274 | "ps3badblocks" ) echo -e "Bad blocks will be searched in file \033[37m$file_name\033[32m";;
275 | *"diff"* ) echo -e "NAND will be written with dump file \033[37m$file_name\033[32m"; echo -e "and using differential file \033[37m$diff_file_name\033[32m";;
276 | *) echo -e "NAND will be written with dump file \033[37m$file_name\033[32m";;
277 | esac
278 | echo
279 | }
280 |
281 | dump_settings ()
282 | {
283 | while true; do
284 | read -p "Dump quantity : " nbr_dump
285 | if ([ $nbr_dump -gt 0 ] && [ $nbr_dump -lt 10 ]) 2>/dev/null
286 | then
287 | break
288 | else
289 | echo "Quantity must be an integer between 1 minimum to 9 maximum. Try again."
290 | fi
291 | done
292 | echo
293 | while true; do
294 | while true; do
295 | read -p "Save dump file(s) as (ex: \"mydump\", without file extention) : " fn
296 | case "$fn" in
297 | *[!A-Za-z0-9_-]*) echo "Invalid input. Only A-Z,a-z,0-9,_,- allowed. Try again.";;
298 | "") true;;
299 | *) break;;
300 | esac
301 | done
302 | file_name="`pwd`/$fn"
303 | var=0
304 | chk_exist=0
305 | while [ $var != $nbr_dump ]; do
306 | var=`expr $var + 1`
307 | set_dumpfilename
308 | if [ -f "$dump_file_name" ]
309 | then
310 | echo -e "File \033[37m"$dump_file_name"\033[32m already exists!"
311 | chk_exist=1
312 | fi
313 | done
314 | if [ $chk_exist == 1 ]
315 | then
316 | while true; do
317 | read -p "Do you want to overwrite file(s) (y/n)? " yn
318 | case $yn in
319 | y|Y|n|N ) break;;
320 | * ) echo "Please answer y(yes) or n(no).";;
321 | esac
322 | done
323 | case $yn in
324 | y|Y ) break;;
325 | n|N ) true;;
326 | esac
327 | else
328 | break
329 | fi
330 | done
331 | echo
332 | echo -e "x"$nbr_dump" dump(s) will be done and saved as:"
333 | var=0
334 | while [ $var != $nbr_dump ]; do
335 | var=`expr $var + 1`
336 | set_dumpfilename
337 | echo -e "\033[37m"$dump_file_name"\033[32m"
338 | done
339 | echo
340 | }
341 |
342 | set_dumpfilename ()
343 | {
344 | if [ $nbr_dump == 1 ]
345 | then
346 | dump_file_name=""$file_name".bin"
347 | else
348 | dump_file_name=""$file_name"_"$var".bin"
349 | fi
350 | }
351 |
352 | confirmation_cmd ()
353 | {
354 | while true; do
355 | read -p "Do you really wish to start \"$(echo $cmd | tr [:lower:] [:upper:])\" command (y/n)? " yn
356 | case $yn in
357 | y|Y ) break;;
358 | n|N ) commandes;;
359 | * ) echo "Please answer y(yes) or n(no).";;
360 | esac
361 | done
362 | echo
363 | }
364 |
365 | error ()
366 | {
367 | echo -e "\033[31mAn error occurred. Verify your installation."
368 | echo -e "\033[32m"
369 | pause
370 | commandes
371 | }
372 |
373 | header ()
374 | {
375 | clear
376 | echo -e "\033[33m*******************************************************************************"
377 | echo " NANDway Launcher \"LME\" "$build_version", by littlebalup"
378 | echo "*******************************************************************************"
379 | echo -e "\033[32m"
380 | }
381 |
382 | commandes ()
383 | {
384 | header
385 | echo -e "Teensy USB serial port: \033[37m"$teensy_port"\033[32m"
386 | echo
387 | echo "Commands list:"
388 | echo " 1) INFO (display NAND information)"
389 | echo " 2) DUMP (dump NAND content)"
390 | echo " 3) WRITE (flash NAND)"
391 | echo " 4) VWRITE (flash and verify NAND)"
392 | echo " 5) DIFFWRITE (differential flash NAND)"
393 | echo " 6) VDIFFWRITE (differential flash and verify NAND)"
394 | echo " 7) PS3BADBLOCKS (identify bad blocks in a NAND dump file)"
395 | echo " S) Set Teensy USB serial port"
396 | echo " Q) Quit"
397 | echo
398 | file_name=""
399 | dump_file_name=""
400 | diff_file_name=""
401 | while true; do
402 | read -p "Select a command: " n
403 | case $n in
404 | 1) cmd="info"; cmd_type="simple"; scrypt_start;;
405 | 2) cmd="dump"; cmd_type="dump"; scrypt_start;;
406 | 3) cmd="write"; cmd_type="write"; scrypt_start;;
407 | 4) cmd="vwrite"; cmd_type="write"; scrypt_start;;
408 | 5) cmd="diffwrite"; cmd_type="diffwrite"; scrypt_start;;
409 | 6) cmd="vdiffwrite"; cmd_type="diffwrite"; scrypt_start;;
410 | 7) cmd="ps3badblocks"; cmd_type="ps3bb"; scrypt_start;;
411 | s|S) header; teensy_port;;
412 | q|Q) clear; exit;;
413 | *) echo "Invalide command, select again.";;
414 | esac
415 | done
416 | exit
417 | }
418 |
419 | scrypt_start ()
420 | {
421 | echo
422 | case $cmd_type in
423 | "dump") dump_settings;;
424 | *"write") select_file;;
425 | "ps3bb" ) select_file;;
426 | esac
427 | confirmation_cmd
428 | if [ "$cmd_type" == "dump" ]
429 | then
430 | var=0
431 | while [ $var != $nbr_dump ]; do
432 | var=`expr $var + 1`
433 | set_dumpfilename
434 | run
435 | done
436 | echo
437 | if [ $nbr_dump -gt 1 ]
438 | then
439 | while true; do
440 | read -p "Perform a binary comparison of dumps (y/n)? " yn
441 | case $yn in
442 | y|Y ) break;;
443 | n|N ) break;;
444 | * ) echo "Please answer y(yes) or n(no).";;
445 | esac
446 | done
447 | echo
448 | echo -------------------------------------------------------------------------------
449 | loop=0; errorresult=0; errorfile=0; errorcode=0
450 | echo "NANDway launcher, file compare log dated : "$(date +%x)" at "$(date +%X)"" > compare_log.txt;
451 | while true; do
452 | if [ $loop == $nbr_dump ]
453 | then
454 | break
455 | else
456 | loop=`expr $loop + 1`
457 | VAR=`expr $nbr_dump - \( $nbr_dump - $loop \)`
458 | while true; do
459 | if [ $VAR == $nbr_dump ]
460 | then
461 | break
462 | else
463 | VAR=`expr $VAR + 1`
464 | echo "Please wait..."
465 | echo >> compare_log.txt
466 | echo -e "Comparing \""$file_name"_"$loop".bin\" with \""$file_name"_"$VAR".bin\"\n[Offset] [FileA] [FileB]" >> compare_log.txt
467 | cmp -l "$file_name"_"$loop".bin "$file_name"_"$VAR".bin | awk 'function oct2dec(oct, dec) {for (i = 1; i <= length(oct); i++) {dec *= 8; dec += substr(oct, i, 1)}; return dec} {printf "%08X %02X %02X\n", $1-1, oct2dec($2), oct2dec($3)}' >> compare_log.txt;
468 | errorlevel=${PIPESTATUS[0]}
469 | case $errorlevel in
470 | 0) echo -e "\033[37m"$file_name"_"$loop".bin\033[32m same as \033[37m"$file_name"_"$VAR".bin\033[32m"; echo "Result: files are identical." >> compare_log.txt;;
471 | 1) echo -e "\033[37m"$file_name"_"$loop".bin\033[33m different from \033[37m"$file_name"_"$VAR".bin\033[32m"; echo "Result: files are different." >> compare_log.txt; errorresult=$errorlevel;;
472 | 2) echo "Result: error (missing file(s))." >> compare_log.txt; errorfile=$errorlevel;;
473 | esac
474 | fi
475 | done
476 | fi
477 | done
478 | echo >> compare_log.txt; echo "END" >> compare_log.txt
479 | errorcode=""$errorfile""$errorresult""
480 | echo "Done."
481 | echo -------------------------------------------------------------------------------
482 | echo
483 | case $errorcode in
484 | 00) echo "Dumps are identical. Details in file compare_log.txt.";;
485 | 01) echo -e "\033[33mAttention : one or more dumps are different. Details in file compare_log.txt.\033[32m";;
486 | 2*) echo -e "\033[31mError : one or more files not found.\033[32m";;
487 | esac
488 | echo
489 | fi
490 | else
491 | dump_file_name="$file_name"
492 | run
493 | fi
494 | echo
495 | pause
496 | clear
497 | commandes
498 | }
499 |
500 | run ()
501 | {
502 | echo
503 | echo "Starting :"
504 | case $cmd_type in
505 | "ps3bb") echo "./NANDway.py "$cmd" "$dump_file_name"";;
506 | *) echo "./NANDway.py "$teensy_port" 0 "$cmd" "$dump_file_name" "$diff_file_name"";;
507 | esac
508 | echo
509 | echo -e "\033[37m-------------------------------------------------------------------------------"
510 | case $cmd_type in
511 | "simple") ./NANDway.py "$teensy_port" 0 "$cmd";;
512 | "diffwrite") ./NANDway.py "$teensy_port" "$cmd" 0 "$dump_file_name" "$diff_file_name";;
513 | "ps3bb") ./NANDway.py "$cmd" "$dump_file_name";;
514 | *) ./NANDway.py "$teensy_port" "$cmd" 0 "$dump_file_name";;
515 | esac
516 | errorlevel=$?
517 | echo "-------------------------------------------------------------------------------"
518 | echo -e "\033[32m"
519 | if [ $errorlevel != 0 ]
520 | then
521 | error
522 | fi
523 | }
524 |
525 | #Console Title
526 | title="NANDway Launcher"
527 | echo -e '\033]2;'$title'\007'
528 | echo -e "\033[32m"
529 | clear
530 |
531 | echo " Linux & Mac Edition "$build_version""
532 | echo -e "\033[33m _ _ _ _ _____"
533 | echo -e " | \ | | /\ | \ | | __ \ \033[36m .--. \033[33m"
534 | echo -e " | \| | / \ | \| | | | |_ ____ _ _ _ \033[36m |\033[37mo\033[36m\033[33m_\033[37mo\033[36m | \033[33m"
535 | echo -e " | . \` | / /\ \ | . \` | | | \ \_/\_/ / _\` | | | | \033[36m |\033[33m\_/\033[36m | \033[33m"
536 | echo -e " | |\ |/ ____ \| |\ | |__| |\ / (_| | |_| | \033[36m /\033[37m/ \ \033[36m\ \033[33m"
537 | echo -e "\033[37m .:'\033[33m |_| \_/_/ \_\_| \_|_____/ \_/\_/ \__,_|\__, | \033[36m (\033[37m| |\033[36m ) \033[33m"
538 | echo -e "\033[37m __ :'__\033[33m _ _ __/ | /'\_ _/'\ "
539 | echo -e "\033[37m .'\` \`-' \`\`. \033[33m | | | | |___/ \___)\033[36m-\033[33m(___/ "
540 | echo -e "\033[37m : .-' \033[33m | | __ _ _ _ _ __ ___| |__ ___ _ __"
541 | echo -e "\033[37m : : \033[33m | |/ _\` | | | | '_ \ / __| '_ \ / _ \ '__|"
542 | echo -e "\033[37m : \`-; \033[33m | | (_| | |_| | | | | (__| | | | __/ |"
543 | echo -e "\033[37m \`.__.-.__.' \033[33m |_|\__,_|\__,_|_| |_|\___|_| |_|\___|_|"
544 | echo
545 | echo -e "\033[32m-------------------------------------------------------------------------------"
546 | echo " Script to easily run NANDway (SBE) by Judges (www.github.com/hjudges/NORway)."
547 | echo " Installation Note:"
548 | echo " - Place this program into the same folder as NANDway.py file"
549 | echo " - Execute"
550 | echo -e "\033[31m ATTENTION! : The use of this program is at your own risk."
551 | echo " The author can not be held responsible for the consequences of its use."
552 | echo -e "\033[32m-------------------------------------------------------------------------------"
553 | pause
554 | check_nandway
555 | header
556 | auto_teensy_port
557 | exit
558 |
--------------------------------------------------------------------------------
/LICENCE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | {description}
294 | Copyright (C) {year} {fullname}
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
--------------------------------------------------------------------------------
/sources GUI v2.XX/WAYLaunchers/MainForm.vb:
--------------------------------------------------------------------------------
1 | Imports System.IO
2 | Imports System.Security.Cryptography
3 | Imports System.Text
4 | Public Class MainForm
5 |
6 | Private Sub MainForm_Closing(sender As Object, e As EventArgs) Handles MyBase.FormClosing
7 |
8 | Dim p As Process()
9 | p = Process.GetProcessesByName("COMMANDS")
10 | For Each proces As Process In p
11 | proces.Kill()
12 | Next
13 |
14 | Dim q As Process()
15 | q = Process.GetProcessesByName("python")
16 | For Each proces As Process In q
17 | proces.Kill()
18 | Next
19 |
20 | Dim r As Process()
21 | r = Process.GetProcessesByName("teensy_loader_cli")
22 | For Each proces As Process In r
23 | proces.Kill()
24 | Next
25 |
26 | End Sub
27 |
28 | Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
29 | SaveToDisk("COMMANDS.EXE", "COMMANDS.EXE")
30 | SaveToDisk("teensy_loader_cli.exe", "teensy_loader_cli.exe")
31 | End Sub
32 |
33 | Private Sub MainForm_Closed(sender As Object, e As EventArgs) Handles MyBase.FormClosed
34 | My.Computer.FileSystem.DeleteFile("COMMANDS.EXE")
35 | My.Computer.FileSystem.DeleteFile("teensy_loader_cli.exe")
36 | End Sub
37 |
38 | 'Onglet NORinfo *****************************************************************************************
39 | Private Sub StartNORinfoButton_Click(sender As Object, e As EventArgs) Handles StartNORinfoButton.Click
40 |
41 |
42 | TeensyBlinkNOR.Visible = True
43 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & TabCommandsNOR.SelectedTab.Text)
44 |
45 | End Sub
46 |
47 | 'Onglet NORdump *****************************************************************************************
48 | Private Sub StartNORdumpButton_Click(sender As Object, e As EventArgs) Handles StartNORdumpButton.Click
49 |
50 | Dim DumpFileNOR As String = Replace(SaveToTextBoxNOR.Text, ".bin", "")
51 | DumpFileNOR = Replace(DumpFileNOR, ".BIN", "")
52 |
53 |
54 | TeensyBlinkNOR.Visible = True
55 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & TabCommandsNOR.SelectedTab.Text & " " & Chr(34) & DumpFileNOR & Chr(34) & " " & "NUL" & " " & NumericUpDownDumpsNOR.Value & " " & CheckBoxBinCompNOR.Checked)
56 |
57 | End Sub
58 |
59 | Private Sub NumericUpDownDumpsNOR_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDownDumpsNOR.ValueChanged
60 | If NumericUpDownDumpsNOR.Value = 1 Then
61 | CheckBoxBinCompNOR.Enabled = False
62 | CheckBoxBinCompNOR.Checked = False
63 | Else
64 | CheckBoxBinCompNOR.Enabled = True
65 | End If
66 | End Sub
67 |
68 | Private Sub SaveToButtonNOR_Click(sender As Object, e As EventArgs) Handles SaveToButtonNOR.Click
69 | If SaveFileDialogNOR.ShowDialog(Me) <> Windows.Forms.DialogResult.OK Then
70 | Exit Sub
71 | End If
72 | SaveToTextBoxNOR.Text = SaveFileDialogNOR.FileName
73 | End Sub
74 |
75 | Private Sub SaveToTextBoxNOR_TextChanged(sender As Object, e As EventArgs) Handles SaveToTextBoxNOR.TextChanged
76 | If SaveToTextBoxNOR.Text <> "" Then
77 | StartNORdumpButton.Enabled = True
78 | Else
79 | StartNORdumpButton.Enabled = False
80 | End If
81 | End Sub
82 |
83 | 'Onglet NORwrite *****************************************************************************************
84 | Private Sub StartNORwriteButton_Click(sender As Object, e As EventArgs) Handles StartNORwriteButton.Click
85 |
86 | Dim VerifyArgument As String
87 | If CheckBoxVerifyNOR.Checked = True Then
88 | VerifyArgument = "V"
89 | Else
90 | VerifyArgument = ""
91 | End If
92 |
93 | Dim WordArgument As String
94 | If CheckBoxWordNOR.Checked = True Then
95 | WordArgument = "WORD"
96 | ElseIf CheckBoxWordUbmNOR.Checked = True Then
97 | WordArgument = "WORDUBM"
98 | Else
99 | WordArgument = ""
100 | End If
101 |
102 | TeensyBlinkNOR.Visible = True
103 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & VerifyArgument & TabCommandsNOR.SelectedTab.Text & WordArgument & " " & Chr(34) & WriteWithTextBoxNOR.Text & Chr(34) & " NUL NUL " & CheckBoxPFWwriteNOR.Checked)
104 |
105 | End Sub
106 |
107 | Private Sub CheckBoxWordNOR_Click(sender As Object, e As EventArgs) Handles CheckBoxWordNOR.Click
108 | CheckBoxWordUbmNOR.Checked = False
109 | End Sub
110 |
111 | Private Sub CheckBoxWordUbmNOR_Click(sender As Object, e As EventArgs) Handles CheckBoxWordUbmNOR.Click
112 | CheckBoxWordNOR.Checked = False
113 | End Sub
114 |
115 | Private Sub WriteWithButtonNOR_Click(sender As Object, e As EventArgs) Handles WriteWithButtonNOR.Click
116 | If OpenFileDumpNOR.ShowDialog(Me) <> Windows.Forms.DialogResult.OK Then
117 | Exit Sub
118 | End If
119 | WriteWithTextBoxNOR.Text = OpenFileDumpNOR.FileName
120 | End Sub
121 |
122 | Private Sub WriteWithTextBoxNOR_TextChanged(sender As Object, e As EventArgs) Handles WriteWithTextBoxNOR.TextChanged
123 | If WriteWithTextBoxNOR.Text <> "" Then
124 | StartNORwriteButton.Enabled = True
125 | Else
126 | StartNORwriteButton.Enabled = False
127 | End If
128 | End Sub
129 |
130 | 'Onglet NORverify *****************************************************************************************
131 | Private Sub StartNORverifyButton_Click(sender As Object, e As EventArgs) Handles StartNORverifyButton.Click
132 |
133 | TeensyBlinkNOR.Visible = True
134 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & TabCommandsNOR.SelectedTab.Text & " " & Chr(34) & VerifyWithTextBoxNOR.Text & Chr(34) & " NUL NUL " & CheckBoxPFWwriteNOR.Checked)
135 |
136 | End Sub
137 |
138 | Private Sub VerifyWithButtonNOR_Click(sender As Object, e As EventArgs) Handles VerifyWithButtonNOR.Click
139 | If OpenFileVerifyNOR.ShowDialog(Me) <> Windows.Forms.DialogResult.OK Then
140 | Exit Sub
141 | End If
142 | VerifyWithTextBoxNOR.Text = OpenFileVerifyNOR.FileName
143 | End Sub
144 |
145 | Private Sub VerifyWithTextBoxNOR_TextChanged(sender As Object, e As EventArgs) Handles VerifyWithTextBoxNOR.TextChanged
146 | StartNORverifyButton.Enabled = True
147 | End Sub
148 |
149 | 'Onglet NORrelease *****************************************************************************************
150 | Private Sub StartNORreleaseButton_Click(sender As Object, e As EventArgs) Handles StartNORreleaseButton.Click
151 |
152 |
153 | TeensyBlinkNOR.Visible = True
154 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & TabCommandsNOR.SelectedTab.Text)
155 |
156 | End Sub
157 |
158 | 'Onglet NORerasechip *****************************************************************************************
159 | Private Sub StartNORerasechipButton_Click(sender As Object, e As EventArgs) Handles StartNORerasechipButton.Click
160 |
161 |
162 | TeensyBlinkNOR.Visible = True
163 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & TabCommandsNOR.SelectedTab.Text)
164 |
165 | End Sub
166 |
167 | 'Onglet NANDinfo *****************************************************************************************
168 | Private Sub StartNANDinfoButton_Click(sender As Object, e As EventArgs) Handles StartNANDinfoButton.Click
169 |
170 |
171 | TeensyBlinkNAND.Visible = True
172 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & TabCommandsNAND.SelectedTab.Text)
173 |
174 | End Sub
175 |
176 | 'Onglet NANDdump *****************************************************************************************
177 | Private Sub StartNANDdumpButton_Click(sender As Object, e As EventArgs) Handles StartNANDdumpButton.Click
178 |
179 | Dim DumpFileNAND As String = Replace(SaveToTextBoxNAND.Text, ".bin", "")
180 | DumpFileNAND = Replace(DumpFileNAND, ".BIN", "")
181 |
182 |
183 | TeensyBlinkNAND.Visible = True
184 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & TabCommandsNAND.SelectedTab.Text & " " & Chr(34) & DumpFileNAND & Chr(34) & " " & "NUL" & " " & NumericUpDownDumpsNAND.Value & " " & CheckBoxBinCompNAND.Checked)
185 |
186 | End Sub
187 |
188 | Private Sub NumericUpDownDumpsNAND_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDownDumpsNAND.ValueChanged
189 | If NumericUpDownDumpsNAND.Value = 1 Then
190 | CheckBoxBinCompNAND.Enabled = False
191 | CheckBoxBinCompNAND.Checked = False
192 | Else
193 | CheckBoxBinCompNAND.Enabled = True
194 | End If
195 | End Sub
196 |
197 | Private Sub SaveToButtonNAND_Click(sender As Object, e As EventArgs) Handles SaveToButtonNAND.Click
198 | If SaveFileDialogNAND.ShowDialog(Me) <> Windows.Forms.DialogResult.OK Then
199 | Exit Sub
200 | End If
201 | SaveToTextBoxNAND.Text = SaveFileDialogNAND.FileName
202 | End Sub
203 |
204 | Private Sub SaveToTextBoxNAND_TextChanged(sender As Object, e As EventArgs) Handles SaveToTextBoxNAND.TextChanged
205 | If SaveToTextBoxNAND.Text <> "" Then
206 | StartNANDdumpButton.Enabled = True
207 | Else
208 | StartNANDdumpButton.Enabled = False
209 | End If
210 | End Sub
211 |
212 | 'Onglet NANDwrite *****************************************************************************************
213 | Private Sub StartNANDwriteButton_Click(sender As Object, e As EventArgs) Handles StartNANDwriteButton.Click
214 | Dim VerifyArgument As String
215 | If CheckBoxVerifyNAND.Checked = True Then
216 | VerifyArgument = "V"
217 | Else
218 | VerifyArgument = ""
219 | End If
220 |
221 | Dim DiffArgument As String
222 | If CheckBoxDiffNAND.Checked = True Then
223 | DiffArgument = "DIFF"
224 | Else
225 | DiffArgument = ""
226 | End If
227 |
228 |
229 | TeensyBlinkNAND.Visible = True
230 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & VerifyArgument & DiffArgument & TabCommandsNAND.SelectedTab.Text & " " & Chr(34) & WriteWithTextBoxNAND.Text & Chr(34) & " " & Chr(34) & DiffWithTextBoxNAND.Text & Chr(34))
231 |
232 | End Sub
233 |
234 | Private Sub WriteWithButtonNAND_Click(sender As Object, e As EventArgs) Handles WriteWithButtonNAND.Click
235 | If OpenFileDumpNAND.ShowDialog(Me) <> Windows.Forms.DialogResult.OK Then
236 | Exit Sub
237 | End If
238 | WriteWithTextBoxNAND.Text = OpenFileDumpNAND.FileName
239 | End Sub
240 |
241 | Private Sub WriteWithTextBoxNAND_TextChanged(sender As Object, e As EventArgs) Handles WriteWithTextBoxNAND.TextChanged
242 | EnableStartNANDwriteButton()
243 | End Sub
244 |
245 | Private Sub CheckBoxDiffNAND_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBoxDiffNAND.CheckedChanged
246 | If CheckBoxDiffNAND.Checked = True Then
247 | DiffWithButtonNAND.Enabled = True
248 | Else
249 | DiffWithButtonNAND.Enabled = False
250 | DiffWithTextBoxNAND.Clear()
251 | End If
252 | EnableStartNANDwriteButton()
253 | End Sub
254 |
255 | Private Sub DiffWithButtonNAND_Click(sender As Object, e As EventArgs) Handles DiffWithButtonNAND.Click
256 | If OpenFileDiffNAND.ShowDialog(Me) <> Windows.Forms.DialogResult.OK Then
257 | Exit Sub
258 | End If
259 | DiffWithTextBoxNAND.Text = OpenFileDiffNAND.FileName
260 | End Sub
261 |
262 | Private Sub DiffWithTextBoxNAND_TextChanged(sender As Object, e As EventArgs) Handles DiffWithTextBoxNAND.TextChanged
263 | EnableStartNANDwriteButton()
264 | End Sub
265 |
266 | Private Sub EnableStartNANDwriteButton()
267 | If WriteWithTextBoxNAND.Text <> "" And CheckBoxDiffNAND.Checked = False Then
268 | StartNANDwriteButton.Enabled = True
269 | ElseIf WriteWithTextBoxNAND.Text <> "" And DiffWithTextBoxNAND.Text <> "" Then
270 | StartNANDwriteButton.Enabled = True
271 | Else
272 | StartNANDwriteButton.Enabled = False
273 | End If
274 | End Sub
275 |
276 | 'Onglet NANDps3badblocks *****************************************************************************************
277 | Private Sub StartNANDbbButton_Click(sender As Object, e As EventArgs) Handles StartNANDbbButton.Click
278 |
279 |
280 | TeensyBlinkNAND.Visible = True
281 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & TabCommandsNAND.SelectedTab.Text & " " & Chr(34) & BBwithTextBoxNAND.Text & Chr(34))
282 |
283 | End Sub
284 |
285 | Private Sub BBwithButtonNAND_Click(sender As Object, e As EventArgs) Handles BBwithButtonNAND.Click
286 | If OpenFileBBNAND.ShowDialog(Me) <> Windows.Forms.DialogResult.OK Then
287 | Exit Sub
288 | End If
289 | BBwithTextBoxNAND.Text = OpenFileBBNAND.FileName
290 | End Sub
291 |
292 | Private Sub BBwithTextBoxNAND_TextChanged(sender As Object, e As EventArgs) Handles BBwithTextBoxNAND.TextChanged
293 | StartNANDbbButton.Enabled = True
294 | End Sub
295 |
296 | 'Onglet SPIinfo *****************************************************************************************
297 | Private Sub StartSPIinfoButton_Click(sender As Object, e As EventArgs) Handles StartSPIinfoButton.Click
298 |
299 |
300 | TeensyBlinkSPI.Visible = True
301 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & TabCommandsSPI.SelectedTab.Text)
302 |
303 | End Sub
304 |
305 | 'Onglet SPIdump *****************************************************************************************
306 | Private Sub StartSPIdumpButton_Click(sender As Object, e As EventArgs) Handles StartSPIdumpButton.Click
307 |
308 | Dim DumpFileSPI As String = Replace(SaveToTextBoxSPI.Text, ".bin", "")
309 | DumpFileSPI = Replace(DumpFileSPI, ".BIN", "")
310 |
311 |
312 | TeensyBlinkSPI.Visible = True
313 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & TabCommandsSPI.SelectedTab.Text & " " & Chr(34) & DumpFileSPI & Chr(34) & " " & "NUL" & " " & NumericUpDownDumpsSPI.Value & " " & CheckBoxBinCompSPI.Checked)
314 |
315 | End Sub
316 |
317 | Private Sub NumericUpDownDumpsSPI_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDownDumpsSPI.ValueChanged
318 | If NumericUpDownDumpsSPI.Value = 1 Then
319 | CheckBoxBinCompSPI.Enabled = False
320 | CheckBoxBinCompSPI.Checked = False
321 | Else
322 | CheckBoxBinCompSPI.Enabled = True
323 | End If
324 | End Sub
325 |
326 | Private Sub SaveToButtonSPI_Click(sender As Object, e As EventArgs) Handles SaveToButtonSPI.Click
327 | If SaveFileDialogSPI.ShowDialog(Me) <> Windows.Forms.DialogResult.OK Then
328 | Exit Sub
329 | End If
330 | SaveToTextBoxSPI.Text = SaveFileDialogSPI.FileName
331 | End Sub
332 |
333 | Private Sub SaveToTextBoxSPI_TextChanged(sender As Object, e As EventArgs) Handles SaveToTextBoxSPI.TextChanged
334 | If SaveToTextBoxSPI.Text <> "" Then
335 | StartSPIdumpButton.Enabled = True
336 | Else
337 | StartSPIdumpButton.Enabled = False
338 | End If
339 | End Sub
340 |
341 | 'Onglet SPIwrite *****************************************************************************************
342 | Private Sub StartSPIwriteButton_Click(sender As Object, e As EventArgs) Handles StartSPIwriteButton.Click
343 | Dim VerifyArgument As String
344 | If CheckBoxVerifySPI.Checked = True Then
345 | VerifyArgument = "V"
346 | Else
347 | VerifyArgument = ""
348 | End If
349 |
350 |
351 | TeensyBlinkSPI.Visible = True
352 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & VerifyArgument & TabCommandsSPI.SelectedTab.Text & " " & Chr(34) & WriteWithTextBoxSPI.Text & Chr(34))
353 |
354 | End Sub
355 |
356 | Private Sub WriteWithButtonSPI_Click(sender As Object, e As EventArgs) Handles WriteWithButtonSPI.Click
357 | If OpenFileDumpSPI.ShowDialog(Me) <> Windows.Forms.DialogResult.OK Then
358 | Exit Sub
359 | End If
360 | WriteWithTextBoxSPI.Text = OpenFileDumpSPI.FileName
361 | End Sub
362 |
363 | Private Sub WriteWithTextBoxSPI_TextChanged(sender As Object, e As EventArgs) Handles WriteWithTextBoxSPI.TextChanged
364 | If WriteWithTextBoxSPI.Text <> "" Then
365 | StartSPIwriteButton.Enabled = True
366 | Else
367 | StartSPIwriteButton.Enabled = False
368 | End If
369 | End Sub
370 |
371 | 'Onglet SPIerasechip *****************************************************************************************
372 | Private Sub StartSPIerasechipButton_Click(sender As Object, e As EventArgs) Handles StartSPIerasechipButton.Click
373 |
374 |
375 | TeensyBlinkSPI.Visible = True
376 | RunCommandCom("COMMANDS.EXE", TabControl1.SelectedTab.Text & TabCommandsSPI.SelectedTab.Text)
377 |
378 | End Sub
379 |
380 | 'load NORway.hex ********************************************************************************************
381 | Private Sub TeensyPicNOR_Click(sender As Object, e As EventArgs) Handles TeensyPicNOR.Click
382 |
383 | If OpenHexNOR.ShowDialog(Me) <> Windows.Forms.DialogResult.OK Then
384 | Exit Sub
385 | End If
386 |
387 | If OpenHexNOR.FileName <> "" Then
388 |
389 |
390 | TeensyBlinkNOR.Visible = True
391 | RunCommandCom("COMMANDS.EXE", "TeensyLoad" & " " & Chr(34) & OpenHexNOR.FileName & Chr(34))
392 |
393 | End If
394 |
395 | End Sub
396 |
397 | 'load NANDway.hex ********************************************************************************************
398 | Private Sub TeensyPicNAND_Click(sender As Object, e As EventArgs) Handles TeensyPicNAND.Click
399 |
400 | If OpenHexNAND.ShowDialog(Me) <> Windows.Forms.DialogResult.OK Then
401 | Exit Sub
402 | End If
403 |
404 | If OpenHexNAND.FileName <> "" Then
405 |
406 |
407 | TeensyBlinkNAND.Visible = True
408 | RunCommandCom("COMMANDS.EXE", "TeensyLoad" & " " & Chr(34) & OpenHexNAND.FileName & Chr(34))
409 |
410 | End If
411 |
412 | End Sub
413 |
414 | 'load SPIway.hex ********************************************************************************************
415 | Private Sub TeensyPicSPI_Click(sender As Object, e As EventArgs) Handles TeensyPicSPI.Click
416 |
417 | If OpenHexSPI.ShowDialog(Me) <> Windows.Forms.DialogResult.OK Then
418 | Exit Sub
419 | End If
420 |
421 | If OpenHexSPI.FileName <> "" Then
422 |
423 |
424 | TeensyBlinkSPI.Visible = True
425 | RunCommandCom("COMMANDS.EXE", "TeensyLoad" & " " & Chr(34) & OpenHexSPI.FileName & Chr(34))
426 |
427 | End If
428 |
429 | End Sub
430 |
431 | Private Sub TabNORwrite_Click(sender As Object, e As EventArgs) Handles TabNORwrite.Paint
432 |
433 | If System.IO.File.Exists("NORway.py") Then
434 | Dim RD As FileStream = New FileStream("NORway.py", FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
435 | Dim md5 As MD5CryptoServiceProvider = New MD5CryptoServiceProvider
436 | md5.ComputeHash(RD)
437 | RD.Close()
438 | Dim hash As Byte() = md5.Hash
439 | Dim SB As StringBuilder = New StringBuilder
440 | Dim b As Byte
441 | For Each b In hash
442 | SB.Append(String.Format("{0:x2}", b))
443 | Next
444 | If SB.ToString() = "37cd558bc2c89b61f5ba9a04827366a9" Then
445 | CheckBoxPFWwriteNOR.Enabled = True
446 | End If
447 | End If
448 |
449 | End Sub
450 |
451 | Private Sub TabNORverify_Click(sender As Object, e As EventArgs) Handles TabNORverify.Paint
452 |
453 | If System.IO.File.Exists("NORway.py") Then
454 | Dim RD As FileStream = New FileStream("NORway.py", FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
455 | Dim md5 As MD5CryptoServiceProvider = New MD5CryptoServiceProvider
456 | md5.ComputeHash(RD)
457 | RD.Close()
458 | Dim hash As Byte() = md5.Hash
459 | Dim SB As StringBuilder = New StringBuilder
460 | Dim b As Byte
461 | For Each b In hash
462 | SB.Append(String.Format("{0:x2}", b))
463 | Next
464 | If SB.ToString() = "37cd558bc2c89b61f5ba9a04827366a9" Then
465 | CheckBoxPFWverifyNOR.Enabled = True
466 | End If
467 | End If
468 |
469 | End Sub
470 | End Class
471 |
472 |
--------------------------------------------------------------------------------
/sources console version/NORway_launcher.bat:
--------------------------------------------------------------------------------
1 | @title NORway Launcher
2 | @echo off
3 | set path=%systemroot%\system32;%systemroot%\system32\wbem
4 |
5 | rem deactivate before compile
6 | set MYFILES="%CD%"
7 |
8 | SET language=
9 | FOR /F "tokens=3" %%G in ('reg query hklm\system\controlset001\control\nls\language /v Installlanguage ^| findstr "Installlanguage"') DO (
10 | IF [%%G] EQU [040C] (set language=FR)
11 | IF [%%G] EQU [080C] (set language=FR)
12 | IF [%%G] EQU [0C0C] (set language=FR)
13 | IF [%%G] EQU [100C] (set language=FR)
14 | IF [%%G] EQU [140C] (set language=FR)
15 | )
16 | IF [%language%] EQU [] (set language=EN)
17 |
18 | call %MYFILES%\language_%language%.bat
19 |
20 | color 0A
21 |
22 | echo V1.9
23 | rem ChangeColor 14 0
24 | echo _ _ ____ _____
25 | echo ^| \ ^| ^|/ __ \^| __ \
26 | echo ^| \^| ^| ^| ^| ^| ^|__) ^|_ ____ _ _ _
27 | echo ^| . ` ^| ^| ^| ^| _ /\ \_/\_/ / _` ^| ^| ^| ^|
28 | echo ^| ^|\ ^| ^|__^| ^| ^| \ \ \ / (_^| ^| ^|_^| ^|
29 | echo ^|_^| \_^|\____/^|_^| \_\ \_/\_/ \__,_^|\__, ^|
30 | echo _ _ __/ ^|
31 | echo ^| ^| ^| ^| ^|___/
32 | echo ^| ^| __ _ _ _ _ __ ___^| ^|__ ___ _ __
33 | echo ^| ^|/ _` ^| ^| ^| ^| '_ \ / __^| '_ \ / _ \ '__^|
34 | echo ^| ^| (_^| ^| ^|_^| ^| ^| ^| ^| (__^| ^| ^| ^| __/ ^|
35 | echo ^|_^|\__,_^|\__,_^|_^| ^|_^|\___^|_^| ^|_^|\___^|_^|
36 | echo.
37 | rem ChangeColor 10 0
38 | echo -------------------------------------------------------------------------------
39 | echo %TXT_intro_line1%
40 | echo %TXT_intro_line2%
41 | echo %TXT_intro_line3%
42 | echo %TXT_intro_line4%
43 | echo.
44 | rem ChangeColor 12 0
45 | echo %TXT_disclaimer_line1%
46 | echo %TXT_disclaimer_line2%
47 | rem ChangeColor 10 0
48 | echo -------------------------------------------------------------------------------
49 | echo.
50 | pause
51 |
52 | if not exist %systemroot%\system32\wbem\wmic.exe goto warning_version
53 |
54 | if not exist norway.py goto warning_norwayfile
55 |
56 | :commandes
57 | cls
58 | rem ChangeColor 14 0
59 | echo *******************************************************************************
60 | echo NORway Launcher V1.9, by littlebalup
61 | echo *******************************************************************************
62 | echo.
63 | rem ChangeColor 10 0
64 | echo.
65 | echo %TXT_cmd_tittle%
66 | echo 1 = %TXT_cmd_INFO%
67 | echo 2 = %TXT_cmd_DUMP%
68 | echo 3 = %TXT_cmd_WRITE%
69 | echo 4 = %TXT_cmd_VWRITE%
70 | echo 5 = %TXT_cmd_WRITEWORD%
71 | echo 6 = %TXT_cmd_VWRITEWORD%
72 | echo 7 = %TXT_cmd_WRITEWORDUBM%
73 | echo 8 = %TXT_cmd_VWRITEWORDUBM%
74 | echo 9 = %TXT_cmd_VERIFY%
75 | echo E = %TXT_cmd_ERASECHIP%
76 | echo R = %TXT_cmd_RELEASE%
77 | echo Q = %TXT_cmd_quit%
78 | echo.
79 | %MYFILES%\choice /C:123456789ERQ /N "%TXT_cmd_choose% : "
80 | if %errorlevel%==1 goto info
81 | if %errorlevel%==2 goto dump
82 | if %errorlevel%==3 goto write
83 | if %errorlevel%==4 goto vwrite
84 | if %errorlevel%==5 goto writeword
85 | if %errorlevel%==6 goto vwriteword
86 | if %errorlevel%==7 goto writewordubm
87 | if %errorlevel%==8 goto vwritewordubm
88 | if %errorlevel%==9 goto verify
89 | if %errorlevel%==10 goto erasechip
90 | if %errorlevel%==11 goto release
91 | if %errorlevel%==12 goto end
92 | goto end
93 |
94 | :info
95 | set teensy_port=
96 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
97 | echo.
98 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
99 | echo.
100 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% INFO "
101 | if %errorlevel%==2 goto commandes
102 | rem ChangeColor 7 0
103 | echo.
104 | echo -------------------------------------------------------------------------------
105 | norway.py %teensy_port% info
106 | echo -------------------------------------------------------------------------------
107 | echo.
108 | if %errorlevel% NEQ 0 goto erreur
109 | rem ChangeColor 10 0
110 | pause
111 | cls
112 | goto commandes
113 |
114 | :dump
115 | set file_name=
116 | set teensy_port=
117 | set nbr_dump=
118 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
119 | echo.
120 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
121 | echo.
122 | :rtn_a
123 | set /p nbr_dump= %TXT_dump_nbr% :
124 | echo %nbr_dump%|findstr /r /c:"^[0-9][0-9]*$" >nul
125 | if "%nbr_dump%" EQU "" goto rtn_a
126 | if %nbr_dump%==0 goto commandes
127 | if %errorlevel%==1 goto rtn_a
128 | :rtn_b
129 | set /p file_name= %TXT_dump_name% :
130 | if "%file_name%" EQU "" goto rtn_b
131 | echo %TXT_dump_saveas% %CD%\%file_name%_*.bin
132 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% DUMP %TXT_cmd_validate2% "
133 | if %errorlevel%==2 goto commandes
134 | set /a VAR=0
135 | :dmpretour
136 | if %VAR%==%nbr_dump% goto dmpfin
137 | set /a VAR=VAR+1
138 | set dump_file_name=%file_name%_%VAR%.bin
139 | rem ChangeColor 7 0
140 | echo.
141 | echo -------------------------------------------------------------------------------
142 | norway.py %teensy_port% dump %dump_file_name%
143 | echo -------------------------------------------------------------------------------
144 | echo.
145 | if %errorlevel% NEQ 0 goto erreur
146 | rem ChangeColor 10 0
147 | echo %TXT_dump_savedas% %CD%\%dump_file_name%
148 | echo.
149 | goto dmpretour
150 | :dmpfin
151 | echo.
152 | if %nbr_dump% GTR 1 goto dmpchk
153 | pause
154 | cls
155 | goto commandes
156 | :dmpchk
157 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_dump_startcomp% "
158 | if %errorlevel%==2 goto commandes
159 | echo.
160 | rem ChangeColor 7 0
161 | echo -------------------------------------------------------------------------------
162 | set /a loop=0
163 | set /a errorresult=0
164 | set /a errorfile=0
165 | set /a errorcode=0
166 | if exist compare_log.txt del compare_log.txt
167 | echo NORway launcher, file compare log dated : %date% at %time% >> compare_log.txt
168 | echo. >> compare_log.txt
169 | :chkloop
170 | if %loop%==%nbr_dump% goto chkfin
171 | set /a loop=loop+1
172 | set /a VAR=%nbr_dump%-(%nbr_dump%-%loop%)
173 | :chkretour
174 | if %VAR%==%nbr_dump% goto chkloop
175 | set /a VAR=VAR+1
176 | echo %TXT_dump_compWait%
177 | fc /b %file_name%_%loop%.bin %file_name%_%VAR%.bin >> compare_log.txt
178 | if %errorlevel%==0 echo %file_name%_%loop%.bin %TXT_dump_compSame% %file_name%_%VAR%.bin
179 | if %errorlevel%==1 echo %file_name%_%loop%.bin %TXT_dump_compDiff% %file_name%_%VAR%.bin
180 | if %errorlevel%==1 (set /a errorresult=%errorlevel%)
181 | if %errorlevel%==2 (set /a errorfile=%errorlevel%)
182 | goto chkretour
183 | :chkfin
184 | echo. >> compare_log.txt
185 | echo END >> compare_log.txt
186 | set /a errorcode = %errorfile%%errorresult%
187 | echo Done.
188 | echo -------------------------------------------------------------------------------
189 | rem ChangeColor 10 0
190 | echo.
191 | if %errorcode%==0 echo %TXT_dump_compOK%
192 | rem ChangeColor 12 0
193 | if %errorcode%==1 echo %TXT_dump_compNOK%
194 | if %errorcode%==20 echo %TXT_dump_compERROR%
195 | if %errorcode%==21 echo %TXT_dump_compERROR%
196 | rem ChangeColor 10 0
197 | echo.
198 | pause
199 | cls
200 | goto commandes
201 |
202 | :write
203 | set activecmd=write
204 | set file_name=
205 | set teensy_port=
206 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
207 | echo.
208 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
209 | echo.
210 | rem ChangeColor 7 0
211 | echo -------------------------------------------------------------------------------
212 | echo %TXT_seefiles% %cd% :
213 | echo.
214 | dir /b *.bin
215 | echo -------------------------------------------------------------------------------
216 | rem ChangeColor 10 0
217 | :retour_write
218 | echo.
219 | set /p file_name= %TXT_write_with% :
220 | if not exist "%CD%\%file_name%" goto erreurfichier
221 | if "%file_name%" EQU "" goto erreurfichier
222 | for %%A in (%file_name%) do set filesize=%%~zA
223 | if not %filesize%==16777216 goto erreurtaillefichier
224 | echo %TXT_willwrite_with% %CD%\%file_name%
225 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% WRITE %TXT_cmd_validate2% "
226 | if %errorlevel%==2 goto commandes
227 | rem ChangeColor 7 0
228 | echo.
229 | echo -------------------------------------------------------------------------------
230 | norway.py %teensy_port% write %file_name%
231 | echo -------------------------------------------------------------------------------
232 | echo.
233 | if %errorlevel% NEQ 0 goto erreur
234 | rem ChangeColor 10 0
235 | pause
236 | cls
237 | goto commandes
238 |
239 | :vwrite
240 | set activecmd=vwrite
241 | set file_name=
242 | set teensy_port=
243 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
244 | echo.
245 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
246 | echo.
247 | rem ChangeColor 7 0
248 | echo -------------------------------------------------------------------------------
249 | echo %TXT_seefiles% %cd% :
250 | echo.
251 | dir /b *.bin
252 | echo -------------------------------------------------------------------------------
253 | rem ChangeColor 10 0
254 | :retour_vwrite
255 | echo.
256 | set /p file_name= %TXT_write_with% :
257 | if not exist "%CD%\%file_name%" goto erreurfichier
258 | if "%file_name%" EQU "" goto erreurfichier
259 | for %%A in (%file_name%) do set filesize=%%~zA
260 | if not %filesize%==16777216 goto erreurtaillefichier
261 | echo %TXT_willwrite_with% %CD%\%file_name%
262 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% VWRITE %TXT_cmd_validate2% "
263 | if %errorlevel%==2 goto commandes
264 | rem ChangeColor 7 0
265 | echo.
266 | echo -------------------------------------------------------------------------------
267 | norway.py %teensy_port% vwrite %file_name%
268 | echo -------------------------------------------------------------------------------
269 | echo.
270 | if %errorlevel% NEQ 0 goto erreur
271 | rem ChangeColor 10 0
272 | pause
273 | cls
274 | goto commandes
275 |
276 | :writeword
277 | set activecmd=writeword
278 | set file_name=
279 | set teensy_port=
280 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
281 | echo.
282 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
283 | echo.
284 | rem ChangeColor 7 0
285 | echo -------------------------------------------------------------------------------
286 | echo %TXT_seefiles% %cd% :
287 | echo.
288 | dir /b *.bin
289 | echo -------------------------------------------------------------------------------
290 | rem ChangeColor 10 0
291 | :retour_writeword
292 | echo.
293 | set /p file_name= %TXT_write_with% :
294 | if not exist "%CD%\%file_name%" goto erreurfichier
295 | if "%file_name%" EQU "" goto erreurfichier
296 | for %%A in (%file_name%) do set filesize=%%~zA
297 | if not %filesize%==16777216 goto erreurtaillefichier
298 | echo %TXT_willwrite_with% %CD%\%file_name%
299 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% WRITEWORD %TXT_cmd_validate2% "
300 | if %errorlevel%==2 goto commandes
301 | rem ChangeColor 7 0
302 | echo.
303 | echo -------------------------------------------------------------------------------
304 | norway.py %teensy_port% writeword %file_name%
305 | echo -------------------------------------------------------------------------------
306 | echo.
307 | if %errorlevel% NEQ 0 goto erreur
308 | rem ChangeColor 10 0
309 | pause
310 | cls
311 | goto commandes
312 |
313 | :vwriteword
314 | set activecmd=vwriteword
315 | set file_name=
316 | set teensy_port=
317 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
318 | echo.
319 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
320 | echo.
321 | rem ChangeColor 7 0
322 | echo -------------------------------------------------------------------------------
323 | echo %TXT_seefiles% %cd% :
324 | echo.
325 | dir /b *.bin
326 | echo -------------------------------------------------------------------------------
327 | rem ChangeColor 10 0
328 | :retour_vwriteword
329 | echo.
330 | set /p file_name= %TXT_write_with% :
331 | if not exist "%CD%\%file_name%" goto erreurfichier
332 | if "%file_name%" EQU "" goto erreurfichier
333 | for %%A in (%file_name%) do set filesize=%%~zA
334 | if not %filesize%==16777216 goto erreurtaillefichier
335 | echo %TXT_willwrite_with% %CD%\%file_name%
336 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% VWRITEWORD %TXT_cmd_validate2% "
337 | if %errorlevel%==2 goto commandes
338 | rem ChangeColor 7 0
339 | echo.
340 | echo -------------------------------------------------------------------------------
341 | norway.py %teensy_port% vwriteword %file_name%
342 | echo -------------------------------------------------------------------------------
343 | echo.
344 | if %errorlevel% NEQ 0 goto erreur
345 | rem ChangeColor 10 0
346 | pause
347 | cls
348 | goto commandes
349 |
350 | :writewordubm
351 | set activecmd=writewordubm
352 | set file_name=
353 | set teensy_port=
354 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
355 | echo.
356 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
357 | echo.
358 | rem ChangeColor 7 0
359 | echo -------------------------------------------------------------------------------
360 | echo %TXT_seefiles% %cd% :
361 | echo.
362 | dir /b *.bin
363 | echo -------------------------------------------------------------------------------
364 | rem ChangeColor 10 0
365 | :retour_writewordubm
366 | echo.
367 | set /p file_name= %TXT_write_with% :
368 | if not exist "%CD%\%file_name%" goto erreurfichier
369 | if "%file_name%" EQU "" goto erreurfichier
370 | for %%A in (%file_name%) do set filesize=%%~zA
371 | if not %filesize%==16777216 goto erreurtaillefichier
372 | echo %TXT_willwrite_with% %CD%\%file_name%
373 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% WRITEWORDUBM %TXT_cmd_validate2% "
374 | if %errorlevel%==2 goto commandes
375 | rem ChangeColor 7 0
376 | echo.
377 | echo -------------------------------------------------------------------------------
378 | norway.py %teensy_port% writewordubm %file_name%
379 | echo -------------------------------------------------------------------------------
380 | echo.
381 | if %errorlevel% NEQ 0 goto erreur
382 | rem ChangeColor 10 0
383 | pause
384 | cls
385 | goto commandes
386 |
387 | :vwritewordubm
388 | set activecmd=vwritewordubm
389 | set file_name=
390 | set teensy_port=
391 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
392 | echo.
393 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
394 | echo.
395 | rem ChangeColor 7 0
396 | echo -------------------------------------------------------------------------------
397 | echo %TXT_seefiles% %cd% :
398 | echo.
399 | dir /b *.bin
400 | echo -------------------------------------------------------------------------------
401 | rem ChangeColor 10 0
402 | :retour_vwritewordubm
403 | echo.
404 | set /p file_name= %TXT_write_with% :
405 | if not exist "%CD%\%file_name%" goto erreurfichier
406 | if "%file_name%" EQU "" goto erreurfichier
407 | for %%A in (%file_name%) do set filesize=%%~zA
408 | if not %filesize%==16777216 goto erreurtaillefichier
409 | echo %TXT_willwrite_with% %CD%\%file_name%
410 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% VWRITEWORDUBM %TXT_cmd_validate2% "
411 | if %errorlevel%==2 goto commandes
412 | rem ChangeColor 7 0
413 | echo.
414 | echo -------------------------------------------------------------------------------
415 | norway.py %teensy_port% vwritewordubm %file_name%
416 | echo -------------------------------------------------------------------------------
417 | echo.
418 | if %errorlevel% NEQ 0 goto erreur
419 | rem ChangeColor 10 0
420 | pause
421 | cls
422 | goto commandes
423 |
424 | :verify
425 | set activecmd=verify
426 | set file_name=
427 | set teensy_port=
428 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
429 | echo.
430 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
431 | echo.
432 | rem ChangeColor 7 0
433 | echo -------------------------------------------------------------------------------
434 | echo %TXT_seefiles% %cd% :
435 | echo.
436 | dir /b *.bin
437 | echo -------------------------------------------------------------------------------
438 | rem ChangeColor 10 0
439 | :retour_verify
440 | echo.
441 | set /p file_name= %TXT_verify_with% :
442 | if not exist "%CD%\%file_name%" goto erreurfichier
443 | if "%file_name%" EQU "" goto erreurfichier
444 | for %%A in (%file_name%) do set filesize=%%~zA
445 | if not %filesize%==16777216 goto erreurtaillefichier
446 | echo %TXT_willverify_with% %CD%\%file_name%
447 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% VERifY %TXT_cmd_validate2% "
448 | if %errorlevel%==2 goto commandes
449 | rem ChangeColor 7 0
450 | echo.
451 | echo -------------------------------------------------------------------------------
452 | norway.py %teensy_port% verify %file_name%
453 | echo -------------------------------------------------------------------------------
454 | echo.
455 | if %errorlevel% NEQ 0 goto erreur
456 | rem ChangeColor 10 0
457 | pause
458 | cls
459 | goto commandes
460 |
461 | :erasechip
462 | set teensy_port=
463 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
464 | echo.
465 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
466 | echo.
467 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% ERASECHIP "
468 | if %errorlevel%==2 goto commandes
469 | rem ChangeColor 7 0
470 | echo.
471 | echo -------------------------------------------------------------------------------
472 | norway.py %teensy_port% erasechip
473 | echo -------------------------------------------------------------------------------
474 | echo.
475 | if %errorlevel% NEQ 0 goto erreur
476 | rem ChangeColor 10 0
477 | pause
478 | cls
479 | goto commandes
480 |
481 | :release
482 | set teensy_port=
483 | for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Description LIKE '%%Abstract Control Model%%'" Get DeviceID ^| FIND "COM"`) do set teensy_port=%%B
484 | echo.
485 | if "%teensy_port%" NEQ "" (echo %TXT_teensy_detect% %teensy_port%) else (goto erreurteensy)
486 | echo.
487 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_cmd_validate1% RELEASE "
488 | if %errorlevel%==2 goto commandes
489 | rem ChangeColor 7 0
490 | echo.
491 | echo -------------------------------------------------------------------------------
492 | norway.py %teensy_port% release
493 | echo -------------------------------------------------------------------------------
494 | echo.
495 | if %errorlevel% NEQ 0 goto erreur
496 | rem ChangeColor 10 0
497 | pause
498 | cls
499 | goto commandes
500 |
501 | :erreur
502 | rem ChangeColor 12 0
503 | echo %TXT_error%
504 | echo.
505 | rem ChangeColor 10 0
506 | pause
507 | cls
508 | goto commandes
509 |
510 | :erreurteensy
511 | rem ChangeColor 12 0
512 | echo %TXT_teensyerror_line1%
513 | echo %TXT_teensyerror_line2%
514 | echo.
515 | rem ChangeColor 10 0
516 | pause
517 | cls
518 | goto commandes
519 |
520 | :erreurfichier
521 | rem ChangeColor 12 0
522 | echo %TXT_error_nofile1% %CD%\%file_name% %TXT_error_nofile2%
523 | echo.
524 | rem ChangeColor 10 0
525 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_restart% "
526 | if %errorlevel%==1 (goto retour_%activecmd%) else (goto commandes)
527 |
528 | :erreurtaillefichier
529 | rem ChangeColor 12 0
530 | echo %TXT_error_sizefile1% %CD%\%file_name% %TXT_error_sizefile2% %filesize% %TXT_error_sizefile3%
531 | echo %TXT_error_sizefile4%
532 | echo.
533 | rem ChangeColor 10 0
534 | %MYFILES%\choice /C:%TXT_choiceYN% "%TXT_restart% "
535 | if %errorlevel%==1 (goto retour_%activecmd%) else (goto commandes)
536 |
537 | :warning_version
538 | cls
539 | rem ChangeColor 12 0
540 | echo.
541 | echo.
542 | echo.
543 | echo.
544 | echo.
545 | echo.
546 | echo.
547 | echo.
548 | echo %TXT_warningversion_line1%
549 | echo.
550 | echo %TXT_warningversion_line2%
551 | echo %TXT_warningversion_line3%
552 | echo.
553 | echo %TXT_warningversion_line4%
554 | echo.
555 | echo %TXT_warningversion_line5%
556 | echo.
557 | echo.
558 | echo.
559 | echo.
560 | echo.
561 | echo.
562 | echo.
563 | echo.
564 | rem ChangeColor 10 0
565 | pause
566 | goto end
567 |
568 | :warning_norwayfile
569 | cls
570 | rem ChangeColor 12 0
571 | echo.
572 | echo.
573 | echo.
574 | echo.
575 | echo.
576 | echo.
577 | echo.
578 | echo.
579 | echo %TXT_warningfiles_line1%
580 | echo.
581 | echo %TXT_warningfiles_line2%
582 | echo.
583 | echo %TXT_warningfiles_line3%
584 | echo.
585 | echo %TXT_warningfiles_line4%
586 | echo.
587 | echo.
588 | echo.
589 | echo.
590 | echo.
591 | echo.
592 | echo.
593 | echo.
594 | echo.
595 | rem ChangeColor 10 0
596 | pause
597 | goto end
598 |
599 | :end
600 | exit
601 |
602 |
--------------------------------------------------------------------------------
/NORway MOD/NORway.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | # *************************************************************************
3 | # NORway.py v0.7 (MOD 0.1 by littlebalup)
4 | #
5 | # Teensy++ 2.0 modifications by judges@eEcho.com
6 | # *************************************************************************
7 | # noralizer.py - NOR flasher for PS3
8 | #
9 | # Copyright (C) 2010-2011 Hector Martin "marcan"
10 | #
11 | # This code is licensed to you under the terms of the GNU GPL, version 2;
12 | # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
13 | # *************************************************************************
14 |
15 | import serial, time, datetime, sys, struct
16 |
17 | class TeensySerialError(Exception):
18 | pass
19 |
20 | class TeensySerial(object):
21 | BUFSIZE = 32768
22 |
23 | def __init__(self, port):
24 | self.ser = serial.Serial(port, 9600, timeout=300, rtscts=False, dsrdtr=False, xonxoff=False, writeTimeout=120)
25 | if self.ser is None:
26 | raise TeensySerialError("could not open serial %s")%port
27 | self.ser.flushInput()
28 | self.ser.flushOutput()
29 | self.obuf = ""
30 |
31 | def write(self, s):
32 | if isinstance(s,int):
33 | s = chr(s)
34 | elif isinstance(s,tuple) or isinstance(s,list):
35 | s = ''.join([chr(c) for c in s])
36 | self.obuf += s
37 | while len(self.obuf) > self.BUFSIZE:
38 | self.ser.write(self.obuf[:self.BUFSIZE])
39 | self.obuf = self.obuf[self.BUFSIZE:]
40 |
41 | def flush(self):
42 | if len(self.obuf):
43 | self.ser.write(self.obuf)
44 | self.ser.flush()
45 | self.obuf = ""
46 |
47 | def read(self, size):
48 | self.flush()
49 | data = self.ser.read(size)
50 | return data
51 |
52 | def readbyte(self):
53 | return ord(self.read(1))
54 |
55 | def close(self):
56 | print
57 | print "Closing serial device..."
58 | if self.ser is None:
59 | print "Device already closed."
60 | else:
61 | self.ser.close()
62 | print "Done."
63 |
64 | class NORError(Exception):
65 | pass
66 |
67 | STATUS_TRIST_N = 0x20
68 | STATUS_RESET_N = 0x10
69 | STATUS_READY = 0x08
70 | STATUS_CE_N = 0x04
71 | STATUS_WE_N = 0x02
72 | STATUS_OE_N = 0x01
73 |
74 | class NORFlasher(TeensySerial):
75 | MF_ID = 0
76 | DEVICE_ID = 0
77 | DEVICE_PROTECTED = 0
78 | RETRY_COUNT = 20
79 |
80 | def __init__(self, port):
81 | TeensySerial.__init__(self, port)
82 |
83 | def ping(self):
84 | self.write(0x02)
85 | self.write(0x03)
86 | val = self.readbyte()
87 | if val != 0x42:
88 | self.close()
89 | raise NORError("Ping failed (expected 0x42, got 0x%02x)"%val)
90 | val = self.readbyte()
91 | if val != 0xbd:
92 | self.close()
93 | raise NORError("Ping failed (expected 0xbd, got 0x%02x)"%val)
94 |
95 | def state(self):
96 | self.write(0x01)
97 | return self.readbyte()
98 |
99 | def manufacturer_id(self):
100 | self.writeat(0x555, 0xaa)
101 | self.writeat(0x2aa, 0x55)
102 | self.writeat(0x555, 0x90)
103 | self.addr(0x0)
104 | self.delay(10)
105 | self.write("\x14")
106 | self.readbyte()
107 | val = self.readbyte()
108 | self.reset = 1
109 | self.udelay(40)
110 | self.reset = 0
111 | self.udelay(40)
112 | self.ping()
113 | return val
114 |
115 | def device_id(self):
116 | self.writeat(0x555, 0xaa)
117 | self.writeat(0x2aa, 0x55)
118 | self.writeat(0x555, 0x90)
119 |
120 | self.addr(0x1)
121 | self.delay(10)
122 | self.write("\x14")
123 | self.readbyte()
124 | val = self.readbyte()
125 |
126 | self.addr(0x0e)
127 | self.delay(10)
128 | self.write("\x14")
129 | self.readbyte()
130 | val = (val << 8) | self.readbyte()
131 |
132 | self.addr(0x0f)
133 | self.delay(10)
134 | self.write("\x14")
135 | self.readbyte()
136 | val = (val << 8) | self.readbyte()
137 |
138 | self.reset = 1
139 | self.udelay(40)
140 | self.reset = 0
141 | self.udelay(40)
142 | self.ping()
143 | return val
144 |
145 | def checkprotection(self):
146 | self.writeat(0x555, 0xaa)
147 | self.writeat(0x2aa, 0x55)
148 | self.writeat(0x555, 0xc0)
149 |
150 | print
151 | print "Checking sector protection..."
152 | for offset in range(0, 0x800000, 0x10000):
153 | self.addr(offset)
154 | self.delay(10)
155 | self.write("\x14")
156 | self.readbyte()
157 | val = self.readbyte()
158 | if ((val & 1) == 0):
159 | print "Sector at 0x%06x is protected!"%offset
160 | self.DEVICE_PROTECTED = 1
161 |
162 | if (self.DEVICE_PROTECTED == 0):
163 | print "No protected sectors found!"
164 |
165 | self.writeat(0x0, 0x90)
166 | self.writeat(0x0, 0x0)
167 | self.delay(10)
168 |
169 | self.reset = 1
170 | self.udelay(40)
171 | self.reset = 0
172 | self.udelay(40)
173 | self.ping()
174 |
175 | def checkchip(self):
176 | if (self.MF_ID == 0):
177 | print
178 | print "Unknown chip manufacturer! Exiting..."
179 | self.close()
180 | sys.exit(1)
181 | if (self.DEVICE_ID == 0):
182 | print
183 | print "Unknown device id! Exiting..."
184 | self.close()
185 | sys.exit(1)
186 | if (self.DEVICE_PROTECTED == 1):
187 | print
188 | print "Device has protected sectors! Command not supported! Exiting..."
189 | self.close()
190 | sys.exit(1)
191 |
192 | def printstate(self):
193 | state = self.state()
194 | self.MF_ID = self.manufacturer_id()
195 | self.DEVICE_ID = self.device_id()
196 |
197 | if self.MF_ID == 0x01:
198 | print "NOR chip manufacturer: Spansion (0x%02x)"%self.MF_ID
199 | if self.DEVICE_ID == 0x7e2101:
200 | print "NOR chip type: S29GL128 (0x%06x)"%self.DEVICE_ID
201 | else:
202 | print "NOR chip type: unknown (0x%06x)"%self.DEVICE_ID
203 | self.DEVICE_ID = 0
204 | elif self.MF_ID == 0xEC:
205 | print "NOR chip manufacturer: Samsung (0x%02x)"%self.MF_ID
206 | if self.DEVICE_ID == 0x7e6660:
207 | print "NOR chip type: K8P2716UZC (0x%06x)"%self.DEVICE_ID
208 | elif self.DEVICE_ID == 0x7e0601:
209 | print "NOR chip type: K8Q2815UQB (0x%06x)"%self.DEVICE_ID
210 | else:
211 | print "NOR chip type: unknown (0x%06x)"%self.DEVICE_ID
212 | self.DEVICE_ID = 0
213 | elif self.MF_ID == 0xC2:
214 | print "NOR chip manufacturer: Macronix (0x%02x)"%self.MF_ID
215 | if self.DEVICE_ID == 0x7e2101:
216 | print "NOR chip type: MX29GL128 (0x%06x)"%self.DEVICE_ID
217 | else:
218 | print "NOR chip type: unknown (0x%06x)"%self.DEVICE_ID
219 | self.DEVICE_ID = 0
220 | else:
221 | print "NOR chip manufacturer: unknown (0x%02x)"%self.MF_ID
222 | print "NOR chip type: unknown (0x%06x)"%self.DEVICE_ID
223 | self.MF_ID = 0
224 | self.DEVICE_ID = 0
225 |
226 | if (self.MF_ID != 0xEC) and (self.MF_ID != 0x0) and (self.DEVICE_ID != 0x7e0601) and (self.DEVICE_ID != 0):
227 | self.checkprotection()
228 |
229 | print
230 | #print "{0:15} {1}".format("STATUS_TRIST_N:", bool(state & STATUS_TRIST_N))
231 | #print "{0:15} {1}".format("STATUS_RESET_N:", bool(state & STATUS_RESET_N))
232 | #print "{0:15} {1}".format("STATUS_READY:", bool(state & STATUS_READY))
233 | #print "{0:15} {1}".format("STATUS_CE_N:", bool(state & STATUS_CE_N))
234 | #print "{0:15} {1}".format("STATUS_WE_N:", bool(state & STATUS_WE_N))
235 | #print "{0:15} {1}".format("STATUS_OE_N:", bool(state & STATUS_OE_N))
236 | print "{0:15} {1}".format("STATUS_TRIST_N:", "HIGH" if (state & STATUS_TRIST_N) else "LOW")
237 | print "{0:15} {1}".format("STATUS_RESET_N:", "HIGH" if (state & STATUS_RESET_N) else "LOW")
238 | print "{0:15} {1}".format("STATUS_READY:", "HIGH" if (state & STATUS_READY) else "LOW")
239 | print "{0:15} {1}".format("STATUS_CE_N:", "HIGH" if (state & STATUS_CE_N) else "LOW")
240 | print "{0:15} {1}".format("STATUS_WE_N:", "HIGH" if (state & STATUS_WE_N) else "LOW")
241 | print "{0:15} {1}".format("STATUS_OE_N:", "HIGH" if (state & STATUS_OE_N) else "LOW")
242 |
243 | #def _s_trist(self, v):
244 | # self.write(0x06 | bool(v))
245 | #def _g_trist(self):
246 | # return not (self.state() & STATUS_TRIST_N)
247 | #trist = property(_g_trist, _s_trist)
248 |
249 | def _s_reset(self, v):
250 | self.write(0x08 | bool(v))
251 | def _g_reset(self):
252 | return not (self.state() & STATUS_RESET_N)
253 | reset = property(_g_reset, _s_reset)
254 |
255 | # (0x0c | 0)=releaseports
256 | # (0x0c | 1)=initports
257 | def setports(self, v):
258 | self.write(0x06 | bool(v))
259 |
260 | def addr(self, v):
261 | assert 0 <= v <= 0x7FFFFF
262 | self.write((0x80 | (v >> 16), (v >> 8) & 0xff, v & 0xff))
263 |
264 | def wait(self, inc):
265 | self.write(0x0e | bool(inc))
266 |
267 | def writeword(self, data, inc):
268 | self.write((0x18 | bool(inc), (data>>8) & 0xff, data & 0xff))
269 |
270 | def writeat(self, addr, data):
271 | self.addr(addr)
272 | self.writeword(data, False)
273 |
274 | def bootloader(self):
275 | self.write("\x04")
276 | self.flush()
277 |
278 | def readsector(self, off, blocksize):
279 | assert (off & (blocksize/2-1)) == 0
280 | self.addr(off)
281 |
282 | if (blocksize == 0x1000):
283 | self.write("\x10")
284 | elif (blocksize == 0x2000):
285 | self.write("\x11")
286 | elif (blocksize == 0x10000):
287 | self.write("\x12")
288 | elif (blocksize == 0x20000):
289 | self.write("\x13")
290 |
291 | d = self.read(blocksize)
292 | return d
293 |
294 | def erasesector(self, off):
295 | offset_2nddie = 0
296 | if (self.MF_ID == 0xEC) and (self.DEVICE_ID == 0x7e0601):
297 | offset_2nddie = off & 0x400000
298 |
299 | self.writeat(0x555 + offset_2nddie, 0xaa)
300 | self.writeat(0x2aa + offset_2nddie, 0x55)
301 | self.writeat(0x555 + offset_2nddie, 0x80)
302 | self.writeat(0x555 + offset_2nddie, 0xaa)
303 | self.writeat(0x2aa + offset_2nddie, 0x55)
304 | self.writeat(off, 0x30)
305 | self.delay(10)
306 | self.wait(False)
307 | self.ping()
308 |
309 | def erasechip(self):
310 | self.writeat(0x555, 0xaa)
311 | self.writeat(0x2aa, 0x55)
312 | self.writeat(0x555, 0x80)
313 | self.writeat(0x555, 0xaa)
314 | self.writeat(0x2aa, 0x55)
315 | self.writeat(0x555, 0x10)
316 | self.delay(10)
317 | self.wait(False)
318 | self.ping()
319 |
320 | if (self.MF_ID == 0xEC) and (self.DEVICE_ID == 0x7e0601):
321 | self.writeat(0x555+0x400000, 0xaa)
322 | self.writeat(0x2aa+0x400000, 0x55)
323 | self.writeat(0x555+0x400000, 0x80)
324 | self.writeat(0x555+0x400000, 0xaa)
325 | self.writeat(0x2aa+0x400000, 0x55)
326 | self.writeat(0x555+0x400000, 0x10)
327 | self.delay(10)
328 | self.wait(False)
329 | self.ping()
330 |
331 | def programline(self, off, data):
332 | assert off&0x1f == 0
333 | if isinstance(data, str):
334 | data = struct.unpack(">%dH"%(len(data)/2), data)
335 | assert len(data) <= 32
336 | saddr = off & ~0x1f
337 | self.writeat(0x555, 0xaa)
338 | self.writeat(0x2aa, 0x55)
339 | self.writeat(saddr, 0x25)
340 | self.writeat(saddr, len(data)-1)
341 | self.addr(off)
342 | for d in data:
343 | self.writeword(d, True)
344 | self.writeat(saddr, 0x29)
345 | self.wait(False)
346 |
347 | def programword(self, off, data):
348 | if isinstance(data, str):
349 | data = struct.unpack(">%dH"%(len(data)/2), data)
350 | assert len(data) <= 2
351 |
352 | offset_2nddie = 0
353 | if (self.MF_ID == 0xEC) and (self.DEVICE_ID == 0x7e0601):
354 | offset_2nddie = addr & 0x400000
355 |
356 | self.writeat(0x555 + offset_2nddie, 0xaa)
357 | self.writeat(0x2aa + offset_2nddie, 0x55)
358 | self.writeat(0x555 + offset_2nddie, 0xa0)
359 | self.wait(False)
360 | self.writeat(off, data[0])
361 | self.wait(False)
362 |
363 | def program(self, addr, data, wordmode, ubm, noverify):
364 | ssize = self.getsectorsize(addr*2)
365 | assert len(data) == ssize
366 | #assert (addr & 0xffff) == 0
367 | assert (addr & (ssize/2-1)) == 0
368 |
369 | use2nddie = 0
370 | if (self.MF_ID == 0xEC) and (self.DEVICE_ID == 0x7e0601) and (addr & 0x400000):
371 | use2nddie = 1
372 |
373 | if (wordmode == True):
374 | if (noverify == False):
375 | self.write("\x0D")
376 | else:
377 | self.write("\x0C")
378 |
379 | odata = self.readsector(addr, ssize)
380 | if odata == data:
381 | return
382 |
383 | if odata != "\xff"*ssize:
384 | self.erasesector(addr)
385 |
386 | # 4KB blocks
387 | for block in range(0,ssize,0x1000):
388 | retries = self.RETRY_COUNT
389 | while retries != 0:
390 | self.addr(addr+(block/2))
391 | self.write(0x1A | use2nddie)
392 | self.write(data[block:block+0x1000])
393 |
394 | # read write status byte
395 | res = self.readbyte()
396 | # 'K' = okay, 'T' = timeout error when writing, 'R' = Teensy receive buffer timeout, 'V' = Verification error
397 | error_msg = ""
398 | if (res != 75): #'K'
399 | if (res == 84): #'T'
400 | error_msg = "RY/BY timeout error while writing!"
401 | elif (res == 82): #'R'
402 | self.close()
403 | raise NORError("Teensy receive buffer timeout! Disconnect and reconnect Teensy!")
404 | elif (res == 86): #'V'
405 | error_msg = "Verification error!"
406 | else:
407 | self.close()
408 | raise NORError("Received unknown error! (Got 0x%02x)"%val)
409 |
410 | self.reset = 1
411 | self.udelay(40)
412 | self.reset = 0
413 | self.udelay(40)
414 | self.ping()
415 |
416 | retries -= 1
417 |
418 | if (res == 86):
419 | print "(%d. Retry) %s"%(self.RETRY_COUNT-retries, error_msg)
420 | else:
421 | break
422 |
423 | if retries == 0:
424 | self.close()
425 | raise NORError("Verification failed")
426 | elif (ubm == True):
427 | if (noverify == False):
428 | self.write("\x0D")
429 | else:
430 | self.write("\x0C")
431 |
432 | odata = self.readsector(addr, ssize)
433 | if odata == data:
434 | return
435 |
436 | if odata != "\xff"*ssize:
437 | self.erasesector(addr)
438 |
439 | # 4KB blocks
440 | for block in range(0,ssize,0x1000):
441 | retries = self.RETRY_COUNT
442 | while retries != 0:
443 | # enter unlock bypass mode
444 | self.addr(addr+(block/2))
445 | self.write(0x1C | use2nddie)
446 | self.write(data[block:block+0x1000])
447 |
448 | # read write status byte
449 | res = self.readbyte()
450 | # 'K' = okay, 'T' = timeout error when writing, 'R' = Teensy receive buffer timeout, 'V' = Verification error
451 | error_msg = ""
452 | if (res != 75): #'K'
453 | if (res == 84): #'T'
454 | error_msg = "RY/BY timeout error while writing!"
455 | elif (res == 82): #'R'
456 | self.close()
457 | raise NORError("Teensy receive buffer timeout! Disconnect and reconnect Teensy!")
458 | elif (res == 86): #'V'
459 | error_msg = "Verification error!"
460 | else:
461 | self.close()
462 | raise NORError("Received unknown error! (Got 0x%02x)"%val)
463 |
464 | self.reset = 1
465 | self.udelay(40)
466 | self.reset = 0
467 | self.udelay(40)
468 | self.ping()
469 |
470 | retries -= 1
471 |
472 | if (res == 86):
473 | print "(%d. Retry) %s"%(self.RETRY_COUNT-retries, error_msg)
474 | else:
475 | break
476 |
477 | if retries == 0:
478 | self.close()
479 | raise NORError("Verification failed")
480 | else:
481 | odata = self.readsector(addr, ssize)
482 | if odata == data:
483 | return
484 |
485 | if odata != "\xff"*ssize:
486 | self.erasesector(addr)
487 |
488 | # 4KB blocks
489 | for block in range(0,ssize,0x1000):
490 | retries = self.RETRY_COUNT
491 | while retries != 0:
492 | self.addr(addr+(block/2))
493 | self.write("\x1E")
494 | self.write(data[block:block+0x1000])
495 |
496 | # read write status byte
497 | res = self.readbyte()
498 | # 'K' = okay, 'T' = timeout error when writing, 'R' = Teensy receive buffer timeout, 'V' = Verification error
499 | error_msg = ""
500 | if (res != 75): #'K'
501 | if (res == 84): #'T'
502 | error_msg = "RY/BY timeout error while writing!"
503 | elif (res == 82): #'R'
504 | self.close()
505 | raise NORError("Teensy receive buffer timeout! Disconnect and reconnect Teensy!")
506 | elif (res == 86): #'V'
507 | error_msg = "Verification error!"
508 | else:
509 | self.close()
510 | raise NORError("Received unknown error! (Got 0x%02x)"%val)
511 |
512 | self.reset = 1
513 | self.udelay(40)
514 | self.reset = 0
515 | self.udelay(40)
516 | self.ping()
517 |
518 | retries -= 1
519 |
520 | if (res == 86):
521 | print "(%d. Retry) %s"%(self.RETRY_COUNT-retries, error_msg)
522 | else:
523 | break
524 |
525 | if retries == 0:
526 | self.close()
527 | raise NORError("Verification failed")
528 |
529 | def writerange(self, addr, data, wordmode, ubm, noverify):
530 | if len(data) == 0:
531 | return
532 |
533 | datasize = len(data)
534 | start = addr
535 |
536 | if (noverify == False):
537 | self.write("\x0D")
538 | else:
539 | self.write("\x0C")
540 |
541 | print "Writing..."
542 | ssize = self.getsectorsize(addr)
543 | while len(data) >= ssize:
544 | print "\r%d KB / %d KB"%((addr-start)/1024, datasize/1024),
545 | sys.stdout.flush()
546 | self.program(addr/2, data[:ssize], wordmode, ubm, noverify)
547 | addr += ssize
548 | data = data[ssize:]
549 | ssize = self.getsectorsize(addr)
550 |
551 | print "\r%d KB / %d KB"%((addr-start)/1024, datasize/1024),
552 | sys.stdout.flush()
553 | print
554 |
555 | def verify(self, addr, data):
556 | BLOCK = 0x10000
557 | start = addr
558 | print
559 | print "Verifying..."
560 | for offset in range(0, len(data)/2, BLOCK):
561 | addr = start+offset*2
562 | nordata = self.readsector(addr/2, 0x20000)
563 | print "\r%d KB / %d KB"%((offset+BLOCK)/512, len(data)/1024),
564 | sys.stdout.flush()
565 | if (nordata == data[offset*2:offset*2+BLOCK*2]):
566 | continue
567 | else:
568 | print
569 | print "Verification failed! Please repeat command [%s]!"%self.getargs()
570 | self.close()
571 | sys.exit(1)
572 | print
573 |
574 | def getsectorsize(self, addr):
575 | s8kb = 0x2000
576 | s64kb = 0x10000
577 | s128kb = 0x20000
578 |
579 | #sector/block sizes for Samsung K8Q2815UQB
580 | if (self.MF_ID == 0xEC) and (self.DEVICE_ID == 0x7e0601):
581 | if (addr < 0x8000*2):
582 | return s8kb
583 | elif (addr >= 0x8000*2) and (addr < 0x3f8000*2):
584 | return s64kb
585 | elif (addr >= 0x3f8000*2) and (addr < 0x408000*2):
586 | return s8kb
587 | elif (addr >= 0x408000*2) and (addr < 0x7f8000*2):
588 | return s64kb
589 | else:
590 | return s8kb
591 |
592 | #sector/block size for all other NORs
593 | return s128kb
594 |
595 | def speedtest_read(self):
596 | self.write(0x0C)
597 | d = self.read(0x20000)
598 | return d
599 |
600 | def speedtest_write_data(self, addr, data):
601 | assert len(data) == 0x20000
602 | assert (addr & 0xffff) == 0
603 |
604 | # 4KB blocks
605 | for block in range(0,0x20000,0x1000):
606 | self.write(0x0D)
607 | self.write(data[block:block+0x1000])
608 |
609 | # read write status byte
610 | res = self.readbyte()
611 | # 'K' = okay, 'T' = timeout error when writing, 'R' = Teensy receive buffer timeout
612 | if (res != 75):
613 | print "Error: %c"%res
614 |
615 | def speedtest_write(self, addr, data):
616 | if len(data) == 0:
617 | return
618 |
619 | datasize = len(data)
620 | start = addr
621 |
622 | while len(data) >= 0x20000:
623 | print "\r%d KB / %d KB"%((addr-start)/1024, datasize/1024),
624 | sys.stdout.flush()
625 | self.speedtest_write_data(addr/2, data[:0x20000])
626 | addr += 0x20000
627 | data = data[0x20000:]
628 | print "\r%d KB / %d KB"%((addr-start)/1024, datasize/1024),
629 | sys.stdout.flush()
630 | print
631 |
632 | def delay(self, v):
633 | while v > 0x41:
634 | self.write(0x7f)
635 | v -= 0x41
636 | if v <= 0:
637 | return
638 | elif v == 1:
639 | self.write(0x00)
640 | else:
641 | self.write(0x40 | (v-2))
642 |
643 | def udelay(self, v):
644 | self.delay(v * 60)
645 |
646 | def closedevice(self):
647 | self.close()
648 |
649 | def getargs(self):
650 | args = ""
651 | for arg in sys.argv:
652 | if " " in arg:
653 | args = args + '"' + arg + '"' + " "
654 | else:
655 | args = args + arg + " "
656 | if len(args) > 0:
657 | args = args[0:len(args)-1]
658 | return args
659 |
660 | if __name__ == "__main__":
661 | print
662 | print "NORway.py v0.7 MOD 0.1 - Teensy++ 2.0 NOR flasher for PS3"
663 | print "Original by judges . Modded by littlebalup"
664 | print "(Orignal noralizer.py by Hector Martin \"marcan\" )"
665 | print
666 |
667 | if len(sys.argv) == 1:
668 | print "Usage:"
669 | print "%s serialport [command] [filename] [address]"%sys.argv[0]
670 | print
671 | print " serialport Name of serial port to open (eg. COM1, COM2, /dev/ttyACM0, etc)"
672 | print " command dump Reads entire NOR to [filename]"
673 | print " erase Erases one sector/block (128KB/64KB/8KB) at [address]"
674 | print " erasechip Erases entire NOR"
675 | print " write Flashes (read-erase-modify-write) [filename]"
676 | print " at [address] to NOR (buffered programming mode)"
677 | print " writeword Flashes (read-erase-modify-write) [filename]"
678 | print " at [address] to NOR (word programming mode)"
679 | print " writewordubm Flashes (read-erase-modify-write) [filename]"
680 | print " at [address] to NOR (word prgrmmng/unlock bypass mode)"
681 | print " vwrite Flashes (read-erase-modify-write-verify) [filename]"
682 | print " at [address] to NOR (buffered programming mode)"
683 | print " vwriteword Flashes (read-erase-modify-write-verify) [filename]"
684 | print " at [address] to NOR (word programming mode)"
685 | print " vwritewordubm Flashes (read-erase-modify-write-verify) [filename]"
686 | print " at [address] to NOR (word prgrmmng/unlock bypass mode)"
687 | print " verify Verifies NOR content with [filename] at [address]"
688 | print " release Releases NOR interface, so the PS3 can boot"
689 | print " bootloader Enters Teensy's bootloader mode"
690 | print " filename Filename for [dump|(v)write|(v)writeword|(v)writewordubm|verify]"
691 | print " address Address for [erase|(v)write|(v)writeword|(v)writewordubm|verify]"
692 | print " Default is 0x0, address must be aligned (multiple of 0x20000)."
693 | print " Use \"perfw\" instead of an adress to write only PerFirmware datas"
694 | print " from the dump file to the NOR (adress 0x40000, length 0xE80000)."
695 | print
696 | print "Examples:"
697 | print " %s COM1"%sys.argv[0]
698 | print " %s COM1 dump d:\myflash.bin"%sys.argv[0]
699 | print " %s COM1 erase 0x20000"%sys.argv[0]
700 | print " %s COM1 erasechip"%sys.argv[0]
701 | print " %s COM1 write d:\myflash.bin"%sys.argv[0]
702 | print " %s COM1 write d:\myflash.bin 0xA0000"%sys.argv[0]
703 | print " %s COM1 write d:\myflash.bin perfw"%sys.argv[0]
704 | print " %s COM1 writeword d:\myflash.bin"%sys.argv[0]
705 | print " %s COM1 writewordubm d:\myflash.bin 0x40000"%sys.argv[0]
706 | print " %s COM1 verify d:\myflash.bin"%sys.argv[0]
707 | print " %s COM1 release"%sys.argv[0]
708 | sys.exit(0)
709 |
710 | n = NORFlasher(sys.argv[1])
711 | print "Pinging..."
712 | n.ping()
713 |
714 | print "Set SB to tristate"
715 | print
716 | n.setports(1)
717 | n.reset = 0
718 | #n.trist = 1
719 | n.printstate()
720 | print
721 | print "Resetting NOR..."
722 | n.reset = 1
723 | n.udelay(40)
724 | n.reset = 0
725 | n.udelay(40)
726 | n.ping()
727 | print "Ready."
728 |
729 | tStart = time.time()
730 | if len(sys.argv) == 4 and sys.argv[2] == "dump":
731 | BLOCK = 0x10000
732 | print
733 | print "Dumping NOR..."
734 | fo = open(sys.argv[3],"wb")
735 | for offset in range(0, 0x800000, BLOCK):
736 | fo.write(n.readsector(offset, 0x20000))
737 | print "\r%d KB / 16384 KB"%((offset+BLOCK)/512),
738 | sys.stdout.flush()
739 | print
740 | print "Done. [%s]"%(datetime.timedelta(seconds=time.time() - tStart))
741 | elif len(sys.argv) == 4 and sys.argv[2] == "erase":
742 | n.checkchip()
743 | print
744 | addr = int(sys.argv[3], 16)
745 | if addr & 0x1:
746 | print "Address must be even!"
747 | n.closedevice()
748 | sys.exit(1)
749 | print "Erasing sector/block at address %06x..."%addr,
750 | sys.stdout.flush()
751 | n.erasesector(addr/2)
752 | print "Done. [%s]"%(datetime.timedelta(seconds=time.time() - tStart))
753 | elif len(sys.argv) == 3 and sys.argv[2] == "erasechip":
754 | n.checkchip()
755 | print
756 | print "Erasing chip, might take a while... (1-3 minutes)"
757 | n.erasechip()
758 | print
759 | print "Done. [%s]"%(datetime.timedelta(seconds=time.time() - tStart))
760 | elif len(sys.argv) in (4,5) and (sys.argv[2] == "write" or sys.argv[2] == "vwrite"):
761 | n.checkchip()
762 | print
763 | data = open(sys.argv[3],"rb").read()
764 | addr = 0
765 | # littlebalup mod part
766 | if len(sys.argv) == 5:
767 | if sys.argv[4] == "perfw":
768 | f = open(sys.argv[3],"rb")
769 | f.seek(0x40000)
770 | data = f.read(0xE80000)
771 | f.close
772 | addr = 0x40000
773 | else:
774 | addr = int(sys.argv[4],16)
775 | # end of mod part
776 | if (n.MF_ID == 0xEC) and (n.DEVICE_ID == 0x7e0601):
777 | print "Buffered programming mode not supported for Samsung K8Q2815UQB!"
778 | print "Programming in unlock bypass mode (writewordubm)..."
779 | if sys.argv[2] == "write":
780 | n.writerange(addr, data, False, True, True)
781 | else:
782 | n.writerange(addr, data, False, True, False)
783 | else:
784 | if sys.argv[2] == "write":
785 | n.writerange(addr, data, False, False, True)
786 | else:
787 | n.writerange(addr, data, False, False, False)
788 | print "Done. [%s]"%(datetime.timedelta(seconds=time.time() - tStart))
789 | tStart = time.time()
790 | n.verify(addr, data)
791 | print "Done. [%s]"%(datetime.timedelta(seconds=time.time() - tStart))
792 | elif len(sys.argv) in (4,5) and (sys.argv[2] == "writeword" or sys.argv[2] == "vwriteword"):
793 | n.checkchip()
794 | print
795 | data = open(sys.argv[3],"rb").read()
796 | addr = 0
797 | # littlebalup mod part
798 | if len(sys.argv) == 5:
799 | if sys.argv[4] == "perfw":
800 | f = open(sys.argv[3],"rb")
801 | f.seek(0x40000)
802 | data = f.read(0xE80000)
803 | f.close
804 | addr = 0x40000
805 | else:
806 | addr = int(sys.argv[4],16)
807 | # end of mod part
808 | if sys.argv[2] == "writeword":
809 | n.writerange(addr, data, True, False, True)
810 | else:
811 | n.writerange(addr, data, True, False, False)
812 | print "Done. [%s]"%(datetime.timedelta(seconds=time.time() - tStart))
813 | tStart = time.time()
814 | n.verify(addr, data)
815 | print "Done. [%s]"%(datetime.timedelta(seconds=time.time() - tStart))
816 | elif len(sys.argv) in (4,5) and (sys.argv[2] == "writewordubm" or sys.argv[2] == "vwritewordubm"):
817 | n.checkchip()
818 | print
819 | data = open(sys.argv[3],"rb").read()
820 | addr = 0
821 | # littlebalup mod part
822 | if len(sys.argv) == 5:
823 | if sys.argv[4] == "perfw":
824 | f = open(sys.argv[3],"rb")
825 | f.seek(0x40000)
826 | data = f.read(0xE80000)
827 | f.close
828 | addr = 0x40000
829 | else:
830 | addr = int(sys.argv[4],16)
831 | # end of mod part
832 | if sys.argv[2] == "writewordubm":
833 | n.writerange(addr, data, False, True, True)
834 | else:
835 | n.writerange(addr, data, False, True, False)
836 | print "Done. [%s]"%(datetime.timedelta(seconds=time.time() - tStart))
837 | tStart = time.time()
838 | n.verify(addr, data)
839 | print "Done. [%s]"%(datetime.timedelta(seconds=time.time() - tStart))
840 | elif len(sys.argv) in (4,5) and sys.argv[2] == "verify":
841 | data = open(sys.argv[3],"rb").read()
842 | addr = 0
843 | # littlebalup mod part
844 | if len(sys.argv) == 5:
845 | if sys.argv[4] == "perfw":
846 | f = open(sys.argv[3],"rb")
847 | f.seek(0x40000)
848 | data = f.read(0xE80000)
849 | f.close
850 | addr = 0x40000
851 | else:
852 | addr = int(sys.argv[4],16)
853 | # end of mod part
854 | n.verify(addr, data)
855 | print "Done. [%s]"%(datetime.timedelta(seconds=time.time() - tStart))
856 | elif len(sys.argv) == 3 and sys.argv[2] == "release":
857 | print
858 | #n.trist = 0
859 | n.setports(0)
860 | print "NOR Released"
861 | elif len(sys.argv) == 3 and sys.argv[2] == "bootloader":
862 | print
863 | print "Entering Teensy's bootloader mode... Goodbye!"
864 | n.bootloader()
865 | n.closedevice()
866 | sys.exit(0)
867 | #elif len(sys.argv) == 4 and sys.argv[2] == "speedtest_read":
868 | # BLOCK = 0x10000
869 | # print
870 | # print "Measuring read performance..."
871 | # fo = open(sys.argv[3],"wb")
872 | # for offset in range(0, 0x800000, BLOCK):
873 | # fo.write(n.speedtest_read())
874 | # print "\r%d KB / 16384 KB"%((offset+BLOCK)/512),
875 | # sys.stdout.flush()
876 | # print
877 | # print "Done. [%s]"%(datetime.timedelta(seconds=time.time() - tStart))
878 | #elif len(sys.argv) in (4,5) and sys.argv[2] == "speedtest_write":
879 | # print
880 | # print "Measuring write performance..."
881 | # data = open(sys.argv[3],"rb").read()
882 | # addr = 0
883 | # if len(sys.argv) == 5:
884 | # addr = int(sys.argv[4],16)
885 | # n.speedtest_write(addr, data)
886 | # print "Done. [%s]"%(datetime.timedelta(seconds=time.time() - tStart))
887 |
888 | n.ping()
889 | n.closedevice()
890 |
--------------------------------------------------------------------------------