Jump to content

Firefox Thunderbird Supprimer écriture inclusive


Recommended Posts

Posted (edited)

Code pour Thunderbird :

Sur le bureau de Windows, créez un nouveau document texte (extension ".txt").
Si vous n'avez pas démasqué les extensions de Windows, (bon déjà vous méritez de mourir, ensuite) regardez sur Internet comment faire, je vais pas tout expliquer non plus.

Ouvrez-le, puis allez dans Fichier > Enregistrer sous...
et dans "Encodage" mettez "UTF-16 LE" ("Unicode" sous Windows 7).

Ensuite, copié-collez le code en Powershsell ci-dessous dans le fichier.

# Character encoding = UTF-16 LE (Byte Order Mark = FF FE)
# End-of-line = Windows (CR LF)

# Composants requis :
$current_folder = $PWD.Path



# Emplacement personnalisé du dossier contenant le fichier "thunderbird.exe".
# Vous pouvez le laisser vide. Exemple :
# $thunderbird_folder = "$current_folder\Mozilla Thunderbird"
$thunderbird_folder = ""



# Emplacements connus :
$thunderbird_folder_portable_32  = "$current_folder\App\Thunderbird"
$thunderbird_folder_portable_64  = "$current_folder\App\Thunderbird64"
$thunderbird_folder_installed_32 = "${env:ProgramFiles(x86)}\Mozilla Thunderbird"
$thunderbird_folder_installed_64 = "${$env:ProgramFiles}\Mozilla Thunderbird"

# Fichiers à réparer :
$thunderbird_corrupted_file_1 = "omni.ja"

# Réparations à faire :
$thunderbird_corrupted_file_1_error_ori = @()
$thunderbird_corrupted_file_1_error_fix = @()

$thunderbird_corrupted_file_1_error_ori += "7574696C69736174657572C2B774726963650A"
$thunderbird_corrupted_file_1_error_fix += "7574696C697361746575720A0A0A0A0A0A0A0A"
# utilisateur·trice => utilisateur

$thunderbird_corrupted_file_1_error_ori += "4A65616EC2B76E65204475706F6E740A"
$thunderbird_corrupted_file_1_error_fix += "4A65616E204475706F6E740A0A0A0A0A"
# Jean·ne Dupont => Jean Dupont

$thunderbird_corrupted_file_1_error_ori += "6A65616E2E6E652E6475706F6E74406578616D706C652E636F6D0A"
$thunderbird_corrupted_file_1_error_fix += "6A65616E2E6475706F6E74406578616D706C652E636F6D0A0A0A0A"
# jean.ne.dupont@example.com => jean.dupont@example.com

$thunderbird_corrupted_file_1_error_ori += "617665727469C2B765206C6F7273717565206C612067C3A96EC3A9726174696F6E20646520636CC3A92073657261207465726D696EC3A9652E0A"
$thunderbird_corrupted_file_1_error_fix += "617665727469206C6F7273717565206C612067C3A96EC3A9726174696F6E20646520636CC3A92073657261207465726D696EC3A9652E0A0A0A0A"
# averti·e lorsque la génération de clé sera terminée. => averti lorsque la génération de clé sera terminée.

$thunderbird_corrupted_file_1_error_ori += "617665727469C2B765206C6F7273717565206C612067C3A96EC3A9726174696F6E20646520636CC3A92073657261207465726D696EC3A9652E0A"
$thunderbird_corrupted_file_1_error_fix += "617665727469206C6F7273717565206C612067C3A96EC3A9726174696F6E20646520636CC3A92073657261207465726D696EC3A9652E0A0A0A0A"
# averti·e lorsque la génération de clé sera terminée. => averti lorsque la génération de clé sera terminée.

$thunderbird_corrupted_file_1_error_ori += "736174697366616974C2B7652064752072C3A973756C7461742E0A"
$thunderbird_corrupted_file_1_error_fix += "7361746973666169742064752072C3A973756C7461742E0A0A0A0A"
# satisfait·e du résultat. => satisfait du résultat.

$thunderbird_corrupted_file_1_error_ori += "636F6E6E656374C3A9C2B76520706C7573696575727320666F69732C20756E652061757472652073657373696F6E20706575742061766F6972207265C3A775206C65206D6573736167652E0A"
$thunderbird_corrupted_file_1_error_fix += "636F6E6E656374C3A920706C7573696575727320666F69732C20756E652061757472652073657373696F6E20706575742061766F6972207265C3A775206C65206D6573736167652E0A0A0A0A"
# connecté·e plusieurs fois, une autre session peut avoir reçu le message. => connecté plusieurs fois, une autre session peut avoir reçu le message.

$thunderbird_corrupted_file_1_error_ori += "70697374C3A9C2B7650A"
$thunderbird_corrupted_file_1_error_fix += "70697374C3A90A0A0A0A"
# pisté·e => pisté



