diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..1ff0c42
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..b87b130
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,76 @@
+name: Build
+
+on:
+ push:
+ branches:
+ - 'master'
+ paths-ignore:
+ - '**/LICENSE'
+ - '**/README.md'
+ - '**/build.yml'
+ - '**/.gitignore'
+ - '**/.gitattributes'
+jobs:
+ build:
+ runs-on: windows-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: microsoft/setup-msbuild@v1.1
+
+ - name: Download FBX SDK
+ run: |
+ md fbx
+ cd fbx
+ Invoke-WebRequest "https://damassets.autodesk.net/content/dam/autodesk/www/adn/fbx/2020-2-1/fbx202021_fbxsdk_vs2019_win.exe" -OutFile "fbxsdk.exe"
+ Start-Process -FilePath "fbxsdk.exe" /S -Wait
+ Invoke-WebRequest "https://damassets.autodesk.net/content/dam/autodesk/www/adn/fbx/2020-2-1/fbx202021_fbxsdk_vs2019_pdbs.exe" -OutFile "fbxpdb.exe"
+ Start-Process -FilePath "fbxpdb.exe" /S -Wait
+ cd ..
+ - name: Nuget Restore
+ run: nuget restore
+
+ - name: Build .Net472
+ run: msbuild /p:Configuration=Release /p:TargetFramework=net472 /verbosity:minimal
+
+ - name: Build .Net5
+ run: msbuild /t:AssetStudioGUI:publish /p:Configuration=Release /p:TargetFramework=net5.0-windows /p:SelfContained=false /verbosity:minimal
+
+ - name: Build .Net6
+ run: msbuild /t:AssetStudioGUI:publish /p:Configuration=Release /p:TargetFramework=net6.0-windows /p:SelfContained=false /verbosity:minimal
+
+ - name: Build .Net5 CLI
+ run: msbuild /t:AssetStudioCLI:publish /p:Configuration=Release /p:TargetFramework=net5.0-windows /p:SelfContained=false /verbosity:minimal
+
+ - name: Build .Net6 CLI
+ run: msbuild /t:AssetStudioCLI:publish /p:Configuration=Release /p:TargetFramework=net6.0-windows /p:SelfContained=false /verbosity:minimal
+
+ - name: Upload .Net472 Artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: net472
+ path: AssetStudioGUI/bin/Release/net472
+
+ - name: Upload .Net5 Artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: net5.0-windows
+ path: AssetStudioGUI/bin/Release/net5.0-windows/publish
+
+ - name: Upload .Net6 Artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: net6.0-windows
+ path: AssetStudioGUI/bin/Release/net6.0-windows/publish
+
+ - name: Upload .Net5 CLI Artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: net5.0-windows
+ path: AssetStudioGUI/bin/Release/net5.0-windows/publish
+
+ - name: Upload .Net6 CLI Artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: net6.0-windows
+ path: AssetStudioGUI/bin/Release/net6.0-windows/publish
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..cc91c10
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,342 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- Backup*.rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+/AssetStudioCLI/Properties/launchSettings.json
+/AssetStudioGUI/Properties/launchSettings.json
diff --git a/AssetStudio.PInvoke/AssetStudio.PInvoke.csproj b/AssetStudio.PInvoke/AssetStudio.PInvoke.csproj
new file mode 100644
index 0000000..fdadfb3
--- /dev/null
+++ b/AssetStudio.PInvoke/AssetStudio.PInvoke.csproj
@@ -0,0 +1,13 @@
+
+
+
+ net472;netstandard2.0;net5.0;net6.0
+ true
+ 0.17.00
+ 0.17.00
+ 0.17.00
+ Copyright © Perfare 2020-2022; Copyright © hozuki 2020
+ embedded
+
+
+
diff --git a/AssetStudio.PInvoke/DllLoader.cs b/AssetStudio.PInvoke/DllLoader.cs
new file mode 100644
index 0000000..b4e85ea
--- /dev/null
+++ b/AssetStudio.PInvoke/DllLoader.cs
@@ -0,0 +1,124 @@
+using System;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.IO;
+using System.Runtime.InteropServices;
+
+namespace AssetStudio.PInvoke
+{
+ public static class DllLoader
+ {
+
+ public static void PreloadDll(string dllName)
+ {
+ var dllDir = GetDirectedDllDirectory();
+
+ // Not using OperatingSystem.Platform.
+ // See: https://www.mono-project.com/docs/faq/technical/#how-to-detect-the-execution-platform
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ Win32.LoadDll(dllDir, dllName);
+ }
+ else
+ {
+ Posix.LoadDll(dllDir, dllName);
+ }
+ }
+
+ private static string GetDirectedDllDirectory()
+ {
+ var localPath = Process.GetCurrentProcess().MainModule.FileName;
+ var localDir = Path.GetDirectoryName(localPath);
+
+ var subDir = Environment.Is64BitProcess ? "x64" : "x86";
+
+ var directedDllDir = Path.Combine(localDir, subDir);
+
+ return directedDllDir;
+ }
+
+ private static class Win32
+ {
+
+ internal static void LoadDll(string dllDir, string dllName)
+ {
+ var dllFileName = $"{dllName}.dll";
+ var directedDllPath = Path.Combine(dllDir, dllFileName);
+
+ // Specify SEARCH_DLL_LOAD_DIR to load dependent libraries located in the same platform-specific directory.
+ var hLibrary = LoadLibraryEx(directedDllPath, IntPtr.Zero, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
+
+ if (hLibrary == IntPtr.Zero)
+ {
+ var errorCode = Marshal.GetLastWin32Error();
+ var exception = new Win32Exception(errorCode);
+
+ throw new DllNotFoundException(exception.Message, exception);
+ }
+ }
+
+ // HMODULE LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
+ // HMODULE LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
+ [DllImport("kernel32.dll", SetLastError = true)]
+ private static extern IntPtr LoadLibraryEx(string lpLibFileName, IntPtr hFile, uint dwFlags);
+
+ private const uint LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x1000;
+ private const uint LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x100;
+
+ }
+
+ private static class Posix
+ {
+
+ internal static void LoadDll(string dllDir, string dllName)
+ {
+ string dllExtension;
+
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ {
+ dllExtension = ".so";
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ {
+ dllExtension = ".dylib";
+ }
+ else
+ {
+ throw new NotSupportedException();
+ }
+
+ var dllFileName = $"lib{dllName}{dllExtension}";
+ var directedDllPath = Path.Combine(dllDir, dllFileName);
+
+ const int ldFlags = RTLD_NOW | RTLD_GLOBAL;
+ var hLibrary = DlOpen(directedDllPath, ldFlags);
+
+ if (hLibrary == IntPtr.Zero)
+ {
+ var pErrStr = DlError();
+ // `PtrToStringAnsi` always uses the specific constructor of `String` (see dotnet/core#2325),
+ // which in turn interprets the byte sequence with system default codepage. On OSX and Linux
+ // the codepage is UTF-8 so the error message should be handled correctly.
+ var errorMessage = Marshal.PtrToStringAnsi(pErrStr);
+
+ throw new DllNotFoundException(errorMessage);
+ }
+ }
+
+ // OSX and most Linux OS use LP64 so `int` is still 32-bit even on 64-bit platforms.
+ // void *dlopen(const char *filename, int flag);
+ [DllImport("libdl", EntryPoint = "dlopen")]
+ private static extern IntPtr DlOpen([MarshalAs(UnmanagedType.LPStr)] string fileName, int flags);
+
+ // char *dlerror(void);
+ [DllImport("libdl", EntryPoint = "dlerror")]
+ private static extern IntPtr DlError();
+
+ private const int RTLD_LAZY = 0x1;
+ private const int RTLD_NOW = 0x2;
+ private const int RTLD_GLOBAL = 0x100;
+
+ }
+
+ }
+}
diff --git a/AssetStudio.PInvoke/Utf8StringHandle.cs b/AssetStudio.PInvoke/Utf8StringHandle.cs
new file mode 100644
index 0000000..96a7719
--- /dev/null
+++ b/AssetStudio.PInvoke/Utf8StringHandle.cs
@@ -0,0 +1,100 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+using Microsoft.Win32.SafeHandles;
+
+namespace AssetStudio.PInvoke
+{
+ // Generally the technique from Steamworks.NET
+ public class Utf8StringHandle : SafeHandleZeroOrMinusOneIsInvalid
+ {
+
+ static Utf8StringHandle()
+ {
+ Utf8 = new UTF8Encoding(false);
+ }
+
+ public Utf8StringHandle(string str)
+ : base(true)
+ {
+ IntPtr buffer;
+
+ if (str == null)
+ {
+ buffer = IntPtr.Zero;
+ }
+ else
+ {
+ if (str.Length == 0)
+ {
+ buffer = Marshal.AllocHGlobal(1);
+
+ unsafe
+ {
+ *(byte*)buffer = 0;
+ }
+ }
+ else
+ {
+ var strlen = Utf8.GetByteCount(str);
+ var strBuffer = new byte[strlen + 1];
+
+ Utf8.GetBytes(str, 0, str.Length, strBuffer, 0);
+
+ buffer = Marshal.AllocHGlobal(strBuffer.Length);
+
+ Marshal.Copy(strBuffer, 0, buffer, strBuffer.Length);
+ }
+ }
+
+ SetHandle(buffer);
+ }
+
+ public static string ReadUtf8StringFromPointer(IntPtr lpstr)
+ {
+ if (lpstr == IntPtr.Zero || lpstr == new IntPtr(-1))
+ {
+ return null;
+ }
+
+ var byteCount = 0;
+
+ unsafe
+ {
+ var p = (byte*)lpstr.ToPointer();
+
+ while (*p != 0)
+ {
+ byteCount += 1;
+ p += 1;
+ }
+ }
+
+ if (byteCount == 0)
+ {
+ return string.Empty;
+ }
+
+ var strBuffer = new byte[byteCount];
+
+ Marshal.Copy(lpstr, strBuffer, 0, byteCount);
+
+ var str = Utf8.GetString(strBuffer);
+
+ return str;
+ }
+
+ protected override bool ReleaseHandle()
+ {
+ if (!IsInvalid)
+ {
+ Marshal.FreeHGlobal(handle);
+ }
+
+ return true;
+ }
+
+ private static readonly UTF8Encoding Utf8;
+
+ }
+}
diff --git a/AssetStudio.sln b/AssetStudio.sln
new file mode 100644
index 0000000..298e168
--- /dev/null
+++ b/AssetStudio.sln
@@ -0,0 +1,155 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.32014.148
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssetStudio", "AssetStudio\AssetStudio.csproj", "{422FEC21-EF60-4F29-AA56-95DFDA23C913}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssetStudio.PInvoke", "AssetStudio.PInvoke\AssetStudio.PInvoke.csproj", "{0B2BE613-3049-4021-85D1-21C325F729F4}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssetStudioFBXWrapper", "AssetStudioFBXWrapper\AssetStudioFBXWrapper.csproj", "{E301AFEA-84E7-4BCE-8D65-A2576D8D105B}"
+ ProjectSection(ProjectDependencies) = postProject
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027} = {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}
+ EndProjectSection
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssetStudioGUI", "AssetStudioGUI\AssetStudioGUI.csproj", "{29EAD018-1C67-497A-AB8E-727D595AD756}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssetStudioUtility", "AssetStudioUtility\AssetStudioUtility.csproj", "{65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Texture2DDecoderWrapper", "Texture2DDecoderWrapper\Texture2DDecoderWrapper.csproj", "{6438FEC1-56B0-488C-A5E2-FBDB23E9574B}"
+ ProjectSection(ProjectDependencies) = postProject
+ {29356642-C46E-4144-83D8-22DC09D0D7FD} = {29356642-C46E-4144-83D8-22DC09D0D7FD}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AssetStudioFBXNative", "AssetStudioFBXNative\AssetStudioFBXNative.vcxproj", "{11EA25A3-ED68-40EE-A9D0-7FDE3B583027}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Texture2DDecoderNative", "Texture2DDecoderNative\Texture2DDecoderNative.vcxproj", "{29356642-C46E-4144-83D8-22DC09D0D7FD}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssetStudioCLI", "AssetStudioCLI\AssetStudioCLI.csproj", "{5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {422FEC21-EF60-4F29-AA56-95DFDA23C913}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {422FEC21-EF60-4F29-AA56-95DFDA23C913}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {422FEC21-EF60-4F29-AA56-95DFDA23C913}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {422FEC21-EF60-4F29-AA56-95DFDA23C913}.Debug|x64.Build.0 = Debug|Any CPU
+ {422FEC21-EF60-4F29-AA56-95DFDA23C913}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {422FEC21-EF60-4F29-AA56-95DFDA23C913}.Debug|x86.Build.0 = Debug|Any CPU
+ {422FEC21-EF60-4F29-AA56-95DFDA23C913}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {422FEC21-EF60-4F29-AA56-95DFDA23C913}.Release|Any CPU.Build.0 = Release|Any CPU
+ {422FEC21-EF60-4F29-AA56-95DFDA23C913}.Release|x64.ActiveCfg = Release|Any CPU
+ {422FEC21-EF60-4F29-AA56-95DFDA23C913}.Release|x64.Build.0 = Release|Any CPU
+ {422FEC21-EF60-4F29-AA56-95DFDA23C913}.Release|x86.ActiveCfg = Release|Any CPU
+ {422FEC21-EF60-4F29-AA56-95DFDA23C913}.Release|x86.Build.0 = Release|Any CPU
+ {0B2BE613-3049-4021-85D1-21C325F729F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0B2BE613-3049-4021-85D1-21C325F729F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0B2BE613-3049-4021-85D1-21C325F729F4}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {0B2BE613-3049-4021-85D1-21C325F729F4}.Debug|x64.Build.0 = Debug|Any CPU
+ {0B2BE613-3049-4021-85D1-21C325F729F4}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {0B2BE613-3049-4021-85D1-21C325F729F4}.Debug|x86.Build.0 = Debug|Any CPU
+ {0B2BE613-3049-4021-85D1-21C325F729F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0B2BE613-3049-4021-85D1-21C325F729F4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0B2BE613-3049-4021-85D1-21C325F729F4}.Release|x64.ActiveCfg = Release|Any CPU
+ {0B2BE613-3049-4021-85D1-21C325F729F4}.Release|x64.Build.0 = Release|Any CPU
+ {0B2BE613-3049-4021-85D1-21C325F729F4}.Release|x86.ActiveCfg = Release|Any CPU
+ {0B2BE613-3049-4021-85D1-21C325F729F4}.Release|x86.Build.0 = Release|Any CPU
+ {E301AFEA-84E7-4BCE-8D65-A2576D8D105B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E301AFEA-84E7-4BCE-8D65-A2576D8D105B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E301AFEA-84E7-4BCE-8D65-A2576D8D105B}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {E301AFEA-84E7-4BCE-8D65-A2576D8D105B}.Debug|x64.Build.0 = Debug|Any CPU
+ {E301AFEA-84E7-4BCE-8D65-A2576D8D105B}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {E301AFEA-84E7-4BCE-8D65-A2576D8D105B}.Debug|x86.Build.0 = Debug|Any CPU
+ {E301AFEA-84E7-4BCE-8D65-A2576D8D105B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E301AFEA-84E7-4BCE-8D65-A2576D8D105B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E301AFEA-84E7-4BCE-8D65-A2576D8D105B}.Release|x64.ActiveCfg = Release|Any CPU
+ {E301AFEA-84E7-4BCE-8D65-A2576D8D105B}.Release|x64.Build.0 = Release|Any CPU
+ {E301AFEA-84E7-4BCE-8D65-A2576D8D105B}.Release|x86.ActiveCfg = Release|Any CPU
+ {E301AFEA-84E7-4BCE-8D65-A2576D8D105B}.Release|x86.Build.0 = Release|Any CPU
+ {29EAD018-1C67-497A-AB8E-727D595AD756}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {29EAD018-1C67-497A-AB8E-727D595AD756}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {29EAD018-1C67-497A-AB8E-727D595AD756}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {29EAD018-1C67-497A-AB8E-727D595AD756}.Debug|x64.Build.0 = Debug|Any CPU
+ {29EAD018-1C67-497A-AB8E-727D595AD756}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {29EAD018-1C67-497A-AB8E-727D595AD756}.Debug|x86.Build.0 = Debug|Any CPU
+ {29EAD018-1C67-497A-AB8E-727D595AD756}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {29EAD018-1C67-497A-AB8E-727D595AD756}.Release|Any CPU.Build.0 = Release|Any CPU
+ {29EAD018-1C67-497A-AB8E-727D595AD756}.Release|x64.ActiveCfg = Release|Any CPU
+ {29EAD018-1C67-497A-AB8E-727D595AD756}.Release|x64.Build.0 = Release|Any CPU
+ {29EAD018-1C67-497A-AB8E-727D595AD756}.Release|x86.ActiveCfg = Release|Any CPU
+ {29EAD018-1C67-497A-AB8E-727D595AD756}.Release|x86.Build.0 = Release|Any CPU
+ {65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}.Debug|x64.Build.0 = Debug|Any CPU
+ {65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}.Debug|x86.Build.0 = Debug|Any CPU
+ {65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}.Release|x64.ActiveCfg = Release|Any CPU
+ {65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}.Release|x64.Build.0 = Release|Any CPU
+ {65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}.Release|x86.ActiveCfg = Release|Any CPU
+ {65EAFFA3-01D3-4EF5-B092-8B4647E9A1FF}.Release|x86.Build.0 = Release|Any CPU
+ {6438FEC1-56B0-488C-A5E2-FBDB23E9574B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6438FEC1-56B0-488C-A5E2-FBDB23E9574B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6438FEC1-56B0-488C-A5E2-FBDB23E9574B}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {6438FEC1-56B0-488C-A5E2-FBDB23E9574B}.Debug|x64.Build.0 = Debug|Any CPU
+ {6438FEC1-56B0-488C-A5E2-FBDB23E9574B}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {6438FEC1-56B0-488C-A5E2-FBDB23E9574B}.Debug|x86.Build.0 = Debug|Any CPU
+ {6438FEC1-56B0-488C-A5E2-FBDB23E9574B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6438FEC1-56B0-488C-A5E2-FBDB23E9574B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6438FEC1-56B0-488C-A5E2-FBDB23E9574B}.Release|x64.ActiveCfg = Release|Any CPU
+ {6438FEC1-56B0-488C-A5E2-FBDB23E9574B}.Release|x64.Build.0 = Release|Any CPU
+ {6438FEC1-56B0-488C-A5E2-FBDB23E9574B}.Release|x86.ActiveCfg = Release|Any CPU
+ {6438FEC1-56B0-488C-A5E2-FBDB23E9574B}.Release|x86.Build.0 = Release|Any CPU
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}.Debug|Any CPU.Build.0 = Debug|Win32
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}.Debug|x64.ActiveCfg = Debug|x64
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}.Debug|x64.Build.0 = Debug|x64
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}.Debug|x86.ActiveCfg = Debug|Win32
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}.Debug|x86.Build.0 = Debug|Win32
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}.Release|Any CPU.ActiveCfg = Release|Win32
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}.Release|Any CPU.Build.0 = Release|Win32
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}.Release|x64.ActiveCfg = Release|x64
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}.Release|x64.Build.0 = Release|x64
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}.Release|x86.ActiveCfg = Release|Win32
+ {11EA25A3-ED68-40EE-A9D0-7FDE3B583027}.Release|x86.Build.0 = Release|Win32
+ {29356642-C46E-4144-83D8-22DC09D0D7FD}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {29356642-C46E-4144-83D8-22DC09D0D7FD}.Debug|Any CPU.Build.0 = Debug|Win32
+ {29356642-C46E-4144-83D8-22DC09D0D7FD}.Debug|x64.ActiveCfg = Debug|x64
+ {29356642-C46E-4144-83D8-22DC09D0D7FD}.Debug|x64.Build.0 = Debug|x64
+ {29356642-C46E-4144-83D8-22DC09D0D7FD}.Debug|x86.ActiveCfg = Debug|Win32
+ {29356642-C46E-4144-83D8-22DC09D0D7FD}.Debug|x86.Build.0 = Debug|Win32
+ {29356642-C46E-4144-83D8-22DC09D0D7FD}.Release|Any CPU.ActiveCfg = Release|Win32
+ {29356642-C46E-4144-83D8-22DC09D0D7FD}.Release|Any CPU.Build.0 = Release|Win32
+ {29356642-C46E-4144-83D8-22DC09D0D7FD}.Release|x64.ActiveCfg = Release|x64
+ {29356642-C46E-4144-83D8-22DC09D0D7FD}.Release|x64.Build.0 = Release|x64
+ {29356642-C46E-4144-83D8-22DC09D0D7FD}.Release|x86.ActiveCfg = Release|Win32
+ {29356642-C46E-4144-83D8-22DC09D0D7FD}.Release|x86.Build.0 = Release|Win32
+ {5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}.Debug|x64.Build.0 = Debug|Any CPU
+ {5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}.Debug|x86.Build.0 = Debug|Any CPU
+ {5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}.Release|x64.ActiveCfg = Release|Any CPU
+ {5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}.Release|x64.Build.0 = Release|Any CPU
+ {5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}.Release|x86.ActiveCfg = Release|Any CPU
+ {5B2D8C81-7DE2-429C-AF90-B7C71D91F3B6}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {3C074481-9CDD-4780-B9F6-57BBC5092EA2}
+ EndGlobalSection
+EndGlobal
diff --git a/AssetStudio/7zip/Common/CRC.cs b/AssetStudio/7zip/Common/CRC.cs
new file mode 100644
index 0000000..995548f
--- /dev/null
+++ b/AssetStudio/7zip/Common/CRC.cs
@@ -0,0 +1,79 @@
+// Common/CRC.cs
+
+using System.Text;
+
+namespace SevenZip
+{
+ public class CRC
+ {
+ public static readonly uint[] Table;
+
+ static CRC()
+ {
+ Table = new uint[256];
+ const uint kPoly = 0xEDB88320;
+ for (uint i = 0; i < 256; i++)
+ {
+ uint r = i;
+ for (int j = 0; j < 8; j++)
+ if ((r & 1) != 0)
+ r = (r >> 1) ^ kPoly;
+ else
+ r >>= 1;
+ Table[i] = r;
+ }
+ }
+
+ uint _value = 0xFFFFFFFF;
+
+ public void Init() { _value = 0xFFFFFFFF; }
+
+ public void UpdateByte(byte b)
+ {
+ _value = Table[(((byte)(_value)) ^ b)] ^ (_value >> 8);
+ }
+
+ public void Update(byte[] data, uint offset, uint size)
+ {
+ for (uint i = 0; i < size; i++)
+ _value = Table[(((byte)(_value)) ^ data[offset + i])] ^ (_value >> 8);
+ }
+
+ public uint GetDigest() { return _value ^ 0xFFFFFFFF; }
+
+ static uint CalculateDigest(byte[] data, uint offset, uint size)
+ {
+ CRC crc = new CRC();
+ // crc.Init();
+ crc.Update(data, offset, size);
+ return crc.GetDigest();
+ }
+
+ static bool VerifyDigest(uint digest, byte[] data, uint offset, uint size)
+ {
+ return (CalculateDigest(data, offset, size) == digest);
+ }
+
+ public static uint CalculateDigestAscii(string data)
+ {
+ var bytes = Encoding.ASCII.GetBytes(data);
+ return CalculateDigest(bytes, 0, (uint)bytes.Length);
+ }
+
+ public static uint CalculateDigestUTF8(string data)
+ {
+ var bytes = Encoding.UTF8.GetBytes(data);
+ return CalculateDigest(bytes, 0, (uint)bytes.Length);
+ }
+
+ public static bool VerifyDigestUTF8(string data, uint digest)
+ {
+ return CalculateDigestUTF8(data) == digest;
+ }
+
+ public static bool Verify28DigestUTF8(string data, uint digest)
+ {
+ return (CalculateDigestUTF8(data) & 0xFFFFFFF) == digest;
+ }
+ }
+}
diff --git a/AssetStudio/7zip/Common/CommandLineParser.cs b/AssetStudio/7zip/Common/CommandLineParser.cs
new file mode 100644
index 0000000..8eabf59
--- /dev/null
+++ b/AssetStudio/7zip/Common/CommandLineParser.cs
@@ -0,0 +1,274 @@
+// CommandLineParser.cs
+
+using System;
+using System.Collections;
+
+namespace SevenZip.CommandLineParser
+{
+ public enum SwitchType
+ {
+ Simple,
+ PostMinus,
+ LimitedPostString,
+ UnLimitedPostString,
+ PostChar
+ }
+
+ public class SwitchForm
+ {
+ public string IDString;
+ public SwitchType Type;
+ public bool Multi;
+ public int MinLen;
+ public int MaxLen;
+ public string PostCharSet;
+
+ public SwitchForm(string idString, SwitchType type, bool multi,
+ int minLen, int maxLen, string postCharSet)
+ {
+ IDString = idString;
+ Type = type;
+ Multi = multi;
+ MinLen = minLen;
+ MaxLen = maxLen;
+ PostCharSet = postCharSet;
+ }
+ public SwitchForm(string idString, SwitchType type, bool multi, int minLen):
+ this(idString, type, multi, minLen, 0, "")
+ {
+ }
+ public SwitchForm(string idString, SwitchType type, bool multi):
+ this(idString, type, multi, 0)
+ {
+ }
+ }
+
+ public class SwitchResult
+ {
+ public bool ThereIs;
+ public bool WithMinus;
+ public ArrayList PostStrings = new ArrayList();
+ public int PostCharIndex;
+ public SwitchResult()
+ {
+ ThereIs = false;
+ }
+ }
+
+ public class Parser
+ {
+ public ArrayList NonSwitchStrings = new ArrayList();
+ SwitchResult[] _switches;
+
+ public Parser(int numSwitches)
+ {
+ _switches = new SwitchResult[numSwitches];
+ for (int i = 0; i < numSwitches; i++)
+ _switches[i] = new SwitchResult();
+ }
+
+ bool ParseString(string srcString, SwitchForm[] switchForms)
+ {
+ int len = srcString.Length;
+ if (len == 0)
+ return false;
+ int pos = 0;
+ if (!IsItSwitchChar(srcString[pos]))
+ return false;
+ while (pos < len)
+ {
+ if (IsItSwitchChar(srcString[pos]))
+ pos++;
+ const int kNoLen = -1;
+ int matchedSwitchIndex = 0;
+ int maxLen = kNoLen;
+ for (int switchIndex = 0; switchIndex < _switches.Length; switchIndex++)
+ {
+ int switchLen = switchForms[switchIndex].IDString.Length;
+ if (switchLen <= maxLen || pos + switchLen > len)
+ continue;
+ if (String.Compare(switchForms[switchIndex].IDString, 0,
+ srcString, pos, switchLen, true) == 0)
+ {
+ matchedSwitchIndex = switchIndex;
+ maxLen = switchLen;
+ }
+ }
+ if (maxLen == kNoLen)
+ throw new Exception("maxLen == kNoLen");
+ SwitchResult matchedSwitch = _switches[matchedSwitchIndex];
+ SwitchForm switchForm = switchForms[matchedSwitchIndex];
+ if ((!switchForm.Multi) && matchedSwitch.ThereIs)
+ throw new Exception("switch must be single");
+ matchedSwitch.ThereIs = true;
+ pos += maxLen;
+ int tailSize = len - pos;
+ SwitchType type = switchForm.Type;
+ switch (type)
+ {
+ case SwitchType.PostMinus:
+ {
+ if (tailSize == 0)
+ matchedSwitch.WithMinus = false;
+ else
+ {
+ matchedSwitch.WithMinus = (srcString[pos] == kSwitchMinus);
+ if (matchedSwitch.WithMinus)
+ pos++;
+ }
+ break;
+ }
+ case SwitchType.PostChar:
+ {
+ if (tailSize < switchForm.MinLen)
+ throw new Exception("switch is not full");
+ string charSet = switchForm.PostCharSet;
+ const int kEmptyCharValue = -1;
+ if (tailSize == 0)
+ matchedSwitch.PostCharIndex = kEmptyCharValue;
+ else
+ {
+ int index = charSet.IndexOf(srcString[pos]);
+ if (index < 0)
+ matchedSwitch.PostCharIndex = kEmptyCharValue;
+ else
+ {
+ matchedSwitch.PostCharIndex = index;
+ pos++;
+ }
+ }
+ break;
+ }
+ case SwitchType.LimitedPostString:
+ case SwitchType.UnLimitedPostString:
+ {
+ int minLen = switchForm.MinLen;
+ if (tailSize < minLen)
+ throw new Exception("switch is not full");
+ if (type == SwitchType.UnLimitedPostString)
+ {
+ matchedSwitch.PostStrings.Add(srcString.Substring(pos));
+ return true;
+ }
+ String stringSwitch = srcString.Substring(pos, minLen);
+ pos += minLen;
+ for (int i = minLen; i < switchForm.MaxLen && pos < len; i++, pos++)
+ {
+ char c = srcString[pos];
+ if (IsItSwitchChar(c))
+ break;
+ stringSwitch += c;
+ }
+ matchedSwitch.PostStrings.Add(stringSwitch);
+ break;
+ }
+ }
+ }
+ return true;
+
+ }
+
+ public void ParseStrings(SwitchForm[] switchForms, string[] commandStrings)
+ {
+ int numCommandStrings = commandStrings.Length;
+ bool stopSwitch = false;
+ for (int i = 0; i < numCommandStrings; i++)
+ {
+ string s = commandStrings[i];
+ if (stopSwitch)
+ NonSwitchStrings.Add(s);
+ else
+ if (s == kStopSwitchParsing)
+ stopSwitch = true;
+ else
+ if (!ParseString(s, switchForms))
+ NonSwitchStrings.Add(s);
+ }
+ }
+
+ public SwitchResult this[int index] { get { return _switches[index]; } }
+
+ public static int ParseCommand(CommandForm[] commandForms, string commandString,
+ out string postString)
+ {
+ for (int i = 0; i < commandForms.Length; i++)
+ {
+ string id = commandForms[i].IDString;
+ if (commandForms[i].PostStringMode)
+ {
+ if (commandString.IndexOf(id) == 0)
+ {
+ postString = commandString.Substring(id.Length);
+ return i;
+ }
+ }
+ else
+ if (commandString == id)
+ {
+ postString = "";
+ return i;
+ }
+ }
+ postString = "";
+ return -1;
+ }
+
+ static bool ParseSubCharsCommand(int numForms, CommandSubCharsSet[] forms,
+ string commandString, ArrayList indices)
+ {
+ indices.Clear();
+ int numUsedChars = 0;
+ for (int i = 0; i < numForms; i++)
+ {
+ CommandSubCharsSet charsSet = forms[i];
+ int currentIndex = -1;
+ int len = charsSet.Chars.Length;
+ for (int j = 0; j < len; j++)
+ {
+ char c = charsSet.Chars[j];
+ int newIndex = commandString.IndexOf(c);
+ if (newIndex >= 0)
+ {
+ if (currentIndex >= 0)
+ return false;
+ if (commandString.IndexOf(c, newIndex + 1) >= 0)
+ return false;
+ currentIndex = j;
+ numUsedChars++;
+ }
+ }
+ if (currentIndex == -1 && !charsSet.EmptyAllowed)
+ return false;
+ indices.Add(currentIndex);
+ }
+ return (numUsedChars == commandString.Length);
+ }
+ const char kSwitchID1 = '-';
+ const char kSwitchID2 = '/';
+
+ const char kSwitchMinus = '-';
+ const string kStopSwitchParsing = "--";
+
+ static bool IsItSwitchChar(char c)
+ {
+ return (c == kSwitchID1 || c == kSwitchID2);
+ }
+ }
+
+ public class CommandForm
+ {
+ public string IDString = "";
+ public bool PostStringMode = false;
+ public CommandForm(string idString, bool postStringMode)
+ {
+ IDString = idString;
+ PostStringMode = postStringMode;
+ }
+ }
+
+ class CommandSubCharsSet
+ {
+ public string Chars = "";
+ public bool EmptyAllowed = false;
+ }
+}
diff --git a/AssetStudio/7zip/Common/InBuffer.cs b/AssetStudio/7zip/Common/InBuffer.cs
new file mode 100644
index 0000000..7c51f0b
--- /dev/null
+++ b/AssetStudio/7zip/Common/InBuffer.cs
@@ -0,0 +1,72 @@
+// InBuffer.cs
+
+namespace SevenZip.Buffer
+{
+ public class InBuffer
+ {
+ byte[] m_Buffer;
+ uint m_Pos;
+ uint m_Limit;
+ uint m_BufferSize;
+ System.IO.Stream m_Stream;
+ bool m_StreamWasExhausted;
+ ulong m_ProcessedSize;
+
+ public InBuffer(uint bufferSize)
+ {
+ m_Buffer = new byte[bufferSize];
+ m_BufferSize = bufferSize;
+ }
+
+ public void Init(System.IO.Stream stream)
+ {
+ m_Stream = stream;
+ m_ProcessedSize = 0;
+ m_Limit = 0;
+ m_Pos = 0;
+ m_StreamWasExhausted = false;
+ }
+
+ public bool ReadBlock()
+ {
+ if (m_StreamWasExhausted)
+ return false;
+ m_ProcessedSize += m_Pos;
+ int aNumProcessedBytes = m_Stream.Read(m_Buffer, 0, (int)m_BufferSize);
+ m_Pos = 0;
+ m_Limit = (uint)aNumProcessedBytes;
+ m_StreamWasExhausted = (aNumProcessedBytes == 0);
+ return (!m_StreamWasExhausted);
+ }
+
+
+ public void ReleaseStream()
+ {
+ // m_Stream.Close();
+ m_Stream = null;
+ }
+
+ public bool ReadByte(byte b) // check it
+ {
+ if (m_Pos >= m_Limit)
+ if (!ReadBlock())
+ return false;
+ b = m_Buffer[m_Pos++];
+ return true;
+ }
+
+ public byte ReadByte()
+ {
+ // return (byte)m_Stream.ReadByte();
+ if (m_Pos >= m_Limit)
+ if (!ReadBlock())
+ return 0xFF;
+ return m_Buffer[m_Pos++];
+ }
+
+ public ulong GetProcessedSize()
+ {
+ return m_ProcessedSize + m_Pos;
+ }
+ }
+}
diff --git a/AssetStudio/7zip/Common/OutBuffer.cs b/AssetStudio/7zip/Common/OutBuffer.cs
new file mode 100644
index 0000000..2da16e1
--- /dev/null
+++ b/AssetStudio/7zip/Common/OutBuffer.cs
@@ -0,0 +1,47 @@
+// OutBuffer.cs
+
+namespace SevenZip.Buffer
+{
+ public class OutBuffer
+ {
+ byte[] m_Buffer;
+ uint m_Pos;
+ uint m_BufferSize;
+ System.IO.Stream m_Stream;
+ ulong m_ProcessedSize;
+
+ public OutBuffer(uint bufferSize)
+ {
+ m_Buffer = new byte[bufferSize];
+ m_BufferSize = bufferSize;
+ }
+
+ public void SetStream(System.IO.Stream stream) { m_Stream = stream; }
+ public void FlushStream() { m_Stream.Flush(); }
+ public void CloseStream() { m_Stream.Close(); }
+ public void ReleaseStream() { m_Stream = null; }
+
+ public void Init()
+ {
+ m_ProcessedSize = 0;
+ m_Pos = 0;
+ }
+
+ public void WriteByte(byte b)
+ {
+ m_Buffer[m_Pos++] = b;
+ if (m_Pos >= m_BufferSize)
+ FlushData();
+ }
+
+ public void FlushData()
+ {
+ if (m_Pos == 0)
+ return;
+ m_Stream.Write(m_Buffer, 0, (int)m_Pos);
+ m_Pos = 0;
+ }
+
+ public ulong GetProcessedSize() { return m_ProcessedSize + m_Pos; }
+ }
+}
diff --git a/AssetStudio/7zip/Compress/LZ/IMatchFinder.cs b/AssetStudio/7zip/Compress/LZ/IMatchFinder.cs
new file mode 100644
index 0000000..10ca2b3
--- /dev/null
+++ b/AssetStudio/7zip/Compress/LZ/IMatchFinder.cs
@@ -0,0 +1,24 @@
+// IMatchFinder.cs
+
+using System;
+
+namespace SevenZip.Compression.LZ
+{
+ interface IInWindowStream
+ {
+ void SetStream(System.IO.Stream inStream);
+ void Init();
+ void ReleaseStream();
+ Byte GetIndexByte(Int32 index);
+ UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit);
+ UInt32 GetNumAvailableBytes();
+ }
+
+ interface IMatchFinder : IInWindowStream
+ {
+ void Create(UInt32 historySize, UInt32 keepAddBufferBefore,
+ UInt32 matchMaxLen, UInt32 keepAddBufferAfter);
+ UInt32 GetMatches(UInt32[] distances);
+ void Skip(UInt32 num);
+ }
+}
diff --git a/AssetStudio/7zip/Compress/LZ/LzBinTree.cs b/AssetStudio/7zip/Compress/LZ/LzBinTree.cs
new file mode 100644
index 0000000..c1c006b
--- /dev/null
+++ b/AssetStudio/7zip/Compress/LZ/LzBinTree.cs
@@ -0,0 +1,367 @@
+// LzBinTree.cs
+
+using System;
+
+namespace SevenZip.Compression.LZ
+{
+ public class BinTree : InWindow, IMatchFinder
+ {
+ UInt32 _cyclicBufferPos;
+ UInt32 _cyclicBufferSize = 0;
+ UInt32 _matchMaxLen;
+
+ UInt32[] _son;
+ UInt32[] _hash;
+
+ UInt32 _cutValue = 0xFF;
+ UInt32 _hashMask;
+ UInt32 _hashSizeSum = 0;
+
+ bool HASH_ARRAY = true;
+
+ const UInt32 kHash2Size = 1 << 10;
+ const UInt32 kHash3Size = 1 << 16;
+ const UInt32 kBT2HashSize = 1 << 16;
+ const UInt32 kStartMaxLen = 1;
+ const UInt32 kHash3Offset = kHash2Size;
+ const UInt32 kEmptyHashValue = 0;
+ const UInt32 kMaxValForNormalize = ((UInt32)1 << 31) - 1;
+
+ UInt32 kNumHashDirectBytes = 0;
+ UInt32 kMinMatchCheck = 4;
+ UInt32 kFixHashSize = kHash2Size + kHash3Size;
+
+ public void SetType(int numHashBytes)
+ {
+ HASH_ARRAY = (numHashBytes > 2);
+ if (HASH_ARRAY)
+ {
+ kNumHashDirectBytes = 0;
+ kMinMatchCheck = 4;
+ kFixHashSize = kHash2Size + kHash3Size;
+ }
+ else
+ {
+ kNumHashDirectBytes = 2;
+ kMinMatchCheck = 2 + 1;
+ kFixHashSize = 0;
+ }
+ }
+
+ public new void SetStream(System.IO.Stream stream) { base.SetStream(stream); }
+ public new void ReleaseStream() { base.ReleaseStream(); }
+
+ public new void Init()
+ {
+ base.Init();
+ for (UInt32 i = 0; i < _hashSizeSum; i++)
+ _hash[i] = kEmptyHashValue;
+ _cyclicBufferPos = 0;
+ ReduceOffsets(-1);
+ }
+
+ public new void MovePos()
+ {
+ if (++_cyclicBufferPos >= _cyclicBufferSize)
+ _cyclicBufferPos = 0;
+ base.MovePos();
+ if (_pos == kMaxValForNormalize)
+ Normalize();
+ }
+
+ public new Byte GetIndexByte(Int32 index) { return base.GetIndexByte(index); }
+
+ public new UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit)
+ { return base.GetMatchLen(index, distance, limit); }
+
+ public new UInt32 GetNumAvailableBytes() { return base.GetNumAvailableBytes(); }
+
+ public void Create(UInt32 historySize, UInt32 keepAddBufferBefore,
+ UInt32 matchMaxLen, UInt32 keepAddBufferAfter)
+ {
+ if (historySize > kMaxValForNormalize - 256)
+ throw new Exception();
+ _cutValue = 16 + (matchMaxLen >> 1);
+
+ UInt32 windowReservSize = (historySize + keepAddBufferBefore +
+ matchMaxLen + keepAddBufferAfter) / 2 + 256;
+
+ base.Create(historySize + keepAddBufferBefore, matchMaxLen + keepAddBufferAfter, windowReservSize);
+
+ _matchMaxLen = matchMaxLen;
+
+ UInt32 cyclicBufferSize = historySize + 1;
+ if (_cyclicBufferSize != cyclicBufferSize)
+ _son = new UInt32[(_cyclicBufferSize = cyclicBufferSize) * 2];
+
+ UInt32 hs = kBT2HashSize;
+
+ if (HASH_ARRAY)
+ {
+ hs = historySize - 1;
+ hs |= (hs >> 1);
+ hs |= (hs >> 2);
+ hs |= (hs >> 4);
+ hs |= (hs >> 8);
+ hs >>= 1;
+ hs |= 0xFFFF;
+ if (hs > (1 << 24))
+ hs >>= 1;
+ _hashMask = hs;
+ hs++;
+ hs += kFixHashSize;
+ }
+ if (hs != _hashSizeSum)
+ _hash = new UInt32[_hashSizeSum = hs];
+ }
+
+ public UInt32 GetMatches(UInt32[] distances)
+ {
+ UInt32 lenLimit;
+ if (_pos + _matchMaxLen <= _streamPos)
+ lenLimit = _matchMaxLen;
+ else
+ {
+ lenLimit = _streamPos - _pos;
+ if (lenLimit < kMinMatchCheck)
+ {
+ MovePos();
+ return 0;
+ }
+ }
+
+ UInt32 offset = 0;
+ UInt32 matchMinPos = (_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0;
+ UInt32 cur = _bufferOffset + _pos;
+ UInt32 maxLen = kStartMaxLen; // to avoid items for len < hashSize;
+ UInt32 hashValue, hash2Value = 0, hash3Value = 0;
+
+ if (HASH_ARRAY)
+ {
+ UInt32 temp = CRC.Table[_bufferBase[cur]] ^ _bufferBase[cur + 1];
+ hash2Value = temp & (kHash2Size - 1);
+ temp ^= ((UInt32)(_bufferBase[cur + 2]) << 8);
+ hash3Value = temp & (kHash3Size - 1);
+ hashValue = (temp ^ (CRC.Table[_bufferBase[cur + 3]] << 5)) & _hashMask;
+ }
+ else
+ hashValue = _bufferBase[cur] ^ ((UInt32)(_bufferBase[cur + 1]) << 8);
+
+ UInt32 curMatch = _hash[kFixHashSize + hashValue];
+ if (HASH_ARRAY)
+ {
+ UInt32 curMatch2 = _hash[hash2Value];
+ UInt32 curMatch3 = _hash[kHash3Offset + hash3Value];
+ _hash[hash2Value] = _pos;
+ _hash[kHash3Offset + hash3Value] = _pos;
+ if (curMatch2 > matchMinPos)
+ if (_bufferBase[_bufferOffset + curMatch2] == _bufferBase[cur])
+ {
+ distances[offset++] = maxLen = 2;
+ distances[offset++] = _pos - curMatch2 - 1;
+ }
+ if (curMatch3 > matchMinPos)
+ if (_bufferBase[_bufferOffset + curMatch3] == _bufferBase[cur])
+ {
+ if (curMatch3 == curMatch2)
+ offset -= 2;
+ distances[offset++] = maxLen = 3;
+ distances[offset++] = _pos - curMatch3 - 1;
+ curMatch2 = curMatch3;
+ }
+ if (offset != 0 && curMatch2 == curMatch)
+ {
+ offset -= 2;
+ maxLen = kStartMaxLen;
+ }
+ }
+
+ _hash[kFixHashSize + hashValue] = _pos;
+
+ UInt32 ptr0 = (_cyclicBufferPos << 1) + 1;
+ UInt32 ptr1 = (_cyclicBufferPos << 1);
+
+ UInt32 len0, len1;
+ len0 = len1 = kNumHashDirectBytes;
+
+ if (kNumHashDirectBytes != 0)
+ {
+ if (curMatch > matchMinPos)
+ {
+ if (_bufferBase[_bufferOffset + curMatch + kNumHashDirectBytes] !=
+ _bufferBase[cur + kNumHashDirectBytes])
+ {
+ distances[offset++] = maxLen = kNumHashDirectBytes;
+ distances[offset++] = _pos - curMatch - 1;
+ }
+ }
+ }
+
+ UInt32 count = _cutValue;
+
+ while(true)
+ {
+ if(curMatch <= matchMinPos || count-- == 0)
+ {
+ _son[ptr0] = _son[ptr1] = kEmptyHashValue;
+ break;
+ }
+ UInt32 delta = _pos - curMatch;
+ UInt32 cyclicPos = ((delta <= _cyclicBufferPos) ?
+ (_cyclicBufferPos - delta) :
+ (_cyclicBufferPos - delta + _cyclicBufferSize)) << 1;
+
+ UInt32 pby1 = _bufferOffset + curMatch;
+ UInt32 len = Math.Min(len0, len1);
+ if (_bufferBase[pby1 + len] == _bufferBase[cur + len])
+ {
+ while(++len != lenLimit)
+ if (_bufferBase[pby1 + len] != _bufferBase[cur + len])
+ break;
+ if (maxLen < len)
+ {
+ distances[offset++] = maxLen = len;
+ distances[offset++] = delta - 1;
+ if (len == lenLimit)
+ {
+ _son[ptr1] = _son[cyclicPos];
+ _son[ptr0] = _son[cyclicPos + 1];
+ break;
+ }
+ }
+ }
+ if (_bufferBase[pby1 + len] < _bufferBase[cur + len])
+ {
+ _son[ptr1] = curMatch;
+ ptr1 = cyclicPos + 1;
+ curMatch = _son[ptr1];
+ len1 = len;
+ }
+ else
+ {
+ _son[ptr0] = curMatch;
+ ptr0 = cyclicPos;
+ curMatch = _son[ptr0];
+ len0 = len;
+ }
+ }
+ MovePos();
+ return offset;
+ }
+
+ public void Skip(UInt32 num)
+ {
+ do
+ {
+ UInt32 lenLimit;
+ if (_pos + _matchMaxLen <= _streamPos)
+ lenLimit = _matchMaxLen;
+ else
+ {
+ lenLimit = _streamPos - _pos;
+ if (lenLimit < kMinMatchCheck)
+ {
+ MovePos();
+ continue;
+ }
+ }
+
+ UInt32 matchMinPos = (_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0;
+ UInt32 cur = _bufferOffset + _pos;
+
+ UInt32 hashValue;
+
+ if (HASH_ARRAY)
+ {
+ UInt32 temp = CRC.Table[_bufferBase[cur]] ^ _bufferBase[cur + 1];
+ UInt32 hash2Value = temp & (kHash2Size - 1);
+ _hash[hash2Value] = _pos;
+ temp ^= ((UInt32)(_bufferBase[cur + 2]) << 8);
+ UInt32 hash3Value = temp & (kHash3Size - 1);
+ _hash[kHash3Offset + hash3Value] = _pos;
+ hashValue = (temp ^ (CRC.Table[_bufferBase[cur + 3]] << 5)) & _hashMask;
+ }
+ else
+ hashValue = _bufferBase[cur] ^ ((UInt32)(_bufferBase[cur + 1]) << 8);
+
+ UInt32 curMatch = _hash[kFixHashSize + hashValue];
+ _hash[kFixHashSize + hashValue] = _pos;
+
+ UInt32 ptr0 = (_cyclicBufferPos << 1) + 1;
+ UInt32 ptr1 = (_cyclicBufferPos << 1);
+
+ UInt32 len0, len1;
+ len0 = len1 = kNumHashDirectBytes;
+
+ UInt32 count = _cutValue;
+ while (true)
+ {
+ if (curMatch <= matchMinPos || count-- == 0)
+ {
+ _son[ptr0] = _son[ptr1] = kEmptyHashValue;
+ break;
+ }
+
+ UInt32 delta = _pos - curMatch;
+ UInt32 cyclicPos = ((delta <= _cyclicBufferPos) ?
+ (_cyclicBufferPos - delta) :
+ (_cyclicBufferPos - delta + _cyclicBufferSize)) << 1;
+
+ UInt32 pby1 = _bufferOffset + curMatch;
+ UInt32 len = Math.Min(len0, len1);
+ if (_bufferBase[pby1 + len] == _bufferBase[cur + len])
+ {
+ while (++len != lenLimit)
+ if (_bufferBase[pby1 + len] != _bufferBase[cur + len])
+ break;
+ if (len == lenLimit)
+ {
+ _son[ptr1] = _son[cyclicPos];
+ _son[ptr0] = _son[cyclicPos + 1];
+ break;
+ }
+ }
+ if (_bufferBase[pby1 + len] < _bufferBase[cur + len])
+ {
+ _son[ptr1] = curMatch;
+ ptr1 = cyclicPos + 1;
+ curMatch = _son[ptr1];
+ len1 = len;
+ }
+ else
+ {
+ _son[ptr0] = curMatch;
+ ptr0 = cyclicPos;
+ curMatch = _son[ptr0];
+ len0 = len;
+ }
+ }
+ MovePos();
+ }
+ while (--num != 0);
+ }
+
+ void NormalizeLinks(UInt32[] items, UInt32 numItems, UInt32 subValue)
+ {
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ UInt32 value = items[i];
+ if (value <= subValue)
+ value = kEmptyHashValue;
+ else
+ value -= subValue;
+ items[i] = value;
+ }
+ }
+
+ void Normalize()
+ {
+ UInt32 subValue = _pos - _cyclicBufferSize;
+ NormalizeLinks(_son, _cyclicBufferSize * 2, subValue);
+ NormalizeLinks(_hash, _hashSizeSum, subValue);
+ ReduceOffsets((Int32)subValue);
+ }
+
+ public void SetCutValue(UInt32 cutValue) { _cutValue = cutValue; }
+ }
+}
diff --git a/AssetStudio/7zip/Compress/LZ/LzInWindow.cs b/AssetStudio/7zip/Compress/LZ/LzInWindow.cs
new file mode 100644
index 0000000..52d23ce
--- /dev/null
+++ b/AssetStudio/7zip/Compress/LZ/LzInWindow.cs
@@ -0,0 +1,132 @@
+// LzInWindow.cs
+
+using System;
+
+namespace SevenZip.Compression.LZ
+{
+ public class InWindow
+ {
+ public Byte[] _bufferBase = null; // pointer to buffer with data
+ System.IO.Stream _stream;
+ UInt32 _posLimit; // offset (from _buffer) of first byte when new block reading must be done
+ bool _streamEndWasReached; // if (true) then _streamPos shows real end of stream
+
+ UInt32 _pointerToLastSafePosition;
+
+ public UInt32 _bufferOffset;
+
+ public UInt32 _blockSize; // Size of Allocated memory block
+ public UInt32 _pos; // offset (from _buffer) of curent byte
+ UInt32 _keepSizeBefore; // how many BYTEs must be kept in buffer before _pos
+ UInt32 _keepSizeAfter; // how many BYTEs must be kept buffer after _pos
+ public UInt32 _streamPos; // offset (from _buffer) of first not read byte from Stream
+
+ public void MoveBlock()
+ {
+ UInt32 offset = (UInt32)(_bufferOffset) + _pos - _keepSizeBefore;
+ // we need one additional byte, since MovePos moves on 1 byte.
+ if (offset > 0)
+ offset--;
+
+ UInt32 numBytes = (UInt32)(_bufferOffset) + _streamPos - offset;
+
+ // check negative offset ????
+ for (UInt32 i = 0; i < numBytes; i++)
+ _bufferBase[i] = _bufferBase[offset + i];
+ _bufferOffset -= offset;
+ }
+
+ public virtual void ReadBlock()
+ {
+ if (_streamEndWasReached)
+ return;
+ while (true)
+ {
+ int size = (int)((0 - _bufferOffset) + _blockSize - _streamPos);
+ if (size == 0)
+ return;
+ int numReadBytes = _stream.Read(_bufferBase, (int)(_bufferOffset + _streamPos), size);
+ if (numReadBytes == 0)
+ {
+ _posLimit = _streamPos;
+ UInt32 pointerToPostion = _bufferOffset + _posLimit;
+ if (pointerToPostion > _pointerToLastSafePosition)
+ _posLimit = (UInt32)(_pointerToLastSafePosition - _bufferOffset);
+
+ _streamEndWasReached = true;
+ return;
+ }
+ _streamPos += (UInt32)numReadBytes;
+ if (_streamPos >= _pos + _keepSizeAfter)
+ _posLimit = _streamPos - _keepSizeAfter;
+ }
+ }
+
+ void Free() { _bufferBase = null; }
+
+ public void Create(UInt32 keepSizeBefore, UInt32 keepSizeAfter, UInt32 keepSizeReserv)
+ {
+ _keepSizeBefore = keepSizeBefore;
+ _keepSizeAfter = keepSizeAfter;
+ UInt32 blockSize = keepSizeBefore + keepSizeAfter + keepSizeReserv;
+ if (_bufferBase == null || _blockSize != blockSize)
+ {
+ Free();
+ _blockSize = blockSize;
+ _bufferBase = new Byte[_blockSize];
+ }
+ _pointerToLastSafePosition = _blockSize - keepSizeAfter;
+ }
+
+ public void SetStream(System.IO.Stream stream) { _stream = stream; }
+ public void ReleaseStream() { _stream = null; }
+
+ public void Init()
+ {
+ _bufferOffset = 0;
+ _pos = 0;
+ _streamPos = 0;
+ _streamEndWasReached = false;
+ ReadBlock();
+ }
+
+ public void MovePos()
+ {
+ _pos++;
+ if (_pos > _posLimit)
+ {
+ UInt32 pointerToPostion = _bufferOffset + _pos;
+ if (pointerToPostion > _pointerToLastSafePosition)
+ MoveBlock();
+ ReadBlock();
+ }
+ }
+
+ public Byte GetIndexByte(Int32 index) { return _bufferBase[_bufferOffset + _pos + index]; }
+
+ // index + limit have not to exceed _keepSizeAfter;
+ public UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit)
+ {
+ if (_streamEndWasReached)
+ if ((_pos + index) + limit > _streamPos)
+ limit = _streamPos - (UInt32)(_pos + index);
+ distance++;
+ // Byte *pby = _buffer + (size_t)_pos + index;
+ UInt32 pby = _bufferOffset + _pos + (UInt32)index;
+
+ UInt32 i;
+ for (i = 0; i < limit && _bufferBase[pby + i] == _bufferBase[pby + i - distance]; i++);
+ return i;
+ }
+
+ public UInt32 GetNumAvailableBytes() { return _streamPos - _pos; }
+
+ public void ReduceOffsets(Int32 subValue)
+ {
+ _bufferOffset += (UInt32)subValue;
+ _posLimit -= (UInt32)subValue;
+ _pos -= (UInt32)subValue;
+ _streamPos -= (UInt32)subValue;
+ }
+ }
+}
diff --git a/AssetStudio/7zip/Compress/LZ/LzOutWindow.cs b/AssetStudio/7zip/Compress/LZ/LzOutWindow.cs
new file mode 100644
index 0000000..c998584
--- /dev/null
+++ b/AssetStudio/7zip/Compress/LZ/LzOutWindow.cs
@@ -0,0 +1,110 @@
+// LzOutWindow.cs
+
+namespace SevenZip.Compression.LZ
+{
+ public class OutWindow
+ {
+ byte[] _buffer = null;
+ uint _pos;
+ uint _windowSize = 0;
+ uint _streamPos;
+ System.IO.Stream _stream;
+
+ public uint TrainSize = 0;
+
+ public void Create(uint windowSize)
+ {
+ if (_windowSize != windowSize)
+ {
+ // System.GC.Collect();
+ _buffer = new byte[windowSize];
+ }
+ _windowSize = windowSize;
+ _pos = 0;
+ _streamPos = 0;
+ }
+
+ public void Init(System.IO.Stream stream, bool solid)
+ {
+ ReleaseStream();
+ _stream = stream;
+ if (!solid)
+ {
+ _streamPos = 0;
+ _pos = 0;
+ TrainSize = 0;
+ }
+ }
+
+ public bool Train(System.IO.Stream stream)
+ {
+ long len = stream.Length;
+ uint size = (len < _windowSize) ? (uint)len : _windowSize;
+ TrainSize = size;
+ stream.Position = len - size;
+ _streamPos = _pos = 0;
+ while (size > 0)
+ {
+ uint curSize = _windowSize - _pos;
+ if (size < curSize)
+ curSize = size;
+ int numReadBytes = stream.Read(_buffer, (int)_pos, (int)curSize);
+ if (numReadBytes == 0)
+ return false;
+ size -= (uint)numReadBytes;
+ _pos += (uint)numReadBytes;
+ _streamPos += (uint)numReadBytes;
+ if (_pos == _windowSize)
+ _streamPos = _pos = 0;
+ }
+ return true;
+ }
+
+ public void ReleaseStream()
+ {
+ Flush();
+ _stream = null;
+ }
+
+ public void Flush()
+ {
+ uint size = _pos - _streamPos;
+ if (size == 0)
+ return;
+ _stream.Write(_buffer, (int)_streamPos, (int)size);
+ if (_pos >= _windowSize)
+ _pos = 0;
+ _streamPos = _pos;
+ }
+
+ public void CopyBlock(uint distance, uint len)
+ {
+ uint pos = _pos - distance - 1;
+ if (pos >= _windowSize)
+ pos += _windowSize;
+ for (; len > 0; len--)
+ {
+ if (pos >= _windowSize)
+ pos = 0;
+ _buffer[_pos++] = _buffer[pos++];
+ if (_pos >= _windowSize)
+ Flush();
+ }
+ }
+
+ public void PutByte(byte b)
+ {
+ _buffer[_pos++] = b;
+ if (_pos >= _windowSize)
+ Flush();
+ }
+
+ public byte GetByte(uint distance)
+ {
+ uint pos = _pos - distance - 1;
+ if (pos >= _windowSize)
+ pos += _windowSize;
+ return _buffer[pos];
+ }
+ }
+}
diff --git a/AssetStudio/7zip/Compress/LZMA/LzmaBase.cs b/AssetStudio/7zip/Compress/LZMA/LzmaBase.cs
new file mode 100644
index 0000000..c7bca86
--- /dev/null
+++ b/AssetStudio/7zip/Compress/LZMA/LzmaBase.cs
@@ -0,0 +1,76 @@
+// LzmaBase.cs
+
+namespace SevenZip.Compression.LZMA
+{
+ internal abstract class Base
+ {
+ public const uint kNumRepDistances = 4;
+ public const uint kNumStates = 12;
+
+ // static byte []kLiteralNextStates = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
+ // static byte []kMatchNextStates = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
+ // static byte []kRepNextStates = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
+ // static byte []kShortRepNextStates = {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
+
+ public struct State
+ {
+ public uint Index;
+ public void Init() { Index = 0; }
+ public void UpdateChar()
+ {
+ if (Index < 4) Index = 0;
+ else if (Index < 10) Index -= 3;
+ else Index -= 6;
+ }
+ public void UpdateMatch() { Index = (uint)(Index < 7 ? 7 : 10); }
+ public void UpdateRep() { Index = (uint)(Index < 7 ? 8 : 11); }
+ public void UpdateShortRep() { Index = (uint)(Index < 7 ? 9 : 11); }
+ public bool IsCharState() { return Index < 7; }
+ }
+
+ public const int kNumPosSlotBits = 6;
+ public const int kDicLogSizeMin = 0;
+ // public const int kDicLogSizeMax = 30;
+ // public const uint kDistTableSizeMax = kDicLogSizeMax * 2;
+
+ public const int kNumLenToPosStatesBits = 2; // it's for speed optimization
+ public const uint kNumLenToPosStates = 1 << kNumLenToPosStatesBits;
+
+ public const uint kMatchMinLen = 2;
+
+ public static uint GetLenToPosState(uint len)
+ {
+ len -= kMatchMinLen;
+ if (len < kNumLenToPosStates)
+ return len;
+ return (uint)(kNumLenToPosStates - 1);
+ }
+
+ public const int kNumAlignBits = 4;
+ public const uint kAlignTableSize = 1 << kNumAlignBits;
+ public const uint kAlignMask = (kAlignTableSize - 1);
+
+ public const uint kStartPosModelIndex = 4;
+ public const uint kEndPosModelIndex = 14;
+ public const uint kNumPosModels = kEndPosModelIndex - kStartPosModelIndex;
+
+ public const uint kNumFullDistances = 1 << ((int)kEndPosModelIndex / 2);
+
+ public const uint kNumLitPosStatesBitsEncodingMax = 4;
+ public const uint kNumLitContextBitsMax = 8;
+
+ public const int kNumPosStatesBitsMax = 4;
+ public const uint kNumPosStatesMax = (1 << kNumPosStatesBitsMax);
+ public const int kNumPosStatesBitsEncodingMax = 4;
+ public const uint kNumPosStatesEncodingMax = (1 << kNumPosStatesBitsEncodingMax);
+
+ public const int kNumLowLenBits = 3;
+ public const int kNumMidLenBits = 3;
+ public const int kNumHighLenBits = 8;
+ public const uint kNumLowLenSymbols = 1 << kNumLowLenBits;
+ public const uint kNumMidLenSymbols = 1 << kNumMidLenBits;
+ public const uint kNumLenSymbols = kNumLowLenSymbols + kNumMidLenSymbols +
+ (1 << kNumHighLenBits);
+ public const uint kMatchMaxLen = kMatchMinLen + kNumLenSymbols - 1;
+ }
+}
diff --git a/AssetStudio/7zip/Compress/LZMA/LzmaDecoder.cs b/AssetStudio/7zip/Compress/LZMA/LzmaDecoder.cs
new file mode 100644
index 0000000..a9be39f
--- /dev/null
+++ b/AssetStudio/7zip/Compress/LZMA/LzmaDecoder.cs
@@ -0,0 +1,398 @@
+// LzmaDecoder.cs
+
+using System;
+
+namespace SevenZip.Compression.LZMA
+{
+ using RangeCoder;
+
+ public class Decoder : ICoder, ISetDecoderProperties // ,System.IO.Stream
+ {
+ class LenDecoder
+ {
+ BitDecoder m_Choice = new BitDecoder();
+ BitDecoder m_Choice2 = new BitDecoder();
+ BitTreeDecoder[] m_LowCoder = new BitTreeDecoder[Base.kNumPosStatesMax];
+ BitTreeDecoder[] m_MidCoder = new BitTreeDecoder[Base.kNumPosStatesMax];
+ BitTreeDecoder m_HighCoder = new BitTreeDecoder(Base.kNumHighLenBits);
+ uint m_NumPosStates = 0;
+
+ public void Create(uint numPosStates)
+ {
+ for (uint posState = m_NumPosStates; posState < numPosStates; posState++)
+ {
+ m_LowCoder[posState] = new BitTreeDecoder(Base.kNumLowLenBits);
+ m_MidCoder[posState] = new BitTreeDecoder(Base.kNumMidLenBits);
+ }
+ m_NumPosStates = numPosStates;
+ }
+
+ public void Init()
+ {
+ m_Choice.Init();
+ for (uint posState = 0; posState < m_NumPosStates; posState++)
+ {
+ m_LowCoder[posState].Init();
+ m_MidCoder[posState].Init();
+ }
+ m_Choice2.Init();
+ m_HighCoder.Init();
+ }
+
+ public uint Decode(RangeCoder.Decoder rangeDecoder, uint posState)
+ {
+ if (m_Choice.Decode(rangeDecoder) == 0)
+ return m_LowCoder[posState].Decode(rangeDecoder);
+ else
+ {
+ uint symbol = Base.kNumLowLenSymbols;
+ if (m_Choice2.Decode(rangeDecoder) == 0)
+ symbol += m_MidCoder[posState].Decode(rangeDecoder);
+ else
+ {
+ symbol += Base.kNumMidLenSymbols;
+ symbol += m_HighCoder.Decode(rangeDecoder);
+ }
+ return symbol;
+ }
+ }
+ }
+
+ class LiteralDecoder
+ {
+ struct Decoder2
+ {
+ BitDecoder[] m_Decoders;
+ public void Create() { m_Decoders = new BitDecoder[0x300]; }
+ public void Init() { for (int i = 0; i < 0x300; i++) m_Decoders[i].Init(); }
+
+ public byte DecodeNormal(RangeCoder.Decoder rangeDecoder)
+ {
+ uint symbol = 1;
+ do
+ symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeDecoder);
+ while (symbol < 0x100);
+ return (byte)symbol;
+ }
+
+ public byte DecodeWithMatchByte(RangeCoder.Decoder rangeDecoder, byte matchByte)
+ {
+ uint symbol = 1;
+ do
+ {
+ uint matchBit = (uint)(matchByte >> 7) & 1;
+ matchByte <<= 1;
+ uint bit = m_Decoders[((1 + matchBit) << 8) + symbol].Decode(rangeDecoder);
+ symbol = (symbol << 1) | bit;
+ if (matchBit != bit)
+ {
+ while (symbol < 0x100)
+ symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeDecoder);
+ break;
+ }
+ }
+ while (symbol < 0x100);
+ return (byte)symbol;
+ }
+ }
+
+ Decoder2[] m_Coders;
+ int m_NumPrevBits;
+ int m_NumPosBits;
+ uint m_PosMask;
+
+ public void Create(int numPosBits, int numPrevBits)
+ {
+ if (m_Coders != null && m_NumPrevBits == numPrevBits &&
+ m_NumPosBits == numPosBits)
+ return;
+ m_NumPosBits = numPosBits;
+ m_PosMask = ((uint)1 << numPosBits) - 1;
+ m_NumPrevBits = numPrevBits;
+ uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits);
+ m_Coders = new Decoder2[numStates];
+ for (uint i = 0; i < numStates; i++)
+ m_Coders[i].Create();
+ }
+
+ public void Init()
+ {
+ uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits);
+ for (uint i = 0; i < numStates; i++)
+ m_Coders[i].Init();
+ }
+
+ uint GetState(uint pos, byte prevByte)
+ { return ((pos & m_PosMask) << m_NumPrevBits) + (uint)(prevByte >> (8 - m_NumPrevBits)); }
+
+ public byte DecodeNormal(RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte)
+ { return m_Coders[GetState(pos, prevByte)].DecodeNormal(rangeDecoder); }
+
+ public byte DecodeWithMatchByte(RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte, byte matchByte)
+ { return m_Coders[GetState(pos, prevByte)].DecodeWithMatchByte(rangeDecoder, matchByte); }
+ };
+
+ LZ.OutWindow m_OutWindow = new LZ.OutWindow();
+ RangeCoder.Decoder m_RangeDecoder = new RangeCoder.Decoder();
+
+ BitDecoder[] m_IsMatchDecoders = new BitDecoder[Base.kNumStates << Base.kNumPosStatesBitsMax];
+ BitDecoder[] m_IsRepDecoders = new BitDecoder[Base.kNumStates];
+ BitDecoder[] m_IsRepG0Decoders = new BitDecoder[Base.kNumStates];
+ BitDecoder[] m_IsRepG1Decoders = new BitDecoder[Base.kNumStates];
+ BitDecoder[] m_IsRepG2Decoders = new BitDecoder[Base.kNumStates];
+ BitDecoder[] m_IsRep0LongDecoders = new BitDecoder[Base.kNumStates << Base.kNumPosStatesBitsMax];
+
+ BitTreeDecoder[] m_PosSlotDecoder = new BitTreeDecoder[Base.kNumLenToPosStates];
+ BitDecoder[] m_PosDecoders = new BitDecoder[Base.kNumFullDistances - Base.kEndPosModelIndex];
+
+ BitTreeDecoder m_PosAlignDecoder = new BitTreeDecoder(Base.kNumAlignBits);
+
+ LenDecoder m_LenDecoder = new LenDecoder();
+ LenDecoder m_RepLenDecoder = new LenDecoder();
+
+ LiteralDecoder m_LiteralDecoder = new LiteralDecoder();
+
+ uint m_DictionarySize;
+ uint m_DictionarySizeCheck;
+
+ uint m_PosStateMask;
+
+ public Decoder()
+ {
+ m_DictionarySize = 0xFFFFFFFF;
+ for (int i = 0; i < Base.kNumLenToPosStates; i++)
+ m_PosSlotDecoder[i] = new BitTreeDecoder(Base.kNumPosSlotBits);
+ }
+
+ void SetDictionarySize(uint dictionarySize)
+ {
+ if (m_DictionarySize != dictionarySize)
+ {
+ m_DictionarySize = dictionarySize;
+ m_DictionarySizeCheck = Math.Max(m_DictionarySize, 1);
+ uint blockSize = Math.Max(m_DictionarySizeCheck, (1 << 12));
+ m_OutWindow.Create(blockSize);
+ }
+ }
+
+ void SetLiteralProperties(int lp, int lc)
+ {
+ if (lp > 8)
+ throw new InvalidParamException();
+ if (lc > 8)
+ throw new InvalidParamException();
+ m_LiteralDecoder.Create(lp, lc);
+ }
+
+ void SetPosBitsProperties(int pb)
+ {
+ if (pb > Base.kNumPosStatesBitsMax)
+ throw new InvalidParamException();
+ uint numPosStates = (uint)1 << pb;
+ m_LenDecoder.Create(numPosStates);
+ m_RepLenDecoder.Create(numPosStates);
+ m_PosStateMask = numPosStates - 1;
+ }
+
+ bool _solid = false;
+ void Init(System.IO.Stream inStream, System.IO.Stream outStream)
+ {
+ m_RangeDecoder.Init(inStream);
+ m_OutWindow.Init(outStream, _solid);
+
+ uint i;
+ for (i = 0; i < Base.kNumStates; i++)
+ {
+ for (uint j = 0; j <= m_PosStateMask; j++)
+ {
+ uint index = (i << Base.kNumPosStatesBitsMax) + j;
+ m_IsMatchDecoders[index].Init();
+ m_IsRep0LongDecoders[index].Init();
+ }
+ m_IsRepDecoders[i].Init();
+ m_IsRepG0Decoders[i].Init();
+ m_IsRepG1Decoders[i].Init();
+ m_IsRepG2Decoders[i].Init();
+ }
+
+ m_LiteralDecoder.Init();
+ for (i = 0; i < Base.kNumLenToPosStates; i++)
+ m_PosSlotDecoder[i].Init();
+ // m_PosSpecDecoder.Init();
+ for (i = 0; i < Base.kNumFullDistances - Base.kEndPosModelIndex; i++)
+ m_PosDecoders[i].Init();
+
+ m_LenDecoder.Init();
+ m_RepLenDecoder.Init();
+ m_PosAlignDecoder.Init();
+ }
+
+ public void Code(System.IO.Stream inStream, System.IO.Stream outStream,
+ Int64 inSize, Int64 outSize, ICodeProgress progress)
+ {
+ Init(inStream, outStream);
+
+ Base.State state = new Base.State();
+ state.Init();
+ uint rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0;
+
+ UInt64 nowPos64 = 0;
+ UInt64 outSize64 = (UInt64)outSize;
+ if (nowPos64 < outSize64)
+ {
+ if (m_IsMatchDecoders[state.Index << Base.kNumPosStatesBitsMax].Decode(m_RangeDecoder) != 0)
+ throw new DataErrorException();
+ state.UpdateChar();
+ byte b = m_LiteralDecoder.DecodeNormal(m_RangeDecoder, 0, 0);
+ m_OutWindow.PutByte(b);
+ nowPos64++;
+ }
+ while (nowPos64 < outSize64)
+ {
+ // UInt64 next = Math.Min(nowPos64 + (1 << 18), outSize64);
+ // while(nowPos64 < next)
+ {
+ uint posState = (uint)nowPos64 & m_PosStateMask;
+ if (m_IsMatchDecoders[(state.Index << Base.kNumPosStatesBitsMax) + posState].Decode(m_RangeDecoder) == 0)
+ {
+ byte b;
+ byte prevByte = m_OutWindow.GetByte(0);
+ if (!state.IsCharState())
+ b = m_LiteralDecoder.DecodeWithMatchByte(m_RangeDecoder,
+ (uint)nowPos64, prevByte, m_OutWindow.GetByte(rep0));
+ else
+ b = m_LiteralDecoder.DecodeNormal(m_RangeDecoder, (uint)nowPos64, prevByte);
+ m_OutWindow.PutByte(b);
+ state.UpdateChar();
+ nowPos64++;
+ }
+ else
+ {
+ uint len;
+ if (m_IsRepDecoders[state.Index].Decode(m_RangeDecoder) == 1)
+ {
+ if (m_IsRepG0Decoders[state.Index].Decode(m_RangeDecoder) == 0)
+ {
+ if (m_IsRep0LongDecoders[(state.Index << Base.kNumPosStatesBitsMax) + posState].Decode(m_RangeDecoder) == 0)
+ {
+ state.UpdateShortRep();
+ m_OutWindow.PutByte(m_OutWindow.GetByte(rep0));
+ nowPos64++;
+ continue;
+ }
+ }
+ else
+ {
+ UInt32 distance;
+ if (m_IsRepG1Decoders[state.Index].Decode(m_RangeDecoder) == 0)
+ {
+ distance = rep1;
+ }
+ else
+ {
+ if (m_IsRepG2Decoders[state.Index].Decode(m_RangeDecoder) == 0)
+ distance = rep2;
+ else
+ {
+ distance = rep3;
+ rep3 = rep2;
+ }
+ rep2 = rep1;
+ }
+ rep1 = rep0;
+ rep0 = distance;
+ }
+ len = m_RepLenDecoder.Decode(m_RangeDecoder, posState) + Base.kMatchMinLen;
+ state.UpdateRep();
+ }
+ else
+ {
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ len = Base.kMatchMinLen + m_LenDecoder.Decode(m_RangeDecoder, posState);
+ state.UpdateMatch();
+ uint posSlot = m_PosSlotDecoder[Base.GetLenToPosState(len)].Decode(m_RangeDecoder);
+ if (posSlot >= Base.kStartPosModelIndex)
+ {
+ int numDirectBits = (int)((posSlot >> 1) - 1);
+ rep0 = ((2 | (posSlot & 1)) << numDirectBits);
+ if (posSlot < Base.kEndPosModelIndex)
+ rep0 += BitTreeDecoder.ReverseDecode(m_PosDecoders,
+ rep0 - posSlot - 1, m_RangeDecoder, numDirectBits);
+ else
+ {
+ rep0 += (m_RangeDecoder.DecodeDirectBits(
+ numDirectBits - Base.kNumAlignBits) << Base.kNumAlignBits);
+ rep0 += m_PosAlignDecoder.ReverseDecode(m_RangeDecoder);
+ }
+ }
+ else
+ rep0 = posSlot;
+ }
+ if (rep0 >= m_OutWindow.TrainSize + nowPos64 || rep0 >= m_DictionarySizeCheck)
+ {
+ if (rep0 == 0xFFFFFFFF)
+ break;
+ throw new DataErrorException();
+ }
+ m_OutWindow.CopyBlock(rep0, len);
+ nowPos64 += len;
+ }
+ }
+ }
+ m_OutWindow.Flush();
+ m_OutWindow.ReleaseStream();
+ m_RangeDecoder.ReleaseStream();
+ }
+
+ public void SetDecoderProperties(byte[] properties)
+ {
+ if (properties.Length < 5)
+ throw new InvalidParamException();
+ int lc = properties[0] % 9;
+ int remainder = properties[0] / 9;
+ int lp = remainder % 5;
+ int pb = remainder / 5;
+ if (pb > Base.kNumPosStatesBitsMax)
+ throw new InvalidParamException();
+ UInt32 dictionarySize = 0;
+ for (int i = 0; i < 4; i++)
+ dictionarySize += ((UInt32)(properties[1 + i])) << (i * 8);
+ SetDictionarySize(dictionarySize);
+ SetLiteralProperties(lp, lc);
+ SetPosBitsProperties(pb);
+ }
+
+ public bool Train(System.IO.Stream stream)
+ {
+ _solid = true;
+ return m_OutWindow.Train(stream);
+ }
+
+ /*
+ public override bool CanRead { get { return true; }}
+ public override bool CanWrite { get { return true; }}
+ public override bool CanSeek { get { return true; }}
+ public override long Length { get { return 0; }}
+ public override long Position
+ {
+ get { return 0; }
+ set { }
+ }
+ public override void Flush() { }
+ public override int Read(byte[] buffer, int offset, int count)
+ {
+ return 0;
+ }
+ public override void Write(byte[] buffer, int offset, int count)
+ {
+ }
+ public override long Seek(long offset, System.IO.SeekOrigin origin)
+ {
+ return 0;
+ }
+ public override void SetLength(long value) {}
+ */
+ }
+}
diff --git a/AssetStudio/7zip/Compress/LZMA/LzmaEncoder.cs b/AssetStudio/7zip/Compress/LZMA/LzmaEncoder.cs
new file mode 100644
index 0000000..0237c51
--- /dev/null
+++ b/AssetStudio/7zip/Compress/LZMA/LzmaEncoder.cs
@@ -0,0 +1,1480 @@
+// LzmaEncoder.cs
+
+using System;
+
+namespace SevenZip.Compression.LZMA
+{
+ using RangeCoder;
+
+ public class Encoder : ICoder, ISetCoderProperties, IWriteCoderProperties
+ {
+ enum EMatchFinderType
+ {
+ BT2,
+ BT4,
+ };
+
+ const UInt32 kIfinityPrice = 0xFFFFFFF;
+
+ static Byte[] g_FastPos = new Byte[1 << 11];
+
+ static Encoder()
+ {
+ const Byte kFastSlots = 22;
+ int c = 2;
+ g_FastPos[0] = 0;
+ g_FastPos[1] = 1;
+ for (Byte slotFast = 2; slotFast < kFastSlots; slotFast++)
+ {
+ UInt32 k = ((UInt32)1 << ((slotFast >> 1) - 1));
+ for (UInt32 j = 0; j < k; j++, c++)
+ g_FastPos[c] = slotFast;
+ }
+ }
+
+ static UInt32 GetPosSlot(UInt32 pos)
+ {
+ if (pos < (1 << 11))
+ return g_FastPos[pos];
+ if (pos < (1 << 21))
+ return (UInt32)(g_FastPos[pos >> 10] + 20);
+ return (UInt32)(g_FastPos[pos >> 20] + 40);
+ }
+
+ static UInt32 GetPosSlot2(UInt32 pos)
+ {
+ if (pos < (1 << 17))
+ return (UInt32)(g_FastPos[pos >> 6] + 12);
+ if (pos < (1 << 27))
+ return (UInt32)(g_FastPos[pos >> 16] + 32);
+ return (UInt32)(g_FastPos[pos >> 26] + 52);
+ }
+
+ Base.State _state = new Base.State();
+ Byte _previousByte;
+ UInt32[] _repDistances = new UInt32[Base.kNumRepDistances];
+
+ void BaseInit()
+ {
+ _state.Init();
+ _previousByte = 0;
+ for (UInt32 i = 0; i < Base.kNumRepDistances; i++)
+ _repDistances[i] = 0;
+ }
+
+ const int kDefaultDictionaryLogSize = 22;
+ const UInt32 kNumFastBytesDefault = 0x20;
+
+ class LiteralEncoder
+ {
+ public struct Encoder2
+ {
+ BitEncoder[] m_Encoders;
+
+ public void Create() { m_Encoders = new BitEncoder[0x300]; }
+
+ public void Init() { for (int i = 0; i < 0x300; i++) m_Encoders[i].Init(); }
+
+ public void Encode(RangeCoder.Encoder rangeEncoder, byte symbol)
+ {
+ uint context = 1;
+ for (int i = 7; i >= 0; i--)
+ {
+ uint bit = (uint)((symbol >> i) & 1);
+ m_Encoders[context].Encode(rangeEncoder, bit);
+ context = (context << 1) | bit;
+ }
+ }
+
+ public void EncodeMatched(RangeCoder.Encoder rangeEncoder, byte matchByte, byte symbol)
+ {
+ uint context = 1;
+ bool same = true;
+ for (int i = 7; i >= 0; i--)
+ {
+ uint bit = (uint)((symbol >> i) & 1);
+ uint state = context;
+ if (same)
+ {
+ uint matchBit = (uint)((matchByte >> i) & 1);
+ state += ((1 + matchBit) << 8);
+ same = (matchBit == bit);
+ }
+ m_Encoders[state].Encode(rangeEncoder, bit);
+ context = (context << 1) | bit;
+ }
+ }
+
+ public uint GetPrice(bool matchMode, byte matchByte, byte symbol)
+ {
+ uint price = 0;
+ uint context = 1;
+ int i = 7;
+ if (matchMode)
+ {
+ for (; i >= 0; i--)
+ {
+ uint matchBit = (uint)(matchByte >> i) & 1;
+ uint bit = (uint)(symbol >> i) & 1;
+ price += m_Encoders[((1 + matchBit) << 8) + context].GetPrice(bit);
+ context = (context << 1) | bit;
+ if (matchBit != bit)
+ {
+ i--;
+ break;
+ }
+ }
+ }
+ for (; i >= 0; i--)
+ {
+ uint bit = (uint)(symbol >> i) & 1;
+ price += m_Encoders[context].GetPrice(bit);
+ context = (context << 1) | bit;
+ }
+ return price;
+ }
+ }
+
+ Encoder2[] m_Coders;
+ int m_NumPrevBits;
+ int m_NumPosBits;
+ uint m_PosMask;
+
+ public void Create(int numPosBits, int numPrevBits)
+ {
+ if (m_Coders != null && m_NumPrevBits == numPrevBits && m_NumPosBits == numPosBits)
+ return;
+ m_NumPosBits = numPosBits;
+ m_PosMask = ((uint)1 << numPosBits) - 1;
+ m_NumPrevBits = numPrevBits;
+ uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits);
+ m_Coders = new Encoder2[numStates];
+ for (uint i = 0; i < numStates; i++)
+ m_Coders[i].Create();
+ }
+
+ public void Init()
+ {
+ uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits);
+ for (uint i = 0; i < numStates; i++)
+ m_Coders[i].Init();
+ }
+
+ public Encoder2 GetSubCoder(UInt32 pos, Byte prevByte)
+ { return m_Coders[((pos & m_PosMask) << m_NumPrevBits) + (uint)(prevByte >> (8 - m_NumPrevBits))]; }
+ }
+
+ class LenEncoder
+ {
+ RangeCoder.BitEncoder _choice = new RangeCoder.BitEncoder();
+ RangeCoder.BitEncoder _choice2 = new RangeCoder.BitEncoder();
+ RangeCoder.BitTreeEncoder[] _lowCoder = new RangeCoder.BitTreeEncoder[Base.kNumPosStatesEncodingMax];
+ RangeCoder.BitTreeEncoder[] _midCoder = new RangeCoder.BitTreeEncoder[Base.kNumPosStatesEncodingMax];
+ RangeCoder.BitTreeEncoder _highCoder = new RangeCoder.BitTreeEncoder(Base.kNumHighLenBits);
+
+ public LenEncoder()
+ {
+ for (UInt32 posState = 0; posState < Base.kNumPosStatesEncodingMax; posState++)
+ {
+ _lowCoder[posState] = new RangeCoder.BitTreeEncoder(Base.kNumLowLenBits);
+ _midCoder[posState] = new RangeCoder.BitTreeEncoder(Base.kNumMidLenBits);
+ }
+ }
+
+ public void Init(UInt32 numPosStates)
+ {
+ _choice.Init();
+ _choice2.Init();
+ for (UInt32 posState = 0; posState < numPosStates; posState++)
+ {
+ _lowCoder[posState].Init();
+ _midCoder[posState].Init();
+ }
+ _highCoder.Init();
+ }
+
+ public void Encode(RangeCoder.Encoder rangeEncoder, UInt32 symbol, UInt32 posState)
+ {
+ if (symbol < Base.kNumLowLenSymbols)
+ {
+ _choice.Encode(rangeEncoder, 0);
+ _lowCoder[posState].Encode(rangeEncoder, symbol);
+ }
+ else
+ {
+ symbol -= Base.kNumLowLenSymbols;
+ _choice.Encode(rangeEncoder, 1);
+ if (symbol < Base.kNumMidLenSymbols)
+ {
+ _choice2.Encode(rangeEncoder, 0);
+ _midCoder[posState].Encode(rangeEncoder, symbol);
+ }
+ else
+ {
+ _choice2.Encode(rangeEncoder, 1);
+ _highCoder.Encode(rangeEncoder, symbol - Base.kNumMidLenSymbols);
+ }
+ }
+ }
+
+ public void SetPrices(UInt32 posState, UInt32 numSymbols, UInt32[] prices, UInt32 st)
+ {
+ UInt32 a0 = _choice.GetPrice0();
+ UInt32 a1 = _choice.GetPrice1();
+ UInt32 b0 = a1 + _choice2.GetPrice0();
+ UInt32 b1 = a1 + _choice2.GetPrice1();
+ UInt32 i = 0;
+ for (i = 0; i < Base.kNumLowLenSymbols; i++)
+ {
+ if (i >= numSymbols)
+ return;
+ prices[st + i] = a0 + _lowCoder[posState].GetPrice(i);
+ }
+ for (; i < Base.kNumLowLenSymbols + Base.kNumMidLenSymbols; i++)
+ {
+ if (i >= numSymbols)
+ return;
+ prices[st + i] = b0 + _midCoder[posState].GetPrice(i - Base.kNumLowLenSymbols);
+ }
+ for (; i < numSymbols; i++)
+ prices[st + i] = b1 + _highCoder.GetPrice(i - Base.kNumLowLenSymbols - Base.kNumMidLenSymbols);
+ }
+ };
+
+ const UInt32 kNumLenSpecSymbols = Base.kNumLowLenSymbols + Base.kNumMidLenSymbols;
+
+ class LenPriceTableEncoder : LenEncoder
+ {
+ UInt32[] _prices = new UInt32[Base.kNumLenSymbols << Base.kNumPosStatesBitsEncodingMax];
+ UInt32 _tableSize;
+ UInt32[] _counters = new UInt32[Base.kNumPosStatesEncodingMax];
+
+ public void SetTableSize(UInt32 tableSize) { _tableSize = tableSize; }
+
+ public UInt32 GetPrice(UInt32 symbol, UInt32 posState)
+ {
+ return _prices[posState * Base.kNumLenSymbols + symbol];
+ }
+
+ void UpdateTable(UInt32 posState)
+ {
+ SetPrices(posState, _tableSize, _prices, posState * Base.kNumLenSymbols);
+ _counters[posState] = _tableSize;
+ }
+
+ public void UpdateTables(UInt32 numPosStates)
+ {
+ for (UInt32 posState = 0; posState < numPosStates; posState++)
+ UpdateTable(posState);
+ }
+
+ public new void Encode(RangeCoder.Encoder rangeEncoder, UInt32 symbol, UInt32 posState)
+ {
+ base.Encode(rangeEncoder, symbol, posState);
+ if (--_counters[posState] == 0)
+ UpdateTable(posState);
+ }
+ }
+
+ const UInt32 kNumOpts = 1 << 12;
+ class Optimal
+ {
+ public Base.State State;
+
+ public bool Prev1IsChar;
+ public bool Prev2;
+
+ public UInt32 PosPrev2;
+ public UInt32 BackPrev2;
+
+ public UInt32 Price;
+ public UInt32 PosPrev;
+ public UInt32 BackPrev;
+
+ public UInt32 Backs0;
+ public UInt32 Backs1;
+ public UInt32 Backs2;
+ public UInt32 Backs3;
+
+ public void MakeAsChar() { BackPrev = 0xFFFFFFFF; Prev1IsChar = false; }
+ public void MakeAsShortRep() { BackPrev = 0; ; Prev1IsChar = false; }
+ public bool IsShortRep() { return (BackPrev == 0); }
+ };
+ Optimal[] _optimum = new Optimal[kNumOpts];
+ LZ.IMatchFinder _matchFinder = null;
+ RangeCoder.Encoder _rangeEncoder = new RangeCoder.Encoder();
+
+ RangeCoder.BitEncoder[] _isMatch = new RangeCoder.BitEncoder[Base.kNumStates << Base.kNumPosStatesBitsMax];
+ RangeCoder.BitEncoder[] _isRep = new RangeCoder.BitEncoder[Base.kNumStates];
+ RangeCoder.BitEncoder[] _isRepG0 = new RangeCoder.BitEncoder[Base.kNumStates];
+ RangeCoder.BitEncoder[] _isRepG1 = new RangeCoder.BitEncoder[Base.kNumStates];
+ RangeCoder.BitEncoder[] _isRepG2 = new RangeCoder.BitEncoder[Base.kNumStates];
+ RangeCoder.BitEncoder[] _isRep0Long = new RangeCoder.BitEncoder[Base.kNumStates << Base.kNumPosStatesBitsMax];
+
+ RangeCoder.BitTreeEncoder[] _posSlotEncoder = new RangeCoder.BitTreeEncoder[Base.kNumLenToPosStates];
+
+ RangeCoder.BitEncoder[] _posEncoders = new RangeCoder.BitEncoder[Base.kNumFullDistances - Base.kEndPosModelIndex];
+ RangeCoder.BitTreeEncoder _posAlignEncoder = new RangeCoder.BitTreeEncoder(Base.kNumAlignBits);
+
+ LenPriceTableEncoder _lenEncoder = new LenPriceTableEncoder();
+ LenPriceTableEncoder _repMatchLenEncoder = new LenPriceTableEncoder();
+
+ LiteralEncoder _literalEncoder = new LiteralEncoder();
+
+ UInt32[] _matchDistances = new UInt32[Base.kMatchMaxLen * 2 + 2];
+
+ UInt32 _numFastBytes = kNumFastBytesDefault;
+ UInt32 _longestMatchLength;
+ UInt32 _numDistancePairs;
+
+ UInt32 _additionalOffset;
+
+ UInt32 _optimumEndIndex;
+ UInt32 _optimumCurrentIndex;
+
+ bool _longestMatchWasFound;
+
+ UInt32[] _posSlotPrices = new UInt32[1 << (Base.kNumPosSlotBits + Base.kNumLenToPosStatesBits)];
+ UInt32[] _distancesPrices = new UInt32[Base.kNumFullDistances << Base.kNumLenToPosStatesBits];
+ UInt32[] _alignPrices = new UInt32[Base.kAlignTableSize];
+ UInt32 _alignPriceCount;
+
+ UInt32 _distTableSize = (kDefaultDictionaryLogSize * 2);
+
+ int _posStateBits = 2;
+ UInt32 _posStateMask = (4 - 1);
+ int _numLiteralPosStateBits = 0;
+ int _numLiteralContextBits = 3;
+
+ UInt32 _dictionarySize = (1 << kDefaultDictionaryLogSize);
+ UInt32 _dictionarySizePrev = 0xFFFFFFFF;
+ UInt32 _numFastBytesPrev = 0xFFFFFFFF;
+
+ Int64 nowPos64;
+ bool _finished;
+ System.IO.Stream _inStream;
+
+ EMatchFinderType _matchFinderType = EMatchFinderType.BT4;
+ bool _writeEndMark = false;
+
+ bool _needReleaseMFStream;
+
+ void Create()
+ {
+ if (_matchFinder == null)
+ {
+ LZ.BinTree bt = new LZ.BinTree();
+ int numHashBytes = 4;
+ if (_matchFinderType == EMatchFinderType.BT2)
+ numHashBytes = 2;
+ bt.SetType(numHashBytes);
+ _matchFinder = bt;
+ }
+ _literalEncoder.Create(_numLiteralPosStateBits, _numLiteralContextBits);
+
+ if (_dictionarySize == _dictionarySizePrev && _numFastBytesPrev == _numFastBytes)
+ return;
+ _matchFinder.Create(_dictionarySize, kNumOpts, _numFastBytes, Base.kMatchMaxLen + 1);
+ _dictionarySizePrev = _dictionarySize;
+ _numFastBytesPrev = _numFastBytes;
+ }
+
+ public Encoder()
+ {
+ for (int i = 0; i < kNumOpts; i++)
+ _optimum[i] = new Optimal();
+ for (int i = 0; i < Base.kNumLenToPosStates; i++)
+ _posSlotEncoder[i] = new RangeCoder.BitTreeEncoder(Base.kNumPosSlotBits);
+ }
+
+ void SetWriteEndMarkerMode(bool writeEndMarker)
+ {
+ _writeEndMark = writeEndMarker;
+ }
+
+ void Init()
+ {
+ BaseInit();
+ _rangeEncoder.Init();
+
+ uint i;
+ for (i = 0; i < Base.kNumStates; i++)
+ {
+ for (uint j = 0; j <= _posStateMask; j++)
+ {
+ uint complexState = (i << Base.kNumPosStatesBitsMax) + j;
+ _isMatch[complexState].Init();
+ _isRep0Long[complexState].Init();
+ }
+ _isRep[i].Init();
+ _isRepG0[i].Init();
+ _isRepG1[i].Init();
+ _isRepG2[i].Init();
+ }
+ _literalEncoder.Init();
+ for (i = 0; i < Base.kNumLenToPosStates; i++)
+ _posSlotEncoder[i].Init();
+ for (i = 0; i < Base.kNumFullDistances - Base.kEndPosModelIndex; i++)
+ _posEncoders[i].Init();
+
+ _lenEncoder.Init((UInt32)1 << _posStateBits);
+ _repMatchLenEncoder.Init((UInt32)1 << _posStateBits);
+
+ _posAlignEncoder.Init();
+
+ _longestMatchWasFound = false;
+ _optimumEndIndex = 0;
+ _optimumCurrentIndex = 0;
+ _additionalOffset = 0;
+ }
+
+ void ReadMatchDistances(out UInt32 lenRes, out UInt32 numDistancePairs)
+ {
+ lenRes = 0;
+ numDistancePairs = _matchFinder.GetMatches(_matchDistances);
+ if (numDistancePairs > 0)
+ {
+ lenRes = _matchDistances[numDistancePairs - 2];
+ if (lenRes == _numFastBytes)
+ lenRes += _matchFinder.GetMatchLen((int)lenRes - 1, _matchDistances[numDistancePairs - 1],
+ Base.kMatchMaxLen - lenRes);
+ }
+ _additionalOffset++;
+ }
+
+
+ void MovePos(UInt32 num)
+ {
+ if (num > 0)
+ {
+ _matchFinder.Skip(num);
+ _additionalOffset += num;
+ }
+ }
+
+ UInt32 GetRepLen1Price(Base.State state, UInt32 posState)
+ {
+ return _isRepG0[state.Index].GetPrice0() +
+ _isRep0Long[(state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice0();
+ }
+
+ UInt32 GetPureRepPrice(UInt32 repIndex, Base.State state, UInt32 posState)
+ {
+ UInt32 price;
+ if (repIndex == 0)
+ {
+ price = _isRepG0[state.Index].GetPrice0();
+ price += _isRep0Long[(state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice1();
+ }
+ else
+ {
+ price = _isRepG0[state.Index].GetPrice1();
+ if (repIndex == 1)
+ price += _isRepG1[state.Index].GetPrice0();
+ else
+ {
+ price += _isRepG1[state.Index].GetPrice1();
+ price += _isRepG2[state.Index].GetPrice(repIndex - 2);
+ }
+ }
+ return price;
+ }
+
+ UInt32 GetRepPrice(UInt32 repIndex, UInt32 len, Base.State state, UInt32 posState)
+ {
+ UInt32 price = _repMatchLenEncoder.GetPrice(len - Base.kMatchMinLen, posState);
+ return price + GetPureRepPrice(repIndex, state, posState);
+ }
+
+ UInt32 GetPosLenPrice(UInt32 pos, UInt32 len, UInt32 posState)
+ {
+ UInt32 price;
+ UInt32 lenToPosState = Base.GetLenToPosState(len);
+ if (pos < Base.kNumFullDistances)
+ price = _distancesPrices[(lenToPosState * Base.kNumFullDistances) + pos];
+ else
+ price = _posSlotPrices[(lenToPosState << Base.kNumPosSlotBits) + GetPosSlot2(pos)] +
+ _alignPrices[pos & Base.kAlignMask];
+ return price + _lenEncoder.GetPrice(len - Base.kMatchMinLen, posState);
+ }
+
+ UInt32 Backward(out UInt32 backRes, UInt32 cur)
+ {
+ _optimumEndIndex = cur;
+ UInt32 posMem = _optimum[cur].PosPrev;
+ UInt32 backMem = _optimum[cur].BackPrev;
+ do
+ {
+ if (_optimum[cur].Prev1IsChar)
+ {
+ _optimum[posMem].MakeAsChar();
+ _optimum[posMem].PosPrev = posMem - 1;
+ if (_optimum[cur].Prev2)
+ {
+ _optimum[posMem - 1].Prev1IsChar = false;
+ _optimum[posMem - 1].PosPrev = _optimum[cur].PosPrev2;
+ _optimum[posMem - 1].BackPrev = _optimum[cur].BackPrev2;
+ }
+ }
+ UInt32 posPrev = posMem;
+ UInt32 backCur = backMem;
+
+ backMem = _optimum[posPrev].BackPrev;
+ posMem = _optimum[posPrev].PosPrev;
+
+ _optimum[posPrev].BackPrev = backCur;
+ _optimum[posPrev].PosPrev = cur;
+ cur = posPrev;
+ }
+ while (cur > 0);
+ backRes = _optimum[0].BackPrev;
+ _optimumCurrentIndex = _optimum[0].PosPrev;
+ return _optimumCurrentIndex;
+ }
+
+ UInt32[] reps = new UInt32[Base.kNumRepDistances];
+ UInt32[] repLens = new UInt32[Base.kNumRepDistances];
+
+
+ UInt32 GetOptimum(UInt32 position, out UInt32 backRes)
+ {
+ if (_optimumEndIndex != _optimumCurrentIndex)
+ {
+ UInt32 lenRes = _optimum[_optimumCurrentIndex].PosPrev - _optimumCurrentIndex;
+ backRes = _optimum[_optimumCurrentIndex].BackPrev;
+ _optimumCurrentIndex = _optimum[_optimumCurrentIndex].PosPrev;
+ return lenRes;
+ }
+ _optimumCurrentIndex = _optimumEndIndex = 0;
+
+ UInt32 lenMain, numDistancePairs;
+ if (!_longestMatchWasFound)
+ {
+ ReadMatchDistances(out lenMain, out numDistancePairs);
+ }
+ else
+ {
+ lenMain = _longestMatchLength;
+ numDistancePairs = _numDistancePairs;
+ _longestMatchWasFound = false;
+ }
+
+ UInt32 numAvailableBytes = _matchFinder.GetNumAvailableBytes() + 1;
+ if (numAvailableBytes < 2)
+ {
+ backRes = 0xFFFFFFFF;
+ return 1;
+ }
+ if (numAvailableBytes > Base.kMatchMaxLen)
+ numAvailableBytes = Base.kMatchMaxLen;
+
+ UInt32 repMaxIndex = 0;
+ UInt32 i;
+ for (i = 0; i < Base.kNumRepDistances; i++)
+ {
+ reps[i] = _repDistances[i];
+ repLens[i] = _matchFinder.GetMatchLen(0 - 1, reps[i], Base.kMatchMaxLen);
+ if (repLens[i] > repLens[repMaxIndex])
+ repMaxIndex = i;
+ }
+ if (repLens[repMaxIndex] >= _numFastBytes)
+ {
+ backRes = repMaxIndex;
+ UInt32 lenRes = repLens[repMaxIndex];
+ MovePos(lenRes - 1);
+ return lenRes;
+ }
+
+ if (lenMain >= _numFastBytes)
+ {
+ backRes = _matchDistances[numDistancePairs - 1] + Base.kNumRepDistances;
+ MovePos(lenMain - 1);
+ return lenMain;
+ }
+
+ Byte currentByte = _matchFinder.GetIndexByte(0 - 1);
+ Byte matchByte = _matchFinder.GetIndexByte((Int32)(0 - _repDistances[0] - 1 - 1));
+
+ if (lenMain < 2 && currentByte != matchByte && repLens[repMaxIndex] < 2)
+ {
+ backRes = (UInt32)0xFFFFFFFF;
+ return 1;
+ }
+
+ _optimum[0].State = _state;
+
+ UInt32 posState = (position & _posStateMask);
+
+ _optimum[1].Price = _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice0() +
+ _literalEncoder.GetSubCoder(position, _previousByte).GetPrice(!_state.IsCharState(), matchByte, currentByte);
+ _optimum[1].MakeAsChar();
+
+ UInt32 matchPrice = _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice1();
+ UInt32 repMatchPrice = matchPrice + _isRep[_state.Index].GetPrice1();
+
+ if (matchByte == currentByte)
+ {
+ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(_state, posState);
+ if (shortRepPrice < _optimum[1].Price)
+ {
+ _optimum[1].Price = shortRepPrice;
+ _optimum[1].MakeAsShortRep();
+ }
+ }
+
+ UInt32 lenEnd = ((lenMain >= repLens[repMaxIndex]) ? lenMain : repLens[repMaxIndex]);
+
+ if(lenEnd < 2)
+ {
+ backRes = _optimum[1].BackPrev;
+ return 1;
+ }
+
+ _optimum[1].PosPrev = 0;
+
+ _optimum[0].Backs0 = reps[0];
+ _optimum[0].Backs1 = reps[1];
+ _optimum[0].Backs2 = reps[2];
+ _optimum[0].Backs3 = reps[3];
+
+ UInt32 len = lenEnd;
+ do
+ _optimum[len--].Price = kIfinityPrice;
+ while (len >= 2);
+
+ for (i = 0; i < Base.kNumRepDistances; i++)
+ {
+ UInt32 repLen = repLens[i];
+ if (repLen < 2)
+ continue;
+ UInt32 price = repMatchPrice + GetPureRepPrice(i, _state, posState);
+ do
+ {
+ UInt32 curAndLenPrice = price + _repMatchLenEncoder.GetPrice(repLen - 2, posState);
+ Optimal optimum = _optimum[repLen];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = 0;
+ optimum.BackPrev = i;
+ optimum.Prev1IsChar = false;
+ }
+ }
+ while (--repLen >= 2);
+ }
+
+ UInt32 normalMatchPrice = matchPrice + _isRep[_state.Index].GetPrice0();
+
+ len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2);
+ if (len <= lenMain)
+ {
+ UInt32 offs = 0;
+ while (len > _matchDistances[offs])
+ offs += 2;
+ for (; ; len++)
+ {
+ UInt32 distance = _matchDistances[offs + 1];
+ UInt32 curAndLenPrice = normalMatchPrice + GetPosLenPrice(distance, len, posState);
+ Optimal optimum = _optimum[len];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = 0;
+ optimum.BackPrev = distance + Base.kNumRepDistances;
+ optimum.Prev1IsChar = false;
+ }
+ if (len == _matchDistances[offs])
+ {
+ offs += 2;
+ if (offs == numDistancePairs)
+ break;
+ }
+ }
+ }
+
+ UInt32 cur = 0;
+
+ while (true)
+ {
+ cur++;
+ if (cur == lenEnd)
+ return Backward(out backRes, cur);
+ UInt32 newLen;
+ ReadMatchDistances(out newLen, out numDistancePairs);
+ if (newLen >= _numFastBytes)
+ {
+ _numDistancePairs = numDistancePairs;
+ _longestMatchLength = newLen;
+ _longestMatchWasFound = true;
+ return Backward(out backRes, cur);
+ }
+ position++;
+ UInt32 posPrev = _optimum[cur].PosPrev;
+ Base.State state;
+ if (_optimum[cur].Prev1IsChar)
+ {
+ posPrev--;
+ if (_optimum[cur].Prev2)
+ {
+ state = _optimum[_optimum[cur].PosPrev2].State;
+ if (_optimum[cur].BackPrev2 < Base.kNumRepDistances)
+ state.UpdateRep();
+ else
+ state.UpdateMatch();
+ }
+ else
+ state = _optimum[posPrev].State;
+ state.UpdateChar();
+ }
+ else
+ state = _optimum[posPrev].State;
+ if (posPrev == cur - 1)
+ {
+ if (_optimum[cur].IsShortRep())
+ state.UpdateShortRep();
+ else
+ state.UpdateChar();
+ }
+ else
+ {
+ UInt32 pos;
+ if (_optimum[cur].Prev1IsChar && _optimum[cur].Prev2)
+ {
+ posPrev = _optimum[cur].PosPrev2;
+ pos = _optimum[cur].BackPrev2;
+ state.UpdateRep();
+ }
+ else
+ {
+ pos = _optimum[cur].BackPrev;
+ if (pos < Base.kNumRepDistances)
+ state.UpdateRep();
+ else
+ state.UpdateMatch();
+ }
+ Optimal opt = _optimum[posPrev];
+ if (pos < Base.kNumRepDistances)
+ {
+ if (pos == 0)
+ {
+ reps[0] = opt.Backs0;
+ reps[1] = opt.Backs1;
+ reps[2] = opt.Backs2;
+ reps[3] = opt.Backs3;
+ }
+ else if (pos == 1)
+ {
+ reps[0] = opt.Backs1;
+ reps[1] = opt.Backs0;
+ reps[2] = opt.Backs2;
+ reps[3] = opt.Backs3;
+ }
+ else if (pos == 2)
+ {
+ reps[0] = opt.Backs2;
+ reps[1] = opt.Backs0;
+ reps[2] = opt.Backs1;
+ reps[3] = opt.Backs3;
+ }
+ else
+ {
+ reps[0] = opt.Backs3;
+ reps[1] = opt.Backs0;
+ reps[2] = opt.Backs1;
+ reps[3] = opt.Backs2;
+ }
+ }
+ else
+ {
+ reps[0] = (pos - Base.kNumRepDistances);
+ reps[1] = opt.Backs0;
+ reps[2] = opt.Backs1;
+ reps[3] = opt.Backs2;
+ }
+ }
+ _optimum[cur].State = state;
+ _optimum[cur].Backs0 = reps[0];
+ _optimum[cur].Backs1 = reps[1];
+ _optimum[cur].Backs2 = reps[2];
+ _optimum[cur].Backs3 = reps[3];
+ UInt32 curPrice = _optimum[cur].Price;
+
+ currentByte = _matchFinder.GetIndexByte(0 - 1);
+ matchByte = _matchFinder.GetIndexByte((Int32)(0 - reps[0] - 1 - 1));
+
+ posState = (position & _posStateMask);
+
+ UInt32 curAnd1Price = curPrice +
+ _isMatch[(state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice0() +
+ _literalEncoder.GetSubCoder(position, _matchFinder.GetIndexByte(0 - 2)).
+ GetPrice(!state.IsCharState(), matchByte, currentByte);
+
+ Optimal nextOptimum = _optimum[cur + 1];
+
+ bool nextIsChar = false;
+ if (curAnd1Price < nextOptimum.Price)
+ {
+ nextOptimum.Price = curAnd1Price;
+ nextOptimum.PosPrev = cur;
+ nextOptimum.MakeAsChar();
+ nextIsChar = true;
+ }
+
+ matchPrice = curPrice + _isMatch[(state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice1();
+ repMatchPrice = matchPrice + _isRep[state.Index].GetPrice1();
+
+ if (matchByte == currentByte &&
+ !(nextOptimum.PosPrev < cur && nextOptimum.BackPrev == 0))
+ {
+ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(state, posState);
+ if (shortRepPrice <= nextOptimum.Price)
+ {
+ nextOptimum.Price = shortRepPrice;
+ nextOptimum.PosPrev = cur;
+ nextOptimum.MakeAsShortRep();
+ nextIsChar = true;
+ }
+ }
+
+ UInt32 numAvailableBytesFull = _matchFinder.GetNumAvailableBytes() + 1;
+ numAvailableBytesFull = Math.Min(kNumOpts - 1 - cur, numAvailableBytesFull);
+ numAvailableBytes = numAvailableBytesFull;
+
+ if (numAvailableBytes < 2)
+ continue;
+ if (numAvailableBytes > _numFastBytes)
+ numAvailableBytes = _numFastBytes;
+ if (!nextIsChar && matchByte != currentByte)
+ {
+ // try Literal + rep0
+ UInt32 t = Math.Min(numAvailableBytesFull - 1, _numFastBytes);
+ UInt32 lenTest2 = _matchFinder.GetMatchLen(0, reps[0], t);
+ if (lenTest2 >= 2)
+ {
+ Base.State state2 = state;
+ state2.UpdateChar();
+ UInt32 posStateNext = (position + 1) & _posStateMask;
+ UInt32 nextRepMatchPrice = curAnd1Price +
+ _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice1() +
+ _isRep[state2.Index].GetPrice1();
+ {
+ UInt32 offset = cur + 1 + lenTest2;
+ while (lenEnd < offset)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+ UInt32 curAndLenPrice = nextRepMatchPrice + GetRepPrice(
+ 0, lenTest2, state2, posStateNext);
+ Optimal optimum = _optimum[offset];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur + 1;
+ optimum.BackPrev = 0;
+ optimum.Prev1IsChar = true;
+ optimum.Prev2 = false;
+ }
+ }
+ }
+ }
+
+ UInt32 startLen = 2; // speed optimization
+
+ for (UInt32 repIndex = 0; repIndex < Base.kNumRepDistances; repIndex++)
+ {
+ UInt32 lenTest = _matchFinder.GetMatchLen(0 - 1, reps[repIndex], numAvailableBytes);
+ if (lenTest < 2)
+ continue;
+ UInt32 lenTestTemp = lenTest;
+ do
+ {
+ while (lenEnd < cur + lenTest)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+ UInt32 curAndLenPrice = repMatchPrice + GetRepPrice(repIndex, lenTest, state, posState);
+ Optimal optimum = _optimum[cur + lenTest];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur;
+ optimum.BackPrev = repIndex;
+ optimum.Prev1IsChar = false;
+ }
+ }
+ while(--lenTest >= 2);
+ lenTest = lenTestTemp;
+
+ if (repIndex == 0)
+ startLen = lenTest + 1;
+
+ // if (_maxMode)
+ if (lenTest < numAvailableBytesFull)
+ {
+ UInt32 t = Math.Min(numAvailableBytesFull - 1 - lenTest, _numFastBytes);
+ UInt32 lenTest2 = _matchFinder.GetMatchLen((Int32)lenTest, reps[repIndex], t);
+ if (lenTest2 >= 2)
+ {
+ Base.State state2 = state;
+ state2.UpdateRep();
+ UInt32 posStateNext = (position + lenTest) & _posStateMask;
+ UInt32 curAndLenCharPrice =
+ repMatchPrice + GetRepPrice(repIndex, lenTest, state, posState) +
+ _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice0() +
+ _literalEncoder.GetSubCoder(position + lenTest,
+ _matchFinder.GetIndexByte((Int32)lenTest - 1 - 1)).GetPrice(true,
+ _matchFinder.GetIndexByte((Int32)((Int32)lenTest - 1 - (Int32)(reps[repIndex] + 1))),
+ _matchFinder.GetIndexByte((Int32)lenTest - 1));
+ state2.UpdateChar();
+ posStateNext = (position + lenTest + 1) & _posStateMask;
+ UInt32 nextMatchPrice = curAndLenCharPrice + _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice1();
+ UInt32 nextRepMatchPrice = nextMatchPrice + _isRep[state2.Index].GetPrice1();
+
+ // for(; lenTest2 >= 2; lenTest2--)
+ {
+ UInt32 offset = lenTest + 1 + lenTest2;
+ while(lenEnd < cur + offset)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+ UInt32 curAndLenPrice = nextRepMatchPrice + GetRepPrice(0, lenTest2, state2, posStateNext);
+ Optimal optimum = _optimum[cur + offset];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur + lenTest + 1;
+ optimum.BackPrev = 0;
+ optimum.Prev1IsChar = true;
+ optimum.Prev2 = true;
+ optimum.PosPrev2 = cur;
+ optimum.BackPrev2 = repIndex;
+ }
+ }
+ }
+ }
+ }
+
+ if (newLen > numAvailableBytes)
+ {
+ newLen = numAvailableBytes;
+ for (numDistancePairs = 0; newLen > _matchDistances[numDistancePairs]; numDistancePairs += 2) ;
+ _matchDistances[numDistancePairs] = newLen;
+ numDistancePairs += 2;
+ }
+ if (newLen >= startLen)
+ {
+ normalMatchPrice = matchPrice + _isRep[state.Index].GetPrice0();
+ while (lenEnd < cur + newLen)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+
+ UInt32 offs = 0;
+ while (startLen > _matchDistances[offs])
+ offs += 2;
+
+ for (UInt32 lenTest = startLen; ; lenTest++)
+ {
+ UInt32 curBack = _matchDistances[offs + 1];
+ UInt32 curAndLenPrice = normalMatchPrice + GetPosLenPrice(curBack, lenTest, posState);
+ Optimal optimum = _optimum[cur + lenTest];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur;
+ optimum.BackPrev = curBack + Base.kNumRepDistances;
+ optimum.Prev1IsChar = false;
+ }
+
+ if (lenTest == _matchDistances[offs])
+ {
+ if (lenTest < numAvailableBytesFull)
+ {
+ UInt32 t = Math.Min(numAvailableBytesFull - 1 - lenTest, _numFastBytes);
+ UInt32 lenTest2 = _matchFinder.GetMatchLen((Int32)lenTest, curBack, t);
+ if (lenTest2 >= 2)
+ {
+ Base.State state2 = state;
+ state2.UpdateMatch();
+ UInt32 posStateNext = (position + lenTest) & _posStateMask;
+ UInt32 curAndLenCharPrice = curAndLenPrice +
+ _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice0() +
+ _literalEncoder.GetSubCoder(position + lenTest,
+ _matchFinder.GetIndexByte((Int32)lenTest - 1 - 1)).
+ GetPrice(true,
+ _matchFinder.GetIndexByte((Int32)lenTest - (Int32)(curBack + 1) - 1),
+ _matchFinder.GetIndexByte((Int32)lenTest - 1));
+ state2.UpdateChar();
+ posStateNext = (position + lenTest + 1) & _posStateMask;
+ UInt32 nextMatchPrice = curAndLenCharPrice + _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice1();
+ UInt32 nextRepMatchPrice = nextMatchPrice + _isRep[state2.Index].GetPrice1();
+
+ UInt32 offset = lenTest + 1 + lenTest2;
+ while (lenEnd < cur + offset)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+ curAndLenPrice = nextRepMatchPrice + GetRepPrice(0, lenTest2, state2, posStateNext);
+ optimum = _optimum[cur + offset];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur + lenTest + 1;
+ optimum.BackPrev = 0;
+ optimum.Prev1IsChar = true;
+ optimum.Prev2 = true;
+ optimum.PosPrev2 = cur;
+ optimum.BackPrev2 = curBack + Base.kNumRepDistances;
+ }
+ }
+ }
+ offs += 2;
+ if (offs == numDistancePairs)
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ bool ChangePair(UInt32 smallDist, UInt32 bigDist)
+ {
+ const int kDif = 7;
+ return (smallDist < ((UInt32)(1) << (32 - kDif)) && bigDist >= (smallDist << kDif));
+ }
+
+ void WriteEndMarker(UInt32 posState)
+ {
+ if (!_writeEndMark)
+ return;
+
+ _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].Encode(_rangeEncoder, 1);
+ _isRep[_state.Index].Encode(_rangeEncoder, 0);
+ _state.UpdateMatch();
+ UInt32 len = Base.kMatchMinLen;
+ _lenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState);
+ UInt32 posSlot = (1 << Base.kNumPosSlotBits) - 1;
+ UInt32 lenToPosState = Base.GetLenToPosState(len);
+ _posSlotEncoder[lenToPosState].Encode(_rangeEncoder, posSlot);
+ int footerBits = 30;
+ UInt32 posReduced = (((UInt32)1) << footerBits) - 1;
+ _rangeEncoder.EncodeDirectBits(posReduced >> Base.kNumAlignBits, footerBits - Base.kNumAlignBits);
+ _posAlignEncoder.ReverseEncode(_rangeEncoder, posReduced & Base.kAlignMask);
+ }
+
+ void Flush(UInt32 nowPos)
+ {
+ ReleaseMFStream();
+ WriteEndMarker(nowPos & _posStateMask);
+ _rangeEncoder.FlushData();
+ _rangeEncoder.FlushStream();
+ }
+
+ public void CodeOneBlock(out Int64 inSize, out Int64 outSize, out bool finished)
+ {
+ inSize = 0;
+ outSize = 0;
+ finished = true;
+
+ if (_inStream != null)
+ {
+ _matchFinder.SetStream(_inStream);
+ _matchFinder.Init();
+ _needReleaseMFStream = true;
+ _inStream = null;
+ if (_trainSize > 0)
+ _matchFinder.Skip(_trainSize);
+ }
+
+ if (_finished)
+ return;
+ _finished = true;
+
+
+ Int64 progressPosValuePrev = nowPos64;
+ if (nowPos64 == 0)
+ {
+ if (_matchFinder.GetNumAvailableBytes() == 0)
+ {
+ Flush((UInt32)nowPos64);
+ return;
+ }
+ UInt32 len, numDistancePairs; // it's not used
+ ReadMatchDistances(out len, out numDistancePairs);
+ UInt32 posState = (UInt32)(nowPos64) & _posStateMask;
+ _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].Encode(_rangeEncoder, 0);
+ _state.UpdateChar();
+ Byte curByte = _matchFinder.GetIndexByte((Int32)(0 - _additionalOffset));
+ _literalEncoder.GetSubCoder((UInt32)(nowPos64), _previousByte).Encode(_rangeEncoder, curByte);
+ _previousByte = curByte;
+ _additionalOffset--;
+ nowPos64++;
+ }
+ if (_matchFinder.GetNumAvailableBytes() == 0)
+ {
+ Flush((UInt32)nowPos64);
+ return;
+ }
+ while (true)
+ {
+ UInt32 pos;
+ UInt32 len = GetOptimum((UInt32)nowPos64, out pos);
+
+ UInt32 posState = ((UInt32)nowPos64) & _posStateMask;
+ UInt32 complexState = (_state.Index << Base.kNumPosStatesBitsMax) + posState;
+ if (len == 1 && pos == 0xFFFFFFFF)
+ {
+ _isMatch[complexState].Encode(_rangeEncoder, 0);
+ Byte curByte = _matchFinder.GetIndexByte((Int32)(0 - _additionalOffset));
+ LiteralEncoder.Encoder2 subCoder = _literalEncoder.GetSubCoder((UInt32)nowPos64, _previousByte);
+ if (!_state.IsCharState())
+ {
+ Byte matchByte = _matchFinder.GetIndexByte((Int32)(0 - _repDistances[0] - 1 - _additionalOffset));
+ subCoder.EncodeMatched(_rangeEncoder, matchByte, curByte);
+ }
+ else
+ subCoder.Encode(_rangeEncoder, curByte);
+ _previousByte = curByte;
+ _state.UpdateChar();
+ }
+ else
+ {
+ _isMatch[complexState].Encode(_rangeEncoder, 1);
+ if (pos < Base.kNumRepDistances)
+ {
+ _isRep[_state.Index].Encode(_rangeEncoder, 1);
+ if (pos == 0)
+ {
+ _isRepG0[_state.Index].Encode(_rangeEncoder, 0);
+ if (len == 1)
+ _isRep0Long[complexState].Encode(_rangeEncoder, 0);
+ else
+ _isRep0Long[complexState].Encode(_rangeEncoder, 1);
+ }
+ else
+ {
+ _isRepG0[_state.Index].Encode(_rangeEncoder, 1);
+ if (pos == 1)
+ _isRepG1[_state.Index].Encode(_rangeEncoder, 0);
+ else
+ {
+ _isRepG1[_state.Index].Encode(_rangeEncoder, 1);
+ _isRepG2[_state.Index].Encode(_rangeEncoder, pos - 2);
+ }
+ }
+ if (len == 1)
+ _state.UpdateShortRep();
+ else
+ {
+ _repMatchLenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState);
+ _state.UpdateRep();
+ }
+ UInt32 distance = _repDistances[pos];
+ if (pos != 0)
+ {
+ for (UInt32 i = pos; i >= 1; i--)
+ _repDistances[i] = _repDistances[i - 1];
+ _repDistances[0] = distance;
+ }
+ }
+ else
+ {
+ _isRep[_state.Index].Encode(_rangeEncoder, 0);
+ _state.UpdateMatch();
+ _lenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState);
+ pos -= Base.kNumRepDistances;
+ UInt32 posSlot = GetPosSlot(pos);
+ UInt32 lenToPosState = Base.GetLenToPosState(len);
+ _posSlotEncoder[lenToPosState].Encode(_rangeEncoder, posSlot);
+
+ if (posSlot >= Base.kStartPosModelIndex)
+ {
+ int footerBits = (int)((posSlot >> 1) - 1);
+ UInt32 baseVal = ((2 | (posSlot & 1)) << footerBits);
+ UInt32 posReduced = pos - baseVal;
+
+ if (posSlot < Base.kEndPosModelIndex)
+ RangeCoder.BitTreeEncoder.ReverseEncode(_posEncoders,
+ baseVal - posSlot - 1, _rangeEncoder, footerBits, posReduced);
+ else
+ {
+ _rangeEncoder.EncodeDirectBits(posReduced >> Base.kNumAlignBits, footerBits - Base.kNumAlignBits);
+ _posAlignEncoder.ReverseEncode(_rangeEncoder, posReduced & Base.kAlignMask);
+ _alignPriceCount++;
+ }
+ }
+ UInt32 distance = pos;
+ for (UInt32 i = Base.kNumRepDistances - 1; i >= 1; i--)
+ _repDistances[i] = _repDistances[i - 1];
+ _repDistances[0] = distance;
+ _matchPriceCount++;
+ }
+ _previousByte = _matchFinder.GetIndexByte((Int32)(len - 1 - _additionalOffset));
+ }
+ _additionalOffset -= len;
+ nowPos64 += len;
+ if (_additionalOffset == 0)
+ {
+ // if (!_fastMode)
+ if (_matchPriceCount >= (1 << 7))
+ FillDistancesPrices();
+ if (_alignPriceCount >= Base.kAlignTableSize)
+ FillAlignPrices();
+ inSize = nowPos64;
+ outSize = _rangeEncoder.GetProcessedSizeAdd();
+ if (_matchFinder.GetNumAvailableBytes() == 0)
+ {
+ Flush((UInt32)nowPos64);
+ return;
+ }
+
+ if (nowPos64 - progressPosValuePrev >= (1 << 12))
+ {
+ _finished = false;
+ finished = false;
+ return;
+ }
+ }
+ }
+ }
+
+ void ReleaseMFStream()
+ {
+ if (_matchFinder != null && _needReleaseMFStream)
+ {
+ _matchFinder.ReleaseStream();
+ _needReleaseMFStream = false;
+ }
+ }
+
+ void SetOutStream(System.IO.Stream outStream) { _rangeEncoder.SetStream(outStream); }
+ void ReleaseOutStream() { _rangeEncoder.ReleaseStream(); }
+
+ void ReleaseStreams()
+ {
+ ReleaseMFStream();
+ ReleaseOutStream();
+ }
+
+ void SetStreams(System.IO.Stream inStream, System.IO.Stream outStream,
+ Int64 inSize, Int64 outSize)
+ {
+ _inStream = inStream;
+ _finished = false;
+ Create();
+ SetOutStream(outStream);
+ Init();
+
+ // if (!_fastMode)
+ {
+ FillDistancesPrices();
+ FillAlignPrices();
+ }
+
+ _lenEncoder.SetTableSize(_numFastBytes + 1 - Base.kMatchMinLen);
+ _lenEncoder.UpdateTables((UInt32)1 << _posStateBits);
+ _repMatchLenEncoder.SetTableSize(_numFastBytes + 1 - Base.kMatchMinLen);
+ _repMatchLenEncoder.UpdateTables((UInt32)1 << _posStateBits);
+
+ nowPos64 = 0;
+ }
+
+
+ public void Code(System.IO.Stream inStream, System.IO.Stream outStream,
+ Int64 inSize, Int64 outSize, ICodeProgress progress)
+ {
+ _needReleaseMFStream = false;
+ try
+ {
+ SetStreams(inStream, outStream, inSize, outSize);
+ while (true)
+ {
+ Int64 processedInSize;
+ Int64 processedOutSize;
+ bool finished;
+ CodeOneBlock(out processedInSize, out processedOutSize, out finished);
+ if (finished)
+ return;
+ if (progress != null)
+ {
+ progress.SetProgress(processedInSize, processedOutSize);
+ }
+ }
+ }
+ finally
+ {
+ ReleaseStreams();
+ }
+ }
+
+ const int kPropSize = 5;
+ Byte[] properties = new Byte[kPropSize];
+
+ public void WriteCoderProperties(System.IO.Stream outStream)
+ {
+ properties[0] = (Byte)((_posStateBits * 5 + _numLiteralPosStateBits) * 9 + _numLiteralContextBits);
+ for (int i = 0; i < 4; i++)
+ properties[1 + i] = (Byte)((_dictionarySize >> (8 * i)) & 0xFF);
+ outStream.Write(properties, 0, kPropSize);
+ }
+
+ UInt32[] tempPrices = new UInt32[Base.kNumFullDistances];
+ UInt32 _matchPriceCount;
+
+ void FillDistancesPrices()
+ {
+ for (UInt32 i = Base.kStartPosModelIndex; i < Base.kNumFullDistances; i++)
+ {
+ UInt32 posSlot = GetPosSlot(i);
+ int footerBits = (int)((posSlot >> 1) - 1);
+ UInt32 baseVal = ((2 | (posSlot & 1)) << footerBits);
+ tempPrices[i] = BitTreeEncoder.ReverseGetPrice(_posEncoders,
+ baseVal - posSlot - 1, footerBits, i - baseVal);
+ }
+
+ for (UInt32 lenToPosState = 0; lenToPosState < Base.kNumLenToPosStates; lenToPosState++)
+ {
+ UInt32 posSlot;
+ RangeCoder.BitTreeEncoder encoder = _posSlotEncoder[lenToPosState];
+
+ UInt32 st = (lenToPosState << Base.kNumPosSlotBits);
+ for (posSlot = 0; posSlot < _distTableSize; posSlot++)
+ _posSlotPrices[st + posSlot] = encoder.GetPrice(posSlot);
+ for (posSlot = Base.kEndPosModelIndex; posSlot < _distTableSize; posSlot++)
+ _posSlotPrices[st + posSlot] += ((((posSlot >> 1) - 1) - Base.kNumAlignBits) << RangeCoder.BitEncoder.kNumBitPriceShiftBits);
+
+ UInt32 st2 = lenToPosState * Base.kNumFullDistances;
+ UInt32 i;
+ for (i = 0; i < Base.kStartPosModelIndex; i++)
+ _distancesPrices[st2 + i] = _posSlotPrices[st + i];
+ for (; i < Base.kNumFullDistances; i++)
+ _distancesPrices[st2 + i] = _posSlotPrices[st + GetPosSlot(i)] + tempPrices[i];
+ }
+ _matchPriceCount = 0;
+ }
+
+ void FillAlignPrices()
+ {
+ for (UInt32 i = 0; i < Base.kAlignTableSize; i++)
+ _alignPrices[i] = _posAlignEncoder.ReverseGetPrice(i);
+ _alignPriceCount = 0;
+ }
+
+
+ static string[] kMatchFinderIDs =
+ {
+ "BT2",
+ "BT4",
+ };
+
+ static int FindMatchFinder(string s)
+ {
+ for (int m = 0; m < kMatchFinderIDs.Length; m++)
+ if (s == kMatchFinderIDs[m])
+ return m;
+ return -1;
+ }
+
+ public void SetCoderProperties(CoderPropID[] propIDs, object[] properties)
+ {
+ for (UInt32 i = 0; i < properties.Length; i++)
+ {
+ object prop = properties[i];
+ switch (propIDs[i])
+ {
+ case CoderPropID.NumFastBytes:
+ {
+ if (!(prop is Int32))
+ throw new InvalidParamException();
+ Int32 numFastBytes = (Int32)prop;
+ if (numFastBytes < 5 || numFastBytes > Base.kMatchMaxLen)
+ throw new InvalidParamException();
+ _numFastBytes = (UInt32)numFastBytes;
+ break;
+ }
+ case CoderPropID.Algorithm:
+ {
+ /*
+ if (!(prop is Int32))
+ throw new InvalidParamException();
+ Int32 maximize = (Int32)prop;
+ _fastMode = (maximize == 0);
+ _maxMode = (maximize >= 2);
+ */
+ break;
+ }
+ case CoderPropID.MatchFinder:
+ {
+ if (!(prop is String))
+ throw new InvalidParamException();
+ EMatchFinderType matchFinderIndexPrev = _matchFinderType;
+ int m = FindMatchFinder(((string)prop).ToUpper());
+ if (m < 0)
+ throw new InvalidParamException();
+ _matchFinderType = (EMatchFinderType)m;
+ if (_matchFinder != null && matchFinderIndexPrev != _matchFinderType)
+ {
+ _dictionarySizePrev = 0xFFFFFFFF;
+ _matchFinder = null;
+ }
+ break;
+ }
+ case CoderPropID.DictionarySize:
+ {
+ const int kDicLogSizeMaxCompress = 30;
+ if (!(prop is Int32))
+ throw new InvalidParamException(); ;
+ Int32 dictionarySize = (Int32)prop;
+ if (dictionarySize < (UInt32)(1 << Base.kDicLogSizeMin) ||
+ dictionarySize > (UInt32)(1 << kDicLogSizeMaxCompress))
+ throw new InvalidParamException();
+ _dictionarySize = (UInt32)dictionarySize;
+ int dicLogSize;
+ for (dicLogSize = 0; dicLogSize < (UInt32)kDicLogSizeMaxCompress; dicLogSize++)
+ if (dictionarySize <= ((UInt32)(1) << dicLogSize))
+ break;
+ _distTableSize = (UInt32)dicLogSize * 2;
+ break;
+ }
+ case CoderPropID.PosStateBits:
+ {
+ if (!(prop is Int32))
+ throw new InvalidParamException();
+ Int32 v = (Int32)prop;
+ if (v < 0 || v > (UInt32)Base.kNumPosStatesBitsEncodingMax)
+ throw new InvalidParamException();
+ _posStateBits = (int)v;
+ _posStateMask = (((UInt32)1) << (int)_posStateBits) - 1;
+ break;
+ }
+ case CoderPropID.LitPosBits:
+ {
+ if (!(prop is Int32))
+ throw new InvalidParamException();
+ Int32 v = (Int32)prop;
+ if (v < 0 || v > (UInt32)Base.kNumLitPosStatesBitsEncodingMax)
+ throw new InvalidParamException();
+ _numLiteralPosStateBits = (int)v;
+ break;
+ }
+ case CoderPropID.LitContextBits:
+ {
+ if (!(prop is Int32))
+ throw new InvalidParamException();
+ Int32 v = (Int32)prop;
+ if (v < 0 || v > (UInt32)Base.kNumLitContextBitsMax)
+ throw new InvalidParamException(); ;
+ _numLiteralContextBits = (int)v;
+ break;
+ }
+ case CoderPropID.EndMarker:
+ {
+ if (!(prop is Boolean))
+ throw new InvalidParamException();
+ SetWriteEndMarkerMode((Boolean)prop);
+ break;
+ }
+ default:
+ throw new InvalidParamException();
+ }
+ }
+ }
+
+ uint _trainSize = 0;
+ public void SetTrainSize(uint trainSize)
+ {
+ _trainSize = trainSize;
+ }
+
+ }
+}
diff --git a/AssetStudio/7zip/Compress/RangeCoder/RangeCoder.cs b/AssetStudio/7zip/Compress/RangeCoder/RangeCoder.cs
new file mode 100644
index 0000000..949c6bb
--- /dev/null
+++ b/AssetStudio/7zip/Compress/RangeCoder/RangeCoder.cs
@@ -0,0 +1,234 @@
+using System;
+
+namespace SevenZip.Compression.RangeCoder
+{
+ class Encoder
+ {
+ public const uint kTopValue = (1 << 24);
+
+ System.IO.Stream Stream;
+
+ public UInt64 Low;
+ public uint Range;
+ uint _cacheSize;
+ byte _cache;
+
+ long StartPosition;
+
+ public void SetStream(System.IO.Stream stream)
+ {
+ Stream = stream;
+ }
+
+ public void ReleaseStream()
+ {
+ Stream = null;
+ }
+
+ public void Init()
+ {
+ StartPosition = Stream.Position;
+
+ Low = 0;
+ Range = 0xFFFFFFFF;
+ _cacheSize = 1;
+ _cache = 0;
+ }
+
+ public void FlushData()
+ {
+ for (int i = 0; i < 5; i++)
+ ShiftLow();
+ }
+
+ public void FlushStream()
+ {
+ Stream.Flush();
+ }
+
+ public void CloseStream()
+ {
+ Stream.Close();
+ }
+
+ public void Encode(uint start, uint size, uint total)
+ {
+ Low += start * (Range /= total);
+ Range *= size;
+ while (Range < kTopValue)
+ {
+ Range <<= 8;
+ ShiftLow();
+ }
+ }
+
+ public void ShiftLow()
+ {
+ if ((uint)Low < (uint)0xFF000000 || (uint)(Low >> 32) == 1)
+ {
+ byte temp = _cache;
+ do
+ {
+ Stream.WriteByte((byte)(temp + (Low >> 32)));
+ temp = 0xFF;
+ }
+ while (--_cacheSize != 0);
+ _cache = (byte)(((uint)Low) >> 24);
+ }
+ _cacheSize++;
+ Low = ((uint)Low) << 8;
+ }
+
+ public void EncodeDirectBits(uint v, int numTotalBits)
+ {
+ for (int i = numTotalBits - 1; i >= 0; i--)
+ {
+ Range >>= 1;
+ if (((v >> i) & 1) == 1)
+ Low += Range;
+ if (Range < kTopValue)
+ {
+ Range <<= 8;
+ ShiftLow();
+ }
+ }
+ }
+
+ public void EncodeBit(uint size0, int numTotalBits, uint symbol)
+ {
+ uint newBound = (Range >> numTotalBits) * size0;
+ if (symbol == 0)
+ Range = newBound;
+ else
+ {
+ Low += newBound;
+ Range -= newBound;
+ }
+ while (Range < kTopValue)
+ {
+ Range <<= 8;
+ ShiftLow();
+ }
+ }
+
+ public long GetProcessedSizeAdd()
+ {
+ return _cacheSize +
+ Stream.Position - StartPosition + 4;
+ // (long)Stream.GetProcessedSize();
+ }
+ }
+
+ class Decoder
+ {
+ public const uint kTopValue = (1 << 24);
+ public uint Range;
+ public uint Code;
+ // public Buffer.InBuffer Stream = new Buffer.InBuffer(1 << 16);
+ public System.IO.Stream Stream;
+
+ public void Init(System.IO.Stream stream)
+ {
+ // Stream.Init(stream);
+ Stream = stream;
+
+ Code = 0;
+ Range = 0xFFFFFFFF;
+ for (int i = 0; i < 5; i++)
+ Code = (Code << 8) | (byte)Stream.ReadByte();
+ }
+
+ public void ReleaseStream()
+ {
+ // Stream.ReleaseStream();
+ Stream = null;
+ }
+
+ public void CloseStream()
+ {
+ Stream.Close();
+ }
+
+ public void Normalize()
+ {
+ while (Range < kTopValue)
+ {
+ Code = (Code << 8) | (byte)Stream.ReadByte();
+ Range <<= 8;
+ }
+ }
+
+ public void Normalize2()
+ {
+ if (Range < kTopValue)
+ {
+ Code = (Code << 8) | (byte)Stream.ReadByte();
+ Range <<= 8;
+ }
+ }
+
+ public uint GetThreshold(uint total)
+ {
+ return Code / (Range /= total);
+ }
+
+ public void Decode(uint start, uint size, uint total)
+ {
+ Code -= start * Range;
+ Range *= size;
+ Normalize();
+ }
+
+ public uint DecodeDirectBits(int numTotalBits)
+ {
+ uint range = Range;
+ uint code = Code;
+ uint result = 0;
+ for (int i = numTotalBits; i > 0; i--)
+ {
+ range >>= 1;
+ /*
+ result <<= 1;
+ if (code >= range)
+ {
+ code -= range;
+ result |= 1;
+ }
+ */
+ uint t = (code - range) >> 31;
+ code -= range & (t - 1);
+ result = (result << 1) | (1 - t);
+
+ if (range < kTopValue)
+ {
+ code = (code << 8) | (byte)Stream.ReadByte();
+ range <<= 8;
+ }
+ }
+ Range = range;
+ Code = code;
+ return result;
+ }
+
+ public uint DecodeBit(uint size0, int numTotalBits)
+ {
+ uint newBound = (Range >> numTotalBits) * size0;
+ uint symbol;
+ if (Code < newBound)
+ {
+ symbol = 0;
+ Range = newBound;
+ }
+ else
+ {
+ symbol = 1;
+ Code -= newBound;
+ Range -= newBound;
+ }
+ Normalize();
+ return symbol;
+ }
+
+ // ulong GetProcessedSize() {return Stream.GetProcessedSize(); }
+ }
+}
diff --git a/AssetStudio/7zip/Compress/RangeCoder/RangeCoderBit.cs b/AssetStudio/7zip/Compress/RangeCoder/RangeCoderBit.cs
new file mode 100644
index 0000000..4f0346d
--- /dev/null
+++ b/AssetStudio/7zip/Compress/RangeCoder/RangeCoderBit.cs
@@ -0,0 +1,117 @@
+using System;
+
+namespace SevenZip.Compression.RangeCoder
+{
+ struct BitEncoder
+ {
+ public const int kNumBitModelTotalBits = 11;
+ public const uint kBitModelTotal = (1 << kNumBitModelTotalBits);
+ const int kNumMoveBits = 5;
+ const int kNumMoveReducingBits = 2;
+ public const int kNumBitPriceShiftBits = 6;
+
+ uint Prob;
+
+ public void Init() { Prob = kBitModelTotal >> 1; }
+
+ public void UpdateModel(uint symbol)
+ {
+ if (symbol == 0)
+ Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
+ else
+ Prob -= (Prob) >> kNumMoveBits;
+ }
+
+ public void Encode(Encoder encoder, uint symbol)
+ {
+ // encoder.EncodeBit(Prob, kNumBitModelTotalBits, symbol);
+ // UpdateModel(symbol);
+ uint newBound = (encoder.Range >> kNumBitModelTotalBits) * Prob;
+ if (symbol == 0)
+ {
+ encoder.Range = newBound;
+ Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
+ }
+ else
+ {
+ encoder.Low += newBound;
+ encoder.Range -= newBound;
+ Prob -= (Prob) >> kNumMoveBits;
+ }
+ if (encoder.Range < Encoder.kTopValue)
+ {
+ encoder.Range <<= 8;
+ encoder.ShiftLow();
+ }
+ }
+
+ private static UInt32[] ProbPrices = new UInt32[kBitModelTotal >> kNumMoveReducingBits];
+
+ static BitEncoder()
+ {
+ const int kNumBits = (kNumBitModelTotalBits - kNumMoveReducingBits);
+ for (int i = kNumBits - 1; i >= 0; i--)
+ {
+ UInt32 start = (UInt32)1 << (kNumBits - i - 1);
+ UInt32 end = (UInt32)1 << (kNumBits - i);
+ for (UInt32 j = start; j < end; j++)
+ ProbPrices[j] = ((UInt32)i << kNumBitPriceShiftBits) +
+ (((end - j) << kNumBitPriceShiftBits) >> (kNumBits - i - 1));
+ }
+ }
+
+ public uint GetPrice(uint symbol)
+ {
+ return ProbPrices[(((Prob - symbol) ^ ((-(int)symbol))) & (kBitModelTotal - 1)) >> kNumMoveReducingBits];
+ }
+ public uint GetPrice0() { return ProbPrices[Prob >> kNumMoveReducingBits]; }
+ public uint GetPrice1() { return ProbPrices[(kBitModelTotal - Prob) >> kNumMoveReducingBits]; }
+ }
+
+ struct BitDecoder
+ {
+ public const int kNumBitModelTotalBits = 11;
+ public const uint kBitModelTotal = (1 << kNumBitModelTotalBits);
+ const int kNumMoveBits = 5;
+
+ uint Prob;
+
+ public void UpdateModel(int numMoveBits, uint symbol)
+ {
+ if (symbol == 0)
+ Prob += (kBitModelTotal - Prob) >> numMoveBits;
+ else
+ Prob -= (Prob) >> numMoveBits;
+ }
+
+ public void Init() { Prob = kBitModelTotal >> 1; }
+
+ public uint Decode(RangeCoder.Decoder rangeDecoder)
+ {
+ uint newBound = (uint)(rangeDecoder.Range >> kNumBitModelTotalBits) * (uint)Prob;
+ if (rangeDecoder.Code < newBound)
+ {
+ rangeDecoder.Range = newBound;
+ Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
+ if (rangeDecoder.Range < Decoder.kTopValue)
+ {
+ rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte();
+ rangeDecoder.Range <<= 8;
+ }
+ return 0;
+ }
+ else
+ {
+ rangeDecoder.Range -= newBound;
+ rangeDecoder.Code -= newBound;
+ Prob -= (Prob) >> kNumMoveBits;
+ if (rangeDecoder.Range < Decoder.kTopValue)
+ {
+ rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte();
+ rangeDecoder.Range <<= 8;
+ }
+ return 1;
+ }
+ }
+ }
+}
diff --git a/AssetStudio/7zip/Compress/RangeCoder/RangeCoderBitTree.cs b/AssetStudio/7zip/Compress/RangeCoder/RangeCoderBitTree.cs
new file mode 100644
index 0000000..4b4506f
--- /dev/null
+++ b/AssetStudio/7zip/Compress/RangeCoder/RangeCoderBitTree.cs
@@ -0,0 +1,157 @@
+using System;
+
+namespace SevenZip.Compression.RangeCoder
+{
+ struct BitTreeEncoder
+ {
+ BitEncoder[] Models;
+ int NumBitLevels;
+
+ public BitTreeEncoder(int numBitLevels)
+ {
+ NumBitLevels = numBitLevels;
+ Models = new BitEncoder[1 << numBitLevels];
+ }
+
+ public void Init()
+ {
+ for (uint i = 1; i < (1 << NumBitLevels); i++)
+ Models[i].Init();
+ }
+
+ public void Encode(Encoder rangeEncoder, UInt32 symbol)
+ {
+ UInt32 m = 1;
+ for (int bitIndex = NumBitLevels; bitIndex > 0; )
+ {
+ bitIndex--;
+ UInt32 bit = (symbol >> bitIndex) & 1;
+ Models[m].Encode(rangeEncoder, bit);
+ m = (m << 1) | bit;
+ }
+ }
+
+ public void ReverseEncode(Encoder rangeEncoder, UInt32 symbol)
+ {
+ UInt32 m = 1;
+ for (UInt32 i = 0; i < NumBitLevels; i++)
+ {
+ UInt32 bit = symbol & 1;
+ Models[m].Encode(rangeEncoder, bit);
+ m = (m << 1) | bit;
+ symbol >>= 1;
+ }
+ }
+
+ public UInt32 GetPrice(UInt32 symbol)
+ {
+ UInt32 price = 0;
+ UInt32 m = 1;
+ for (int bitIndex = NumBitLevels; bitIndex > 0; )
+ {
+ bitIndex--;
+ UInt32 bit = (symbol >> bitIndex) & 1;
+ price += Models[m].GetPrice(bit);
+ m = (m << 1) + bit;
+ }
+ return price;
+ }
+
+ public UInt32 ReverseGetPrice(UInt32 symbol)
+ {
+ UInt32 price = 0;
+ UInt32 m = 1;
+ for (int i = NumBitLevels; i > 0; i--)
+ {
+ UInt32 bit = symbol & 1;
+ symbol >>= 1;
+ price += Models[m].GetPrice(bit);
+ m = (m << 1) | bit;
+ }
+ return price;
+ }
+
+ public static UInt32 ReverseGetPrice(BitEncoder[] Models, UInt32 startIndex,
+ int NumBitLevels, UInt32 symbol)
+ {
+ UInt32 price = 0;
+ UInt32 m = 1;
+ for (int i = NumBitLevels; i > 0; i--)
+ {
+ UInt32 bit = symbol & 1;
+ symbol >>= 1;
+ price += Models[startIndex + m].GetPrice(bit);
+ m = (m << 1) | bit;
+ }
+ return price;
+ }
+
+ public static void ReverseEncode(BitEncoder[] Models, UInt32 startIndex,
+ Encoder rangeEncoder, int NumBitLevels, UInt32 symbol)
+ {
+ UInt32 m = 1;
+ for (int i = 0; i < NumBitLevels; i++)
+ {
+ UInt32 bit = symbol & 1;
+ Models[startIndex + m].Encode(rangeEncoder, bit);
+ m = (m << 1) | bit;
+ symbol >>= 1;
+ }
+ }
+ }
+
+ struct BitTreeDecoder
+ {
+ BitDecoder[] Models;
+ int NumBitLevels;
+
+ public BitTreeDecoder(int numBitLevels)
+ {
+ NumBitLevels = numBitLevels;
+ Models = new BitDecoder[1 << numBitLevels];
+ }
+
+ public void Init()
+ {
+ for (uint i = 1; i < (1 << NumBitLevels); i++)
+ Models[i].Init();
+ }
+
+ public uint Decode(RangeCoder.Decoder rangeDecoder)
+ {
+ uint m = 1;
+ for (int bitIndex = NumBitLevels; bitIndex > 0; bitIndex--)
+ m = (m << 1) + Models[m].Decode(rangeDecoder);
+ return m - ((uint)1 << NumBitLevels);
+ }
+
+ public uint ReverseDecode(RangeCoder.Decoder rangeDecoder)
+ {
+ uint m = 1;
+ uint symbol = 0;
+ for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
+ {
+ uint bit = Models[m].Decode(rangeDecoder);
+ m <<= 1;
+ m += bit;
+ symbol |= (bit << bitIndex);
+ }
+ return symbol;
+ }
+
+ public static uint ReverseDecode(BitDecoder[] Models, UInt32 startIndex,
+ RangeCoder.Decoder rangeDecoder, int NumBitLevels)
+ {
+ uint m = 1;
+ uint symbol = 0;
+ for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
+ {
+ uint bit = Models[startIndex + m].Decode(rangeDecoder);
+ m <<= 1;
+ m += bit;
+ symbol |= (bit << bitIndex);
+ }
+ return symbol;
+ }
+ }
+}
diff --git a/AssetStudio/7zip/ICoder.cs b/AssetStudio/7zip/ICoder.cs
new file mode 100644
index 0000000..c8b95c8
--- /dev/null
+++ b/AssetStudio/7zip/ICoder.cs
@@ -0,0 +1,157 @@
+// ICoder.h
+
+using System;
+
+namespace SevenZip
+{
+ ///
+ /// The exception that is thrown when an error in input stream occurs during decoding.
+ ///
+ class DataErrorException : ApplicationException
+ {
+ public DataErrorException(): base("Data Error") { }
+ }
+
+ ///
+ /// The exception that is thrown when the value of an argument is outside the allowable range.
+ ///
+ class InvalidParamException : ApplicationException
+ {
+ public InvalidParamException(): base("Invalid Parameter") { }
+ }
+
+ public interface ICodeProgress
+ {
+ ///
+ /// Callback progress.
+ ///
+ ///
+ /// input size. -1 if unknown.
+ ///
+ ///
+ /// output size. -1 if unknown.
+ ///
+ void SetProgress(Int64 inSize, Int64 outSize);
+ };
+
+ public interface ICoder
+ {
+ ///
+ /// Codes streams.
+ ///
+ ///
+ /// input Stream.
+ ///
+ ///
+ /// output Stream.
+ ///
+ ///
+ /// input Size. -1 if unknown.
+ ///
+ ///
+ /// output Size. -1 if unknown.
+ ///
+ ///
+ /// callback progress reference.
+ ///
+ ///
+ /// if input stream is not valid
+ ///
+ void Code(System.IO.Stream inStream, System.IO.Stream outStream,
+ Int64 inSize, Int64 outSize, ICodeProgress progress);
+ };
+
+ /*
+ public interface ICoder2
+ {
+ void Code(ISequentialInStream []inStreams,
+ const UInt64 []inSizes,
+ ISequentialOutStream []outStreams,
+ UInt64 []outSizes,
+ ICodeProgress progress);
+ };
+ */
+
+ ///
+ /// Provides the fields that represent properties idenitifiers for compressing.
+ ///
+ public enum CoderPropID
+ {
+ ///
+ /// Specifies default property.
+ ///
+ DefaultProp = 0,
+ ///
+ /// Specifies size of dictionary.
+ ///
+ DictionarySize,
+ ///
+ /// Specifies size of memory for PPM*.
+ ///
+ UsedMemorySize,
+ ///
+ /// Specifies order for PPM methods.
+ ///
+ Order,
+ ///
+ /// Specifies Block Size.
+ ///
+ BlockSize,
+ ///
+ /// Specifies number of postion state bits for LZMA (0 <= x <= 4).
+ ///
+ PosStateBits,
+ ///
+ /// Specifies number of literal context bits for LZMA (0 <= x <= 8).
+ ///
+ LitContextBits,
+ ///
+ /// Specifies number of literal position bits for LZMA (0 <= x <= 4).
+ ///
+ LitPosBits,
+ ///
+ /// Specifies number of fast bytes for LZ*.
+ ///
+ NumFastBytes,
+ ///
+ /// Specifies match finder. LZMA: "BT2", "BT4" or "BT4B".
+ ///
+ MatchFinder,
+ ///
+ /// Specifies the number of match finder cyckes.
+ ///
+ MatchFinderCycles,
+ ///
+ /// Specifies number of passes.
+ ///
+ NumPasses,
+ ///
+ /// Specifies number of algorithm.
+ ///
+ Algorithm,
+ ///
+ /// Specifies the number of threads.
+ ///
+ NumThreads,
+ ///
+ /// Specifies mode with end marker.
+ ///
+ EndMarker
+ };
+
+
+ public interface ISetCoderProperties
+ {
+ void SetCoderProperties(CoderPropID[] propIDs, object[] properties);
+ };
+
+ public interface IWriteCoderProperties
+ {
+ void WriteCoderProperties(System.IO.Stream outStream);
+ }
+
+ public interface ISetDecoderProperties
+ {
+ void SetDecoderProperties(byte[] properties);
+ }
+}
diff --git a/AssetStudio/AIVersionManager.cs b/AssetStudio/AIVersionManager.cs
new file mode 100644
index 0000000..66bb947
--- /dev/null
+++ b/AssetStudio/AIVersionManager.cs
@@ -0,0 +1,179 @@
+using System;
+using System.IO;
+using System.Linq;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using System.Net.Http;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+
+namespace AssetStudio
+{
+ public class VersionIndex
+ {
+ public string MappedPath;
+ public string RawPath;
+ public string Version;
+ public double Coverage;
+ }
+
+ public static class AIVersionManager
+ {
+ private const string BaseUrl = "https://raw.githubusercontent.com/radioegor146/gi-asset-indexes/master/";
+ private const string CommitsUrl = "https://api.github.com/repos/radioegor146/gi-asset-indexes/commits?path=";
+
+ private static readonly string BaseAIFolder = Path.Combine(Environment.CurrentDirectory, "AI");
+ private static readonly string VersionsPath = Path.Combine(BaseAIFolder, "versions.json");
+ private static readonly string VersionIndexUrl = Path.Combine(BaseUrl, "version-index.json");
+ private static readonly HttpClient Client;
+
+ private static List Versions;
+
+ public static bool Loaded;
+
+ static AIVersionManager()
+ {
+ Client = new HttpClient();
+ Client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (compatible; MSIE 6.0; Windows 98; Trident/5.1)");
+ Client.Timeout = TimeSpan.FromMinutes(1);
+ Versions = new List();
+ Loaded = false;
+ }
+
+ public static Uri CreateUri(string source, out Uri result) => Uri.TryCreate(source, UriKind.Absolute, out result) && result.Scheme == Uri.UriSchemeHttps ? result : null;
+
+ public static void FetchVersions()
+ {
+ var versions = Task.Run(() => DownloadString(VersionIndexUrl)).Result;
+ if (string.IsNullOrEmpty(versions))
+ {
+ Logger.Warning("Could not load AI versions !!");
+ return;
+ }
+ Versions = JsonConvert.DeserializeObject>(versions);
+ Loaded = Versions.Count > 0;
+ }
+
+ public static async Task DownloadString(string url)
+ {
+ string json = "";
+ if (CreateUri(url, out var uri) != null)
+ {
+ try
+ {
+ json = await Client.GetStringAsync(uri);
+ }
+ catch (Exception ex)
+ {
+ Logger.Warning($"Failed to fetch {Path.GetFileName(url)}, {ex.Message}");
+ }
+ }
+ return json;
+ }
+
+ public static async Task DownloadAI(string version)
+ {
+ var versionIndex = Versions.FirstOrDefault(x => x.Version == version);
+
+ Logger.Info("Downloading....");
+ string json = await DownloadString(BaseUrl + versionIndex.MappedPath);
+ if (!await StoreCommit(version))
+ {
+ throw new Exception("Failed to store AIVersion");
+ }
+ return json;
+ }
+
+ public static async Task NeedDownload(string version)
+ {
+ var path = GetAIPath(version);
+ if (!File.Exists(path)) return true;
+ var latestCommit = await GetLatestCommit(version);
+ if (string.IsNullOrEmpty(latestCommit)) return true;
+ var dict = LoadVersions();
+ if (dict.TryGetValue(version, out var commit))
+ {
+ if (commit == latestCommit) return false;
+ }
+ return true;
+ }
+
+ public static async Task StoreCommit(string version)
+ {
+ var latestCommit = await GetLatestCommit(version);
+ if (string.IsNullOrEmpty(latestCommit)) return false;
+ var dict = LoadVersions();
+ if (dict.TryGetValue(version, out var commit))
+ {
+ if (commit != latestCommit)
+ dict[version] = latestCommit;
+ }
+ else dict.Add(version, latestCommit);
+ StoreVersions(dict);
+ return true;
+ }
+
+ public static Dictionary CreateVersions()
+ {
+ var dict = new Dictionary();
+ var dir = Path.GetDirectoryName(VersionsPath);
+ if (!Directory.Exists(dir))
+ Directory.CreateDirectory(dir);
+ using (var stream = File.Create(VersionsPath))
+ {
+ var serializer = new JsonSerializer();
+
+ using (StreamWriter writer = new StreamWriter(stream))
+ using (JsonTextWriter jsonWriter = new JsonTextWriter(writer))
+ {
+ JsonSerializer ser = new JsonSerializer();
+ ser.Serialize(jsonWriter, dict);
+ jsonWriter.Flush();
+ }
+ }
+ return dict;
+ }
+
+ public static Dictionary LoadVersions()
+ {
+ if (!File.Exists(VersionsPath))
+ {
+ return CreateVersions();
+ }
+
+ var file = File.ReadAllText(VersionsPath);
+ return JsonConvert.DeserializeObject>(file);
+ }
+
+ public static void StoreVersions(Dictionary dict)
+ {
+ var json = JsonConvert.SerializeObject(dict, Formatting.Indented);
+ File.WriteAllText(VersionsPath, json);
+ }
+
+ public static string GetAIPath(string version)
+ {
+ var versionIndex = Versions.FirstOrDefault(x => x.Version == version);
+ return Path.Combine(BaseAIFolder, Path.GetFileName(versionIndex.MappedPath));
+ }
+
+ public static async Task GetLatestCommit(string version)
+ {
+ var versionIndex = Versions.FirstOrDefault(x => x.Version == version);
+ string commit = "";
+ try
+ {
+ string json = await DownloadString(CommitsUrl + versionIndex.MappedPath);
+ JArray data = JArray.Parse(json);
+ commit = data[0]["sha"].ToString();
+ }
+ catch (Exception ex)
+ {
+ Logger.Error($"Failed to fetch latest commit", ex);
+ }
+ return commit;
+ }
+
+ public static string[] GetVersions() => Versions.Select(x => x.Version).ToArray();
+ }
+}
diff --git a/AssetStudio/AssetEntry.cs b/AssetStudio/AssetEntry.cs
new file mode 100644
index 0000000..b4581db
--- /dev/null
+++ b/AssetStudio/AssetEntry.cs
@@ -0,0 +1,11 @@
+namespace AssetStudio
+{
+ public class AssetEntry
+ {
+ public string Name;
+ public string Container;
+ public string SourcePath;
+ public long PathID;
+ public ClassIDType Type;
+ }
+}
diff --git a/AssetStudio/AssetStudio.csproj b/AssetStudio/AssetStudio.csproj
new file mode 100644
index 0000000..4708921
--- /dev/null
+++ b/AssetStudio/AssetStudio.csproj
@@ -0,0 +1,27 @@
+
+
+
+ net472;netstandard2.0;net5.0;net6.0
+ 0.17.00
+ 0.17.00
+ 0.17.00
+ Copyright © Perfare 2018-2022
+ embedded
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AssetStudio/AssetsManager.cs b/AssetStudio/AssetsManager.cs
new file mode 100644
index 0000000..1c10f9e
--- /dev/null
+++ b/AssetStudio/AssetsManager.cs
@@ -0,0 +1,587 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.IO.Compression;
+using System.Linq;
+using System.Text;
+using static AssetStudio.ImportHelper;
+
+namespace AssetStudio
+{
+ public class AssetsManager
+ {
+ public Game Game;
+ public bool ResolveDependancies;
+ public string SpecifyUnityVersion;
+ public List assetsFileList = new List();
+
+ internal Dictionary assetsFileIndexCache = new Dictionary(StringComparer.OrdinalIgnoreCase);
+ internal Dictionary resourceFileReaders = new Dictionary(StringComparer.OrdinalIgnoreCase);
+
+ private List importFiles = new List();
+ private HashSet importFilesHash = new HashSet(StringComparer.OrdinalIgnoreCase);
+ private HashSet assetsFileListHash = new HashSet(StringComparer.OrdinalIgnoreCase);
+
+ public void LoadFiles(params string[] files)
+ {
+ if (ResolveDependancies)
+ files = CABManager.ProcessDependencies(files);
+ Load(files);
+ }
+
+ public void LoadFolder(string path)
+ {
+ var files = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories).ToArray();
+ Load(files);
+ }
+
+ private void Load(string[] files)
+ {
+ foreach (var file in files)
+ {
+ importFiles.Add(file);
+ importFilesHash.Add(Path.GetFileName(file));
+ }
+
+ Progress.Reset();
+ //use a for loop because list size can change
+ for (var i = 0; i < importFiles.Count; i++)
+ {
+ LoadFile(importFiles[i]);
+ Progress.Report(i + 1, importFiles.Count);
+ }
+
+ importFiles.Clear();
+ importFilesHash.Clear();
+ assetsFileListHash.Clear();
+ CABManager.offsets.Clear();
+
+ ReadAssets();
+ ProcessAssets();
+ }
+
+ private void LoadFile(string fullName)
+ {
+ var reader = new FileReader(fullName, Game);
+ LoadFile(reader);
+ }
+
+ private void LoadFile(FileReader reader)
+ {
+ switch (reader.FileType)
+ {
+ case FileType.AssetsFile:
+ LoadAssetsFile(reader);
+ break;
+ case FileType.BundleFile:
+ LoadBundleFile(reader);
+ break;
+ case FileType.HoyoFile:
+ LoadHoYoFile(reader);
+ break;
+ case FileType.WebFile:
+ LoadWebFile(reader);
+ break;
+ case FileType.GZipFile:
+ LoadFile(DecompressGZip(reader));
+ break;
+ case FileType.BrotliFile:
+ LoadFile(DecompressBrotli(reader));
+ break;
+ case FileType.ZipFile:
+ LoadZipFile(reader);
+ break;
+ }
+ }
+
+ private void LoadAssetsFile(FileReader reader)
+ {
+ if (!assetsFileListHash.Contains(reader.FileName))
+ {
+ Logger.Info($"Loading {reader.FileName}");
+ try
+ {
+ var assetsFile = new SerializedFile(reader, this, reader.FullPath);
+ CheckStrippedVersion(assetsFile);
+ assetsFileList.Add(assetsFile);
+ assetsFileListHash.Add(assetsFile.fileName);
+ }
+ catch (Exception e)
+ {
+ Logger.Error($"Error while reading assets file {reader.FullPath}", e);
+ reader.Dispose();
+ }
+ }
+ else
+ {
+ Logger.Info($"Skipping {reader.FullPath}");
+ reader.Dispose();
+ }
+ }
+
+ private void LoadAssetsFromMemory(FileReader reader, string originalPath, string unityVersion = null)
+ {
+ if (!assetsFileListHash.Contains(reader.FileName))
+ {
+ try
+ {
+ var assetsFile = new SerializedFile(reader, this);
+ assetsFile.originalPath = originalPath;
+ if (!string.IsNullOrEmpty(unityVersion) && assetsFile.header.m_Version < SerializedFileFormatVersion.Unknown_7)
+ {
+ assetsFile.SetVersion(unityVersion);
+ }
+ CheckStrippedVersion(assetsFile);
+ assetsFileList.Add(assetsFile);
+ assetsFileListHash.Add(assetsFile.fileName);
+ }
+ catch (Exception e)
+ {
+ Logger.Error($"Error while reading assets file {reader.FullPath} from {Path.GetFileName(originalPath)}", e);
+ resourceFileReaders.Add(reader.FileName, reader);
+ }
+ }
+ else
+ Logger.Info($"Skipping {originalPath} ({reader.FileName})");
+ }
+
+ private void LoadBundleFile(FileReader reader, string originalPath = null)
+ {
+ Logger.Info("Loading " + reader.FullPath);
+ try
+ {
+ var bundleFile = new BundleFile(reader);
+ foreach (var file in bundleFile.FileList)
+ {
+ var dummyPath = Path.Combine(Path.GetDirectoryName(reader.FullPath), file.fileName);
+ var subReader = new FileReader(dummyPath, file.stream);
+ if (subReader.FileType == FileType.AssetsFile)
+ {
+ LoadAssetsFromMemory(subReader, originalPath ?? reader.FullPath, bundleFile.m_Header.unityRevision);
+ }
+ else
+ {
+ resourceFileReaders[file.fileName] = subReader; //TODO
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ var str = $"Error while reading bundle file {reader.FullPath}";
+ if (originalPath != null)
+ {
+ str += $" from {Path.GetFileName(originalPath)}";
+ }
+ Logger.Error(str, e);
+ }
+ finally
+ {
+ reader.Dispose();
+ }
+ }
+
+ private void LoadWebFile(FileReader reader)
+ {
+ Logger.Info("Loading " + reader.FullPath);
+ try
+ {
+ var webFile = new WebFile(reader);
+ foreach (var file in webFile.fileList)
+ {
+ var dummyPath = Path.Combine(Path.GetDirectoryName(reader.FullPath), file.fileName);
+ var subReader = new FileReader(dummyPath, file.stream);
+ switch (subReader.FileType)
+ {
+ case FileType.AssetsFile:
+ LoadAssetsFromMemory(subReader, reader.FullPath);
+ break;
+ case FileType.BundleFile:
+ LoadBundleFile(subReader, reader.FullPath);
+ break;
+ case FileType.WebFile:
+ LoadWebFile(subReader);
+ break;
+ case FileType.ResourceFile:
+ resourceFileReaders[file.fileName] = subReader; //TODO
+ break;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Logger.Error($"Error while reading web file {reader.FullPath}", e);
+ }
+ finally
+ {
+ reader.Dispose();
+ }
+ }
+
+ private void LoadZipFile(FileReader reader)
+ {
+ Logger.Info("Loading " + reader.FileName);
+ try
+ {
+ using (ZipArchive archive = new ZipArchive(reader.BaseStream, ZipArchiveMode.Read))
+ {
+ List splitFiles = new List();
+ // register all files before parsing the assets so that the external references can be found
+ // and find split files
+ foreach (ZipArchiveEntry entry in archive.Entries)
+ {
+ if (entry.Name.Contains(".split"))
+ {
+ string baseName = Path.GetFileNameWithoutExtension(entry.Name);
+ string basePath = Path.Combine(Path.GetDirectoryName(entry.FullName), baseName);
+ if (!splitFiles.Contains(basePath))
+ {
+ splitFiles.Add(basePath);
+ importFilesHash.Add(baseName);
+ }
+ }
+ else
+ {
+ importFilesHash.Add(entry.Name);
+ }
+ }
+
+ // merge split files and load the result
+ foreach (string basePath in splitFiles)
+ {
+ try
+ {
+ Stream splitStream = new MemoryStream();
+ int i = 0;
+ while (true)
+ {
+ string path = $"{basePath}.split{i++}";
+ ZipArchiveEntry entry = archive.GetEntry(path);
+ if (entry == null)
+ break;
+ using (Stream entryStream = entry.Open())
+ {
+ entryStream.CopyTo(splitStream);
+ }
+ }
+ splitStream.Seek(0, SeekOrigin.Begin);
+ FileReader entryReader = new FileReader(basePath, splitStream);
+ LoadFile(entryReader);
+ }
+ catch (Exception e)
+ {
+ Logger.Error($"Error while reading zip split file {basePath}", e);
+ }
+ }
+
+ // load all entries
+ foreach (ZipArchiveEntry entry in archive.Entries)
+ {
+ try
+ {
+ string dummyPath = Path.Combine(Path.GetDirectoryName(reader.FullPath), reader.FileName, entry.FullName);
+ // create a new stream
+ // - to store the deflated stream in
+ // - to keep the data for later extraction
+ Stream streamReader = new MemoryStream();
+ using (Stream entryStream = entry.Open())
+ {
+ entryStream.CopyTo(streamReader);
+ }
+ streamReader.Position = 0;
+
+ FileReader entryReader = new FileReader(dummyPath, streamReader);
+ LoadFile(entryReader);
+ if (entryReader.FileType == FileType.ResourceFile)
+ {
+ entryReader.Position = 0;
+ if (!resourceFileReaders.ContainsKey(entry.Name))
+ {
+ resourceFileReaders.Add(entry.Name, entryReader);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Logger.Error($"Error while reading zip entry {entry.FullName}", e);
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Logger.Error($"Error while reading zip file {reader.FileName}", e);
+ }
+ finally
+ {
+ reader.Dispose();
+ }
+ }
+
+ private void LoadHoYoFile(FileReader reader)
+ {
+ Logger.Info("Loading " + reader.FileName);
+ try
+ {
+ HoYoFile hoyoFile;
+ reader.BundlePos = CABManager.offsets.TryGetValue(reader.FullPath, out var list) ? list.ToArray() : Array.Empty();
+ hoyoFile = new HoYoFile(reader);
+ foreach (var bundle in hoyoFile.Bundles)
+ {
+ foreach (var file in bundle.Value)
+ {
+ var dummyPath = Path.Combine(Path.GetDirectoryName(reader.FullPath), file.fileName);
+ var cabReader = new FileReader(dummyPath, file.stream, Game);
+ if (cabReader.FileType == FileType.AssetsFile)
+ {
+ var assetsFile = new SerializedFile(cabReader, this, reader.FullPath);
+ CheckStrippedVersion(assetsFile);
+ assetsFileList.Add(assetsFile);
+ assetsFileListHash.Add(assetsFile.fileName);
+ }
+ else
+ {
+ resourceFileReaders[file.fileName] = cabReader; //TODO
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Logger.Error($"Error while reading file {reader.FileName}", e);
+ }
+ finally
+ {
+ reader.Dispose();
+ }
+ }
+
+ public void CheckStrippedVersion(SerializedFile assetsFile)
+ {
+ if (assetsFile.IsVersionStripped && string.IsNullOrEmpty(SpecifyUnityVersion))
+ {
+ throw new Exception("The Unity version has been stripped, please set the version in the options");
+ }
+ if (!string.IsNullOrEmpty(SpecifyUnityVersion))
+ {
+ assetsFile.SetVersion(SpecifyUnityVersion);
+ }
+ }
+
+ public void Clear()
+ {
+ foreach (var assetsFile in assetsFileList)
+ {
+ assetsFile.Objects.Clear();
+ assetsFile.reader.Close();
+ }
+ assetsFileList.Clear();
+
+ foreach (var resourceFileReader in resourceFileReaders)
+ {
+ resourceFileReader.Value.Close();
+ }
+ resourceFileReaders.Clear();
+
+ assetsFileIndexCache.Clear();
+ }
+
+ private void ReadAssets()
+ {
+ Logger.Info("Read assets...");
+
+ var progressCount = assetsFileList.Sum(x => x.m_Objects.Count);
+ int i = 0;
+ Progress.Reset();
+ foreach (var assetsFile in assetsFileList)
+ {
+ foreach (var objectInfo in assetsFile.m_Objects)
+ {
+ var objectReader = new ObjectReader(assetsFile.reader, assetsFile, objectInfo);
+ try
+ {
+ Object obj;
+ switch (objectReader.type)
+ {
+ case ClassIDType.Animation:
+ obj = new Animation(objectReader);
+ break;
+ case ClassIDType.AnimationClip:
+ obj = new AnimationClip(objectReader);
+ break;
+ case ClassIDType.Animator:
+ obj = new Animator(objectReader);
+ break;
+ case ClassIDType.AnimatorController:
+ obj = new AnimatorController(objectReader);
+ break;
+ case ClassIDType.AnimatorOverrideController:
+ obj = new AnimatorOverrideController(objectReader);
+ break;
+ case ClassIDType.AssetBundle:
+ obj = new AssetBundle(objectReader);
+ break;
+ case ClassIDType.AudioClip:
+ obj = new AudioClip(objectReader);
+ break;
+ case ClassIDType.Avatar:
+ obj = new Avatar(objectReader);
+ break;
+ case ClassIDType.Font:
+ obj = new Font(objectReader);
+ break;
+ case ClassIDType.GameObject:
+ obj = new GameObject(objectReader);
+ break;
+ case ClassIDType.IndexObject:
+ obj = new IndexObject(objectReader);
+ break;
+ case ClassIDType.Material:
+ obj = new Material(objectReader);
+ break;
+ case ClassIDType.Mesh:
+ obj = new Mesh(objectReader);
+ break;
+ case ClassIDType.MeshFilter:
+ obj = new MeshFilter(objectReader);
+ break;
+ case ClassIDType.MeshRenderer:
+ if (!Renderer.Parsable) continue;
+ obj = new MeshRenderer(objectReader);
+ break;
+ case ClassIDType.MiHoYoBinData:
+ obj = new MiHoYoBinData(objectReader);
+ break;
+ case ClassIDType.MonoBehaviour:
+ obj = new MonoBehaviour(objectReader);
+ break;
+ case ClassIDType.MonoScript:
+ obj = new MonoScript(objectReader);
+ break;
+ case ClassIDType.MovieTexture:
+ obj = new MovieTexture(objectReader);
+ break;
+ case ClassIDType.PlayerSettings:
+ obj = new PlayerSettings(objectReader);
+ break;
+ case ClassIDType.RectTransform:
+ obj = new RectTransform(objectReader);
+ break;
+ case ClassIDType.Shader:
+ if (!Shader.Parsable) continue;
+ obj = new Shader(objectReader);
+ break;
+ case ClassIDType.SkinnedMeshRenderer:
+ if (!Renderer.Parsable) continue;
+ obj = new SkinnedMeshRenderer(objectReader);
+ break;
+ case ClassIDType.Sprite:
+ obj = new Sprite(objectReader);
+ break;
+ case ClassIDType.SpriteAtlas:
+ obj = new SpriteAtlas(objectReader);
+ break;
+ case ClassIDType.TextAsset:
+ obj = new TextAsset(objectReader);
+ break;
+ case ClassIDType.Texture2D:
+ obj = new Texture2D(objectReader);
+ break;
+ case ClassIDType.Transform:
+ obj = new Transform(objectReader);
+ break;
+ case ClassIDType.VideoClip:
+ obj = new VideoClip(objectReader);
+ break;
+ case ClassIDType.ResourceManager:
+ obj = new ResourceManager(objectReader);
+ break;
+ default:
+ obj = new Object(objectReader);
+ break;
+ }
+ assetsFile.AddObject(obj);
+ }
+ catch (Exception e)
+ {
+ var sb = new StringBuilder();
+ sb.AppendLine("Unable to load object")
+ .AppendLine($"Assets {assetsFile.fileName}")
+ .AppendLine($"Path {assetsFile.originalPath}")
+ .AppendLine($"Type {objectReader.type}")
+ .AppendLine($"PathID {objectInfo.m_PathID}")
+ .Append(e);
+ Logger.Error(sb.ToString());
+ }
+
+ Progress.Report(++i, progressCount);
+ }
+ }
+ }
+
+ private void ProcessAssets()
+ {
+ Logger.Info("Process Assets...");
+
+ foreach (var assetsFile in assetsFileList)
+ {
+ foreach (var obj in assetsFile.Objects)
+ {
+ if (obj is GameObject m_GameObject)
+ {
+ foreach (var pptr in m_GameObject.m_Components)
+ {
+ if (pptr.TryGet(out var m_Component))
+ {
+ switch (m_Component)
+ {
+ case Transform m_Transform:
+ m_GameObject.m_Transform = m_Transform;
+ break;
+ case MeshRenderer m_MeshRenderer:
+ m_GameObject.m_MeshRenderer = m_MeshRenderer;
+ break;
+ case MeshFilter m_MeshFilter:
+ m_GameObject.m_MeshFilter = m_MeshFilter;
+ break;
+ case SkinnedMeshRenderer m_SkinnedMeshRenderer:
+ m_GameObject.m_SkinnedMeshRenderer = m_SkinnedMeshRenderer;
+ break;
+ case Animator m_Animator:
+ m_GameObject.m_Animator = m_Animator;
+ break;
+ case Animation m_Animation:
+ m_GameObject.m_Animation = m_Animation;
+ break;
+ }
+ }
+ }
+ }
+ else if (obj is SpriteAtlas m_SpriteAtlas)
+ {
+ if (m_SpriteAtlas.m_RenderDataMap.Count > 0)
+ {
+ foreach (var m_PackedSprite in m_SpriteAtlas.m_PackedSprites)
+ {
+ if (m_PackedSprite.TryGet(out var m_Sprite))
+ {
+ if (m_Sprite.m_SpriteAtlas.IsNull)
+ {
+ m_Sprite.m_SpriteAtlas.Set(m_SpriteAtlas);
+ }
+ else
+ {
+ m_Sprite.m_SpriteAtlas.TryGet(out var m_SpriteAtlaOld);
+ if (m_SpriteAtlaOld.m_IsVariant)
+ {
+ m_Sprite.m_SpriteAtlas.Set(m_SpriteAtlas);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/AssetStudio/BigArrayPool.cs b/AssetStudio/BigArrayPool.cs
new file mode 100644
index 0000000..369e689
--- /dev/null
+++ b/AssetStudio/BigArrayPool.cs
@@ -0,0 +1,10 @@
+using System.Buffers;
+
+namespace AssetStudio
+{
+ public static class BigArrayPool
+ {
+ private static readonly ArrayPool s_shared = ArrayPool.Create(64 * 1024 * 1024, 3);
+ public static ArrayPool Shared => s_shared;
+ }
+}
diff --git a/AssetStudio/Brotli/BitReader.cs b/AssetStudio/Brotli/BitReader.cs
new file mode 100644
index 0000000..9438c24
--- /dev/null
+++ b/AssetStudio/Brotli/BitReader.cs
@@ -0,0 +1,271 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+Distributed under MIT license.
+See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+namespace Org.Brotli.Dec
+{
+ /// Bit reading helpers.
+ internal sealed class BitReader
+ {
+ ///
+ /// Input byte buffer, consist of a ring-buffer and a "slack" region where bytes from the start of
+ /// the ring-buffer are copied.
+ ///
+ private const int Capacity = 1024;
+
+ private const int Slack = 16;
+
+ private const int IntBufferSize = Capacity + Slack;
+
+ private const int ByteReadSize = Capacity << 2;
+
+ private const int ByteBufferSize = IntBufferSize << 2;
+
+ private readonly byte[] byteBuffer = new byte[ByteBufferSize];
+
+ private readonly int[] intBuffer = new int[IntBufferSize];
+
+ private readonly Org.Brotli.Dec.IntReader intReader = new Org.Brotli.Dec.IntReader();
+
+ private System.IO.Stream input;
+
+ /// Input stream is finished.
+ private bool endOfStreamReached;
+
+ /// Pre-fetched bits.
+ internal long accumulator;
+
+ /// Current bit-reading position in accumulator.
+ internal int bitOffset;
+
+ /// Offset of next item in intBuffer.
+ private int intOffset;
+
+ private int tailBytes = 0;
+
+ /* Number of bytes in unfinished "int" item. */
+ /// Fills up the input buffer.
+ ///
+ /// Fills up the input buffer.
+ /// No-op if there are at least 36 bytes present after current position.
+ ///
After encountering the end of the input stream, 64 additional zero bytes are copied to the
+ /// buffer.
+ ///
+ internal static void ReadMoreInput(Org.Brotli.Dec.BitReader br)
+ {
+ // TODO: Split to check and read; move read outside of decoding loop.
+ if (br.intOffset <= Capacity - 9)
+ {
+ return;
+ }
+ if (br.endOfStreamReached)
+ {
+ if (IntAvailable(br) >= -2)
+ {
+ return;
+ }
+ throw new Org.Brotli.Dec.BrotliRuntimeException("No more input");
+ }
+ int readOffset = br.intOffset << 2;
+ int bytesRead = ByteReadSize - readOffset;
+ System.Array.Copy(br.byteBuffer, readOffset, br.byteBuffer, 0, bytesRead);
+ br.intOffset = 0;
+ try
+ {
+ while (bytesRead < ByteReadSize)
+ {
+ int len = br.input.Read(br.byteBuffer, bytesRead, ByteReadSize - bytesRead);
+ // EOF is -1 in Java, but 0 in C#.
+ if (len <= 0)
+ {
+ br.endOfStreamReached = true;
+ br.tailBytes = bytesRead;
+ bytesRead += 3;
+ break;
+ }
+ bytesRead += len;
+ }
+ }
+ catch (System.IO.IOException e)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Failed to read input", e);
+ }
+ Org.Brotli.Dec.IntReader.Convert(br.intReader, bytesRead >> 2);
+ }
+
+ internal static void CheckHealth(Org.Brotli.Dec.BitReader br, bool endOfStream)
+ {
+ if (!br.endOfStreamReached)
+ {
+ return;
+ }
+ int byteOffset = (br.intOffset << 2) + ((br.bitOffset + 7) >> 3) - 8;
+ if (byteOffset > br.tailBytes)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Read after end");
+ }
+ if (endOfStream && (byteOffset != br.tailBytes))
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Unused bytes after end");
+ }
+ }
+
+ /// Advances the Read buffer by 5 bytes to make room for reading next 24 bits.
+ internal static void FillBitWindow(Org.Brotli.Dec.BitReader br)
+ {
+ if (br.bitOffset >= 32)
+ {
+ br.accumulator = ((long)br.intBuffer[br.intOffset++] << 32) | ((long)(((ulong)br.accumulator) >> 32));
+ br.bitOffset -= 32;
+ }
+ }
+
+ /// Reads the specified number of bits from Read Buffer.
+ internal static int ReadBits(Org.Brotli.Dec.BitReader br, int n)
+ {
+ FillBitWindow(br);
+ int val = (int)((long)(((ulong)br.accumulator) >> br.bitOffset)) & ((1 << n) - 1);
+ br.bitOffset += n;
+ return val;
+ }
+
+ /// Initialize bit reader.
+ ///
+ /// Initialize bit reader.
+ /// Initialisation turns bit reader to a ready state. Also a number of bytes is prefetched to
+ /// accumulator. Because of that this method may block until enough data could be read from input.
+ ///
+ /// BitReader POJO
+ /// data source
+ internal static void Init(Org.Brotli.Dec.BitReader br, System.IO.Stream input)
+ {
+ if (br.input != null)
+ {
+ throw new System.InvalidOperationException("Bit reader already has associated input stream");
+ }
+ Org.Brotli.Dec.IntReader.Init(br.intReader, br.byteBuffer, br.intBuffer);
+ br.input = input;
+ br.accumulator = 0;
+ br.bitOffset = 64;
+ br.intOffset = Capacity;
+ br.endOfStreamReached = false;
+ Prepare(br);
+ }
+
+ private static void Prepare(Org.Brotli.Dec.BitReader br)
+ {
+ ReadMoreInput(br);
+ CheckHealth(br, false);
+ FillBitWindow(br);
+ FillBitWindow(br);
+ }
+
+ internal static void Reload(Org.Brotli.Dec.BitReader br)
+ {
+ if (br.bitOffset == 64)
+ {
+ Prepare(br);
+ }
+ }
+
+ ///
+ internal static void Close(Org.Brotli.Dec.BitReader br)
+ {
+ System.IO.Stream @is = br.input;
+ br.input = null;
+ if (@is != null)
+ {
+ @is.Close();
+ }
+ }
+
+ internal static void JumpToByteBoundary(Org.Brotli.Dec.BitReader br)
+ {
+ int padding = (64 - br.bitOffset) & 7;
+ if (padding != 0)
+ {
+ int paddingBits = Org.Brotli.Dec.BitReader.ReadBits(br, padding);
+ if (paddingBits != 0)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Corrupted padding bits");
+ }
+ }
+ }
+
+ internal static int IntAvailable(Org.Brotli.Dec.BitReader br)
+ {
+ int limit = Capacity;
+ if (br.endOfStreamReached)
+ {
+ limit = (br.tailBytes + 3) >> 2;
+ }
+ return limit - br.intOffset;
+ }
+
+ internal static void CopyBytes(Org.Brotli.Dec.BitReader br, byte[] data, int offset, int length)
+ {
+ if ((br.bitOffset & 7) != 0)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Unaligned copyBytes");
+ }
+ // Drain accumulator.
+ while ((br.bitOffset != 64) && (length != 0))
+ {
+ data[offset++] = unchecked((byte)((long)(((ulong)br.accumulator) >> br.bitOffset)));
+ br.bitOffset += 8;
+ length--;
+ }
+ if (length == 0)
+ {
+ return;
+ }
+ // Get data from shadow buffer with "sizeof(int)" granularity.
+ int copyInts = System.Math.Min(IntAvailable(br), length >> 2);
+ if (copyInts > 0)
+ {
+ int readOffset = br.intOffset << 2;
+ System.Array.Copy(br.byteBuffer, readOffset, data, offset, copyInts << 2);
+ offset += copyInts << 2;
+ length -= copyInts << 2;
+ br.intOffset += copyInts;
+ }
+ if (length == 0)
+ {
+ return;
+ }
+ // Read tail bytes.
+ if (IntAvailable(br) > 0)
+ {
+ // length = 1..3
+ FillBitWindow(br);
+ while (length != 0)
+ {
+ data[offset++] = unchecked((byte)((long)(((ulong)br.accumulator) >> br.bitOffset)));
+ br.bitOffset += 8;
+ length--;
+ }
+ CheckHealth(br, false);
+ return;
+ }
+ // Now it is possible to copy bytes directly.
+ try
+ {
+ while (length > 0)
+ {
+ int len = br.input.Read(data, offset, length);
+ if (len == -1)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Unexpected end of input");
+ }
+ offset += len;
+ length -= len;
+ }
+ }
+ catch (System.IO.IOException e)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Failed to read input", e);
+ }
+ }
+ }
+}
diff --git a/AssetStudio/Brotli/BrotliInputStream.cs b/AssetStudio/Brotli/BrotliInputStream.cs
new file mode 100644
index 0000000..097f179
--- /dev/null
+++ b/AssetStudio/Brotli/BrotliInputStream.cs
@@ -0,0 +1,223 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+Distributed under MIT license.
+See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+namespace Org.Brotli.Dec
+{
+ ///
+ ///
+ /// decorator that decompresses brotli data.
+ /// Not thread-safe.
+ ///
+ public class BrotliInputStream : System.IO.Stream
+ {
+ public const int DefaultInternalBufferSize = 16384;
+
+ /// Internal buffer used for efficient byte-by-byte reading.
+ private byte[] buffer;
+
+ /// Number of decoded but still unused bytes in internal buffer.
+ private int remainingBufferBytes;
+
+ /// Next unused byte offset.
+ private int bufferOffset;
+
+ /// Decoder state.
+ private readonly Org.Brotli.Dec.State state = new Org.Brotli.Dec.State();
+
+ ///
+ /// Creates a
+ ///
+ /// wrapper that decompresses brotli data.
+ /// For byte-by-byte reading (
+ ///
+ /// ) internal buffer with
+ ///
+ /// size is allocated and used.
+ ///
Will block the thread until first kilobyte of data of source is available.
+ ///
+ /// underlying data source
+ /// in case of corrupted data or source stream problems
+ public BrotliInputStream(System.IO.Stream source)
+ : this(source, DefaultInternalBufferSize, null)
+ {
+ }
+
+ ///
+ /// Creates a
+ ///
+ /// wrapper that decompresses brotli data.
+ /// For byte-by-byte reading (
+ ///
+ /// ) internal buffer of specified size is
+ /// allocated and used.
+ ///
Will block the thread until first kilobyte of data of source is available.
+ ///
+ /// compressed data source
+ ///
+ /// size of internal buffer used in case of
+ /// byte-by-byte reading
+ ///
+ /// in case of corrupted data or source stream problems
+ public BrotliInputStream(System.IO.Stream source, int byteReadBufferSize)
+ : this(source, byteReadBufferSize, null)
+ {
+ }
+
+ ///
+ /// Creates a
+ ///
+ /// wrapper that decompresses brotli data.
+ /// For byte-by-byte reading (
+ ///
+ /// ) internal buffer of specified size is
+ /// allocated and used.
+ ///
Will block the thread until first kilobyte of data of source is available.
+ ///
+ /// compressed data source
+ ///
+ /// size of internal buffer used in case of
+ /// byte-by-byte reading
+ ///
+ ///
+ /// custom dictionary data;
+ ///
+ /// if not used
+ ///
+ /// in case of corrupted data or source stream problems
+ public BrotliInputStream(System.IO.Stream source, int byteReadBufferSize, byte[] customDictionary)
+ {
+ if (byteReadBufferSize <= 0)
+ {
+ throw new System.ArgumentException("Bad buffer size:" + byteReadBufferSize);
+ }
+ else if (source == null)
+ {
+ throw new System.ArgumentException("source is null");
+ }
+ this.buffer = new byte[byteReadBufferSize];
+ this.remainingBufferBytes = 0;
+ this.bufferOffset = 0;
+ try
+ {
+ Org.Brotli.Dec.State.SetInput(state, source);
+ }
+ catch (Org.Brotli.Dec.BrotliRuntimeException ex)
+ {
+ throw new System.IO.IOException("Brotli decoder initialization failed", ex);
+ }
+ if (customDictionary != null)
+ {
+ Org.Brotli.Dec.Decode.SetCustomDictionary(state, customDictionary);
+ }
+ }
+
+ ///
+ ///
+ public override void Close()
+ {
+ Org.Brotli.Dec.State.Close(state);
+ }
+
+ ///
+ ///
+ public override int ReadByte()
+ {
+ if (bufferOffset >= remainingBufferBytes)
+ {
+ remainingBufferBytes = Read(buffer, 0, buffer.Length);
+ bufferOffset = 0;
+ if (remainingBufferBytes == -1)
+ {
+ return -1;
+ }
+ }
+ return buffer[bufferOffset++] & unchecked((int)(0xFF));
+ }
+
+ ///
+ ///
+ public override int Read(byte[] destBuffer, int destOffset, int destLen)
+ {
+ if (destOffset < 0)
+ {
+ throw new System.ArgumentException("Bad offset: " + destOffset);
+ }
+ else if (destLen < 0)
+ {
+ throw new System.ArgumentException("Bad length: " + destLen);
+ }
+ else if (destOffset + destLen > destBuffer.Length)
+ {
+ throw new System.ArgumentException("Buffer overflow: " + (destOffset + destLen) + " > " + destBuffer.Length);
+ }
+ else if (destLen == 0)
+ {
+ return 0;
+ }
+ int copyLen = System.Math.Max(remainingBufferBytes - bufferOffset, 0);
+ if (copyLen != 0)
+ {
+ copyLen = System.Math.Min(copyLen, destLen);
+ System.Array.Copy(buffer, bufferOffset, destBuffer, destOffset, copyLen);
+ bufferOffset += copyLen;
+ destOffset += copyLen;
+ destLen -= copyLen;
+ if (destLen == 0)
+ {
+ return copyLen;
+ }
+ }
+ try
+ {
+ state.output = destBuffer;
+ state.outputOffset = destOffset;
+ state.outputLength = destLen;
+ state.outputUsed = 0;
+ Org.Brotli.Dec.Decode.Decompress(state);
+ if (state.outputUsed == 0)
+ {
+ return 0;
+ }
+ return state.outputUsed + copyLen;
+ }
+ catch (Org.Brotli.Dec.BrotliRuntimeException ex)
+ {
+ throw new System.IO.IOException("Brotli stream decoding failed", ex);
+ }
+ }
+ // <{[INJECTED CODE]}>
+ public override bool CanRead {
+ get {return true;}
+ }
+
+ public override bool CanSeek {
+ get {return false;}
+ }
+ public override long Length {
+ get {throw new System.NotSupportedException();}
+ }
+ public override long Position {
+ get {throw new System.NotSupportedException();}
+ set {throw new System.NotSupportedException();}
+ }
+ public override long Seek(long offset, System.IO.SeekOrigin origin) {
+ throw new System.NotSupportedException();
+ }
+ public override void SetLength(long value){
+ throw new System.NotSupportedException();
+ }
+
+ public override bool CanWrite{get{return false;}}
+ public override System.IAsyncResult BeginWrite(byte[] buffer, int offset,
+ int count, System.AsyncCallback callback, object state) {
+ throw new System.NotSupportedException();
+ }
+ public override void Write(byte[] buffer, int offset, int count) {
+ throw new System.NotSupportedException();
+ }
+
+ public override void Flush() {}
+ }
+}
diff --git a/AssetStudio/Brotli/BrotliRuntimeException.cs b/AssetStudio/Brotli/BrotliRuntimeException.cs
new file mode 100644
index 0000000..41f336e
--- /dev/null
+++ b/AssetStudio/Brotli/BrotliRuntimeException.cs
@@ -0,0 +1,22 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+Distributed under MIT license.
+See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+namespace Org.Brotli.Dec
+{
+ /// Unchecked exception used internally.
+ [System.Serializable]
+ internal class BrotliRuntimeException : System.Exception
+ {
+ internal BrotliRuntimeException(string message)
+ : base(message)
+ {
+ }
+
+ internal BrotliRuntimeException(string message, System.Exception cause)
+ : base(message, cause)
+ {
+ }
+ }
+}
diff --git a/AssetStudio/Brotli/Context.cs b/AssetStudio/Brotli/Context.cs
new file mode 100644
index 0000000..8a525db
--- /dev/null
+++ b/AssetStudio/Brotli/Context.cs
@@ -0,0 +1,57 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+Distributed under MIT license.
+See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+namespace Org.Brotli.Dec
+{
+ /// Common context lookup table for all context modes.
+ internal sealed class Context
+ {
+ internal static readonly int[] Lookup = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 12, 16, 12, 12, 20, 12, 16, 24, 28, 12, 12, 32, 12, 36, 12, 44, 44, 44, 44, 44, 44, 44, 44
+ , 44, 44, 32, 32, 24, 40, 28, 12, 12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, 12, 28, 12, 12, 12, 56, 60, 60, 60, 56, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56, 60, 60, 60, 60
+ , 60, 56, 60, 60, 60, 60, 60, 24, 12, 28, 12, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+ 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,
+ 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 40, 40, 40, 40, 40, 40, 40, 40, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38
+ , 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35
+ , 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,
+ 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24,
+ 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39,
+ 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54,
+ 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ internal static readonly int[] LookupOffsets = new int[] { 1024, 1536, 1280, 1536, 0, 256, 768, 512 };
+ // CONTEXT_UTF8, last byte.
+ // ASCII range.
+ // UTF8 continuation byte range.
+ // UTF8 lead byte range.
+ // CONTEXT_UTF8 second last byte.
+ // ASCII range.
+ // UTF8 continuation byte range.
+ // UTF8 lead byte range.
+ // CONTEXT_SIGNED, second last byte.
+ // CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits.
+ // CONTEXT_LSB6, last byte.
+ // CONTEXT_MSB6, last byte.
+ // CONTEXT_{M,L}SB6, second last byte,
+ // CONTEXT_LSB6
+ // CONTEXT_MSB6
+ // CONTEXT_UTF8
+ // CONTEXT_SIGNED
+ }
+}
diff --git a/AssetStudio/Brotli/Decode.cs b/AssetStudio/Brotli/Decode.cs
new file mode 100644
index 0000000..eb5d36e
--- /dev/null
+++ b/AssetStudio/Brotli/Decode.cs
@@ -0,0 +1,992 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+Distributed under MIT license.
+See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+namespace Org.Brotli.Dec
+{
+ /// API for Brotli decompression.
+ internal sealed class Decode
+ {
+ private const int DefaultCodeLength = 8;
+
+ private const int CodeLengthRepeatCode = 16;
+
+ private const int NumLiteralCodes = 256;
+
+ private const int NumInsertAndCopyCodes = 704;
+
+ private const int NumBlockLengthCodes = 26;
+
+ private const int LiteralContextBits = 6;
+
+ private const int DistanceContextBits = 2;
+
+ private const int HuffmanTableBits = 8;
+
+ private const int HuffmanTableMask = unchecked((int)(0xFF));
+
+ private const int CodeLengthCodes = 18;
+
+ private static readonly int[] CodeLengthCodeOrder = new int[] { 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+
+ private const int NumDistanceShortCodes = 16;
+
+ private static readonly int[] DistanceShortCodeIndexOffset = new int[] { 3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2 };
+
+ private static readonly int[] DistanceShortCodeValueOffset = new int[] { 0, 0, 0, 0, -1, 1, -2, 2, -3, 3, -1, 1, -2, 2, -3, 3 };
+
+ /// Static Huffman code for the code length code lengths.
+ private static readonly int[] FixedTable = new int[] { unchecked((int)(0x020000)), unchecked((int)(0x020004)), unchecked((int)(0x020003)), unchecked((int)(0x030002)), unchecked((int)(0x020000)), unchecked((int)(0x020004)), unchecked((int)(0x020003
+ )), unchecked((int)(0x040001)), unchecked((int)(0x020000)), unchecked((int)(0x020004)), unchecked((int)(0x020003)), unchecked((int)(0x030002)), unchecked((int)(0x020000)), unchecked((int)(0x020004)), unchecked((int)(0x020003)), unchecked((int
+ )(0x040005)) };
+
+ /// Decodes a number in the range [0..255], by reading 1 - 11 bits.
+ private static int DecodeVarLenUnsignedByte(Org.Brotli.Dec.BitReader br)
+ {
+ if (Org.Brotli.Dec.BitReader.ReadBits(br, 1) != 0)
+ {
+ int n = Org.Brotli.Dec.BitReader.ReadBits(br, 3);
+ if (n == 0)
+ {
+ return 1;
+ }
+ else
+ {
+ return Org.Brotli.Dec.BitReader.ReadBits(br, n) + (1 << n);
+ }
+ }
+ return 0;
+ }
+
+ private static void DecodeMetaBlockLength(Org.Brotli.Dec.BitReader br, Org.Brotli.Dec.State state)
+ {
+ state.inputEnd = Org.Brotli.Dec.BitReader.ReadBits(br, 1) == 1;
+ state.metaBlockLength = 0;
+ state.isUncompressed = false;
+ state.isMetadata = false;
+ if (state.inputEnd && Org.Brotli.Dec.BitReader.ReadBits(br, 1) != 0)
+ {
+ return;
+ }
+ int sizeNibbles = Org.Brotli.Dec.BitReader.ReadBits(br, 2) + 4;
+ if (sizeNibbles == 7)
+ {
+ state.isMetadata = true;
+ if (Org.Brotli.Dec.BitReader.ReadBits(br, 1) != 0)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Corrupted reserved bit");
+ }
+ int sizeBytes = Org.Brotli.Dec.BitReader.ReadBits(br, 2);
+ if (sizeBytes == 0)
+ {
+ return;
+ }
+ for (int i = 0; i < sizeBytes; i++)
+ {
+ int bits = Org.Brotli.Dec.BitReader.ReadBits(br, 8);
+ if (bits == 0 && i + 1 == sizeBytes && sizeBytes > 1)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Exuberant nibble");
+ }
+ state.metaBlockLength |= bits << (i * 8);
+ }
+ }
+ else
+ {
+ for (int i = 0; i < sizeNibbles; i++)
+ {
+ int bits = Org.Brotli.Dec.BitReader.ReadBits(br, 4);
+ if (bits == 0 && i + 1 == sizeNibbles && sizeNibbles > 4)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Exuberant nibble");
+ }
+ state.metaBlockLength |= bits << (i * 4);
+ }
+ }
+ state.metaBlockLength++;
+ if (!state.inputEnd)
+ {
+ state.isUncompressed = Org.Brotli.Dec.BitReader.ReadBits(br, 1) == 1;
+ }
+ }
+
+ /// Decodes the next Huffman code from bit-stream.
+ private static int ReadSymbol(int[] table, int offset, Org.Brotli.Dec.BitReader br)
+ {
+ int val = (int)((long)(((ulong)br.accumulator) >> br.bitOffset));
+ offset += val & HuffmanTableMask;
+ int bits = table[offset] >> 16;
+ int sym = table[offset] & unchecked((int)(0xFFFF));
+ if (bits <= HuffmanTableBits)
+ {
+ br.bitOffset += bits;
+ return sym;
+ }
+ offset += sym;
+ int mask = (1 << bits) - 1;
+ offset += (int)(((uint)(val & mask)) >> HuffmanTableBits);
+ br.bitOffset += ((table[offset] >> 16) + HuffmanTableBits);
+ return table[offset] & unchecked((int)(0xFFFF));
+ }
+
+ private static int ReadBlockLength(int[] table, int offset, Org.Brotli.Dec.BitReader br)
+ {
+ Org.Brotli.Dec.BitReader.FillBitWindow(br);
+ int code = ReadSymbol(table, offset, br);
+ int n = Org.Brotli.Dec.Prefix.BlockLengthNBits[code];
+ return Org.Brotli.Dec.Prefix.BlockLengthOffset[code] + Org.Brotli.Dec.BitReader.ReadBits(br, n);
+ }
+
+ private static int TranslateShortCodes(int code, int[] ringBuffer, int index)
+ {
+ if (code < NumDistanceShortCodes)
+ {
+ index += DistanceShortCodeIndexOffset[code];
+ index &= 3;
+ return ringBuffer[index] + DistanceShortCodeValueOffset[code];
+ }
+ return code - NumDistanceShortCodes + 1;
+ }
+
+ private static void MoveToFront(int[] v, int index)
+ {
+ int value = v[index];
+ for (; index > 0; index--)
+ {
+ v[index] = v[index - 1];
+ }
+ v[0] = value;
+ }
+
+ private static void InverseMoveToFrontTransform(byte[] v, int vLen)
+ {
+ int[] mtf = new int[256];
+ for (int i = 0; i < 256; i++)
+ {
+ mtf[i] = i;
+ }
+ for (int i = 0; i < vLen; i++)
+ {
+ int index = v[i] & unchecked((int)(0xFF));
+ v[i] = unchecked((byte)mtf[index]);
+ if (index != 0)
+ {
+ MoveToFront(mtf, index);
+ }
+ }
+ }
+
+ private static void ReadHuffmanCodeLengths(int[] codeLengthCodeLengths, int numSymbols, int[] codeLengths, Org.Brotli.Dec.BitReader br)
+ {
+ int symbol = 0;
+ int prevCodeLen = DefaultCodeLength;
+ int repeat = 0;
+ int repeatCodeLen = 0;
+ int space = 32768;
+ int[] table = new int[32];
+ Org.Brotli.Dec.Huffman.BuildHuffmanTable(table, 0, 5, codeLengthCodeLengths, CodeLengthCodes);
+ while (symbol < numSymbols && space > 0)
+ {
+ Org.Brotli.Dec.BitReader.ReadMoreInput(br);
+ Org.Brotli.Dec.BitReader.FillBitWindow(br);
+ int p = (int)(((long)(((ulong)br.accumulator) >> br.bitOffset))) & 31;
+ br.bitOffset += table[p] >> 16;
+ int codeLen = table[p] & unchecked((int)(0xFFFF));
+ if (codeLen < CodeLengthRepeatCode)
+ {
+ repeat = 0;
+ codeLengths[symbol++] = codeLen;
+ if (codeLen != 0)
+ {
+ prevCodeLen = codeLen;
+ space -= 32768 >> codeLen;
+ }
+ }
+ else
+ {
+ int extraBits = codeLen - 14;
+ int newLen = 0;
+ if (codeLen == CodeLengthRepeatCode)
+ {
+ newLen = prevCodeLen;
+ }
+ if (repeatCodeLen != newLen)
+ {
+ repeat = 0;
+ repeatCodeLen = newLen;
+ }
+ int oldRepeat = repeat;
+ if (repeat > 0)
+ {
+ repeat -= 2;
+ repeat <<= extraBits;
+ }
+ repeat += Org.Brotli.Dec.BitReader.ReadBits(br, extraBits) + 3;
+ int repeatDelta = repeat - oldRepeat;
+ if (symbol + repeatDelta > numSymbols)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("symbol + repeatDelta > numSymbols");
+ }
+ // COV_NF_LINE
+ for (int i = 0; i < repeatDelta; i++)
+ {
+ codeLengths[symbol++] = repeatCodeLen;
+ }
+ if (repeatCodeLen != 0)
+ {
+ space -= repeatDelta << (15 - repeatCodeLen);
+ }
+ }
+ }
+ if (space != 0)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Unused space");
+ }
+ // COV_NF_LINE
+ // TODO: Pass max_symbol to Huffman table builder instead?
+ Org.Brotli.Dec.Utils.FillWithZeroes(codeLengths, symbol, numSymbols - symbol);
+ }
+
+ // TODO: Use specialized versions for smaller tables.
+ internal static void ReadHuffmanCode(int alphabetSize, int[] table, int offset, Org.Brotli.Dec.BitReader br)
+ {
+ bool ok = true;
+ int simpleCodeOrSkip;
+ Org.Brotli.Dec.BitReader.ReadMoreInput(br);
+ // TODO: Avoid allocation.
+ int[] codeLengths = new int[alphabetSize];
+ simpleCodeOrSkip = Org.Brotli.Dec.BitReader.ReadBits(br, 2);
+ if (simpleCodeOrSkip == 1)
+ {
+ // Read symbols, codes & code lengths directly.
+ int maxBitsCounter = alphabetSize - 1;
+ int maxBits = 0;
+ int[] symbols = new int[4];
+ int numSymbols = Org.Brotli.Dec.BitReader.ReadBits(br, 2) + 1;
+ while (maxBitsCounter != 0)
+ {
+ maxBitsCounter >>= 1;
+ maxBits++;
+ }
+ // TODO: uncomment when codeLengths is reused.
+ // Utils.fillWithZeroes(codeLengths, 0, alphabetSize);
+ for (int i = 0; i < numSymbols; i++)
+ {
+ symbols[i] = Org.Brotli.Dec.BitReader.ReadBits(br, maxBits) % alphabetSize;
+ codeLengths[symbols[i]] = 2;
+ }
+ codeLengths[symbols[0]] = 1;
+ switch (numSymbols)
+ {
+ case 1:
+ {
+ break;
+ }
+
+ case 2:
+ {
+ ok = symbols[0] != symbols[1];
+ codeLengths[symbols[1]] = 1;
+ break;
+ }
+
+ case 3:
+ {
+ ok = symbols[0] != symbols[1] && symbols[0] != symbols[2] && symbols[1] != symbols[2];
+ break;
+ }
+
+ case 4:
+ default:
+ {
+ ok = symbols[0] != symbols[1] && symbols[0] != symbols[2] && symbols[0] != symbols[3] && symbols[1] != symbols[2] && symbols[1] != symbols[3] && symbols[2] != symbols[3];
+ if (Org.Brotli.Dec.BitReader.ReadBits(br, 1) == 1)
+ {
+ codeLengths[symbols[2]] = 3;
+ codeLengths[symbols[3]] = 3;
+ }
+ else
+ {
+ codeLengths[symbols[0]] = 2;
+ }
+ break;
+ }
+ }
+ }
+ else
+ {
+ // Decode Huffman-coded code lengths.
+ int[] codeLengthCodeLengths = new int[CodeLengthCodes];
+ int space = 32;
+ int numCodes = 0;
+ for (int i = simpleCodeOrSkip; i < CodeLengthCodes && space > 0; i++)
+ {
+ int codeLenIdx = CodeLengthCodeOrder[i];
+ Org.Brotli.Dec.BitReader.FillBitWindow(br);
+ int p = (int)((long)(((ulong)br.accumulator) >> br.bitOffset)) & 15;
+ // TODO: Demultiplex FIXED_TABLE.
+ br.bitOffset += FixedTable[p] >> 16;
+ int v = FixedTable[p] & unchecked((int)(0xFFFF));
+ codeLengthCodeLengths[codeLenIdx] = v;
+ if (v != 0)
+ {
+ space -= (32 >> v);
+ numCodes++;
+ }
+ }
+ ok = (numCodes == 1 || space == 0);
+ ReadHuffmanCodeLengths(codeLengthCodeLengths, alphabetSize, codeLengths, br);
+ }
+ if (!ok)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Can't readHuffmanCode");
+ }
+ // COV_NF_LINE
+ Org.Brotli.Dec.Huffman.BuildHuffmanTable(table, offset, HuffmanTableBits, codeLengths, alphabetSize);
+ }
+
+ private static int DecodeContextMap(int contextMapSize, byte[] contextMap, Org.Brotli.Dec.BitReader br)
+ {
+ Org.Brotli.Dec.BitReader.ReadMoreInput(br);
+ int numTrees = DecodeVarLenUnsignedByte(br) + 1;
+ if (numTrees == 1)
+ {
+ Org.Brotli.Dec.Utils.FillWithZeroes(contextMap, 0, contextMapSize);
+ return numTrees;
+ }
+ bool useRleForZeros = Org.Brotli.Dec.BitReader.ReadBits(br, 1) == 1;
+ int maxRunLengthPrefix = 0;
+ if (useRleForZeros)
+ {
+ maxRunLengthPrefix = Org.Brotli.Dec.BitReader.ReadBits(br, 4) + 1;
+ }
+ int[] table = new int[Org.Brotli.Dec.Huffman.HuffmanMaxTableSize];
+ ReadHuffmanCode(numTrees + maxRunLengthPrefix, table, 0, br);
+ for (int i = 0; i < contextMapSize; )
+ {
+ Org.Brotli.Dec.BitReader.ReadMoreInput(br);
+ Org.Brotli.Dec.BitReader.FillBitWindow(br);
+ int code = ReadSymbol(table, 0, br);
+ if (code == 0)
+ {
+ contextMap[i] = 0;
+ i++;
+ }
+ else if (code <= maxRunLengthPrefix)
+ {
+ int reps = (1 << code) + Org.Brotli.Dec.BitReader.ReadBits(br, code);
+ while (reps != 0)
+ {
+ if (i >= contextMapSize)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Corrupted context map");
+ }
+ // COV_NF_LINE
+ contextMap[i] = 0;
+ i++;
+ reps--;
+ }
+ }
+ else
+ {
+ contextMap[i] = unchecked((byte)(code - maxRunLengthPrefix));
+ i++;
+ }
+ }
+ if (Org.Brotli.Dec.BitReader.ReadBits(br, 1) == 1)
+ {
+ InverseMoveToFrontTransform(contextMap, contextMapSize);
+ }
+ return numTrees;
+ }
+
+ private static void DecodeBlockTypeAndLength(Org.Brotli.Dec.State state, int treeType)
+ {
+ Org.Brotli.Dec.BitReader br = state.br;
+ int[] ringBuffers = state.blockTypeRb;
+ int offset = treeType * 2;
+ Org.Brotli.Dec.BitReader.FillBitWindow(br);
+ int blockType = ReadSymbol(state.blockTypeTrees, treeType * Org.Brotli.Dec.Huffman.HuffmanMaxTableSize, br);
+ state.blockLength[treeType] = ReadBlockLength(state.blockLenTrees, treeType * Org.Brotli.Dec.Huffman.HuffmanMaxTableSize, br);
+ if (blockType == 1)
+ {
+ blockType = ringBuffers[offset + 1] + 1;
+ }
+ else if (blockType == 0)
+ {
+ blockType = ringBuffers[offset];
+ }
+ else
+ {
+ blockType -= 2;
+ }
+ if (blockType >= state.numBlockTypes[treeType])
+ {
+ blockType -= state.numBlockTypes[treeType];
+ }
+ ringBuffers[offset] = ringBuffers[offset + 1];
+ ringBuffers[offset + 1] = blockType;
+ }
+
+ private static void DecodeLiteralBlockSwitch(Org.Brotli.Dec.State state)
+ {
+ DecodeBlockTypeAndLength(state, 0);
+ int literalBlockType = state.blockTypeRb[1];
+ state.contextMapSlice = literalBlockType << LiteralContextBits;
+ state.literalTreeIndex = state.contextMap[state.contextMapSlice] & unchecked((int)(0xFF));
+ state.literalTree = state.hGroup0.trees[state.literalTreeIndex];
+ int contextMode = state.contextModes[literalBlockType];
+ state.contextLookupOffset1 = Org.Brotli.Dec.Context.LookupOffsets[contextMode];
+ state.contextLookupOffset2 = Org.Brotli.Dec.Context.LookupOffsets[contextMode + 1];
+ }
+
+ private static void DecodeCommandBlockSwitch(Org.Brotli.Dec.State state)
+ {
+ DecodeBlockTypeAndLength(state, 1);
+ state.treeCommandOffset = state.hGroup1.trees[state.blockTypeRb[3]];
+ }
+
+ private static void DecodeDistanceBlockSwitch(Org.Brotli.Dec.State state)
+ {
+ DecodeBlockTypeAndLength(state, 2);
+ state.distContextMapSlice = state.blockTypeRb[5] << DistanceContextBits;
+ }
+
+ private static void MaybeReallocateRingBuffer(Org.Brotli.Dec.State state)
+ {
+ int newSize = state.maxRingBufferSize;
+ if ((long)newSize > state.expectedTotalSize)
+ {
+ /* TODO: Handle 2GB+ cases more gracefully. */
+ int minimalNewSize = (int)state.expectedTotalSize + state.customDictionary.Length;
+ while ((newSize >> 1) > minimalNewSize)
+ {
+ newSize >>= 1;
+ }
+ if (!state.inputEnd && newSize < 16384 && state.maxRingBufferSize >= 16384)
+ {
+ newSize = 16384;
+ }
+ }
+ if (newSize <= state.ringBufferSize)
+ {
+ return;
+ }
+ int ringBufferSizeWithSlack = newSize + Org.Brotli.Dec.Dictionary.MaxTransformedWordLength;
+ byte[] newBuffer = new byte[ringBufferSizeWithSlack];
+ if (state.ringBuffer != null)
+ {
+ System.Array.Copy(state.ringBuffer, 0, newBuffer, 0, state.ringBufferSize);
+ }
+ else if (state.customDictionary.Length != 0)
+ {
+ /* Prepend custom dictionary, if any. */
+ int length = state.customDictionary.Length;
+ int offset = 0;
+ if (length > state.maxBackwardDistance)
+ {
+ offset = length - state.maxBackwardDistance;
+ length = state.maxBackwardDistance;
+ }
+ System.Array.Copy(state.customDictionary, offset, newBuffer, 0, length);
+ state.pos = length;
+ state.bytesToIgnore = length;
+ }
+ state.ringBuffer = newBuffer;
+ state.ringBufferSize = newSize;
+ }
+
+ /// Reads next metablock header.
+ /// decoding state
+ private static void ReadMetablockInfo(Org.Brotli.Dec.State state)
+ {
+ Org.Brotli.Dec.BitReader br = state.br;
+ if (state.inputEnd)
+ {
+ state.nextRunningState = Org.Brotli.Dec.RunningState.Finished;
+ state.bytesToWrite = state.pos;
+ state.bytesWritten = 0;
+ state.runningState = Org.Brotli.Dec.RunningState.Write;
+ return;
+ }
+ // TODO: Reset? Do we need this?
+ state.hGroup0.codes = null;
+ state.hGroup0.trees = null;
+ state.hGroup1.codes = null;
+ state.hGroup1.trees = null;
+ state.hGroup2.codes = null;
+ state.hGroup2.trees = null;
+ Org.Brotli.Dec.BitReader.ReadMoreInput(br);
+ DecodeMetaBlockLength(br, state);
+ if (state.metaBlockLength == 0 && !state.isMetadata)
+ {
+ return;
+ }
+ if (state.isUncompressed || state.isMetadata)
+ {
+ Org.Brotli.Dec.BitReader.JumpToByteBoundary(br);
+ state.runningState = state.isMetadata ? Org.Brotli.Dec.RunningState.ReadMetadata : Org.Brotli.Dec.RunningState.CopyUncompressed;
+ }
+ else
+ {
+ state.runningState = Org.Brotli.Dec.RunningState.CompressedBlockStart;
+ }
+ if (state.isMetadata)
+ {
+ return;
+ }
+ state.expectedTotalSize += state.metaBlockLength;
+ if (state.ringBufferSize < state.maxRingBufferSize)
+ {
+ MaybeReallocateRingBuffer(state);
+ }
+ }
+
+ private static void ReadMetablockHuffmanCodesAndContextMaps(Org.Brotli.Dec.State state)
+ {
+ Org.Brotli.Dec.BitReader br = state.br;
+ for (int i = 0; i < 3; i++)
+ {
+ state.numBlockTypes[i] = DecodeVarLenUnsignedByte(br) + 1;
+ state.blockLength[i] = 1 << 28;
+ if (state.numBlockTypes[i] > 1)
+ {
+ ReadHuffmanCode(state.numBlockTypes[i] + 2, state.blockTypeTrees, i * Org.Brotli.Dec.Huffman.HuffmanMaxTableSize, br);
+ ReadHuffmanCode(NumBlockLengthCodes, state.blockLenTrees, i * Org.Brotli.Dec.Huffman.HuffmanMaxTableSize, br);
+ state.blockLength[i] = ReadBlockLength(state.blockLenTrees, i * Org.Brotli.Dec.Huffman.HuffmanMaxTableSize, br);
+ }
+ }
+ Org.Brotli.Dec.BitReader.ReadMoreInput(br);
+ state.distancePostfixBits = Org.Brotli.Dec.BitReader.ReadBits(br, 2);
+ state.numDirectDistanceCodes = NumDistanceShortCodes + (Org.Brotli.Dec.BitReader.ReadBits(br, 4) << state.distancePostfixBits);
+ state.distancePostfixMask = (1 << state.distancePostfixBits) - 1;
+ int numDistanceCodes = state.numDirectDistanceCodes + (48 << state.distancePostfixBits);
+ // TODO: Reuse?
+ state.contextModes = new byte[state.numBlockTypes[0]];
+ for (int i = 0; i < state.numBlockTypes[0]; )
+ {
+ /* Ensure that less than 256 bits read between readMoreInput. */
+ int limit = System.Math.Min(i + 96, state.numBlockTypes[0]);
+ for (; i < limit; ++i)
+ {
+ state.contextModes[i] = unchecked((byte)(Org.Brotli.Dec.BitReader.ReadBits(br, 2) << 1));
+ }
+ Org.Brotli.Dec.BitReader.ReadMoreInput(br);
+ }
+ // TODO: Reuse?
+ state.contextMap = new byte[state.numBlockTypes[0] << LiteralContextBits];
+ int numLiteralTrees = DecodeContextMap(state.numBlockTypes[0] << LiteralContextBits, state.contextMap, br);
+ state.trivialLiteralContext = true;
+ for (int j = 0; j < state.numBlockTypes[0] << LiteralContextBits; j++)
+ {
+ if (state.contextMap[j] != j >> LiteralContextBits)
+ {
+ state.trivialLiteralContext = false;
+ break;
+ }
+ }
+ // TODO: Reuse?
+ state.distContextMap = new byte[state.numBlockTypes[2] << DistanceContextBits];
+ int numDistTrees = DecodeContextMap(state.numBlockTypes[2] << DistanceContextBits, state.distContextMap, br);
+ Org.Brotli.Dec.HuffmanTreeGroup.Init(state.hGroup0, NumLiteralCodes, numLiteralTrees);
+ Org.Brotli.Dec.HuffmanTreeGroup.Init(state.hGroup1, NumInsertAndCopyCodes, state.numBlockTypes[1]);
+ Org.Brotli.Dec.HuffmanTreeGroup.Init(state.hGroup2, numDistanceCodes, numDistTrees);
+ Org.Brotli.Dec.HuffmanTreeGroup.Decode(state.hGroup0, br);
+ Org.Brotli.Dec.HuffmanTreeGroup.Decode(state.hGroup1, br);
+ Org.Brotli.Dec.HuffmanTreeGroup.Decode(state.hGroup2, br);
+ state.contextMapSlice = 0;
+ state.distContextMapSlice = 0;
+ state.contextLookupOffset1 = Org.Brotli.Dec.Context.LookupOffsets[state.contextModes[0]];
+ state.contextLookupOffset2 = Org.Brotli.Dec.Context.LookupOffsets[state.contextModes[0] + 1];
+ state.literalTreeIndex = 0;
+ state.literalTree = state.hGroup0.trees[0];
+ state.treeCommandOffset = state.hGroup1.trees[0];
+ // TODO: == 0?
+ state.blockTypeRb[0] = state.blockTypeRb[2] = state.blockTypeRb[4] = 1;
+ state.blockTypeRb[1] = state.blockTypeRb[3] = state.blockTypeRb[5] = 0;
+ }
+
+ private static void CopyUncompressedData(Org.Brotli.Dec.State state)
+ {
+ Org.Brotli.Dec.BitReader br = state.br;
+ byte[] ringBuffer = state.ringBuffer;
+ // Could happen if block ends at ring buffer end.
+ if (state.metaBlockLength <= 0)
+ {
+ Org.Brotli.Dec.BitReader.Reload(br);
+ state.runningState = Org.Brotli.Dec.RunningState.BlockStart;
+ return;
+ }
+ int chunkLength = System.Math.Min(state.ringBufferSize - state.pos, state.metaBlockLength);
+ Org.Brotli.Dec.BitReader.CopyBytes(br, ringBuffer, state.pos, chunkLength);
+ state.metaBlockLength -= chunkLength;
+ state.pos += chunkLength;
+ if (state.pos == state.ringBufferSize)
+ {
+ state.nextRunningState = Org.Brotli.Dec.RunningState.CopyUncompressed;
+ state.bytesToWrite = state.ringBufferSize;
+ state.bytesWritten = 0;
+ state.runningState = Org.Brotli.Dec.RunningState.Write;
+ return;
+ }
+ Org.Brotli.Dec.BitReader.Reload(br);
+ state.runningState = Org.Brotli.Dec.RunningState.BlockStart;
+ }
+
+ private static bool WriteRingBuffer(Org.Brotli.Dec.State state)
+ {
+ /* Ignore custom dictionary bytes. */
+ if (state.bytesToIgnore != 0)
+ {
+ state.bytesWritten += state.bytesToIgnore;
+ state.bytesToIgnore = 0;
+ }
+ int toWrite = System.Math.Min(state.outputLength - state.outputUsed, state.bytesToWrite - state.bytesWritten);
+ if (toWrite != 0)
+ {
+ System.Array.Copy(state.ringBuffer, state.bytesWritten, state.output, state.outputOffset + state.outputUsed, toWrite);
+ state.outputUsed += toWrite;
+ state.bytesWritten += toWrite;
+ }
+ return state.outputUsed < state.outputLength;
+ }
+
+ internal static void SetCustomDictionary(Org.Brotli.Dec.State state, byte[] data)
+ {
+ state.customDictionary = (data == null) ? new byte[0] : data;
+ }
+
+ /// Actual decompress implementation.
+ internal static void Decompress(Org.Brotli.Dec.State state)
+ {
+ if (state.runningState == Org.Brotli.Dec.RunningState.Uninitialized)
+ {
+ throw new System.InvalidOperationException("Can't decompress until initialized");
+ }
+ if (state.runningState == Org.Brotli.Dec.RunningState.Closed)
+ {
+ throw new System.InvalidOperationException("Can't decompress after close");
+ }
+ Org.Brotli.Dec.BitReader br = state.br;
+ int ringBufferMask = state.ringBufferSize - 1;
+ byte[] ringBuffer = state.ringBuffer;
+ while (state.runningState != Org.Brotli.Dec.RunningState.Finished)
+ {
+ switch (state.runningState)
+ {
+ case Org.Brotli.Dec.RunningState.BlockStart:
+ {
+ // TODO: extract cases to methods for the better readability.
+ if (state.metaBlockLength < 0)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Invalid metablock length");
+ }
+ ReadMetablockInfo(state);
+ /* Ring-buffer would be reallocated here. */
+ ringBufferMask = state.ringBufferSize - 1;
+ ringBuffer = state.ringBuffer;
+ continue;
+ }
+
+ case Org.Brotli.Dec.RunningState.CompressedBlockStart:
+ {
+ ReadMetablockHuffmanCodesAndContextMaps(state);
+ state.runningState = Org.Brotli.Dec.RunningState.MainLoop;
+ goto case Org.Brotli.Dec.RunningState.MainLoop;
+ }
+
+ case Org.Brotli.Dec.RunningState.MainLoop:
+ {
+ // Fall through
+ if (state.metaBlockLength <= 0)
+ {
+ state.runningState = Org.Brotli.Dec.RunningState.BlockStart;
+ continue;
+ }
+ Org.Brotli.Dec.BitReader.ReadMoreInput(br);
+ if (state.blockLength[1] == 0)
+ {
+ DecodeCommandBlockSwitch(state);
+ }
+ state.blockLength[1]--;
+ Org.Brotli.Dec.BitReader.FillBitWindow(br);
+ int cmdCode = ReadSymbol(state.hGroup1.codes, state.treeCommandOffset, br);
+ int rangeIdx = (int)(((uint)cmdCode) >> 6);
+ state.distanceCode = 0;
+ if (rangeIdx >= 2)
+ {
+ rangeIdx -= 2;
+ state.distanceCode = -1;
+ }
+ int insertCode = Org.Brotli.Dec.Prefix.InsertRangeLut[rangeIdx] + (((int)(((uint)cmdCode) >> 3)) & 7);
+ int copyCode = Org.Brotli.Dec.Prefix.CopyRangeLut[rangeIdx] + (cmdCode & 7);
+ state.insertLength = Org.Brotli.Dec.Prefix.InsertLengthOffset[insertCode] + Org.Brotli.Dec.BitReader.ReadBits(br, Org.Brotli.Dec.Prefix.InsertLengthNBits[insertCode]);
+ state.copyLength = Org.Brotli.Dec.Prefix.CopyLengthOffset[copyCode] + Org.Brotli.Dec.BitReader.ReadBits(br, Org.Brotli.Dec.Prefix.CopyLengthNBits[copyCode]);
+ state.j = 0;
+ state.runningState = Org.Brotli.Dec.RunningState.InsertLoop;
+ goto case Org.Brotli.Dec.RunningState.InsertLoop;
+ }
+
+ case Org.Brotli.Dec.RunningState.InsertLoop:
+ {
+ // Fall through
+ if (state.trivialLiteralContext)
+ {
+ while (state.j < state.insertLength)
+ {
+ Org.Brotli.Dec.BitReader.ReadMoreInput(br);
+ if (state.blockLength[0] == 0)
+ {
+ DecodeLiteralBlockSwitch(state);
+ }
+ state.blockLength[0]--;
+ Org.Brotli.Dec.BitReader.FillBitWindow(br);
+ ringBuffer[state.pos] = unchecked((byte)ReadSymbol(state.hGroup0.codes, state.literalTree, br));
+ state.j++;
+ if (state.pos++ == ringBufferMask)
+ {
+ state.nextRunningState = Org.Brotli.Dec.RunningState.InsertLoop;
+ state.bytesToWrite = state.ringBufferSize;
+ state.bytesWritten = 0;
+ state.runningState = Org.Brotli.Dec.RunningState.Write;
+ break;
+ }
+ }
+ }
+ else
+ {
+ int prevByte1 = ringBuffer[(state.pos - 1) & ringBufferMask] & unchecked((int)(0xFF));
+ int prevByte2 = ringBuffer[(state.pos - 2) & ringBufferMask] & unchecked((int)(0xFF));
+ while (state.j < state.insertLength)
+ {
+ Org.Brotli.Dec.BitReader.ReadMoreInput(br);
+ if (state.blockLength[0] == 0)
+ {
+ DecodeLiteralBlockSwitch(state);
+ }
+ int literalTreeIndex = state.contextMap[state.contextMapSlice + (Org.Brotli.Dec.Context.Lookup[state.contextLookupOffset1 + prevByte1] | Org.Brotli.Dec.Context.Lookup[state.contextLookupOffset2 + prevByte2])] & unchecked((int)(0xFF));
+ state.blockLength[0]--;
+ prevByte2 = prevByte1;
+ Org.Brotli.Dec.BitReader.FillBitWindow(br);
+ prevByte1 = ReadSymbol(state.hGroup0.codes, state.hGroup0.trees[literalTreeIndex], br);
+ ringBuffer[state.pos] = unchecked((byte)prevByte1);
+ state.j++;
+ if (state.pos++ == ringBufferMask)
+ {
+ state.nextRunningState = Org.Brotli.Dec.RunningState.InsertLoop;
+ state.bytesToWrite = state.ringBufferSize;
+ state.bytesWritten = 0;
+ state.runningState = Org.Brotli.Dec.RunningState.Write;
+ break;
+ }
+ }
+ }
+ if (state.runningState != Org.Brotli.Dec.RunningState.InsertLoop)
+ {
+ continue;
+ }
+ state.metaBlockLength -= state.insertLength;
+ if (state.metaBlockLength <= 0)
+ {
+ state.runningState = Org.Brotli.Dec.RunningState.MainLoop;
+ continue;
+ }
+ if (state.distanceCode < 0)
+ {
+ Org.Brotli.Dec.BitReader.ReadMoreInput(br);
+ if (state.blockLength[2] == 0)
+ {
+ DecodeDistanceBlockSwitch(state);
+ }
+ state.blockLength[2]--;
+ Org.Brotli.Dec.BitReader.FillBitWindow(br);
+ state.distanceCode = ReadSymbol(state.hGroup2.codes, state.hGroup2.trees[state.distContextMap[state.distContextMapSlice + (state.copyLength > 4 ? 3 : state.copyLength - 2)] & unchecked((int)(0xFF))], br);
+ if (state.distanceCode >= state.numDirectDistanceCodes)
+ {
+ state.distanceCode -= state.numDirectDistanceCodes;
+ int postfix = state.distanceCode & state.distancePostfixMask;
+ state.distanceCode = (int)(((uint)state.distanceCode) >> state.distancePostfixBits);
+ int n = ((int)(((uint)state.distanceCode) >> 1)) + 1;
+ int offset = ((2 + (state.distanceCode & 1)) << n) - 4;
+ state.distanceCode = state.numDirectDistanceCodes + postfix + ((offset + Org.Brotli.Dec.BitReader.ReadBits(br, n)) << state.distancePostfixBits);
+ }
+ }
+ // Convert the distance code to the actual distance by possibly looking up past distances
+ // from the ringBuffer.
+ state.distance = TranslateShortCodes(state.distanceCode, state.distRb, state.distRbIdx);
+ if (state.distance < 0)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Negative distance");
+ }
+ // COV_NF_LINE
+ if (state.maxDistance != state.maxBackwardDistance && state.pos < state.maxBackwardDistance)
+ {
+ state.maxDistance = state.pos;
+ }
+ else
+ {
+ state.maxDistance = state.maxBackwardDistance;
+ }
+ state.copyDst = state.pos;
+ if (state.distance > state.maxDistance)
+ {
+ state.runningState = Org.Brotli.Dec.RunningState.Transform;
+ continue;
+ }
+ if (state.distanceCode > 0)
+ {
+ state.distRb[state.distRbIdx & 3] = state.distance;
+ state.distRbIdx++;
+ }
+ if (state.copyLength > state.metaBlockLength)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Invalid backward reference");
+ }
+ // COV_NF_LINE
+ state.j = 0;
+ state.runningState = Org.Brotli.Dec.RunningState.CopyLoop;
+ goto case Org.Brotli.Dec.RunningState.CopyLoop;
+ }
+
+ case Org.Brotli.Dec.RunningState.CopyLoop:
+ {
+ // fall through
+ int src = (state.pos - state.distance) & ringBufferMask;
+ int dst = state.pos;
+ int copyLength = state.copyLength - state.j;
+ if ((src + copyLength < ringBufferMask) && (dst + copyLength < ringBufferMask))
+ {
+ for (int k = 0; k < copyLength; ++k)
+ {
+ ringBuffer[dst++] = ringBuffer[src++];
+ }
+ state.j += copyLength;
+ state.metaBlockLength -= copyLength;
+ state.pos += copyLength;
+ }
+ else
+ {
+ for (; state.j < state.copyLength; )
+ {
+ ringBuffer[state.pos] = ringBuffer[(state.pos - state.distance) & ringBufferMask];
+ state.metaBlockLength--;
+ state.j++;
+ if (state.pos++ == ringBufferMask)
+ {
+ state.nextRunningState = Org.Brotli.Dec.RunningState.CopyLoop;
+ state.bytesToWrite = state.ringBufferSize;
+ state.bytesWritten = 0;
+ state.runningState = Org.Brotli.Dec.RunningState.Write;
+ break;
+ }
+ }
+ }
+ if (state.runningState == Org.Brotli.Dec.RunningState.CopyLoop)
+ {
+ state.runningState = Org.Brotli.Dec.RunningState.MainLoop;
+ }
+ continue;
+ }
+
+ case Org.Brotli.Dec.RunningState.Transform:
+ {
+ if (state.copyLength >= Org.Brotli.Dec.Dictionary.MinWordLength && state.copyLength <= Org.Brotli.Dec.Dictionary.MaxWordLength)
+ {
+ int offset = Org.Brotli.Dec.Dictionary.OffsetsByLength[state.copyLength];
+ int wordId = state.distance - state.maxDistance - 1;
+ int shift = Org.Brotli.Dec.Dictionary.SizeBitsByLength[state.copyLength];
+ int mask = (1 << shift) - 1;
+ int wordIdx = wordId & mask;
+ int transformIdx = (int)(((uint)wordId) >> shift);
+ offset += wordIdx * state.copyLength;
+ if (transformIdx < Org.Brotli.Dec.Transform.Transforms.Length)
+ {
+ int len = Org.Brotli.Dec.Transform.TransformDictionaryWord(ringBuffer, state.copyDst, Org.Brotli.Dec.Dictionary.GetData(), offset, state.copyLength, Org.Brotli.Dec.Transform.Transforms[transformIdx]);
+ state.copyDst += len;
+ state.pos += len;
+ state.metaBlockLength -= len;
+ if (state.copyDst >= state.ringBufferSize)
+ {
+ state.nextRunningState = Org.Brotli.Dec.RunningState.CopyWrapBuffer;
+ state.bytesToWrite = state.ringBufferSize;
+ state.bytesWritten = 0;
+ state.runningState = Org.Brotli.Dec.RunningState.Write;
+ continue;
+ }
+ }
+ else
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Invalid backward reference");
+ }
+ }
+ else
+ {
+ // COV_NF_LINE
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Invalid backward reference");
+ }
+ // COV_NF_LINE
+ state.runningState = Org.Brotli.Dec.RunningState.MainLoop;
+ continue;
+ }
+
+ case Org.Brotli.Dec.RunningState.CopyWrapBuffer:
+ {
+ System.Array.Copy(ringBuffer, state.ringBufferSize, ringBuffer, 0, state.copyDst - state.ringBufferSize);
+ state.runningState = Org.Brotli.Dec.RunningState.MainLoop;
+ continue;
+ }
+
+ case Org.Brotli.Dec.RunningState.ReadMetadata:
+ {
+ while (state.metaBlockLength > 0)
+ {
+ Org.Brotli.Dec.BitReader.ReadMoreInput(br);
+ // Optimize
+ Org.Brotli.Dec.BitReader.ReadBits(br, 8);
+ state.metaBlockLength--;
+ }
+ state.runningState = Org.Brotli.Dec.RunningState.BlockStart;
+ continue;
+ }
+
+ case Org.Brotli.Dec.RunningState.CopyUncompressed:
+ {
+ CopyUncompressedData(state);
+ continue;
+ }
+
+ case Org.Brotli.Dec.RunningState.Write:
+ {
+ if (!WriteRingBuffer(state))
+ {
+ // Output buffer is full.
+ return;
+ }
+ if (state.pos >= state.maxBackwardDistance)
+ {
+ state.maxDistance = state.maxBackwardDistance;
+ }
+ state.pos &= ringBufferMask;
+ state.runningState = state.nextRunningState;
+ continue;
+ }
+
+ default:
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Unexpected state " + state.runningState);
+ }
+ }
+ }
+ if (state.runningState == Org.Brotli.Dec.RunningState.Finished)
+ {
+ if (state.metaBlockLength < 0)
+ {
+ throw new Org.Brotli.Dec.BrotliRuntimeException("Invalid metablock length");
+ }
+ Org.Brotli.Dec.BitReader.JumpToByteBoundary(br);
+ Org.Brotli.Dec.BitReader.CheckHealth(state.br, true);
+ }
+ }
+ }
+}
diff --git a/AssetStudio/Brotli/Dictionary.cs b/AssetStudio/Brotli/Dictionary.cs
new file mode 100644
index 0000000..1c2082f
--- /dev/null
+++ b/AssetStudio/Brotli/Dictionary.cs
@@ -0,0 +1,97 @@
+/* Copyright 2015 Google Inc. All Rights Reserved.
+
+Distributed under MIT license.
+See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+namespace Org.Brotli.Dec
+{
+ /// Collection of static dictionary words.
+ ///
+ /// Collection of static dictionary words.
+ /// Dictionary content is loaded from binary resource when
+ ///
+ /// is executed for the
+ /// first time. Consequently, it saves memory and CPU in case dictionary is not required.
+ ///
One possible drawback is that multiple threads that need dictionary data may be blocked (only
+ /// once in each classworld). To avoid this, it is enough to call
+ ///
+ /// proactively.
+ ///
+ internal sealed class Dictionary
+ {
+ /// "Initialization-on-demand holder idiom" implementation.
+ ///
+ /// "Initialization-on-demand holder idiom" implementation.
+ /// This static class definition is not initialized until the JVM determines that it must be
+ /// executed (when the static method
+ ///
+ /// is invoked).
+ ///
+ private class DataHolder0
+ {
+ internal static string GetData()
+ {
+ return "timedownlifeleftbackcodedatashowonlysitecityopenjustlikefreeworktextyearoverbodyloveformbookplaylivelinehelphomesidemorewordlongthemviewfindpagedaysfullheadtermeachareafromtruemarkableuponhighdatelandnewsevennextcasebothpostusedmadehandherewhatnameLinkblogsizebaseheldmakemainuser') +holdendswithNewsreadweresigntakehavegameseencallpathwellplusmenufilmpartjointhislistgoodneedwayswestjobsmindalsologorichuseslastteamarmyfoodkingwilleastwardbestfirePageknowaway.pngmovethanloadgiveselfnotemuchfeedmanyrockicononcelookhidediedHomerulehostajaxinfoclublawslesshalfsomesuchzone100%onescareTimeracebluefourweekfacehopegavehardlostwhenparkkeptpassshiproomHTMLplanTypedonesavekeepflaglinksoldfivetookratetownjumpthusdarkcardfilefearstaykillthatfallautoever.comtalkshopvotedeepmoderestturnbornbandfellroseurl(skinrolecomeactsagesmeetgold.jpgitemvaryfeltthensenddropViewcopy1.0\"stopelseliestourpack.gifpastcss?graymean>rideshotlatesaidroadvar feeljohnrickportfast'UA-deadpoorbilltypeU.S.woodmust2px;Inforankwidewantwalllead[0];paulwavesure$('#waitmassarmsgoesgainlangpaid!-- lockunitrootwalkfirmwifexml\"songtest20pxkindrowstoolfontmailsafestarmapscorerainflowbabyspansays4px;6px;artsfootrealwikiheatsteptriporg/lakeweaktoldFormcastfansbankveryrunsjulytask1px;goalgrewslowedgeid=\"sets5px;.js?40pxif (soonseatnonetubezerosentreedfactintogiftharm18pxcamehillboldzoomvoideasyringfillpeakinitcost3px;jacktagsbitsrolleditknewnearironfreddiskwentsoilputs/js/holyT22:ISBNT20:adamseesjson', 'contT21: RSSloopasiamoon
soulLINEfortcartT14:80px!--<9px;T04:mike:46ZniceinchYorkricezh:\u00E4'));puremageparatonebond:37Z_of_']);000,zh:\u00E7tankyardbowlbush:56ZJava30px\n|}\n%C3%:34ZjeffEXPIcashvisagolfsnowzh:\u00E9quer.csssickmeatmin.binddellhirepicsrent:36ZHTTP-201fotowolfEND xbox:54ZBODYdick;\n}\nexit:35Zvarsbeat'});diet999;anne}}[i].Langkm\u00C2\u00B2wiretoysaddssealalex;\n\t}echonine.org005)tonyjewssandlegsroof000) 200winegeardogsbootgarycutstyletemption.xmlcockgang$('.50pxPh.Dmiscalanloandeskmileryanunixdisc);}\ndustclip).\n\n70px-200DVDs7]>sonyguysfuckpipe|-\n!002)ndow[1];[];\nLog salt\r\n\t\tbangtrimbath){\r\n00px\n});ko:\u00ECfeesad>\rs:// [];tollplug(){\n{\r\n .js'200pdualboat.JPG);\n}quot);\n\n');\n\r\n}\r201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037201320122011201020092008200720062005200420032002200120001999199819971996199519941993199219911990198919881987198619851984198319821981198019791978197719761975197419731972197119701969196819671966196519641963196219611960195919581957195619551954195319521951195010001024139400009999comom\u00C3\u00A1sesteestaperotodohacecadaa\u00C3\u00B1obiend\u00C3\u00ADaas\u00C3\u00ADvidacasootroforosolootracualdijosidograntipotemadebealgoqu\u00C3\u00A9estonadatrespococasabajotodasinoaguapuesunosantediceluisellamayozonaamorpisoobraclicellodioshoracasi\u00D0\u00B7\u00D0\u00B0\u00D0\u00BD\u00D0\u00B0\u00D0\u00BE\u00D0\u00BC\u00D1\u0080\u00D0\u00B0\u00D1\u0080\u00D1\u0083\u00D1\u0082\u00D0\u00B0\u00D0\u00BD\u00D0\u00B5\u00D0\u00BF\u00D0\u00BE\u00D0\u00BE\u00D1\u0082\u00D0\u00B8\u00D0\u00B7\u00D0\u00BD\u00D0\u00BE\u00D0\u00B4\u00D0\u00BE\u00D1\u0082\u00D0\u00BE\u00D0\u00B6\u00D0\u00B5\u00D0\u00BE\u00D0\u00BD\u00D0\u00B8\u00D1\u0085\u00D0\u009D\u00D0\u00B0\u00D0\u00B5\u00D0\u00B5\u00D0\u00B1\u00D1\u008B\u00D0\u00BC\u00D1\u008B\u00D0\u0092\u00D1\u008B\u00D1\u0081\u00D0\u00BE\u00D0\u00B2\u00D1\u008B\u00D0\u00B2\u00D0\u00BE\u00D0\u009D\u00D0\u00BE\u00D0\u00BE\u00D0\u00B1\u00D0\u009F\u00D0\u00BE\u00D0\u00BB\u00D0\u00B8\u00D0\u00BD\u00D0\u00B8\u00D0\u00A0\u00D0\u00A4\u00D0\u009D\u00D0\u00B5\u00D0\u009C\u00D1\u008B\u00D1\u0082\u00D1\u008B\u00D0\u009E\u00D0\u00BD\u00D0\u00B8\u00D0\u00BC\u00D0\u00B4\u00D0\u00B0\u00D0\u0097\u00D0\u00B0\u00D0\u0094\u00D0\u00B0\u00D0\u009D\u00D1\u0083\u00D0\u009E\u00D0\u00B1\u00D1\u0082\u00D0\u00B5\u00D0\u0098\u00D0\u00B7\u00D0\u00B5\u00D0\u00B9\u00D0\u00BD\u00D1\u0083\u00D0\u00BC\u00D0\u00BC\u00D0\u00A2\u00D1\u008B\u00D1\u0083\u00D0\u00B6\u00D9\u0081\u00D9\u008A\u00D8\u00A3\u00D9\u0086\u00D9\u0085\u00D8\u00A7\u00D9\u0085\u00D8\u00B9\u00D9\u0083\u00D9\u0084\u00D8\u00A3\u00D9\u0088\u00D8\u00B1\u00D8\u00AF\u00D9\u008A\u00D8\u00A7\u00D9\u0081\u00D9\u0089\u00D9\u0087\u00D9\u0088\u00D9\u0084\u00D9\u0085\u00D9\u0084\u00D9\u0083\u00D8\u00A7\u00D9\u0088\u00D9\u0084\u00D9\u0087\u00D8\u00A8\u00D8\u00B3\u00D8\u00A7\u00D9\u0084\u00D8\u00A5\u00D9\u0086\u00D9\u0087\u00D9\u008A\u00D8\u00A3\u00D9\u008A\u00D9\u0082\u00D8\u00AF\u00D9\u0087\u00D9\u0084\u00D8\u00AB\u00D9\u0085\u00D8\u00A8\u00D9\u0087\u00D9\u0084\u00D9\u0088\u00D9\u0084\u00D9\u008A\u00D8\u00A8\u00D9\u0084\u00D8\u00A7\u00D9\u008A\u00D8\u00A8\u00D9\u0083\u00D8\u00B4\u00D9\u008A\u00D8\u00A7\u00D9\u0085\u00D8\u00A3\u00D9\u0085\u00D9\u0086\u00D8\u00AA\u00D8\u00A8\u00D9\u008A\u00D9\u0084\u00D9\u0086\u00D8\u00AD\u00D8\u00A8\u00D9\u0087\u00D9\u0085\u00D9\u0085\u00D8\u00B4\u00D9\u0088\u00D8\u00B4firstvideolightworldmediawhitecloseblackrightsmallbooksplacemusicfieldorderpointvalueleveltableboardhousegroupworksyearsstatetodaywaterstartstyledeathpowerphonenighterrorinputabouttermstitletoolseventlocaltimeslargewordsgamesshortspacefocusclearmodelblockguideradiosharewomenagainmoneyimagenamesyounglineslatercolorgreenfront&watchforcepricerulesbeginaftervisitissueareasbelowindextotalhourslabelprintpressbuiltlinksspeedstudytradefoundsenseundershownformsrangeaddedstillmovedtakenaboveflashfixedoftenotherviewschecklegalriveritemsquickshapehumanexistgoingmoviethirdbasicpeacestagewidthloginideaswrotepagesusersdrivestorebreaksouthvoicesitesmonthwherebuildwhichearthforumthreesportpartyClicklowerlivesclasslayerentrystoryusagesoundcourtyour birthpopuptypesapplyImagebeinguppernoteseveryshowsmeansextramatchtrackknownearlybegansuperpapernorthlearngivennamedendedTermspartsGroupbrandusingwomanfalsereadyaudiotakeswhile.com/livedcasesdailychildgreatjudgethoseunitsneverbroadcoastcoverapplefilescyclesceneplansclickwritequeenpieceemailframeolderphotolimitcachecivilscaleenterthemetheretouchboundroyalaskedwholesincestock namefaithheartemptyofferscopeownedmightalbumthinkbloodarraymajortrustcanonunioncountvalidstoneStyleLoginhappyoccurleft:freshquitefilmsgradeneedsurbanfightbasishoverauto;route.htmlmixedfinalYour slidetopicbrownalonedrawnsplitreachRightdatesmarchquotegoodsLinksdoubtasyncthumballowchiefyouthnovel10px;serveuntilhandsCheckSpacequeryjamesequaltwice0,000Startpanelsongsroundeightshiftworthpostsleadsweeksavoidthesemilesplanesmartalphaplantmarksratesplaysclaimsalestextsstarswrongthing.org/multiheardPowerstandtokensolid(thisbringshipsstafftriedcallsfullyfactsagentThis //-->adminegyptEvent15px;Emailtrue\"crossspentblogsbox\">notedleavechinasizesguestrobotheavytrue,sevengrandcrimesignsawaredancephase>\n\n\r\nname=diegopage swiss-->\n\n#fff;\">Log.com\"treatsheet) && 14px;sleepntentfiledja:\u00E3\u0083id=\"cName\"worseshots-box-delta\n<bears:48Z spendbakershops= \"\";php\">ction13px;brianhellosize=o=%2F joinmaybe , fjsimg\" \")[0]MTopBType\"newlyDanskczechtrailknowsfaq\">zh-cn10);\n-1\");type=bluestrulydavis.js';>\r\n\r\nform jesus100% menu.\r\n\t\r\nwalesrisksumentddingb-likteachgif\" vegasdanskeestishqipsuomisobredesdeentretodospuedea\u00C3\u00B1osest\u00C3\u00A1tienehastaotrospartedondenuevohacerformamismomejormundoaqu\u00C3\u00ADd\u00C3\u00ADass\u00C3\u00B3loayudafechatodastantomenosdatosotrassitiomuchoahoralugarmayorestoshorastenerantesfotosestaspa\u00C3\u00ADsnuevasaludforosmedioquienmesespoderchileser\u00C3\u00A1vecesdecirjos\u00C3\u00A9estarventagrupohechoellostengoamigocosasnivelgentemismaairesjuliotemashaciafavorjuniolibrepuntobuenoautorabrilbuenatextomarzosaberlistaluegoc\u00C3\u00B3moenerojuegoper\u00C3\u00BAhaberestoynuncamujervalorfueralibrogustaigualvotoscasosgu\u00C3\u00ADapuedosomosavisousteddebennochebuscafaltaeurosseriedichocursoclavecasasle\u00C3\u00B3nplazolargoobrasvistaapoyojuntotratavistocrearcampohemoscincocargopisosordenhacen\u00C3\u00A1readiscopedrocercapuedapapelmenor\u00C3\u00BAtilclarojorgecalleponertardenadiemarcasigueellassiglocochemotosmadreclaserestoni\u00C3\u00B1oquedapasarbancohijosviajepablo\u00C3\u00A9stevienereinodejarfondocanalnorteletracausatomarmanoslunesautosvillavendopesartipostengamarcollevapadreunidovamoszonasambosbandamariaabusomuchasubirriojavivirgradochicaall\u00C3\u00ADjovendichaestantalessalirsuelopesosfinesllamabusco\u00C3\u00A9stalleganegroplazahumorpagarjuntadobleislasbolsaba\u00C3\u00B1ohablalucha\u00C3\u0081readicenjugarnotasvalleall\u00C3\u00A1cargadolorabajoest\u00C3\u00A9gustomentemariofirmacostofichaplatahogarartesleyesaquelmuseobasespocosmitadcielochicomiedoganarsantoetapadebesplayaredessietecortecoreadudasdeseoviejodeseaaguas"domaincommonstatuseventsmastersystemactionbannerremovescrollupdateglobalmediumfilternumberchangeresultpublicscreenchoosenormaltravelissuessourcetargetspringmodulemobileswitchphotosborderregionitselfsocialactivecolumnrecordfollowtitle>eitherlengthfamilyfriendlayoutauthorcreatereviewsummerserverplayedplayerexpandpolicyformatdoublepointsseriespersonlivingdesignmonthsforcesuniqueweightpeopleenergynaturesearchfigurehavingcustomoffsetletterwindowsubmitrendergroupsuploadhealthmethodvideosschoolfutureshadowdebatevaluesObjectothersrightsleaguechromesimplenoticesharedendingseasonreportonlinesquarebuttonimagesenablemovinglatestwinterFranceperiodstrongrepeatLondondetailformeddemandsecurepassedtoggleplacesdevicestaticcitiesstreamyellowattackstreetflighthiddeninfo\">openedusefulvalleycausesleadersecretseconddamagesportsexceptratingsignedthingseffectfieldsstatesofficevisualeditorvolumeReportmuseummoviesparentaccessmostlymother\" id=\"marketgroundchancesurveybeforesymbolmomentspeechmotioninsidematterCenterobjectexistsmiddleEuropegrowthlegacymannerenoughcareeransweroriginportalclientselectrandomclosedtopicscomingfatheroptionsimplyraisedescapechosenchurchdefinereasoncorneroutputmemoryiframepolicemodelsNumberduringoffersstyleskilledlistedcalledsilvermargindeletebetterbrowselimitsGlobalsinglewidgetcenterbudgetnowrapcreditclaimsenginesafetychoicespirit-stylespreadmakingneededrussiapleaseextentScriptbrokenallowschargedividefactormember-basedtheoryconfigaroundworkedhelpedChurchimpactshouldalwayslogo\" bottomlist\">){var prefixorangeHeader.push(couplegardenbridgelaunchReviewtakingvisionlittledatingButtonbeautythemesforgotSearchanchoralmostloadedChangereturnstringreloadMobileincomesupplySourceordersviewed courseAbout island: The dialoghousesBEGIN MexicostartscentreheightaddingIslandassetsEmpireSchooleffortdirectnearlymanualSelect.\n\nOnejoinedmenu\">PhilipawardshandleimportOfficeregardskillsnationSportsdegreeweekly (e.g.behinddoctorloggedunitedbeyond-scaleacceptservedmarineFootercamera \n_form\"leavesstress\" />\r\n.gif\" onloadloaderOxfordsistersurvivlistenfemaleDesignsize=\"appealtext\">levelsthankshigherforcedanimalanyoneAfricaagreedrecentPeople wonderpricesturned|| {};main\">inlinesundaywrap\">failedcensusminutebeaconquotes150px|estateremoteemail\"linkedright;signalformal1.htmlsignupprincefloat:.png\" forum.AccesspaperssoundsextendHeightsliderUTF-8\"& Before. WithstudioownersmanageprofitjQueryannualparamsboughtfamousgooglelongeri++) {israelsayingdecidehome\">headerensurebranchpiecesblock;statedtop\">boston.test(avatartested_countforumsschemaindex,filledsharesreaderalert(appearSubmitline\">body\">\n* TheThoughseeingjerseyNews\nSystem DavidcancertablesprovedApril reallydriveritem\">more\">boardscolorscampusfirst || [];media.guitarfinishwidth:showedOther .php\" assumelayerswilsonstoresreliefswedenCustomeasily your String\n\nWhiltaylorclear:resortfrenchthough\") + \"buyingbrandsMembername\">oppingsector5px;\">vspacepostermajor coffeemartinmaturehappenkansaslink\">Images=falsewhile hspace0& \n\nIn powerPolski-colorjordanBottomStart -count2.htmlnews\">01.jpgOnline-rightmillerseniorISBN 00,000 guidesvalue)ectionrepair.xml\" rights.html-blockregExp:hoverwithinvirginphones\rusing \n\tvar >');\n\t\n\nbahasabrasilgalegomagyarpolskisrpski\u00D8\u00B1\u00D8\u00AF\u00D9\u0088\u00E4\u00B8\u00AD\u00E6\u0096\u0087\u00E7\u00AE\u0080\u00E4\u00BD\u0093\u00E7\u00B9\u0081\u00E9\u00AB\u0094\u00E4\u00BF\u00A1\u00E6\u0081\u00AF\u00E4\u00B8\u00AD\u00E5\u009B\u00BD\u00E6\u0088\u0091\u00E4\u00BB\u00AC\u00E4\u00B8\u0080\u00E4\u00B8\u00AA\u00E5\u0085\u00AC\u00E5\u008F\u00B8\u00E7\u00AE\u00A1\u00E7\u0090\u0086\u00E8\u00AE\u00BA\u00E5\u009D\u009B\u00E5\u008F\u00AF\u00E4\u00BB\u00A5\u00E6\u009C\u008D\u00E5\u008A\u00A1\u00E6\u0097\u00B6\u00E9\u0097\u00B4\u00E4\u00B8\u00AA\u00E4\u00BA\u00BA\u00E4\u00BA\u00A7\u00E5\u0093\u0081\u00E8\u0087\u00AA\u00E5\u00B7\u00B1\u00E4\u00BC\u0081\u00E4\u00B8\u009A\u00E6\u009F\u00A5\u00E7\u009C\u008B\u00E5\u00B7\u00A5\u00E4\u00BD\u009C\u00E8\u0081\u0094\u00E7\u00B3\u00BB\u00E6\u00B2\u00A1\u00E6\u009C\u0089\u00E7\u00BD\u0091\u00E7\u00AB\u0099\u00E6\u0089\u0080\u00E6\u009C\u0089\u00E8\u00AF\u0084\u00E8\u00AE\u00BA\u00E4\u00B8\u00AD\u00E5\u00BF\u0083\u00E6\u0096\u0087\u00E7\u00AB\u00A0\u00E7\u0094\u00A8\u00E6\u0088\u00B7\u00E9\u00A6\u0096\u00E9\u00A1\u00B5\u00E4\u00BD\u009C\u00E8\u0080\u0085\u00E6\u008A\u0080\u00E6\u009C\u00AF\u00E9\u0097\u00AE\u00E9\u00A2\u0098\u00E7\u009B\u00B8\u00E5\u0085\u00B3\u00E4\u00B8\u008B\u00E8\u00BD\u00BD\u00E6\u0090\u009C\u00E7\u00B4\u00A2\u00E4\u00BD\u00BF\u00E7\u0094\u00A8\u00E8\u00BD\u00AF\u00E4\u00BB\u00B6\u00E5\u009C\u00A8\u00E7\u00BA\u00BF\u00E4\u00B8\u00BB\u00E9\u00A2\u0098\u00E8\u00B5\u0084\u00E6\u0096\u0099\u00E8\u00A7\u0086\u00E9\u00A2\u0091\u00E5\u009B\u009E\u00E5\u00A4\u008D\u00E6\u00B3\u00A8\u00E5\u0086\u008C\u00E7\u00BD\u0091\u00E7\u00BB\u009C\u00E6\u0094\u00B6\u00E8\u0097\u008F\u00E5\u0086\u0085\u00E5\u00AE\u00B9\u00E6\u008E\u00A8\u00E8\u008D\u0090\u00E5\u00B8\u0082\u00E5\u009C\u00BA\u00E6\u00B6\u0088\u00E6\u0081\u00AF\u00E7\u00A9\u00BA\u00E9\u0097\u00B4\u00E5\u008F\u0091\u00E5\u00B8\u0083\u00E4\u00BB\u0080\u00E4\u00B9\u0088\u00E5\u00A5\u00BD\u00E5\u008F\u008B\u00E7\u0094\u009F\u00E6\u00B4\u00BB\u00E5\u009B\u00BE\u00E7\u0089\u0087\u00E5\u008F\u0091\u00E5\u00B1\u0095\u00E5\u00A6\u0082\u00E6\u009E\u009C\u00E6\u0089\u008B\u00E6\u009C\u00BA\u00E6\u0096\u00B0\u00E9\u0097\u00BB\u00E6\u009C\u0080\u00E6\u0096\u00B0\u00E6\u0096\u00B9\u00E5\u00BC\u008F\u00E5\u008C\u0097\u00E4\u00BA\u00AC\u00E6\u008F\u0090\u00E4\u00BE\u009B\u00E5\u0085\u00B3\u00E4\u00BA\u008E\u00E6\u009B\u00B4\u00E5\u00A4\u009A\u00E8\u00BF\u0099\u00E4\u00B8\u00AA\u00E7\u00B3\u00BB\u00E7\u00BB\u009F\u00E7\u009F\u00A5\u00E9\u0081\u0093\u00E6\u00B8\u00B8\u00E6\u0088\u008F\u00E5\u00B9\u00BF\u00E5\u0091\u008A\u00E5\u0085\u00B6\u00E4\u00BB\u0096\u00E5\u008F\u0091\u00E8\u00A1\u00A8\u00E5\u00AE\u0089\u00E5\u0085\u00A8\u00E7\u00AC\u00AC\u00E4\u00B8\u0080\u00E4\u00BC\u009A\u00E5\u0091\u0098\u00E8\u00BF\u009B\u00E8\u00A1\u008C\u00E7\u0082\u00B9\u00E5\u0087\u00BB\u00E7\u0089\u0088\u00E6\u009D\u0083\u00E7\u0094\u00B5\u00E5\u00AD\u0090\u00E4\u00B8\u0096\u00E7\u0095\u008C\u00E8\u00AE\u00BE\u00E8\u00AE\u00A1\u00E5\u0085\u008D\u00E8\u00B4\u00B9\u00E6\u0095\u0099\u00E8\u0082\u00B2\u00E5\u008A\u00A0\u00E5\u0085\u00A5\u00E6\u00B4\u00BB\u00E5\u008A\u00A8\u00E4\u00BB\u0096\u00E4\u00BB\u00AC\u00E5\u0095\u0086\u00E5\u0093\u0081\u00E5\u008D\u009A\u00E5\u00AE\u00A2\u00E7\u008E\u00B0\u00E5\u009C\u00A8\u00E4\u00B8\u008A\u00E6\u00B5\u00B7\u00E5\u00A6\u0082\u00E4\u00BD\u0095\u00E5\u00B7\u00B2\u00E7\u00BB\u008F\u00E7\u0095\u0099\u00E8\u00A8\u0080\u00E8\u00AF\u00A6\u00E7\u00BB\u0086\u00E7\u00A4\u00BE\u00E5\u008C\u00BA\u00E7\u0099\u00BB\u00E5\u00BD\u0095\u00E6\u009C\u00AC\u00E7\u00AB\u0099\u00E9\u009C\u0080\u00E8\u00A6\u0081\u00E4\u00BB\u00B7\u00E6\u00A0\u00BC\u00E6\u0094\u00AF\u00E6\u008C\u0081\u00E5\u009B\u00BD\u00E9\u0099\u0085\u00E9\u0093\u00BE\u00E6\u008E\u00A5\u00E5\u009B\u00BD\u00E5\u00AE\u00B6\u00E5\u00BB\u00BA\u00E8\u00AE\u00BE\u00E6\u009C\u008B\u00E5\u008F\u008B\u00E9\u0098\u0085\u00E8\u00AF\u00BB\u00E6\u00B3\u0095\u00E5\u00BE\u008B\u00E4\u00BD\u008D\u00E7\u00BD\u00AE\u00E7\u00BB\u008F\u00E6\u00B5\u008E\u00E9\u0080\u0089\u00E6\u008B\u00A9\u00E8\u00BF\u0099\u00E6\u00A0\u00B7\u00E5\u00BD\u0093\u00E5\u0089\u008D\u00E5\u0088\u0086\u00E7\u00B1\u00BB\u00E6\u008E\u0092\u00E8\u00A1\u008C\u00E5\u009B\u00A0\u00E4\u00B8\u00BA\u00E4\u00BA\u00A4\u00E6\u0098\u0093\u00E6\u009C\u0080\u00E5\u0090\u008E\u00E9\u009F\u00B3\u00E4\u00B9\u0090\u00E4\u00B8\u008D\u00E8\u0083\u00BD\u00E9\u0080\u009A\u00E8\u00BF\u0087\u00E8\u00A1\u008C\u00E4\u00B8\u009A\u00E7\u00A7\u0091\u00E6\u008A\u0080\u00E5\u008F\u00AF\u00E8\u0083\u00BD\u00E8\u00AE\u00BE\u00E5\u00A4\u0087\u00E5\u0090\u0088\u00E4\u00BD\u009C\u00E5\u00A4\u00A7\u00E5\u00AE\u00B6\u00E7\u00A4\u00BE\u00E4\u00BC\u009A\u00E7\u00A0\u0094\u00E7\u00A9\u00B6\u00E4\u00B8\u0093\u00E4\u00B8\u009A\u00E5\u0085\u00A8\u00E9\u0083\u00A8\u00E9\u00A1\u00B9\u00E7\u009B\u00AE\u00E8\u00BF\u0099\u00E9\u0087\u008C\u00E8\u00BF\u0098\u00E6\u0098\u00AF\u00E5\u00BC\u0080\u00E5\u00A7\u008B\u00E6\u0083\u0085\u00E5\u0086\u00B5\u00E7\u0094\u00B5\u00E8\u0084\u0091\u00E6\u0096\u0087\u00E4\u00BB\u00B6\u00E5\u0093\u0081\u00E7\u0089\u008C\u00E5\u00B8\u00AE\u00E5\u008A\u00A9\u00E6\u0096\u0087\u00E5\u008C\u0096\u00E8\u00B5\u0084\u00E6\u00BA\u0090\u00E5\u00A4\u00A7\u00E5\u00AD\u00A6\u00E5\u00AD\u00A6\u00E4\u00B9\u00A0\u00E5\u009C\u00B0\u00E5\u009D\u0080\u00E6\u00B5\u008F\u00E8\u00A7\u0088\u00E6\u008A\u0095\u00E8\u00B5\u0084\u00E5\u00B7\u00A5\u00E7\u00A8\u008B\u00E8\u00A6\u0081\u00E6\u00B1\u0082\u00E6\u0080\u008E\u00E4\u00B9\u0088\u00E6\u0097\u00B6\u00E5\u0080\u0099\u00E5\u008A\u009F\u00E8\u0083\u00BD\u00E4\u00B8\u00BB\u00E8\u00A6\u0081\u00E7\u009B\u00AE\u00E5\u0089\u008D\u00E8\u00B5\u0084\u00E8\u00AE\u00AF\u00E5\u009F\u008E\u00E5\u00B8\u0082\u00E6\u0096\u00B9\u00E6\u00B3\u0095\u00E7\u0094\u00B5\u00E5\u00BD\u00B1\u00E6\u008B\u009B\u00E8\u0081\u0098\u00E5\u00A3\u00B0\u00E6\u0098\u008E\u00E4\u00BB\u00BB\u00E4\u00BD\u0095\u00E5\u0081\u00A5\u00E5\u00BA\u00B7\u00E6\u0095\u00B0\u00E6\u008D\u00AE\u00E7\u00BE\u008E\u00E5\u009B\u00BD\u00E6\u00B1\u00BD\u00E8\u00BD\u00A6\u00E4\u00BB\u008B\u00E7\u00BB\u008D\u00E4\u00BD\u0086\u00E6\u0098\u00AF\u00E4\u00BA\u00A4\u00E6\u00B5\u0081\u00E7\u0094\u009F\u00E4\u00BA\u00A7\u00E6\u0089\u0080\u00E4\u00BB\u00A5\u00E7\u0094\u00B5\u00E8\u00AF\u009D\u00E6\u0098\u00BE\u00E7\u00A4\u00BA\u00E4\u00B8\u0080\u00E4\u00BA\u009B\u00E5\u008D\u0095\u00E4\u00BD\u008D\u00E4\u00BA\u00BA\u00E5\u0091\u0098\u00E5\u0088\u0086\u00E6\u009E\u0090\u00E5\u009C\u00B0\u00E5\u009B\u00BE\u00E6\u0097\u0085\u00E6\u00B8\u00B8\u00E5\u00B7\u00A5\u00E5\u0085\u00B7\u00E5\u00AD\u00A6\u00E7\u0094\u009F\u00E7\u00B3\u00BB\u00E5\u0088\u0097\u00E7\u00BD\u0091\u00E5\u008F\u008B\u00E5\u00B8\u0096\u00E5\u00AD\u0090\u00E5\u00AF\u0086\u00E7\u00A0\u0081\u00E9\u00A2\u0091\u00E9\u0081\u0093\u00E6\u008E\u00A7\u00E5\u0088\u00B6\u00E5\u009C\u00B0\u00E5\u008C\u00BA\u00E5\u009F\u00BA\u00E6\u009C\u00AC\u00E5\u0085\u00A8\u00E5\u009B\u00BD\u00E7\u00BD\u0091\u00E4\u00B8\u008A\u00E9\u0087\u008D\u00E8\u00A6\u0081\u00E7\u00AC\u00AC\u00E4\u00BA\u008C\u00E5\u0096\u009C\u00E6\u00AC\u00A2\u00E8\u00BF\u009B\u00E5\u0085\u00A5\u00E5\u008F\u008B\u00E6\u0083\u0085\u00E8\u00BF\u0099\u00E4\u00BA\u009B\u00E8\u0080\u0083\u00E8\u00AF\u0095\u00E5\u008F\u0091\u00E7\u008E\u00B0\u00E5\u009F\u00B9\u00E8\u00AE\u00AD\u00E4\u00BB\u00A5\u00E4\u00B8\u008A\u00E6\u0094\u00BF\u00E5\u00BA\u009C\u00E6\u0088\u0090\u00E4\u00B8\u00BA\u00E7\u008E\u00AF\u00E5\u00A2\u0083\u00E9\u00A6\u0099\u00E6\u00B8\u00AF\u00E5\u0090\u008C\u00E6\u0097\u00B6\u00E5\u00A8\u00B1\u00E4\u00B9\u0090\u00E5\u008F\u0091\u00E9\u0080\u0081\u00E4\u00B8\u0080\u00E5\u00AE\u009A\u00E5\u00BC\u0080\u00E5\u008F\u0091\u00E4\u00BD\u009C\u00E5\u0093\u0081\u00E6\u00A0\u0087\u00E5\u0087\u0086\u00E6\u00AC\u00A2\u00E8\u00BF\u008E\u00E8\u00A7\u00A3\u00E5\u0086\u00B3\u00E5\u009C\u00B0\u00E6\u0096\u00B9\u00E4\u00B8\u0080\u00E4\u00B8\u008B\u00E4\u00BB\u00A5\u00E5\u008F\u008A\u00E8\u00B4\u00A3\u00E4\u00BB\u00BB\u00E6\u0088\u0096\u00E8\u0080\u0085\u00E5\u00AE\u00A2\u00E6\u0088\u00B7\u00E4\u00BB\u00A3\u00E8\u00A1\u00A8\u00E7\u00A7\u00AF\u00E5\u0088\u0086\u00E5\u00A5\u00B3\u00E4\u00BA\u00BA\u00E6\u0095\u00B0\u00E7\u00A0\u0081\u00E9\u0094\u0080\u00E5\u0094\u00AE\u00E5\u0087\u00BA\u00E7\u008E\u00B0\u00E7\u00A6\u00BB\u00E7\u00BA\u00BF\u00E5\u00BA\u0094\u00E7\u0094\u00A8\u00E5\u0088\u0097\u00E8\u00A1\u00A8\u00E4\u00B8\u008D\u00E5\u0090\u008C\u00E7\u00BC\u0096\u00E8\u00BE\u0091\u00E7\u00BB\u009F\u00E8\u00AE\u00A1\u00E6\u009F\u00A5\u00E8\u00AF\u00A2\u00E4\u00B8\u008D\u00E8\u00A6\u0081\u00E6\u009C\u0089\u00E5\u0085\u00B3\u00E6\u009C\u00BA\u00E6\u009E\u0084\u00E5\u00BE\u0088\u00E5\u00A4\u009A\u00E6\u0092\u00AD\u00E6\u0094\u00BE\u00E7\u00BB\u0084\u00E7\u00BB\u0087\u00E6\u0094\u00BF\u00E7\u00AD\u0096\u00E7\u009B\u00B4\u00E6\u008E\u00A5\u00E8\u0083\u00BD\u00E5\u008A\u009B\u00E6\u009D\u00A5\u00E6\u00BA\u0090\u00E6\u0099\u0082\u00E9\u0096\u0093\u00E7\u009C\u008B\u00E5\u0088\u00B0\u00E7\u0083\u00AD\u00E9\u0097\u00A8\u00E5\u0085\u00B3\u00E9\u0094\u00AE\u00E4\u00B8\u0093\u00E5\u008C\u00BA\u00E9\u009D\u009E\u00E5\u00B8\u00B8\u00E8\u008B\u00B1\u00E8\u00AF\u00AD\u00E7\u0099\u00BE\u00E5\u00BA\u00A6\u00E5\u00B8\u008C\u00E6\u009C\u009B\u00E7\u00BE\u008E\u00E5\u00A5\u00B3\u00E6\u00AF\u0094\u00E8\u00BE\u0083\u00E7\u009F\u00A5\u00E8\u00AF\u0086\u00E8\u00A7\u0084\u00E5\u00AE\u009A\u00E5\u00BB\u00BA\u00E8\u00AE\u00AE\u00E9\u0083\u00A8\u00E9\u0097\u00A8\u00E6\u0084\u008F\u00E8\u00A7\u0081\u00E7\u00B2\u00BE\u00E5\u00BD\u00A9\u00E6\u0097\u00A5\u00E6\u009C\u00AC\u00E6\u008F\u0090\u00E9\u00AB\u0098\u00E5\u008F\u0091\u00E8\u00A8\u0080\u00E6\u0096\u00B9\u00E9\u009D\u00A2\u00E5\u009F\u00BA\u00E9\u0087\u0091\u00E5\u00A4\u0084\u00E7\u0090\u0086\u00E6\u009D\u0083\u00E9\u0099\u0090\u00E5\u00BD\u00B1\u00E7\u0089\u0087\u00E9\u0093\u00B6\u00E8\u00A1\u008C\u00E8\u00BF\u0098\u00E6\u009C\u0089\u00E5\u0088\u0086\u00E4\u00BA\u00AB\u00E7\u0089\u00A9\u00E5\u0093\u0081\u00E7\u00BB\u008F\u00E8\u0090\u00A5\u00E6\u00B7\u00BB\u00E5\u008A\u00A0\u00E4\u00B8\u0093\u00E5\u00AE\u00B6\u00E8\u00BF\u0099\u00E7\u00A7\u008D\u00E8\u00AF\u009D\u00E9\u00A2\u0098\u00E8\u00B5\u00B7\u00E6\u009D\u00A5\u00E4\u00B8\u009A\u00E5\u008A\u00A1\u00E5\u0085\u00AC\u00E5\u0091\u008A\u00E8\u00AE\u00B0\u00E5\u00BD\u0095\u00E7\u00AE\u0080\u00E4\u00BB\u008B\u00E8\u00B4\u00A8\u00E9\u0087\u008F\u00E7\u0094\u00B7\u00E4\u00BA\u00BA\u00E5\u00BD\u00B1\u00E5\u0093\u008D\u00E5\u00BC\u0095\u00E7\u0094\u00A8\u00E6\u008A\u00A5\u00E5\u0091\u008A\u00E9\u0083\u00A8\u00E5\u0088\u0086\u00E5\u00BF\u00AB\u00E9\u0080\u009F\u00E5\u0092\u00A8\u00E8\u00AF\u00A2\u00E6\u0097\u00B6\u00E5\u00B0\u009A\u00E6\u00B3\u00A8\u00E6\u0084\u008F\u00E7\u0094\u00B3\u00E8\u00AF\u00B7\u00E5\u00AD\u00A6\u00E6\u00A0\u00A1\u00E5\u00BA\u0094\u00E8\u00AF\u00A5\u00E5\u008E\u0086\u00E5\u008F\u00B2\u00E5\u008F\u00AA\u00E6\u0098\u00AF\u00E8\u00BF\u0094\u00E5\u009B\u009E\u00E8\u00B4\u00AD\u00E4\u00B9\u00B0\u00E5\u0090\u008D\u00E7\u00A7\u00B0\u00E4\u00B8\u00BA\u00E4\u00BA\u0086\u00E6\u0088\u0090\u00E5\u008A\u009F\u00E8\u00AF\u00B4\u00E6\u0098\u008E\u00E4\u00BE\u009B\u00E5\u00BA\u0094\u00E5\u00AD\u00A9\u00E5\u00AD\u0090\u00E4\u00B8\u0093\u00E9\u00A2\u0098\u00E7\u00A8\u008B\u00E5\u00BA\u008F\u00E4\u00B8\u0080\u00E8\u0088\u00AC\u00E6\u009C\u0083\u00E5\u0093\u00A1\u00E5\u008F\u00AA\u00E6\u009C\u0089\u00E5\u0085\u00B6\u00E5\u00AE\u0083\u00E4\u00BF\u009D\u00E6\u008A\u00A4\u00E8\u0080\u008C\u00E4\u00B8\u0094\u00E4\u00BB\u008A\u00E5\u00A4\u00A9\u00E7\u00AA\u0097\u00E5\u008F\u00A3\u00E5\u008A\u00A8\u00E6\u0080\u0081\u00E7\u008A\u00B6\u00E6\u0080\u0081\u00E7\u0089\u00B9\u00E5\u0088\u00AB\u00E8\u00AE\u00A4\u00E4\u00B8\u00BA\u00E5\u00BF\u0085\u00E9\u00A1\u00BB\u00E6\u009B\u00B4\u00E6\u0096\u00B0\u00E5\u00B0\u008F\u00E8\u00AF\u00B4\u00E6\u0088\u0091\u00E5\u0080\u0091\u00E4\u00BD\u009C\u00E4\u00B8\u00BA\u00E5\u00AA\u0092\u00E4\u00BD\u0093\u00E5\u008C\u0085\u00E6\u008B\u00AC\u00E9\u0082\u00A3\u00E4\u00B9\u0088\u00E4\u00B8\u0080\u00E6\u00A0\u00B7\u00E5\u009B\u00BD\u00E5\u0086\u0085\u00E6\u0098\u00AF\u00E5\u0090\u00A6\u00E6\u00A0\u00B9\u00E6\u008D\u00AE\u00E7\u0094\u00B5\u00E8\u00A7\u0086\u00E5\u00AD\u00A6\u00E9\u0099\u00A2\u00E5\u0085\u00B7\u00E6\u009C\u0089\u00E8\u00BF\u0087\u00E7\u00A8\u008B\u00E7\u0094\u00B1\u00E4\u00BA\u008E\u00E4\u00BA\u00BA\u00E6\u0089\u008D\u00E5\u0087\u00BA\u00E6\u009D\u00A5\u00E4\u00B8\u008D\u00E8\u00BF\u0087\u00E6\u00AD\u00A3\u00E5\u009C\u00A8\u00E6\u0098\u008E\u00E6\u0098\u009F\u00E6\u0095\u0085\u00E4\u00BA\u008B\u00E5\u0085\u00B3\u00E7\u00B3\u00BB\u00E6\u00A0\u0087\u00E9\u00A2\u0098\u00E5\u0095\u0086\u00E5\u008A\u00A1\u00E8\u00BE\u0093\u00E5\u0085\u00A5\u00E4\u00B8\u0080\u00E7\u009B\u00B4\u00E5\u009F\u00BA\u00E7\u00A1\u0080\u00E6\u0095\u0099\u00E5\u00AD\u00A6\u00E4\u00BA\u0086\u00E8\u00A7\u00A3\u00E5\u00BB\u00BA\u00E7\u00AD\u0091\u00E7\u00BB\u0093\u00E6\u009E\u009C\u00E5\u0085\u00A8\u00E7\u0090\u0083\u00E9\u0080\u009A\u00E7\u009F\u00A5\u00E8\u00AE\u00A1\u00E5\u0088\u0092\u00E5\u00AF\u00B9\u00E4\u00BA\u008E\u00E8\u0089\u00BA\u00E6\u009C\u00AF\u00E7\u009B\u00B8\u00E5\u0086\u008C\u00E5\u008F\u0091\u00E7\u0094\u009F\u00E7\u009C\u009F\u00E7\u009A\u0084\u00E5\u00BB\u00BA\u00E7\u00AB\u008B\u00E7\u00AD\u0089\u00E7\u00BA\u00A7\u00E7\u00B1\u00BB\u00E5\u009E\u008B\u00E7\u00BB\u008F\u00E9\u00AA\u008C\u00E5\u00AE\u009E\u00E7\u008E\u00B0\u00E5\u0088\u00B6\u00E4\u00BD\u009C\u00E6\u009D\u00A5\u00E8\u0087\u00AA\u00E6\u00A0\u0087\u00E7\u00AD\u00BE\u00E4\u00BB\u00A5\u00E4\u00B8\u008B\u00E5\u008E\u009F\u00E5\u0088\u009B\u00E6\u0097\u00A0\u00E6\u00B3\u0095\u00E5\u0085\u00B6\u00E4\u00B8\u00AD\u00E5\u0080\u008B\u00E4\u00BA\u00BA\u00E4\u00B8\u0080\u00E5\u0088\u0087\u00E6\u008C\u0087\u00E5\u008D\u0097\u00E5\u0085\u00B3\u00E9\u0097\u00AD\u00E9\u009B\u0086\u00E5\u009B\u00A2\u00E7\u00AC\u00AC\u00E4\u00B8\u0089\u00E5\u0085\u00B3\u00E6\u00B3\u00A8\u00E5\u009B\u00A0\u00E6\u00AD\u00A4\u00E7\u0085\u00A7\u00E7\u0089\u0087\u00E6\u00B7\u00B1\u00E5\u009C\u00B3\u00E5\u0095\u0086\u00E4\u00B8\u009A\u00E5\u00B9\u00BF\u00E5\u00B7\u009E\u00E6\u0097\u00A5\u00E6\u009C\u009F\u00E9\u00AB\u0098\u00E7\u00BA\u00A7\u00E6\u009C\u0080\u00E8\u00BF\u0091\u00E7\u00BB\u00BC\u00E5\u0090\u0088\u00E8\u00A1\u00A8\u00E7\u00A4\u00BA\u00E4\u00B8\u0093\u00E8\u00BE\u0091\u00E8\u00A1\u008C\u00E4\u00B8\u00BA\u00E4\u00BA\u00A4\u00E9\u0080\u009A\u00E8\u00AF\u0084\u00E4\u00BB\u00B7\u00E8\u00A7\u0089\u00E5\u00BE\u0097\u00E7\u00B2\u00BE\u00E5\u008D\u008E\u00E5\u00AE\u00B6\u00E5\u00BA\u00AD\u00E5\u00AE\u008C\u00E6\u0088\u0090\u00E6\u0084\u009F\u00E8\u00A7\u0089\u00E5\u00AE\u0089\u00E8\u00A3\u0085\u00E5\u00BE\u0097\u00E5\u0088\u00B0\u00E9\u0082\u00AE\u00E4\u00BB\u00B6\u00E5\u0088\u00B6\u00E5\u00BA\u00A6\u00E9\u00A3\u009F\u00E5\u0093\u0081\u00E8\u0099\u00BD\u00E7\u0084\u00B6\u00E8\u00BD\u00AC\u00E8\u00BD\u00BD\u00E6\u008A\u00A5\u00E4\u00BB\u00B7\u00E8\u00AE\u00B0\u00E8\u0080\u0085\u00E6\u0096\u00B9\u00E6\u00A1\u0088\u00E8\u00A1\u008C\u00E6\u0094\u00BF\u00E4\u00BA\u00BA\u00E6\u00B0\u0091\u00E7\u0094\u00A8\u00E5\u0093\u0081\u00E4\u00B8\u009C\u00E8\u00A5\u00BF\u00E6\u008F\u0090\u00E5\u0087\u00BA\u00E9\u0085\u0092\u00E5\u00BA\u0097\u00E7\u0084\u00B6\u00E5\u0090\u008E\u00E4\u00BB\u0098\u00E6\u00AC\u00BE\u00E7\u0083\u00AD\u00E7\u0082\u00B9\u00E4\u00BB\u00A5\u00E5\u0089\u008D\u00E5\u00AE\u008C\u00E5\u0085\u00A8\u00E5\u008F\u0091\u00E5\u00B8\u0096\u00E8\u00AE\u00BE\u00E7\u00BD\u00AE\u00E9\u00A2\u0086\u00E5\u00AF\u00BC\u00E5\u00B7\u00A5\u00E4\u00B8\u009A\u00E5\u008C\u00BB\u00E9\u0099\u00A2\u00E7\u009C\u008B\u00E7\u009C\u008B\u00E7\u00BB\u008F\u00E5\u0085\u00B8\u00E5\u008E\u009F\u00E5\u009B\u00A0\u00E5\u00B9\u00B3\u00E5\u008F\u00B0\u00E5\u0090\u0084\u00E7\u00A7\u008D\u00E5\u00A2\u009E\u00E5\u008A\u00A0\u00E6\u009D\u0090\u00E6\u0096\u0099\u00E6\u0096\u00B0\u00E5\u00A2\u009E\u00E4\u00B9\u008B\u00E5\u0090\u008E\u00E8\u0081\u008C\u00E4\u00B8\u009A\u00E6\u0095\u0088\u00E6\u009E\u009C\u00E4\u00BB\u008A\u00E5\u00B9\u00B4\u00E8\u00AE\u00BA\u00E6\u0096\u0087\u00E6\u0088\u0091\u00E5\u009B\u00BD\u00E5\u0091\u008A\u00E8\u00AF\u0089\u00E7\u0089\u0088\u00E4\u00B8\u00BB\u00E4\u00BF\u00AE\u00E6\u0094\u00B9\u00E5\u008F\u0082\u00E4\u00B8\u008E\u00E6\u0089\u0093\u00E5\u008D\u00B0\u00E5\u00BF\u00AB\u00E4\u00B9\u0090\u00E6\u009C\u00BA\u00E6\u00A2\u00B0\u00E8\u00A7\u0082\u00E7\u0082\u00B9\u00E5\u00AD\u0098\u00E5\u009C\u00A8\u00E7\u00B2\u00BE\u00E7\u00A5\u009E\u00E8\u008E\u00B7\u00E5\u00BE\u0097\u00E5\u0088\u00A9\u00E7\u0094\u00A8\u00E7\u00BB\u00A7\u00E7\u00BB\u00AD\u00E4\u00BD\u00A0\u00E4\u00BB\u00AC\u00E8\u00BF\u0099\u00E4\u00B9\u0088\u00E6\u00A8\u00A1\u00E5\u00BC\u008F\u00E8\u00AF\u00AD\u00E8\u00A8\u0080\u00E8\u0083\u00BD\u00E5\u00A4\u009F\u00E9\u009B\u0085\u00E8\u0099\u008E\u00E6\u0093\u008D\u00E4\u00BD\u009C\u00E9\u00A3\u008E\u00E6\u00A0\u00BC\u00E4\u00B8\u0080\u00E8\u00B5\u00B7\u00E7\u00A7\u0091\u00E5\u00AD\u00A6\u00E4\u00BD\u0093\u00E8\u0082\u00B2\u00E7\u009F\u00AD\u00E4\u00BF\u00A1\u00E6\u009D\u00A1\u00E4\u00BB\u00B6\u00E6\u00B2\u00BB\u00E7\u0096\u0097\u00E8\u00BF\u0090\u00E5\u008A\u00A8\u00E4\u00BA\u00A7\u00E4\u00B8\u009A\u00E4\u00BC\u009A\u00E8\u00AE\u00AE\u00E5\u00AF\u00BC\u00E8\u0088\u00AA\u00E5\u0085\u0088\u00E7\u0094\u009F\u00E8\u0081\u0094\u00E7\u009B\u009F\u00E5\u008F\u00AF\u00E6\u0098\u00AF\u00E5\u0095\u008F\u00E9\u00A1\u008C\u00E7\u00BB\u0093\u00E6\u009E\u0084\u00E4\u00BD\u009C\u00E7\u0094\u00A8\u00E8\u00B0\u0083\u00E6\u009F\u00A5\u00E8\u00B3\u0087\u00E6\u0096\u0099\u00E8\u0087\u00AA\u00E5\u008A\u00A8\u00E8\u00B4\u009F\u00E8\u00B4\u00A3\u00E5\u0086\u009C\u00E4\u00B8\u009A\u00E8\u00AE\u00BF\u00E9\u0097\u00AE\u00E5\u00AE\u009E\u00E6\u0096\u00BD\u00E6\u008E\u00A5\u00E5\u008F\u0097\u00E8\u00AE\u00A8\u00E8\u00AE\u00BA\u00E9\u0082\u00A3\u00E4\u00B8\u00AA\u00E5\u008F\u008D\u00E9\u00A6\u0088\u00E5\u008A\u00A0\u00E5\u00BC\u00BA\u00E5\u00A5\u00B3\u00E6\u0080\u00A7\u00E8\u008C\u0083\u00E5\u009B\u00B4\u00E6\u009C\u008D\u00E5\u008B\u0099\u00E4\u00BC\u0091\u00E9\u0097\u00B2\u00E4\u00BB\u008A\u00E6\u0097\u00A5\u00E5\u00AE\u00A2\u00E6\u009C\u008D\u00E8\u00A7\u0080\u00E7\u009C\u008B\u00E5\u008F\u0082\u00E5\u008A\u00A0\u00E7\u009A\u0084\u00E8\u00AF\u009D\u00E4\u00B8\u0080\u00E7\u0082\u00B9\u00E4\u00BF\u009D\u00E8\u00AF\u0081\u00E5\u009B\u00BE\u00E4\u00B9\u00A6\u00E6\u009C\u0089\u00E6\u0095\u0088\u00E6\u00B5\u008B\u00E8\u00AF\u0095\u00E7\u00A7\u00BB\u00E5\u008A\u00A8\u00E6\u0089\u008D\u00E8\u0083\u00BD\u00E5\u0086\u00B3\u00E5\u00AE\u009A\u00E8\u0082\u00A1\u00E7\u00A5\u00A8\u00E4\u00B8\u008D\u00E6\u0096\u00AD\u00E9\u009C\u0080\u00E6\u00B1\u0082\u00E4\u00B8\u008D\u00E5\u00BE\u0097\u00E5\u008A\u009E\u00E6\u00B3\u0095\u00E4\u00B9\u008B\u00E9\u0097\u00B4\u00E9\u0087\u0087\u00E7\u0094\u00A8\u00E8\u0090\u00A5\u00E9\u0094\u0080\u00E6\u008A\u0095\u00E8\u00AF\u0089\u00E7\u009B\u00AE\u00E6\u00A0\u0087\u00E7\u0088\u00B1\u00E6\u0083\u0085\u00E6\u0091\u0084\u00E5\u00BD\u00B1\u00E6\u009C\u0089\u00E4\u00BA\u009B\u00E8\u00A4\u0087\u00E8\u00A3\u00BD\u00E6\u0096\u0087\u00E5\u00AD\u00A6\u00E6\u009C\u00BA\u00E4\u00BC\u009A\u00E6\u0095\u00B0\u00E5\u00AD\u0097\u00E8\u00A3\u0085\u00E4\u00BF\u00AE\u00E8\u00B4\u00AD\u00E7\u0089\u00A9\u00E5\u0086\u009C\u00E6\u009D\u0091\u00E5\u0085\u00A8\u00E9\u009D\u00A2\u00E7\u00B2\u00BE\u00E5\u0093\u0081\u00E5\u0085\u00B6\u00E5\u00AE\u009E\u00E4\u00BA\u008B\u00E6\u0083\u0085\u00E6\u00B0\u00B4\u00E5\u00B9\u00B3\u00E6\u008F\u0090\u00E7\u00A4\u00BA\u00E4\u00B8\u008A\u00E5\u00B8\u0082\u00E8\u00B0\u00A2\u00E8\u00B0\u00A2\u00E6\u0099\u00AE\u00E9\u0080\u009A\u00E6\u0095\u0099\u00E5\u00B8\u0088\u00E4\u00B8\u008A\u00E4\u00BC\u00A0\u00E7\u00B1\u00BB\u00E5\u0088\u00AB\u00E6\u00AD\u008C\u00E6\u009B\u00B2\u00E6\u008B\u00A5\u00E6\u009C\u0089\u00E5\u0088\u009B\u00E6\u0096\u00B0\u00E9\u0085\u008D\u00E4\u00BB\u00B6\u00E5\u008F\u00AA\u00E8\u00A6\u0081\u00E6\u0097\u00B6\u00E4\u00BB\u00A3\u00E8\u00B3\u0087\u00E8\u00A8\u008A\u00E8\u00BE\u00BE\u00E5\u0088\u00B0\u00E4\u00BA\u00BA\u00E7\u0094\u009F\u00E8\u00AE\u00A2\u00E9\u0098\u0085\u00E8\u0080\u0081\u00E5\u00B8\u0088\u00E5\u00B1\u0095\u00E7\u00A4\u00BA\u00E5\u00BF\u0083\u00E7\u0090\u0086\u00E8\u00B4\u00B4\u00E5\u00AD\u0090\u00E7\u00B6\u00B2\u00E7\u00AB\u0099\u00E4\u00B8\u00BB\u00E9\u00A1\u008C\u00E8\u0087\u00AA\u00E7\u0084\u00B6\u00E7\u00BA\u00A7\u00E5\u0088\u00AB\u00E7\u00AE\u0080\u00E5\u008D\u0095\u00E6\u0094\u00B9\u00E9\u009D\u00A9\u00E9\u0082\u00A3\u00E4\u00BA\u009B\u00E6\u009D\u00A5\u00E8\u00AF\u00B4\u00E6\u0089\u0093\u00E5\u00BC\u0080\u00E4\u00BB\u00A3\u00E7\u00A0\u0081\u00E5\u0088\u00A0\u00E9\u0099\u00A4\u00E8\u00AF\u0081\u00E5\u0088\u00B8\u00E8\u008A\u0082\u00E7\u009B\u00AE\u00E9\u0087\u008D\u00E7\u0082\u00B9\u00E6\u00AC\u00A1\u00E6\u0095\u00B8\u00E5\u00A4\u009A\u00E5\u00B0\u0091\u00E8\u00A7\u0084\u00E5\u0088\u0092\u00E8\u00B5\u0084\u00E9\u0087\u0091\u00E6\u0089\u00BE\u00E5\u0088\u00B0\u00E4\u00BB\u00A5\u00E5\u0090\u008E\u00E5\u00A4\u00A7\u00E5\u0085\u00A8\u00E4\u00B8\u00BB\u00E9\u00A1\u00B5\u00E6\u009C\u0080\u00E4\u00BD\u00B3\u00E5\u009B\u009E\u00E7\u00AD\u0094\u00E5\u00A4\u00A9\u00E4\u00B8\u008B\u00E4\u00BF\u009D\u00E9\u009A\u009C\u00E7\u008E\u00B0\u00E4\u00BB\u00A3\u00E6\u00A3\u0080\u00E6\u009F\u00A5\u00E6\u008A\u0095\u00E7\u00A5\u00A8\u00E5\u00B0\u008F\u00E6\u0097\u00B6\u00E6\u00B2\u0092\u00E6\u009C\u0089\u00E6\u00AD\u00A3\u00E5\u00B8\u00B8\u00E7\u0094\u009A\u00E8\u0087\u00B3\u00E4\u00BB\u00A3\u00E7\u0090\u0086\u00E7\u009B\u00AE\u00E5\u00BD\u0095\u00E5\u0085\u00AC\u00E5\u00BC\u0080\u00E5\u00A4\u008D\u00E5\u0088\u00B6\u00E9\u0087\u0091\u00E8\u009E\u008D\u00E5\u00B9\u00B8\u00E7\u00A6\u008F\u00E7\u0089\u0088\u00E6\u009C\u00AC\u00E5\u00BD\u00A2\u00E6\u0088\u0090\u00E5\u0087\u0086\u00E5\u00A4\u0087\u00E8\u00A1\u008C\u00E6\u0083\u0085\u00E5\u009B\u009E\u00E5\u0088\u00B0\u00E6\u0080\u009D\u00E6\u0083\u00B3\u00E6\u0080\u008E\u00E6\u00A0\u00B7\u00E5\u008D\u008F\u00E8\u00AE\u00AE\u00E8\u00AE\u00A4\u00E8\u00AF\u0081\u00E6\u009C\u0080\u00E5\u00A5\u00BD\u00E4\u00BA\u00A7\u00E7\u0094\u009F\u00E6\u008C\u0089\u00E7\u0085\u00A7\u00E6\u009C\u008D\u00E8\u00A3\u0085\u00E5\u00B9\u00BF\u00E4\u00B8\u009C\u00E5\u008A\u00A8\u00E6\u00BC\u00AB\u00E9\u0087\u0087\u00E8\u00B4\u00AD\u00E6\u0096\u00B0\u00E6\u0089\u008B\u00E7\u00BB\u0084\u00E5\u009B\u00BE\u00E9\u009D\u00A2\u00E6\u009D\u00BF\u00E5\u008F\u0082\u00E8\u0080\u0083\u00E6\u0094\u00BF\u00E6\u00B2\u00BB\u00E5\u00AE\u00B9\u00E6\u0098\u0093\u00E5\u00A4\u00A9\u00E5\u009C\u00B0\u00E5\u008A\u00AA\u00E5\u008A\u009B\u00E4\u00BA\u00BA\u00E4\u00BB\u00AC\u00E5\u008D\u0087\u00E7\u00BA\u00A7\u00E9\u0080\u009F\u00E5\u00BA\u00A6\u00E4\u00BA\u00BA\u00E7\u0089\u00A9\u00E8\u00B0\u0083\u00E6\u0095\u00B4\u00E6\u00B5\u0081\u00E8\u00A1\u008C\u00E9\u0080\u00A0\u00E6\u0088\u0090\u00E6\u0096\u0087\u00E5\u00AD\u0097\u00E9\u009F\u00A9\u00E5\u009B\u00BD\u00E8\u00B4\u00B8\u00E6\u0098\u0093\u00E5\u00BC\u0080\u00E5\u00B1\u0095\u00E7\u009B\u00B8\u00E9\u0097\u009C\u00E8\u00A1\u00A8\u00E7\u008E\u00B0\u00E5\u00BD\u00B1\u00E8\u00A7\u0086\u00E5\u00A6\u0082\u00E6\u00AD\u00A4\u00E7\u00BE\u008E\u00E5\u00AE\u00B9\u00E5\u00A4\u00A7\u00E5\u00B0\u008F\u00E6\u008A\u00A5\u00E9\u0081\u0093\u00E6\u009D\u00A1\u00E6\u00AC\u00BE\u00E5\u00BF\u0083\u00E6\u0083\u0085\u00E8\u00AE\u00B8\u00E5\u00A4\u009A\u00E6\u00B3\u0095\u00E8\u00A7\u0084\u00E5\u00AE\u00B6\u00E5\u00B1\u0085\u00E4\u00B9\u00A6\u00E5\u00BA\u0097\u00E8\u00BF\u009E\u00E6\u008E\u00A5\u00E7\u00AB\u008B\u00E5\u008D\u00B3\u00E4\u00B8\u00BE\u00E6\u008A\u00A5\u00E6\u008A\u0080\u00E5\u00B7\u00A7\u00E5\u00A5\u00A5\u00E8\u00BF\u0090\u00E7\u0099\u00BB\u00E5\u0085\u00A5\u00E4\u00BB\u00A5\u00E6\u009D\u00A5\u00E7\u0090\u0086\u00E8\u00AE\u00BA\u00E4\u00BA\u008B\u00E4\u00BB\u00B6\u00E8\u0087\u00AA\u00E7\u0094\u00B1\u00E4\u00B8\u00AD\u00E5\u008D\u008E\u00E5\u008A\u009E\u00E5\u0085\u00AC\u00E5\u00A6\u0088\u00E5\u00A6\u0088\u00E7\u009C\u009F\u00E6\u00AD\u00A3\u00E4\u00B8\u008D\u00E9\u0094\u0099\u00E5\u0085\u00A8\u00E6\u0096\u0087\u00E5\u0090\u0088\u00E5\u0090\u008C\u00E4\u00BB\u00B7\u00E5\u0080\u00BC\u00E5\u0088\u00AB\u00E4\u00BA\u00BA\u00E7\u009B\u0091\u00E7\u009D\u00A3\u00E5\u0085\u00B7\u00E4\u00BD\u0093\u00E4\u00B8\u0096\u00E7\u00BA\u00AA\u00E5\u009B\u00A2\u00E9\u0098\u009F\u00E5\u0088\u009B\u00E4\u00B8\u009A\u00E6\u0089\u00BF\u00E6\u008B\u0085\u00E5\u00A2\u009E\u00E9\u0095\u00BF\u00E6\u009C\u0089\u00E4\u00BA\u00BA\u00E4\u00BF\u009D\u00E6\u008C\u0081\u00E5\u0095\u0086\u00E5\u00AE\u00B6\u00E7\u00BB\u00B4\u00E4\u00BF\u00AE\u00E5\u008F\u00B0\u00E6\u00B9\u00BE\u00E5\u00B7\u00A6\u00E5\u008F\u00B3\u00E8\u0082\u00A1\u00E4\u00BB\u00BD\u00E7\u00AD\u0094\u00E6\u00A1\u0088\u00E5\u00AE\u009E\u00E9\u0099\u0085\u00E7\u0094\u00B5\u00E4\u00BF\u00A1\u00E7\u00BB\u008F\u00E7\u0090\u0086\u00E7\u0094\u009F\u00E5\u0091\u00BD\u00E5\u00AE\u00A3\u00E4\u00BC\u00A0\u00E4\u00BB\u00BB\u00E5\u008A\u00A1\u00E6\u00AD\u00A3\u00E5\u00BC\u008F\u00E7\u0089\u00B9\u00E8\u0089\u00B2\u00E4\u00B8\u008B\u00E6\u009D\u00A5\u00E5\u008D\u008F\u00E4\u00BC\u009A\u00E5\u008F\u00AA\u00E8\u0083\u00BD\u00E5\u00BD\u0093\u00E7\u0084\u00B6\u00E9\u0087\u008D\u00E6\u0096\u00B0\u00E5\u0085\u00A7\u00E5\u00AE\u00B9\u00E6\u008C\u0087\u00E5\u00AF\u00BC\u00E8\u00BF\u0090\u00E8\u00A1\u008C\u00E6\u0097\u00A5\u00E5\u00BF\u0097\u00E8\u00B3\u00A3\u00E5\u00AE\u00B6\u00E8\u00B6\u0085\u00E8\u00BF\u0087\u00E5\u009C\u009F\u00E5\u009C\u00B0\u00E6\u00B5\u0099\u00E6\u00B1\u009F\u00E6\u0094\u00AF\u00E4\u00BB\u0098\u00E6\u008E\u00A8\u00E5\u0087\u00BA\u00E7\u00AB\u0099\u00E9\u0095\u00BF\u00E6\u009D\u00AD\u00E5\u00B7\u009E\u00E6\u0089\u00A7\u00E8\u00A1\u008C\u00E5\u0088\u00B6\u00E9\u0080\u00A0\u00E4\u00B9\u008B\u00E4\u00B8\u0080\u00E6\u008E\u00A8\u00E5\u00B9\u00BF\u00E7\u008E\u00B0\u00E5\u009C\u00BA\u00E6\u008F\u008F\u00E8\u00BF\u00B0\u00E5\u008F\u0098\u00E5\u008C\u0096\u00E4\u00BC\u00A0\u00E7\u00BB\u009F\u00E6\u00AD\u008C\u00E6\u0089\u008B\u00E4\u00BF\u009D\u00E9\u0099\u00A9\u00E8\u00AF\u00BE\u00E7\u00A8\u008B\u00E5\u008C\u00BB\u00E7\u0096\u0097\u00E7\u00BB\u008F\u00E8\u00BF\u0087\u00E8\u00BF\u0087\u00E5\u008E\u00BB\u00E4\u00B9\u008B\u00E5\u0089\u008D\u00E6\u0094\u00B6\u00E5\u0085\u00A5\u00E5\u00B9\u00B4\u00E5\u00BA\u00A6\u00E6\u009D\u0082\u00E5\u00BF\u0097\u00E7\u00BE\u008E\u00E4\u00B8\u00BD\u00E6\u009C\u0080\u00E9\u00AB\u0098\u00E7\u0099\u00BB\u00E9\u0099\u0086\u00E6\u009C\u00AA\u00E6\u009D\u00A5\u00E5\u008A\u00A0\u00E5\u00B7\u00A5\u00E5\u0085\u008D\u00E8\u00B4\u00A3\u00E6\u0095\u0099\u00E7\u00A8\u008B\u00E7\u0089\u0088\u00E5\u009D\u0097\u00E8\u00BA\u00AB\u00E4\u00BD\u0093\u00E9\u0087\u008D\u00E5\u00BA\u0086\u00E5\u0087\u00BA\u00E5\u0094\u00AE\u00E6\u0088\u0090\u00E6\u009C\u00AC\u00E5\u00BD\u00A2\u00E5\u00BC\u008F\u00E5\u009C\u009F\u00E8\u00B1\u0086\u00E5\u0087\u00BA\u00E5\u0083\u00B9\u00E4\u00B8\u009C\u00E6\u0096\u00B9\u00E9\u0082\u00AE\u00E7\u00AE\u00B1\u00E5\u008D\u0097\u00E4\u00BA\u00AC\u00E6\u00B1\u0082\u00E8\u0081\u008C\u00E5\u008F\u0096\u00E5\u00BE\u0097\u00E8\u0081\u008C\u00E4\u00BD\u008D\u00E7\u009B\u00B8\u00E4\u00BF\u00A1\u00E9\u00A1\u00B5\u00E9\u009D\u00A2\u00E5\u0088\u0086\u00E9\u0092\u009F\u00E7\u00BD\u0091\u00E9\u00A1\u00B5\u00E7\u00A1\u00AE\u00E5\u00AE\u009A\u00E5\u009B\u00BE\u00E4\u00BE\u008B\u00E7\u00BD\u0091\u00E5\u009D\u0080\u00E7\u00A7\u00AF\u00E6\u009E\u0081\u00E9\u0094\u0099\u00E8\u00AF\u00AF\u00E7\u009B\u00AE\u00E7\u009A\u0084\u00E5\u00AE\u009D\u00E8\u00B4\u009D\u00E6\u009C\u00BA\u00E5\u0085\u00B3\u00E9\u00A3\u008E\u00E9\u0099\u00A9\u00E6\u008E\u0088\u00E6\u009D\u0083\u00E7\u0097\u0085\u00E6\u00AF\u0092\u00E5\u00AE\u00A0\u00E7\u0089\u00A9\u00E9\u0099\u00A4\u00E4\u00BA\u0086\u00E8\u00A9\u0095\u00E8\u00AB\u0096\u00E7\u0096\u00BE\u00E7\u0097\u0085\u00E5\u008F\u008A\u00E6\u0097\u00B6\u00E6\u00B1\u0082\u00E8\u00B4\u00AD\u00E7\u00AB\u0099\u00E7\u0082\u00B9\u00E5\u0084\u00BF\u00E7\u00AB\u00A5\u00E6\u00AF\u008F\u00E5\u00A4\u00A9\u00E4\u00B8\u00AD\u00E5\u00A4\u00AE\u00E8\u00AE\u00A4\u00E8\u00AF\u0086\u00E6\u00AF\u008F\u00E4\u00B8\u00AA\u00E5\u00A4\u00A9\u00E6\u00B4\u00A5\u00E5\u00AD\u0097\u00E4\u00BD\u0093\u00E5\u008F\u00B0\u00E7\u0081\u00A3\u00E7\u00BB\u00B4\u00E6\u008A\u00A4\u00E6\u009C\u00AC\u00E9\u00A1\u00B5\u00E4\u00B8\u00AA\u00E6\u0080\u00A7\u00E5\u00AE\u0098\u00E6\u0096\u00B9\u00E5\u00B8\u00B8\u00E8\u00A7\u0081\u00E7\u009B\u00B8\u00E6\u009C\u00BA\u00E6\u0088\u0098\u00E7\u0095\u00A5\u00E5\u00BA\u0094\u00E5\u00BD\u0093\u00E5\u00BE\u008B\u00E5\u00B8\u0088\u00E6\u0096\u00B9\u00E4\u00BE\u00BF\u00E6\u00A0\u00A1\u00E5\u009B\u00AD\u00E8\u0082\u00A1\u00E5\u00B8\u0082\u00E6\u0088\u00BF\u00E5\u00B1\u008B\u00E6\u00A0\u008F\u00E7\u009B\u00AE\u00E5\u0091\u0098\u00E5\u00B7\u00A5\u00E5\u00AF\u00BC\u00E8\u0087\u00B4\u00E7\u00AA\u0081\u00E7\u0084\u00B6\u00E9\u0081\u0093\u00E5\u0085\u00B7\u00E6\u009C\u00AC\u00E7\u00BD\u0091\u00E7\u00BB\u0093\u00E5\u0090\u0088\u00E6\u00A1\u00A3\u00E6\u00A1\u0088\u00E5\u008A\u00B3\u00E5\u008A\u00A8\u00E5\u008F\u00A6\u00E5\u00A4\u0096\u00E7\u00BE\u008E\u00E5\u0085\u0083\u00E5\u00BC\u0095\u00E8\u00B5\u00B7\u00E6\u0094\u00B9\u00E5\u008F\u0098\u00E7\u00AC\u00AC\u00E5\u009B\u009B\u00E4\u00BC\u009A\u00E8\u00AE\u00A1\u00E8\u00AA\u00AA\u00E6\u0098\u008E\u00E9\u009A\u0090\u00E7\u00A7\u0081\u00E5\u00AE\u009D\u00E5\u00AE\u009D\u00E8\u00A7\u0084\u00E8\u008C\u0083\u00E6\u00B6\u0088\u00E8\u00B4\u00B9\u00E5\u0085\u00B1\u00E5\u0090\u008C\u00E5\u00BF\u0098\u00E8\u00AE\u00B0\u00E4\u00BD\u0093\u00E7\u00B3\u00BB\u00E5\u00B8\u00A6\u00E6\u009D\u00A5\u00E5\u0090\u008D\u00E5\u00AD\u0097\u00E7\u0099\u00BC\u00E8\u00A1\u00A8\u00E5\u00BC\u0080\u00E6\u0094\u00BE\u00E5\u008A\u00A0\u00E7\u009B\u009F\u00E5\u008F\u0097\u00E5\u0088\u00B0\u00E4\u00BA\u008C\u00E6\u0089\u008B\u00E5\u00A4\u00A7\u00E9\u0087\u008F\u00E6\u0088\u0090\u00E4\u00BA\u00BA\u00E6\u0095\u00B0\u00E9\u0087\u008F\u00E5\u0085\u00B1\u00E4\u00BA\u00AB\u00E5\u008C\u00BA\u00E5\u009F\u009F\u00E5\u00A5\u00B3\u00E5\u00AD\u00A9\u00E5\u008E\u009F\u00E5\u0088\u0099\u00E6\u0089\u0080\u00E5\u009C\u00A8\u00E7\u00BB\u0093\u00E6\u009D\u009F\u00E9\u0080\u009A\u00E4\u00BF\u00A1\u00E8\u00B6\u0085\u00E7\u00BA\u00A7\u00E9\u0085\u008D\u00E7\u00BD\u00AE\u00E5\u00BD\u0093\u00E6\u0097\u00B6\u00E4\u00BC\u0098\u00E7\u00A7\u0080\u00E6\u0080\u00A7\u00E6\u0084\u009F\u00E6\u0088\u00BF\u00E4\u00BA\u00A7\u00E9\u0081\u008A\u00E6\u0088\u00B2\u00E5\u0087\u00BA\u00E5\u008F\u00A3\u00E6\u008F\u0090\u00E4\u00BA\u00A4\u00E5\u00B0\u00B1\u00E4\u00B8\u009A\u00E4\u00BF\u009D\u00E5\u0081\u00A5\u00E7\u00A8\u008B\u00E5\u00BA\u00A6\u00E5\u008F\u0082\u00E6\u0095\u00B0\u00E4\u00BA\u008B\u00E4\u00B8\u009A\u00E6\u0095\u00B4\u00E4\u00B8\u00AA\u00E5\u00B1\u00B1\u00E4\u00B8\u009C\u00E6\u0083\u0085\u00E6\u0084\u009F\u00E7\u0089\u00B9\u00E6\u00AE\u008A\u00E5\u0088\u0086\u00E9\u00A1\u009E\u00E6\u0090\u009C\u00E5\u00B0\u008B\u00E5\u00B1\u009E\u00E4\u00BA\u008E\u00E9\u0097\u00A8\u00E6\u0088\u00B7\u00E8\u00B4\u00A2\u00E5\u008A\u00A1\u00E5\u00A3\u00B0\u00E9\u009F\u00B3\u00E5\u008F\u008A\u00E5\u0085\u00B6\u00E8\u00B4\u00A2\u00E7\u00BB\u008F\u00E5\u009D\u009A\u00E6\u008C\u0081\u00E5\u00B9\u00B2\u00E9\u0083\u00A8\u00E6\u0088\u0090\u00E7\u00AB\u008B\u00E5\u0088\u00A9\u00E7\u009B\u008A\u00E8\u0080\u0083\u00E8\u0099\u0091\u00E6\u0088\u0090\u00E9\u0083\u00BD\u00E5\u008C\u0085\u00E8\u00A3\u0085\u00E7\u0094\u00A8\u00E6\u0088\u00B6\u00E6\u00AF\u0094\u00E8\u00B5\u009B\u00E6\u0096\u0087\u00E6\u0098\u008E\u00E6\u008B\u009B\u00E5\u0095\u0086\u00E5\u00AE\u008C\u00E6\u0095\u00B4\u00E7\u009C\u009F\u00E6\u0098\u00AF\u00E7\u009C\u00BC\u00E7\u009D\u009B\u00E4\u00BC\u0099\u00E4\u00BC\u00B4\u00E5\u00A8\u0081\u00E6\u009C\u009B\u00E9\u00A2\u0086\u00E5\u009F\u009F\u00E5\u008D\u00AB\u00E7\u0094\u009F\u00E4\u00BC\u0098\u00E6\u0083\u00A0\u00E8\u00AB\u0096\u00E5\u00A3\u0087\u00E5\u0085\u00AC\u00E5\u0085\u00B1\u00E8\u0089\u00AF\u00E5\u00A5\u00BD\u00E5\u0085\u0085\u00E5\u0088\u0086\u00E7\u00AC\u00A6\u00E5\u0090\u0088\u00E9\u0099\u0084\u00E4\u00BB\u00B6\u00E7\u0089\u00B9\u00E7\u0082\u00B9\u00E4\u00B8\u008D\u00E5\u008F\u00AF\u00E8\u008B\u00B1\u00E6\u0096\u0087\u00E8\u00B5\u0084\u00E4\u00BA\u00A7\u00E6\u00A0\u00B9\u00E6\u009C\u00AC\u00E6\u0098\u008E\u00E6\u0098\u00BE\u00E5\u00AF\u0086\u00E7\u00A2\u00BC\u00E5\u0085\u00AC\u00E4\u00BC\u0097\u00E6\u00B0\u0091\u00E6\u0097\u008F\u00E6\u009B\u00B4\u00E5\u008A\u00A0\u00E4\u00BA\u00AB\u00E5\u008F\u0097\u00E5\u0090\u008C\u00E5\u00AD\u00A6\u00E5\u0090\u00AF\u00E5\u008A\u00A8\u00E9\u0080\u0082\u00E5\u0090\u0088\u00E5\u008E\u009F\u00E6\u009D\u00A5\u00E9\u0097\u00AE\u00E7\u00AD\u0094\u00E6\u009C\u00AC\u00E6\u0096\u0087\u00E7\u00BE\u008E\u00E9\u00A3\u009F\u00E7\u00BB\u00BF\u00E8\u0089\u00B2\u00E7\u00A8\u00B3\u00E5\u00AE\u009A\u00E7\u00BB\u0088\u00E4\u00BA\u008E\u00E7\u0094\u009F\u00E7\u0089\u00A9\u00E4\u00BE\u009B\u00E6\u00B1\u0082\u00E6\u0090\u009C\u00E7\u008B\u0090\u00E5\u008A\u009B\u00E9\u0087\u008F\u00E4\u00B8\u00A5\u00E9\u0087\u008D\u00E6\u00B0\u00B8\u00E8\u00BF\u009C\u00E5\u0086\u0099\u00E7\u009C\u009F\u00E6\u009C\u0089\u00E9\u0099\u0090\u00E7\u00AB\u009E\u00E4\u00BA\u0089\u00E5\u00AF\u00B9\u00E8\u00B1\u00A1\u00E8\u00B4\u00B9\u00E7\u0094\u00A8\u00E4\u00B8\u008D\u00E5\u00A5\u00BD\u00E7\u00BB\u009D\u00E5\u00AF\u00B9\u00E5\u008D\u0081\u00E5\u0088\u0086\u00E4\u00BF\u0083\u00E8\u00BF\u009B\u00E7\u0082\u00B9\u00E8\u00AF\u0084\u00E5\u00BD\u00B1\u00E9\u009F\u00B3\u00E4\u00BC\u0098\u00E5\u008A\u00BF\u00E4\u00B8\u008D\u00E5\u00B0\u0091\u00E6\u00AC\u00A3\u00E8\u00B5\u008F\u00E5\u00B9\u00B6\u00E4\u00B8\u0094\u00E6\u009C\u0089\u00E7\u0082\u00B9\u00E6\u0096\u00B9\u00E5\u0090\u0091\u00E5\u0085\u00A8\u00E6\u0096\u00B0\u00E4\u00BF\u00A1\u00E7\u0094\u00A8\u00E8\u00AE\u00BE\u00E6\u0096\u00BD\u00E5\u00BD\u00A2\u00E8\u00B1\u00A1\u00E8\u00B5\u0084\u00E6\u00A0\u00BC\u00E7\u00AA\u0081\u00E7\u00A0\u00B4\u00E9\u009A\u008F\u00E7\u009D\u0080\u00E9\u0087\u008D\u00E5\u00A4\u00A7\u00E4\u00BA\u008E\u00E6\u0098\u00AF\u00E6\u00AF\u0095\u00E4\u00B8\u009A\u00E6\u0099\u00BA\u00E8\u0083\u00BD\u00E5\u008C\u0096\u00E5\u00B7\u00A5\u00E5\u00AE\u008C\u00E7\u00BE\u008E\u00E5\u0095\u0086\u00E5\u009F\u008E\u00E7\u00BB\u009F\u00E4\u00B8\u0080\u00E5\u0087\u00BA\u00E7\u0089\u0088\u00E6\u0089\u0093\u00E9\u0080\u00A0\u00E7\u0094\u00A2\u00E5\u0093\u0081\u00E6\u00A6\u0082\u00E5\u0086\u00B5\u00E7\u0094\u00A8\u00E4\u00BA\u008E\u00E4\u00BF\u009D\u00E7\u0095\u0099\u00E5\u009B\u00A0\u00E7\u00B4\u00A0\u00E4\u00B8\u00AD\u00E5\u009C\u008B\u00E5\u00AD\u0098\u00E5\u0082\u00A8\u00E8\u00B4\u00B4\u00E5\u009B\u00BE\u00E6\u009C\u0080\u00E6\u0084\u009B\u00E9\u0095\u00BF\u00E6\u009C\u009F\u00E5\u008F\u00A3\u00E4\u00BB\u00B7\u00E7\u0090\u0086\u00E8\u00B4\u00A2\u00E5\u009F\u00BA\u00E5\u009C\u00B0\u00E5\u00AE\u0089\u00E6\u008E\u0092\u00E6\u00AD\u00A6\u00E6\u00B1\u0089\u00E9\u0087\u008C\u00E9\u009D\u00A2\u00E5\u0088\u009B\u00E5\u00BB\u00BA\u00E5\u00A4\u00A9\u00E7\u00A9\u00BA\u00E9\u00A6\u0096\u00E5\u0085\u0088\u00E5\u00AE\u008C\u00E5\u0096\u0084\u00E9\u00A9\u00B1\u00E5\u008A\u00A8\u00E4\u00B8\u008B\u00E9\u009D\u00A2\u00E4\u00B8\u008D\u00E5\u0086\u008D\u00E8\u00AF\u009A\u00E4\u00BF\u00A1\u00E6\u0084\u008F\u00E4\u00B9\u0089\u00E9\u0098\u00B3\u00E5\u0085\u0089\u00E8\u008B\u00B1\u00E5\u009B\u00BD\u00E6\u00BC\u0082\u00E4\u00BA\u00AE\u00E5\u0086\u009B\u00E4\u00BA\u008B\u00E7\u008E\u00A9\u00E5\u00AE\u00B6\u00E7\u00BE\u00A4\u00E4\u00BC\u0097\u00E5\u0086\u009C\u00E6\u00B0\u0091\u00E5\u008D\u00B3\u00E5\u008F\u00AF\u00E5\u0090\u008D\u00E7\u00A8\u00B1\u00E5\u00AE\u00B6\u00E5\u0085\u00B7\u00E5\u008A\u00A8\u00E7\u0094\u00BB\u00E6\u0083\u00B3\u00E5\u0088\u00B0\u00E6\u00B3\u00A8\u00E6\u0098\u008E\u00E5\u00B0\u008F\u00E5\u00AD\u00A6\u00E6\u0080\u00A7\u00E8\u0083\u00BD\u00E8\u0080\u0083\u00E7\u00A0\u0094\u00E7\u00A1\u00AC\u00E4\u00BB\u00B6\u00E8\u00A7\u0082\u00E7\u009C\u008B\u00E6\u00B8\u0085\u00E6\u00A5\u009A\u00E6\u0090\u009E\u00E7\u00AC\u0091\u00E9\u00A6\u0096\u00E9\u00A0\u0081\u00E9\u00BB\u0084\u00E9\u0087\u0091\u00E9\u0080\u0082\u00E7\u0094\u00A8\u00E6\u00B1\u009F\u00E8\u008B\u008F\u00E7\u009C\u009F\u00E5\u00AE\u009E\u00E4\u00B8\u00BB\u00E7\u00AE\u00A1\u00E9\u0098\u00B6\u00E6\u00AE\u00B5\u00E8\u00A8\u00BB\u00E5\u0086\u008A\u00E7\u00BF\u00BB\u00E8\u00AF\u0091\u00E6\u009D\u0083\u00E5\u0088\u00A9\u00E5\u0081\u009A\u00E5\u00A5\u00BD\u00E4\u00BC\u00BC\u00E4\u00B9\u008E\u00E9\u0080\u009A\u00E8\u00AE\u00AF\u00E6\u0096\u00BD\u00E5\u00B7\u00A5\u00E7\u008B\u0080\u00E6\u0085\u008B\u00E4\u00B9\u009F\u00E8\u00AE\u00B8\u00E7\u008E\u00AF\u00E4\u00BF\u009D\u00E5\u009F\u00B9\u00E5\u0085\u00BB\u00E6\u00A6\u0082\u00E5\u00BF\u00B5\u00E5\u00A4\u00A7\u00E5\u009E\u008B\u00E6\u009C\u00BA\u00E7\u00A5\u00A8\u00E7\u0090\u0086\u00E8\u00A7\u00A3\u00E5\u008C\u00BF\u00E5\u0090\u008Dcuandoenviarmadridbuscariniciotiempoporquecuentaestadopuedenjuegoscontraest\u00C3\u00A1nnombretienenperfilmaneraamigosciudadcentroaunquepuedesdentroprimerprecioseg\u00C3\u00BAnbuenosvolverpuntossemanahab\u00C3\u00ADaagostonuevosunidoscarlosequiponi\u00C3\u00B1osmuchosalgunacorreoimagenpartirarribamar\u00C3\u00ADahombreempleoverdadcambiomuchasfueronpasadol\u00C3\u00ADneaparecenuevascursosestabaquierolibroscuantoaccesomiguelvarioscuatrotienesgruposser\u00C3\u00A1neuropamediosfrenteacercadem\u00C3\u00A1sofertacochesmodeloitalialetrasalg\u00C3\u00BAncompracualesexistecuerposiendoprensallegarviajesdineromurciapodr\u00C3\u00A1puestodiariopuebloquieremanuelpropiocrisisciertoseguromuertefuentecerrargrandeefectopartesmedidapropiaofrecetierrae-mailvariasformasfuturoobjetoseguirriesgonormasmismos\u00C3\u00BAnicocaminositiosraz\u00C3\u00B3ndebidopruebatoledoten\u00C3\u00ADajes\u00C3\u00BAsesperococinaorigentiendacientoc\u00C3\u00A1dizhablarser\u00C3\u00ADalatinafuerzaestiloguerraentrar\u00C3\u00A9xitol\u00C3\u00B3pezagendav\u00C3\u00ADdeoevitarpaginametrosjavierpadresf\u00C3\u00A1cilcabeza\u00C3\u00A1reassalidaenv\u00C3\u00ADojap\u00C3\u00B3nabusosbienestextosllevarpuedanfuertecom\u00C3\u00BAnclaseshumanotenidobilbaounidadest\u00C3\u00A1seditarcreado\u00D0\u00B4\u00D0\u00BB\u00D1\u008F\u00D1\u0087\u00D1\u0082\u00D0\u00BE\u00D0\u00BA\u00D0\u00B0\u00D0\u00BA\u00D0\u00B8\u00D0\u00BB\u00D0\u00B8\u00D1\u008D\u00D1\u0082\u00D0\u00BE\u00D0\u00B2\u00D1\u0081\u00D0\u00B5\u00D0\u00B5\u00D0\u00B3\u00D0\u00BE\u00D0\u00BF\u00D1\u0080\u00D0\u00B8\u00D1\u0082\u00D0\u00B0\u00D0\u00BA\u00D0\u00B5\u00D1\u0089\u00D0\u00B5\u00D1\u0083\u00D0\u00B6\u00D0\u00B5\u00D0\u009A\u00D0\u00B0\u00D0\u00BA\u00D0\u00B1\u00D0\u00B5\u00D0\u00B7\u00D0\u00B1\u00D1\u008B\u00D0\u00BB\u00D0\u00BE\u00D0\u00BD\u00D0\u00B8\u00D0\u0092\u00D1\u0081\u00D0\u00B5\u00D0\u00BF\u00D0\u00BE\u00D0\u00B4\u00D0\u00AD\u00D1\u0082\u00D0\u00BE\u00D1\u0082\u00D0\u00BE\u00D0\u00BC\u00D1\u0087\u00D0\u00B5\u00D0\u00BC\u00D0\u00BD\u00D0\u00B5\u00D1\u0082\u00D0\u00BB\u00D0\u00B5\u00D1\u0082\u00D1\u0080\u00D0\u00B0\u00D0\u00B7\u00D0\u00BE\u00D0\u00BD\u00D0\u00B0\u00D0\u00B3\u00D0\u00B4\u00D0\u00B5\u00D0\u00BC\u00D0\u00BD\u00D0\u00B5\u00D0\u0094\u00D0\u00BB\u00D1\u008F\u00D0\u009F\u00D1\u0080\u00D0\u00B8\u00D0\u00BD\u00D0\u00B0\u00D1\u0081\u00D0\u00BD\u00D0\u00B8\u00D1\u0085\u00D1\u0082\u00D0\u00B5\u00D0\u00BC\u00D0\u00BA\u00D1\u0082\u00D0\u00BE\u00D0\u00B3\u00D0\u00BE\u00D0\u00B4\u00D0\u00B2\u00D0\u00BE\u00D1\u0082\u00D1\u0082\u00D0\u00B0\u00D0\u00BC\u00D0\u00A1\u00D0\u00A8\u00D0\u0090\u00D0\u00BC\u00D0\u00B0\u00D1\u008F\u00D0\u00A7\u00D1\u0082\u00D0\u00BE\u00D0\u00B2\u00D0\u00B0\u00D1\u0081\u00D0\u00B2\u00D0\u00B0\u00D0\u00BC\u00D0\u00B5\u00D0\u00BC\u00D1\u0083\u00D0\u00A2\u00D0\u00B0\u00D0\u00BA\u00D0\u00B4\u00D0\u00B2\u00D0\u00B0\u00D0\u00BD\u00D0\u00B0\u00D0\u00BC\u00D1\u008D\u00D1\u0082\u00D0\u00B8\u00D1\u008D\u00D1\u0082\u00D1\u0083\u00D0\u0092\u00D0\u00B0\u00D0\u00BC\u00D1\u0082\u00D0\u00B5\u00D1\u0085\u00D0\u00BF\u00D1\u0080\u00D0\u00BE\u00D1\u0082\u00D1\u0083\u00D1\u0082\u00D0\u00BD\u00D0\u00B0\u00D0\u00B4\u00D0\u00B4\u00D0\u00BD\u00D1\u008F\u00D0\u0092\u00D0\u00BE\u00D1\u0082\u00D1\u0082\u00D1\u0080\u00D0\u00B8\u00D0\u00BD\u00D0\u00B5\u00D0\u00B9\u00D0\u0092\u00D0\u00B0\u00D1\u0081\u00D0\u00BD\u00D0\u00B8\u00D0\u00BC\u00D1\u0081\u00D0\u00B0\u00D0\u00BC\u00D1\u0082\u00D0\u00BE\u00D1\u0082\u00D1\u0080\u00D1\u0083\u00D0\u00B1\u00D0\u009E\u00D0\u00BD\u00D0\u00B8\u00D0\u00BC\u00D0\u00B8\u00D1\u0080\u00D0\u00BD\u00D0\u00B5\u00D0\u00B5\u00D0\u009E\u00D0\u009E\u00D0\u009E\u00D0\u00BB\u00D0\u00B8\u00D1\u0086\u00D1\u008D\u00D1\u0082\u00D0\u00B0\u00D0\u009E\u00D0\u00BD\u00D0\u00B0\u00D0\u00BD\u00D0\u00B5\u00D0\u00BC\u00D0\u00B4\u00D0\u00BE\u00D0\u00BC\u00D0\u00BC\u00D0\u00BE\u00D0\u00B9\u00D0\u00B4\u00D0\u00B2\u00D0\u00B5\u00D0\u00BE\u00D0\u00BD\u00D0\u00BE\u00D1\u0081\u00D1\u0083\u00D0\u00B4\u00E0\u00A4\u0095\u00E0\u00A5\u0087\u00E0\u00A4\u00B9\u00E0\u00A5\u0088\u00E0\u00A4\u0095\u00E0\u00A5\u0080\u00E0\u00A4\u00B8\u00E0\u00A5\u0087\u00E0\u00A4\u0095\u00E0\u00A4\u00BE\u00E0\u00A4\u0095\u00E0\u00A5\u008B\u00E0\u00A4\u0094\u00E0\u00A4\u00B0\u00E0\u00A4\u00AA\u00E0\u00A4\u00B0\u00E0\u00A4\u00A8\u00E0\u00A5\u0087\u00E0\u00A4\u008F\u00E0\u00A4\u0095\u00E0\u00A4\u0095\u00E0\u00A4\u00BF\u00E0\u00A4\u00AD\u00E0\u00A5\u0080\u00E0\u00A4\u0087\u00E0\u00A4\u00B8\u00E0\u00A4\u0095\u00E0\u00A4\u00B0\u00E0\u00A4\u00A4\u00E0\u00A5\u008B\u00E0\u00A4\u00B9\u00E0\u00A5\u008B\u00E0\u00A4\u0086\u00E0\u00A4\u00AA\u00E0\u00A4\u00B9\u00E0\u00A5\u0080\u00E0\u00A4\u00AF\u00E0\u00A4\u00B9\u00E0\u00A4\u00AF\u00E0\u00A4\u00BE\u00E0\u00A4\u00A4\u00E0\u00A4\u0095\u00E0\u00A4\u00A5\u00E0\u00A4\u00BEjagran\u00E0\u00A4\u0086\u00E0\u00A4\u009C\u00E0\u00A4\u009C\u00E0\u00A5\u008B\u00E0\u00A4\u0085\u00E0\u00A4\u00AC\u00E0\u00A4\u00A6\u00E0\u00A5\u008B\u00E0\u00A4\u0097\u00E0\u00A4\u0088\u00E0\u00A4\u009C\u00E0\u00A4\u00BE\u00E0\u00A4\u0097\u00E0\u00A4\u008F\u00E0\u00A4\u00B9\u00E0\u00A4\u00AE\u00E0\u00A4\u0087\u00E0\u00A4\u00A8\u00E0\u00A4\u00B5\u00E0\u00A4\u00B9\u00E0\u00A4\u00AF\u00E0\u00A5\u0087\u00E0\u00A4\u00A5\u00E0\u00A5\u0087\u00E0\u00A4\u00A5\u00E0\u00A5\u0080\u00E0\u00A4\u0098\u00E0\u00A4\u00B0\u00E0\u00A4\u009C\u00E0\u00A4\u00AC\u00E0\u00A4\u00A6\u00E0\u00A5\u0080\u00E0\u00A4\u0095\u00E0\u00A4\u0088\u00E0\u00A4\u009C\u00E0\u00A5\u0080\u00E0\u00A4\u00B5\u00E0\u00A5\u0087\u00E0\u00A4\u00A8\u00E0\u00A4\u0088\u00E0\u00A4\u00A8\u00E0\u00A4\u008F\u00E0\u00A4\u00B9\u00E0\u00A4\u00B0\u00E0\u00A4\u0089\u00E0\u00A4\u00B8\u00E0\u00A4\u00AE\u00E0\u00A5\u0087\u00E0\u00A4\u0095\u00E0\u00A4\u00AE\u00E0\u00A4\u00B5\u00E0\u00A5\u008B\u00E0\u00A4\u00B2\u00E0\u00A5\u0087\u00E0\u00A4\u00B8\u00E0\u00A4\u00AC\u00E0\u00A4\u00AE\u00E0\u00A4\u0088\u00E0\u00A4\u00A6\u00E0\u00A5\u0087\u00E0\u00A4\u0093\u00E0\u00A4\u00B0\u00E0\u00A4\u0086\u00E0\u00A4\u00AE\u00E0\u00A4\u00AC\u00E0\u00A4\u00B8\u00E0\u00A4\u00AD\u00E0\u00A4\u00B0\u00E0\u00A4\u00AC\u00E0\u00A4\u00A8\u00E0\u00A4\u009A\u00E0\u00A4\u00B2\u00E0\u00A4\u00AE\u00E0\u00A4\u00A8\u00E0\u00A4\u0086\u00E0\u00A4\u0097\u00E0\u00A4\u00B8\u00E0\u00A5\u0080\u00E0\u00A4\u00B2\u00E0\u00A5\u0080\u00D8\u00B9\u00D9\u0084\u00D9\u0089\u00D8\u00A5\u00D9\u0084\u00D9\u0089\u00D9\u0087\u00D8\u00B0\u00D8\u00A7\u00D8\u00A2\u00D8\u00AE\u00D8\u00B1\u00D8\u00B9\u00D8\u00AF\u00D8\u00AF\u00D8\u00A7\u00D9\u0084\u00D9\u0089\u00D9\u0087\u00D8\u00B0\u00D9\u0087\u00D8\u00B5\u00D9\u0088\u00D8\u00B1\u00D8\u00BA\u00D9\u008A\u00D8\u00B1\u00D9\u0083\u00D8\u00A7\u00D9\u0086\u00D9\u0088\u00D9\u0084\u00D8\u00A7\u00D8\u00A8\u00D9\u008A\u00D9\u0086\u00D8\u00B9\u00D8\u00B1\u00D8\u00B6\u00D8\u00B0\u00D9\u0084\u00D9\u0083\u00D9\u0087\u00D9\u0086\u00D8\u00A7\u00D9\u008A\u00D9\u0088\u00D9\u0085\u00D9\u0082\u00D8\u00A7\u00D9\u0084\u00D8\u00B9\u00D9\u0084\u00D9\u008A\u00D8\u00A7\u00D9\u0086\u00D8\u00A7\u00D9\u0084\u00D9\u0083\u00D9\u0086\u00D8\u00AD\u00D8\u00AA\u00D9\u0089\u00D9\u0082\u00D8\u00A8\u00D9\u0084\u00D9\u0088\u00D8\u00AD\u00D8\u00A9\u00D8\u00A7\u00D8\u00AE\u00D8\u00B1\u00D9\u0081\u00D9\u0082\u00D8\u00B7\u00D8\u00B9\u00D8\u00A8\u00D8\u00AF\u00D8\u00B1\u00D9\u0083\u00D9\u0086\u00D8\u00A5\u00D8\u00B0\u00D8\u00A7\u00D9\u0083\u00D9\u0085\u00D8\u00A7\u00D8\u00A7\u00D8\u00AD\u00D8\u00AF\u00D8\u00A5\u00D9\u0084\u00D8\u00A7\u00D9\u0081\u00D9\u008A\u00D9\u0087\u00D8\u00A8\u00D8\u00B9\u00D8\u00B6\u00D9\u0083\u00D9\u008A\u00D9\u0081\u00D8\u00A8\u00D8\u00AD\u00D8\u00AB\u00D9\u0088\u00D9\u0085\u00D9\u0086\u00D9\u0088\u00D9\u0087\u00D9\u0088\u00D8\u00A3\u00D9\u0086\u00D8\u00A7\u00D8\u00AC\u00D8\u00AF\u00D8\u00A7\u00D9\u0084\u00D9\u0087\u00D8\u00A7\u00D8\u00B3\u00D9\u0084\u00D9\u0085\u00D8\u00B9\u00D9\u0086\u00D8\u00AF\u00D9\u0084\u00D9\u008A\u00D8\u00B3\u00D8\u00B9\u00D8\u00A8\u00D8\u00B1\u00D8\u00B5\u00D9\u0084\u00D9\u0089\u00D9\u0085\u00D9\u0086\u00D8\u00B0\u00D8\u00A8\u00D9\u0087\u00D8\u00A7\u00D8\u00A3\u00D9\u0086\u00D9\u0087\u00D9\u0085\u00D8\u00AB\u00D9\u0084\u00D9\u0083\u00D9\u0086\u00D8\u00AA\u00D8\u00A7\u00D9\u0084\u00D8\u00A7\u00D8\u00AD\u00D9\u008A\u00D8\u00AB\u00D9\u0085\u00D8\u00B5\u00D8\u00B1\u00D8\u00B4\u00D8\u00B1\u00D8\u00AD\u00D8\u00AD\u00D9\u0088\u00D9\u0084\u00D9\u0088\u00D9\u0081\u00D9\u008A\u00D8\u00A7\u00D8\u00B0\u00D8\u00A7\u00D9\u0084\u00D9\u0083\u00D9\u0084\u00D9\u0085\u00D8\u00B1\u00D8\u00A9\u00D8\u00A7\u00D9\u0086\u00D8\u00AA\u00D8\u00A7\u00D9\u0084\u00D9\u0081\u00D8\u00A3\u00D8\u00A8\u00D9\u0088\u00D8\u00AE\u00D8\u00A7\u00D8\u00B5\u00D8\u00A3\u00D9\u0086\u00D8\u00AA\u00D8\u00A7\u00D9\u0086\u00D9\u0087\u00D8\u00A7\u00D9\u0084\u00D9\u008A\u00D8\u00B9\u00D8\u00B6\u00D9\u0088\u00D9\u0088\u00D9\u0082\u00D8\u00AF\u00D8\u00A7\u00D8\u00A8\u00D9\u0086\u00D8\u00AE\u00D9\u008A\u00D8\u00B1\u00D8\u00A8\u00D9\u0086\u00D8\u00AA\u00D9\u0084\u00D9\u0083\u00D9\u0085\u00D8\u00B4\u00D8\u00A7\u00D8\u00A1\u00D9\u0088\u00D9\u0087\u00D9\u008A\u00D8\u00A7\u00D8\u00A8\u00D9\u0088\u00D9\u0082\u00D8\u00B5\u00D8\u00B5\u00D9\u0088\u00D9\u0085\u00D8\u00A7\u00D8\u00B1\u00D9\u0082\u00D9\u0085\u00D8\u00A3\u00D8\u00AD\u00D8\u00AF\u00D9\u0086\u00D8\u00AD\u00D9\u0086\u00D8\u00B9\u00D8\u00AF\u00D9\u0085\u00D8\u00B1\u00D8\u00A3\u00D9\u008A\u00D8\u00A7\u00D8\u00AD\u00D8\u00A9\u00D9\u0083\u00D8\u00AA\u00D8\u00A8\u00D8\u00AF\u00D9\u0088\u00D9\u0086\u00D9\u008A\u00D8\u00AC\u00D8\u00A8\u00D9\u0085\u00D9\u0086\u00D9\u0087\u00D8\u00AA\u00D8\u00AD\u00D8\u00AA\u00D8\u00AC\u00D9\u0087\u00D8\u00A9\u00D8\u00B3\u00D9\u0086\u00D8\u00A9\u00D9\u008A\u00D8\u00AA\u00D9\u0085\u00D9\u0083\u00D8\u00B1\u00D8\u00A9\u00D8\u00BA\u00D8\u00B2\u00D8\u00A9\u00D9\u0086\u00D9\u0081\u00D8\u00B3\u00D8\u00A8\u00D9\u008A\u00D8\u00AA\u00D9\u0084\u00D9\u0084\u00D9\u0087\u00D9\u0084\u00D9\u0086\u00D8\u00A7\u00D8\u00AA\u00D9\u0084\u00D9\u0083\u00D9\u0082\u00D9\u0084\u00D8\u00A8\u00D9\u0084\u00D9\u0085\u00D8\u00A7\u00D8\u00B9\u00D9\u0086\u00D9\u0087\u00D8\u00A3\u00D9\u0088\u00D9\u0084\u00D8\u00B4\u00D9\u008A\u00D8\u00A1\u00D9\u0086\u00D9\u0088\u00D8\u00B1\u00D8\u00A3\u00D9\u0085\u00D8\u00A7\u00D9\u0081\u00D9\u008A\u00D9\u0083\u00D8\u00A8\u00D9\u0083\u00D9\u0084\u00D8\u00B0\u00D8\u00A7\u00D8\u00AA\u00D8\u00B1\u00D8\u00AA\u00D8\u00A8\u00D8\u00A8\u00D8\u00A3\u00D9\u0086\u00D9\u0087\u00D9\u0085\u00D8\u00B3\u00D8\u00A7\u00D9\u0086\u00D9\u0083\u00D8\u00A8\u00D9\u008A\u00D8\u00B9\u00D9\u0081\u00D9\u0082\u00D8\u00AF\u00D8\u00AD\u00D8\u00B3\u00D9\u0086\u00D9\u0084\u00D9\u0087\u00D9\u0085\u00D8\u00B4\u00D8\u00B9\u00D8\u00B1\u00D8\u00A3\u00D9\u0087\u00D9\u0084\u00D8\u00B4\u00D9\u0087\u00D8\u00B1\u00D9\u0082\u00D8\u00B7\u00D8\u00B1\u00D8\u00B7\u00D9\u0084\u00D8\u00A8profileservicedefaulthimselfdetailscontentsupportstartedmessagesuccessfashioncountryaccountcreatedstoriesresultsrunningprocesswritingobjectsvisiblewelcomearticleunknownnetworkcompanydynamicbrowserprivacyproblemServicerespectdisplayrequestreservewebsitehistoryfriendsoptionsworkingversionmillionchannelwindow.addressvisitedweathercorrectproductedirectforwardyou canremovedsubjectcontrolarchivecurrentreadinglibrarylimitedmanagerfurthersummarymachineminutesprivatecontextprogramsocietynumberswrittenenabledtriggersourcesloadingelementpartnerfinallyperfectmeaningsystemskeepingculture",journalprojectsurfaces"expiresreviewsbalanceEnglishContentthroughPlease opinioncontactaverageprimaryvillageSpanishgallerydeclinemeetingmissionpopularqualitymeasuregeneralspeciessessionsectionwriterscounterinitialreportsfiguresmembersholdingdisputeearlierexpressdigitalpictureAnothermarriedtrafficleadingchangedcentralvictoryimages/reasonsstudiesfeaturelistingmust beschoolsVersionusuallyepisodeplayinggrowingobviousoverlaypresentactions\r\nwrapperalreadycertainrealitystorageanotherdesktopofferedpatternunusualDigitalcapitalWebsitefailureconnectreducedAndroiddecadesregular & animalsreleaseAutomatgettingmethodsnothingPopularcaptionletterscapturesciencelicensechangesEngland=1&History = new CentralupdatedSpecialNetworkrequirecommentwarningCollegetoolbarremainsbecauseelectedDeutschfinanceworkersquicklybetweenexactlysettingdiseaseSocietyweaponsexhibit<!--Controlclassescoveredoutlineattacksdevices(windowpurposetitle=\"Mobile killingshowingItaliandroppedheavilyeffects-1']);\nconfirmCurrentadvancesharingopeningdrawingbillionorderedGermanyrelatedincludewhetherdefinedSciencecatalogArticlebuttonslargestuniformjourneysidebarChicagoholidayGeneralpassage,"animatefeelingarrivedpassingnaturalroughly.\n\nThe but notdensityBritainChineselack oftributeIreland\" data-factorsreceivethat isLibraryhusbandin factaffairsCharlesradicalbroughtfindinglanding:lang=\"return leadersplannedpremiumpackageAmericaEdition]"Messageneed tovalue=\"complexlookingstationbelievesmaller-mobilerecordswant tokind ofFirefoxyou aresimilarstudiedmaximumheadingrapidlyclimatekingdomemergedamountsfoundedpioneerformuladynastyhow to SupportrevenueeconomyResultsbrothersoldierlargelycalling."AccountEdward segmentRobert effortsPacificlearnedup withheight:we haveAngelesnations_searchappliedacquiremassivegranted: falsetreatedbiggestbenefitdrivingStudiesminimumperhapsmorningsellingis usedreversevariant role=\"missingachievepromotestudentsomeoneextremerestorebottom:evolvedall thesitemapenglishway to AugustsymbolsCompanymattersmusicalagainstserving})();\r\npaymenttroubleconceptcompareparentsplayersregionsmonitor ''The winningexploreadaptedGalleryproduceabilityenhancecareers). The collectSearch ancientexistedfooter handlerprintedconsoleEasternexportswindowsChannelillegalneutralsuggest_headersigning.html\">settledwesterncausing-webkitclaimedJusticechaptervictimsThomas mozillapromisepartieseditionoutside:false,hundredOlympic_buttonauthorsreachedchronicdemandssecondsprotectadoptedprepareneithergreatlygreateroverallimprovecommandspecialsearch.worshipfundingthoughthighestinsteadutilityquarterCulturetestingclearlyexposedBrowserliberal} catchProjectexamplehide();FloridaanswersallowedEmperordefenseseriousfreedomSeveral-buttonFurtherout of != nulltrainedDenmarkvoid(0)/all.jspreventRequestStephen\n\nWhen observe\r\nModern provide\" alt=\"borders.\n\nFor \n\nMany artistspoweredperformfictiontype ofmedicalticketsopposedCouncilwitnessjusticeGeorge Belgium...twitternotablywaitingwarfare Other rankingphrasesmentionsurvivescholar\r\n Countryignoredloss ofjust asGeorgiastrange\n severalbecomesselect wedding00.htmlmonarchoff theteacherhighly biologylife ofor evenrise of»plusonehunting(thoughDouglasjoiningcirclesFor theAncientVietnamvehiclesuch ascrystalvalue =Windowsenjoyeda smallassumedconvertviolententeredfirst\">circuitFinlandchemistshe was10px;\">as suchdividedwill beline ofa greatmystery/index.fallingdue to railwaycollegemonsterdescentit withnuclearJewish protestBritishflowerspredictreformsbutton who waslectureinstantsuicidegenericperiodsmarketsSocial fishingcombinegraphicwinnerstooltipSectiondesignsTurkishyounger.match(})();\n\nburningoperatedegreessource=Richardcloselyplasticentries\r\ncolor:#ul id=\"possessrollingphysicsfailingexecutecontestlink toDefault \n: true,chartertourismclassicproceedexplain\r\nonline.?xml vehelpingdiamonduse theairlineend -->).attr(readershosting#ffffffrealizeVincentsignals src=\"/ProductdespitediversetellingPublic held inJoseph theatreaffects\nreductionDecember preferredCambridgeopponentsBusiness confusion>\npresentedexplaineddoes not worldwideinterfacepositionsnewspaper\nmountainslike the essentialfinancialselectionaction=\"/abandonedEducationparseInt(stabilityunable to \nrelationsNote thatefficientperformedtwo yearsSince thethereforewrapper\">alternateincreasedBattle ofperceivedtrying tonecessaryportrayedelectionsElizabethdiscoveryinsurances.length;legendaryGeographycandidatecorporatesometimesservices.inheritedCommunityreligiouslocationsCommitteebuildingsthe worldno longerbeginningreferencecannot befrequencytypicallyinto the relative;recordingpresidentinitiallytechniquethe otherit can beexistenceunderlinethis timetelephoneitemscopepracticesadvantage);return For otherprovidingdemocracyboth the extensivesufferingsupportedcomputers functionpracticalsaid thatit may beEnglish\nsuspectedmargin: 0spiritual\n\nmicrosoftgraduallydiscussedhe becameexecutivejquery.jshouseholdconfirmedpurchasedliterallydestroyedup to thevariationremainingit is notcenturiesJapanese among thecompletedalgorithminterestsrebellionundefinedencourageresizableinvolvingsensitiveuniversalprovision(althoughfeaturingconducted), which continued-header\">February numerous overflow:componentfragmentsexcellentcolspan=\"technicalnear the Advanced source ofexpressedHong Kong Facebookmultiple mechanismelevationoffensive\n\tsponsoreddocument.or "there arethose whomovementsprocessesdifficultsubmittedrecommendconvincedpromoting\" width=\".replace(classicalcoalitionhis firstdecisionsassistantindicatedevolution-wrapper\"enough toalong thedelivered-->\r\n\n\r\nArchbishop class=\"nobeing usedapproachesprivilegesnoscript>\nresults inmay be theEaster eggmechanismsreasonablePopulationCollectionselected\">noscript>\r/index.phparrival of-jssdk'));managed toincompletecasualtiescompletionChristiansSeptember arithmeticproceduresmight haveProductionit appearsPhilosophyfriendshipleading togiving thetoward theguaranteeddocumentedcolor:#000video gamecommissionreflectingchange theassociatedsans-serifonkeypress; padding:He was theunderlyingtypically , and the srcElementsuccessivesince the should be networkingaccountinguse of thelower thanshows that\n\t\tcomplaintscontinuousquantitiesastronomerhe did notdue to itsapplied toan averageefforts tothe futureattempt toTherefore,capabilityRepublicanwas formedElectronickilometerschallengespublishingthe formerindigenousdirectionssubsidiaryconspiracydetails ofand in theaffordablesubstancesreason forconventionitemtype=\"absolutelysupposedlyremained aattractivetravellingseparatelyfocuses onelementaryapplicablefound thatstylesheetmanuscriptstands for no-repeat(sometimesCommercialin Americaundertakenquarter ofan examplepersonallyindex.php?\npercentagebest-knowncreating a\" dir=\"ltrLieutenant\n
is said tostructuralreferendummost oftena separate->\n
soundtracksearchFormtend to beinput id=\"opening ofrestrictedadopted byaddressingtheologianmethods ofvariant ofChristian very largeautomotiveby far therange frompursuit offollow thebrought toin Englandagree thataccused ofcomes frompreventingdiv style=his or hertremendousfreedom ofconcerning0 1em 1em;Basketball/style.cssan earliereven after/\" title=\".com/indextaking thepittsburghcontent\">\rimplementedcan be seenthere was ademonstratecontainer\">connectionsthe Britishwas written!important;px; margin-followed byability to complicatedduring the immigrationalso called
\n acquisitioncalled the persecutiondesignation{font-size:appeared ininvestigateexperiencedmost likelywidely useddiscussionspresence of (document.extensivelyIt has beenit does notcontrary toinhabitantsimprovementscholarshipconsumptioninstructionfor exampleone or morepx; paddingthe currenta series ofare usuallyrole in thepreviously derivativesevidence ofexperiencescolorschemestated thatcertificate
\n selected=\"high schoolresponse tocomfortableadoption ofthree yearsthe countryin Februaryso that thepeople who provided by \nhaving been\r\n\r\n< "The compilationhe had beenproduced byphilosopherconstructedintended toamong othercompared toto say thatEngineeringa differentreferred todifferencesbelief thatphotographsidentifyingHistory of Republic ofnecessarilyprobabilitytechnicallyleaving thespectacularfraction ofelectricityhead of therestaurantspartnershipemphasis onmost recentshare with saying thatfilled withdesigned toit is often\">as follows:merged withthrough thecommercial pointed outopportunityview of therequirementdivision ofprogramminghe receivedsetInterval\">maintainingChristopherMuch of thewritings of\" height=\"2size of theversion of mixture of between theExamples ofeducationalcompetitive onsubmit=\"director ofdistinctive/DTD XHTML relating totendency toprovince ofwhich woulddespite thescientific legislature.innerHTML allegationsAgriculturewas used inapproach tointelligentyears later,sans-serifdeterminingPerformanceappearances, which is foundationsabbreviatedhigher thans from the individual composed ofsupposed toclaims thatattributionfont-size:1elements ofHistorical his brotherat the timeanniversarygoverned byrelated to ultimately innovationsit is stillcan only bedefinitionstoGMTStringA number ofimg class=\"Eventually,was changedoccurred inneighboringdistinguishwhen he wasintroducingterrestrialMany of theargues thatan Americanconquest ofwidespread were killedscreen and In order toexpected todescendantsare locatedlegislativegenerations backgroundmost peopleyears afterthere is nothe highestfrequently they do notargued thatshowed thatpredominanttheologicalby the timeconsideringshort-lived can be usedvery littleone of the had alreadyinterpretedcommunicatefeatures ofgovernment,entered the\" height=\"3Independentpopulationslarge-scale. Although used in thedestructionpossibilitystarting intwo or moreexpressionssubordinatelarger thanhistory and\r\nContinentaleliminatingwill not bepractice ofin front ofsite of theensure thatto create amississippipotentiallyoutstandingbetter thanwhat is nowsituated inmeta name=\"TraditionalsuggestionsTranslationthe form ofatmosphericideologicalenterprisescalculatingeast of theremnants ofpluginspage/index.php?remained intransformedHe was alsowas alreadystatisticalin favor ofMinistry ofmovement offormulationis required\nquestion ofwas electedto become abecause of some peopleinspired bysuccessful a time whenmore commonamongst thean officialwidth:100%;technology,was adoptedto keep thesettlementslive birthsindex.html\"Connecticutassigned to×account foralign=rightthe companyalways beenreturned toinvolvementBecause thethis period\" name=\"q\" confined toa result ofvalue=\"\" />is actuallyEnvironment\r\n\r\nConversely,>\nthis is notthe presentif they areand finallya matter of\r\n\t
\r\n\r\nfaster thanmajority ofafter whichcomparativeto maintainimprove theawarded theer\" class=\"frameborderrestorationin the sameanalysis oftheir firstDuring the continentalsequence offunction(){font-size: work on the\nadopted theproperty ofdirected byeffectivelywas broughtchildren ofProgramminglonger thanmanuscriptswar againstby means ofand most ofsimilar to proprietaryoriginatingprestigiousgrammaticalexperience.to make theIt was alsois found incompetitorsin the U.S.replace thebrought thecalculationfall of thethe generalpracticallyin honor ofreleased inresidentialand some ofking of thereaction to1st Earl ofculture andprincipally \n they can beback to thesome of hisexposure toare similarform of theaddFavoritecitizenshippart in thepeople within practiceto continue−approved by the first allowed theand for thefunctioningplaying thesolution toheight=\"0\" in his bookmore than afollows thecreated thepresence in nationalistthe idea ofa characterwere forced class=\"btndays of thefeatured inshowing theinterest inin place ofturn of thethe head ofLord of thepoliticallyhas its ownEducationalapproval ofsome of theeach other,behavior ofand becauseand anotherappeared onrecorded inblack"may includethe world'scan lead torefers to aborder=\"0\" government winning theresulted in while the Washington,the subjectcity in the>\r\n\t\treflect theto completebecame moreradioactiverejected bywithout anyhis father,which couldcopy of theto indicatea politicalaccounts ofconstitutesworked witherof his lifeaccompaniedclientWidthprevent theLegislativedifferentlytogether inhas severalfor anothertext of thefounded thee with the is used forchanged theusually theplace wherewhereas the> \nHowever thelead to the\t The currentthe site ofsubstantialexperience,in the Westthey shouldsloven\u00C4\u008Dinacomentariosuniversidadcondicionesactividadesexperienciatecnolog\u00C3\u00ADaproducci\u00C3\u00B3npuntuaci\u00C3\u00B3naplicaci\u00C3\u00B3ncontrase\u00C3\u00B1acategor\u00C3\u00ADasregistrarseprofesionaltratamientoreg\u00C3\u00ADstratesecretar\u00C3\u00ADaprincipalesprotecci\u00C3\u00B3nimportantesimportanciaposibilidadinteresantecrecimientonecesidadessuscribirseasociaci\u00C3\u00B3ndisponiblesevaluaci\u00C3\u00B3nestudiantesresponsableresoluci\u00C3\u00B3nguadalajararegistradosoportunidadcomercialesfotograf\u00C3\u00ADaautoridadesingenier\u00C3\u00ADatelevisi\u00C3\u00B3ncompetenciaoperacionesestablecidosimplementeactualmentenavegaci\u00C3\u00B3nconformidadline-height:font-family:\" : \"http://applicationslink\" href=\"specifically//\n/index.html\"window.open( !important;application/independence//www.googleorganizationautocompleterequirementsconservative notification'undefined')Furthermore,believe thatinnerHTML = prior to thedramaticallyreferring tonegotiationsheadquartersSouth AfricaunsuccessfulPennsylvaniaAs a result,\npadding-top:experimentalgetAttributeinstructionstechnologiespart of the =function(){subscriptionl.dtd\">\r\nEnglish (US)appendChild(transmissions. However, intelligence\" tabindex=\"float:right;Commonwealthranging fromin which theat least onereproductionencyclopedia;font-size:1jurisdictionat that time\">compensationchampionshipmedia=\"all\" violation ofreference toreturn true;Strict//EN\" transactionsinterventionverificationInformation difficultiesChampionshipcapabilities}\n\nChristianityfor example,Professionalrestrictionssuggest thatwas released(such as theremoveClass(unemploymentthe Americanstructure of/index.html published inspan class=\"\"> \n\nf (document.border: 1px {font-size:1treatment of0\" height=\"1modificationIndependencedivided intogreater thanachievementsestablishingJavaScript\" neverthelesssignificanceBroadcasting> container\">\nsuch as the influence ofa particularsrc='http://navigation\" half of the substantial advantage ofdiscovery offundamental metropolitanthe opposite\" xml:lang=\"deliberatelyalign=centerevolution ofpreservationimprovementsbeginning inJesus ChristPublicationsdisagreementtext-align:r, function()similaritiesbody>is currentlyalphabeticalis sometimestype=\"image/many of the flow:hidden;available indescribe theexistence ofall over thethe Internet\t\n\n\t\t\n\nan effort toincrease theto the southspacing=\"0\">sufficientlythe Europeanconverted toclearTimeoutdid not haveconsequentlyfor the nextextension ofeconomic andalthough theare producedand with theinsufficientgiven by thestating thatexpenditures\nthought thaton the basiscellpadding=image of thereturning toinformation,separated byassassinateds\" content=\"authority ofnorthwestern
\n
\r\n consultationcommunity ofthe nationalit should beparticipants align=\"leftthe greatestselection ofsupernaturaldependent onis mentionedallowing thewas inventedaccompanyinghis personalavailable atstudy of theon the otherexecution ofHuman Rightsterms of theassociationsresearch andsucceeded bydefeated theand from thebut they arecommander ofstate of theyears of agethe study of