$i_installation_type = 0
if ($thunderbird_folder -ne "")
{
	if (-not (Test-Path "$thunderbird_folder\$thunderbird_corrupted_file_1"))
	{
		Write-Host "Erreur, fichier non détecté :`r`n$thunderbird_folder\$thunderbird_corrupted_file_1"
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	$i_installation_type = 1
	Write-Host "Fichier détecté :`r`n$thunderbird_folder\$thunderbird_corrupted_file_1`r`n"
}
if (Test-Path "$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1")
{
	$i_installation_type = 2
	Write-Host "Fichier détecté :`r`n$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1`r`n"
}
if (Test-Path "$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1")
{
	$i_installation_type += 3
	Write-Host "Fichier détecté :`r`n$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1`r`n"
}
if (Test-Path "$thunderbird_folder_installed_32\$thunderbird_corrupted_file_1")
{
	$i_installation_type = 6
	Write-Host "Fichier détecté :`r`n$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1`r`n"
}
if (Test-Path "$thunderbird_folder_installed_64\$thunderbird_corrupted_file_1")
{
	$i_installation_type = 7
	Write-Host "Fichier détecté :`r`n$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1`r`n"
}

if ($i_installation_type -eq 0)
{
	Write-Host "Erreur, aucun fichier détecté."
	Write-Host "`r`nAppuyez sur une touche pour continuer..."
	$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
	exit 0
}
if ($i_installation_type -eq 1)
{
	if (Test-Path -Path "$thunderbird_folder\$thunderbird_corrupted_file_1.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$thunderbird_folder\$thunderbird_corrupted_file_1.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}
if ($i_installation_type -eq 2 -or $i_installation_type -eq 5)
{
	if (Test-Path -Path "$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}
if ($i_installation_type -eq 3 -or $i_installation_type -eq 5)
{
	if (Test-Path -Path "$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}
if ($i_installation_type -eq 6)
{
	if (Test-Path -Path "$thunderbird_folder_installed_32\$thunderbird_corrupted_file_1.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$thunderbird_folder_installed_32\$thunderbird_corrupted_file_1.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}
if ($i_installation_type -eq 7) {
	if (Test-Path -Path "$thunderbird_folder_installed_64\$thunderbird_corrupted_file_1.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$thunderbird_folder_installed_64\$thunderbird_corrupted_file_1.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}

if ($thunderbird_corrupted_file_1_error_ori.Length -ne $thunderbird_corrupted_file_1_error_fix.Length)
{
	Write-Host "Erreur :`r`nLe nombre de cases dans le tableau des chaînes hexadécimales à détecter`r`net dans le tableau des chaînes hexadécimales à remplacer n'est pas identique."
	Write-Host "`r`nAppuyez sur une touche pour continuer..."
	$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
	exit 0
}
for ($i = 0; $i -le $thunderbird_corrupted_file_1_error_ori.Length - 1; $i += 1)
{
	# Write-Host $($thunderbird_corrupted_file_1_error_ori[$i]) = $($thunderbird_corrupted_file_1_error_ori[$i].Length)`r`n$($thunderbird_corrupted_file_1_error_fix[$i]) = $($thunderbird_corrupted_file_1_error_fix[$i].Length)
	if ($thunderbird_corrupted_file_1_error_ori[$i].Length -ne $thunderbird_corrupted_file_1_error_fix[$i].Length)
	{
		Write-Host "Erreur :`r`nLa variable ""$($thunderbird_corrupted_file_1_error_ori[$i])"" et`r`nla variable ""$($thunderbird_corrupted_file_1_error_fix[$i])"""
		"n'ont pas le même nombre de caractères."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	if ($thunderbird_corrupted_file_1_error_ori[$i].Length % 2 -ne 0)
	{
		Write-Host "Erreur, les variables :`r`n$($thunderbird_corrupted_file_1_error_ori[$i])`r`n$($thunderbird_corrupted_file_1_error_fix[$i])`r`nont un nombre impair de caractères."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	if ($thunderbird_corrupted_file_1_error_ori[$i].Length -lt 12)
	{
		Write-Host "Erreur, les variables :`r`n$($thunderbird_corrupted_file_1_error_ori[$i])`r`n$($thunderbird_corrupted_file_1_error_fix[$i])`r`ndoivent avoir au moins 12 caractères hexadécimaux" `
		"`r`npour représenter au moins 6 octets.`r`nOr ici, elles n'en contiennent que $($thunderbird_corrupted_file_1_error_ori[$i].Length)."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}

if ($i_installation_type -eq 1)
{
	Out-File -FilePath "$thunderbird_folder\$thunderbird_corrupted_file_1.temporary" -Force -Encoding ASCII		# (Force = Écraser si existe déjà) (Encoding ASCII = Utiliser ASCII au lieu d'Unicode UTF16LE donc pas de Byte Order Mark FFFE)
	if (-not (Test-Path "$thunderbird_folder\$thunderbird_corrupted_file_1.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$thunderbird_folder\$thunderbird_corrupted_file_1.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
}
if ($i_installation_type -eq 2 -or $i_installation_type -eq 5)
{
	Out-File -FilePath "$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
}
if ($i_installation_type -eq 3 -or $i_installation_type -eq 5)
{
	Out-File -FilePath "$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
}
if ($i_installation_type -eq 6)
{
	Out-File -FilePath "$thunderbird_folder_installed_32\$thunderbird_corrupted_file_1.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$thunderbird_folder_installed_32\$thunderbird_corrupted_file_1.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$thunderbird_folder_installed_32\$thunderbird_corrupted_file_1.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
}
if ($i_installation_type -eq 7)
{
	Out-File -FilePath "$thunderbird_folder_installed_64\$thunderbird_corrupted_file_1.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$thunderbird_folder_installed_64\$thunderbird_corrupted_file_1.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$thunderbird_folder_installed_64\$thunderbird_corrupted_file_1.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
}

function i_my_replace_array_hex_strings_in_file([string[]]$array_hex_strings_to_find, [string[]]$array_hex_strings_to_replace, [string]$file_fullname)
{
	$file_input  = [System.IO.File]::OpenRead($file_fullname)		# Ouverture du fichier en lecture
	$file_output = [System.IO.File]::Create("$file_fullname.temporary")	# Ouverture du fichier en écriture

	$byte_buffer_read = New-Object byte[] 1
	$byte_buffer      = New-Object byte[] 0
	$i_byte_check     = 0
	$b_replacement_done  = $false
	$i_replacement_count = 0
	$i_1 = 0
	while ($file_input.Read($byte_buffer_read, 0, 1) -ne 0)
	{
		$byte_read        = $byte_buffer_read[0]
		# $character_read = [char]$byte_read
		# Write-Host "Caractère lu (code $($byte_read.ToString("X2"))) : $character_read"

		if ($b_replacement_done -eq $false)
		{
			# Pour aller plus vite, extraction des 5 premiers octets et conversion en décimal
			$byte_to_find_1 = [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(0, 2), 16)
			$byte_to_find_2 = [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(2, 2), 16)
			$byte_to_find_3 = [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(4, 2), 16)
			$byte_to_find_4 = [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(6, 2), 16)
			$byte_to_find_5 = [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(8, 2), 16)
			$b_replacement_done = $true
		}

		switch ($i_byte_check)
		{
			0
			{
				if ($byte_read -eq $byte_to_find_1)
				{
					$byte_buffer += $byte_read
					$i_byte_check = 1
				}
				break
			}
			1
			{
				if ($byte_read -eq $byte_to_find_2)
				{
					$byte_buffer += $byte_read
					$i_byte_check = 2
				}
				else
				{
					$file_output.Write($byte_buffer, 0, $byte_buffer.Length)
					$byte_buffer  = @()
					$i_byte_check = 0
				}
				break
			}
			2
			{
				if ($byte_read -eq $byte_to_find_3)
				{
					$byte_buffer += $byte_read
					$i_byte_check = 3
				}
				else
				{
					$file_output.Write($byte_buffer, 0, $byte_buffer.Length)
					$byte_buffer  = @()
					$i_byte_check = 0
				}
				break
			}
			3
			{
				if ($byte_read -eq $byte_to_find_4)
				{
					$byte_buffer += $byte_read
					$i_byte_check = 4
				}
				else
				{
					$file_output.Write($byte_buffer, 0, $byte_buffer.Length)
					$byte_buffer  = @()
					$i_byte_check = 0
				}
				break
			}
			4
			{
				if ($byte_read -eq $byte_to_find_5)
				{
					$byte_buffer += $byte_read
					$i_byte_check = 5
				}
				else
				{
					$file_output.Write($byte_buffer, 0, $byte_buffer.Length)
					$byte_buffer  = @()
					$i_byte_check = 0
				}
				break
			}
			default
			{
				if ($byte_read.ToString("X2") -eq $array_hex_strings_to_find[$i_1].Substring(2 * $i_byte_check, 2))
				{
					$byte_buffer += $byte_read
					$i_byte_check++
				}
				else
				{
					$file_output.Write($byte_buffer, 0, $byte_buffer.Length)
					$byte_buffer  = @()
					$i_byte_check = 0
				}
				if ($i_byte_check -eq $array_hex_strings_to_find[$i_1].Length / 2)
				{
					for ($i_2 = 0; $i_2 -lt $array_hex_strings_to_replace[$i_1].Length; $i_2 += 2)
					{
						$file_output.WriteByte([byte]::Parse($array_hex_strings_to_replace[$i_1].Substring($i_2, 2), [System.Globalization.NumberStyles]::HexNumber))
					}
					$byte_buffer  = @()
					$i_byte_check = 0
					$b_replacement_done = $false
					$i_replacement_count++
					Write-Host "Fichier :`r`n$file_fullname`r`nSéquence trouvée :`r`n$($array_hex_strings_to_find[$i_1])`r`nRemplacée par :`r`n$($array_hex_strings_to_replace[$i_1])`r`n"
					if ($i_1 -lt $array_hex_strings_to_find.Length - 1)
					{
						$i_1++
					}
				}
			}
		}

		if ($i_byte_check -eq 0 -and $b_replacement_done -eq $true)
		{
			$file_output.WriteByte($byte_read)
		}
	}

        $file_input.Close()
        $file_output.Close()
        $file_input.Dispose()
        $file_output.Dispose()
	return $i_replacement_count
}

if ($i_installation_type -eq 1)
{
	$number_of_replacements_1 = i_my_replace_array_hex_strings_in_file $thunderbird_corrupted_file_1_error_ori $thunderbird_corrupted_file_1_error_fix ("$thunderbird_folder\$thunderbird_corrupted_file_1")
	Write-Host "$number_of_replacements_1 remplacement(s) effectué(s) sur le fichier :`r`n$thunderbird_folder\$thunderbird_corrupted_file_1`r`n"
}

if ($i_installation_type -eq 2 -or $i_installation_type -eq 5)
{
	$number_of_replacements_1 = i_my_replace_array_hex_strings_in_file $thunderbird_corrupted_file_1_error_ori $thunderbird_corrupted_file_1_error_fix ("$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1")
	Write-Host "$number_of_replacements_1 remplacement(s) effectué(s) sur le fichier :`r`n$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1`r`n"
}
if ($i_installation_type -eq 3 -or $i_installation_type -eq 5)
{
	$number_of_replacements_1 = i_my_replace_array_hex_strings_in_file $thunderbird_corrupted_file_1_error_ori $thunderbird_corrupted_file_1_error_fix ("$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1")
	Write-Host "$number_of_replacements_1 remplacement(s) effectué(s) sur le fichier :`r`n$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1`r`n"
}
if ($i_installation_type -eq 6)
{
	$number_of_replacements_1 = i_my_replace_array_hex_strings_in_file $thunderbird_corrupted_file_1_error_ori $thunderbird_corrupted_file_1_error_fix ("$thunderbird_folder_installed_32\$thunderbird_corrupted_file_1")
	Write-Host "$number_of_replacements_1 remplacement(s) effectué(s) sur le fichier :`r`n$thunderbird_folder_installed_32\$thunderbird_corrupted_file_1`r`n"
}
if ($i_installation_type -eq 7)
{
	$number_of_replacements_1 = i_my_replace_array_hex_strings_in_file $thunderbird_corrupted_file_1_error_ori $thunderbird_corrupted_file_1_error_fix ("$thunderbird_folder_installed_64\$thunderbird_corrupted_file_1")
	Write-Host "$number_of_replacements_1 remplacement(s) effectué(s) sur le fichier :`r`n$thunderbird_folder_installed_64\$thunderbird_corrupted_file_1`r`n"
}

function i_my_rename_file([string]$file_fullname, [string]$file_fullname_new)
{
	if (-not (Test-Path $file_fullname))
	{
		Write-Host "Erreur, le fichier :`r`n$file_fullname`r`nn'existe pas, impossible de le renommer en :`r`n$file_fullname_new"
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}

	# Write-Host "On renomme le fichier :`r`n$file_fullname`r`nen :`r`n$file_fullname_new"
        Rename-Item -Path $file_fullname -NewName $file_fullname_new -ErrorAction Stop

	if (-not (Test-Path $file_fullname_new))
	{
		Write-Host "Erreur, le fichier :`r`n$file_fullname`r`nn'a pas pu être renommé."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}

	return 0
}

if ($i_installation_type -eq 1)
{
	$i_return = i_my_rename_file "$thunderbird_folder\$thunderbird_corrupted_file_1"           "$thunderbird_folder\$thunderbird_corrupted_file_1.bak"
	$i_return = i_my_rename_file "$thunderbird_folder\$thunderbird_corrupted_file_1.temporary" "$thunderbird_folder\$thunderbird_corrupted_file_1"
}
if ($i_installation_type -eq 2 -or $i_installation_type -eq 5)
{
	$i_return = i_my_rename_file "$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1"           "$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1.bak"
	$i_return = i_my_rename_file "$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1.temporary" "$thunderbird_folder_portable_32\$thunderbird_corrupted_file_1"
}
if ($i_installation_type -eq 3 -or $i_installation_type -eq 5)
{
	$i_return = i_my_rename_file "$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1"           "$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1.bak"
	$i_return = i_my_rename_file "$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1.temporary" "$thunderbird_folder_portable_64\$thunderbird_corrupted_file_1"
}
if ($i_installation_type -eq 6)
{
	$i_return = i_my_rename_file "$thunderbird_folder_installed_32\$thunderbird_corrupted_file_1"           "$thunderbird_folder_installed_32\$thunderbird_corrupted_file_1.bak"
	$i_return = i_my_rename_file "$thunderbird_folder_installed_32\$thunderbird_corrupted_file_1.temporary" "$thunderbird_folder_installed_32\$thunderbird_corrupted_file_1"
}
if ($i_installation_type -eq 7)
{
	$i_return = i_my_rename_file "$thunderbird_folder_installed_64\$thunderbird_corrupted_file_1"           "$thunderbird_folder_installed_64\$thunderbird_corrupted_file_1.bak"
	$i_return = i_my_rename_file "$thunderbird_folder_installed_64\$thunderbird_corrupted_file_1.temporary" "$thunderbird_folder_installed_64\$thunderbird_corrupted_file_1"
}

Write-Host "`r`nAppuyez sur une touche pour continuer..."
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
exit 0

Enregistrez et fermez le fichier, puis changez son extension ".txt" en ".ps1".

Si vous avez Thunderbird Portable, vous pouvez renommer le fichier en "ThunderbirdPortable - Supprimer écriture inclusive.ps1" par exemple.
Ensuite il faut placer le fichier script dans le dossier racine, par exemple : "D:\Programs\PortableApps\PortableApps\ThunderbirdPortable".
Si vous avez installé Thunderbird, vous pouvez mettre ce fichier depuis n'importe où.
Pour une autre installation, il vous suffit de modifier le début du script pour renseigner l'emplacement.

Ensuite double-cliquez dessus pour nettoyer les fichiers corrompus.

Bonus : voici une version du script en VisualBasic Script (exécutable en mode fenêtre ou en mode console). C'est plus lent mais si vous n'arrivez pas à utiliser le PowerShell, ça fonctionnera aussi :

' Character encoding = UTF-16 LE (Byte Order Mark = FF FE)
' End-of-line = Windows (CR LF)

' Composants requis :
set object_shell       = WScript.CreateObject("WScript.Shell")
set object_file_system = WScript.CreateObject("Scripting.FileSystemObject")
current_folder         = object_file_system.GetParentFolderName(WScript.ScriptFullName)



' Emplacement personnalisé du dossier contenant le fichier "thunderbird.exe".
' Vous pouvez le laisser vide. Exemple :
' thunderbird_folder = current_folder & "\Mozilla Thunderbird"
thunderbird_folder = ""



' Emplacements connus :
thunderbird_folder_portable_32  = current_folder & "\App\Thunderbird"
thunderbird_folder_portable_64  = current_folder & "\App\Thunderbird64"
thunderbird_folder_installed_32 = object_shell.ExpandEnvironmentStrings("%ProgramFiles(x86)%") & "\Mozilla Thunderbird"
thunderbird_folder_installed_64 = object_shell.ExpandEnvironmentStrings("%ProgramFiles%")      & "\Mozilla Thunderbird"

' Fichiers à réparer :
thunderbird_corrupted_file_1 = "omni.ja"

' Réparations à faire :
dim thunderbird_corrupted_file_1_error_ori()
dim thunderbird_corrupted_file_1_error_fix()

redim preserve thunderbird_corrupted_file_1_error_ori(0)
redim preserve thunderbird_corrupted_file_1_error_fix(0)
thunderbird_corrupted_file_1_error_ori(0) = "7574696C69736174657572C2B774726963650A"
thunderbird_corrupted_file_1_error_fix(0) = "7574696C697361746575720A0A0A0A0A0A0A0A"
' utilisateur·trice => utilisateur

redim preserve thunderbird_corrupted_file_1_error_ori(ubound(thunderbird_corrupted_file_1_error_ori) + 1)
redim preserve thunderbird_corrupted_file_1_error_fix(ubound(thunderbird_corrupted_file_1_error_fix) + 1)
thunderbird_corrupted_file_1_error_ori(1) = "4A65616EC2B76E65204475706F6E740A"
thunderbird_corrupted_file_1_error_fix(1) = "4A65616E204475706F6E740A0A0A0A0A"
' Jean·ne Dupont => Jean Dupont

redim preserve thunderbird_corrupted_file_1_error_ori(ubound(thunderbird_corrupted_file_1_error_ori) + 1)
redim preserve thunderbird_corrupted_file_1_error_fix(ubound(thunderbird_corrupted_file_1_error_fix) + 1)
thunderbird_corrupted_file_1_error_ori(2) = "6A65616E2E6E652E6475706F6E74406578616D706C652E636F6D0A"
thunderbird_corrupted_file_1_error_fix(2) = "6A65616E2E6475706F6E74406578616D706C652E636F6D0A0A0A0A"
' jean.ne.dupont@example.com => jean.dupont@example.com

redim preserve thunderbird_corrupted_file_1_error_ori(ubound(thunderbird_corrupted_file_1_error_ori) + 1)
redim preserve thunderbird_corrupted_file_1_error_fix(ubound(thunderbird_corrupted_file_1_error_fix) + 1)
thunderbird_corrupted_file_1_error_ori(3) = "617665727469C2B765206C6F7273717565206C612067C3A96EC3A9726174696F6E20646520636CC3A92073657261207465726D696EC3A9652E0A"
thunderbird_corrupted_file_1_error_fix(3) = "617665727469206C6F7273717565206C612067C3A96EC3A9726174696F6E20646520636CC3A92073657261207465726D696EC3A9652E0A0A0A0A"
' averti·e lorsque la génération de clé sera terminée. => averti lorsque la génération de clé sera terminée.

redim preserve thunderbird_corrupted_file_1_error_ori(ubound(thunderbird_corrupted_file_1_error_ori) + 1)
redim preserve thunderbird_corrupted_file_1_error_fix(ubound(thunderbird_corrupted_file_1_error_fix) + 1)
thunderbird_corrupted_file_1_error_ori(4) = "617665727469C2B765206C6F7273717565206C612067C3A96EC3A9726174696F6E20646520636CC3A92073657261207465726D696EC3A9652E0A"
thunderbird_corrupted_file_1_error_fix(4) = "617665727469206C6F7273717565206C612067C3A96EC3A9726174696F6E20646520636CC3A92073657261207465726D696EC3A9652E0A0A0A0A"
' averti·e lorsque la génération de clé sera terminée. => averti lorsque la génération de clé sera terminée.

redim preserve thunderbird_corrupted_file_1_error_ori(ubound(thunderbird_corrupted_file_1_error_ori) + 1)
redim preserve thunderbird_corrupted_file_1_error_fix(ubound(thunderbird_corrupted_file_1_error_fix) + 1)
thunderbird_corrupted_file_1_error_ori(5) = "736174697366616974C2B7652064752072C3A973756C7461742E0A"
thunderbird_corrupted_file_1_error_fix(5) = "7361746973666169742064752072C3A973756C7461742E0A0A0A0A"
' satisfait·e du résultat. => satisfait du résultat.

redim preserve thunderbird_corrupted_file_1_error_ori(ubound(thunderbird_corrupted_file_1_error_ori) + 1)
redim preserve thunderbird_corrupted_file_1_error_fix(ubound(thunderbird_corrupted_file_1_error_fix) + 1)
thunderbird_corrupted_file_1_error_ori(6) = "636F6E6E656374C3A9C2B76520706C7573696575727320666F69732C20756E652061757472652073657373696F6E20706575742061766F6972207265C3A775206C65206D6573736167652E0A"
thunderbird_corrupted_file_1_error_fix(6) = "636F6E6E656374C3A920706C7573696575727320666F69732C20756E652061757472652073657373696F6E20706575742061766F6972207265C3A775206C65206D6573736167652E0A0A0A0A"
' connecté·e plusieurs fois, une autre session peut avoir reçu le message. => connecté plusieurs fois, une autre session peut avoir reçu le message.

redim preserve thunderbird_corrupted_file_1_error_ori(ubound(thunderbird_corrupted_file_1_error_ori) + 1)
redim preserve thunderbird_corrupted_file_1_error_fix(ubound(thunderbird_corrupted_file_1_error_fix) + 1)
thunderbird_corrupted_file_1_error_ori(7) = "70697374C3A9C2B7650A"
thunderbird_corrupted_file_1_error_fix(7) = "70697374C3A90A0A0A0A"
' pisté·e => pisté



i_installation_type = 0
if thunderbird_folder <> "" then
	if object_file_system.FileExists(thunderbird_folder & "\" & thunderbird_corrupted_file_1) = FALSE then
		WScript.Echo "Erreur, fichier non détecté :" & vbCrLf & thunderbird_folder & "\" & thunderbird_corrupted_file_1
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	i_installation_type = 1
	WScript.Echo "Fichier détecté :" & vbCrLf & thunderbird_folder & "\" & thunderbird_corrupted_file_1 & vbCrLf
end if
if object_file_system.FileExists(thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1) = TRUE then
	i_installation_type = 2
	WScript.Echo "Fichier détecté :" & vbCrLf & thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1 & vbCrLf
end if
if object_file_system.FileExists(thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1) = TRUE then
	i_installation_type = i_installation_type + 3
	WScript.Echo "Fichier détecté :" & vbCrLf & thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1 & vbCrLf
end if
if object_file_system.FileExists(thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1) = TRUE then
	i_installation_type = 6
	WScript.Echo "Fichier détecté :" & vbCrLf & thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1 & vbCrLf
end if
if object_file_system.FileExists(thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1) = TRUE then
	i_installation_type = 7
	WScript.Echo "Fichier détecté :" & vbCrLf & thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1 & vbCrLf
end if

if i_installation_type = 0 then
	WScript.Echo "Erreur, aucun fichier détecté."
	WScript.Sleep 5000
	WScript.Quit(0)
end if
if i_installation_type = 1 then
	if object_file_system.FileExists(thunderbird_folder & "\" & thunderbird_corrupted_file_1 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & thunderbird_folder & "\" & thunderbird_corrupted_file_1 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 2 OR i_installation_type = 5 then
	if object_file_system.FileExists(thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 3 OR i_installation_type = 5 then
	if object_file_system.FileExists(thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 6 then
	if object_file_system.FileExists(thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 7 then
	if object_file_system.FileExists(thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if

if ubound(thunderbird_corrupted_file_1_error_ori) <> ubound(thunderbird_corrupted_file_1_error_fix) then
	WScript.Echo "Erreur :" & vbCrLf & "Le nombre de cases dans le tableau des chaînes hexadécimales à détecter" & vbCrLf & "et dans le tableau des chaînes hexadécimales à remplacer n'est pas identique."
	WScript.Sleep 5000
	WScript.Quit(0)
end if
for i = 0 to ubound(thunderbird_corrupted_file_1_error_ori) step 1
	' WScript.Echo thunderbird_corrupted_file_1_error_ori(i) & " = " & len(thunderbird_corrupted_file_1_error_ori(i)) & vbCrLf & thunderbird_corrupted_file_1_error_fix(i) & " = " & len(thunderbird_corrupted_file_1_error_fix(i))
	if len(thunderbird_corrupted_file_1_error_ori(i)) <> len(thunderbird_corrupted_file_1_error_fix(i)) then
		WScript.Echo "Erreur :" & vbCrLf & "La variable """ & thunderbird_corrupted_file_1_error_ori(i) & """ et" & vbCrLf & "la variable """ & thunderbird_corrupted_file_1_error_fix(i) & """" & vbCrLf _
		& "n'ont pas le même nombre de caractères."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	if len(thunderbird_corrupted_file_1_error_ori(i)) MOD 2 <> 0 then
		WScript.Echo "Erreur, les variables :" & vbCrLf & thunderbird_corrupted_file_1_error_ori(i) & vbCrLf & thunderbird_corrupted_file_1_error_fix(i) & vbCrLf & "ont un nombre impair de caractères."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	if len(thunderbird_corrupted_file_1_error_ori(i)) < 12 then
		WScript.Echo "Erreur, les variables :" & vbCrLf & thunderbird_corrupted_file_1_error_ori(i) & vbCrLf & thunderbird_corrupted_file_1_error_fix(i) & vbCrLf & "doivent avoir au moins 12 caractères hexadécimaux" _
		& vbCrLf & "pour représenter au moins 6 octets." & vbCrLf & "Or ici, elles n'en contiennent que " & len(thunderbird_corrupted_file_1_error_ori(i)) & "."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
next

if i_installation_type = 1 then
	set object_file = object_file_system.CreateTextFile(thunderbird_folder & "\" & thunderbird_corrupted_file_1 & ".temporary", TRUE, FALSE)	' (TRUE = Écraser si existe déjà) (FALSE = Utiliser ASCII au lieu d'Unicode UTF16LE donc pas de Byte Order Mark FFFE)
	object_file.Close
	if object_file_system.FileExists(thunderbird_folder & "\" & thunderbird_corrupted_file_1 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & thunderbird_folder & "\" & thunderbird_corrupted_file_1 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 2 OR i_installation_type = 5 then
	set object_file = object_file_system.CreateTextFile(thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 3 OR i_installation_type = 5 then
	set object_file = object_file_system.CreateTextFile(thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 6 then
	set object_file = object_file_system.CreateTextFile(thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 7 then
	set object_file = object_file_system.CreateTextFile(thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if

function i_my_replace_array_hex_strings_in_file(byval array_hex_strings_to_find, byval array_hex_strings_to_replace, byval file_fullname)
	set object_file_input  = object_file_system.OpenTextFile(file_fullname, 1)				' Ouverture du fichier en lecture
	set object_file_output = object_file_system.OpenTextFile(file_fullname & ".temporary", 2, TRUE, 0)	' Ouverture du fichier en écriture (TRUE = Fichier créé si n'existe pas) (0 = ASCII, -1 = Unicode, -2 = Par défaut)

	char_buffer  = ""
	i_char_check = 0
	b_replacement_done  = FALSE
	i_replacement_count = 0
	i_1 = 0
	do until object_file_input.AtEndOfStream
		character_read = object_file_input.Read(1)
		' byte_read    = ucase(cstr(hex(ascb(character_read))))
		' byte_read    = string(2 - len(byte_read), "0") & byte_read
		' WScript.Echo "Caractère lu (code " & byte_read & ") : " & character_read

		if b_replacement_done = FALSE then
			' Pour aller plus vite, extraction des 5 premiers octets et conversion en caractères
			byte_to_find_1 = mid(array_hex_strings_to_find(i_1),1,2)
			byte_to_find_2 = mid(array_hex_strings_to_find(i_1),3,2)
			byte_to_find_3 = mid(array_hex_strings_to_find(i_1),5,2)
			byte_to_find_4 = mid(array_hex_strings_to_find(i_1),7,2)
			byte_to_find_5 = mid(array_hex_strings_to_find(i_1),9,2)
			char_to_find_1 = chr(cdbl("&h" & byte_to_find_1))
			char_to_find_2 = chr(cdbl("&h" & byte_to_find_2))
			char_to_find_3 = chr(cdbl("&h" & byte_to_find_3))
			char_to_find_4 = chr(cdbl("&h" & byte_to_find_4))
			char_to_find_5 = chr(cdbl("&h" & byte_to_find_5))
			b_replacement_done = TRUE
		end if

		Select Case i_char_check
			Case 0
				if character_read = char_to_find_1 then
					char_buffer  = char_buffer & character_read
					i_char_check = 1
				end if
			Case 1
				if character_read = char_to_find_2 then
					char_buffer  = char_buffer & character_read
					i_char_check = 2
				else
					object_file_output.Write(char_buffer)
					char_buffer  = ""
					i_char_check = 0
				end if
			Case 2
				if character_read = char_to_find_3 then
					char_buffer  = char_buffer & character_read
					i_char_check = 3
				else
					object_file_output.Write(char_buffer)
					char_buffer  = ""
					i_char_check = 0
				end if
			Case 3
				if character_read = char_to_find_4 then
					char_buffer  = char_buffer & character_read
					i_char_check = 4
				else
					object_file_output.Write(char_buffer)
					char_buffer  = ""
					i_char_check = 0
				end if
			Case 4
				if character_read = char_to_find_5 then
					char_buffer  = char_buffer & character_read
					i_char_check = 5
				else
					object_file_output.Write(char_buffer)
					char_buffer  = ""
					i_char_check = 0
				end if
			Case Else
				if character_read = chr(cdbl("&h" & mid(array_hex_strings_to_find(i_1),2*i_char_check+1,2))) then
					char_buffer = char_buffer & character_read
					i_char_check = i_char_check + 1
				else
					object_file_output.Write(char_buffer)
					char_buffer  = ""
					i_char_check = 0
				end if
				if i_char_check = len(array_hex_strings_to_find(i_1)) / 2 then
					for i_2 = 1 to len(array_hex_strings_to_replace(i_1)) step 2
						object_file_output.Write(chr(cdbl("&h" & mid(array_hex_strings_to_replace(i_1),i_2,2))))
					next
					char_buffer  = ""
					i_char_check = 0
					b_replacement_done  = FALSE
					i_replacement_count = i_replacement_count + 1
					WScript.Echo "Fichier :" & vbCrLf & file_fullname & vbCrLf & "Séquence trouvée :" & vbCrLf & array_hex_strings_to_find(i_1) & vbCrLf & "Remplacée par :" & vbCrLf & array_hex_strings_to_replace(i_1) & vbCrLf
					if i_1 < ubound(array_hex_strings_to_find) then
						i_1 = i_1 + 1
					end if
				end if
		End Select

		if i_char_check = 0 AND b_replacement_done = TRUE then
			object_file_output.Write(character_read)
		end if
	loop

	object_file_input.Close
	object_file_output.Close
	i_my_replace_array_hex_strings_in_file = i_replacement_count
end function

if i_installation_type = 1 then
	number_of_replacements_1 = i_my_replace_array_hex_strings_in_file(thunderbird_corrupted_file_1_error_ori, thunderbird_corrupted_file_1_error_fix, thunderbird_folder & "\" & thunderbird_corrupted_file_1)
	Wscript.Echo number_of_replacements_1 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & thunderbird_folder & "\" & thunderbird_corrupted_file_1 & vbCrLf
end if
if i_installation_type = 2 OR i_installation_type = 5 then
	number_of_replacements_1 = i_my_replace_array_hex_strings_in_file(thunderbird_corrupted_file_1_error_ori, thunderbird_corrupted_file_1_error_fix, thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1)
	Wscript.Echo number_of_replacements_1 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1 & vbCrLf
end if
if i_installation_type = 3 OR i_installation_type = 5 then
	number_of_replacements_1 = i_my_replace_array_hex_strings_in_file(thunderbird_corrupted_file_1_error_ori, thunderbird_corrupted_file_1_error_fix, thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1)
	Wscript.Echo number_of_replacements_1 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1 & vbCrLf
end if
if i_installation_type = 6 then
	number_of_replacements_1 = i_my_replace_array_hex_strings_in_file(thunderbird_corrupted_file_1_error_ori, thunderbird_corrupted_file_1_error_fix, thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1)
	Wscript.Echo number_of_replacements_1 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1 & vbCrLf
end if
if i_installation_type = 7 then
	number_of_replacements_1 = i_my_replace_array_hex_strings_in_file(thunderbird_corrupted_file_1_error_ori, thunderbird_corrupted_file_1_error_fix, thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1)
	Wscript.Echo number_of_replacements_1 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1 & vbCrLf
end if

Function i_my_rename_file(byval file_fullname, byval file_fullname_new)
	if not object_file_system.FileExists(file_fullname) then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & file_fullname & vbCrLf & "n'existe pas, impossible de le renommer en :" & vbCrLf & file_fullname_new
		WScript.Sleep 5000
		WScript.Quit(0)
	end if

	' WScript.Echo "On renomme le fichier :" & vbCrLf & file_fullname & vbCrLf & "en :" & vbCrLf & file_fullname_new
	object_file_system.MoveFile file_fullname, file_fullname_new

	if not object_file_system.FileExists(file_fullname_new) then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & file_fullname & vbCrLf & "n'a pas pu être renommé."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if

	i_my_rename_file = 0
end function

if i_installation_type = 1 then
	i_my_rename_file thunderbird_folder & "\" & thunderbird_corrupted_file_1,                thunderbird_folder & "\" & thunderbird_corrupted_file_1 & ".bak"
	i_my_rename_file thunderbird_folder & "\" & thunderbird_corrupted_file_1 & ".temporary", thunderbird_folder & "\" & thunderbird_corrupted_file_1
end if
if i_installation_type = 2 OR i_installation_type = 5 then
	i_my_rename_file thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1,                thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1 & ".bak"
	i_my_rename_file thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1 & ".temporary", thunderbird_folder_portable_32 & "\" & thunderbird_corrupted_file_1
end if
if i_installation_type = 3 OR i_installation_type = 5 then
	i_my_rename_file thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1,                thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1 & ".bak"
	i_my_rename_file thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1 & ".temporary", thunderbird_folder_portable_64 & "\" & thunderbird_corrupted_file_1
end if
if i_installation_type = 6 then
	i_my_rename_file thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1,                thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1 & ".bak"
	i_my_rename_file thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1 & ".temporary", thunderbird_folder_installed_32 & "\" & thunderbird_corrupted_file_1
end if
if i_installation_type = 7 then
	i_my_rename_file thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1,                thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1 & ".bak"
	i_my_rename_file thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1 & ".temporary", thunderbird_folder_installed_64 & "\" & thunderbird_corrupted_file_1
end if

WScript.Sleep 5000
WScript.Quit(0)

Il faudra donner au fichier ".txt" l'extension ".vbs".

Edited by actaruss
Erreur orthographe
Link to comment
Share on other sites

Posted (edited)

Code pour Firefox :

Sur le bureau de Windows, créez un nouveau document texte (extension ".txt").

Ouvrez-le, puis allez dans Fichier > Enregistrer sous...
et dans "Encodage" mettez "UTF-16 LE" ("Unicode" sous Windows 7).

Ensuite, copié-collez le code en Powershsell ci-dessous dans le fichier.

# Character encoding = UTF-16 LE (Byte Order Mark = FF FE)
# End-of-line = Windows (CR LF)

# Composants requis :
$current_folder = $PWD.Path



# Emplacement personnalisé du dossier contenant le fichier "firefox.exe".
# Vous pouvez le laisser vide. Exemple :
# $firefox_folder = "$current_folder\Mozilla Firefox"
$firefox_folder = ""



# Emplacements connus :
$firefox_folder_portable_32  = "$current_folder\App\Firefox"
$firefox_folder_portable_64  = "$current_folder\App\Firefox64"
$firefox_folder_installed_32 = "${env:ProgramFiles(x86)}\Mozilla Firefox"
$firefox_folder_installed_64 = "${$env:ProgramFiles}\Mozilla Firefox"

# Fichiers à réparer :
$firefox_corrupted_file_1 = "omni.ja"
$firefox_corrupted_file_2 = "browser\omni.ja"

# Réparations à faire :
$firefox_corrupted_file_1_error_ori = @()
$firefox_corrupted_file_1_error_fix = @()
$firefox_corrupted_file_2_error_ori = @()
$firefox_corrupted_file_2_error_fix = @()

$firefox_corrupted_file_1_error_ori += "7574696C69736174657572C2B774726963650A"
$firefox_corrupted_file_1_error_fix += "7574696C697361746575720A0A0A0A0A0A0A0A"
# utilisateur·trice => utilisateur

$firefox_corrupted_file_2_error_ori += "61646D696E697374726174657572C2B7747269636520612064C3A9736163746976C3A9206C612073796E6368726F6E69736174696F6E2E0A"
$firefox_corrupted_file_2_error_fix += "61646D696E69737472617465757220612064C3A9736163746976C3A9206C612073796E6368726F6E69736174696F6E2E0A0A0A0A0A0A0A0A"
# administrateur·trice a désactivé la synchronisation. => administrateur a désactivé la synchronisation.

$firefox_corrupted_file_2_error_ori += "636F6E6E656374C3A9C2B7652E0A"
$firefox_corrupted_file_2_error_fix += "636F6E6E656374C3A92E0A0A0A0A"
# connecté·e. => connecté.

$firefox_corrupted_file_2_error_ori += "636F6E6E656374C3A9C2B76520617665632073756363C3A8730A"
$firefox_corrupted_file_2_error_fix += "636F6E6E656374C3A920617665632073756363C3A8730A0A0A0A"
# connecté·e avec succès => connecté avec succès

$firefox_corrupted_file_2_error_ori += "636F6E6E656374C3A9C2B7650A"
$firefox_corrupted_file_2_error_fix += "636F6E6E656374C3A90A0A0A0A"
# connecté·e => connecté

$firefox_corrupted_file_2_error_ori += "7375697669C2B7650A"
$firefox_corrupted_file_2_error_fix += "73756976690A0A0A0A"
# suivi·e=> suivi

$firefox_corrupted_file_2_error_ori += "5072C3AA74C2B76520C3A0207363616E6E65723C2F7374726F6E673E206574206D61696E74656E657A20766F74726520617070617265696C2061752D64657373757320646520636520636F64650A"
$firefox_corrupted_file_2_error_fix += "5072C3AA7420C3A0207363616E6E65723C2F7374726F6E673E206574206D61696E74656E657A20766F74726520617070617265696C2061752D64657373757320646520636520636F64650A0A0A0A"
# Prêt·e à scanner</strong> et maintenez votre appareil au-dessus de ce code => Prêt à scanner</strong> et maintenez votre appareil au-dessus de ce code

$firefox_corrupted_file_2_error_ori += "70697374C3A9C2B7650A"
$firefox_corrupted_file_2_error_fix += "70697374C3A90A0A0A0A"
# pisté·e => pisté



$i_installation_type = 0
if ($firefox_folder -ne "")
{
	if (-not (Test-Path "$firefox_folder\$firefox_corrupted_file_1"))
	{
		Write-Host "Erreur, fichier non détecté :`r`n$firefox_folder\$firefox_corrupted_file_1"
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	if (-not (Test-Path "$firefox_folder\$firefox_corrupted_file_2"))
	{
		Write-Host "Erreur, fichier non détecté :`r`n$firefox_folder\$firefox_corrupted_file_2"
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	$i_installation_type = 1
	Write-Host "Fichiers détectés :`r`n$firefox_folder\$firefox_corrupted_file_1`r`n$firefox_folder\$firefox_corrupted_file_2`r`n"
}
if (Test-Path "$firefox_folder_portable_32\$firefox_corrupted_file_1")
{
	if (-not (Test-Path "$firefox_folder_portable_32\$firefox_corrupted_file_2"))
	{
		Write-Host "Erreur, le second fichier :`r`n$firefox_folder_portable_32\$firefox_corrupted_file_2"
		"n'a pas été détecté alors que le premier l'a été :`r`n$firefox_folder_portable_32\$firefox_corrupted_file_1"
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	$i_installation_type = 2
	Write-Host "Fichiers détectés :`r`n$firefox_folder_portable_32\$firefox_corrupted_file_1`r`n$firefox_folder_portable_32\$firefox_corrupted_file_2`r`n"
}
if (Test-Path "$firefox_folder_portable_64\$firefox_corrupted_file_1")
{
	if (-not (Test-Path "$firefox_folder_portable_64\$firefox_corrupted_file_2"))
	{
		Write-Host "Erreur, le second fichier :`r`n$firefox_folder_portable_64\$firefox_corrupted_file_2"
		"n'a pas été détecté alors que le premier l'a été :`r`n$firefox_folder_portable_64\$firefox_corrupted_file_1"
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	$i_installation_type += 3
	Write-Host "Fichiers détectés :`r`n$firefox_folder_portable_64\$firefox_corrupted_file_1`r`n$firefox_folder_portable_64\$firefox_corrupted_file_2`r`n"
}
if (Test-Path "$firefox_folder_installed_32\$firefox_corrupted_file_1")
{
	if (-not (Test-Path "$firefox_folder_installed_32\$firefox_corrupted_file_2"))
	{
		Write-Host "Erreur, le second fichier :`r`n$firefox_folder_installed_32\$firefox_corrupted_file_2"
		"n'a pas été détecté alors que le premier l'a été :`r`n$firefox_folder_installed_32\$firefox_corrupted_file_1"
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	$i_installation_type = 6
	Write-Host "Fichiers détectés :`r`n$firefox_folder_portable_32\$firefox_corrupted_file_1`r`n$firefox_folder_portable_32\$firefox_corrupted_file_2`r`n"
}
if (Test-Path "$firefox_folder_installed_64\$firefox_corrupted_file_1")
{
	if (-not (Test-Path "$firefox_folder_installed_64\$firefox_corrupted_file_2"))
	{
		Write-Host "Erreur, le second fichier :`r`n$firefox_folder_installed_64\$firefox_corrupted_file_2"
		"n'a pas été détecté alors que le premier l'a été :`r`n$firefox_folder_installed_64\$firefox_corrupted_file_1"
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	$i_installation_type = 7
	Write-Host "Fichiers détectés :`r`n$firefox_folder_portable_64\$firefox_corrupted_file_1`r`n$firefox_folder_portable_64\$firefox_corrupted_file_2`r`n"
}

if ($i_installation_type -eq 0)
{
	Write-Host "Erreur, aucun fichier détecté."
	Write-Host "`r`nAppuyez sur une touche pour continuer..."
	$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
	exit 0
}
if ($i_installation_type -eq 1)
{
	if (Test-Path -Path "$firefox_folder\$firefox_corrupted_file_1.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$firefox_folder\$firefox_corrupted_file_1.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	if (Test-Path -Path "$firefox_folder\$firefox_corrupted_file_2.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$firefox_folder\$firefox_corrupted_file_2.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}
if ($i_installation_type -eq 2 -or $i_installation_type -eq 5)
{
	if (Test-Path -Path "$firefox_folder_portable_32\$firefox_corrupted_file_1.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$firefox_folder_portable_32\$firefox_corrupted_file_1.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	if (Test-Path -Path "$firefox_folder_portable_32\$firefox_corrupted_file_2.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$firefox_folder_portable_32\$firefox_corrupted_file_2.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}
if ($i_installation_type -eq 3 -or $i_installation_type -eq 5)
{
	if (Test-Path -Path "$firefox_folder_portable_64\$firefox_corrupted_file_1.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$firefox_folder_portable_64\$firefox_corrupted_file_1.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	if (Test-Path -Path "$firefox_folder_portable_64\$firefox_corrupted_file_2.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$firefox_folder_portable_64\$firefox_corrupted_file_2.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}
if ($i_installation_type -eq 6)
{
	if (Test-Path -Path "$firefox_folder_installed_32\$firefox_corrupted_file_1.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$firefox_folder_installed_32\$firefox_corrupted_file_1.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	if (Test-Path -Path "$firefox_folder_installed_32\$firefox_corrupted_file_2.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$firefox_folder_installed_32\$firefox_corrupted_file_2.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}
if ($i_installation_type -eq 7) {
	if (Test-Path -Path "$firefox_folder_installed_64\$firefox_corrupted_file_1.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$firefox_folder_installed_64\$firefox_corrupted_file_1.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	if (Test-Path -Path "$firefox_folder_installed_64\$firefox_corrupted_file_2.bak")
	{
		Write-Host "Erreur, le fichier de sauvegarde :`r`n$firefox_folder_installed_64\$firefox_corrupted_file_2.bak"
		"existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
		"supprimez le fichier "".bak"" et relancez ce script."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}

if ($firefox_corrupted_file_1_error_ori.Length -ne $firefox_corrupted_file_1_error_fix.Length)
{
	Write-Host "Erreur :`r`nLe nombre de cases dans le tableau des chaînes hexadécimales à détecter`r`net dans le tableau des chaînes hexadécimales à remplacer n'est pas identique."
	Write-Host "`r`nAppuyez sur une touche pour continuer..."
	$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
	exit 0
}
if ($firefox_corrupted_file_2_error_ori.Length -ne $firefox_corrupted_file_2_error_fix.Length)
{
	Write-Host "Erreur :`r`nLe nombre de cases dans le tableau des chaînes hexadécimales à détecter`r`net dans le tableau des chaînes hexadécimales à remplacer n'est pas identique."
	Write-Host "`r`nAppuyez sur une touche pour continuer..."
	$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
	exit 0
}
for ($i = 0; $i -le $firefox_corrupted_file_1_error_ori.Length - 1; $i += 1)
{
	# Write-Host $($firefox_corrupted_file_1_error_ori[$i]) = $($firefox_corrupted_file_1_error_ori[$i].Length)`r`n$($firefox_corrupted_file_1_error_fix[$i]) = $($firefox_corrupted_file_1_error_fix[$i].Length)
	if ($firefox_corrupted_file_1_error_ori[$i].Length -ne $firefox_corrupted_file_1_error_fix[$i].Length)
	{
		Write-Host "Erreur :`r`nLa variable ""$($firefox_corrupted_file_1_error_ori[$i])"" et`r`nla variable ""$($firefox_corrupted_file_1_error_fix[$i])"""
		"n'ont pas le même nombre de caractères."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	if ($firefox_corrupted_file_1_error_ori[$i].Length % 2 -ne 0)
	{
		Write-Host "Erreur, les variables :`r`n$($firefox_corrupted_file_1_error_ori[$i])`r`n$($firefox_corrupted_file_1_error_fix[$i])`r`nont un nombre impair de caractères."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	if ($firefox_corrupted_file_1_error_ori[$i].Length -lt 12)
	{
		Write-Host "Erreur, les variables :`r`n$($firefox_corrupted_file_1_error_ori[$i])`r`n$($firefox_corrupted_file_1_error_fix[$i])`r`ndoivent avoir au moins 12 caractères hexadécimaux" `
		"`r`npour représenter au moins 6 octets.`r`nOr ici, elles n'en contiennent que $($firefox_corrupted_file_1_error_ori[$i].Length)."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}
for ($i = 0; $i -le $firefox_corrupted_file_2_error_ori.Length - 1; $i += 1)
{
	# Write-Host $($firefox_corrupted_file_2_error_ori[$i]) = $($firefox_corrupted_file_2_error_ori[$i].Length)`r`n$($firefox_corrupted_file_2_error_fix[$i]) = $($firefox_corrupted_file_2_error_fix[$i].Length)
	if ($firefox_corrupted_file_2_error_ori[$i].Length -ne $firefox_corrupted_file_2_error_fix[$i].Length)
	{
		Write-Host "Erreur :`r`nLa variable ""$($firefox_corrupted_file_2_error_ori[$i])"" et`r`nla variable ""$($firefox_corrupted_file_2_error_fix[$i])"""
		"n'ont pas le même nombre de caractères."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	if ($firefox_corrupted_file_2_error_ori[$i].Length % 2 -ne 0)
	{
		Write-Host "Erreur, les variables :`r`n$($firefox_corrupted_file_2_error_ori[$i])`r`n$($firefox_corrupted_file_2_error_fix[$i])`r`nont un nombre impair de caractères."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
	if ($firefox_corrupted_file_2_error_ori[$i].Length -lt 12)
	{
		Write-Host "Erreur, les variables :`r`n$($firefox_corrupted_file_2_error_ori[$i])`r`n$($firefox_corrupted_file_2_error_fix[$i])`r`ndoivent avoir au moins 12 caractères hexadécimaux" `
		"`r`npour représenter au moins 6 octets.`r`nOr ici, elles n'en contiennent que $($firefox_corrupted_file_2_error_ori[$i].Length)."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}
}

if ($i_installation_type -eq 1)
{
	Out-File -FilePath "$firefox_folder\$firefox_corrupted_file_1.temporary" -Force -Encoding ASCII		# (Force = Écraser si existe déjà) (Encoding ASCII = Utiliser ASCII au lieu d'Unicode UTF16LE donc pas de Byte Order Mark FFFE)
	if (-not (Test-Path "$firefox_folder\$firefox_corrupted_file_1.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$firefox_folder\$firefox_corrupted_file_1.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
	Out-File -FilePath "$firefox_folder\$firefox_corrupted_file_2.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$firefox_folder\$firefox_corrupted_file_2.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$firefox_folder\$firefox_corrupted_file_2.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
}
if ($i_installation_type -eq 2 -or $i_installation_type -eq 5)
{
	Out-File -FilePath "$firefox_folder_portable_32\$firefox_corrupted_file_1.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$firefox_folder_portable_32\$firefox_corrupted_file_1.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$firefox_folder_portable_32\$firefox_corrupted_file_1.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
	Out-File -FilePath "$firefox_folder_portable_32\$firefox_corrupted_file_2.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$firefox_folder_portable_32\$firefox_corrupted_file_2.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$firefox_folder_portable_32\$firefox_corrupted_file_2.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
}
if ($i_installation_type -eq 3 -or $i_installation_type -eq 5)
{
	Out-File -FilePath "$firefox_folder_portable_64\$firefox_corrupted_file_1.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$firefox_folder_portable_64\$firefox_corrupted_file_1.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$firefox_folder_portable_64\$firefox_corrupted_file_1.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
	Out-File -FilePath "$firefox_folder_portable_64\$firefox_corrupted_file_2.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$firefox_folder_portable_64\$firefox_corrupted_file_2.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$firefox_folder_portable_64\$firefox_corrupted_file_2.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
}
if ($i_installation_type -eq 6)
{
	Out-File -FilePath "$firefox_folder_installed_32\$firefox_corrupted_file_1.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$firefox_folder_installed_32\$firefox_corrupted_file_1.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$firefox_folder_installed_32\$firefox_corrupted_file_1.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
	Out-File -FilePath "$firefox_folder_installed_32\$firefox_corrupted_file_2.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$firefox_folder_installed_32\$firefox_corrupted_file_2.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$firefox_folder_installed_32\$firefox_corrupted_file_2.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
}
if ($i_installation_type -eq 7)
{
	Out-File -FilePath "$firefox_folder_installed_64\$firefox_corrupted_file_1.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$firefox_folder_installed_64\$firefox_corrupted_file_1.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$firefox_folder_installed_64\$firefox_corrupted_file_1.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
	Out-File -FilePath "$firefox_folder_installed_64\$firefox_corrupted_file_2.temporary" -Force -Encoding ASCII
	if (-not (Test-Path "$firefox_folder_installed_64\$firefox_corrupted_file_2.temporary"))
	{
		Write-Host "Erreur, le fichier :`r`n$firefox_folder_installed_64\$firefox_corrupted_file_2.temporary"
		"n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
        }
}

function i_my_replace_array_hex_strings_in_file([string[]]$array_hex_strings_to_find, [string[]]$array_hex_strings_to_replace, [string]$file_fullname)
{
	$file_input  = [System.IO.File]::OpenRead($file_fullname)		# Ouverture du fichier en lecture
	$file_output = [System.IO.File]::Create("$file_fullname.temporary")	# Ouverture du fichier en écriture

	$byte_buffer_read = New-Object byte[] 1
	$byte_buffer      = New-Object byte[] 0
	$i_byte_check     = 0
	$b_replacement_done  = $false
	$i_replacement_count = 0
	$i_1 = 0
	while ($file_input.Read($byte_buffer_read, 0, 1) -ne 0)
	{
		$byte_read        = $byte_buffer_read[0]
		# $character_read = [char]$byte_read
		# Write-Host "Caractère lu (code $($byte_read.ToString("X2"))) : $character_read"

		if ($b_replacement_done -eq $false)
		{
			# Pour aller plus vite, extraction des 5 premiers octets et conversion en décimal
			$byte_to_find_1 = [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(0, 2), 16)
			$byte_to_find_2 = [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(2, 2), 16)
			$byte_to_find_3 = [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(4, 2), 16)
			$byte_to_find_4 = [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(6, 2), 16)
			$byte_to_find_5 = [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(8, 2), 16)
			$b_replacement_done = $true
		}

		switch ($i_byte_check)
		{
			0
			{
				if ($byte_read -eq $byte_to_find_1)
				{
					$byte_buffer += $byte_read
					$i_byte_check = 1
				}
				break
			}
			1
			{
				if ($byte_read -eq $byte_to_find_2)
				{
					$byte_buffer += $byte_read
					$i_byte_check = 2
				}
				else
				{
					$file_output.Write($byte_buffer, 0, $byte_buffer.Length)
					$byte_buffer  = @()
					$i_byte_check = 0
				}
				break
			}
			2
			{
				if ($byte_read -eq $byte_to_find_3)
				{
					$byte_buffer += $byte_read
					$i_byte_check = 3
				}
				else
				{
					$file_output.Write($byte_buffer, 0, $byte_buffer.Length)
					$byte_buffer  = @()
					$i_byte_check = 0
				}
				break
			}
			3
			{
				if ($byte_read -eq $byte_to_find_4)
				{
					$byte_buffer += $byte_read
					$i_byte_check = 4
				}
				else
				{
					$file_output.Write($byte_buffer, 0, $byte_buffer.Length)
					$byte_buffer  = @()
					$i_byte_check = 0
				}
				break
			}
			4
			{
				if ($byte_read -eq $byte_to_find_5)
				{
					$byte_buffer += $byte_read
					$i_byte_check = 5
				}
				else
				{
					$file_output.Write($byte_buffer, 0, $byte_buffer.Length)
					$byte_buffer  = @()
					$i_byte_check = 0
				}
				break
			}
			default
			{
				if ($byte_read.ToString("X2") -eq $array_hex_strings_to_find[$i_1].Substring(2 * $i_byte_check, 2))
				{
					$byte_buffer += $byte_read
					$i_byte_check++
				}
				else
				{
					$file_output.Write($byte_buffer, 0, $byte_buffer.Length)
					$byte_buffer  = @()
					$i_byte_check = 0
				}
				if ($i_byte_check -eq $array_hex_strings_to_find[$i_1].Length / 2)
				{
					for ($i_2 = 0; $i_2 -lt $array_hex_strings_to_replace[$i_1].Length; $i_2 += 2)
					{
						$file_output.WriteByte([byte]::Parse($array_hex_strings_to_replace[$i_1].Substring($i_2, 2), [System.Globalization.NumberStyles]::HexNumber))
					}
					$byte_buffer  = @()
					$i_byte_check = 0
					$b_replacement_done = $false
					$i_replacement_count++
					Write-Host "Fichier :`r`n$file_fullname`r`nSéquence trouvée :`r`n$($array_hex_strings_to_find[$i_1])`r`nRemplacée par :`r`n$($array_hex_strings_to_replace[$i_1])`r`n"
					if ($i_1 -lt $array_hex_strings_to_find.Length - 1)
					{
						$i_1++
					}
				}
			}
		}

		if ($i_byte_check -eq 0 -and $b_replacement_done -eq $true)
		{
			$file_output.WriteByte($byte_read)
		}
	}

        $file_input.Close()
        $file_output.Close()
        $file_input.Dispose()
        $file_output.Dispose()
	return $i_replacement_count
}

if ($i_installation_type -eq 1)
{
	$number_of_replacements_1 = i_my_replace_array_hex_strings_in_file $firefox_corrupted_file_1_error_ori $firefox_corrupted_file_1_error_fix ("$firefox_folder\$firefox_corrupted_file_1")
	Write-Host "$number_of_replacements_1 remplacement(s) effectué(s) sur le fichier :`r`n$firefox_folder\$firefox_corrupted_file_1`r`n"
	$number_of_replacements_2 = i_my_replace_array_hex_strings_in_file $firefox_corrupted_file_2_error_ori $firefox_corrupted_file_2_error_fix ("$firefox_folder\$firefox_corrupted_file_2")
	Write-Host "$number_of_replacements_2 remplacement(s) effectué(s) sur le fichier :`r`n$firefox_folder\$firefox_corrupted_file_2`r`n"
}

if ($i_installation_type -eq 2 -or $i_installation_type -eq 5)
{
	$number_of_replacements_1 = i_my_replace_array_hex_strings_in_file $firefox_corrupted_file_1_error_ori $firefox_corrupted_file_1_error_fix ("$firefox_folder_portable_32\$firefox_corrupted_file_1")
	Write-Host "$number_of_replacements_1 remplacement(s) effectué(s) sur le fichier :`r`n$firefox_folder_portable_32\$firefox_corrupted_file_1`r`n"
	$number_of_replacements_2 = i_my_replace_array_hex_strings_in_file $firefox_corrupted_file_2_error_ori $firefox_corrupted_file_2_error_fix ("$firefox_folder_portable_32\$firefox_corrupted_file_2")
	Write-Host "$number_of_replacements_2 remplacement(s) effectué(s) sur le fichier :`r`n$firefox_folder_portable_32\$firefox_corrupted_file_2`r`n"
}
if ($i_installation_type -eq 3 -or $i_installation_type -eq 5)
{
	$number_of_replacements_1 = i_my_replace_array_hex_strings_in_file $firefox_corrupted_file_1_error_ori $firefox_corrupted_file_1_error_fix ("$firefox_folder_portable_64\$firefox_corrupted_file_1")
	Write-Host "$number_of_replacements_1 remplacement(s) effectué(s) sur le fichier :`r`n$firefox_folder_portable_64\$firefox_corrupted_file_1`r`n"
	$number_of_replacements_2 = i_my_replace_array_hex_strings_in_file $firefox_corrupted_file_2_error_ori $firefox_corrupted_file_2_error_fix ("$firefox_folder_portable_64\$firefox_corrupted_file_2")
	Write-Host "$number_of_replacements_2 remplacement(s) effectué(s) sur le fichier :`r`n$firefox_folder_portable_64\$firefox_corrupted_file_2`r`n"
}
if ($i_installation_type -eq 6)
{
	$number_of_replacements_1 = i_my_replace_array_hex_strings_in_file $firefox_corrupted_file_1_error_ori $firefox_corrupted_file_1_error_fix ("$firefox_folder_installed_32\$firefox_corrupted_file_1")
	Write-Host "$number_of_replacements_1 remplacement(s) effectué(s) sur le fichier :`r`n$firefox_folder_installed_32\$firefox_corrupted_file_1`r`n"
	$number_of_replacements_2 = i_my_replace_array_hex_strings_in_file $firefox_corrupted_file_2_error_ori $firefox_corrupted_file_2_error_fix ("$firefox_folder_installed_32\$firefox_corrupted_file_2")
	Write-Host "$number_of_replacements_2 remplacement(s) effectué(s) sur le fichier :`r`n$firefox_folder_installed_32\$firefox_corrupted_file_2`r`n"
}
if ($i_installation_type -eq 7)
{
	$number_of_replacements_1 = i_my_replace_array_hex_strings_in_file $firefox_corrupted_file_1_error_ori $firefox_corrupted_file_1_error_fix ("$firefox_folder_installed_64\$firefox_corrupted_file_1")
	Write-Host "$number_of_replacements_1 remplacement(s) effectué(s) sur le fichier :`r`n$firefox_folder_installed_64\$firefox_corrupted_file_1`r`n"
	$number_of_replacements_2 = i_my_replace_array_hex_strings_in_file $firefox_corrupted_file_2_error_ori $firefox_corrupted_file_2_error_fix ("$firefox_folder_installed_64\$firefox_corrupted_file_2")
	Write-Host "$number_of_replacements_2 remplacement(s) effectué(s) sur le fichier :`r`n$firefox_folder_installed_64\$firefox_corrupted_file_2`r`n"
}

function i_my_rename_file([string]$file_fullname, [string]$file_fullname_new)
{
	if (-not (Test-Path $file_fullname))
	{
		Write-Host "Erreur, le fichier :`r`n$file_fullname`r`nn'existe pas, impossible de le renommer en :`r`n$file_fullname_new"
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}

	# Write-Host "On renomme le fichier :`r`n$file_fullname`r`nen :`r`n$file_fullname_new"
        Rename-Item -Path $file_fullname -NewName $file_fullname_new -ErrorAction Stop

	if (-not (Test-Path $file_fullname_new))
	{
		Write-Host "Erreur, le fichier :`r`n$file_fullname`r`nn'a pas pu être renommé."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		exit 0
	}

	return 0
}

if ($i_installation_type -eq 1)
{
	$i_return = i_my_rename_file "$firefox_folder\$firefox_corrupted_file_1"           "$firefox_folder\$firefox_corrupted_file_1.bak"
	$i_return = i_my_rename_file "$firefox_folder\$firefox_corrupted_file_1.temporary" "$firefox_folder\$firefox_corrupted_file_1"
	$i_return = i_my_rename_file "$firefox_folder\$firefox_corrupted_file_2"           "$firefox_folder\$firefox_corrupted_file_2.bak"
	$i_return = i_my_rename_file "$firefox_folder\$firefox_corrupted_file_2.temporary" "$firefox_folder\$firefox_corrupted_file_2"
}
if ($i_installation_type -eq 2 -or $i_installation_type -eq 5)
{
	$i_return = i_my_rename_file "$firefox_folder_portable_32\$firefox_corrupted_file_1"           "$firefox_folder_portable_32\$firefox_corrupted_file_1.bak"
	$i_return = i_my_rename_file "$firefox_folder_portable_32\$firefox_corrupted_file_1.temporary" "$firefox_folder_portable_32\$firefox_corrupted_file_1"
	$i_return = i_my_rename_file "$firefox_folder_portable_32\$firefox_corrupted_file_2"           "$firefox_folder_portable_32\$firefox_corrupted_file_2.bak"
	$i_return = i_my_rename_file "$firefox_folder_portable_32\$firefox_corrupted_file_2.temporary" "$firefox_folder_portable_32\$firefox_corrupted_file_2"
}
if ($i_installation_type -eq 3 -or $i_installation_type -eq 5)
{
	$i_return = i_my_rename_file "$firefox_folder_portable_64\$firefox_corrupted_file_1"           "$firefox_folder_portable_64\$firefox_corrupted_file_1.bak"
	$i_return = i_my_rename_file "$firefox_folder_portable_64\$firefox_corrupted_file_1.temporary" "$firefox_folder_portable_64\$firefox_corrupted_file_1"
	$i_return = i_my_rename_file "$firefox_folder_portable_64\$firefox_corrupted_file_2"           "$firefox_folder_portable_64\$firefox_corrupted_file_2.bak"
	$i_return = i_my_rename_file "$firefox_folder_portable_64\$firefox_corrupted_file_2.temporary" "$firefox_folder_portable_64\$firefox_corrupted_file_2"
}
if ($i_installation_type -eq 6)
{
	$i_return = i_my_rename_file "$firefox_folder_installed_32\$firefox_corrupted_file_1"           "$firefox_folder_installed_32\$firefox_corrupted_file_1.bak"
	$i_return = i_my_rename_file "$firefox_folder_installed_32\$firefox_corrupted_file_1.temporary" "$firefox_folder_installed_32\$firefox_corrupted_file_1"
	$i_return = i_my_rename_file "$firefox_folder_installed_32\$firefox_corrupted_file_2"           "$firefox_folder_installed_32\$firefox_corrupted_file_2.bak"
	$i_return = i_my_rename_file "$firefox_folder_installed_32\$firefox_corrupted_file_2.temporary" "$firefox_folder_installed_32\$firefox_corrupted_file_2"
}
if ($i_installation_type -eq 7)
{
	$i_return = i_my_rename_file "$firefox_folder_installed_64\$firefox_corrupted_file_1"           "$firefox_folder_installed_64\$firefox_corrupted_file_1.bak"
	$i_return = i_my_rename_file "$firefox_folder_installed_64\$firefox_corrupted_file_1.temporary" "$firefox_folder_installed_64\$firefox_corrupted_file_1"
	$i_return = i_my_rename_file "$firefox_folder_installed_64\$firefox_corrupted_file_2"           "$firefox_folder_installed_64\$firefox_corrupted_file_2.bak"
	$i_return = i_my_rename_file "$firefox_folder_installed_64\$firefox_corrupted_file_2.temporary" "$firefox_folder_installed_64\$firefox_corrupted_file_2"
}

Write-Host "`r`nAppuyez sur une touche pour continuer..."
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
exit 0

Enregistrez et fermez le fichier, puis changez son extension ".txt" en ".ps1".

Si vous avez Firefox Portable, vous pouvez renommer le fichier en "FirefoxPortable - Supprimer écriture inclusive.ps1" par exemple.
Ensuite il faut placer le fichier script dans le dossier racine, par exemple : "D:\Programs\PortableApps\PortableApps\FirefoxPortable".
Si vous avez installé Firefox, vous pouvez mettre ce fichier depuis n'importe où.
Pour une autre installation, il vous suffit de modifier le début du script pour renseigner l'emplacement.

Ensuite double-cliquez dessus pour nettoyer les fichiers corrompus.

Bonus : voici une version du script en VisualBasic Script (exécutable en mode fenêtre ou en mode console). C'est plus lent mais si vous n'arrivez pas à utiliser le PowerShell, ça fonctionnera aussi :

' Character encoding = UTF-16 LE (Byte Order Mark = FF FE)
' End-of-line = Windows (CR LF)

' Composants requis :
set object_shell       = WScript.CreateObject("WScript.Shell")
set object_file_system = WScript.CreateObject("Scripting.FileSystemObject")
current_folder         = object_file_system.GetParentFolderName(WScript.ScriptFullName)



' Emplacement personnalisé du dossier contenant le fichier "firefox.exe".
' Vous pouvez le laisser vide. Exemple :
' firefox_folder = current_folder & "\Mozilla Firefox"
firefox_folder = ""



' Emplacements connus :
firefox_folder_portable_32  = current_folder & "\App\Firefox"
firefox_folder_portable_64  = current_folder & "\App\Firefox64"
firefox_folder_installed_32 = object_shell.ExpandEnvironmentStrings("%ProgramFiles(x86)%") & "\Mozilla Firefox"
firefox_folder_installed_64 = object_shell.ExpandEnvironmentStrings("%ProgramFiles%")      & "\Mozilla Firefox"

' Fichiers à réparer :
firefox_corrupted_file_1 = "omni.ja"
firefox_corrupted_file_2 = "browser\omni.ja"

' Réparations à faire :
dim firefox_corrupted_file_1_error_ori()
dim firefox_corrupted_file_1_error_fix()
dim firefox_corrupted_file_2_error_ori()
dim firefox_corrupted_file_2_error_fix()

redim preserve firefox_corrupted_file_1_error_ori(0)
redim preserve firefox_corrupted_file_1_error_fix(0)
firefox_corrupted_file_1_error_ori(0) = "7574696C69736174657572C2B774726963650A"
firefox_corrupted_file_1_error_fix(0) = "7574696C697361746575720A0A0A0A0A0A0A0A"
' utilisateur·trice => utilisateur

redim preserve firefox_corrupted_file_2_error_ori(0)
redim preserve firefox_corrupted_file_2_error_fix(0)
firefox_corrupted_file_2_error_ori(0) = "61646D696E697374726174657572C2B7747269636520612064C3A9736163746976C3A9206C612073796E6368726F6E69736174696F6E2E0A"
firefox_corrupted_file_2_error_fix(0) = "61646D696E69737472617465757220612064C3A9736163746976C3A9206C612073796E6368726F6E69736174696F6E2E0A0A0A0A0A0A0A0A"
' administrateur·trice a désactivé la synchronisation. => administrateur a désactivé la synchronisation.

redim preserve firefox_corrupted_file_2_error_ori(ubound(firefox_corrupted_file_2_error_ori) + 1)
redim preserve firefox_corrupted_file_2_error_fix(ubound(firefox_corrupted_file_2_error_fix) + 1)
firefox_corrupted_file_2_error_ori(1) = "636F6E6E656374C3A9C2B7652E0A"
firefox_corrupted_file_2_error_fix(1) = "636F6E6E656374C3A92E0A0A0A0A"
' connecté·e. => connecté.

redim preserve firefox_corrupted_file_2_error_ori(ubound(firefox_corrupted_file_2_error_ori) + 1)
redim preserve firefox_corrupted_file_2_error_fix(ubound(firefox_corrupted_file_2_error_fix) + 1)
firefox_corrupted_file_2_error_ori(2) = "636F6E6E656374C3A9C2B76520617665632073756363C3A8730A"
firefox_corrupted_file_2_error_fix(2) = "636F6E6E656374C3A920617665632073756363C3A8730A0A0A0A"
' connecté·e avec succès => connecté avec succès

redim preserve firefox_corrupted_file_2_error_ori(ubound(firefox_corrupted_file_2_error_ori) + 1)
redim preserve firefox_corrupted_file_2_error_fix(ubound(firefox_corrupted_file_2_error_fix) + 1)
firefox_corrupted_file_2_error_ori(3) = "636F6E6E656374C3A9C2B7650A"
firefox_corrupted_file_2_error_fix(3) = "636F6E6E656374C3A90A0A0A0A"
' connecté·e => connecté

redim preserve firefox_corrupted_file_2_error_ori(ubound(firefox_corrupted_file_2_error_ori) + 1)
redim preserve firefox_corrupted_file_2_error_fix(ubound(firefox_corrupted_file_2_error_fix) + 1)
firefox_corrupted_file_2_error_ori(4) = "7375697669C2B7650A"
firefox_corrupted_file_2_error_fix(4) = "73756976690A0A0A0A"
' suivi·e=> suivi

redim preserve firefox_corrupted_file_2_error_ori(ubound(firefox_corrupted_file_2_error_ori) + 1)
redim preserve firefox_corrupted_file_2_error_fix(ubound(firefox_corrupted_file_2_error_fix) + 1)
firefox_corrupted_file_2_error_ori(5) = "5072C3AA74C2B76520C3A0207363616E6E65723C2F7374726F6E673E206574206D61696E74656E657A20766F74726520617070617265696C2061752D64657373757320646520636520636F64650A"
firefox_corrupted_file_2_error_fix(5) = "5072C3AA7420C3A0207363616E6E65723C2F7374726F6E673E206574206D61696E74656E657A20766F74726520617070617265696C2061752D64657373757320646520636520636F64650A0A0A0A"
' Prêt·e à scanner</strong> et maintenez votre appareil au-dessus de ce code => Prêt à scanner</strong> et maintenez votre appareil au-dessus de ce code

redim preserve firefox_corrupted_file_2_error_ori(ubound(firefox_corrupted_file_2_error_ori) + 1)
redim preserve firefox_corrupted_file_2_error_fix(ubound(firefox_corrupted_file_2_error_fix) + 1)
firefox_corrupted_file_2_error_ori(6) = "70697374C3A9C2B7650A"
firefox_corrupted_file_2_error_fix(6) = "70697374C3A90A0A0A0A"
' pisté·e => pisté



i_installation_type = 0
if firefox_folder <> "" then
	if object_file_system.FileExists(firefox_folder & "\" & firefox_corrupted_file_1) = FALSE then
		WScript.Echo "Erreur, fichier non détecté :" & vbCrLf & firefox_folder & "\" & firefox_corrupted_file_1
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	if object_file_system.FileExists(firefox_folder & "\" & firefox_corrupted_file_2) = FALSE then
		WScript.Echo "Erreur, fichier non détecté :" & vbCrLf & firefox_folder & "\" & firefox_corrupted_file_2
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	i_installation_type = 1
	WScript.Echo "Fichiers détectés :" & vbCrLf & firefox_folder & "\" & firefox_corrupted_file_1 & vbCrLf & firefox_folder & "\" & firefox_corrupted_file_2 & vbCrLf
end if
if object_file_system.FileExists(firefox_folder_portable_32 & "\" & firefox_corrupted_file_1) = TRUE then
	if object_file_system.FileExists(firefox_folder_portable_32 & "\" & firefox_corrupted_file_2) = FALSE then
		WScript.Echo "Erreur, le second fichier :" & vbCrLf & firefox_folder_portable_32 & "\" & firefox_corrupted_file_2 & vbCrLf _
		& "n'a pas été détecté alors que le premier l'a été :" & vbCrLf & firefox_folder_portable_32 & "\" & firefox_corrupted_file_1
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	i_installation_type = 2
	WScript.Echo "Fichiers détectés :" & vbCrLf & firefox_folder_portable_32 & "\" & firefox_corrupted_file_1 & vbCrLf & firefox_folder_portable_32 & "\" & firefox_corrupted_file_2 & vbCrLf
end if
if object_file_system.FileExists(firefox_folder_portable_64 & "\" & firefox_corrupted_file_1) = TRUE then
	if object_file_system.FileExists(firefox_folder_portable_64 & "\" & firefox_corrupted_file_2) = FALSE then
		WScript.Echo "Erreur, le second fichier :" & vbCrLf & firefox_folder_portable_64 & "\" & firefox_corrupted_file_2 & vbCrLf _
		& "n'a pas été détecté alors que le premier l'a été :" & vbCrLf & firefox_folder_portable_64 & "\" & firefox_corrupted_file_1
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	i_installation_type = i_installation_type + 3
	WScript.Echo "Fichiers détectés :" & vbCrLf & firefox_folder_portable_64 & "\" & firefox_corrupted_file_1 & vbCrLf & firefox_folder_portable_64 & "\" & firefox_corrupted_file_2 & vbCrLf
end if
if object_file_system.FileExists(firefox_folder_installed_32 & "\" & firefox_corrupted_file_1) = TRUE then
	if object_file_system.FileExists(firefox_folder_installed_32 & "\" & firefox_corrupted_file_2) = FALSE then
		WScript.Echo "Erreur, le second fichier :" & vbCrLf & firefox_folder_installed_32 & "\" & firefox_corrupted_file_2 & vbCrLf _
		& "n'a pas été détecté alors que le premier l'a été :" & vbCrLf & firefox_folder_installed_32 & "\" & firefox_corrupted_file_1
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	i_installation_type = 6
	WScript.Echo "Fichiers détectés :" & vbCrLf & firefox_folder_installed_32 & "\" & firefox_corrupted_file_1 & vbCrLf & firefox_folder_installed_32 & "\" & firefox_corrupted_file_2 & vbCrLf
end if
if object_file_system.FileExists(firefox_folder_installed_64 & "\" & firefox_corrupted_file_1) = TRUE then
	if object_file_system.FileExists(firefox_folder_installed_64 & "\" & firefox_corrupted_file_2) = FALSE then
		WScript.Echo "Erreur, le second fichier :" & vbCrLf & firefox_folder_installed_64 & "\" & firefox_corrupted_file_2 & vbCrLf _
		& "n'a pas été détecté alors que le premier l'a été :" & vbCrLf & firefox_folder_installed_64 & "\" & firefox_corrupted_file_1
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	i_installation_type = 7
	WScript.Echo "Fichiers détectés :" & vbCrLf & firefox_folder_installed_64 & "\" & firefox_corrupted_file_1 & vbCrLf & firefox_folder_installed_64 & "\" & firefox_corrupted_file_2 & vbCrLf
end if

if i_installation_type = 0 then
	WScript.Echo "Erreur, aucun fichier détecté."
	WScript.Sleep 5000
	WScript.Quit(0)
end if
if i_installation_type = 1 then
	if object_file_system.FileExists(firefox_folder & "\" & firefox_corrupted_file_1 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & firefox_folder & "\" & firefox_corrupted_file_1 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	if object_file_system.FileExists(firefox_folder & "\" & firefox_corrupted_file_2 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & firefox_folder & "\" & firefox_corrupted_file_2 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 2 OR i_installation_type = 5 then
	if object_file_system.FileExists(firefox_folder_portable_32 & "\" & firefox_corrupted_file_1 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & firefox_folder_portable_32 & "\" & firefox_corrupted_file_1 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	if object_file_system.FileExists(firefox_folder_portable_32 & "\" & firefox_corrupted_file_2 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & firefox_folder_portable_32 & "\" & firefox_corrupted_file_2 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 3 OR i_installation_type = 5 then
	if object_file_system.FileExists(firefox_folder_portable_64 & "\" & firefox_corrupted_file_1 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & firefox_folder_portable_64 & "\" & firefox_corrupted_file_1 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	if object_file_system.FileExists(firefox_folder_portable_64 & "\" & firefox_corrupted_file_2 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & firefox_folder_portable_64 & "\" & firefox_corrupted_file_2 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 6 then
	if object_file_system.FileExists(firefox_folder_installed_32 & "\" & firefox_corrupted_file_1 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & firefox_folder_installed_32 & "\" & firefox_corrupted_file_1 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	if object_file_system.FileExists(firefox_folder_installed_32 & "\" & firefox_corrupted_file_2 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & firefox_folder_installed_32 & "\" & firefox_corrupted_file_2 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 7 then
	if object_file_system.FileExists(firefox_folder_installed_64 & "\" & firefox_corrupted_file_1 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & firefox_folder_installed_64 & "\" & firefox_corrupted_file_1 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	if object_file_system.FileExists(firefox_folder_installed_64 & "\" & firefox_corrupted_file_2 & ".bak") = TRUE then
		WScript.Echo "Erreur, le fichier de sauvegarde :" & vbCrLf & firefox_folder_installed_64 & "\" & firefox_corrupted_file_2 & ".bak" & vbCrLf _
		& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
		& "supprimez le fichier "".bak"" et relancez ce script."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if

if ubound(firefox_corrupted_file_1_error_ori) <> ubound(firefox_corrupted_file_1_error_fix) then
	WScript.Echo "Erreur :" & vbCrLf & "Le nombre de cases dans le tableau des chaînes hexadécimales à détecter" & vbCrLf & "et dans le tableau des chaînes hexadécimales à remplacer n'est pas identique."
	WScript.Sleep 5000
	WScript.Quit(0)
end if
if ubound(firefox_corrupted_file_2_error_ori) <> ubound(firefox_corrupted_file_2_error_fix) then
	WScript.Echo "Erreur :" & vbCrLf & "Le nombre de cases dans le tableau des chaînes hexadécimales à détecter" & vbCrLf & "et dans le tableau des chaînes hexadécimales à remplacer n'est pas identique."
	WScript.Sleep 5000
	WScript.Quit(0)
end if
for i = 0 to ubound(firefox_corrupted_file_1_error_ori) step 1
	' WScript.Echo firefox_corrupted_file_1_error_ori(i) & " = " & len(firefox_corrupted_file_1_error_ori(i)) & vbCrLf & firefox_corrupted_file_1_error_fix(i) & " = " & len(firefox_corrupted_file_1_error_fix(i))
	if len(firefox_corrupted_file_1_error_ori(i)) <> len(firefox_corrupted_file_1_error_fix(i)) then
		WScript.Echo "Erreur :" & vbCrLf & "La variable """ & firefox_corrupted_file_1_error_ori(i) & """ et" & vbCrLf & "la variable """ & firefox_corrupted_file_1_error_fix(i) & """" & vbCrLf _
		& "n'ont pas le même nombre de caractères."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	if len(firefox_corrupted_file_1_error_ori(i)) MOD 2 <> 0 then
		WScript.Echo "Erreur, les variables :" & vbCrLf & firefox_corrupted_file_1_error_ori(i) & vbCrLf & firefox_corrupted_file_1_error_fix(i) & vbCrLf & "ont un nombre impair de caractères."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	if len(firefox_corrupted_file_1_error_ori(i)) < 12 then
		WScript.Echo "Erreur, les variables :" & vbCrLf & firefox_corrupted_file_1_error_ori(i) & vbCrLf & firefox_corrupted_file_1_error_fix(i) & vbCrLf & "doivent avoir au moins 12 caractères hexadécimaux" _
		& vbCrLf & "pour représenter au moins 6 octets." & vbCrLf & "Or ici, elles n'en contiennent que " & len(firefox_corrupted_file_1_error_ori(i)) & "."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
next
for i = 0 to ubound(firefox_corrupted_file_2_error_ori) step 1
	' WScript.Echo firefox_corrupted_file_2_error_ori(i) & " = " & len(firefox_corrupted_file_2_error_ori(i)) & vbCrLf & firefox_corrupted_file_2_error_fix(i) & " = " & len(firefox_corrupted_file_2_error_fix(i))
	if len(firefox_corrupted_file_2_error_ori(i)) <> len(firefox_corrupted_file_2_error_fix(i)) then
		WScript.Echo "Erreur :" & vbCrLf & "La variable """ & firefox_corrupted_file_2_error_ori(i) & """ et" & vbCrLf & "la variable """ & firefox_corrupted_file_2_error_fix(i) & """" & vbCrLf _
		& "n'ont pas le même nombre de caractères."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	if len(firefox_corrupted_file_2_error_ori(i)) MOD 2 <> 0 then
		WScript.Echo "Erreur, les variables :" & vbCrLf & firefox_corrupted_file_2_error_ori(i) & vbCrLf & firefox_corrupted_file_2_error_fix(i) & vbCrLf & "ont un nombre impair de caractères."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	if len(firefox_corrupted_file_2_error_ori(i)) < 12 then
		WScript.Echo "Erreur, les variables :" & vbCrLf & firefox_corrupted_file_2_error_ori(i) & vbCrLf & firefox_corrupted_file_2_error_fix(i) & vbCrLf & "doivent avoir au moins 12 caractères hexadécimaux" _
		& vbCrLf & "pour représenter au moins 6 octets." & vbCrLf & "Or ici, elles n'en contiennent que " & len(firefox_corrupted_file_2_error_ori(i)) & "."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
next

if i_installation_type = 1 then
	set object_file = object_file_system.CreateTextFile(firefox_folder & "\" & firefox_corrupted_file_1 & ".temporary", TRUE, FALSE)	' (TRUE = Écraser si existe déjà) (FALSE = Utiliser ASCII au lieu d'Unicode UTF16LE donc pas de Byte Order Mark FFFE)
	object_file.Close
	if object_file_system.FileExists(firefox_folder & "\" & firefox_corrupted_file_1 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & firefox_folder & "\" & firefox_corrupted_file_1 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	set object_file = object_file_system.CreateTextFile(firefox_folder & "\" & firefox_corrupted_file_2 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(firefox_folder & "\" & firefox_corrupted_file_1 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & firefox_folder & "\" & firefox_corrupted_file_2 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 2 OR i_installation_type = 5 then
	set object_file = object_file_system.CreateTextFile(firefox_folder_portable_32 & "\" & firefox_corrupted_file_1 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(firefox_folder_portable_32 & "\" & firefox_corrupted_file_1 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & firefox_folder_portable_32 & "\" & firefox_corrupted_file_1 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	set object_file = object_file_system.CreateTextFile(firefox_folder_portable_32 & "\" & firefox_corrupted_file_2 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(firefox_folder_portable_32 & "\" & firefox_corrupted_file_2 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & firefox_folder_portable_32 & "\" & firefox_corrupted_file_2 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 3 OR i_installation_type = 5 then
	set object_file = object_file_system.CreateTextFile(firefox_folder_portable_64 & "\" & firefox_corrupted_file_1 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(firefox_folder_portable_64 & "\" & firefox_corrupted_file_1 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & firefox_folder_portable_64 & "\" & firefox_corrupted_file_1 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	set object_file = object_file_system.CreateTextFile(firefox_folder_portable_64 & "\" & firefox_corrupted_file_2 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(firefox_folder_portable_64 & "\" & firefox_corrupted_file_2 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & firefox_folder_portable_64 & "\" & firefox_corrupted_file_2 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 6 then
	set object_file = object_file_system.CreateTextFile(firefox_folder_installed_32 & "\" & firefox_corrupted_file_1 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(firefox_folder_installed_32 & "\" & firefox_corrupted_file_1 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & firefox_folder_installed_32 & "\" & firefox_corrupted_file_1 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	set object_file = object_file_system.CreateTextFile(firefox_folder_installed_32 & "\" & firefox_corrupted_file_2 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(firefox_folder_installed_32 & "\" & firefox_corrupted_file_2 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & firefox_folder_installed_32 & "\" & firefox_corrupted_file_2 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if
if i_installation_type = 7 then
	set object_file = object_file_system.CreateTextFile(firefox_folder_installed_64 & "\" & firefox_corrupted_file_1 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(firefox_folder_installed_64 & "\" & firefox_corrupted_file_1 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & firefox_folder_installed_64 & "\" & firefox_corrupted_file_1 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
	set object_file = object_file_system.CreateTextFile(firefox_folder_installed_64 & "\" & firefox_corrupted_file_2 & ".temporary", TRUE, FALSE)
	object_file.Close
	if object_file_system.FileExists(firefox_folder_installed_64 & "\" & firefox_corrupted_file_2 & ".temporary") = FALSE then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & firefox_folder_installed_64 & "\" & firefox_corrupted_file_2 & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if
end if

function i_my_replace_array_hex_strings_in_file(byval array_hex_strings_to_find, byval array_hex_strings_to_replace, byval file_fullname)
	set object_file_input  = object_file_system.OpenTextFile(file_fullname, 1)				' Ouverture du fichier en lecture
	set object_file_output = object_file_system.OpenTextFile(file_fullname & ".temporary", 2, TRUE, 0)	' Ouverture du fichier en écriture (TRUE = Fichier créé si n'existe pas) (0 = ASCII, -1 = Unicode, -2 = Par défaut)

	char_buffer  = ""
	i_char_check = 0
	b_replacement_done  = FALSE
	i_replacement_count = 0
	i_1 = 0
	do until object_file_input.AtEndOfStream
		character_read = object_file_input.Read(1)
		' byte_read    = ucase(cstr(hex(ascb(character_read))))
		' byte_read    = string(2 - len(byte_read), "0") & byte_read
		' WScript.Echo "Caractère lu (code " & byte_read & ") : " & character_read

		if b_replacement_done = FALSE then
			' Pour aller plus vite, extraction des 5 premiers octets et conversion en caractères
			byte_to_find_1 = mid(array_hex_strings_to_find(i_1),1,2)
			byte_to_find_2 = mid(array_hex_strings_to_find(i_1),3,2)
			byte_to_find_3 = mid(array_hex_strings_to_find(i_1),5,2)
			byte_to_find_4 = mid(array_hex_strings_to_find(i_1),7,2)
			byte_to_find_5 = mid(array_hex_strings_to_find(i_1),9,2)
			char_to_find_1 = chr(cdbl("&h" & byte_to_find_1))
			char_to_find_2 = chr(cdbl("&h" & byte_to_find_2))
			char_to_find_3 = chr(cdbl("&h" & byte_to_find_3))
			char_to_find_4 = chr(cdbl("&h" & byte_to_find_4))
			char_to_find_5 = chr(cdbl("&h" & byte_to_find_5))
			b_replacement_done = TRUE
		end if

		Select Case i_char_check
			Case 0
				if character_read = char_to_find_1 then
					char_buffer  = char_buffer & character_read
					i_char_check = 1
				end if
			Case 1
				if character_read = char_to_find_2 then
					char_buffer  = char_buffer & character_read
					i_char_check = 2
				else
					object_file_output.Write(char_buffer)
					char_buffer  = ""
					i_char_check = 0
				end if
			Case 2
				if character_read = char_to_find_3 then
					char_buffer  = char_buffer & character_read
					i_char_check = 3
				else
					object_file_output.Write(char_buffer)
					char_buffer  = ""
					i_char_check = 0
				end if
			Case 3
				if character_read = char_to_find_4 then
					char_buffer  = char_buffer & character_read
					i_char_check = 4
				else
					object_file_output.Write(char_buffer)
					char_buffer  = ""
					i_char_check = 0
				end if
			Case 4
				if character_read = char_to_find_5 then
					char_buffer  = char_buffer & character_read
					i_char_check = 5
				else
					object_file_output.Write(char_buffer)
					char_buffer  = ""
					i_char_check = 0
				end if
			Case Else
				if character_read = chr(cdbl("&h" & mid(array_hex_strings_to_find(i_1),2*i_char_check+1,2))) then
					char_buffer = char_buffer & character_read
					i_char_check = i_char_check + 1
				else
					object_file_output.Write(char_buffer)
					char_buffer  = ""
					i_char_check = 0
				end if
				if i_char_check = len(array_hex_strings_to_find(i_1)) / 2 then
					for i_2 = 1 to len(array_hex_strings_to_replace(i_1)) step 2
						object_file_output.Write(chr(cdbl("&h" & mid(array_hex_strings_to_replace(i_1),i_2,2))))
					next
					char_buffer  = ""
					i_char_check = 0
					b_replacement_done  = FALSE
					i_replacement_count = i_replacement_count + 1
					WScript.Echo "Fichier :" & vbCrLf & file_fullname & vbCrLf & "Séquence trouvée :" & vbCrLf & array_hex_strings_to_find(i_1) & vbCrLf & "Remplacée par :" & vbCrLf & array_hex_strings_to_replace(i_1) & vbCrLf
					if i_1 < ubound(array_hex_strings_to_find) then
						i_1 = i_1 + 1
					end if
				end if
		End Select

		if i_char_check = 0 AND b_replacement_done = TRUE then
			object_file_output.Write(character_read)
		end if
	loop

	object_file_input.Close
	object_file_output.Close
	i_my_replace_array_hex_strings_in_file = i_replacement_count
end function

if i_installation_type = 1 then
	number_of_replacements_1 = i_my_replace_array_hex_strings_in_file(firefox_corrupted_file_1_error_ori, firefox_corrupted_file_1_error_fix, firefox_folder & "\" & firefox_corrupted_file_1)
	Wscript.Echo number_of_replacements_1 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & firefox_folder & "\" & firefox_corrupted_file_1 & vbCrLf
	number_of_replacements_2 = i_my_replace_array_hex_strings_in_file(firefox_corrupted_file_2_error_ori, firefox_corrupted_file_2_error_fix, firefox_folder & "\" & firefox_corrupted_file_2)
	Wscript.Echo number_of_replacements_2 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & firefox_folder & "\" & firefox_corrupted_file_2 & vbCrLf
end if
if i_installation_type = 2 OR i_installation_type = 5 then
	number_of_replacements_1 = i_my_replace_array_hex_strings_in_file(firefox_corrupted_file_1_error_ori, firefox_corrupted_file_1_error_fix, firefox_folder_portable_32 & "\" & firefox_corrupted_file_1)
	Wscript.Echo number_of_replacements_1 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & firefox_folder_portable_32 & "\" & firefox_corrupted_file_1 & vbCrLf
	number_of_replacements_2 = i_my_replace_array_hex_strings_in_file(firefox_corrupted_file_2_error_ori, firefox_corrupted_file_2_error_fix, firefox_folder_portable_32 & "\" & firefox_corrupted_file_2)
	Wscript.Echo number_of_replacements_2 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & firefox_folder_portable_32 & "\" & firefox_corrupted_file_2 & vbCrLf
end if
if i_installation_type = 3 OR i_installation_type = 5 then
	number_of_replacements_1 = i_my_replace_array_hex_strings_in_file(firefox_corrupted_file_1_error_ori, firefox_corrupted_file_1_error_fix, firefox_folder_portable_64 & "\" & firefox_corrupted_file_1)
	Wscript.Echo number_of_replacements_1 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & firefox_folder_portable_64 & "\" & firefox_corrupted_file_1 & vbCrLf
	number_of_replacements_2 = i_my_replace_array_hex_strings_in_file(firefox_corrupted_file_2_error_ori, firefox_corrupted_file_2_error_fix, firefox_folder_portable_64 & "\" & firefox_corrupted_file_2)
	Wscript.Echo number_of_replacements_2 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & firefox_folder_portable_64 & "\" & firefox_corrupted_file_2 & vbCrLf
end if
if i_installation_type = 6 then
	number_of_replacements_1 = i_my_replace_array_hex_strings_in_file(firefox_corrupted_file_1_error_ori, firefox_corrupted_file_1_error_fix, firefox_folder_installed_32 & "\" & firefox_corrupted_file_1)
	Wscript.Echo number_of_replacements_1 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & firefox_folder_installed_32 & "\" & firefox_corrupted_file_1 & vbCrLf
	number_of_replacements_2 = i_my_replace_array_hex_strings_in_file(firefox_corrupted_file_2_error_ori, firefox_corrupted_file_2_error_fix, firefox_folder_installed_32 & "\" & firefox_corrupted_file_2)
	Wscript.Echo number_of_replacements_2 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & firefox_folder_installed_32 & "\" & firefox_corrupted_file_2 & vbCrLf
end if
if i_installation_type = 7 then
	number_of_replacements_1 = i_my_replace_array_hex_strings_in_file(firefox_corrupted_file_1_error_ori, firefox_corrupted_file_1_error_fix, firefox_folder_installed_64 & "\" & firefox_corrupted_file_1)
	Wscript.Echo number_of_replacements_1 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & firefox_folder_installed_64 & "\" & firefox_corrupted_file_1 & vbCrLf
	number_of_replacements_2 = i_my_replace_array_hex_strings_in_file(firefox_corrupted_file_2_error_ori, firefox_corrupted_file_2_error_fix, firefox_folder_installed_64 & "\" & firefox_corrupted_file_2)
	Wscript.Echo number_of_replacements_2 & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & firefox_folder_installed_64 & "\" & firefox_corrupted_file_2 & vbCrLf
end if

Function i_my_rename_file(byval file_fullname, byval file_fullname_new)
	if not object_file_system.FileExists(file_fullname) then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & file_fullname & vbCrLf & "n'existe pas, impossible de le renommer en :" & vbCrLf & file_fullname_new
		WScript.Sleep 5000
		WScript.Quit(0)
	end if

	' WScript.Echo "On renomme le fichier :" & vbCrLf & file_fullname & vbCrLf & "en :" & vbCrLf & file_fullname_new
	object_file_system.MoveFile file_fullname, file_fullname_new

	if not object_file_system.FileExists(file_fullname_new) then
		WScript.Echo "Erreur, le fichier :" & vbCrLf & file_fullname & vbCrLf & "n'a pas pu être renommé."
		WScript.Sleep 5000
		WScript.Quit(0)
	end if

	i_my_rename_file = 0
end function

if i_installation_type = 1 then
	i_my_rename_file firefox_folder & "\" & firefox_corrupted_file_1,                firefox_folder & "\" & firefox_corrupted_file_1 & ".bak"
	i_my_rename_file firefox_folder & "\" & firefox_corrupted_file_1 & ".temporary", firefox_folder & "\" & firefox_corrupted_file_1
	i_my_rename_file firefox_folder & "\" & firefox_corrupted_file_2,                firefox_folder & "\" & firefox_corrupted_file_2 & ".bak"
	i_my_rename_file firefox_folder & "\" & firefox_corrupted_file_2 & ".temporary", firefox_folder & "\" & firefox_corrupted_file_2
end if
if i_installation_type = 2 OR i_installation_type = 5 then
	i_my_rename_file firefox_folder_portable_32 & "\" & firefox_corrupted_file_1,                firefox_folder_portable_32 & "\" & firefox_corrupted_file_1 & ".bak"
	i_my_rename_file firefox_folder_portable_32 & "\" & firefox_corrupted_file_1 & ".temporary", firefox_folder_portable_32 & "\" & firefox_corrupted_file_1
	i_my_rename_file firefox_folder_portable_32 & "\" & firefox_corrupted_file_2,                firefox_folder_portable_32 & "\" & firefox_corrupted_file_2 & ".bak"
	i_my_rename_file firefox_folder_portable_32 & "\" & firefox_corrupted_file_2 & ".temporary", firefox_folder_portable_32 & "\" & firefox_corrupted_file_2
end if
if i_installation_type = 3 OR i_installation_type = 5 then
	i_my_rename_file firefox_folder_portable_64 & "\" & firefox_corrupted_file_1,                firefox_folder_portable_64 & "\" & firefox_corrupted_file_1 & ".bak"
	i_my_rename_file firefox_folder_portable_64 & "\" & firefox_corrupted_file_1 & ".temporary", firefox_folder_portable_64 & "\" & firefox_corrupted_file_1
	i_my_rename_file firefox_folder_portable_64 & "\" & firefox_corrupted_file_2,                firefox_folder_portable_64 & "\" & firefox_corrupted_file_2 & ".bak"
	i_my_rename_file firefox_folder_portable_64 & "\" & firefox_corrupted_file_2 & ".temporary", firefox_folder_portable_64 & "\" & firefox_corrupted_file_2
end if
if i_installation_type = 6 then
	i_my_rename_file firefox_folder_installed_32 & "\" & firefox_corrupted_file_1,                firefox_folder_installed_32 & "\" & firefox_corrupted_file_1 & ".bak"
	i_my_rename_file firefox_folder_installed_32 & "\" & firefox_corrupted_file_1 & ".temporary", firefox_folder_installed_32 & "\" & firefox_corrupted_file_1
	i_my_rename_file firefox_folder_installed_32 & "\" & firefox_corrupted_file_2,                firefox_folder_installed_32 & "\" & firefox_corrupted_file_2 & ".bak"
	i_my_rename_file firefox_folder_installed_32 & "\" & firefox_corrupted_file_2 & ".temporary", firefox_folder_installed_32 & "\" & firefox_corrupted_file_2
end if
if i_installation_type = 7 then
	i_my_rename_file firefox_folder_installed_64 & "\" & firefox_corrupted_file_1,                firefox_folder_installed_64 & "\" & firefox_corrupted_file_1 & ".bak"
	i_my_rename_file firefox_folder_installed_64 & "\" & firefox_corrupted_file_1 & ".temporary", firefox_folder_installed_64 & "\" & firefox_corrupted_file_1
	i_my_rename_file firefox_folder_installed_64 & "\" & firefox_corrupted_file_2,                firefox_folder_installed_64 & "\" & firefox_corrupted_file_2 & ".bak"
	i_my_rename_file firefox_folder_installed_64 & "\" & firefox_corrupted_file_2 & ".temporary", firefox_folder_installed_64 & "\" & firefox_corrupted_file_2
end if

WScript.Sleep 5000
WScript.Quit(0)

Il faudra donner au fichier ".txt" l'extension ".vbs".

PS : Je remercie ChatGPT pour la vitesse à laquelle j'ai pu écrire ces scripts.
Pour les puristes, je sais, il eut été plus intelligent de faire d'abord une fonction de recherche, puis ensuite une fonction d'édition en utilisant une fonction type "fsetpos", mais j'avais la flemme, j'ai torché ça à l'arrache en 2h en dehors du taf sur mon temps de pause, donc soyez indulgents.

Edited by actaruss
Erreur orthographe
  • Merci 1
Link to comment
Share on other sites

  • actaruss changed the title to Firefox Thunderbird Supprimer écriture inclusive

Merci pour cette "synthèse" du sujet. 😄

Heureusement que cela n'a pas pris. J'arrête également de lire tout média qui se lance dans cette aventure. Comme 90% des gens sont contre l'écriture inclusive normalement, et qu'ils doivent réagir pareil, ca doit leur faire 90% d'audimat en moins. Je pense qu'ils en reviennent donc rapidement.

Limaces, Hulotscope, écriture inclusive… voici l’édito des lectrices et lecteurs (reporterre.net)

Après, il faut distinguer l'utilisation du point médian, l'accord de proximité, l'accord de majorité, tous à jeter, de la féminisation des noms de métier ou fonction. 

Mais ca ne fait que 1 bébé sur 4 à ne pas laisser se noyer dans l'eau du bain. 😅

  • Aime 1
Link to comment
Share on other sites

Merci également pour ces précisions mais je n'ai pas aussi pu lire la totalité de ce topic qui me donne déjà le tournis.

De grâce si vous ne comprenez pas ce charabia, faites comme moi : passez votre chemin.

Link to comment
Share on other sites

l'écriture inclusive qui est une ânerie j'en conviens est quand même signe d'un monde qui se cherche, évolue et tente de prendre tout le monde en compte.
Comme féminiser les titres, j'adhère pas à tout, Mme la Maire sonne toujours bizarre dans mes oreilles par exemple.
D'ailleurs je ne comprend pas vraiment pourquoi faire ça... Le titre désignant la fonction ou le statut de la personne, pas la personne elle-même.

Au quotidien je fait l'effort d'y réfléchir, et c'est pas si dur de ne pas "genrer" son interlocuteur dan une conversation. Avant j’accueillais toujours les personnes avec un bonjour madame, mademoiselle ou monsieur. mais une erreur d'observation peut vite arriver et vexer la personne en face, alors un simple "bonjour" suffit.

Sinon en français la règle est simple pour écrire : genre inconnu ou pluriel mixte = usage du masculin
Je crois pas que ce soit les LGBT qui ont poussé l'écriture inclusive mais les féministes ultra qui trouvent cette règle patriarcale.

Link to comment
Share on other sites

Le 07/07/2023 à 20:47, ceric64 a dit :

Merci également pour ces précisions mais je n'ai pas aussi pu lire la totalité de ce topic qui me donne déjà le tournis.

De grâce si vous ne comprenez pas ce charabia, faites comme moi : passez votre chemin.

On appelle ça la paresse intellectuelle, c'est le grand mal de notre temps.
C'est le principe de la philosophie, des maths ou de tout raisonnement logique : faut prendre le temps de lire la démonstration.

Si je te dis "la laïcité est une erreur", "le suffrage universel est une erreur", "l'Islam n'est pas une religion mais un système politique incompatible avec notre société", "les transgenres sont des malades mentaux", "notre société va vers la guerre civile", "les athées sont soit des paumés, soit des cons", etc.

Va toujours y avoir des cons pour dire "NAN C PA VRÊ !".

L'important n'est pas la conclusion, mais toute la démonstration qui y mène.

Le 08/07/2023 à 13:25, L33thium a dit :

l'écriture inclusive qui est une ânerie j'en conviens est quand même signe d'un monde qui se cherche, évolue et tente de prendre tout le monde en compte.
Comme féminiser les titres, j'adhère pas à tout, Mme la Maire sonne toujours bizarre dans mes oreilles par exemple.
D'ailleurs je ne comprend pas vraiment pourquoi faire ça... Le titre désignant la fonction ou le statut de la personne, pas la personne elle-même.

Au quotidien je fait l'effort d'y réfléchir, et c'est pas si dur de ne pas "genrer" son interlocuteur dan une conversation. Avant j’accueillais toujours les personnes avec un bonjour madame, mademoiselle ou monsieur. mais une erreur d'observation peut vite arriver et vexer la personne en face, alors un simple "bonjour" suffit.

Sinon en français la règle est simple pour écrire : genre inconnu ou pluriel mixte = usage du masculin
Je crois pas que ce soit les LGBT qui ont poussé l'écriture inclusive mais les féministes ultra qui trouvent cette règle patriarcale.

Tu n'as pas dû lire ma démonstration, j'ai déjà répondu à tout ça 😅

Link to comment
Share on other sites

  • 2 weeks later...
Le 10/07/2023 à 12:37, ceric64 a dit :

@actaruss, j'utilise thunderbird et je n'ai jamais eu de problème avec l'écriture inclusive.

Car je ne m'en sers pas.

Troliloliloliloliloliloooooool

Link to comment
Share on other sites

  • 2 months later...

Récemment, j'ai réalisé que cette immonde écriture inclusive était revenue dans Firefox et Thunderbird.
J'ai donc réexécuté mes scripts de désinfection, mais ils ne fonctionnaient plus.

Cela signifie 2 choses :
1 - Les traducteurs ne sont pas allés voir un psychiatre, comme je le leur avait pourtant conseillé.
Je leur ai bien expliqué leur maladie mentale ci-dessus, mais bon, c'est le principe de la folie : on ne sait pas qu'on est fou.
Laissons donc ces déchets de l'humanité rater leur vie et finir dans la poubelle de la sélection naturelle.

2 -
Je n'aurais pas dû laisser ce code à ChatGPT. C'était de la flemme, et ce n'est jamais une bonne chose.
J'ai donc regardé de près de code que ChatGPT avait pondu et en effet... c'est du code dégueulasse. Je m'en excuse.

On en parle beaucoup, mais quand on y regarde de près, même la version 4.0 de ChatGPT ne semble pas très efficace pour coder.
ChatGPT est utile pour "pisser" du code simple en grosse quantité, genre pour faire un site Internet vite fait.
Mais dès qu'il s'agit d'un code complexe, pour l'instant l'intelligence artificielle est plus de la bêtise artificielle.
J'ai donc pris une journée pour faire un vrai code potable.

Voici donc un nouveau code. Cette fois c'est le même pour Firefox et Thunderbird, seule l'entête change.
De plus, vous pouvez ajouter autant de lignes à modifier que vous voulez, et pas besoin qu'elles soient dans l'ordre ou présentes dans le fichier à modifier.

C'était légèrement plus complexe à coder, mais cette fois ce code ne deviendra pas obsolète.

Thunderbird en Powershell :

# Character encoding = UTF-16 LE (Byte Order Mark = FF FE)
# End-of-line = Windows (CR LF)

# Composants requis :
$current_folder = $PWD.Path



# _____________________________________________________________________________
# Partie à modifier pour ajouter des fichiers et erreurs à corriger :



# Emplacement personnalisé du dossier contenant le fichier "thunderbird.exe".
# Vous pouvez le laisser vide. Exemple :
# $program_folder = "$current_folder\Mozilla Thunderbird"
$program_folder = ""



# Emplacements connus :
$program_folder_portable_32  = "$current_folder\App\Thunderbird"
$program_folder_portable_64  = "$current_folder\App\Thunderbird64"
$program_folder_installed_32 = "${env:ProgramFiles(x86)}\Mozilla Thunderbird"
$program_folder_installed_64 = "${$env:ProgramFiles}\Mozilla Thunderbird"



# Fichier(s) à réparer :
$corrupted_file_1 = "omni.ja"



# Réparations à faire :

$corrupted_file_1_error_ori = @()
$corrupted_file_1_error_fix = @()

# away=absent·e => away=absent
$corrupted_file_1_error_ori += "6E74C2B7650A"	# nt·e
$corrupted_file_1_error_fix += "6E740A0A0A0A"	# nt

# utilisateur·trice => utilisateur
$corrupted_file_1_error_ori += "C2B774726963650A"	# ·trice
$corrupted_file_1_error_fix += "0A0A0A0A0A0A0A0A"	# 

# Jean·ne Dupont => Jean Dupont
$corrupted_file_1_error_ori += "C2B76E65204475706F6E740A"	# ·ne Dupont
$corrupted_file_1_error_fix += "204475706F6E740A0A0A0A0A"	#  Dupont

# jean.ne.dupont@example.com => jean.dupont@exemple.com
$corrupted_file_1_error_ori += "2E6E652E6475706F6E74406578616D706C652E636F6D0A"	# .ne.dupont@example.com
$corrupted_file_1_error_fix += "2E6475706F6E74406578656D706C652E636F6D0A0A0A0A"	# .dupont@exemple.com

# averti·e lorsque la génération de clé sera terminée. => averti lorsque la génération de clé sera terminée.
$corrupted_file_1_error_ori += "C2B765206C6F7273717565206C612067C3A96EC3A9726174696F6E20646520636CC3A92073657261207465726D696EC3A9652E0A"	# ·e lorsque la génération de clé sera terminée.
$corrupted_file_1_error_fix += "206C6F7273717565206C612067C3A96EC3A9726174696F6E20646520636CC3A92073657261207465726D696EC3A9652E0A0A0A0A"	#  lorsque la génération de clé sera terminée.

# satisfait·e du résultat. => satisfait du résultat.
$corrupted_file_1_error_ori += "C2B7652064752072C3A973756C7461742E0A"	# ·e du résultat.
$corrupted_file_1_error_fix += "2064752072C3A973756C7461742E0A0A0A0A"	#  du résultat.

# connecté·e plusieurs fois, une autre session peut avoir reçu le message. => connecté plusieurs fois, une autre session peut avoir reçu le message.
$corrupted_file_1_error_ori += "C2B76520706C7573696575727320666F69732C20756E652061757472652073657373696F6E20706575742061766F6972207265C3A775206C65206D6573736167652E0A"	# ·e plusieurs fois, une autre session peut avoir reçu le message.
$corrupted_file_1_error_fix += "20706C7573696575727320666F69732C20756E652061757472652073657373696F6E20706575742061766F6972207265C3A775206C65206D6573736167652E0A0A0A0A"	#  plusieurs fois, une autre session peut avoir reçu le message.

# pisté·e => pisté
$corrupted_file_1_error_ori += "C3A9C2B7650A"	# é·e
$corrupted_file_1_error_fix += "C3A90A0A0A0A"	# é



# _____________________________________________________________________________
# Partie à ne pas modifier :



function i_my_replace_array_hex_strings_in_file([string[]]$array_hex_strings_to_find, [string[]]$array_hex_strings_to_replace, [string]$file_fullname)
{
	if ($array_hex_strings_to_find.GetUpperBound(0) -ne $array_hex_strings_to_replace.GetUpperBound(0))
	{
		Write-Host "Erreur :`r`nLe nombre de cases dans le tableau des chaînes hexadécimales à détecter ($($array_hex_strings_to_find.GetUpperBound(0) + 1))`r`net dans le tableau des chaînes hexadécimales à remplacer ($($array_hex_strings_to_replace.GetUpperBound(0) + 1))`r`nn'est pas identique."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		if ($Host.UI.RawUI.KeyAvailable -eq $true)			# Si le buffer n'est pas vide, au cas où une touche aurait déjà été pressée.
		{
			while ($Host.UI.RawUI.KeyAvailable -eq $true)		# Vide le buffer et met en pause.
			{
				$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
			}
		}
		else
		{
			$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")	# Met en pause.
		}
		exit 0
	}
	for ($i = 0; $i -le $array_hex_strings_to_find.GetUpperBound(0); $i++)
	{
		if ($array_hex_strings_to_find[$i].Length -ne $array_hex_strings_to_replace[$i].Length)
		{
			Write-Host "Erreur :`r`nLa variable $($array_hex_strings_to_find[$i]) et`r`nla variable $($array_hex_strings_to_replace[$i])"
			Write-Host "n'ont pas le même nombre de caractères ($($array_hex_strings_to_find[$i].Length) contre $($array_hex_strings_to_replace[$i].Length))."
			Write-Host "`r`nAppuyez sur une touche pour continuer..."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			else
			{
				$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
			}
			exit 0
		}
		if ($array_hex_strings_to_find[$i].Length % 2 -ne 0)
		{
			Write-Host "Erreur, les variables :`r`n$($array_hex_strings_to_find[$i]) et`r`n$($array_hex_strings_to_replace[$i])`r`nont un nombre impair de caractères."
			Write-Host "`r`nAppuyez sur une touche pour continuer..."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			else
			{
				$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
			}
			exit 0
		}
		if ($array_hex_strings_to_find[$i].Length -lt 12)
		{
			Write-Host "Erreur, les variables :`r`n$($array_hex_strings_to_find[$i]) et`r`n$($array_hex_strings_to_replace[$i])"
			Write-Host "doivent avoir au moins 12 caractères hexadécimaux pour représenter"
			Write-Host "au moins 6 octets. Or ici, elles n'en contiennent que $($array_hex_strings_to_find[$i].Length)."
			Write-Host "`r`nAppuyez sur une touche pour continuer..."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			else
			{
				$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
			}
			exit 0
		}
	}

	Out-File -FilePath "$file_fullname.temporary" -Force -Encoding ASCII		# (Force = Écraser si existe déjà) (Encoding ASCII = Utiliser ASCII au lieu d'Unicode UTF16LE donc pas de Byte Order Mark FFFE)
	if ((Test-Path "$file_fullname.temporary") -eq $false)
	{
		Write-Host "Erreur, le fichier :`r`n$file_fullname.temporary"
		Write-Host "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		if ($Host.UI.RawUI.KeyAvailable -eq $true)
		{
			while ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
			}
		}
		else
		{
			$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		}
		exit 0
        }

	# Pour aller plus vite, on crée 5 tableaux en 2 dimensions.
	# Nous sommes obligés de créer chaque dimension indépendamment car
	# il est impossible de redimensionner dynamiquement les 2 dimensions.
	# Concernant la 1ère dimension :
	# Le 1er tableau contiendra les premiers octets de toutes les chaînes
	# à rechercher, convertis en décimal et en éliminant les doublons.
	# Le 2ème tableau contiendra les deuxièmes octets, etc.
	# Le 3ème tableau contiendra les troisièmes octets, etc.
	$array_bytes_to_find_1 = @()
	$array_bytes_to_find_2 = @()
	$array_bytes_to_find_3 = @()
	$array_bytes_to_find_4 = @()
	$array_bytes_to_find_5 = @()
	for ($i_1 = 0; $i_1 -le $array_hex_strings_to_find.GetUpperBound(0); $i_1++)
	{
		$b_already_exists = $false
		for ($i_2 = 0; $i_2 -le $array_bytes_to_find_1.GetUpperBound(0); $i_2++)
		{
			if ([Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(0, 2), 16) -eq $array_bytes_to_find_1[$i_2])
			{
				$b_already_exists = $true
			}
		}
		if ($b_already_exists -eq $false)
		{
			$array_bytes_to_find_1 += [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(0, 2), 16)
		}
		$b_already_exists = $false
		for ($i_2 = 0; $i_2 -le $array_bytes_to_find_2.GetUpperBound(0); $i_2++)
		{
			if ([Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(2, 2), 16) -eq $array_bytes_to_find_2[$i_2])
			{
				$b_already_exists = $true
			}
		}
		if ($b_already_exists -eq $false)
		{
			$array_bytes_to_find_2 += [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(2, 2), 16)
		}
		$b_already_exists = $false
		for ($i_2 = 0; $i_2 -le $array_bytes_to_find_3.GetUpperBound(0); $i_2++)
		{
			if ([Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(4, 2), 16) -eq $array_bytes_to_find_3[$i_2])
			{
				$b_already_exists = $true
			}
		}
		if ($b_already_exists -eq $false)
		{
			$array_bytes_to_find_3 += [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(4, 2), 16)
		}
		$b_already_exists = $false
		for ($i_2 = 0; $i_2 -le $array_bytes_to_find_4.GetUpperBound(0); $i_2++)
		{
			if ([Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(6, 2), 16) -eq $array_bytes_to_find_4[$i_2])
			{
				$b_already_exists = $true
			}
		}
		if ($b_already_exists -eq $false)
		{
			$array_bytes_to_find_4 += [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(6, 2), 16)
		}
		$b_already_exists = $false
		for ($i_2 = 0; $i_2 -le $array_bytes_to_find_5.GetUpperBound(0); $i_2++)
		{
			if ([Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(8, 2), 16) -eq $array_bytes_to_find_5[$i_2])
			{
				$b_already_exists = $true
			}
		}
		if ($b_already_exists -eq $false)
		{
			$array_bytes_to_find_5 += [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(8, 2), 16)
		}
	}
	# Concernant la 2ème dimension :
	# Pour chaque tableau, elle contiendra les numéros des chaînes
	# auxquelles les octets correspondent (en commençant par 0).
	# Imaginons que la 1ère case du 1er tableau contient l'octet C2 = 194
	# et que plusieurs chaînes commencent par C2 (doublons), par exemple
	# les chaînes 1 2 4 5 6, alors les chiffres 0 1 3 4 5 seront inscrits
	# dans la 2ème dimension de la 1ère case du 1er tableau.
	$array_bytes_to_find_1_2D = New-Object 'object[,]' ($array_bytes_to_find_1.GetUpperBound(0) + 1), 1
	$array_bytes_to_find_2_2D = New-Object 'object[,]' ($array_bytes_to_find_2.GetUpperBound(0) + 1), 1
	$array_bytes_to_find_3_2D = New-Object 'object[,]' ($array_bytes_to_find_3.GetUpperBound(0) + 1), 1
	$array_bytes_to_find_4_2D = New-Object 'object[,]' ($array_bytes_to_find_4.GetUpperBound(0) + 1), 1
	$array_bytes_to_find_5_2D = New-Object 'object[,]' ($array_bytes_to_find_5.GetUpperBound(0) + 1), 1
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_1_2D.GetUpperBound(0); $i_1++)
	{
		$array_bytes_to_find_1_2D[$i_1, 0] = $array_bytes_to_find_1[$i_1]
		$i_2 = 1
		for ($i_3 = 0; $i_3 -le $array_hex_strings_to_find.GetUpperBound(0); $i_3++)
		{
			if ([int]::Parse($array_hex_strings_to_find[$i_3].Substring(0, 2), [System.Globalization.NumberStyles]::HexNumber) -eq $array_bytes_to_find_1_2D[$i_1, 0])
			{
				if ($array_bytes_to_find_1_2D.GetUpperBound(1) -lt $i_2)
				{
					# En PowerShell il n'existe pas d'équivalent à la commande
					# ReDim Preserve array_bytes_to_find_1_2D(ubound,ubound+1)
					# du VBScript pour redimensionner la 2ème dimension du tableau.
					# La notation "+=" ajoute un élément à la fin d'un tableau,
					# mais seulement s'il est en 1 dimension, pas en 2 dimensions.
					# Il faut donc créer un autre tableau $array_subarray_2D
					# avec une case supplémentaire puis recopier le tableau dedans
					# en utilisant une boucle for.
					$array_subarray_2D = New-Object 'object[,]' ($array_bytes_to_find_1_2D.GetUpperBound(0) + 1), ($array_bytes_to_find_1_2D.GetUpperBound(1) + 2)
					for ($i = 0; $i -le $array_bytes_to_find_1_2D.GetUpperBound(0); $i++)
					{
						for ($j = 0; $j -le $array_bytes_to_find_1_2D.GetUpperBound(1); $j++)
						{
							$array_subarray_2D[$i, $j] = $array_bytes_to_find_1_2D[$i, $j]
						}
					}
					$array_bytes_to_find_1_2D = $array_subarray_2D
					Remove-Variable -Name array_subarray_2D
				}
				$array_bytes_to_find_1_2D[$i_1, $i_2] = $i_3
				$i_2++
			}
		}
	}
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_2_2D.GetUpperBound(0); $i_1++)
	{
		$array_bytes_to_find_2_2D[$i_1, 0] = $array_bytes_to_find_2[$i_1]
		$i_2 = 1
		for ($i_3 = 0; $i_3 -le $array_hex_strings_to_find.GetUpperBound(0); $i_3++)
		{
			if ([int]::Parse($array_hex_strings_to_find[$i_3].Substring(2, 2), [System.Globalization.NumberStyles]::HexNumber) -eq $array_bytes_to_find_2_2D[$i_1, 0])
			{
				if ($array_bytes_to_find_2_2D.GetUpperBound(1) -lt $i_2)
				{
					$array_subarray_2D = New-Object 'object[,]' ($array_bytes_to_find_2_2D.GetUpperBound(0) + 1), ($array_bytes_to_find_2_2D.GetUpperBound(1) + 2)
					for ($i = 0; $i -le $array_bytes_to_find_2_2D.GetUpperBound(0); $i++)
					{
						for ($j = 0; $j -le $array_bytes_to_find_2_2D.GetUpperBound(1); $j++)
						{
							$array_subarray_2D[$i, $j] = $array_bytes_to_find_2_2D[$i, $j]
						}
					}
					$array_bytes_to_find_2_2D = $array_subarray_2D
					Remove-Variable -Name array_subarray_2D
				}
				$array_bytes_to_find_2_2D[$i_1, $i_2] = $i_3
				$i_2++
			}
		}
	}
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_3_2D.GetUpperBound(0); $i_1++)
	{
		$array_bytes_to_find_3_2D[$i_1, 0] = $array_bytes_to_find_3[$i_1]
		$i_2 = 1
		for ($i_3 = 0; $i_3 -le $array_hex_strings_to_find.GetUpperBound(0); $i_3++)
		{
			if ([int]::Parse($array_hex_strings_to_find[$i_3].Substring(4, 2), [System.Globalization.NumberStyles]::HexNumber) -eq $array_bytes_to_find_3_2D[$i_1, 0])
			{
				if ($array_bytes_to_find_3_2D.GetUpperBound(1) -lt $i_2)
				{
					$array_subarray_2D = New-Object 'object[,]' ($array_bytes_to_find_3_2D.GetUpperBound(0) + 1), ($array_bytes_to_find_3_2D.GetUpperBound(1) + 2)
					for ($i = 0; $i -le $array_bytes_to_find_3_2D.GetUpperBound(0); $i++)
					{
						for ($j = 0; $j -le $array_bytes_to_find_3_2D.GetUpperBound(1); $j++)
						{
							$array_subarray_2D[$i, $j] = $array_bytes_to_find_3_2D[$i, $j]
						}
					}
					$array_bytes_to_find_3_2D = $array_subarray_2D
					Remove-Variable -Name array_subarray_2D
				}
				$array_bytes_to_find_3_2D[$i_1, $i_2] = $i_3
				$i_2++
			}
		}
	}
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_4_2D.GetUpperBound(0); $i_1++)
	{
		$array_bytes_to_find_4_2D[$i_1, 0] = $array_bytes_to_find_4[$i_1]
		$i_2 = 1
		for ($i_3 = 0; $i_3 -le $array_hex_strings_to_find.GetUpperBound(0); $i_3++)
		{
			if ([int]::Parse($array_hex_strings_to_find[$i_3].Substring(6, 2), [System.Globalization.NumberStyles]::HexNumber) -eq $array_bytes_to_find_4_2D[$i_1, 0])
			{
				if ($array_bytes_to_find_4_2D.GetUpperBound(1) -lt $i_2)
				{
					$array_subarray_2D = New-Object 'object[,]' ($array_bytes_to_find_4_2D.GetUpperBound(0) + 1), ($array_bytes_to_find_4_2D.GetUpperBound(1) + 2)
					for ($i = 0; $i -le $array_bytes_to_find_4_2D.GetUpperBound(0); $i++)
					{
						for ($j = 0; $j -le $array_bytes_to_find_4_2D.GetUpperBound(1); $j++)
						{
							$array_subarray_2D[$i, $j] = $array_bytes_to_find_4_2D[$i, $j]
						}
					}
					$array_bytes_to_find_4_2D = $array_subarray_2D
					Remove-Variable -Name array_subarray_2D
				}
				$array_bytes_to_find_4_2D[$i_1, $i_2] = $i_3
				$i_2++
			}
		}
	}
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_5_2D.GetUpperBound(0); $i_1++)
	{
		$array_bytes_to_find_5_2D[$i_1, 0] = $array_bytes_to_find_5[$i_1]
		$i_2 = 1
		for ($i_3 = 0; $i_3 -le $array_hex_strings_to_find.GetUpperBound(0); $i_3++)
		{
			if ([int]::Parse($array_hex_strings_to_find[$i_3].Substring(8, 2), [System.Globalization.NumberStyles]::HexNumber) -eq $array_bytes_to_find_5_2D[$i_1, 0])
			{
				if ($array_bytes_to_find_5_2D.GetUpperBound(1) -lt $i_2)
				{
					$array_subarray_2D = New-Object 'object[,]' ($array_bytes_to_find_5_2D.GetUpperBound(0) + 1), ($array_bytes_to_find_5_2D.GetUpperBound(1) + 2)
					for ($i = 0; $i -le $array_bytes_to_find_5_2D.GetUpperBound(0); $i++)
					{
						for ($j = 0; $j -le $array_bytes_to_find_5_2D.GetUpperBound(1); $j++)
						{
							$array_subarray_2D[$i, $j] = $array_bytes_to_find_5_2D[$i, $j]
						}
					}
					$array_bytes_to_find_5_2D = $array_subarray_2D
					Remove-Variable -Name array_subarray_2D
				}
				$array_bytes_to_find_5_2D[$i_1, $i_2] = $i_3
				$i_2++
			}
		}
	}
	<#
	Write-Host "1ers  octets à rechercher => Dans les chaînes : "
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_1_2D.GetUpperBound(0); $i_1++)
	{
		Write-Host -NoNewline "$($array_bytes_to_find_1_2D[$i_1, 0])	=> "
		for ($i_2 = 1; $i_2 -le ($array_bytes_to_find_1_2D.GetUpperBound(1)); $i_2++)
		{
			Write-Host -NoNewline "$($array_bytes_to_find_1_2D[$i_1, $i_2])"
			if ($i_2 + 1 -le $array_bytes_to_find_1_2D.GetUpperBound(1))
			{
				if ($array_bytes_to_find_1_2D[$i_1, $($i_2 + 1)] -ne $null)
				{
					Write-Host -NoNewline " "
				}
			}
		}
		Write-Host
	}
	Write-Host "2èmes octets à rechercher => Dans les chaînes : "
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_2_2D.GetUpperBound(0); $i_1++)
	{
		Write-Host -NoNewline "$($array_bytes_to_find_2_2D[$i_1, 0])	=> "
		for ($i_2 = 1; $i_2 -le ($array_bytes_to_find_2_2D.GetUpperBound(1)); $i_2++)
		{
			Write-Host -NoNewline "$($array_bytes_to_find_2_2D[$i_1, $i_2])"
			if ($i_2 + 1 -le $array_bytes_to_find_2_2D.GetUpperBound(1))
			{
				if ($array_bytes_to_find_2_2D[$i_1, $($i_2 + 1)] -ne $null)
				{
					Write-Host -NoNewline " "
				}
			}
		}
		Write-Host
	}
	Write-Host "3èmes octets à rechercher => Dans les chaînes : "
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_3_2D.GetUpperBound(0); $i_1++)
	{
		Write-Host -NoNewline "$($array_bytes_to_find_3_2D[$i_1, 0])	=> "
		for ($i_2 = 1; $i_2 -le ($array_bytes_to_find_3_2D.GetUpperBound(1)); $i_2++)
		{
			Write-Host -NoNewline "$($array_bytes_to_find_3_2D[$i_1, $i_2])"
			if ($i_2 + 1 -le $array_bytes_to_find_3_2D.GetUpperBound(1))
			{
				if ($array_bytes_to_find_3_2D[$i_1, $($i_2 + 1)] -ne $null)
				{
					Write-Host -NoNewline " "
				}
			}
		}
		Write-Host
	}
	Write-Host "4èmes octets à rechercher => Dans les chaînes : "
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_4_2D.GetUpperBound(0); $i_1++)
	{
		Write-Host -NoNewline "$($array_bytes_to_find_4_2D[$i_1, 0])	=> "
		for ($i_2 = 1; $i_2 -le ($array_bytes_to_find_4_2D.GetUpperBound(1)); $i_2++)
		{
			Write-Host -NoNewline "$($array_bytes_to_find_4_2D[$i_1, $i_2])"
			if ($i_2 + 1 -le $array_bytes_to_find_4_2D.GetUpperBound(1))
			{
				if ($array_bytes_to_find_4_2D[$i_1, $($i_2 + 1)] -ne $null)
				{
					Write-Host -NoNewline " "
				}
			}
		}
		Write-Host
	}
	Write-Host "5èmes octets à rechercher => Dans les chaînes : "
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_5_2D.GetUpperBound(0); $i_1++)
	{
		Write-Host -NoNewline "$($array_bytes_to_find_5_2D[$i_1, 0])	=> "
		for ($i_2 = 1; $i_2 -le ($array_bytes_to_find_5_2D.GetUpperBound(1)); $i_2++)
		{
			Write-Host -NoNewline "$($array_bytes_to_find_5_2D[$i_1, $i_2])"
			if ($i_2 + 1 -le $array_bytes_to_find_5_2D.GetUpperBound(1))
			{
				if ($array_bytes_to_find_5_2D[$i_1, $($i_2 + 1)] -ne $null)
				{
					Write-Host -NoNewline " "
				}
			}
		}
		Write-Host
	}
	Write-Host "`r`nAppuyez sur une touche pour continuer..."
	if ($Host.UI.RawUI.KeyAvailable -eq $true)
	{
		while ($Host.UI.RawUI.KeyAvailable -eq $true)
		{
			$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
		}
	}
	else
	{
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
	}
	Write-Host
	#>

	Write-Host -NoNewline "`r`nAnalyse en cours... "

	$file_input  = [System.IO.File]::OpenRead($file_fullname)		# Ouverture du fichier en lecture
	$file_output = [System.IO.File]::Create("$file_fullname.temporary")	# Ouverture du fichier en écriture

	$array_bytes_to_find_1_2D_ubound = $array_bytes_to_find_1_2D.GetUpperBound(0)
	$array_bytes_to_find_2_2D_ubound = $array_bytes_to_find_2_2D.GetUpperBound(0)
	$array_bytes_to_find_3_2D_ubound = $array_bytes_to_find_3_2D.GetUpperBound(0)
	$array_bytes_to_find_4_2D_ubound = $array_bytes_to_find_4_2D.GetUpperBound(0)
	$array_bytes_to_find_5_2D_ubound = $array_bytes_to_find_5_2D.GetUpperBound(0)
	$array_byte_buffer_1 = @()
	$array_byte_buffer_2 = @()
	$array_match_found_1 = @()
	$array_match_found_2 = @()
	$byte_buffer_read    = New-Object byte[] 1
	$byte_read           = 0
	$i_byte_check        = 0
	$i_replacement_count = 0
	while ($file_input.Read($byte_buffer_read, 0, 1) -ne 0)
	{
		$byte_read = $byte_buffer_read[0]
		# Write-Host "Caractère lu (hexadécimal $($byte_read.ToString("X2")) = décimal $byte_read) : ""$([char]$byte_read)"""

		# L'octet lu est stocké dans la dernière case d'un tableau (buffer).
		$array_byte_buffer_1 += $byte_read
		# Write-Host "Contenu du buffer : $($array_byte_buffer_1 -join " ")"

		switch ($i_byte_check)
		{
			0
			{
				# On considère que le buffer peut contenir plusieurs octets en attente d'être traités,
				# c'est-à-dire écrits dans le fichier de sortie s'il n'existe aucune correspondance.
				# Chaque 1er octet traité disparaît du buffer, dont la taille se réduit.
				# Lorsque sa taille atteint 0 (GetUpperBound = -1), le buffer est vide,
				# tous les octets ont été traités.
				$b_exit_while_1 = $flase
				while ($array_byte_buffer_1.GetUpperBound(0) -ge 0 -and $b_exit_while_1 -eq $flase)
				{
					# Première boucle de vérification.
					# On compare le 1er octet ($i_byte_check = 0) du buffer
					# aux octets stockés dans les cases de la 1ère dimension du 1er tableau.
					$i_0 = 0
					while ($i_0 -le $array_bytes_to_find_1_2D_ubound -and $b_exit_while_1 -eq $flase)
					{
						# Si il correspond à une case,
						# l'écriture du fichier de sortie est suspendue ($i_byte_check ≠ 0)
						# et l'octet reste stocké dans le buffer.
						if ($array_byte_buffer_1[$i_byte_check] -eq $array_bytes_to_find_1_2D[$i_0, 0])
						{
							# Write-Host "Étape $i_byte_check - Correspondance trouvée : $($array_byte_buffer_1[$i_byte_check]) = $($array_bytes_to_find_1_2D[$i_0, 0])"
							$b_exit_while_1 = $true
							$i_byte_check++		# $i_byte_check = 1
							$i_0--
						}
						$i_0++
					}
					# Si il ne correspond pas, l'octet est traité,
					# c'est-à-dire écrit dans le fichier de sortie puis retiré du buffer.
					if ($b_exit_while_1 -eq $flase)
					{
						$file_output.WriteByte($array_byte_buffer_1[$i_byte_check])
						# Si le buffer contient plusieurs cases,
						# on les décale vers l'arrière et on le raccourcit d'une case.
						if ($array_byte_buffer_1.GetUpperBound(0) -ge 1)
						{
							$array_byte_buffer_2 = @()
							$array_byte_buffer_2 = $array_byte_buffer_1[1..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
							$array_byte_buffer_1 = $array_byte_buffer_2
						}
						else
						{
							$array_byte_buffer_1 = @()
						}
					}
				}
				break
			}
			1
			{
				# Deuxième boucle de vérification.
				# On compare le 2ème octet ($i_byte_check = 1) du buffer
				# aux octets stockés dans les cases de la 1ère dimension du 2ème tableau.
				$b_exit_while_1 = $flase
				$i_1 = 0
				while ($i_1 -le $array_bytes_to_find_2_2D_ubound -and $b_exit_while_1 -eq $flase)
				{
					# Si il correspond à une case,
					# on compare la 2ème dimension de la case du 1er tableau précédent
					# à la 2ème dimension de cette case de ce 2ème tableau et
					# on stocke les numéros communs dans un tableau : $array_match_found_1.
					if ($array_byte_buffer_1[$i_byte_check] -eq $array_bytes_to_find_2_2D[$i_1, 0])
					{
						$b_exit_while_1 = $true
						$array_match_found_1 = @()
						$i_0_2D = 1
						$b_exit_while_2 = $false
						while ($i_0_2D -le $array_bytes_to_find_1_2D.GetUpperBound(1) -and $b_exit_while_2 -eq $false)
						{
							if ($array_bytes_to_find_1_2D[$i_0, $i_0_2D] -ne $null)
							{
								$i_1_2D = 1
								$b_exit_while_3 = $false
								while ($i_1_2D -le $array_bytes_to_find_2_2D.GetUpperBound(1) -and $b_exit_while_3 -eq $false)
								{
									if ($array_bytes_to_find_2_2D[$i_1, $i_1_2D] -ne $null)
									{
										if ($array_bytes_to_find_1_2D[$i_0, $i_0_2D] -eq $array_bytes_to_find_2_2D[$i_1, $i_1_2D])
										{
											$array_match_found_1 += $array_bytes_to_find_1_2D[$i_0, $i_0_2D]
										}
										$i_1_2D++
									}
									else
									{
										$b_exit_while_3 = $true
									}
								}
								$i_0_2D++
							}
							else
							{
								$b_exit_while_2 = $true
							}
						}
						# Si le tableau n'est pas vide, il indique le ou les numéros
						# des chaînes qui commencent par ces 2 octets. Dans ce cas :
						# l'écriture du fichier de sortie reste suspendue ($i_byte_check ≠ 0)
						# et les octets restent stockés dans le buffer.
						if ($array_match_found_1.GetUpperBound(0) -ge 0)
						{
							# Write-Host "Étape $i_byte_check - Correspondance trouvée : $($array_byte_buffer_1[$i_byte_check]) = $($array_bytes_to_find_2_2D[$i_1, 0])"
							# Write-Host "Les octets du buffer ""$($array_byte_buffer_1 -join " ")"" doivent commencer la/les chaîne(s) ""$($array_match_found_1 -join " ")"""
							$i_byte_check++		# $i_byte_check = 2
						}
						# Si le tableau est vide, les 2 octets ne correspondent
						# à aucune chaîne à rechercher. C'est la même situation que
						# si le 2ème octet ne correspond à aucune case du 2ème tableau.
					}
					$i_1++
				}
				# Si il ne correspond pas, le premier octet est traité,
				# c'est-à-dire écrit dans le fichier de sortie puis retiré du buffer.
				# De plus $i_byte_check est réinitialisée donc on retourne
				# à la première boucle de vérification pour vider le buffer.
				if ($b_exit_while_1 -eq $flase -or $array_match_found_1.GetUpperBound(0) -lt 0)
				{
					$i_byte_check = 0
					$file_output.WriteByte($array_byte_buffer_1[$i_byte_check])
					# Si le buffer contient plusieurs cases,
					# on les décale vers l'arrière et on le raccourcit d'une case.
					if ($array_byte_buffer_1.GetUpperBound(0) -ge 1)
					{
						$array_byte_buffer_2 = @()
						$array_byte_buffer_2 = $array_byte_buffer_1[1..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
						$array_byte_buffer_1 = $array_byte_buffer_2
					}
					else
					{
						$array_byte_buffer_1 = @()
					}
				}
				break
			}
			2
			{
				# Troisième boucle de vérification.
				# On compare le 3ème octet ($i_byte_check = 2) du buffer
				# aux octets stockés dans les cases de la 1ère dimension du 3ème tableau.
				$b_exit_while_1 = $flase
				$i_2 = 0
				while ($i_2 -le $array_bytes_to_find_3_2D_ubound -and $b_exit_while_1 -eq $flase)
				{
					# Si il correspond à une case,
					# on compare le tableau précédent $array_match_found_1
					# à la 2ème dimension de cette case de ce 3ème tableau et
					# on stocke les numéros communs dans $array_match_found_1
					# par l'intermédiaire d'un tableau temporaire : $array_match_found_2.
					if ($array_byte_buffer_1[$i_byte_check] -eq $array_bytes_to_find_3_2D[$i_2, 0])
					{
						$b_exit_while_1 = $true
						$array_match_found_2 = @()
						$i_1_2D = 0
						$b_exit_while_2 = $false
						while ($i_1_2D -le $array_match_found_1.GetUpperBound(0) -and $b_exit_while_2 -eq $false)
						{
							if ($array_match_found_1[$i_1_2D] -ne $null)
							{
								$i_2_2D = 1
								$b_exit_while_3 = $false
								while ($i_2_2D -le $array_bytes_to_find_3_2D.GetUpperBound(1) -and $b_exit_while_3 -eq $false)
								{
									if ($array_bytes_to_find_3_2D[$i_2, $i_2_2D] -ne $null)
									{
										if ($array_match_found_1[$i_1_2D] -eq $array_bytes_to_find_3_2D[$i_2, $i_2_2D])
										{
											$array_match_found_2 += $array_match_found_1[$i_1_2D]
										}
										$i_2_2D++
									}
									else
									{
										$b_exit_while_3 = $true
									}
								}
								$i_1_2D++
							}
							else
							{
								$b_exit_while_2 = $true
							}
						}
						$array_match_found_1 = $array_match_found_2
						# Si le tableau n'est pas vide, il indique le ou les numéros
						# des chaînes qui commencent par ces 3 octets. Dans ce cas :
						# l'écriture du fichier de sortie reste suspendue ($i_byte_check ≠ 0)
						# et les octets restent stockés dans le buffer.
						if ($array_match_found_1.GetUpperBound(0) -ge 0)
						{
							Write-Host -NoNewline "*"
							# Write-Host "Étape $i_byte_check - Correspondance trouvée : $($array_byte_buffer_1[$i_byte_check]) = $($array_bytes_to_find_3_2D[$i_2, 0])"
							# Write-Host "Les octets du buffer ""$($array_byte_buffer_1 -join " ")"" doivent commencer la/les chaîne(s) ""$($array_match_found_1 -join " ")"""
							$i_byte_check++		# $i_byte_check = 3
						}
						# Si le tableau est vide, les 3 octets ne correspondent
						# à aucune chaîne à rechercher. C'est la même situation que
						# si le 3ème octet ne correspond à aucune case du 3ème tableau.
					}
					$i_2++
				}
				# Si il ne correspond pas, le premier octet est traité,
				# c'est-à-dire écrit dans le fichier de sortie puis retiré du buffer.
				# De plus $i_byte_check est réinitialisée donc on retourne
				# à la première boucle de vérification pour vider le buffer.
				if ($b_exit_while_1 -eq $flase -or $array_match_found_1.GetUpperBound(0) -lt 0)
				{
					$i_byte_check = 0
					$file_output.WriteByte($array_byte_buffer_1[$i_byte_check])
					# Si le buffer contient plusieurs cases,
					# on les décale vers l'arrière et on le raccourcit d'une case.
					if ($array_byte_buffer_1.GetUpperBound(0) -ge 1)
					{
						$array_byte_buffer_2 = @()
						$array_byte_buffer_2 = $array_byte_buffer_1[1..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
						$array_byte_buffer_1 = $array_byte_buffer_2
					}
					else
					{
						$array_byte_buffer_1 = @()
					}
				}
				break
			}
			3
			{
				$b_exit_while_1 = $flase
				$i_3 = 0
				while ($i_3 -le $array_bytes_to_find_4_2D_ubound -and $b_exit_while_1 -eq $flase)
				{
					if ($array_byte_buffer_1[$i_byte_check] -eq $array_bytes_to_find_4_2D[$i_3, 0])
					{
						$b_exit_while_1 = $true
						$array_match_found_2 = @()
						$i_2_2D = 0
						$b_exit_while_2 = $false
						while ($i_2_2D -le $array_match_found_1.GetUpperBound(0) -and $b_exit_while_2 -eq $false)
						{
							if ($array_match_found_1[$i_2_2D] -ne $null)
							{
								$i_3_2D = 1
								$b_exit_while_3 = $false
								while ($i_3_2D -le $array_bytes_to_find_4_2D.GetUpperBound(1) -and $b_exit_while_3 -eq $false)
								{
									if ($array_bytes_to_find_4_2D[$i_3, $i_3_2D] -ne $null)
									{
										if ($array_match_found_1[$i_2_2D] -eq $array_bytes_to_find_4_2D[$i_3, $i_3_2D])
										{
											$array_match_found_2 += $array_match_found_1[$i_2_2D]
										}
										$i_3_2D++
									}
									else
									{
										$b_exit_while_3 = $true
									}
								}
								$i_2_2D++
							}
							else
							{
								$b_exit_while_2 = $true
							}
						}
						$array_match_found_1 = $array_match_found_2
						if ($array_match_found_1.GetUpperBound(0) -ge 0)
						{
							Write-Host -NoNewline "*"
							# Write-Host "Étape $i_byte_check - Correspondance trouvée : $($array_byte_buffer_1[$i_byte_check]) = $($array_bytes_to_find_4_2D[$i_3, 0])"
							# Write-Host "Les octets du buffer ""$($array_byte_buffer_1 -join " ")"" doivent commencer la/les chaîne(s) ""$($array_match_found_1 -join " ")"""
							$i_byte_check++		# $i_byte_check = 4
						}
					}
					$i_3++
				}
				if ($b_exit_while_1 -eq $flase -or $array_match_found_1.GetUpperBound(0) -lt 0)
				{
					$i_byte_check = 0
					$file_output.WriteByte($array_byte_buffer_1[$i_byte_check])
					if ($array_byte_buffer_1.GetUpperBound(0) -ge 1)
					{
						$array_byte_buffer_2 = @()
						$array_byte_buffer_2 = $array_byte_buffer_1[1..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
						$array_byte_buffer_1 = $array_byte_buffer_2
					}
					else
					{
						$array_byte_buffer_1 = @()
					}
				}
				break
			}
			4
			{
				$b_exit_while_1 = $flase
				$i_4 = 0
				while ($i_4 -le $array_bytes_to_find_5_2D_ubound -and $b_exit_while_1 -eq $flase)
				{
					if ($array_byte_buffer_1[$i_byte_check] -eq $array_bytes_to_find_5_2D[$i_4, 0])
					{
						$b_exit_while_1 = $true
						$array_match_found_2 = @()
						$i_3_2D = 0
						$b_exit_while_2 = $false
						while ($i_3_2D -le $array_match_found_1.GetUpperBound(0) -and $b_exit_while_2 -eq $false)
						{
							if ($array_match_found_1[$i_3_2D] -ne $null)
							{
								$i_4_2D = 1
								$b_exit_while_3 = $false
								while ($i_4_2D -le $array_bytes_to_find_5_2D.GetUpperBound(1) -and $b_exit_while_3 -eq $false)
								{
									if ($array_bytes_to_find_5_2D[$i_4, $i_4_2D] -ne $null)
									{
										if ($array_match_found_1[$i_3_2D] -eq $array_bytes_to_find_5_2D[$i_4, $i_4_2D])
										{
											$array_match_found_2 += $array_match_found_1[$i_3_2D]
										}
										$i_4_2D++
									}
									else
									{
										$b_exit_while_3 = $true
									}
								}
								$i_3_2D++
							}
							else
							{
								$b_exit_while_2 = $true
							}
						}
						$array_match_found_1 = $array_match_found_2
						if ($array_match_found_1.GetUpperBound(0) -ge 0)
						{
							Write-Host -NoNewline "*"
							# Write-Host "Étape $i_byte_check - Correspondance trouvée : $($array_byte_buffer_1[$i_byte_check]) = $($array_bytes_to_find_5_2D[$i_4, 0])"
							# Write-Host "Les octets du buffer ""$($array_byte_buffer_1 -join " ")"" doivent commencer la/les chaîne(s) ""$($array_match_found_1 -join " ")"""
							$i_byte_check++		# $i_byte_check = 5
						}
					}
					$i_4++
				}
				if ($b_exit_while_1 -eq $flase -or $array_match_found_1.GetUpperBound(0) -lt 0)
				{
					$i_byte_check = 0
					$file_output.WriteByte($array_byte_buffer_1[$i_byte_check])
					if ($array_byte_buffer_1.GetUpperBound(0) -ge 1)
					{
						$array_byte_buffer_2 = @()
						$array_byte_buffer_2 = $array_byte_buffer_1[1..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
						$array_byte_buffer_1 = $array_byte_buffer_2
					}
					else
					{
						$array_byte_buffer_1 = @()
					}
				}
				break
			}
			default
			{
				# On prend le tableau $array_match_found_1, il contient le
				# (ou les) numéro de case du tableau $array_hex_strings_to_find
				# qui lui-même contient la chaîne complète des octets à analyser
				# dont les 5 premiers octets correspondent.
				# Remarque : il se peut que plusieurs chaînes aient leurs 5 premiers
				# octets en commun. Voire que seul le dernier octet soit différent.
				# Donc on analyse chaque case du tableau $array_match_found_1.
				$b_exit_while_1 = $flase
				$i_5 = 0				# (Inutile car i_5 reste à 0)
				while ($i_5 -le $array_match_found_1.GetUpperBound(0) -and $b_exit_while_1 -eq $flase)
				{
					# On analyse la chaîne contenue dans $array_hex_strings_to_find.
					# Si la chaîne continue à correspondre, on teste l'octet suivant.
					if ($array_byte_buffer_1[$i_byte_check].ToString("X2") -eq $array_hex_strings_to_find[$array_match_found_1[$i_5]].Substring(2 * $i_byte_check, 2))
					{
						Write-Host -NoNewline "*"
						# Write-Host "Étape $i_byte_check - Correspondance trouvée : $($array_byte_buffer_1[$i_byte_check]) = $($array_hex_strings_to_find[$array_match_found_1[$i_5]].Substring(2 * $i_byte_check, 2))"
						$b_exit_while_1 = $true
						$i_byte_check++

					}
					# Si la chaîne ne correspond plus, alors on retire son numéro du tableau $array_match_found_1.
					# Et si le tableau est vide, alors aucune chaîne ne correspondait,
					# donc le premier octet est traité et $i_byte_check est réinitialisée.
					else
					{
						if ($array_match_found_1.GetUpperBound(0) -ge 1)
						{
							$array_match_found_2 = @()
							$array_match_found_2 = $array_match_found_1[1..($($array_match_found_1.GetUpperBound(0) + 1) - 1)]
							$array_match_found_1 = $array_match_found_2
						}
						else
						{
							$array_match_found_1 = @()
							$i_byte_check = 0
							$file_output.WriteByte($array_byte_buffer_1[$i_byte_check])
							if ($array_byte_buffer_1.GetUpperBound(0) -ge 1)
							{
								$array_byte_buffer_2 = @()
								$array_byte_buffer_2 = $array_byte_buffer_1[1..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
								$array_byte_buffer_1 = $array_byte_buffer_2
							}
							else
							{
								$array_byte_buffer_1 = @()
							}
						}
					}
					if ($i_byte_check -gt 0)
					{
						# Si la correspondance va jusqu'au bout de la chaîne, alors la chaîne a été détectée.
						if ($i_byte_check -eq $array_hex_strings_to_find[$array_match_found_1[$i_5]].Length / 2)
						{
							# Dans ce cas on écrit la nouvelle chaîne et on vide le buffer.
							for ($i = 0; $i -le $array_hex_strings_to_replace[$array_match_found_1[$i_5]].Length - 1; $i += 2)
							{
								$file_output.WriteByte([byte]::Parse($array_hex_strings_to_replace[$array_match_found_1[$i_5]].Substring($i, 2), [System.Globalization.NumberStyles]::HexNumber))
							}
							# Write-Host `r`n"Contenu de la chaîne n°$($array_match_found_1[$i_5] + 1) ($($array_hex_strings_to_find[$array_match_found_1[$i_5]].Length / 2) cases) : $($array_hex_strings_to_find[$array_match_found_1[$i_5]])`r`nContenu du buffer ($($array_byte_buffer_1.GetUpperBound(0) + 1) cases) : $($array_byte_buffer_1 -join " ")"
							# On vide le buffer de la chaîne à rechercher.
							if ($array_byte_buffer_1.GetUpperBound(0) -ge $array_hex_strings_to_find[$array_match_found_1[$i_5]].Length / 2)
							{
								$array_byte_buffer_2 = @()
								$array_byte_buffer_2 = $array_byte_buffer_1[($array_hex_strings_to_find[$array_match_found_1[$i_5]].Length / 2)..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
								$array_byte_buffer_1 = $array_byte_buffer_2
								# Write-Host "Contenu restant du buffer = : $($array_byte_buffer_1 -join " ")"
							}
							else
							{
								$array_byte_buffer_1 = @()
							}
							$i_byte_check = 0
							$i_replacement_count++
							Write-Host "`r`nFichier :`r`n$file_fullname`r`nSéquence n°$($array_match_found_1[$i_5] + 1) trouvée :`r`n$($array_hex_strings_to_find[$array_match_found_1[$i_5]])`r`nRemplacée par :`r`n$($array_hex_strings_to_replace[$array_match_found_1[$i_5]])`r`n"
							Write-Host -NoNewline "`r`nAnalyse en cours... "
						}
					}
				}
			}
		}
	}

        $file_input.Close()
        $file_output.Close()
        $file_input.Dispose()
        $file_output.Dispose()
	return $i_replacement_count
}

function i_my_rename_file([string]$file_fullname, [string]$file_fullname_new)
{
	if ((Test-Path $file_fullname) -eq $false)
	{
		Write-Host "Erreur, le fichier :`r`n$file_fullname`r`nn'existe pas, impossible de le renommer en :`r`n$file_fullname_new"
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		if ($Host.UI.RawUI.KeyAvailable -eq $true)
		{
			while ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
			}
		}
		else
		{
			$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		}
		exit 0
	}

        Rename-Item -Path $file_fullname -NewName $file_fullname_new -ErrorAction Stop
	Write-Host "Le fichier :`r`n$file_fullname`r`na été renommé en :`r`n$file_fullname_new`r`n"

	if ((Test-Path $file_fullname_new) -eq $false)
	{
		Write-Host "Erreur, le fichier :`r`n$file_fullname`r`nn'a pas pu être renommé."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		if ($Host.UI.RawUI.KeyAvailable -eq $true)
		{
			while ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
			}
		}
		else
		{
			$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		}
		exit 0
	}

	return 0
}

function i_my_fix_corrupted_file([string[]]$corrupted_file_error_ori, [string[]]$corrupted_file_error_fix, [string]$corrupted_file)
{
	$i_installation_type = 0
	if ($program_folder -ne "")
	{
		if ((Test-Path "$program_folder\$corrupted_file") -eq $false)
		{
			Write-Host "Erreur, fichier non détecté :`r`n$program_folder\$corrupted_file"
			Write-Host "`r`nAppuyez sur une touche pour continuer..."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			else
			{
				$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
			}
			exit 0
		}
		$i_installation_type = 1
		Write-Host "Fichier détecté :`r`n$program_folder\$corrupted_file`r`n"
	}
	if ((Test-Path "$program_folder_portable_32\$corrupted_file") -eq $true)
	{
		$i_installation_type = 2
		Write-Host "Fichier détecté :`r`n$program_folder_portable_32\$corrupted_file`r`n"
	}
	if ((Test-Path "$program_folder_portable_64\$corrupted_file") -eq $true)
	{
		$i_installation_type += 3
		Write-Host "Fichier détecté :`r`n$program_folder_portable_64\$corrupted_file`r`n"
	}
	if ((Test-Path "$program_folder_installed_32\$corrupted_file") -eq $true)
	{
		$i_installation_type = 6
		Write-Host "Fichier détecté :`r`n$program_folder_portable_32\$corrupted_file`r`n"
	}
	if ((Test-Path "$program_folder_installed_64\$corrupted_file") -eq $true)
	{
		$i_installation_type = 7
		Write-Host "Fichier détecté :`r`n$program_folder_portable_64\$corrupted_file`r`n"
	}

	if ($i_installation_type -eq 0)
	{
		Write-Host "Erreur, aucun fichier détecté."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		if ($Host.UI.RawUI.KeyAvailable -eq $true)
		{
			while ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
			}
		}
		else
		{
			$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		}
		exit 0
	}
	if ($i_installation_type -eq 1)
	{
		if ((Test-Path -Path "$program_folder\$corrupted_file.bak" -PathType Leaf) -eq $true)
		{
			Write-Host "Attention, le fichier de sauvegarde :`r`n$program_folder\$corrupted_file.bak"
			Write-Host "existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
			Write-Host "appuyez sur ""o"" pour supprimer le fichier "".bak"" et continuer,`r`nsinon appuyez sur une autre touche pour quitter."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				Write-Host "`r`nAppuyez sur une touche pour continuer..."
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			$user_response = Read-Host "`r`nVoulez-vous continuer ? (o = oui)"
			$user_response = $user_response.ToLower()
			if ($user_response -ne "o")
			{
				exit 0
			}
			Remove-Item -Path "$program_folder\$corrupted_file.bak" -Force
			Write-Host "Le fichier :`r`n$program_folder\$corrupted_file.bak`r`na été supprimé."
		}
		$number_of_replacements = i_my_replace_array_hex_strings_in_file $corrupted_file_error_ori $corrupted_file_error_fix ("$program_folder\$corrupted_file")
		Write-Host "`r`n`r`n$number_of_replacements remplacement(s) effectué(s) sur le fichier :`r`n$program_folder\$corrupted_file`r`n"
		$i_return = i_my_rename_file "$program_folder\$corrupted_file"           "$program_folder\$corrupted_file.bak"
		$i_return = i_my_rename_file "$program_folder\$corrupted_file.temporary" "$program_folder\$corrupted_file"
	}
	if ($i_installation_type -eq 2 -or $i_installation_type -eq 5)
	{
		if ((Test-Path -Path "$program_folder_portable_32\$corrupted_file.bak" -PathType Leaf) -eq $true)
		{
			Write-Host "Attention, le fichier de sauvegarde :`r`n$program_folder_portable_32\$corrupted_file.bak"
			Write-Host "existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
			Write-Host "appuyez sur ""o"" pour supprimer le fichier "".bak"" et continuer,`r`nsinon appuyez sur une autre touche pour quitter."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				Write-Host "`r`nAppuyez sur une touche pour continuer..."
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			$user_response = Read-Host "`r`nVoulez-vous continuer ? (o = oui)"
			$user_response = $user_response.ToLower()
			if ($user_response -ne "o")
			{
				exit 0
			}
			Remove-Item -Path "$program_folder_portable_32\$corrupted_file.bak" -Force
			Write-Host "Le fichier :`r`n$program_folder_portable_32\$corrupted_file.bak`r`na été supprimé."
		}
		$number_of_replacements = i_my_replace_array_hex_strings_in_file $corrupted_file_error_ori $corrupted_file_error_fix ("$program_folder_portable_32\$corrupted_file")
		Write-Host "`r`n`r`n$number_of_replacements remplacement(s) effectué(s) sur le fichier :`r`n$program_folder_portable_32\$corrupted_file`r`n"
		$i_return = i_my_rename_file "$program_folder_portable_32\$corrupted_file"           "$program_folder_portable_32\$corrupted_file.bak"
		$i_return = i_my_rename_file "$program_folder_portable_32\$corrupted_file.temporary" "$program_folder_portable_32\$corrupted_file"
	}
	if ($i_installation_type -eq 3 -or $i_installation_type -eq 5)
	{
		if ((Test-Path -Path "$program_folder_portable_64\$corrupted_file.bak" -PathType Leaf) -eq $true)
		{
			Write-Host "Attention, le fichier de sauvegarde :`r`n$program_folder_portable_64\$corrupted_file.bak"
			Write-Host "existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
			Write-Host "appuyez sur ""o"" pour supprimer le fichier "".bak"" et continuer,`r`nsinon appuyez sur une autre touche pour quitter."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				Write-Host "`r`nAppuyez sur une touche pour continuer..."
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			$user_response = Read-Host "`r`nVoulez-vous continuer ? (o = oui)"
			$user_response = $user_response.ToLower()
			if ($user_response -ne "o")
			{
				exit 0
			}
			Remove-Item -Path "$program_folder_portable_64\$corrupted_file.bak" -Force
			Write-Host "Le fichier :`r`n$program_folder_portable_64\$corrupted_file.bak`r`na été supprimé."
		}
		$number_of_replacements = i_my_replace_array_hex_strings_in_file $corrupted_file_error_ori $corrupted_file_error_fix ("$program_folder_portable_64\$corrupted_file")
		Write-Host "`r`n`r`n$number_of_replacements remplacement(s) effectué(s) sur le fichier :`r`n$program_folder_portable_64\$corrupted_file`r`n"
		$i_return = i_my_rename_file "$program_folder_portable_64\$corrupted_file"           "$program_folder_portable_64\$corrupted_file.bak"
		$i_return = i_my_rename_file "$program_folder_portable_64\$corrupted_file.temporary" "$program_folder_portable_64\$corrupted_file"
	}
	if ($i_installation_type -eq 6)
	{
		if ((Test-Path -Path "$program_folder_installed_32\$corrupted_file.bak" -PathType Leaf) -eq $true)
		{
			Write-Host "Attention, le fichier de sauvegarde :`r`n$program_folder_installed_32\$corrupted_file.bak"
			Write-Host "existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
			Write-Host "appuyez sur ""o"" pour supprimer le fichier "".bak"" et continuer,`r`nsinon appuyez sur une autre touche pour quitter."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				Write-Host "`r`nAppuyez sur une touche pour continuer..."
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			$user_response = Read-Host "`r`nVoulez-vous continuer ? (o = oui)"
			$user_response = $user_response.ToLower()
			if ($user_response -ne "o")
			{
				exit 0
			}
			Remove-Item -Path "$program_folder_installed_32\$corrupted_file.bak" -Force
			Write-Host "Le fichier :`r`n$program_folder_installed_32\$corrupted_file.bak`r`na été supprimé."
		}
		$number_of_replacements = i_my_replace_array_hex_strings_in_file $corrupted_file_error_ori $corrupted_file_error_fix ("$program_folder_installed_32\$corrupted_file")
		Write-Host "`r`n`r`n$number_of_replacements remplacement(s) effectué(s) sur le fichier :`r`n$program_folder_installed_32\$corrupted_file`r`n"
		$i_return = i_my_rename_file "$program_folder_installed_32\$corrupted_file"           "$program_folder_installed_32\$corrupted_file.bak"
		$i_return = i_my_rename_file "$program_folder_installed_32\$corrupted_file.temporary" "$program_folder_installed_32\$corrupted_file"
	}
	if ($i_installation_type -eq 7)
	{
		if ((Test-Path -Path "$program_folder_installed_64\$corrupted_file.bak" -PathType Leaf) -eq $true)
		{
			Write-Host "Attention, le fichier de sauvegarde :`r`n$program_folder_installed_64\$corrupted_file.bak"
			Write-Host "existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
			Write-Host "appuyez sur ""o"" pour supprimer le fichier "".bak"" et continuer,`r`nsinon appuyez sur une autre touche pour quitter."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				Write-Host "`r`nAppuyez sur une touche pour continuer..."
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			$user_response = Read-Host "`r`nVoulez-vous continuer ? (o = oui)"
			$user_response = $user_response.ToLower()
			if ($user_response -ne "o")
			{
				exit 0
			}
			Remove-Item -Path "$program_folder_installed_64\$corrupted_file.bak" -Force
			Write-Host "Le fichier :`r`n$program_folder_installed_64\$corrupted_file.bak`r`na été supprimé."
		}
		$number_of_replacements = i_my_replace_array_hex_strings_in_file $corrupted_file_error_ori $corrupted_file_error_fix ("$program_folder_installed_64\$corrupted_file")
		Write-Host "`r`n`r`n$number_of_replacements remplacement(s) effectué(s) sur le fichier :`r`n$program_folder_installed_64\$corrupted_file`r`n"
		$i_return = i_my_rename_file "$program_folder_installed_64\$corrupted_file"           "$program_folder_installed_64\$corrupted_file.bak"
		$i_return = i_my_rename_file "$program_folder_installed_64\$corrupted_file.temporary" "$program_folder_installed_64\$corrupted_file"
	}
	return $number_of_replacements
}



# _____________________________________________________________________________
# Partie à modifier pour ajouter des fichiers à corriger :



# Lancement du script :
$number_of_replacements = i_my_fix_corrupted_file $corrupted_file_1_error_ori $corrupted_file_1_error_fix ("$corrupted_file_1")



# _____________________________________________________________________________
# Partie à ne pas modifier :



$pause_message = "L'exécution de ce programme est terminée."
Write-Host "$pause_message`r`n`r`nAppuyez sur une touche pour continuer..."
if ($Host.UI.RawUI.KeyAvailable -eq $true)
{
	while ($Host.UI.RawUI.KeyAvailable -eq $true)
	{
		$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
	}
}
else
{
	$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
}
exit 0

Thunderbird en VBScript

' Character encoding = UTF-16 LE (Byte Order Mark = FF FE)
' End-of-line = Windows (CR LF)

' Composants requis :
set object_shell       = WScript.CreateObject("WScript.Shell")
set object_file_system = WScript.CreateObject("Scripting.FileSystemObject")
current_folder         = object_file_system.GetParentFolderName(WScript.ScriptFullName)



' _____________________________________________________________________________
' Partie à modifier pour ajouter des fichiers et erreurs à corriger :



' Emplacement personnalisé du dossier contenant le fichier "thunderbird.exe".
' Vous pouvez le laisser vide. Exemple :
' program_folder = current_folder & "\Mozilla Thunderbird"
program_folder = ""



' Emplacements connus :
program_folder_portable_32  = current_folder & "\App\Thunderbird"
program_folder_portable_64  = current_folder & "\App\Thunderbird64"
program_folder_installed_32 = object_shell.ExpandEnvironmentStrings("%ProgramFiles(x86)%") & "\Mozilla Thunderbird"
program_folder_installed_64 = object_shell.ExpandEnvironmentStrings("%ProgramFiles%")      & "\Mozilla Thunderbird"



' Fichiers à réparer :
corrupted_file_1 = "omni.ja"



' Réparations à faire :

dim corrupted_file_1_error_ori()
redim corrupted_file_1_error_ori(-1)
dim corrupted_file_1_error_fix()
redim corrupted_file_1_error_fix(-1)

' away=absent·e => away=absent
redim preserve corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori) + 1)
corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori)) = "6E74C2B7650A"	' é·e
redim preserve corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix) + 1)
corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix)) = "6E740A0A0A0A"	' nt

' utilisateur·trice => utilisateur
redim preserve corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori) + 1)
corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori)) = "C2B774726963650A"	' ·trice
redim preserve corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix) + 1)
corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix)) = "0A0A0A0A0A0A0A0A"	' 

' Jean·ne Dupont => Jean Dupont
redim preserve corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori) + 1)
corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori)) = "C2B76E65204475706F6E740A"	' ·ne Dupont
redim preserve corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix) + 1)
corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix)) = "204475706F6E740A0A0A0A0A"	'  Dupont

' jean.ne.dupont@example.com => jean.dupont@example.com
redim preserve corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori) + 1)
corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori)) = "2E6E652E6475706F6E74406578616D706C652E636F6D0A"	' .ne.dupont@example.com
redim preserve corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix) + 1)
corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix)) = "2E6475706F6E74406578656D706C652E636F6D0A0A0A0A"	' .dupont@exemple.com

' averti·e lorsque la génération de clé sera terminée. => averti lorsque la génération de clé sera terminée.
redim preserve corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori) + 1)
corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori)) = "C2B765206C6F7273717565206C612067C3A96EC3A9726174696F6E20646520636CC3A92073657261207465726D696EC3A9652E0A"	' ·e lorsque la génération de clé sera terminée.
redim preserve corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix) + 1)
corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix)) = "206C6F7273717565206C612067C3A96EC3A9726174696F6E20646520636CC3A92073657261207465726D696EC3A9652E0A0A0A0A"	'  lorsque la génération de clé sera terminée.

' satisfait·e du résultat. => satisfait du résultat.
redim preserve corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori) + 1)
corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori)) = "C2B7652064752072C3A973756C7461742E0A"	' ·e du résultat.
redim preserve corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix) + 1)
corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix)) = "2064752072C3A973756C7461742E0A0A0A0A"	'  du résultat.

' connecté·e plusieurs fois, une autre session peut avoir reçu le message. => connecté plusieurs fois, une autre session peut avoir reçu le message.
redim preserve corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori) + 1)
corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori)) = "C2B76520706C7573696575727320666F69732C20756E652061757472652073657373696F6E20706575742061766F6972207265C3A775206C65206D6573736167652E0A"	' ·e plusieurs fois, une autre session peut avoir reçu le message.
redim preserve corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix) + 1)
corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix)) = "20706C7573696575727320666F69732C20756E652061757472652073657373696F6E20706575742061766F6972207265C3A775206C65206D6573736167652E0A0A0A0A"	'  plusieurs fois, une autre session peut avoir reçu le message.

' pisté·e => pisté
redim preserve corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori) + 1)
corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori)) = "C3A9C2B7650A"	' é·e
redim preserve corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix) + 1)
corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix)) = "C3A90A0A0A0A"	' é



' _____________________________________________________________________________
' Partie à ne pas modifier :



function i_my_replace_array_hex_strings_in_file(byval array_hex_strings_to_find, byval array_hex_strings_to_replace, byval file_fullname)
	if ubound(array_hex_strings_to_find) <> ubound(array_hex_strings_to_replace) then
		MsgBox "Erreur :" & vbCrLf & "Le nombre de cases dans le tableau des chaînes hexadécimales à détecter (" & ubound(array_hex_strings_to_find) + 1 & ")" & vbCrLf & "et dans le tableau des chaînes hexadécimales à remplacer (" & ubound(array_hex_strings_to_replace) + 1 & ")" & vbCrLf & "n'est pas identique.", 48, "Erreur"		' 0 = vbOKOnly vbDefaultButton1 vbApplicationModal	48 = vbExclamation
		WScript.Quit(0)
	end if
	for i = 0 to ubound(array_hex_strings_to_find) step 1
		if len(array_hex_strings_to_find(i)) <> len(array_hex_strings_to_replace(i)) then
			MsgBox "Erreur :" & vbCrLf & "La variable " & array_hex_strings_to_find(i) & " et" & vbCrLf & "la variable " & array_hex_strings_to_replace(i) & vbCrLf _
			& "n'ont pas le même nombre de caractères (" & len(array_hex_strings_to_find(i)) & " contre " & len(array_hex_strings_to_replace(i)) & ").", 48, "Erreur"
			WScript.Quit(0)
		end if
		if len(array_hex_strings_to_find(i)) MOD 2 <> 0 then
			MsgBox "Erreur, les variables :" & vbCrLf & array_hex_strings_to_find(i) & " et" & vbCrLf & array_hex_strings_to_replace(i) & vbCrLf & "ont un nombre impair de caractères.", 48, "Erreur"
			WScript.Quit(0)
		end if
		if len(array_hex_strings_to_find(i)) < 12 then
			MsgBox "Erreur, les variables :" & vbCrLf & array_hex_strings_to_find(i) & " et" & vbCrLf & array_hex_strings_to_replace(i) & vbCrLf _
			& "doivent avoir au moins 12 caractères hexadécimaux pour représenter" & vbCrLf _
			& "au moins 6 octets. Or ici, elles n'en contiennent que " & len(array_hex_strings_to_find(i)) & ".", 48, "Erreur"
			WScript.Quit(0)
		end if
	next

	set object_file = object_file_system.CreateTextFile(file_fullname & ".temporary", TRUE, FALSE)	' (TRUE = Écraser si existe déjà) (FALSE = Utiliser ASCII au lieu d'Unicode UTF16LE donc pas de Byte Order Mark FFFE)
	object_file.Close
	if object_file_system.FileExists(file_fullname & ".temporary") = FALSE then
		MsgBox "Erreur, le fichier :" & vbCrLf & file_fullname & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur.", 48, "Erreur"
		WScript.Quit(0)
	end if

	' Pour aller plus vite, on crée 5 tableaux en 2 dimensions.
	' Nous sommes obligés de créer chaque dimension indépendamment car
	' il est impossible de redimensionner dynamiquement les 2 dimensions.
	' Concernant la 1ère dimension :
	' Le 1er tableau contiendra les premiers octets de toutes les chaînes
	' à rechercher, convertis en décimal et en éliminant les doublons.
	' Le 2ème tableau contiendra les deuxièmes octets, etc.
	' Le 3ème tableau contiendra les troisièmes octets, etc.
	dim array_bytes_to_find_1()
	redim array_bytes_to_find_1(-1)
	dim array_bytes_to_find_2()
	redim array_bytes_to_find_2(-1)
	dim array_bytes_to_find_3()
	redim array_bytes_to_find_3(-1)
	dim array_bytes_to_find_4()
	redim array_bytes_to_find_4(-1)
	dim array_bytes_to_find_5()
	redim array_bytes_to_find_5(-1)
	for i_1 = 0 to ubound(array_hex_strings_to_find) step 1
		b_already_exists = FALSE
		for i_2 = 0 to ubound(array_bytes_to_find_1) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_1), 1, 2)) = array_bytes_to_find_1(i_2) then
				b_already_exists = TRUE
			end if
		next
		if b_already_exists = FALSE then
			redim preserve array_bytes_to_find_1(ubound(array_bytes_to_find_1) + 1)
			array_bytes_to_find_1(ubound(array_bytes_to_find_1)) = cint("&H" & mid(array_hex_strings_to_find(i_1), 1, 2))
		end if
		b_already_exists = FALSE
		for i_2 = 0 to ubound(array_bytes_to_find_2) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_1), 3, 2)) = array_bytes_to_find_2(i_2) then
				b_already_exists = TRUE
			end if
		next
		if b_already_exists = FALSE then
			redim preserve array_bytes_to_find_2(ubound(array_bytes_to_find_2) + 1)
			array_bytes_to_find_2(ubound(array_bytes_to_find_2)) = cint("&H" & mid(array_hex_strings_to_find(i_1), 3, 2))
		end if
		b_already_exists = FALSE
		for i_2 = 0 to ubound(array_bytes_to_find_3) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_1), 5, 2)) = array_bytes_to_find_3(i_2) then
				b_already_exists = TRUE
			end if
		next
		if b_already_exists = FALSE then
			redim preserve array_bytes_to_find_3(ubound(array_bytes_to_find_3) + 1)
			array_bytes_to_find_3(ubound(array_bytes_to_find_3)) = cint("&H" & mid(array_hex_strings_to_find(i_1), 5, 2))
		end if
		b_already_exists = FALSE
		for i_2 = 0 to ubound(array_bytes_to_find_4) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_1), 7, 2)) = array_bytes_to_find_4(i_2) then
				b_already_exists = TRUE
			end if
		next
		if b_already_exists = FALSE then
			redim preserve array_bytes_to_find_4(ubound(array_bytes_to_find_4) + 1)
			array_bytes_to_find_4(ubound(array_bytes_to_find_4)) = cint("&H" & mid(array_hex_strings_to_find(i_1), 7, 2))
		end if
		b_already_exists = FALSE
		for i_2 = 0 to ubound(array_bytes_to_find_5) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_1), 9, 2)) = array_bytes_to_find_5(i_2) then
				b_already_exists = TRUE
			end if
		next
		if b_already_exists = FALSE then
			redim preserve array_bytes_to_find_5(ubound(array_bytes_to_find_5) + 1)
			array_bytes_to_find_5(ubound(array_bytes_to_find_5)) = cint("&H" & mid(array_hex_strings_to_find(i_1), 9, 2))
		end if
	next
	' Concernant la 2ème dimension :
	' Pour chaque tableau, elle contiendra les numéros des chaînes
	' auxquelles les octets correspondent (en commençant par 0).
	' Imaginons que la 1ère case du 1er tableau contient l'octet C2 = 194
	' et plusieurs chaînes commencent par C2 (doublons), par exemple les
	' chaînes 1 2 4 5 6, alors les chiffres 0 1 3 4 5 seront inscrits
	' dans la 2ème dimension de la 1ère case du 1er tableau.
	dim array_bytes_to_find_1_2D()
	redim array_bytes_to_find_1_2D(ubound(array_bytes_to_find_1), 0)
	dim array_bytes_to_find_2_2D()
	redim array_bytes_to_find_2_2D(ubound(array_bytes_to_find_2), 0)
	dim array_bytes_to_find_3_2D()
	redim array_bytes_to_find_3_2D(ubound(array_bytes_to_find_3), 0)
	dim array_bytes_to_find_4_2D()
	redim array_bytes_to_find_4_2D(ubound(array_bytes_to_find_4), 0)
	dim array_bytes_to_find_5_2D()
	redim array_bytes_to_find_5_2D(ubound(array_bytes_to_find_5), 0)
	for i_1 = 0 to ubound(array_bytes_to_find_1_2D, 1) step 1
		array_bytes_to_find_1_2D(i_1, 0) = array_bytes_to_find_1(i_1)
		i_2 = 1
		for i_3 = 0 to ubound(array_hex_strings_to_find) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_3), 1, 2)) = array_bytes_to_find_1_2D(i_1, 0) then
				if ubound(array_bytes_to_find_1_2D, 2) < i_2 then
					redim preserve array_bytes_to_find_1_2D(ubound(array_bytes_to_find_1_2D, 1), ubound(array_bytes_to_find_1_2D, 2) + 1)
				end if
				array_bytes_to_find_1_2D(i_1, i_2) = i_3
				i_2 = i_2 + 1
			end if
		next
	next
	for i_1 = 0 to ubound(array_bytes_to_find_2_2D, 1) step 1
		array_bytes_to_find_2_2D(i_1, 0) = array_bytes_to_find_2(i_1)
		i_2 = 1
		for i_3 = 0 to ubound(array_hex_strings_to_find) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_3), 3, 2)) = array_bytes_to_find_2_2D(i_1, 0) then
				if ubound(array_bytes_to_find_2_2D, 2) < i_2 then
					redim preserve array_bytes_to_find_2_2D(ubound(array_bytes_to_find_2_2D, 1), ubound(array_bytes_to_find_2_2D, 2) + 1)
				end if
				array_bytes_to_find_2_2D(i_1, i_2) = i_3
				i_2 = i_2 + 1
			end if
		next
	next
	for i_1 = 0 to ubound(array_bytes_to_find_3_2D, 1) step 1
		array_bytes_to_find_3_2D(i_1, 0) = array_bytes_to_find_3(i_1)
		i_2 = 1
		for i_3 = 0 to ubound(array_hex_strings_to_find) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_3), 5, 2)) = array_bytes_to_find_3_2D(i_1, 0) then
				if ubound(array_bytes_to_find_3_2D, 2) < i_2 then
					redim preserve array_bytes_to_find_3_2D(ubound(array_bytes_to_find_3_2D, 1), ubound(array_bytes_to_find_3_2D, 2) + 1)
				end if
				array_bytes_to_find_3_2D(i_1, i_2) = i_3
				i_2 = i_2 + 1
			end if
		next
	next
	for i_1 = 0 to ubound(array_bytes_to_find_4_2D, 1) step 1
		array_bytes_to_find_4_2D(i_1, 0) = array_bytes_to_find_4(i_1)
		i_2 = 1
		for i_3 = 0 to ubound(array_hex_strings_to_find) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_3), 7, 2)) = array_bytes_to_find_4_2D(i_1, 0) then
				if ubound(array_bytes_to_find_4_2D, 2) < i_2 then
					redim preserve array_bytes_to_find_4_2D(ubound(array_bytes_to_find_4_2D, 1), ubound(array_bytes_to_find_4_2D, 2) + 1)
				end if
				array_bytes_to_find_4_2D(i_1, i_2) = i_3
				i_2 = i_2 + 1
			end if
		next
	next
	for i_1 = 0 to ubound(array_bytes_to_find_5_2D, 1) step 1
		array_bytes_to_find_5_2D(i_1, 0) = array_bytes_to_find_5(i_1)
		i_2 = 1
		for i_3 = 0 to ubound(array_hex_strings_to_find) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_3), 9, 2)) = array_bytes_to_find_5_2D(i_1, 0) then
				if ubound(array_bytes_to_find_5_2D, 2) < i_2 then
					redim preserve array_bytes_to_find_5_2D(ubound(array_bytes_to_find_5_2D, 1), ubound(array_bytes_to_find_5_2D, 2) + 1)
				end if
				array_bytes_to_find_5_2D(i_1, i_2) = i_3
				i_2 = i_2 + 1
			end if
		next
	next

	WScript_Echo_variable = "1ers  octets à rechercher => Dans les chaînes : " & vbCrLf
	for i_1 = 0 to ubound(array_bytes_to_find_1_2D, 1) step 1
		WScript_Echo_variable = WScript_Echo_variable & array_bytes_to_find_1_2D(i_1, 0) & "	=> "
		for i_2 = 1 to ubound(array_bytes_to_find_1_2D, 2) step 1
			WScript_Echo_variable = WScript_Echo_variable & array_bytes_to_find_1_2D(i_1, i_2)
			if i_2 + 1 <= ubound(array_bytes_to_find_1_2D, 2) then
				if array_bytes_to_find_1_2D(i_1, i_2 + 1) <> "" then
					WScript_Echo_variable = WScript_Echo_variable & " "
				end if
			end if
		next
		WScript_Echo_variable = WScript_Echo_variable & vbCrLf
	Next
'	WScript.Echo WScript_Echo_variable
	WScript_Echo_variable = "2èmes octets à rechercher => Dans les chaînes : " & vbCrLf
	for i_1 = 0 to ubound(array_bytes_to_find_2_2D, 1) step 1
		WScript_Echo_variable = WScript_Echo_variable & array_bytes_to_find_2_2D(i_1, 0) & "	=> "
		for i_2 = 1 to ubound(array_bytes_to_find_2_2D, 2) step 1
			WScript_Echo_variable = WScript_Echo_variable & array_bytes_to_find_2_2D(i_1, i_2)
			if i_2 + 1 <= ubound(array_bytes_to_find_2_2D, 2) then
				if array_bytes_to_find_2_2D(i_1, i_2 + 1) <> "" then
					WScript_Echo_variable = WScript_Echo_variable & " "
				end if
			end if
		next
		WScript_Echo_variable = WScript_Echo_variable & vbCrLf
	Next
'	WScript.Echo WScript_Echo_variable
	WScript_Echo_variable = "3èmes octets à rechercher => Dans les chaînes : " & vbCrLf
	for i_1 = 0 to ubound(array_bytes_to_find_3_2D, 1) step 1
		WScript_Echo_variable = WScript_Echo_variable & array_bytes_to_find_3_2D(i_1, 0) & "	=> "
		for i_2 = 1 to ubound(array_bytes_to_find_3_2D, 2) step 1
			WScript_Echo_variable = WScript_Echo_variable & array_bytes_to_find_3_2D(i_1, i_2)
			if i_2 + 1 <= ubound(array_bytes_to_find_3_2D, 2) then
				if array_bytes_to_find_3_2D(i_1, i_2 + 1) <> "" then
					WScript_Echo_variable = WScript_Echo_variable & " "
				end if
			end if
		next
		WScript_Echo_variable = WScript_Echo_variable & vbCrLf
	Next
'	WScript.Echo WScript_Echo_variable
	WScript_Echo_variable = "4èmes octets à rechercher => Dans les chaînes : " & vbCrLf
	for i_1 = 0 to ubound(array_bytes_to_find_4_2D, 1) step 1
		WScript_Echo_variable = WScript_Echo_variable & array_bytes_to_find_4_2D(i_1, 0) & "	=> "
		for i_2 = 1 to ubound(array_bytes_to_find_4_2D, 2) step 1
			WScript_Echo_variable = WScript_Echo_variable & array_bytes_to_find_4_2D(i_1, i_2)
			if i_2 + 1 <= ubound(array_bytes_to_find_4_2D, 2) then
				if array_bytes_to_find_4_2D(i_1, i_2 + 1) <> "" then
					WScript_Echo_variable = WScript_Echo_variable & " "
				end if
			end if
		next
		WScript_Echo_variable = WScript_Echo_variable & vbCrLf
	Next
'	WScript.Echo WScript_Echo_variable
	WScript_Echo_variable = "5èmes octets à rechercher => Dans les chaînes : " & vbCrLf
	for i_1 = 0 to ubound(array_bytes_to_find_5_2D, 1) step 1
		WScript_Echo_variable = WScript_Echo_variable & array_bytes_to_find_5_2D(i_1, 0) & "	=> "
		for i_2 = 1 to ubound(array_bytes_to_find_5_2D, 2) step 1
			WScript_Echo_variable = WScript_Echo_variable & array_bytes_to_find_5_2D(i_1, i_2)
			if i_2 + 1 <= ubound(array_bytes_to_find_5_2D, 2) then
				if array_bytes_to_find_5_2D(i_1, i_2 + 1) <> "" then
					WScript_Echo_variable = WScript_Echo_variable & " "
				end if
			end if
		next
		WScript_Echo_variable = WScript_Echo_variable & vbCrLf
	Next
'	WScript.Echo WScript_Echo_variable

	set file_input  = object_file_system.OpenTextFile(file_fullname, 1)				' 1 = Ouverture du fichier en lecture
	set file_output = object_file_system.OpenTextFile(file_fullname & ".temporary", 2, TRUE, 0)	' 2 = Ouverture du fichier en écriture (TRUE = Fichier créé si n'existe pas) (0 = ASCII, -1 = Unicode, -2 = Par défaut)

	array_bytes_to_find_1_2D_ubound = ubound(array_bytes_to_find_1_2D, 1)
	array_bytes_to_find_2_2D_ubound = ubound(array_bytes_to_find_2_2D, 1)
	array_bytes_to_find_3_2D_ubound = ubound(array_bytes_to_find_3_2D, 1)
	array_bytes_to_find_4_2D_ubound = ubound(array_bytes_to_find_4_2D, 1)
	array_bytes_to_find_5_2D_ubound = ubound(array_bytes_to_find_5_2D, 1)
	dim array_byte_buffer_1()
	redim array_byte_buffer_1(-1)
	dim array_byte_buffer_2()
	redim array_byte_buffer_2(-1)
	dim array_match_found_1()
	redim array_match_found_1(-1)
	dim array_match_found_2()
	redim array_match_found_2(-1)
	byte_read           = 0
	i_byte_check        = 0
	i_replacement_count = 0
	do until file_input.AtEndOfStream
		byte_read    = asc(file_input.Read(1))
		' WScript.Echo "Caractère lu (hexadécimal " & string(2 - len(hex(byte_read)), "0") & ucase((hex(byte_read))) & " = décimal " & byte_read & ") : """ & chr(byte_read) & """"

		' L'octet lu est stocké dans la dernière case d'un tableau (buffer).
		redim preserve array_byte_buffer_1(ubound(array_byte_buffer_1) + 1)
		array_byte_buffer_1(ubound(array_byte_buffer_1)) = byte_read
		' WScript.Echo "Contenu du buffer : " & join(array_byte_buffer_1, " ")

		select case i_byte_check
			case 0
				' On considère que le buffer peut contenir plusieurs octets en attente d'être traités,
				' c'est-à-dire écrits dans le fichier de sortie s'il n'existe aucune correspondance.
				' Chaque 1er octet traité disparaît du buffer, dont la taille se réduit.
				' Lorsque sa taille atteint 0 (ubound = -1), le buffer est vide,
				' tous les octets ont été traités.
				b_exit_while_1 = FALSE
				while ubound(array_byte_buffer_1) >= 0 AND b_exit_while_1 = FALSE
					' Première boucle de vérification.
					' On compare le 1er octet (i_byte_check = 0) du buffer
					' aux octets stockés dans les cases de la 1ère dimension du 1er tableau.
					i_0 = 0
					while i_0 <= array_bytes_to_find_1_2D_ubound AND b_exit_while_1 = FALSE
						' Si il correspond à une case,
						' l'écriture du fichier de sortie est suspendue (i_byte_check ≠ 0)
						' et l'octet reste stocké dans le buffer.
						if array_byte_buffer_1(i_byte_check) = array_bytes_to_find_1_2D(i_0, 0) then
							' WScript.Echo "Étape " & i_byte_check & " - Correspondance trouvée : " & array_byte_buffer_1(i_byte_check) & " = " & array_bytes_to_find_1_2D(i_0, 0)
							b_exit_while_1 = TRUE
							i_byte_check = i_byte_check + 1		' i_byte_check = 1
							i_0 = i_0 - 1
						end if
						i_0 = i_0 + 1
					wend
					' Si il ne correspond pas, l'octet est traité,
					' c'est-à-dire écrit dans le fichier de sortie puis retiré du buffer.
					if b_exit_while_1 = FALSE then
						file_output.Write(chr(array_byte_buffer_1(i_byte_check)))
						' Si le buffer contient plusieurs cases,
						' on les décale vers l'arrière et on le raccourcit d'une case.
						if ubound(array_byte_buffer_1) >= 1 then
							redim array_byte_buffer_2(ubound(array_byte_buffer_1) - 1)
							for i = 1 to ubound(array_byte_buffer_1)
								array_byte_buffer_2(i - 1) = array_byte_buffer_1(i)
							next
							redim array_byte_buffer_1(ubound(array_byte_buffer_2))
							for i = 0 to ubound(array_byte_buffer_2)
								array_byte_buffer_1(i) = array_byte_buffer_2(i)
							next
						else
							redim array_byte_buffer_1(-1)
						end if
					end if
				wend
				' break
			case 1
				' Deuxième boucle de vérification.
				' On compare le 2ème octet (i_byte_check = 1) du buffer
				' aux octets stockés dans les cases de la 1ère dimension du 2ème tableau.
				b_exit_while_1 = FALSE
				i_1 = 0
				while i_1 <= array_bytes_to_find_2_2D_ubound AND b_exit_while_1 = FALSE
					' Si il correspond à une case,
					' on compare la 2ème dimension de la case du 1er tableau précédent
					' à la 2ème dimension de cette case de ce 2ème tableau et
					' on stocke les numéros communs dans un tableau : array_match_found_1.
					if array_byte_buffer_1(i_byte_check) = array_bytes_to_find_2_2D(i_1, 0) then
						b_exit_while_1 = TRUE
						redim array_match_found_1(-1)
						i_0_2D = 1
						b_exit_while_2 = FALSE
						while i_0_2D <= ubound(array_bytes_to_find_1_2D, 2) AND b_exit_while_2 = FALSE
							if array_bytes_to_find_1_2D(i_0, i_0_2D) <> "" then
								i_1_2D = 1
								b_exit_while_3 = FALSE
								while i_1_2D <= ubound(array_bytes_to_find_2_2D, 2) AND  b_exit_while_3 = FALSE
									if array_bytes_to_find_2_2D(i_1, i_1_2D) <> "" then
										if array_bytes_to_find_1_2D(i_0, i_0_2D) = array_bytes_to_find_2_2D(i_1, i_1_2D) then
											redim preserve array_match_found_1(ubound(array_match_found_1) + 1)
											array_match_found_1(ubound(array_match_found_1)) = array_bytes_to_find_1_2D(i_0, i_0_2D)
										end if
										i_1_2D = i_1_2D + 1
									else
										b_exit_while_3 = TRUE
									end if
								wend
								i_0_2D = i_0_2D + 1
							else
								b_exit_while_2 = TRUE
							end if
						wend
						' Si le tableau n'est pas vide, il indique le ou les numéros
						' des chaînes qui commencent par ces 2 octets. Dans ce cas :
						' l'écriture du fichier de sortie reste suspendue (i_byte_check ≠ 0)
						' et les octets restent stockés dans le buffer.
						if ubound(array_match_found_1) >= 0 then
							' WScript.Echo "Étape " & i_byte_check & " - Correspondance trouvée : " & array_byte_buffer_1(i_byte_check) & " = " & array_bytes_to_find_2_2D(i_1, 0)
							' WScript.Echo "Les octets du buffer """ & join(array_byte_buffer_1, " ") & """ doivent commencer la/les chaîne(s) """ & join(array_match_found_1, " ") & """"
							i_byte_check = i_byte_check + 1		' i_byte_check = 2
						end if
						' Si le tableau est vide, les 2 octets ne correspondent
						' à aucune chaîne à rechercher. C'est la même situation que
						' si le 2ème octet ne correspond à aucune case du 2ème tableau.
					end if
					i_1 = i_1 + 1
				wend
				' Si il ne correspond pas, le premier octet est traité,
				' c'est-à-dire écrit dans le fichier de sortie puis retiré du buffer.
				' De plus i_byte_check est réinitialisée donc on retourne
				' à la première boucle de vérification pour vider le buffer.
				if b_exit_while_1 = FALSE OR ubound(array_match_found_1) < 0 then
					i_byte_check = 0
					file_output.Write(chr(array_byte_buffer_1(i_byte_check)))
					' Si le buffer contient plusieurs cases,
					' on les décale vers l'arrière et on le raccourcit d'une case.
					if ubound(array_byte_buffer_1) >= 1 then
						redim array_byte_buffer_2(ubound(array_byte_buffer_1) - 1)
						for i = 1 to ubound(array_byte_buffer_1)
							array_byte_buffer_2(i - 1) = array_byte_buffer_1(i)
						next
						redim array_byte_buffer_1(ubound(array_byte_buffer_2))
						for i = 0 to ubound(array_byte_buffer_2)
							array_byte_buffer_1(i) = array_byte_buffer_2(i)
						next
					else
						redim array_byte_buffer_1(-1)
					end if
				end if
				' break
			case 2
				' Troisième boucle de vérification.
				' On compare le 3ème octet (i_byte_check = 2) du buffer
				' aux octets stockés dans les cases de la 1ère dimension du 3ème tableau.
				b_exit_while_1 = FALSE
				i_2 = 0
				while i_2 <= array_bytes_to_find_3_2D_ubound AND b_exit_while_1 = FALSE
					' Si il correspond à une case,
					' on compare le tableau précédent array_match_found_1
					' à la 2ème dimension de cette case de ce 3ème tableau et
					' on stocke les numéros communs dans array_match_found_1
					' par l'intermédiaire d'un tableau temporaire : array_match_found_2.
					if array_byte_buffer_1(i_byte_check) = array_bytes_to_find_3_2D(i_2, 0) then
						b_exit_while_1 = TRUE
						redim array_match_found_2(-1)
						i_1_2D = 0
						b_exit_while_2 = FALSE
						while i_1_2D <= ubound(array_match_found_1) AND b_exit_while_2 = FALSE
							if array_match_found_1(i_1_2D) <> "" then
								i_2_2D = 1
								b_exit_while_3 = FALSE
								while i_2_2D <= ubound(array_bytes_to_find_3_2D, 2) AND  b_exit_while_3 = FALSE
									if array_bytes_to_find_3_2D(i_2, i_2_2D) <> "" then
										if array_match_found_1(i_1_2D) = array_bytes_to_find_3_2D(i_2, i_2_2D) then
											redim preserve array_match_found_2(ubound(array_match_found_2) + 1)
											array_match_found_2(ubound(array_match_found_2)) = array_match_found_1(i_1_2D)
										end if
										i_2_2D = i_2_2D + 1
									else
										b_exit_while_3 = TRUE
									end if
								wend
								i_1_2D = i_1_2D + 1
							else
								b_exit_while_2 = TRUE
							end if
						wend
						redim array_match_found_1(ubound(array_match_found_2))
						for i = 0 to ubound(array_match_found_2)
							array_match_found_1(i) = array_match_found_2(i)
						next
						' Si le tableau n'est pas vide, il indique le ou les numéros
						' des chaînes qui commencent par ces 3 octets. Dans ce cas :
						' l'écriture du fichier de sortie reste suspendue (i_byte_check ≠ 0)
						' et les octets restent stockés dans le buffer.
						if ubound(array_match_found_1) >= 0 then
							' WScript.Echo "Étape " & i_byte_check & " - Correspondance trouvée : " & array_byte_buffer_1(i_byte_check) & " = " & array_bytes_to_find_3_2D(i_2, 0)
							' WScript.Echo "Les octets du buffer """ & join(array_byte_buffer_1, " ") & """ doivent commencer la/les chaîne(s) """ & join(array_match_found_1, " ") & """"
							i_byte_check = i_byte_check + 1		' i_byte_check = 3
						end if
						' Si le tableau est vide, les 3 octets ne correspondent
						' à aucune chaîne à rechercher. C'est la même situation que
						' si le 3ème octet ne correspond à aucune case du 3ème tableau.
					end if
					i_2 = i_2 + 1
				wend
				' Si il ne correspond pas, le premier octet est traité,
				' c'est-à-dire écrit dans le fichier de sortie puis retiré du buffer.
				' De plus i_byte_check est réinitialisée donc on retourne
				' à la première boucle de vérification pour vider le buffer.
				if b_exit_while_1 = FALSE OR ubound(array_match_found_1) < 0 then
					i_byte_check = 0
					file_output.Write(chr(array_byte_buffer_1(i_byte_check)))
					' Si le buffer contient plusieurs cases,
					' on les décale vers l'arrière et on le raccourcit d'une case.
					if ubound(array_byte_buffer_1) >= 1 then
						redim array_byte_buffer_2(ubound(array_byte_buffer_1) - 1)
						for i = 1 to ubound(array_byte_buffer_1)
							array_byte_buffer_2(i - 1) = array_byte_buffer_1(i)
						next
						redim array_byte_buffer_1(ubound(array_byte_buffer_2))
						for i = 0 to ubound(array_byte_buffer_2)
							array_byte_buffer_1(i) = array_byte_buffer_2(i)
						next
					else
						redim array_byte_buffer_1(-1)
					end if
				end if
				' break
			case 3
				b_exit_while_1 = FALSE
				i_3 = 0
				while i_3 <= array_bytes_to_find_4_2D_ubound AND b_exit_while_1 = FALSE
					if array_byte_buffer_1(i_byte_check) = array_bytes_to_find_4_2D(i_3, 0) then
						b_exit_while_1 = TRUE
						redim array_match_found_2(-1)
						i_2_2D = 0
						b_exit_while_2 = FALSE
						while i_2_2D <= ubound(array_match_found_1) AND b_exit_while_2 = FALSE
							if array_match_found_1(i_2_2D) <> "" then
								i_3_2D = 1
								b_exit_while_3 = FALSE
								while i_3_2D <= ubound(array_bytes_to_find_4_2D, 2) AND  b_exit_while_3 = FALSE
									if array_bytes_to_find_4_2D(i_3, i_3_2D) <> "" then
										if array_match_found_1(i_2_2D) = array_bytes_to_find_4_2D(i_3, i_3_2D) then
											redim preserve array_match_found_2(ubound(array_match_found_2) + 1)
											array_match_found_2(ubound(array_match_found_2)) = array_match_found_1(i_2_2D)
										end if
										i_3_2D = i_3_2D + 1
									else
										b_exit_while_3 = TRUE
									end if
								wend
								i_2_2D = i_2_2D + 1
							else
								b_exit_while_2 = TRUE
							end if
						wend
						redim array_match_found_1(ubound(array_match_found_2))
						for i = 0 to ubound(array_match_found_2)
							array_match_found_1(i) = array_match_found_2(i)
						next
						if ubound(array_match_found_1) >= 0 then
							' WScript.Echo "Étape " & i_byte_check & " - Correspondance trouvée : " & array_byte_buffer_1(i_byte_check) & " = " & array_bytes_to_find_4_2D(i_3, 0)
							' WScript.Echo "Les octets du buffer """ & join(array_byte_buffer_1, " ") & """ doivent commencer la/les chaîne(s) """ & join(array_match_found_1, " ") & """"
							i_byte_check = i_byte_check + 1		' i_byte_check = 4
						end if
					end if
					i_3 = i_3 + 1
				wend
				if b_exit_while_1 = FALSE OR ubound(array_match_found_1) < 0 then
					i_byte_check = 0
					file_output.Write(chr(array_byte_buffer_1(i_byte_check)))
					if ubound(array_byte_buffer_1) >= 1 then
						redim array_byte_buffer_2(ubound(array_byte_buffer_1) - 1)
						for i = 1 to ubound(array_byte_buffer_1)
							array_byte_buffer_2(i - 1) = array_byte_buffer_1(i)
						next
						redim array_byte_buffer_1(ubound(array_byte_buffer_2))
						for i = 0 to ubound(array_byte_buffer_2)
							array_byte_buffer_1(i) = array_byte_buffer_2(i)
						next
					else
						redim array_byte_buffer_1(-1)
					end if
				end if
				' break
			case 4
				b_exit_while_1 = FALSE
				i_4 = 0
				while i_4 <= array_bytes_to_find_5_2D_ubound AND b_exit_while_1 = FALSE
					if array_byte_buffer_1(i_byte_check) = array_bytes_to_find_5_2D(i_4, 0) then
						b_exit_while_1 = TRUE
						redim array_match_found_2(-1)
						i_3_2D = 0
						b_exit_while_2 = FALSE
						while i_3_2D <= ubound(array_match_found_1) AND b_exit_while_2 = FALSE
							if array_match_found_1(i_3_2D) <> "" then
								i_4_2D = 1
								b_exit_while_3 = FALSE
								while i_4_2D <= ubound(array_bytes_to_find_5_2D, 2) AND  b_exit_while_3 = FALSE
									if array_bytes_to_find_5_2D(i_4, i_4_2D) <> "" then
										if array_match_found_1(i_3_2D) = array_bytes_to_find_5_2D(i_4, i_4_2D) then
											redim preserve array_match_found_2(ubound(array_match_found_2) + 1)
											array_match_found_2(ubound(array_match_found_2)) = array_match_found_1(i_3_2D)
										end if
										i_4_2D = i_4_2D + 1
									else
										b_exit_while_3 = TRUE
									end if
								wend
								i_3_2D = i_3_2D + 1
							else
								b_exit_while_2 = TRUE
							end if
						wend
						redim array_match_found_1(ubound(array_match_found_2))
						for i = 0 to ubound(array_match_found_2)
							array_match_found_1(i) = array_match_found_2(i)
						next
						if ubound(array_match_found_1) >= 0 then
							' WScript.Echo "Étape " & i_byte_check & " - Correspondance trouvée : " & array_byte_buffer_1(i_byte_check) & " = " & array_bytes_to_find_5_2D(i_4, 0)
							' WScript.Echo "Les octets du buffer """ & join(array_byte_buffer_1, " ") & """ doivent commencer la/les chaîne(s) """ & join(array_match_found_1, " ") & """"
							i_byte_check = i_byte_check + 1		' i_byte_check = 5
						end if
					end if
					i_4 = i_4 + 1
				wend
				if b_exit_while_1 = FALSE OR ubound(array_match_found_1) < 0 then
					i_byte_check = 0
					file_output.Write(chr(array_byte_buffer_1(i_byte_check)))
					if ubound(array_byte_buffer_1) >= 2 then
						redim array_byte_buffer_2(ubound(array_byte_buffer_1) - 1)
						for i = 1 to ubound(array_byte_buffer_1)
							array_byte_buffer_2(i - 1) = array_byte_buffer_1(i)
						next
						redim array_byte_buffer_1(ubound(array_byte_buffer_2))
						for i = 0 to ubound(array_byte_buffer_2)
							array_byte_buffer_1(i) = array_byte_buffer_2(i)
						next
					else
						redim array_byte_buffer_1(-1)
					end if
				end if
				' break
			case else
				' On prend le tableau array_match_found_1, il contient le
				' (ou les) numéro de case du tableau array_hex_strings_to_find
				' qui lui-même contient la chaîne complète des octets à analyser
				' dont les 5 premiers octets correspondent.
				' Remarque : il se peut que plusieurs chaînes aient leurs 5 premiers
				' octets en commun. Voire que seul le dernier octet soit différent.
				' Donc on analyse chaque case du tableau array_match_found_1.
				b_exit_while_1 = FALSE
				i_5 = 0				' (Inutile car i_5 reste à 0)
				while i_5 <= ubound(array_match_found_1) AND b_exit_while_1 = FALSE
					' On analyse la chaîne contenue dans array_hex_strings_to_find.
					' Si la chaîne continue à correspondre, on teste l'octet suivant.
					if string(2 - len(hex(array_byte_buffer_1(i_byte_check))), "0") & ucase((hex(array_byte_buffer_1(i_byte_check)))) = mid(array_hex_strings_to_find(array_match_found_1(i_5)), 2 * i_byte_check + 1, 2) then
						' WScript.Echo "Étape " & i_byte_check & " - Correspondance trouvée : " & array_byte_buffer_1(i_byte_check) & " = " & mid(array_hex_strings_to_find(array_match_found_1(i_5)), 2 * i_byte_check + 1, 2)
						b_exit_while_1 = TRUE
						i_byte_check = i_byte_check + 1
					' Si la chaîne ne correspond plus, alors on retire son numéro du tableau array_match_found_1.
					' Et si le tableau est vide, alors aucune chaîne ne correspondait,
					' donc le premier octet est traité et i_byte_check est réinitialisée.
					else
						if ubound(array_match_found_1) >= 1 then
							redim array_match_found_2(ubound(array_match_found_1) - 1)
							for i = 1 to ubound(array_match_found_1)
								array_match_found_2(i - 1) = array_match_found_1(i)
							next
							redim array_match_found_1(ubound(array_match_found_2))
							for i = 0 to ubound(array_match_found_2)
								array_match_found_1(i) = array_match_found_2(i)
							next
						else
							redim array_match_found_1(-1)
							i_byte_check = 0
							file_output.Write(chr(array_byte_buffer_1(i_byte_check)))
							if ubound(array_byte_buffer_1) >= 1 then
								redim array_byte_buffer_2(ubound(array_byte_buffer_1) - 1)
								for i = 1 to ubound(array_byte_buffer_1)
									array_byte_buffer_2(i - 1) = array_byte_buffer_1(i)
								next
								redim array_byte_buffer_1(ubound(array_byte_buffer_2))
								for i = 0 to ubound(array_byte_buffer_2)
									array_byte_buffer_1(i) = array_byte_buffer_2(i)
								next
							else
								redim array_byte_buffer_1(-1)
							end if
						end if
					end if
					if i_byte_check > 0 then
						' Si la correspondance va jusqu'au bout de la chaîne, alors la chaîne a été détectée.
						if i_byte_check = len(array_hex_strings_to_find(array_match_found_1(i_5))) / 2 then
							' Dans ce cas on écrit la nouvelle chaîne et on vide le buffer.
							for i = 0 to len(array_hex_strings_to_replace(array_match_found_1(i_5))) - 1 step 2
								file_output.Write(chr(cbyte("&H" & Mid(array_hex_strings_to_replace(array_match_found_1(i_5)), i + 1, 2))))
							next
							' WScript.Echo vbCrLf & "Contenu de la chaîne n°" & array_match_found_1(i_5) + 1 & " (" & len(array_hex_strings_to_find(array_match_found_1(i_5))) / 2 & " cases) : " & array_hex_strings_to_find(array_match_found_1(i_5)) & vbCrLf & "Contenu du buffer (" & ubound(array_byte_buffer_1) + 1 & " cases) : " & join(array_byte_buffer_1, " ")
							' On vide le buffer de la chaîne à rechercher.
							if ubound(array_byte_buffer_1) >= len(array_hex_strings_to_find(array_match_found_1(i_5))) / 2 then
								redim array_byte_buffer_2(ubound(array_byte_buffer_1) - (len(array_hex_strings_to_find(array_match_found_1(i_5))) / 2))
								for i = len(array_hex_strings_to_find(array_match_found_1(i_5))) / 2 to ubound(array_byte_buffer_1) step 1
									array_byte_buffer_2(i - len(array_hex_strings_to_find(array_match_found_1(i_5))) / 2) = array_byte_buffer_1(i)
								next
								redim array_byte_buffer_1(ubound(array_byte_buffer_2))
								for i = 0 to ubound(array_byte_buffer_2)
									array_byte_buffer_1(i) = array_byte_buffer_2(i)
								next
								' WScript.Echo "Contenu restant du buffer = : " & join(array_byte_buffer_1, " ")
							else
								redim array_byte_buffer_1(-1)
							end if
							i_byte_check = 0
							i_replacement_count = i_replacement_count + 1
							' WScript.Echo vbCrLf & "Fichier :" & vbCrLf & file_fullname & vbCrLf & "Séquence n°" & array_match_found_1(i_5) + 1 & " trouvée :" & vbCrLf & array_hex_strings_to_find(array_match_found_1(i_5)) & vbCrLf & "Remplacée par :" & vbCrLf & array_hex_strings_to_replace(array_match_found_1(i_5)) & vbCrLf
						end if
					end if
				wend
		end select
	loop

        file_input.Close
        file_output.Close
	i_my_replace_array_hex_strings_in_file = i_replacement_count
end function

Function i_my_rename_file(byval file_fullname, byval file_fullname_new)
	if object_file_system.FileExists(file_fullname) = FALSE then
		MsgBox "Erreur, le fichier :" & vbCrLf & file_fullname & vbCrLf & "n'existe pas, impossible de le renommer en :" & vbCrLf & file_fullname_new, 48, "Erreur"
		WScript.Quit(0)
	end if

	' WScript.Echo "Le fichier :" & vbCrLf & file_fullname & vbCrLf & "a été renommé en :" & vbCrLf & file_fullname_new & vbCrLf
	object_file_system.MoveFile file_fullname, file_fullname_new

	if object_file_system.FileExists(file_fullname_new) = FALSE then
		MsgBox "Erreur, le fichier :" & vbCrLf & file_fullname & vbCrLf & "n'a pas pu être renommé.", 48, "Erreur"
		WScript.Quit(0)
	end if

	i_my_rename_file = 0
end function

function i_my_fix_corrupted_file(byval corrupted_file_error_ori, byval corrupted_file_error_fix, byval corrupted_file)
	i_installation_type = 0
	if program_folder <> "" then
		if object_file_system.FileExists(program_folder & "\" & corrupted_file) = FALSE then
			MsgBox "Erreur, fichier non détecté :" & vbCrLf & program_folder & "\" & corrupted_file, 48, "Erreur"
			WScript.Quit(0)
		end if
		i_installation_type = 1
		WScript.Echo "Fichier détecté :" & vbCrLf & program_folder & "\" & corrupted_file & vbCrLf
	end if
	if object_file_system.FileExists(program_folder_portable_32 & "\" & corrupted_file) = TRUE then
		i_installation_type = 2
		WScript.Echo "Fichier détecté :" & vbCrLf & program_folder_portable_32 & "\" & corrupted_file & vbCrLf
	end if
	if object_file_system.FileExists(program_folder_portable_64 & "\" & corrupted_file) = TRUE then
		i_installation_type = i_installation_type + 3
		WScript.Echo "Fichier détecté :" & vbCrLf & program_folder_portable_64 & "\" & corrupted_file & vbCrLf
	end if
	if object_file_system.FileExists(program_folder_installed_32 & "\" & corrupted_file) = TRUE then
		i_installation_type = 6
		WScript.Echo "Fichier détecté :" & vbCrLf & program_folder_installed_32 & "\" & corrupted_file & vbCrLf
	end if
	if object_file_system.FileExists(program_folder_installed_64 & "\" & corrupted_file) = TRUE then
		i_installation_type = 7
		WScript.Echo "Fichier détecté :" & vbCrLf & program_folder_installed_64 & "\" & corrupted_file & vbCrLf
	end if

	if i_installation_type = 0 then
		MsgBox "Erreur, aucun fichier détecté.", 48, "Erreur"
		WScript.Quit(0)
	end if
	if i_installation_type = 1 then
		if object_file_system.FileExists(program_folder & "\" & corrupted_file & ".bak") = TRUE then
			user_response = MsgBox("Attention, le fichier de sauvegarde :" & vbCrLf & program_folder & "\" & corrupted_file & ".bak" & vbCrLf _
			& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
			& "appuyez sur ""Oui"" pour supprimer le fichier "".bak"" et continuer," & vbCrLf & "sinon appuyez sur ""Non"" pour quitter." & vbCrLf _
			& "Voulez-vous continuer ?", 292, "Question")	' 4 = vbYesNo	32 = vbQuestion	256 = vbDefaultButton2	0 = vbApplicationModal
			if user_response <> "6" then
				WScript.Quit(0)
			end if
			object_file_system.DeleteFile program_folder & "\" & corrupted_file & ".bak", TRUE
			WScript.Echo "Le fichier :" & vbCrLf & program_folder & "\" & corrupted_file & ".bak" & vbCrLf & "a été supprimé."
		end if
		number_of_replacements = i_my_replace_array_hex_strings_in_file(corrupted_file_error_ori, corrupted_file_error_fix, program_folder & "\" & corrupted_file)
		WScript.Echo vbCrLf & vbCrLf & number_of_replacements & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & program_folder & "\" & corrupted_file & vbCrLf
		i_my_rename_file program_folder & "\" & corrupted_file,                program_folder & "\" & corrupted_file & ".bak"
		i_my_rename_file program_folder & "\" & corrupted_file & ".temporary", program_folder & "\" & corrupted_file
	end if
	if i_installation_type = 2 OR i_installation_type = 5 then
		if object_file_system.FileExists(program_folder_portable_32 & "\" & corrupted_file & ".bak") = TRUE then
			user_response = MsgBox("Attention, le fichier de sauvegarde :" & vbCrLf & program_folder_portable_32 & "\" & corrupted_file & ".bak" & vbCrLf _
			& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
			& "appuyez sur ""Oui"" pour supprimer le fichier "".bak"" et continuer," & vbCrLf & "sinon appuyez sur ""Non"" pour quitter." & vbCrLf _
			& "Voulez-vous continuer ?", 292, "Question")
			if user_response <> "6" then
				WScript.Quit(0)
			end if
			object_file_system.DeleteFile program_folder_portable_32 & "\" & corrupted_file & ".bak", TRUE
			WScript.Echo "Le fichier :" & vbCrLf & program_folder_portable_32 & "\" & corrupted_file & ".bak" & vbCrLf & "a été supprimé."
		end if
		number_of_replacements = i_my_replace_array_hex_strings_in_file(corrupted_file_error_ori, corrupted_file_error_fix, program_folder_portable_32 & "\" & corrupted_file)
		WScript.Echo vbCrLf & vbCrLf & number_of_replacements & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & program_folder_portable_32 & "\" & corrupted_file & vbCrLf
		i_my_rename_file program_folder_portable_32 & "\" & corrupted_file,                program_folder_portable_32 & "\" & corrupted_file & ".bak"
		i_my_rename_file program_folder_portable_32 & "\" & corrupted_file & ".temporary", program_folder_portable_32 & "\" & corrupted_file
	end if
	if i_installation_type = 3 OR i_installation_type = 5 then
		if object_file_system.FileExists(program_folder_portable_64 & "\" & corrupted_file_1 & ".bak") = TRUE then
			user_response = MsgBox("Attention, le fichier de sauvegarde :" & vbCrLf & program_folder_portable_64 & "\" & corrupted_file & ".bak" & vbCrLf _
			& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
			& "appuyez sur ""Oui"" pour supprimer le fichier "".bak"" et continuer," & vbCrLf & "sinon appuyez sur ""Non"" pour quitter." & vbCrLf _
			& "Voulez-vous continuer ?", 292, "Question")
			if user_response <> "6" then
				WScript.Quit(0)
			end if
			object_file_system.DeleteFile program_folder_portable_64 & "\" & corrupted_file & ".bak", TRUE
			WScript.Echo "Le fichier :" & vbCrLf & program_folder_portable_64 & "\" & corrupted_file & ".bak" & vbCrLf & "a été supprimé."
		end if
		number_of_replacements = i_my_replace_array_hex_strings_in_file(corrupted_file_error_ori, corrupted_file_error_fix, program_folder_portable_64 & "\" & corrupted_file)
		WScript.Echo vbCrLf & vbCrLf & number_of_replacements & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & program_folder_portable_64 & "\" & corrupted_file & vbCrLf
		i_my_rename_file program_folder_portable_64 & "\" & corrupted_file,                program_folder_portable_64 & "\" & corrupted_file & ".bak"
		i_my_rename_file program_folder_portable_64 & "\" & corrupted_file & ".temporary", program_folder_portable_64 & "\" & corrupted_file
	end if
	if i_installation_type = 6 then
		if object_file_system.FileExists(program_folder_installed_32 & "\" & corrupted_file_1 & ".bak") = TRUE then
			user_response = MsgBox("Attention, le fichier de sauvegarde :" & vbCrLf & program_folder_installed_32 & "\" & corrupted_file & ".bak" & vbCrLf _
			& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
			& "appuyez sur ""Oui"" pour supprimer le fichier "".bak"" et continuer," & vbCrLf & "sinon appuyez sur ""Non"" pour quitter." & vbCrLf _
			& "Voulez-vous continuer ?", 292, "Question")
			if user_response <> "6" then
				WScript.Quit(0)
			end if
			object_file_system.DeleteFile program_folder_installed_32 & "\" & corrupted_file & ".bak", TRUE
			WScript.Echo "Le fichier :" & vbCrLf & program_folder_installed_32 & "\" & corrupted_file & ".bak" & vbCrLf & "a été supprimé."
		end if
		number_of_replacements = i_my_replace_array_hex_strings_in_file(corrupted_file_error_ori, corrupted_file_error_fix, program_folder_installed_32 & "\" & corrupted_file)
		WScript.Echo vbCrLf & vbCrLf & number_of_replacements & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & program_folder_installed_32 & "\" & corrupted_file & vbCrLf
		i_my_rename_file program_folder_installed_32 & "\" & corrupted_file,                program_folder_installed_32 & "\" & corrupted_file & ".bak"
		i_my_rename_file program_folder_installed_32 & "\" & corrupted_file & ".temporary", program_folder_installed_32 & "\" & corrupted_file
	end if
	if i_installation_type = 7 then
		if object_file_system.FileExists(program_folder_installed_64 & "\" & corrupted_file_1 & ".bak") = TRUE then
			user_response = MsgBox("Attention, le fichier de sauvegarde :" & vbCrLf & program_folder_installed_64 & "\" & corrupted_file & ".bak" & vbCrLf _
			& "existe déjà. Si vous avez déjà utilisé ce script mais que" & vbCrLf & "l'écriture inclusive est revenue à la suite d'une mise à jour," & vbCrLf _
			& "appuyez sur ""Oui"" pour supprimer le fichier "".bak"" et continuer," & vbCrLf & "sinon appuyez sur ""Non"" pour quitter." & vbCrLf _
			& "Voulez-vous continuer ?", 292, "Question")
			if user_response <> "6" then
				WScript.Quit(0)
			end if
			object_file_system.DeleteFile program_folder_installed_64 & "\" & corrupted_file & ".bak", TRUE
			WScript.Echo "Le fichier :" & vbCrLf & program_folder_installed_64 & "\" & corrupted_file & ".bak" & vbCrLf & "a été supprimé."
		end if
		number_of_replacements = i_my_replace_array_hex_strings_in_file(corrupted_file_error_ori, corrupted_file_error_fix, program_folder_installed_64 & "\" & corrupted_file)
		WScript.Echo vbCrLf & vbCrLf & number_of_replacements & " remplacement(s) effectué(s) sur le fichier :" & vbCrLf & program_folder_installed_64 & "\" & corrupted_file & vbCrLf
		i_my_rename_file program_folder_installed_64 & "\" & corrupted_file,                program_folder_installed_64 & "\" & corrupted_file & ".bak"
		i_my_rename_file program_folder_installed_64 & "\" & corrupted_file & ".temporary", program_folder_installed_64 & "\" & corrupted_file
	end if
	i_my_fix_corrupted_file = number_of_replacements
end function



' _____________________________________________________________________________
' Partie à modifier pour ajouter des fichiers à corriger :



' Lancement du script :
number_of_replacements = i_my_fix_corrupted_file(corrupted_file_1_error_ori, corrupted_file_1_error_fix, corrupted_file_1)



' _____________________________________________________________________________
' Partie à ne pas modifier :



pause_message = "L'exécution de ce programme est terminée."
MsgBox pause_message & vbCrLf & vbCrLf & "Appuyez sur une touche pour continuer...", 64, "Pause"		' 0 = vbOKOnly vbDefaultButton1 vbApplicationModal	64 = vbInformation
WScript.Quit(0)

Firefox en Powershell

# Character encoding = UTF-16 LE (Byte Order Mark = FF FE)
# End-of-line = Windows (CR LF)

# Composants requis :
$current_folder = $PWD.Path



# _____________________________________________________________________________
# Partie à modifier pour ajouter des fichiers et erreurs à corriger :



# Emplacement personnalisé du dossier contenant le fichier "firefox.exe".
# Vous pouvez le laisser vide. Exemple :
# $program_folder = "$current_folder\Mozilla Firefox"
$program_folder = ""



# Emplacements connus :
$program_folder_portable_32  = "$current_folder\App\Firefox"
$program_folder_portable_64  = "$current_folder\App\Firefox64"
$program_folder_installed_32 = "${env:ProgramFiles(x86)}\Mozilla Firefox"
$program_folder_installed_64 = "${$env:ProgramFiles}\Mozilla Firefox"



# Fichier(s) à réparer :
$corrupted_file_1 = "omni.ja"
$corrupted_file_2 = "browser\omni.ja"



# Réparations à faire :

$corrupted_file_1_error_ori = @()
$corrupted_file_1_error_fix = @()

# utilisateur·trice => utilisateur
$corrupted_file_1_error_ori += "C2B774726963650A"	# ·trice
$corrupted_file_1_error_fix += "0A0A0A0A0A0A0A0A"	# 

$corrupted_file_2_error_ori = @()
$corrupted_file_2_error_fix = @()

# administrateur·trice a désactivé la synchronisation. => administrateur a désactivé la synchronisation.
$corrupted_file_2_error_ori += "C2B7747269636520612064C3A9736163746976C3A9206C612073796E6368726F6E69736174696F6E2E0A"	# ·trice a désactivé la synchronisation.
$corrupted_file_2_error_fix += "20612064C3A9736163746976C3A9206C612073796E6368726F6E69736174696F6E2E0A0A0A0A0A0A0A0A"	#  a désactivé la synchronisation.

# connecté·e. => connecté.
$corrupted_file_2_error_ori += "C3A9C2B7652E0A"	# é·e.
$corrupted_file_2_error_fix += "C3A92E0A0A0A0A"	# é.

# connecté·e avec succès => connecté avec succès
$corrupted_file_2_error_ori += "C2B76520617665632073756363C3A8730A"	# ·e avec succès
$corrupted_file_2_error_fix += "20617665632073756363C3A8730A0A0A0A"	#  avec succès

# suivi·e => suivi
$corrupted_file_2_error_ori += "7669C2B7650A"	# vi·e
$corrupted_file_2_error_fix += "76690A0A0A0A"	# vi

# Prêt·e à scanner</strong> et maintenez votre appareil au-dessus de ce code => Prêt à scanner</strong> et maintenez votre appareil au-dessus de ce code
$corrupted_file_2_error_ori += "C2B76520C3A0207363616E6E65723C2F7374726F6E673E206574206D61696E74656E657A20766F74726520617070617265696C2061752D64657373757320646520636520636F64650A"	# ·e à scanner</strong> et maintenez votre appareil au-dessus de ce code
$corrupted_file_2_error_fix += "20C3A0207363616E6E65723C2F7374726F6E673E206574206D61696E74656E657A20766F74726520617070617265696C2061752D64657373757320646520636520636F64650A0A0A0A"	#  à scanner</strong> et maintenez votre appareil au-dessus de ce code

# pisté·e => pisté
$corrupted_file_2_error_ori += "C3A9C2B7650A"	# é·e
$corrupted_file_2_error_fix += "C3A90A0A0A0A"	# é

# véritables client·e·s qui ont laissé des avis sincères et objectifs.
$corrupted_file_2_error_ori += "C2B765C2B77320717569206F6E74206C61697373C3A92064657320617669732073696E63C3A8726573206574206F626A6563746966732E0A"	# ·e·s qui ont laissé des avis sincères et objectifs.
$corrupted_file_2_error_fix += "7320717569206F6E74206C61697373C3A92064657320617669732073696E63C3A8726573206574206F626A6563746966732E0A0A0A0A0A0A"	# s qui ont laissé des avis sincères et objectifs.



# _____________________________________________________________________________
# Partie à ne pas modifier :



function i_my_replace_array_hex_strings_in_file([string[]]$array_hex_strings_to_find, [string[]]$array_hex_strings_to_replace, [string]$file_fullname)
{
	if ($array_hex_strings_to_find.GetUpperBound(0) -ne $array_hex_strings_to_replace.GetUpperBound(0))
	{
		Write-Host "Erreur :`r`nLe nombre de cases dans le tableau des chaînes hexadécimales à détecter ($($array_hex_strings_to_find.GetUpperBound(0) + 1))`r`net dans le tableau des chaînes hexadécimales à remplacer ($($array_hex_strings_to_replace.GetUpperBound(0) + 1))`r`nn'est pas identique."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		if ($Host.UI.RawUI.KeyAvailable -eq $true)			# Si le buffer n'est pas vide, au cas où une touche aurait déjà été pressée.
		{
			while ($Host.UI.RawUI.KeyAvailable -eq $true)		# Vide le buffer et met en pause.
			{
				$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
			}
		}
		else
		{
			$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")	# Met en pause.
		}
		exit 0
	}
	for ($i = 0; $i -le $array_hex_strings_to_find.GetUpperBound(0); $i++)
	{
		if ($array_hex_strings_to_find[$i].Length -ne $array_hex_strings_to_replace[$i].Length)
		{
			Write-Host "Erreur :`r`nLa variable $($array_hex_strings_to_find[$i]) et`r`nla variable $($array_hex_strings_to_replace[$i])"
			Write-Host "n'ont pas le même nombre de caractères ($($array_hex_strings_to_find[$i].Length) contre $($array_hex_strings_to_replace[$i].Length))."
			Write-Host "`r`nAppuyez sur une touche pour continuer..."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			else
			{
				$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
			}
			exit 0
		}
		if ($array_hex_strings_to_find[$i].Length % 2 -ne 0)
		{
			Write-Host "Erreur, les variables :`r`n$($array_hex_strings_to_find[$i]) et`r`n$($array_hex_strings_to_replace[$i])`r`nont un nombre impair de caractères."
			Write-Host "`r`nAppuyez sur une touche pour continuer..."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			else
			{
				$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
			}
			exit 0
		}
		if ($array_hex_strings_to_find[$i].Length -lt 12)
		{
			Write-Host "Erreur, les variables :`r`n$($array_hex_strings_to_find[$i]) et`r`n$($array_hex_strings_to_replace[$i])"
			Write-Host "doivent avoir au moins 12 caractères hexadécimaux pour représenter"
			Write-Host "au moins 6 octets. Or ici, elles n'en contiennent que $($array_hex_strings_to_find[$i].Length)."
			Write-Host "`r`nAppuyez sur une touche pour continuer..."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			else
			{
				$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
			}
			exit 0
		}
	}

	Out-File -FilePath "$file_fullname.temporary" -Force -Encoding ASCII		# (Force = Écraser si existe déjà) (Encoding ASCII = Utiliser ASCII au lieu d'Unicode UTF16LE donc pas de Byte Order Mark FFFE)
	if ((Test-Path "$file_fullname.temporary") -eq $false)
	{
		Write-Host "Erreur, le fichier :`r`n$file_fullname.temporary"
		Write-Host "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement`r`ndes privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		if ($Host.UI.RawUI.KeyAvailable -eq $true)
		{
			while ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
			}
		}
		else
		{
			$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		}
		exit 0
        }

	# Pour aller plus vite, on crée 5 tableaux en 2 dimensions.
	# Nous sommes obligés de créer chaque dimension indépendamment car
	# il est impossible de redimensionner dynamiquement les 2 dimensions.
	# Concernant la 1ère dimension :
	# Le 1er tableau contiendra les premiers octets de toutes les chaînes
	# à rechercher, convertis en décimal et en éliminant les doublons.
	# Le 2ème tableau contiendra les deuxièmes octets, etc.
	# Le 3ème tableau contiendra les troisièmes octets, etc.
	$array_bytes_to_find_1 = @()
	$array_bytes_to_find_2 = @()
	$array_bytes_to_find_3 = @()
	$array_bytes_to_find_4 = @()
	$array_bytes_to_find_5 = @()
	for ($i_1 = 0; $i_1 -le $array_hex_strings_to_find.GetUpperBound(0); $i_1++)
	{
		$b_already_exists = $false
		for ($i_2 = 0; $i_2 -le $array_bytes_to_find_1.GetUpperBound(0); $i_2++)
		{
			if ([Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(0, 2), 16) -eq $array_bytes_to_find_1[$i_2])
			{
				$b_already_exists = $true
			}
		}
		if ($b_already_exists -eq $false)
		{
			$array_bytes_to_find_1 += [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(0, 2), 16)
		}
		$b_already_exists = $false
		for ($i_2 = 0; $i_2 -le $array_bytes_to_find_2.GetUpperBound(0); $i_2++)
		{
			if ([Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(2, 2), 16) -eq $array_bytes_to_find_2[$i_2])
			{
				$b_already_exists = $true
			}
		}
		if ($b_already_exists -eq $false)
		{
			$array_bytes_to_find_2 += [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(2, 2), 16)
		}
		$b_already_exists = $false
		for ($i_2 = 0; $i_2 -le $array_bytes_to_find_3.GetUpperBound(0); $i_2++)
		{
			if ([Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(4, 2), 16) -eq $array_bytes_to_find_3[$i_2])
			{
				$b_already_exists = $true
			}
		}
		if ($b_already_exists -eq $false)
		{
			$array_bytes_to_find_3 += [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(4, 2), 16)
		}
		$b_already_exists = $false
		for ($i_2 = 0; $i_2 -le $array_bytes_to_find_4.GetUpperBound(0); $i_2++)
		{
			if ([Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(6, 2), 16) -eq $array_bytes_to_find_4[$i_2])
			{
				$b_already_exists = $true
			}
		}
		if ($b_already_exists -eq $false)
		{
			$array_bytes_to_find_4 += [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(6, 2), 16)
		}
		$b_already_exists = $false
		for ($i_2 = 0; $i_2 -le $array_bytes_to_find_5.GetUpperBound(0); $i_2++)
		{
			if ([Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(8, 2), 16) -eq $array_bytes_to_find_5[$i_2])
			{
				$b_already_exists = $true
			}
		}
		if ($b_already_exists -eq $false)
		{
			$array_bytes_to_find_5 += [Convert]::ToInt32($array_hex_strings_to_find[$i_1].Substring(8, 2), 16)
		}
	}
	# Concernant la 2ème dimension :
	# Pour chaque tableau, elle contiendra les numéros des chaînes
	# auxquelles les octets correspondent (en commençant par 0).
	# Imaginons que la 1ère case du 1er tableau contient l'octet C2 = 194
	# et que plusieurs chaînes commencent par C2 (doublons), par exemple
	# les chaînes 1 2 4 5 6, alors les chiffres 0 1 3 4 5 seront inscrits
	# dans la 2ème dimension de la 1ère case du 1er tableau.
	$array_bytes_to_find_1_2D = New-Object 'object[,]' ($array_bytes_to_find_1.GetUpperBound(0) + 1), 1
	$array_bytes_to_find_2_2D = New-Object 'object[,]' ($array_bytes_to_find_2.GetUpperBound(0) + 1), 1
	$array_bytes_to_find_3_2D = New-Object 'object[,]' ($array_bytes_to_find_3.GetUpperBound(0) + 1), 1
	$array_bytes_to_find_4_2D = New-Object 'object[,]' ($array_bytes_to_find_4.GetUpperBound(0) + 1), 1
	$array_bytes_to_find_5_2D = New-Object 'object[,]' ($array_bytes_to_find_5.GetUpperBound(0) + 1), 1
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_1_2D.GetUpperBound(0); $i_1++)
	{
		$array_bytes_to_find_1_2D[$i_1, 0] = $array_bytes_to_find_1[$i_1]
		$i_2 = 1
		for ($i_3 = 0; $i_3 -le $array_hex_strings_to_find.GetUpperBound(0); $i_3++)
		{
			if ([int]::Parse($array_hex_strings_to_find[$i_3].Substring(0, 2), [System.Globalization.NumberStyles]::HexNumber) -eq $array_bytes_to_find_1_2D[$i_1, 0])
			{
				if ($array_bytes_to_find_1_2D.GetUpperBound(1) -lt $i_2)
				{
					# En PowerShell il n'existe pas d'équivalent à la commande
					# ReDim Preserve array_bytes_to_find_1_2D(ubound,ubound+1)
					# du VBScript pour redimensionner la 2ème dimension du tableau.
					# La notation "+=" ajoute un élément à la fin d'un tableau,
					# mais seulement s'il est en 1 dimension, pas en 2 dimensions.
					# Il faut donc créer un autre tableau $array_subarray_2D
					# avec une case supplémentaire puis recopier le tableau dedans
					# en utilisant une boucle for.
					$array_subarray_2D = New-Object 'object[,]' ($array_bytes_to_find_1_2D.GetUpperBound(0) + 1), ($array_bytes_to_find_1_2D.GetUpperBound(1) + 2)
					for ($i = 0; $i -le $array_bytes_to_find_1_2D.GetUpperBound(0); $i++)
					{
						for ($j = 0; $j -le $array_bytes_to_find_1_2D.GetUpperBound(1); $j++)
						{
							$array_subarray_2D[$i, $j] = $array_bytes_to_find_1_2D[$i, $j]
						}
					}
					$array_bytes_to_find_1_2D = $array_subarray_2D
					Remove-Variable -Name array_subarray_2D
				}
				$array_bytes_to_find_1_2D[$i_1, $i_2] = $i_3
				$i_2++
			}
		}
	}
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_2_2D.GetUpperBound(0); $i_1++)
	{
		$array_bytes_to_find_2_2D[$i_1, 0] = $array_bytes_to_find_2[$i_1]
		$i_2 = 1
		for ($i_3 = 0; $i_3 -le $array_hex_strings_to_find.GetUpperBound(0); $i_3++)
		{
			if ([int]::Parse($array_hex_strings_to_find[$i_3].Substring(2, 2), [System.Globalization.NumberStyles]::HexNumber) -eq $array_bytes_to_find_2_2D[$i_1, 0])
			{
				if ($array_bytes_to_find_2_2D.GetUpperBound(1) -lt $i_2)
				{
					$array_subarray_2D = New-Object 'object[,]' ($array_bytes_to_find_2_2D.GetUpperBound(0) + 1), ($array_bytes_to_find_2_2D.GetUpperBound(1) + 2)
					for ($i = 0; $i -le $array_bytes_to_find_2_2D.GetUpperBound(0); $i++)
					{
						for ($j = 0; $j -le $array_bytes_to_find_2_2D.GetUpperBound(1); $j++)
						{
							$array_subarray_2D[$i, $j] = $array_bytes_to_find_2_2D[$i, $j]
						}
					}
					$array_bytes_to_find_2_2D = $array_subarray_2D
					Remove-Variable -Name array_subarray_2D
				}
				$array_bytes_to_find_2_2D[$i_1, $i_2] = $i_3
				$i_2++
			}
		}
	}
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_3_2D.GetUpperBound(0); $i_1++)
	{
		$array_bytes_to_find_3_2D[$i_1, 0] = $array_bytes_to_find_3[$i_1]
		$i_2 = 1
		for ($i_3 = 0; $i_3 -le $array_hex_strings_to_find.GetUpperBound(0); $i_3++)
		{
			if ([int]::Parse($array_hex_strings_to_find[$i_3].Substring(4, 2), [System.Globalization.NumberStyles]::HexNumber) -eq $array_bytes_to_find_3_2D[$i_1, 0])
			{
				if ($array_bytes_to_find_3_2D.GetUpperBound(1) -lt $i_2)
				{
					$array_subarray_2D = New-Object 'object[,]' ($array_bytes_to_find_3_2D.GetUpperBound(0) + 1), ($array_bytes_to_find_3_2D.GetUpperBound(1) + 2)
					for ($i = 0; $i -le $array_bytes_to_find_3_2D.GetUpperBound(0); $i++)
					{
						for ($j = 0; $j -le $array_bytes_to_find_3_2D.GetUpperBound(1); $j++)
						{
							$array_subarray_2D[$i, $j] = $array_bytes_to_find_3_2D[$i, $j]
						}
					}
					$array_bytes_to_find_3_2D = $array_subarray_2D
					Remove-Variable -Name array_subarray_2D
				}
				$array_bytes_to_find_3_2D[$i_1, $i_2] = $i_3
				$i_2++
			}
		}
	}
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_4_2D.GetUpperBound(0); $i_1++)
	{
		$array_bytes_to_find_4_2D[$i_1, 0] = $array_bytes_to_find_4[$i_1]
		$i_2 = 1
		for ($i_3 = 0; $i_3 -le $array_hex_strings_to_find.GetUpperBound(0); $i_3++)
		{
			if ([int]::Parse($array_hex_strings_to_find[$i_3].Substring(6, 2), [System.Globalization.NumberStyles]::HexNumber) -eq $array_bytes_to_find_4_2D[$i_1, 0])
			{
				if ($array_bytes_to_find_4_2D.GetUpperBound(1) -lt $i_2)
				{
					$array_subarray_2D = New-Object 'object[,]' ($array_bytes_to_find_4_2D.GetUpperBound(0) + 1), ($array_bytes_to_find_4_2D.GetUpperBound(1) + 2)
					for ($i = 0; $i -le $array_bytes_to_find_4_2D.GetUpperBound(0); $i++)
					{
						for ($j = 0; $j -le $array_bytes_to_find_4_2D.GetUpperBound(1); $j++)
						{
							$array_subarray_2D[$i, $j] = $array_bytes_to_find_4_2D[$i, $j]
						}
					}
					$array_bytes_to_find_4_2D = $array_subarray_2D
					Remove-Variable -Name array_subarray_2D
				}
				$array_bytes_to_find_4_2D[$i_1, $i_2] = $i_3
				$i_2++
			}
		}
	}
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_5_2D.GetUpperBound(0); $i_1++)
	{
		$array_bytes_to_find_5_2D[$i_1, 0] = $array_bytes_to_find_5[$i_1]
		$i_2 = 1
		for ($i_3 = 0; $i_3 -le $array_hex_strings_to_find.GetUpperBound(0); $i_3++)
		{
			if ([int]::Parse($array_hex_strings_to_find[$i_3].Substring(8, 2), [System.Globalization.NumberStyles]::HexNumber) -eq $array_bytes_to_find_5_2D[$i_1, 0])
			{
				if ($array_bytes_to_find_5_2D.GetUpperBound(1) -lt $i_2)
				{
					$array_subarray_2D = New-Object 'object[,]' ($array_bytes_to_find_5_2D.GetUpperBound(0) + 1), ($array_bytes_to_find_5_2D.GetUpperBound(1) + 2)
					for ($i = 0; $i -le $array_bytes_to_find_5_2D.GetUpperBound(0); $i++)
					{
						for ($j = 0; $j -le $array_bytes_to_find_5_2D.GetUpperBound(1); $j++)
						{
							$array_subarray_2D[$i, $j] = $array_bytes_to_find_5_2D[$i, $j]
						}
					}
					$array_bytes_to_find_5_2D = $array_subarray_2D
					Remove-Variable -Name array_subarray_2D
				}
				$array_bytes_to_find_5_2D[$i_1, $i_2] = $i_3
				$i_2++
			}
		}
	}
	<#
	Write-Host "1ers  octets à rechercher => Dans les chaînes : "
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_1_2D.GetUpperBound(0); $i_1++)
	{
		Write-Host -NoNewline "$($array_bytes_to_find_1_2D[$i_1, 0])	=> "
		for ($i_2 = 1; $i_2 -le ($array_bytes_to_find_1_2D.GetUpperBound(1)); $i_2++)
		{
			Write-Host -NoNewline "$($array_bytes_to_find_1_2D[$i_1, $i_2])"
			if ($i_2 + 1 -le $array_bytes_to_find_1_2D.GetUpperBound(1))
			{
				if ($array_bytes_to_find_1_2D[$i_1, $($i_2 + 1)] -ne $null)
				{
					Write-Host -NoNewline " "
				}
			}
		}
		Write-Host
	}
	Write-Host "2èmes octets à rechercher => Dans les chaînes : "
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_2_2D.GetUpperBound(0); $i_1++)
	{
		Write-Host -NoNewline "$($array_bytes_to_find_2_2D[$i_1, 0])	=> "
		for ($i_2 = 1; $i_2 -le ($array_bytes_to_find_2_2D.GetUpperBound(1)); $i_2++)
		{
			Write-Host -NoNewline "$($array_bytes_to_find_2_2D[$i_1, $i_2])"
			if ($i_2 + 1 -le $array_bytes_to_find_2_2D.GetUpperBound(1))
			{
				if ($array_bytes_to_find_2_2D[$i_1, $($i_2 + 1)] -ne $null)
				{
					Write-Host -NoNewline " "
				}
			}
		}
		Write-Host
	}
	Write-Host "3èmes octets à rechercher => Dans les chaînes : "
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_3_2D.GetUpperBound(0); $i_1++)
	{
		Write-Host -NoNewline "$($array_bytes_to_find_3_2D[$i_1, 0])	=> "
		for ($i_2 = 1; $i_2 -le ($array_bytes_to_find_3_2D.GetUpperBound(1)); $i_2++)
		{
			Write-Host -NoNewline "$($array_bytes_to_find_3_2D[$i_1, $i_2])"
			if ($i_2 + 1 -le $array_bytes_to_find_3_2D.GetUpperBound(1))
			{
				if ($array_bytes_to_find_3_2D[$i_1, $($i_2 + 1)] -ne $null)
				{
					Write-Host -NoNewline " "
				}
			}
		}
		Write-Host
	}
	Write-Host "4èmes octets à rechercher => Dans les chaînes : "
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_4_2D.GetUpperBound(0); $i_1++)
	{
		Write-Host -NoNewline "$($array_bytes_to_find_4_2D[$i_1, 0])	=> "
		for ($i_2 = 1; $i_2 -le ($array_bytes_to_find_4_2D.GetUpperBound(1)); $i_2++)
		{
			Write-Host -NoNewline "$($array_bytes_to_find_4_2D[$i_1, $i_2])"
			if ($i_2 + 1 -le $array_bytes_to_find_4_2D.GetUpperBound(1))
			{
				if ($array_bytes_to_find_4_2D[$i_1, $($i_2 + 1)] -ne $null)
				{
					Write-Host -NoNewline " "
				}
			}
		}
		Write-Host
	}
	Write-Host "5èmes octets à rechercher => Dans les chaînes : "
	for ($i_1 = 0; $i_1 -le $array_bytes_to_find_5_2D.GetUpperBound(0); $i_1++)
	{
		Write-Host -NoNewline "$($array_bytes_to_find_5_2D[$i_1, 0])	=> "
		for ($i_2 = 1; $i_2 -le ($array_bytes_to_find_5_2D.GetUpperBound(1)); $i_2++)
		{
			Write-Host -NoNewline "$($array_bytes_to_find_5_2D[$i_1, $i_2])"
			if ($i_2 + 1 -le $array_bytes_to_find_5_2D.GetUpperBound(1))
			{
				if ($array_bytes_to_find_5_2D[$i_1, $($i_2 + 1)] -ne $null)
				{
					Write-Host -NoNewline " "
				}
			}
		}
		Write-Host
	}
	Write-Host "`r`nAppuyez sur une touche pour continuer..."
	if ($Host.UI.RawUI.KeyAvailable -eq $true)
	{
		while ($Host.UI.RawUI.KeyAvailable -eq $true)
		{
			$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
		}
	}
	else
	{
		$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
	}
	Write-Host
	#>

	Write-Host -NoNewline "`r`nAnalyse en cours... "

	$file_input  = [System.IO.File]::OpenRead($file_fullname)		# Ouverture du fichier en lecture
	$file_output = [System.IO.File]::Create("$file_fullname.temporary")	# Ouverture du fichier en écriture

	$array_bytes_to_find_1_2D_ubound = $array_bytes_to_find_1_2D.GetUpperBound(0)
	$array_bytes_to_find_2_2D_ubound = $array_bytes_to_find_2_2D.GetUpperBound(0)
	$array_bytes_to_find_3_2D_ubound = $array_bytes_to_find_3_2D.GetUpperBound(0)
	$array_bytes_to_find_4_2D_ubound = $array_bytes_to_find_4_2D.GetUpperBound(0)
	$array_bytes_to_find_5_2D_ubound = $array_bytes_to_find_5_2D.GetUpperBound(0)
	$array_byte_buffer_1 = @()
	$array_byte_buffer_2 = @()
	$array_match_found_1 = @()
	$array_match_found_2 = @()
	$byte_buffer_read    = New-Object byte[] 1
	$byte_read           = 0
	$i_byte_check        = 0
	$i_replacement_count = 0
	while ($file_input.Read($byte_buffer_read, 0, 1) -ne 0)
	{
		$byte_read = $byte_buffer_read[0]
		# Write-Host "Caractère lu (hexadécimal $($byte_read.ToString("X2")) = décimal $byte_read) : ""$([char]$byte_read)"""

		# L'octet lu est stocké dans la dernière case d'un tableau (buffer).
		$array_byte_buffer_1 += $byte_read
		# Write-Host "Contenu du buffer : $($array_byte_buffer_1 -join " ")"

		switch ($i_byte_check)
		{
			0
			{
				# On considère que le buffer peut contenir plusieurs octets en attente d'être traités,
				# c'est-à-dire écrits dans le fichier de sortie s'il n'existe aucune correspondance.
				# Chaque 1er octet traité disparaît du buffer, dont la taille se réduit.
				# Lorsque sa taille atteint 0 (GetUpperBound = -1), le buffer est vide,
				# tous les octets ont été traités.
				$b_exit_while_1 = $flase
				while ($array_byte_buffer_1.GetUpperBound(0) -ge 0 -and $b_exit_while_1 -eq $flase)
				{
					# Première boucle de vérification.
					# On compare le 1er octet ($i_byte_check = 0) du buffer
					# aux octets stockés dans les cases de la 1ère dimension du 1er tableau.
					$i_0 = 0
					while ($i_0 -le $array_bytes_to_find_1_2D_ubound -and $b_exit_while_1 -eq $flase)
					{
						# Si il correspond à une case,
						# l'écriture du fichier de sortie est suspendue ($i_byte_check ≠ 0)
						# et l'octet reste stocké dans le buffer.
						if ($array_byte_buffer_1[$i_byte_check] -eq $array_bytes_to_find_1_2D[$i_0, 0])
						{
							# Write-Host "Étape $i_byte_check - Correspondance trouvée : $($array_byte_buffer_1[$i_byte_check]) = $($array_bytes_to_find_1_2D[$i_0, 0])"
							$b_exit_while_1 = $true
							$i_byte_check++		# $i_byte_check = 1
							$i_0--
						}
						$i_0++
					}
					# Si il ne correspond pas, l'octet est traité,
					# c'est-à-dire écrit dans le fichier de sortie puis retiré du buffer.
					if ($b_exit_while_1 -eq $flase)
					{
						$file_output.WriteByte($array_byte_buffer_1[$i_byte_check])
						# Si le buffer contient plusieurs cases,
						# on les décale vers l'arrière et on le raccourcit d'une case.
						if ($array_byte_buffer_1.GetUpperBound(0) -ge 1)
						{
							$array_byte_buffer_2 = @()
							$array_byte_buffer_2 = $array_byte_buffer_1[1..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
							$array_byte_buffer_1 = $array_byte_buffer_2
						}
						else
						{
							$array_byte_buffer_1 = @()
						}
					}
				}
				break
			}
			1
			{
				# Deuxième boucle de vérification.
				# On compare le 2ème octet ($i_byte_check = 1) du buffer
				# aux octets stockés dans les cases de la 1ère dimension du 2ème tableau.
				$b_exit_while_1 = $flase
				$i_1 = 0
				while ($i_1 -le $array_bytes_to_find_2_2D_ubound -and $b_exit_while_1 -eq $flase)
				{
					# Si il correspond à une case,
					# on compare la 2ème dimension de la case du 1er tableau précédent
					# à la 2ème dimension de cette case de ce 2ème tableau et
					# on stocke les numéros communs dans un tableau : $array_match_found_1.
					if ($array_byte_buffer_1[$i_byte_check] -eq $array_bytes_to_find_2_2D[$i_1, 0])
					{
						$b_exit_while_1 = $true
						$array_match_found_1 = @()
						$i_0_2D = 1
						$b_exit_while_2 = $false
						while ($i_0_2D -le $array_bytes_to_find_1_2D.GetUpperBound(1) -and $b_exit_while_2 -eq $false)
						{
							if ($array_bytes_to_find_1_2D[$i_0, $i_0_2D] -ne $null)
							{
								$i_1_2D = 1
								$b_exit_while_3 = $false
								while ($i_1_2D -le $array_bytes_to_find_2_2D.GetUpperBound(1) -and $b_exit_while_3 -eq $false)
								{
									if ($array_bytes_to_find_2_2D[$i_1, $i_1_2D] -ne $null)
									{
										if ($array_bytes_to_find_1_2D[$i_0, $i_0_2D] -eq $array_bytes_to_find_2_2D[$i_1, $i_1_2D])
										{
											$array_match_found_1 += $array_bytes_to_find_1_2D[$i_0, $i_0_2D]
										}
										$i_1_2D++
									}
									else
									{
										$b_exit_while_3 = $true
									}
								}
								$i_0_2D++
							}
							else
							{
								$b_exit_while_2 = $true
							}
						}
						# Si le tableau n'est pas vide, il indique le ou les numéros
						# des chaînes qui commencent par ces 2 octets. Dans ce cas :
						# l'écriture du fichier de sortie reste suspendue ($i_byte_check ≠ 0)
						# et les octets restent stockés dans le buffer.
						if ($array_match_found_1.GetUpperBound(0) -ge 0)
						{
							# Write-Host "Étape $i_byte_check - Correspondance trouvée : $($array_byte_buffer_1[$i_byte_check]) = $($array_bytes_to_find_2_2D[$i_1, 0])"
							# Write-Host "Les octets du buffer ""$($array_byte_buffer_1 -join " ")"" doivent commencer la/les chaîne(s) ""$($array_match_found_1 -join " ")"""
							$i_byte_check++		# $i_byte_check = 2
						}
						# Si le tableau est vide, les 2 octets ne correspondent
						# à aucune chaîne à rechercher. C'est la même situation que
						# si le 2ème octet ne correspond à aucune case du 2ème tableau.
					}
					$i_1++
				}
				# Si il ne correspond pas, le premier octet est traité,
				# c'est-à-dire écrit dans le fichier de sortie puis retiré du buffer.
				# De plus $i_byte_check est réinitialisée donc on retourne
				# à la première boucle de vérification pour vider le buffer.
				if ($b_exit_while_1 -eq $flase -or $array_match_found_1.GetUpperBound(0) -lt 0)
				{
					$i_byte_check = 0
					$file_output.WriteByte($array_byte_buffer_1[$i_byte_check])
					# Si le buffer contient plusieurs cases,
					# on les décale vers l'arrière et on le raccourcit d'une case.
					if ($array_byte_buffer_1.GetUpperBound(0) -ge 1)
					{
						$array_byte_buffer_2 = @()
						$array_byte_buffer_2 = $array_byte_buffer_1[1..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
						$array_byte_buffer_1 = $array_byte_buffer_2
					}
					else
					{
						$array_byte_buffer_1 = @()
					}
				}
				break
			}
			2
			{
				# Troisième boucle de vérification.
				# On compare le 3ème octet ($i_byte_check = 2) du buffer
				# aux octets stockés dans les cases de la 1ère dimension du 3ème tableau.
				$b_exit_while_1 = $flase
				$i_2 = 0
				while ($i_2 -le $array_bytes_to_find_3_2D_ubound -and $b_exit_while_1 -eq $flase)
				{
					# Si il correspond à une case,
					# on compare le tableau précédent $array_match_found_1
					# à la 2ème dimension de cette case de ce 3ème tableau et
					# on stocke les numéros communs dans $array_match_found_1
					# par l'intermédiaire d'un tableau temporaire : $array_match_found_2.
					if ($array_byte_buffer_1[$i_byte_check] -eq $array_bytes_to_find_3_2D[$i_2, 0])
					{
						$b_exit_while_1 = $true
						$array_match_found_2 = @()
						$i_1_2D = 0
						$b_exit_while_2 = $false
						while ($i_1_2D -le $array_match_found_1.GetUpperBound(0) -and $b_exit_while_2 -eq $false)
						{
							if ($array_match_found_1[$i_1_2D] -ne $null)
							{
								$i_2_2D = 1
								$b_exit_while_3 = $false
								while ($i_2_2D -le $array_bytes_to_find_3_2D.GetUpperBound(1) -and $b_exit_while_3 -eq $false)
								{
									if ($array_bytes_to_find_3_2D[$i_2, $i_2_2D] -ne $null)
									{
										if ($array_match_found_1[$i_1_2D] -eq $array_bytes_to_find_3_2D[$i_2, $i_2_2D])
										{
											$array_match_found_2 += $array_match_found_1[$i_1_2D]
										}
										$i_2_2D++
									}
									else
									{
										$b_exit_while_3 = $true
									}
								}
								$i_1_2D++
							}
							else
							{
								$b_exit_while_2 = $true
							}
						}
						$array_match_found_1 = $array_match_found_2
						# Si le tableau n'est pas vide, il indique le ou les numéros
						# des chaînes qui commencent par ces 3 octets. Dans ce cas :
						# l'écriture du fichier de sortie reste suspendue ($i_byte_check ≠ 0)
						# et les octets restent stockés dans le buffer.
						if ($array_match_found_1.GetUpperBound(0) -ge 0)
						{
							Write-Host -NoNewline "*"
							# Write-Host "Étape $i_byte_check - Correspondance trouvée : $($array_byte_buffer_1[$i_byte_check]) = $($array_bytes_to_find_3_2D[$i_2, 0])"
							# Write-Host "Les octets du buffer ""$($array_byte_buffer_1 -join " ")"" doivent commencer la/les chaîne(s) ""$($array_match_found_1 -join " ")"""
							$i_byte_check++		# $i_byte_check = 3
						}
						# Si le tableau est vide, les 3 octets ne correspondent
						# à aucune chaîne à rechercher. C'est la même situation que
						# si le 3ème octet ne correspond à aucune case du 3ème tableau.
					}
					$i_2++
				}
				# Si il ne correspond pas, le premier octet est traité,
				# c'est-à-dire écrit dans le fichier de sortie puis retiré du buffer.
				# De plus $i_byte_check est réinitialisée donc on retourne
				# à la première boucle de vérification pour vider le buffer.
				if ($b_exit_while_1 -eq $flase -or $array_match_found_1.GetUpperBound(0) -lt 0)
				{
					$i_byte_check = 0
					$file_output.WriteByte($array_byte_buffer_1[$i_byte_check])
					# Si le buffer contient plusieurs cases,
					# on les décale vers l'arrière et on le raccourcit d'une case.
					if ($array_byte_buffer_1.GetUpperBound(0) -ge 1)
					{
						$array_byte_buffer_2 = @()
						$array_byte_buffer_2 = $array_byte_buffer_1[1..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
						$array_byte_buffer_1 = $array_byte_buffer_2
					}
					else
					{
						$array_byte_buffer_1 = @()
					}
				}
				break
			}
			3
			{
				$b_exit_while_1 = $flase
				$i_3 = 0
				while ($i_3 -le $array_bytes_to_find_4_2D_ubound -and $b_exit_while_1 -eq $flase)
				{
					if ($array_byte_buffer_1[$i_byte_check] -eq $array_bytes_to_find_4_2D[$i_3, 0])
					{
						$b_exit_while_1 = $true
						$array_match_found_2 = @()
						$i_2_2D = 0
						$b_exit_while_2 = $false
						while ($i_2_2D -le $array_match_found_1.GetUpperBound(0) -and $b_exit_while_2 -eq $false)
						{
							if ($array_match_found_1[$i_2_2D] -ne $null)
							{
								$i_3_2D = 1
								$b_exit_while_3 = $false
								while ($i_3_2D -le $array_bytes_to_find_4_2D.GetUpperBound(1) -and $b_exit_while_3 -eq $false)
								{
									if ($array_bytes_to_find_4_2D[$i_3, $i_3_2D] -ne $null)
									{
										if ($array_match_found_1[$i_2_2D] -eq $array_bytes_to_find_4_2D[$i_3, $i_3_2D])
										{
											$array_match_found_2 += $array_match_found_1[$i_2_2D]
										}
										$i_3_2D++
									}
									else
									{
										$b_exit_while_3 = $true
									}
								}
								$i_2_2D++
							}
							else
							{
								$b_exit_while_2 = $true
							}
						}
						$array_match_found_1 = $array_match_found_2
						if ($array_match_found_1.GetUpperBound(0) -ge 0)
						{
							Write-Host -NoNewline "*"
							# Write-Host "Étape $i_byte_check - Correspondance trouvée : $($array_byte_buffer_1[$i_byte_check]) = $($array_bytes_to_find_4_2D[$i_3, 0])"
							# Write-Host "Les octets du buffer ""$($array_byte_buffer_1 -join " ")"" doivent commencer la/les chaîne(s) ""$($array_match_found_1 -join " ")"""
							$i_byte_check++		# $i_byte_check = 4
						}
					}
					$i_3++
				}
				if ($b_exit_while_1 -eq $flase -or $array_match_found_1.GetUpperBound(0) -lt 0)
				{
					$i_byte_check = 0
					$file_output.WriteByte($array_byte_buffer_1[$i_byte_check])
					if ($array_byte_buffer_1.GetUpperBound(0) -ge 1)
					{
						$array_byte_buffer_2 = @()
						$array_byte_buffer_2 = $array_byte_buffer_1[1..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
						$array_byte_buffer_1 = $array_byte_buffer_2
					}
					else
					{
						$array_byte_buffer_1 = @()
					}
				}
				break
			}
			4
			{
				$b_exit_while_1 = $flase
				$i_4 = 0
				while ($i_4 -le $array_bytes_to_find_5_2D_ubound -and $b_exit_while_1 -eq $flase)
				{
					if ($array_byte_buffer_1[$i_byte_check] -eq $array_bytes_to_find_5_2D[$i_4, 0])
					{
						$b_exit_while_1 = $true
						$array_match_found_2 = @()
						$i_3_2D = 0
						$b_exit_while_2 = $false
						while ($i_3_2D -le $array_match_found_1.GetUpperBound(0) -and $b_exit_while_2 -eq $false)
						{
							if ($array_match_found_1[$i_3_2D] -ne $null)
							{
								$i_4_2D = 1
								$b_exit_while_3 = $false
								while ($i_4_2D -le $array_bytes_to_find_5_2D.GetUpperBound(1) -and $b_exit_while_3 -eq $false)
								{
									if ($array_bytes_to_find_5_2D[$i_4, $i_4_2D] -ne $null)
									{
										if ($array_match_found_1[$i_3_2D] -eq $array_bytes_to_find_5_2D[$i_4, $i_4_2D])
										{
											$array_match_found_2 += $array_match_found_1[$i_3_2D]
										}
										$i_4_2D++
									}
									else
									{
										$b_exit_while_3 = $true
									}
								}
								$i_3_2D++
							}
							else
							{
								$b_exit_while_2 = $true
							}
						}
						$array_match_found_1 = $array_match_found_2
						if ($array_match_found_1.GetUpperBound(0) -ge 0)
						{
							Write-Host -NoNewline "*"
							# Write-Host "Étape $i_byte_check - Correspondance trouvée : $($array_byte_buffer_1[$i_byte_check]) = $($array_bytes_to_find_5_2D[$i_4, 0])"
							# Write-Host "Les octets du buffer ""$($array_byte_buffer_1 -join " ")"" doivent commencer la/les chaîne(s) ""$($array_match_found_1 -join " ")"""
							$i_byte_check++		# $i_byte_check = 5
						}
					}
					$i_4++
				}
				if ($b_exit_while_1 -eq $flase -or $array_match_found_1.GetUpperBound(0) -lt 0)
				{
					$i_byte_check = 0
					$file_output.WriteByte($array_byte_buffer_1[$i_byte_check])
					if ($array_byte_buffer_1.GetUpperBound(0) -ge 1)
					{
						$array_byte_buffer_2 = @()
						$array_byte_buffer_2 = $array_byte_buffer_1[1..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
						$array_byte_buffer_1 = $array_byte_buffer_2
					}
					else
					{
						$array_byte_buffer_1 = @()
					}
				}
				break
			}
			default
			{
				# On prend le tableau $array_match_found_1, il contient le
				# (ou les) numéro de case du tableau $array_hex_strings_to_find
				# qui lui-même contient la chaîne complète des octets à analyser
				# dont les 5 premiers octets correspondent.
				# Remarque : il se peut que plusieurs chaînes aient leurs 5 premiers
				# octets en commun. Voire que seul le dernier octet soit différent.
				# Donc on analyse chaque case du tableau $array_match_found_1.
				$b_exit_while_1 = $flase
				$i_5 = 0				# (Inutile car i_5 reste à 0)
				while ($i_5 -le $array_match_found_1.GetUpperBound(0) -and $b_exit_while_1 -eq $flase)
				{
					# On analyse la chaîne contenue dans $array_hex_strings_to_find.
					# Si la chaîne continue à correspondre, on teste l'octet suivant.
					if ($array_byte_buffer_1[$i_byte_check].ToString("X2") -eq $array_hex_strings_to_find[$array_match_found_1[$i_5]].Substring(2 * $i_byte_check, 2))
					{
						Write-Host -NoNewline "*"
						# Write-Host "Étape $i_byte_check - Correspondance trouvée : $($array_byte_buffer_1[$i_byte_check]) = $($array_hex_strings_to_find[$array_match_found_1[$i_5]].Substring(2 * $i_byte_check, 2))"
						$b_exit_while_1 = $true
						$i_byte_check++

					}
					# Si la chaîne ne correspond plus, alors on retire son numéro du tableau $array_match_found_1.
					# Et si le tableau est vide, alors aucune chaîne ne correspondait,
					# donc le premier octet est traité et $i_byte_check est réinitialisée.
					else
					{
						if ($array_match_found_1.GetUpperBound(0) -ge 1)
						{
							$array_match_found_2 = @()
							$array_match_found_2 = $array_match_found_1[1..($($array_match_found_1.GetUpperBound(0) + 1) - 1)]
							$array_match_found_1 = $array_match_found_2
						}
						else
						{
							$array_match_found_1 = @()
							$i_byte_check = 0
							$file_output.WriteByte($array_byte_buffer_1[$i_byte_check])
							if ($array_byte_buffer_1.GetUpperBound(0) -ge 1)
							{
								$array_byte_buffer_2 = @()
								$array_byte_buffer_2 = $array_byte_buffer_1[1..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
								$array_byte_buffer_1 = $array_byte_buffer_2
							}
							else
							{
								$array_byte_buffer_1 = @()
							}
						}
					}
					if ($i_byte_check -gt 0)
					{
						# Si la correspondance va jusqu'au bout de la chaîne, alors la chaîne a été détectée.
						if ($i_byte_check -eq $array_hex_strings_to_find[$array_match_found_1[$i_5]].Length / 2)
						{
							# Dans ce cas on écrit la nouvelle chaîne et on vide le buffer.
							for ($i = 0; $i -le $array_hex_strings_to_replace[$array_match_found_1[$i_5]].Length - 1; $i += 2)
							{
								$file_output.WriteByte([byte]::Parse($array_hex_strings_to_replace[$array_match_found_1[$i_5]].Substring($i, 2), [System.Globalization.NumberStyles]::HexNumber))
							}
							# Write-Host `r`n"Contenu de la chaîne n°$($array_match_found_1[$i_5] + 1) ($($array_hex_strings_to_find[$array_match_found_1[$i_5]].Length / 2) cases) : $($array_hex_strings_to_find[$array_match_found_1[$i_5]])`r`nContenu du buffer ($($array_byte_buffer_1.GetUpperBound(0) + 1) cases) : $($array_byte_buffer_1 -join " ")"
							# On vide le buffer de la chaîne à rechercher.
							if ($array_byte_buffer_1.GetUpperBound(0) -ge $array_hex_strings_to_find[$array_match_found_1[$i_5]].Length / 2)
							{
								$array_byte_buffer_2 = @()
								$array_byte_buffer_2 = $array_byte_buffer_1[($array_hex_strings_to_find[$array_match_found_1[$i_5]].Length / 2)..($($array_byte_buffer_1.GetUpperBound(0) + 1) - 1)]
								$array_byte_buffer_1 = $array_byte_buffer_2
								# Write-Host "Contenu restant du buffer = : $($array_byte_buffer_1 -join " ")"
							}
							else
							{
								$array_byte_buffer_1 = @()
							}
							$i_byte_check = 0
							$i_replacement_count++
							Write-Host "`r`nFichier :`r`n$file_fullname`r`nSéquence n°$($array_match_found_1[$i_5] + 1) trouvée :`r`n$($array_hex_strings_to_find[$array_match_found_1[$i_5]])`r`nRemplacée par :`r`n$($array_hex_strings_to_replace[$array_match_found_1[$i_5]])`r`n"
							Write-Host -NoNewline "`r`nAnalyse en cours... "
						}
					}
				}
			}
		}
	}

        $file_input.Close()
        $file_output.Close()
        $file_input.Dispose()
        $file_output.Dispose()
	return $i_replacement_count
}

function i_my_rename_file([string]$file_fullname, [string]$file_fullname_new)
{
	if ((Test-Path $file_fullname) -eq $false)
	{
		Write-Host "Erreur, le fichier :`r`n$file_fullname`r`nn'existe pas, impossible de le renommer en :`r`n$file_fullname_new"
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		if ($Host.UI.RawUI.KeyAvailable -eq $true)
		{
			while ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
			}
		}
		else
		{
			$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		}
		exit 0
	}

        Rename-Item -Path $file_fullname -NewName $file_fullname_new -ErrorAction Stop
	Write-Host "Le fichier :`r`n$file_fullname`r`na été renommé en :`r`n$file_fullname_new`r`n"

	if ((Test-Path $file_fullname_new) -eq $false)
	{
		Write-Host "Erreur, le fichier :`r`n$file_fullname`r`nn'a pas pu être renommé."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		if ($Host.UI.RawUI.KeyAvailable -eq $true)
		{
			while ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
			}
		}
		else
		{
			$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		}
		exit 0
	}

	return 0
}

function i_my_fix_corrupted_file([string[]]$corrupted_file_error_ori, [string[]]$corrupted_file_error_fix, [string]$corrupted_file)
{
	$i_installation_type = 0
	if ($program_folder -ne "")
	{
		if ((Test-Path "$program_folder\$corrupted_file") -eq $false)
		{
			Write-Host "Erreur, fichier non détecté :`r`n$program_folder\$corrupted_file"
			Write-Host "`r`nAppuyez sur une touche pour continuer..."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			else
			{
				$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
			}
			exit 0
		}
		$i_installation_type = 1
		Write-Host "Fichier détecté :`r`n$program_folder\$corrupted_file`r`n"
	}
	if ((Test-Path "$program_folder_portable_32\$corrupted_file") -eq $true)
	{
		$i_installation_type = 2
		Write-Host "Fichier détecté :`r`n$program_folder_portable_32\$corrupted_file`r`n"
	}
	if ((Test-Path "$program_folder_portable_64\$corrupted_file") -eq $true)
	{
		$i_installation_type += 3
		Write-Host "Fichier détecté :`r`n$program_folder_portable_64\$corrupted_file`r`n"
	}
	if ((Test-Path "$program_folder_installed_32\$corrupted_file") -eq $true)
	{
		$i_installation_type = 6
		Write-Host "Fichier détecté :`r`n$program_folder_portable_32\$corrupted_file`r`n"
	}
	if ((Test-Path "$program_folder_installed_64\$corrupted_file") -eq $true)
	{
		$i_installation_type = 7
		Write-Host "Fichier détecté :`r`n$program_folder_portable_64\$corrupted_file`r`n"
	}

	if ($i_installation_type -eq 0)
	{
		Write-Host "Erreur, aucun fichier détecté."
		Write-Host "`r`nAppuyez sur une touche pour continuer..."
		if ($Host.UI.RawUI.KeyAvailable -eq $true)
		{
			while ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
			}
		}
		else
		{
			$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
		}
		exit 0
	}
	if ($i_installation_type -eq 1)
	{
		if ((Test-Path -Path "$program_folder\$corrupted_file.bak" -PathType Leaf) -eq $true)
		{
			Write-Host "Attention, le fichier de sauvegarde :`r`n$program_folder\$corrupted_file.bak"
			Write-Host "existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
			Write-Host "appuyez sur ""o"" pour supprimer le fichier "".bak"" et continuer,`r`nsinon appuyez sur une autre touche pour quitter."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				Write-Host "`r`nAppuyez sur une touche pour continuer..."
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			$user_response = Read-Host "`r`nVoulez-vous continuer ? (o = oui)"
			$user_response = $user_response.ToLower()
			if ($user_response -ne "o")
			{
				exit 0
			}
			Remove-Item -Path "$program_folder\$corrupted_file.bak" -Force
			Write-Host "Le fichier :`r`n$program_folder\$corrupted_file.bak`r`na été supprimé."
		}
		$number_of_replacements = i_my_replace_array_hex_strings_in_file $corrupted_file_error_ori $corrupted_file_error_fix ("$program_folder\$corrupted_file")
		Write-Host "`r`n`r`n$number_of_replacements remplacement(s) effectué(s) sur le fichier :`r`n$program_folder\$corrupted_file`r`n"
		$i_return = i_my_rename_file "$program_folder\$corrupted_file"           "$program_folder\$corrupted_file.bak"
		$i_return = i_my_rename_file "$program_folder\$corrupted_file.temporary" "$program_folder\$corrupted_file"
	}
	if ($i_installation_type -eq 2 -or $i_installation_type -eq 5)
	{
		if ((Test-Path -Path "$program_folder_portable_32\$corrupted_file.bak" -PathType Leaf) -eq $true)
		{
			Write-Host "Attention, le fichier de sauvegarde :`r`n$program_folder_portable_32\$corrupted_file.bak"
			Write-Host "existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
			Write-Host "appuyez sur ""o"" pour supprimer le fichier "".bak"" et continuer,`r`nsinon appuyez sur une autre touche pour quitter."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				Write-Host "`r`nAppuyez sur une touche pour continuer..."
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			$user_response = Read-Host "`r`nVoulez-vous continuer ? (o = oui)"
			$user_response = $user_response.ToLower()
			if ($user_response -ne "o")
			{
				exit 0
			}
			Remove-Item -Path "$program_folder_portable_32\$corrupted_file.bak" -Force
			Write-Host "Le fichier :`r`n$program_folder_portable_32\$corrupted_file.bak`r`na été supprimé."
		}
		$number_of_replacements = i_my_replace_array_hex_strings_in_file $corrupted_file_error_ori $corrupted_file_error_fix ("$program_folder_portable_32\$corrupted_file")
		Write-Host "`r`n`r`n$number_of_replacements remplacement(s) effectué(s) sur le fichier :`r`n$program_folder_portable_32\$corrupted_file`r`n"
		$i_return = i_my_rename_file "$program_folder_portable_32\$corrupted_file"           "$program_folder_portable_32\$corrupted_file.bak"
		$i_return = i_my_rename_file "$program_folder_portable_32\$corrupted_file.temporary" "$program_folder_portable_32\$corrupted_file"
	}
	if ($i_installation_type -eq 3 -or $i_installation_type -eq 5)
	{
		if ((Test-Path -Path "$program_folder_portable_64\$corrupted_file.bak" -PathType Leaf) -eq $true)
		{
			Write-Host "Attention, le fichier de sauvegarde :`r`n$program_folder_portable_64\$corrupted_file.bak"
			Write-Host "existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
			Write-Host "appuyez sur ""o"" pour supprimer le fichier "".bak"" et continuer,`r`nsinon appuyez sur une autre touche pour quitter."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				Write-Host "`r`nAppuyez sur une touche pour continuer..."
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			$user_response = Read-Host "`r`nVoulez-vous continuer ? (o = oui)"
			$user_response = $user_response.ToLower()
			if ($user_response -ne "o")
			{
				exit 0
			}
			Remove-Item -Path "$program_folder_portable_64\$corrupted_file.bak" -Force
			Write-Host "Le fichier :`r`n$program_folder_portable_64\$corrupted_file.bak`r`na été supprimé."
		}
		$number_of_replacements = i_my_replace_array_hex_strings_in_file $corrupted_file_error_ori $corrupted_file_error_fix ("$program_folder_portable_64\$corrupted_file")
		Write-Host "`r`n`r`n$number_of_replacements remplacement(s) effectué(s) sur le fichier :`r`n$program_folder_portable_64\$corrupted_file`r`n"
		$i_return = i_my_rename_file "$program_folder_portable_64\$corrupted_file"           "$program_folder_portable_64\$corrupted_file.bak"
		$i_return = i_my_rename_file "$program_folder_portable_64\$corrupted_file.temporary" "$program_folder_portable_64\$corrupted_file"
	}
	if ($i_installation_type -eq 6)
	{
		if ((Test-Path -Path "$program_folder_installed_32\$corrupted_file.bak" -PathType Leaf) -eq $true)
		{
			Write-Host "Attention, le fichier de sauvegarde :`r`n$program_folder_installed_32\$corrupted_file.bak"
			Write-Host "existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
			Write-Host "appuyez sur ""o"" pour supprimer le fichier "".bak"" et continuer,`r`nsinon appuyez sur une autre touche pour quitter."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				Write-Host "`r`nAppuyez sur une touche pour continuer..."
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			$user_response = Read-Host "`r`nVoulez-vous continuer ? (o = oui)"
			$user_response = $user_response.ToLower()
			if ($user_response -ne "o")
			{
				exit 0
			}
			Remove-Item -Path "$program_folder_installed_32\$corrupted_file.bak" -Force
			Write-Host "Le fichier :`r`n$program_folder_installed_32\$corrupted_file.bak`r`na été supprimé."
		}
		$number_of_replacements = i_my_replace_array_hex_strings_in_file $corrupted_file_error_ori $corrupted_file_error_fix ("$program_folder_installed_32\$corrupted_file")
		Write-Host "`r`n`r`n$number_of_replacements remplacement(s) effectué(s) sur le fichier :`r`n$program_folder_installed_32\$corrupted_file`r`n"
		$i_return = i_my_rename_file "$program_folder_installed_32\$corrupted_file"           "$program_folder_installed_32\$corrupted_file.bak"
		$i_return = i_my_rename_file "$program_folder_installed_32\$corrupted_file.temporary" "$program_folder_installed_32\$corrupted_file"
	}
	if ($i_installation_type -eq 7)
	{
		if ((Test-Path -Path "$program_folder_installed_64\$corrupted_file.bak" -PathType Leaf) -eq $true)
		{
			Write-Host "Attention, le fichier de sauvegarde :`r`n$program_folder_installed_64\$corrupted_file.bak"
			Write-Host "existe déjà. Si vous avez déjà utilisé ce script mais que`r`nl'écriture inclusive est revenue à la suite d'une mise à jour,"
			Write-Host "appuyez sur ""o"" pour supprimer le fichier "".bak"" et continuer,`r`nsinon appuyez sur une autre touche pour quitter."
			if ($Host.UI.RawUI.KeyAvailable -eq $true)
			{
				Write-Host "`r`nAppuyez sur une touche pour continuer..."
				while ($Host.UI.RawUI.KeyAvailable -eq $true)
				{
					$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
				}
			}
			$user_response = Read-Host "`r`nVoulez-vous continuer ? (o = oui)"
			$user_response = $user_response.ToLower()
			if ($user_response -ne "o")
			{
				exit 0
			}
			Remove-Item -Path "$program_folder_installed_64\$corrupted_file.bak" -Force
			Write-Host "Le fichier :`r`n$program_folder_installed_64\$corrupted_file.bak`r`na été supprimé."
		}
		$number_of_replacements = i_my_replace_array_hex_strings_in_file $corrupted_file_error_ori $corrupted_file_error_fix ("$program_folder_installed_64\$corrupted_file")
		Write-Host "`r`n`r`n$number_of_replacements remplacement(s) effectué(s) sur le fichier :`r`n$program_folder_installed_64\$corrupted_file`r`n"
		$i_return = i_my_rename_file "$program_folder_installed_64\$corrupted_file"           "$program_folder_installed_64\$corrupted_file.bak"
		$i_return = i_my_rename_file "$program_folder_installed_64\$corrupted_file.temporary" "$program_folder_installed_64\$corrupted_file"
	}
	return $number_of_replacements
}



# _____________________________________________________________________________
# Partie à modifier pour ajouter des fichiers à corriger :



# Lancement du script :
$number_of_replacements = i_my_fix_corrupted_file $corrupted_file_1_error_ori $corrupted_file_1_error_fix ("$corrupted_file_1")
$number_of_replacements = i_my_fix_corrupted_file $corrupted_file_2_error_ori $corrupted_file_2_error_fix ("$corrupted_file_2")



# _____________________________________________________________________________
# Partie à ne pas modifier :



$pause_message = "L'exécution de ce programme est terminée."
Write-Host "$pause_message`r`n`r`nAppuyez sur une touche pour continuer..."
if ($Host.UI.RawUI.KeyAvailable -eq $true)
{
	while ($Host.UI.RawUI.KeyAvailable -eq $true)
	{
		$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
	}
}
else
{
	$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
}
exit 0

Firefox en VBScript

' Character encoding = UTF-16 LE (Byte Order Mark = FF FE)
' End-of-line = Windows (CR LF)

' Composants requis :
set object_shell       = WScript.CreateObject("WScript.Shell")
set object_file_system = WScript.CreateObject("Scripting.FileSystemObject")
current_folder         = object_file_system.GetParentFolderName(WScript.ScriptFullName)



' _____________________________________________________________________________
' Partie à modifier pour ajouter des fichiers et erreurs à corriger :



' Emplacement personnalisé du dossier contenant le fichier "firefox.exe".
' Vous pouvez le laisser vide. Exemple :
' program_folder = current_folder & "\Mozilla Firefox"
program_folder = ""



' Emplacements connus :
program_folder_portable_32  = current_folder & "\App\Firefox"
program_folder_portable_64  = current_folder & "\App\Firefox64"
program_folder_installed_32 = object_shell.ExpandEnvironmentStrings("%ProgramFiles(x86)%") & "\Mozilla Firefox"
program_folder_installed_64 = object_shell.ExpandEnvironmentStrings("%ProgramFiles%")      & "\Mozilla Firefox"



' Fichiers à réparer :
corrupted_file_1 = "omni.ja"
corrupted_file_2 = "browser\omni.ja"



' Réparations à faire :

dim corrupted_file_1_error_ori()
redim corrupted_file_1_error_ori(-1)
dim corrupted_file_1_error_fix()
redim corrupted_file_1_error_fix(-1)

' utilisateur·trice => utilisateur
redim preserve corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori) + 1)
corrupted_file_1_error_ori(ubound(corrupted_file_1_error_ori)) = "C2B774726963650A"	' ·trice
redim preserve corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix) + 1)
corrupted_file_1_error_fix(ubound(corrupted_file_1_error_fix)) = "0A0A0A0A0A0A0A0A"	' 

dim corrupted_file_2_error_ori()
redim corrupted_file_2_error_ori(-1)
dim corrupted_file_2_error_fix()
redim corrupted_file_2_error_fix(-1)

' administrateur·trice a désactivé la synchronisation. => administrateur a désactivé la synchronisation.
redim preserve corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori) + 1)
corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori)) = "C2B7747269636520612064C3A9736163746976C3A9206C612073796E6368726F6E69736174696F6E2E0A"	' ·trice a désactivé la synchronisation.
redim preserve corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix) + 1)
corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix)) = "20612064C3A9736163746976C3A9206C612073796E6368726F6E69736174696F6E2E0A0A0A0A0A0A0A0A"	'  a désactivé la synchronisation.

' connecté·e. => connecté.
redim preserve corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori) + 1)
corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori)) = "C3A9C2B7652E0A"	' é·e.
redim preserve corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix) + 1)
corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix)) = "C3A92E0A0A0A0A"	' é.

' connecté·e avec succès => connecté avec succès
redim preserve corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori) + 1)
corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori)) = "C2B76520617665632073756363C3A8730A"	' ·e avec succès
redim preserve corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix) + 1)
corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix)) = "20617665632073756363C3A8730A0A0A0A"	'  avec succès

' suivi·e => suivi
redim preserve corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori) + 1)
corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori)) = "7669C2B7650A"	' vi·e
redim preserve corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix) + 1)
corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix)) = "76690A0A0A0A"	' vi

' Prêt·e à scanner</strong> et maintenez votre appareil au-dessus de ce code => Prêt à scanner</strong> et maintenez votre appareil au-dessus de ce code
redim preserve corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori) + 1)
corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori)) = "C2B76520C3A0207363616E6E65723C2F7374726F6E673E206574206D61696E74656E657A20766F74726520617070617265696C2061752D64657373757320646520636520636F64650A"	' ·e à scanner</strong> et maintenez votre appareil au-dessus de ce code
redim preserve corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix) + 1)
corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix)) = "20C3A0207363616E6E65723C2F7374726F6E673E206574206D61696E74656E657A20766F74726520617070617265696C2061752D64657373757320646520636520636F64650A0A0A0A"	'  à scanner</strong> et maintenez votre appareil au-dessus de ce code

' pisté·e => pisté
redim preserve corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori) + 1)
corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori)) = "C3A9C2B7650A"	' é·e
redim preserve corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix) + 1)
corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix)) = "C3A90A0A0A0A"	' é

' véritables client·e·s qui ont laissé des avis sincères et objectifs.
redim preserve corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori) + 1)
corrupted_file_2_error_ori(ubound(corrupted_file_2_error_ori)) = "C2B765C2B77320717569206F6E74206C61697373C3A92064657320617669732073696E63C3A8726573206574206F626A6563746966732E0A"	' ·e·s qui ont laissé des avis sincères et objectifs.
redim preserve corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix) + 1)
corrupted_file_2_error_fix(ubound(corrupted_file_2_error_fix)) = "7320717569206F6E74206C61697373C3A92064657320617669732073696E63C3A8726573206574206F626A6563746966732E0A0A0A0A0A0A"	' s qui ont laissé des avis sincères et objectifs.



' _____________________________________________________________________________
' Partie à ne pas modifier :



function i_my_replace_array_hex_strings_in_file(byval array_hex_strings_to_find, byval array_hex_strings_to_replace, byval file_fullname)
	if ubound(array_hex_strings_to_find) <> ubound(array_hex_strings_to_replace) then
		MsgBox "Erreur :" & vbCrLf & "Le nombre de cases dans le tableau des chaînes hexadécimales à détecter (" & ubound(array_hex_strings_to_find) + 1 & ")" & vbCrLf & "et dans le tableau des chaînes hexadécimales à remplacer (" & ubound(array_hex_strings_to_replace) + 1 & ")" & vbCrLf & "n'est pas identique.", 48, "Erreur"		' 0 = vbOKOnly vbDefaultButton1 vbApplicationModal	48 = vbExclamation
		WScript.Quit(0)
	end if
	for i = 0 to ubound(array_hex_strings_to_find) step 1
		if len(array_hex_strings_to_find(i)) <> len(array_hex_strings_to_replace(i)) then
			MsgBox "Erreur :" & vbCrLf & "La variable " & array_hex_strings_to_find(i) & " et" & vbCrLf & "la variable " & array_hex_strings_to_replace(i) & vbCrLf _
			& "n'ont pas le même nombre de caractères (" & len(array_hex_strings_to_find(i)) & " contre " & len(array_hex_strings_to_replace(i)) & ").", 48, "Erreur"
			WScript.Quit(0)
		end if
		if len(array_hex_strings_to_find(i)) MOD 2 <> 0 then
			MsgBox "Erreur, les variables :" & vbCrLf & array_hex_strings_to_find(i) & " et" & vbCrLf & array_hex_strings_to_replace(i) & vbCrLf & "ont un nombre impair de caractères.", 48, "Erreur"
			WScript.Quit(0)
		end if
		if len(array_hex_strings_to_find(i)) < 12 then
			MsgBox "Erreur, les variables :" & vbCrLf & array_hex_strings_to_find(i) & " et" & vbCrLf & array_hex_strings_to_replace(i) & vbCrLf _
			& "doivent avoir au moins 12 caractères hexadécimaux pour représenter" & vbCrLf _
			& "au moins 6 octets. Or ici, elles n'en contiennent que " & len(array_hex_strings_to_find(i)) & ".", 48, "Erreur"
			WScript.Quit(0)
		end if
	next

	set object_file = object_file_system.CreateTextFile(file_fullname & ".temporary", TRUE, FALSE)	' (TRUE = Écraser si existe déjà) (FALSE = Utiliser ASCII au lieu d'Unicode UTF16LE donc pas de Byte Order Mark FFFE)
	object_file.Close
	if object_file_system.FileExists(file_fullname & ".temporary") = FALSE then
		MsgBox "Erreur, le fichier :" & vbCrLf & file_fullname & ".temporary" & vbCrLf _
		& "n'a pas pu être créé. L'écriture dans ce dossier nécessite probablement" & vbCrLf & "des privilèges d'administrateur. Veuillez exécuter ce script en tant qu'administrateur.", 48, "Erreur"
		WScript.Quit(0)
	end if

	' Pour aller plus vite, on crée 5 tableaux en 2 dimensions.
	' Nous sommes obligés de créer chaque dimension indépendamment car
	' il est impossible de redimensionner dynamiquement les 2 dimensions.
	' Concernant la 1ère dimension :
	' Le 1er tableau contiendra les premiers octets de toutes les chaînes
	' à rechercher, convertis en décimal et en éliminant les doublons.
	' Le 2ème tableau contiendra les deuxièmes octets, etc.
	' Le 3ème tableau contiendra les troisièmes octets, etc.
	dim array_bytes_to_find_1()
	redim array_bytes_to_find_1(-1)
	dim array_bytes_to_find_2()
	redim array_bytes_to_find_2(-1)
	dim array_bytes_to_find_3()
	redim array_bytes_to_find_3(-1)
	dim array_bytes_to_find_4()
	redim array_bytes_to_find_4(-1)
	dim array_bytes_to_find_5()
	redim array_bytes_to_find_5(-1)
	for i_1 = 0 to ubound(array_hex_strings_to_find) step 1
		b_already_exists = FALSE
		for i_2 = 0 to ubound(array_bytes_to_find_1) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_1), 1, 2)) = array_bytes_to_find_1(i_2) then
				b_already_exists = TRUE
			end if
		next
		if b_already_exists = FALSE then
			redim preserve array_bytes_to_find_1(ubound(array_bytes_to_find_1) + 1)
			array_bytes_to_find_1(ubound(array_bytes_to_find_1)) = cint("&H" & mid(array_hex_strings_to_find(i_1), 1, 2))
		end if
		b_already_exists = FALSE
		for i_2 = 0 to ubound(array_bytes_to_find_2) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_1), 3, 2)) = array_bytes_to_find_2(i_2) then
				b_already_exists = TRUE
			end if
		next
		if b_already_exists = FALSE then
			redim preserve array_bytes_to_find_2(ubound(array_bytes_to_find_2) + 1)
			array_bytes_to_find_2(ubound(array_bytes_to_find_2)) = cint("&H" & mid(array_hex_strings_to_find(i_1), 3, 2))
		end if
		b_already_exists = FALSE
		for i_2 = 0 to ubound(array_bytes_to_find_3) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_1), 5, 2)) = array_bytes_to_find_3(i_2) then
				b_already_exists = TRUE
			end if
		next
		if b_already_exists = FALSE then
			redim preserve array_bytes_to_find_3(ubound(array_bytes_to_find_3) + 1)
			array_bytes_to_find_3(ubound(array_bytes_to_find_3)) = cint("&H" & mid(array_hex_strings_to_find(i_1), 5, 2))
		end if
		b_already_exists = FALSE
		for i_2 = 0 to ubound(array_bytes_to_find_4) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_1), 7, 2)) = array_bytes_to_find_4(i_2) then
				b_already_exists = TRUE
			end if
		next
		if b_already_exists = FALSE then
			redim preserve array_bytes_to_find_4(ubound(array_bytes_to_find_4) + 1)
			array_bytes_to_find_4(ubound(array_bytes_to_find_4)) = cint("&H" & mid(array_hex_strings_to_find(i_1), 7, 2))
		end if
		b_already_exists = FALSE
		for i_2 = 0 to ubound(array_bytes_to_find_5) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_1), 9, 2)) = array_bytes_to_find_5(i_2) then
				b_already_exists = TRUE
			end if
		next
		if b_already_exists = FALSE then
			redim preserve array_bytes_to_find_5(ubound(array_bytes_to_find_5) + 1)
			array_bytes_to_find_5(ubound(array_bytes_to_find_5)) = cint("&H" & mid(array_hex_strings_to_find(i_1), 9, 2))
		end if
	next
	' Concernant la 2ème dimension :
	' Pour chaque tableau, elle contiendra les numéros des chaînes
	' auxquelles les octets correspondent (en commençant par 0).
	' Imaginons que la 1ère case du 1er tableau contient l'octet C2 = 194
	' et plusieurs chaînes commencent par C2 (doublons), par exemple les
	' chaînes 1 2 4 5 6, alors les chiffres 0 1 3 4 5 seront inscrits
	' dans la 2ème dimension de la 1ère case du 1er tableau.
	dim array_bytes_to_find_1_2D()
	redim array_bytes_to_find_1_2D(ubound(array_bytes_to_find_1), 0)
	dim array_bytes_to_find_2_2D()
	redim array_bytes_to_find_2_2D(ubound(array_bytes_to_find_2), 0)
	dim array_bytes_to_find_3_2D()
	redim array_bytes_to_find_3_2D(ubound(array_bytes_to_find_3), 0)
	dim array_bytes_to_find_4_2D()
	redim array_bytes_to_find_4_2D(ubound(array_bytes_to_find_4), 0)
	dim array_bytes_to_find_5_2D()
	redim array_bytes_to_find_5_2D(ubound(array_bytes_to_find_5), 0)
	for i_1 = 0 to ubound(array_bytes_to_find_1_2D, 1) step 1
		array_bytes_to_find_1_2D(i_1, 0) = array_bytes_to_find_1(i_1)
		i_2 = 1
		for i_3 = 0 to ubound(array_hex_strings_to_find) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_3), 1, 2)) = array_bytes_to_find_1_2D(i_1, 0) then
				if ubound(array_bytes_to_find_1_2D, 2) < i_2 then
					redim preserve array_bytes_to_find_1_2D(ubound(array_bytes_to_find_1_2D, 1), ubound(array_bytes_to_find_1_2D, 2) + 1)
				end if
				array_bytes_to_find_1_2D(i_1, i_2) = i_3
				i_2 = i_2 + 1
			end if
		next
	next
	for i_1 = 0 to ubound(array_bytes_to_find_2_2D, 1) step 1
		array_bytes_to_find_2_2D(i_1, 0) = array_bytes_to_find_2(i_1)
		i_2 = 1
		for i_3 = 0 to ubound(array_hex_strings_to_find) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_3), 3, 2)) = array_bytes_to_find_2_2D(i_1, 0) then
				if ubound(array_bytes_to_find_2_2D, 2) < i_2 then
					redim preserve array_bytes_to_find_2_2D(ubound(array_bytes_to_find_2_2D, 1), ubound(array_bytes_to_find_2_2D, 2) + 1)
				end if
				array_bytes_to_find_2_2D(i_1, i_2) = i_3
				i_2 = i_2 + 1
			end if
		next
	next
	for i_1 = 0 to ubound(array_bytes_to_find_3_2D, 1) step 1
		array_bytes_to_find_3_2D(i_1, 0) = array_bytes_to_find_3(i_1)
		i_2 = 1
		for i_3 = 0 to ubound(array_hex_strings_to_find) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_3), 5, 2)) = array_bytes_to_find_3_2D(i_1, 0) then
				if ubound(array_bytes_to_find_3_2D, 2) < i_2 then
					redim preserve array_bytes_to_find_3_2D(ubound(array_bytes_to_find_3_2D, 1), ubound(array_bytes_to_find_3_2D, 2) + 1)
				end if
				array_bytes_to_find_3_2D(i_1, i_2) = i_3
				i_2 = i_2 + 1
			end if
		next
	next
	for i_1 = 0 to ubound(array_bytes_to_find_4_2D, 1) step 1
		array_bytes_to_find_4_2D(i_1, 0) = array_bytes_to_find_4(i_1)
		i_2 = 1
		for i_3 = 0 to ubound(array_hex_strings_to_find) step 1
			if cint("&H" & mid(array_hex_strings_to_find(i_3), 7, 2)) = array_bytes_to_find_4_2D(i_1, 0) then
				if ubound(array_bytes_to_find_4_2D, 2) < i_2 then
					redim preserve array_bytes_to_find_4_2D(ubound(array_bytes_to_find_4_2D, 1), ubound(array_bytes_to_find_4_2D, 2) + 1)
				end if
				array_bytes_to_find_4_2D(i_1, i_2) = i_3
				i_2 = i_2 + 1
			end if
		next
	next
	for i_1 = 0 to ubound(array_bytes_to_find_5_2D, 1) step 1
		array_bytes_to_find_5_2D