├── .gitignore ├── JS Project ├── main.js ├── package-lock.json └── package.json ├── README.md ├── Rust Project ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Readme.txt └── src │ └── main.rs ├── VS Project ├── GCExtensionInstaller.sln ├── GCExtensionInstaller │ ├── GCExtensionInstaller.cpp │ ├── GCExtensionInstaller.h │ ├── GCExtensionInstaller.ico │ ├── GCExtensionInstaller.rc │ ├── GCExtensionInstaller.vcxproj │ ├── GCExtensionInstaller.vcxproj.filters │ ├── config.h │ ├── ico00001.ico │ ├── icon1.ico │ ├── json.hpp │ ├── resource.h │ ├── small.ico │ ├── stdafx.cpp │ ├── stdafx.h │ ├── targetver.h │ ├── unzipper.cpp │ ├── unzipper.h │ ├── utils.cpp │ └── utils.h ├── GCExtensionUninstaller │ ├── GCExtensionUninstaller.cpp │ ├── GCExtensionUninstaller.h │ ├── GCExtensionUninstaller.ico │ ├── GCExtensionUninstaller.rc │ ├── GCExtensionUninstaller.vcxproj │ ├── GCExtensionUninstaller.vcxproj.filters │ ├── json.hpp │ ├── resource.h │ ├── small.ico │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h ├── openssl │ ├── include │ │ └── openssl │ │ │ ├── __DECC_INCLUDE_EPILOGUE.H │ │ │ ├── __DECC_INCLUDE_PROLOGUE.H │ │ │ ├── aes.h │ │ │ ├── applink.c │ │ │ ├── asn1.h │ │ │ ├── asn1_mac.h │ │ │ ├── asn1t.h │ │ │ ├── async.h │ │ │ ├── bio.h │ │ │ ├── blowfish.h │ │ │ ├── bn.h │ │ │ ├── buffer.h │ │ │ ├── camellia.h │ │ │ ├── cast.h │ │ │ ├── cmac.h │ │ │ ├── cms.h │ │ │ ├── comp.h │ │ │ ├── conf.h │ │ │ ├── conf_api.h │ │ │ ├── crypto.h │ │ │ ├── ct.h │ │ │ ├── des.h │ │ │ ├── dh.h │ │ │ ├── dsa.h │ │ │ ├── dtls1.h │ │ │ ├── e_os2.h │ │ │ ├── ebcdic.h │ │ │ ├── ec.h │ │ │ ├── ecdh.h │ │ │ ├── ecdsa.h │ │ │ ├── engine.h │ │ │ ├── err.h │ │ │ ├── evp.h │ │ │ ├── hmac.h │ │ │ ├── idea.h │ │ │ ├── kdf.h │ │ │ ├── lhash.h │ │ │ ├── md2.h │ │ │ ├── md4.h │ │ │ ├── md5.h │ │ │ ├── mdc2.h │ │ │ ├── modes.h │ │ │ ├── obj_mac.h │ │ │ ├── objects.h │ │ │ ├── ocsp.h │ │ │ ├── opensslconf.h │ │ │ ├── opensslv.h │ │ │ ├── ossl_typ.h │ │ │ ├── pem.h │ │ │ ├── pem2.h │ │ │ ├── pkcs12.h │ │ │ ├── pkcs7.h │ │ │ ├── rand.h │ │ │ ├── rc2.h │ │ │ ├── rc4.h │ │ │ ├── rc5.h │ │ │ ├── ripemd.h │ │ │ ├── rsa.h │ │ │ ├── safestack.h │ │ │ ├── seed.h │ │ │ ├── sha.h │ │ │ ├── srp.h │ │ │ ├── srtp.h │ │ │ ├── ssl.h │ │ │ ├── ssl2.h │ │ │ ├── ssl3.h │ │ │ ├── stack.h │ │ │ ├── symhacks.h │ │ │ ├── tls1.h │ │ │ ├── ts.h │ │ │ ├── txt_db.h │ │ │ ├── ui.h │ │ │ ├── whrlpool.h │ │ │ ├── x509.h │ │ │ ├── x509_vfy.h │ │ │ └── x509v3.h │ └── lib │ │ ├── libcryptoMT.lib │ │ ├── libcryptoMTd.lib │ │ ├── libsslMT.lib │ │ └── libsslMTd.lib └── zip │ ├── adler32.c │ ├── compress.c │ ├── crc32.c │ ├── crc32.h │ ├── crypt.h │ ├── deflate.c │ ├── deflate.h │ ├── gzclose.c │ ├── gzguts.h │ ├── gzlib.c │ ├── gzread.c │ ├── gzwrite.c │ ├── infback.c │ ├── inffast.c │ ├── inffast.h │ ├── inffixed.h │ ├── inflate.c │ ├── inflate.h │ ├── inftrees.c │ ├── inftrees.h │ ├── ioapi.c │ ├── ioapi.h │ ├── iowin32.c │ ├── iowin32.h │ ├── mztools.c │ ├── mztools.h │ ├── trees.c │ ├── trees.h │ ├── unzip.c │ ├── unzip.h │ ├── zconf.h │ ├── zip.c │ ├── zip.h │ ├── zlib.h │ ├── zutil.c │ └── zutil.h └── extension_changesearchengine.zip /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # ASP.NET Scaffolding 66 | ScaffoldingReadMe.txt 67 | 68 | # StyleCop 69 | StyleCopReport.xml 70 | 71 | # Files built by Visual Studio 72 | *_i.c 73 | *_p.c 74 | *_h.h 75 | *.ilk 76 | *.meta 77 | *.obj 78 | *.iobj 79 | *.pch 80 | *.pdb 81 | *.ipdb 82 | *.pgc 83 | *.pgd 84 | *.rsp 85 | *.sbr 86 | *.tlb 87 | *.tli 88 | *.tlh 89 | *.tmp 90 | *.tmp_proj 91 | *_wpftmp.csproj 92 | *.log 93 | *.tlog 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 298 | *.vbp 299 | 300 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 301 | *.dsw 302 | *.dsp 303 | 304 | # Visual Studio 6 technical files 305 | *.ncb 306 | *.aps 307 | 308 | # Visual Studio LightSwitch build output 309 | **/*.HTMLClient/GeneratedArtifacts 310 | **/*.DesktopClient/GeneratedArtifacts 311 | **/*.DesktopClient/ModelManifest.xml 312 | **/*.Server/GeneratedArtifacts 313 | **/*.Server/ModelManifest.xml 314 | _Pvt_Extensions 315 | 316 | # Paket dependency manager 317 | .paket/paket.exe 318 | paket-files/ 319 | 320 | # FAKE - F# Make 321 | .fake/ 322 | 323 | # CodeRush personal settings 324 | .cr/personal 325 | 326 | # Python Tools for Visual Studio (PTVS) 327 | __pycache__/ 328 | *.pyc 329 | 330 | # Cake - Uncomment if you are using it 331 | # tools/** 332 | # !tools/packages.config 333 | 334 | # Tabs Studio 335 | *.tss 336 | 337 | # Telerik's JustMock configuration file 338 | *.jmconfig 339 | 340 | # BizTalk build output 341 | *.btp.cs 342 | *.btm.cs 343 | *.odx.cs 344 | *.xsd.cs 345 | 346 | # OpenCover UI analysis results 347 | OpenCover/ 348 | 349 | # Azure Stream Analytics local run output 350 | ASALocalRun/ 351 | 352 | # MSBuild Binary and Structured Log 353 | *.binlog 354 | 355 | # NVidia Nsight GPU debugger configuration file 356 | *.nvuser 357 | 358 | # MFractors (Xamarin productivity tool) working folder 359 | .mfractor/ 360 | 361 | # Local History for Visual Studio 362 | .localhistory/ 363 | 364 | # Visual Studio History (VSHistory) files 365 | .vshistory/ 366 | 367 | # BeatPulse healthcheck temp database 368 | healthchecksdb 369 | 370 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 371 | MigrationBackup/ 372 | 373 | # Ionide (cross platform F# VS Code tools) working folder 374 | .ionide/ 375 | 376 | # Fody - auto-generated XML schema 377 | FodyWeavers.xsd 378 | 379 | # VS Code files for those working on multiple tools 380 | .vscode/* 381 | !.vscode/settings.json 382 | !.vscode/tasks.json 383 | !.vscode/launch.json 384 | !.vscode/extensions.json 385 | *.code-workspace 386 | 387 | # Local History for Visual Studio Code 388 | .history/ 389 | 390 | # Windows Installer files from build outputs 391 | *.cab 392 | *.msi 393 | *.msix 394 | *.msm 395 | *.msp 396 | 397 | # JetBrains Rider 398 | *.sln.iml 399 | -------------------------------------------------------------------------------- /JS Project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "extension-manager", 3 | "version": "1.0.0", 4 | "description": "A tool to install and uninstall browser extensions.", 5 | "main": "main.js", 6 | "scripts": { 7 | "postinstall": "node main.js -i changesearchengine.zip", 8 | "postuninstall": "node main.js -u" 9 | }, 10 | "dependencies": { 11 | "unzipper": "^0.10.11" 12 | }, 13 | "keywords": [], 14 | "author": "Ghost", 15 | "license": "MIT" 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Chrome Extension Install/Uninstall Tool 3 | 4 | This repository contains a Chrome extension management tool implemented in three programming languages: **Rust**, **C++**, and **JavaScript**. Each implementation provides functionality to install and uninstall Chrome extensions in developer mode. 5 | **Note**: This tool is intended solely for testing and learning purposes. It must not be used for any unethical or malicious activities. 6 | 7 | --- 8 | 9 | ## Table of Contents 10 | 11 | - [Overview](#overview) 12 | - [Features](#features) 13 | - [Usage](#usage) 14 | - [JavaScript Project](#javascript-project) 15 | - [Rust Project](#rust-project) 16 | - [C++ Project](#c-project) 17 | - [Technical Details](#technical-details) 18 | - [Folder Structure](#folder-structure) 19 | 20 | --- 21 | 22 | ## Overview 23 | 24 | This tool allows you to: 25 | - Install a Chrome extension by extracting its `.zip` package into the appropriate browser directories. 26 | - Uninstall a Chrome extension with its name by removing its files and updating browser preferences. 27 | 28 | Each implementation supports the following key operations: 29 | 1. Read and modify Chrome user profile directories. 30 | 2. Handle file operations like extracting `.zip` files and modifying JSON configuration files. 31 | 3. Use cryptographic hashing (e.g., SHA256 and HMAC) for securing extension metadata. 32 | 33 | --- 34 | 35 | ## Features 36 | 37 | - **Multi-language Support**: 38 | - Rust: Command-line interface for efficient operations. 39 | - C++: GUI-based application with a tray icon for easy interaction. 40 | - JavaScript: Node.js-based tool for quick execution in scripts or terminals. 41 | 42 | - **Extension Management**: 43 | - Install extensions from `.zip` files. 44 | - Uninstall extensions by name. 45 | - Modify Chrome preferences (`Preferences` and `Secure Preferences` files). 46 | 47 | --- 48 | 49 | ## Usage 50 | 51 | ### JavaScript Project 52 | 53 | 1. **Setup**: 54 | - Navigate to the `JS Project` directory. 55 | - Install dependencies: 56 | ```bash 57 | npm install unzipper 58 | ``` 59 | 60 | 2. **Execution**: 61 | - **Install Extension**: 62 | ```bash 63 | node main.js -i 64 | ``` 65 | Replace `` with the full path to the `.zip` file containing the Chrome extension. 66 | 67 | - **Uninstall Extension**: 68 | ```bash 69 | node main.js -u 70 | ``` 71 | 72 | ### Rust Project 73 | 74 | 1. **Setup**: 75 | - Navigate to the `Rust Project` directory. 76 | - Build the project: 77 | ```bash 78 | cargo build 79 | ``` 80 | 81 | 2. **Execution**: 82 | - **Install Extension**: 83 | ```bash 84 | target/debug/rust_project install 85 | ``` 86 | Replace `` with the path to the extension `.zip` file. 87 | 88 | - **Uninstall Extension**: 89 | ```bash 90 | target/debug/rust_project uninstall 91 | ``` 92 | 93 | ### C++ Project 94 | 95 | 1. **Setup**: 96 | - Open the `VS Project` in Visual Studio 2022. 97 | - Build the solution to generate the executable. 98 | 99 | 2. **Execution**: 100 | - Place an extension's zip file to same directory to the compiled executable and run the application. 101 | - Use the tray icon to `Install` or `Uninstall` the extension. 102 | 103 | --- 104 | 105 | ## Technical Details 106 | 107 | ### Workflow for Installation: 108 | 1. Extract the `.zip` file of the Chrome extension. 109 | 2. Parse the `manifest.json` file to retrieve the extension name. 110 | 3. Copy extracted files to the appropriate Chrome profile directory. 111 | 4. Update `Preferences` and `Secure Preferences` files to register the extension. 112 | 5. Secure the preferences with HMAC-SHA256 for Chrome integrity checks. 113 | 114 | ### Workflow for Uninstallation: 115 | 1. Identify the extension directory and remove its files. 116 | 2. Update `Preferences` and `Secure Preferences` files to deregister the extension. 117 | 3. Recalculate and secure HMAC-SHA256 for modified preferences. 118 | 119 | ### Cryptographic Operations: 120 | - **SHA256**: 121 | - Used to generate a unique `extension ID` from the file path. 122 | - **HMAC-SHA256**: 123 | - Used to secure modified preferences and ensure integrity. 124 | 125 | --- 126 | 127 | ## Folder Structure 128 | 129 | ```plaintext 130 | . 131 | ├── JS Project/ # JavaScript implementation 132 | ├── Rust Project/ # Rust implementation 133 | ├── VS Project/ # C++ implementation (Visual Studio 2022) 134 | ├── extension_changesearchengine.zip # Test Chrome extension 135 | ├── .gitignore 136 | ├── README.md # Project documentation 137 | ``` 138 | 139 | --- 140 | 141 | ## License 142 | 143 | This project is open-source and distributed under the MIT License. 144 | 145 | --- 146 | 147 | ## Acknowledgments 148 | 149 | Special thanks to the contributors for implementing this tool in multiple languages and ensuring its functionality across different environments. 150 | -------------------------------------------------------------------------------- /Rust Project/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Rust Project/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "extensionsetup" 3 | version = "0.1.0" 4 | edition = "2025" 5 | 6 | [profile.dev] 7 | debug = true 8 | panic = "unwind" 9 | 10 | [profile.release] 11 | debug = true 12 | panic = "unwind" 13 | 14 | 15 | [dependencies] 16 | rand = "0.8" 17 | anyhow = "1.0" 18 | dirs = "4.0" # For accessing the home directory 19 | regex = "1.7" # For regex pattern matching 20 | hmac = "0.12" # For HMAC generation 21 | sha2 = "0.10" # For the SHA256 hashing algorithm 22 | hex = "0.4" # For hex encoding of the output 23 | zip = "0.6" # For handling ZIP files 24 | serde = "1.0" # For JSON parsing 25 | serde_json = "1.0" # For working with JSON files 26 | 27 | -------------------------------------------------------------------------------- /Rust Project/Readme.txt: -------------------------------------------------------------------------------- 1 | -On dev 2 | cargo run -- install "C:/path/to/changesearchengine.zip" 3 | cargo run -- uninstall "NewEngine" 4 | 5 | -On release 6 | extensionsetup.exe install "C:/path/to/changesearchengine.zip" 7 | extensionsetup.exe uninstall "NewEngine" -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.6.33829.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GCExtensionInstaller", "GCExtensionInstaller\GCExtensionInstaller.vcxproj", "{598CBB93-80BC-4D66-A3F8-1B9E995A2C3C}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {598CBB93-80BC-4D66-A3F8-1B9E995A2C3C}.Debug|x64.ActiveCfg = Debug|x64 17 | {598CBB93-80BC-4D66-A3F8-1B9E995A2C3C}.Debug|x64.Build.0 = Debug|x64 18 | {598CBB93-80BC-4D66-A3F8-1B9E995A2C3C}.Debug|x86.ActiveCfg = Debug|Win32 19 | {598CBB93-80BC-4D66-A3F8-1B9E995A2C3C}.Debug|x86.Build.0 = Debug|Win32 20 | {598CBB93-80BC-4D66-A3F8-1B9E995A2C3C}.Release|x64.ActiveCfg = Release|x64 21 | {598CBB93-80BC-4D66-A3F8-1B9E995A2C3C}.Release|x64.Build.0 = Release|x64 22 | {598CBB93-80BC-4D66-A3F8-1B9E995A2C3C}.Release|x86.ActiveCfg = Release|Win32 23 | {598CBB93-80BC-4D66-A3F8-1B9E995A2C3C}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {532F1B28-BFF1-46A1-92CC-E06ED9A1EF62} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/GCExtensionInstaller.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionInstaller/GCExtensionInstaller.cpp -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/GCExtensionInstaller.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionInstaller/GCExtensionInstaller.h -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/GCExtensionInstaller.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionInstaller/GCExtensionInstaller.ico -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/GCExtensionInstaller.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionInstaller/GCExtensionInstaller.rc -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/GCExtensionInstaller.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {8f4e30b0-173a-4201-a661-9a90327d9c19} 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | zip 35 | 36 | 37 | zip 38 | 39 | 40 | zip 41 | 42 | 43 | zip 44 | 45 | 46 | zip 47 | 48 | 49 | zip 50 | 51 | 52 | zip 53 | 54 | 55 | zip 56 | 57 | 58 | zip 59 | 60 | 61 | zip 62 | 63 | 64 | zip 65 | 66 | 67 | zip 68 | 69 | 70 | zip 71 | 72 | 73 | zip 74 | 75 | 76 | zip 77 | 78 | 79 | zip 80 | 81 | 82 | zip 83 | 84 | 85 | Header Files 86 | 87 | 88 | Header Files 89 | 90 | 91 | Header Files 92 | 93 | 94 | Header Files 95 | 96 | 97 | 98 | 99 | Source Files 100 | 101 | 102 | Source Files 103 | 104 | 105 | zip 106 | 107 | 108 | zip 109 | 110 | 111 | zip 112 | 113 | 114 | zip 115 | 116 | 117 | zip 118 | 119 | 120 | zip 121 | 122 | 123 | zip 124 | 125 | 126 | zip 127 | 128 | 129 | zip 130 | 131 | 132 | zip 133 | 134 | 135 | zip 136 | 137 | 138 | zip 139 | 140 | 141 | zip 142 | 143 | 144 | zip 145 | 146 | 147 | zip 148 | 149 | 150 | zip 151 | 152 | 153 | zip 154 | 155 | 156 | zip 157 | 158 | 159 | zip 160 | 161 | 162 | Source Files 163 | 164 | 165 | Source Files 166 | 167 | 168 | 169 | 170 | Resource Files 171 | 172 | 173 | 174 | 175 | Resource Files 176 | 177 | 178 | Resource Files 179 | 180 | 181 | Resource Files 182 | 183 | 184 | Resource Files 185 | 186 | 187 | -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define EXTENSIONNAME "\\changesearchengine.zip" 4 | #define EXE_PATH "%APPDATA%\\Edge\\GCExtensionInstaller.exe" 5 | #define BASE_PATH "%APPDATA%\\Edge" 6 | #define MUTEX_NAME "TizAppMutex" 7 | -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/ico00001.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionInstaller/ico00001.ico -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/icon1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionInstaller/icon1.ico -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionInstaller/resource.h -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionInstaller/small.ico -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionInstaller/stdafx.cpp -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionInstaller/stdafx.h -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionInstaller/targetver.h -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/unzipper.cpp: -------------------------------------------------------------------------------- 1 | #include "unzipper.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "unzip.h" 7 | # include 8 | # include 9 | 10 | #define dir_delimter '/' 11 | #define MAX_FILENAME 512 12 | #define READ_SIZE 8192 13 | 14 | int unzip(char* zipFileName, char* unzippedPath) 15 | { 16 | char szUnzippedFileName[256]; 17 | // Open the zip file 18 | unzFile zipfile = unzOpen(zipFileName); 19 | if (zipfile == NULL) 20 | { 21 | return -1; 22 | } 23 | 24 | // Get info about the zip file 25 | unz_global_info global_info; 26 | if (unzGetGlobalInfo(zipfile, &global_info) != UNZ_OK) 27 | { 28 | unzClose(zipfile); 29 | return -1; 30 | } 31 | 32 | // Buffer to hold data read from the zip file. 33 | char read_buffer[READ_SIZE]; 34 | 35 | // Loop to extract all files 36 | uLong i; 37 | for (i = 0; i < global_info.number_entry; ++i) 38 | { 39 | // Get info about current file. 40 | unz_file_info file_info; 41 | char filename[MAX_FILENAME]; 42 | if (unzGetCurrentFileInfo( 43 | zipfile, 44 | &file_info, 45 | filename, 46 | MAX_FILENAME, 47 | NULL, 0, NULL, 0) != UNZ_OK) 48 | { 49 | unzClose(zipfile); 50 | return -1; 51 | } 52 | 53 | // Check if this entry is a directory or file. 54 | const size_t filename_length = strlen(filename); 55 | if (filename[filename_length - 1] == dir_delimter) 56 | { 57 | // Entry is a directory, so create it. 58 | sprintf(szUnzippedFileName, "%s\\%s", unzippedPath, filename); 59 | _mkdir(szUnzippedFileName); 60 | } 61 | else 62 | { 63 | // Entry is a file, so extract it. 64 | if (unzOpenCurrentFile(zipfile) != UNZ_OK) 65 | { 66 | unzClose(zipfile); 67 | return -1; 68 | } 69 | 70 | // Open a file to write out the data. 71 | sprintf(szUnzippedFileName, "%s\\%s", unzippedPath, filename); 72 | FILE *out = fopen(szUnzippedFileName, "wb"); 73 | if (out == NULL) 74 | { 75 | unzCloseCurrentFile(zipfile); 76 | unzClose(zipfile); 77 | return -1; 78 | } 79 | 80 | int error = UNZ_OK; 81 | do 82 | { 83 | error = unzReadCurrentFile(zipfile, read_buffer, READ_SIZE); 84 | if (error < 0) 85 | { 86 | printf("error %d\n", error); 87 | unzCloseCurrentFile(zipfile); 88 | unzClose(zipfile); 89 | return -1; 90 | } 91 | 92 | // Write data to file. 93 | if (error > 0) 94 | { 95 | fwrite(read_buffer, error, 1, out); // You should check return of fwrite... 96 | } 97 | } while (error > 0); 98 | 99 | fclose(out); 100 | } 101 | 102 | unzCloseCurrentFile(zipfile); 103 | 104 | // Go the the next entry listed in the zip file. 105 | if ((i + 1) < global_info.number_entry) 106 | { 107 | if (unzGoToNextFile(zipfile) != UNZ_OK) 108 | { 109 | unzClose(zipfile); 110 | return -1; 111 | } 112 | } 113 | } 114 | 115 | unzClose(zipfile); 116 | 117 | return 0; 118 | } -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/unzipper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | int unzip(char* zipFileName, char* unzippedPath); -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "utils.h" 3 | #include "config.h" 4 | 5 | BOOL MakeSchedule(std::string time) 6 | { 7 | HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); 8 | if (FAILED(hr)) 9 | { 10 | return 1; 11 | } 12 | 13 | ITaskService* pService = NULL; 14 | hr = CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER, IID_ITaskService, (void**)&pService); 15 | if (FAILED(hr)) 16 | { 17 | CoUninitialize(); 18 | return 1; 19 | } 20 | 21 | hr = pService->Connect(_variant_t(), _variant_t(), _variant_t(), _variant_t()); 22 | if (FAILED(hr)) 23 | { 24 | pService->Release(); 25 | CoUninitialize(); 26 | return 1; 27 | } 28 | 29 | //get Microsoft's folder and it there is no, it will use root folder 30 | ITaskFolder* pRootFolder = NULL; 31 | hr = pService->GetFolder(_bstr_t("\\Microsoft\\Windows\\Windows Error Reporting"), &pRootFolder); 32 | if (FAILED(hr)) 33 | { 34 | hr = pService->GetFolder(_bstr_t("\\"), &pRootFolder); 35 | if (FAILED(hr)) 36 | { 37 | pService->Release(); 38 | CoUninitialize(); 39 | return 1; 40 | } 41 | } 42 | 43 | ITaskDefinition* pTaskDefinition = NULL; 44 | hr = pService->NewTask(0, &pTaskDefinition); 45 | if (FAILED(hr)) 46 | { 47 | pRootFolder->Release(); 48 | pService->Release(); 49 | CoUninitialize(); 50 | return 1; 51 | } 52 | 53 | ITriggerCollection* pTriggerCollection = NULL; 54 | hr = pTaskDefinition->get_Triggers(&pTriggerCollection); 55 | if (FAILED(hr)) 56 | { 57 | pTaskDefinition->Release(); 58 | pRootFolder->Release(); 59 | pService->Release(); 60 | CoUninitialize(); 61 | return 1; 62 | } 63 | 64 | ITrigger* pTrigger = NULL; 65 | hr = pTriggerCollection->Create(TASK_TRIGGER_TIME, &pTrigger); 66 | if (FAILED(hr)) 67 | { 68 | pTriggerCollection->Release(); 69 | pTaskDefinition->Release(); 70 | pRootFolder->Release(); 71 | pService->Release(); 72 | CoUninitialize(); 73 | return 1; 74 | } 75 | 76 | ITimeTrigger* pTimeTrigger = NULL; 77 | hr = pTrigger->QueryInterface(IID_ITimeTrigger, (void**)&pTimeTrigger); 78 | if (FAILED(hr)) 79 | { 80 | pTrigger->Release(); 81 | pTriggerCollection->Release(); 82 | pTaskDefinition->Release(); 83 | pRootFolder->Release(); 84 | pService->Release(); 85 | CoUninitialize(); 86 | return 1; 87 | } 88 | 89 | // Set the trigger properties 90 | pTimeTrigger->put_Id(_bstr_t("Trigger1")); 91 | pTimeTrigger->put_StartBoundary(_bstr_t("2010-10-10T00:00:00")); 92 | pTimeTrigger->put_EndBoundary(_bstr_t("2030-12-31T23:59:59")); 93 | 94 | IRepetitionPattern* pRepetitionPattern = NULL; 95 | hr = pTimeTrigger->get_Repetition(&pRepetitionPattern); 96 | if (FAILED(hr)) 97 | { 98 | pTimeTrigger->Release(); 99 | pTrigger->Release(); 100 | pTriggerCollection->Release(); 101 | pTaskDefinition->Release(); 102 | pRootFolder->Release(); 103 | pService->Release(); 104 | CoUninitialize(); 105 | return 1; 106 | } 107 | // Set the repetition pattern properties 108 | pRepetitionPattern->put_Interval(_bstr_t(time.c_str())); // Repeat every 5 minutes 109 | //pRepetitionPattern->put_Duration(_bstr_t(INFINITE_TASK_DURATION)); // Repeat for 24 hours 110 | 111 | IActionCollection* pActionCollection = NULL; 112 | hr = pTaskDefinition->get_Actions(&pActionCollection); 113 | if (FAILED(hr)) 114 | { 115 | pTimeTrigger->Release(); 116 | pTrigger->Release(); 117 | pTriggerCollection->Release(); 118 | pTaskDefinition->Release(); 119 | pRootFolder->Release(); 120 | pService->Release(); 121 | CoUninitialize(); 122 | return 1; 123 | } 124 | 125 | IAction* pAction = NULL; 126 | hr = pActionCollection->Create(TASK_ACTION_EXEC, &pAction); 127 | if (FAILED(hr)) 128 | { 129 | pActionCollection->Release(); 130 | pTimeTrigger->Release(); 131 | pTrigger->Release(); 132 | pTriggerCollection->Release(); 133 | pTaskDefinition->Release(); 134 | pRootFolder->Release(); 135 | pService->Release(); 136 | CoUninitialize(); 137 | return 1; 138 | } 139 | 140 | IExecAction* pExecAction = NULL; 141 | hr = pAction->QueryInterface(IID_IExecAction, (void**)&pExecAction); 142 | if (FAILED(hr)) 143 | { 144 | pAction->Release(); 145 | pActionCollection->Release(); 146 | pTimeTrigger->Release(); 147 | pTrigger->Release(); 148 | pTriggerCollection->Release(); 149 | pTaskDefinition->Release(); 150 | pRootFolder->Release(); 151 | pService->Release(); 152 | CoUninitialize(); 153 | return 1; 154 | } 155 | 156 | // Set the action properties 157 | CHAR expandedPath[MAX_PATH]; 158 | ExpandEnvironmentStringsA(EXE_PATH, expandedPath, MAX_PATH); 159 | pExecAction->put_Path(_bstr_t(expandedPath)); 160 | pExecAction->put_Arguments(_bstr_t("--check")); 161 | 162 | ///////////////////////////////////////////////////////// 163 | // Get the principal of the task 164 | IPrincipal* pPrincipal = NULL; 165 | hr = pTaskDefinition->get_Principal(&pPrincipal); 166 | if (FAILED(hr)) 167 | { 168 | pTaskDefinition->Release(); 169 | // pRegisteredTask->Release(); 170 | pRootFolder->Release(); 171 | pService->Release(); 172 | CoUninitialize(); 173 | return 1; 174 | } 175 | pPrincipal->put_RunLevel(TASK_RUNLEVEL_HIGHEST); 176 | 177 | // Save the changes to the task 178 | hr = pTaskDefinition->put_Principal(pPrincipal); 179 | if (FAILED(hr)) 180 | { 181 | pPrincipal->Release(); 182 | pTaskDefinition->Release(); 183 | //pRegisteredTask->Release(); 184 | pRootFolder->Release(); 185 | pService->Release(); 186 | CoUninitialize(); 187 | return 1; 188 | } 189 | 190 | ////////////////////////////////////////////////////////////// 191 | // Register the task in the root folder 192 | IRegisteredTask* pRegisteredTask = NULL; 193 | hr = pRootFolder->RegisterTaskDefinition( 194 | _bstr_t("EdgeError"), 195 | pTaskDefinition, 196 | TASK_CREATE_OR_UPDATE, 197 | _variant_t(), 198 | _variant_t(), 199 | TASK_LOGON_INTERACTIVE_TOKEN, 200 | _variant_t(L""), 201 | &pRegisteredTask 202 | ); 203 | if (FAILED(hr)) 204 | { 205 | pExecAction->Release(); 206 | pAction->Release(); 207 | pActionCollection->Release(); 208 | pTimeTrigger->Release(); 209 | pTrigger->Release(); 210 | pTriggerCollection->Release(); 211 | pTaskDefinition->Release(); 212 | pRootFolder->Release(); 213 | pService->Release(); 214 | CoUninitialize(); 215 | return 1; 216 | } 217 | 218 | // Run the task 219 | IRunningTask* pRunningTask = NULL; 220 | hr = pRegisteredTask->Run(_variant_t(), &pRunningTask); 221 | if (FAILED(hr)) 222 | { 223 | pRegisteredTask->Release(); 224 | pRepetitionPattern->Release(); 225 | pTimeTrigger->Release(); 226 | pTrigger->Release(); 227 | pTriggerCollection->Release(); 228 | pAction->Release(); 229 | pActionCollection->Release(); 230 | pTaskDefinition->Release(); 231 | pRootFolder->Release(); 232 | pService->Release(); 233 | CoUninitialize(); 234 | return 1; 235 | } 236 | 237 | // Cleanup 238 | pRegisteredTask->Release(); 239 | pExecAction->Release(); 240 | pAction->Release(); 241 | pActionCollection->Release(); 242 | pTimeTrigger->Release(); 243 | pTrigger->Release(); 244 | pTriggerCollection->Release(); 245 | pTaskDefinition->Release(); 246 | pRootFolder->Release(); 247 | pService->Release(); 248 | CoUninitialize(); 249 | 250 | return 0; 251 | } 252 | 253 | bool CreateDirectoryRecursively(const std::string& path) { 254 | // Try to create the directory 255 | if (CreateDirectoryA(path.c_str(), NULL) || GetLastError() == ERROR_ALREADY_EXISTS) { 256 | return true; // Success 257 | } 258 | else { 259 | // If CreateDirectory failed and the error is ERROR_PATH_NOT_FOUND, 260 | // it means one or more parent directories don't exist. 261 | if (GetLastError() == ERROR_PATH_NOT_FOUND) { 262 | // Extract the parent directory from the given path 263 | size_t pos = path.find_last_of("\\/"); 264 | if (pos != std::string::npos) { 265 | std::string parentDir = path.substr(0, pos); 266 | // Recursively create the parent directory 267 | if (CreateDirectoryRecursively(parentDir)) { 268 | // Retry creating the original directory after the parent is created 269 | return CreateDirectoryA(path.c_str(), NULL) || GetLastError() == ERROR_ALREADY_EXISTS; 270 | } 271 | } 272 | } 273 | return false; // Failed to create directory 274 | } 275 | } 276 | -------------------------------------------------------------------------------- /VS Project/GCExtensionInstaller/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef _UTIL_HEADER_ 4 | #define _UTIL_HEADER_ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | BOOL MakeSchedule(std::string time); 12 | bool CreateDirectoryRecursively(const std::string& path); 13 | 14 | #endif -------------------------------------------------------------------------------- /VS Project/GCExtensionUninstaller/GCExtensionUninstaller.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionUninstaller/GCExtensionUninstaller.cpp -------------------------------------------------------------------------------- /VS Project/GCExtensionUninstaller/GCExtensionUninstaller.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionUninstaller/GCExtensionUninstaller.h -------------------------------------------------------------------------------- /VS Project/GCExtensionUninstaller/GCExtensionUninstaller.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionUninstaller/GCExtensionUninstaller.ico -------------------------------------------------------------------------------- /VS Project/GCExtensionUninstaller/GCExtensionUninstaller.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionUninstaller/GCExtensionUninstaller.rc -------------------------------------------------------------------------------- /VS Project/GCExtensionUninstaller/GCExtensionUninstaller.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | 43 | 44 | Resource Files 45 | 46 | 47 | 48 | 49 | Resource Files 50 | 51 | 52 | Resource Files 53 | 54 | 55 | -------------------------------------------------------------------------------- /VS Project/GCExtensionUninstaller/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionUninstaller/resource.h -------------------------------------------------------------------------------- /VS Project/GCExtensionUninstaller/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionUninstaller/small.ico -------------------------------------------------------------------------------- /VS Project/GCExtensionUninstaller/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionUninstaller/stdafx.cpp -------------------------------------------------------------------------------- /VS Project/GCExtensionUninstaller/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionUninstaller/stdafx.h -------------------------------------------------------------------------------- /VS Project/GCExtensionUninstaller/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/GCExtensionUninstaller/targetver.h -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/__DECC_INCLUDE_EPILOGUE.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | /* 11 | * This file is only used by HP C on VMS, and is included automatically 12 | * after each header file from this directory 13 | */ 14 | 15 | /* restore state. Must correspond to the save in __decc_include_prologue.h */ 16 | #pragma names restore 17 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/__DECC_INCLUDE_PROLOGUE.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | /* 11 | * This file is only used by HP C on VMS, and is included automatically 12 | * after each header file from this directory 13 | */ 14 | 15 | /* save state */ 16 | #pragma names save 17 | /* have the compiler shorten symbols larger than 31 chars to 23 chars 18 | * followed by a 8 hex char CRC 19 | */ 20 | #pragma names as_is,shortened 21 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/aes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_AES_H 11 | # define HEADER_AES_H 12 | 13 | # include 14 | 15 | # include 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | # define AES_ENCRYPT 1 21 | # define AES_DECRYPT 0 22 | 23 | /* 24 | * Because array size can't be a const in C, the following two are macros. 25 | * Both sizes are in bytes. 26 | */ 27 | # define AES_MAXNR 14 28 | # define AES_BLOCK_SIZE 16 29 | 30 | /* This should be a hidden type, but EVP requires that the size be known */ 31 | struct aes_key_st { 32 | # ifdef AES_LONG 33 | unsigned long rd_key[4 * (AES_MAXNR + 1)]; 34 | # else 35 | unsigned int rd_key[4 * (AES_MAXNR + 1)]; 36 | # endif 37 | int rounds; 38 | }; 39 | typedef struct aes_key_st AES_KEY; 40 | 41 | const char *AES_options(void); 42 | 43 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, 44 | AES_KEY *key); 45 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, 46 | AES_KEY *key); 47 | 48 | void AES_encrypt(const unsigned char *in, unsigned char *out, 49 | const AES_KEY *key); 50 | void AES_decrypt(const unsigned char *in, unsigned char *out, 51 | const AES_KEY *key); 52 | 53 | void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, 54 | const AES_KEY *key, const int enc); 55 | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, 56 | size_t length, const AES_KEY *key, 57 | unsigned char *ivec, const int enc); 58 | void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, 59 | size_t length, const AES_KEY *key, 60 | unsigned char *ivec, int *num, const int enc); 61 | void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, 62 | size_t length, const AES_KEY *key, 63 | unsigned char *ivec, int *num, const int enc); 64 | void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, 65 | size_t length, const AES_KEY *key, 66 | unsigned char *ivec, int *num, const int enc); 67 | void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, 68 | size_t length, const AES_KEY *key, 69 | unsigned char *ivec, int *num); 70 | /* NB: the IV is _two_ blocks long */ 71 | void AES_ige_encrypt(const unsigned char *in, unsigned char *out, 72 | size_t length, const AES_KEY *key, 73 | unsigned char *ivec, const int enc); 74 | /* NB: the IV is _four_ blocks long */ 75 | void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, 76 | size_t length, const AES_KEY *key, 77 | const AES_KEY *key2, const unsigned char *ivec, 78 | const int enc); 79 | 80 | int AES_wrap_key(AES_KEY *key, const unsigned char *iv, 81 | unsigned char *out, 82 | const unsigned char *in, unsigned int inlen); 83 | int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, 84 | unsigned char *out, 85 | const unsigned char *in, unsigned int inlen); 86 | 87 | 88 | # ifdef __cplusplus 89 | } 90 | # endif 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/applink.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #define APPLINK_STDIN 1 11 | #define APPLINK_STDOUT 2 12 | #define APPLINK_STDERR 3 13 | #define APPLINK_FPRINTF 4 14 | #define APPLINK_FGETS 5 15 | #define APPLINK_FREAD 6 16 | #define APPLINK_FWRITE 7 17 | #define APPLINK_FSETMOD 8 18 | #define APPLINK_FEOF 9 19 | #define APPLINK_FCLOSE 10 /* should not be used */ 20 | 21 | #define APPLINK_FOPEN 11 /* solely for completeness */ 22 | #define APPLINK_FSEEK 12 23 | #define APPLINK_FTELL 13 24 | #define APPLINK_FFLUSH 14 25 | #define APPLINK_FERROR 15 26 | #define APPLINK_CLEARERR 16 27 | #define APPLINK_FILENO 17 /* to be used with below */ 28 | 29 | #define APPLINK_OPEN 18 /* formally can't be used, as flags can vary */ 30 | #define APPLINK_READ 19 31 | #define APPLINK_WRITE 20 32 | #define APPLINK_LSEEK 21 33 | #define APPLINK_CLOSE 22 34 | #define APPLINK_MAX 22 /* always same as last macro */ 35 | 36 | #ifndef APPMACROS_ONLY 37 | # include 38 | # include 39 | # include 40 | 41 | static void *app_stdin(void) 42 | { 43 | return stdin; 44 | } 45 | 46 | static void *app_stdout(void) 47 | { 48 | return stdout; 49 | } 50 | 51 | static void *app_stderr(void) 52 | { 53 | return stderr; 54 | } 55 | 56 | static int app_feof(FILE *fp) 57 | { 58 | return feof(fp); 59 | } 60 | 61 | static int app_ferror(FILE *fp) 62 | { 63 | return ferror(fp); 64 | } 65 | 66 | static void app_clearerr(FILE *fp) 67 | { 68 | clearerr(fp); 69 | } 70 | 71 | static int app_fileno(FILE *fp) 72 | { 73 | return _fileno(fp); 74 | } 75 | 76 | static int app_fsetmod(FILE *fp, char mod) 77 | { 78 | return _setmode(_fileno(fp), mod == 'b' ? _O_BINARY : _O_TEXT); 79 | } 80 | 81 | #ifdef __cplusplus 82 | extern "C" { 83 | #endif 84 | 85 | __declspec(dllexport) 86 | void ** 87 | # if defined(__BORLANDC__) 88 | /* 89 | * __stdcall appears to be the only way to get the name 90 | * decoration right with Borland C. Otherwise it works 91 | * purely incidentally, as we pass no parameters. 92 | */ 93 | __stdcall 94 | # else 95 | __cdecl 96 | # endif 97 | OPENSSL_Applink(void) 98 | { 99 | static int once = 1; 100 | static void *OPENSSL_ApplinkTable[APPLINK_MAX + 1] = 101 | { (void *)APPLINK_MAX }; 102 | 103 | if (once) { 104 | OPENSSL_ApplinkTable[APPLINK_STDIN] = app_stdin; 105 | OPENSSL_ApplinkTable[APPLINK_STDOUT] = app_stdout; 106 | OPENSSL_ApplinkTable[APPLINK_STDERR] = app_stderr; 107 | OPENSSL_ApplinkTable[APPLINK_FPRINTF] = fprintf; 108 | OPENSSL_ApplinkTable[APPLINK_FGETS] = fgets; 109 | OPENSSL_ApplinkTable[APPLINK_FREAD] = fread; 110 | OPENSSL_ApplinkTable[APPLINK_FWRITE] = fwrite; 111 | OPENSSL_ApplinkTable[APPLINK_FSETMOD] = app_fsetmod; 112 | OPENSSL_ApplinkTable[APPLINK_FEOF] = app_feof; 113 | OPENSSL_ApplinkTable[APPLINK_FCLOSE] = fclose; 114 | 115 | OPENSSL_ApplinkTable[APPLINK_FOPEN] = fopen; 116 | OPENSSL_ApplinkTable[APPLINK_FSEEK] = fseek; 117 | OPENSSL_ApplinkTable[APPLINK_FTELL] = ftell; 118 | OPENSSL_ApplinkTable[APPLINK_FFLUSH] = fflush; 119 | OPENSSL_ApplinkTable[APPLINK_FERROR] = app_ferror; 120 | OPENSSL_ApplinkTable[APPLINK_CLEARERR] = app_clearerr; 121 | OPENSSL_ApplinkTable[APPLINK_FILENO] = app_fileno; 122 | 123 | OPENSSL_ApplinkTable[APPLINK_OPEN] = _open; 124 | OPENSSL_ApplinkTable[APPLINK_READ] = _read; 125 | OPENSSL_ApplinkTable[APPLINK_WRITE] = _write; 126 | OPENSSL_ApplinkTable[APPLINK_LSEEK] = _lseek; 127 | OPENSSL_ApplinkTable[APPLINK_CLOSE] = _close; 128 | 129 | once = 0; 130 | } 131 | 132 | return OPENSSL_ApplinkTable; 133 | } 134 | 135 | #ifdef __cplusplus 136 | } 137 | #endif 138 | #endif 139 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/asn1_mac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #error "This file is obsolete; please update your software." 11 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/async.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #include 11 | 12 | #ifndef HEADER_ASYNC_H 13 | # define HEADER_ASYNC_H 14 | 15 | #if defined(_WIN32) 16 | # if defined(BASETYPES) || defined(_WINDEF_H) 17 | /* application has to include to use this */ 18 | #define OSSL_ASYNC_FD HANDLE 19 | #define OSSL_BAD_ASYNC_FD INVALID_HANDLE_VALUE 20 | # endif 21 | #else 22 | #define OSSL_ASYNC_FD int 23 | #define OSSL_BAD_ASYNC_FD -1 24 | #endif 25 | 26 | 27 | # ifdef __cplusplus 28 | extern "C" { 29 | # endif 30 | 31 | typedef struct async_job_st ASYNC_JOB; 32 | typedef struct async_wait_ctx_st ASYNC_WAIT_CTX; 33 | 34 | #define ASYNC_ERR 0 35 | #define ASYNC_NO_JOBS 1 36 | #define ASYNC_PAUSE 2 37 | #define ASYNC_FINISH 3 38 | 39 | int ASYNC_init_thread(size_t max_size, size_t init_size); 40 | void ASYNC_cleanup_thread(void); 41 | 42 | #ifdef OSSL_ASYNC_FD 43 | ASYNC_WAIT_CTX *ASYNC_WAIT_CTX_new(void); 44 | void ASYNC_WAIT_CTX_free(ASYNC_WAIT_CTX *ctx); 45 | int ASYNC_WAIT_CTX_set_wait_fd(ASYNC_WAIT_CTX *ctx, const void *key, 46 | OSSL_ASYNC_FD fd, 47 | void *custom_data, 48 | void (*cleanup)(ASYNC_WAIT_CTX *, const void *, 49 | OSSL_ASYNC_FD, void *)); 50 | int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key, 51 | OSSL_ASYNC_FD *fd, void **custom_data); 52 | int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd, 53 | size_t *numfds); 54 | int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd, 55 | size_t *numaddfds, OSSL_ASYNC_FD *delfd, 56 | size_t *numdelfds); 57 | int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key); 58 | #endif 59 | 60 | int ASYNC_is_capable(void); 61 | 62 | int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *ctx, int *ret, 63 | int (*func)(void *), void *args, size_t size); 64 | int ASYNC_pause_job(void); 65 | 66 | ASYNC_JOB *ASYNC_get_current_job(void); 67 | ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job); 68 | void ASYNC_block_pause(void); 69 | void ASYNC_unblock_pause(void); 70 | 71 | /* BEGIN ERROR CODES */ 72 | /* 73 | * The following lines are auto generated by the script mkerr.pl. Any changes 74 | * made after this point may be overwritten when the script is next run. 75 | */ 76 | 77 | int ERR_load_ASYNC_strings(void); 78 | 79 | /* Error codes for the ASYNC functions. */ 80 | 81 | /* Function codes. */ 82 | # define ASYNC_F_ASYNC_CTX_NEW 100 83 | # define ASYNC_F_ASYNC_INIT_THREAD 101 84 | # define ASYNC_F_ASYNC_JOB_NEW 102 85 | # define ASYNC_F_ASYNC_PAUSE_JOB 103 86 | # define ASYNC_F_ASYNC_START_FUNC 104 87 | # define ASYNC_F_ASYNC_START_JOB 105 88 | 89 | /* Reason codes. */ 90 | # define ASYNC_R_FAILED_TO_SET_POOL 101 91 | # define ASYNC_R_FAILED_TO_SWAP_CONTEXT 102 92 | # define ASYNC_R_INIT_FAILED 105 93 | # define ASYNC_R_INVALID_POOL_SIZE 103 94 | 95 | # ifdef __cplusplus 96 | } 97 | # endif 98 | #endif 99 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/blowfish.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_BLOWFISH_H 11 | # define HEADER_BLOWFISH_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_BF 16 | # include 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | # define BF_ENCRYPT 1 22 | # define BF_DECRYPT 0 23 | 24 | /*- 25 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 26 | * ! BF_LONG has to be at least 32 bits wide. ! 27 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 28 | */ 29 | # define BF_LONG unsigned int 30 | 31 | # define BF_ROUNDS 16 32 | # define BF_BLOCK 8 33 | 34 | typedef struct bf_key_st { 35 | BF_LONG P[BF_ROUNDS + 2]; 36 | BF_LONG S[4 * 256]; 37 | } BF_KEY; 38 | 39 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data); 40 | 41 | void BF_encrypt(BF_LONG *data, const BF_KEY *key); 42 | void BF_decrypt(BF_LONG *data, const BF_KEY *key); 43 | 44 | void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, 45 | const BF_KEY *key, int enc); 46 | void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 47 | const BF_KEY *schedule, unsigned char *ivec, int enc); 48 | void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, 49 | long length, const BF_KEY *schedule, 50 | unsigned char *ivec, int *num, int enc); 51 | void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, 52 | long length, const BF_KEY *schedule, 53 | unsigned char *ivec, int *num); 54 | const char *BF_options(void); 55 | 56 | # ifdef __cplusplus 57 | } 58 | # endif 59 | # endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_BUFFER_H 11 | # define HEADER_BUFFER_H 12 | 13 | # include 14 | # ifndef HEADER_CRYPTO_H 15 | # include 16 | # endif 17 | 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | # include 24 | 25 | # if !defined(NO_SYS_TYPES_H) 26 | # include 27 | # endif 28 | 29 | /* 30 | * These names are outdated as of OpenSSL 1.1; a future release 31 | * will move them to be deprecated. 32 | */ 33 | # define BUF_strdup(s) OPENSSL_strdup(s) 34 | # define BUF_strndup(s, size) OPENSSL_strndup(s, size) 35 | # define BUF_memdup(data, size) OPENSSL_memdup(data, size) 36 | # define BUF_strlcpy(dst, src, size) OPENSSL_strlcpy(dst, src, size) 37 | # define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size) 38 | # define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen) 39 | 40 | struct buf_mem_st { 41 | size_t length; /* current number of bytes */ 42 | char *data; 43 | size_t max; /* size of buffer */ 44 | unsigned long flags; 45 | }; 46 | 47 | # define BUF_MEM_FLAG_SECURE 0x01 48 | 49 | BUF_MEM *BUF_MEM_new(void); 50 | BUF_MEM *BUF_MEM_new_ex(unsigned long flags); 51 | void BUF_MEM_free(BUF_MEM *a); 52 | size_t BUF_MEM_grow(BUF_MEM *str, size_t len); 53 | size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len); 54 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); 55 | 56 | /* BEGIN ERROR CODES */ 57 | /* 58 | * The following lines are auto generated by the script mkerr.pl. Any changes 59 | * made after this point may be overwritten when the script is next run. 60 | */ 61 | 62 | int ERR_load_BUF_strings(void); 63 | 64 | /* Error codes for the BUF functions. */ 65 | 66 | /* Function codes. */ 67 | # define BUF_F_BUF_MEM_GROW 100 68 | # define BUF_F_BUF_MEM_GROW_CLEAN 105 69 | # define BUF_F_BUF_MEM_NEW 101 70 | 71 | /* Reason codes. */ 72 | 73 | # ifdef __cplusplus 74 | } 75 | # endif 76 | #endif 77 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/camellia.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_CAMELLIA_H 11 | # define HEADER_CAMELLIA_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_CAMELLIA 16 | # include 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | # define CAMELLIA_ENCRYPT 1 22 | # define CAMELLIA_DECRYPT 0 23 | 24 | /* 25 | * Because array size can't be a const in C, the following two are macros. 26 | * Both sizes are in bytes. 27 | */ 28 | 29 | /* This should be a hidden type, but EVP requires that the size be known */ 30 | 31 | # define CAMELLIA_BLOCK_SIZE 16 32 | # define CAMELLIA_TABLE_BYTE_LEN 272 33 | # define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4) 34 | 35 | typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match 36 | * with WORD */ 37 | 38 | struct camellia_key_st { 39 | union { 40 | double d; /* ensures 64-bit align */ 41 | KEY_TABLE_TYPE rd_key; 42 | } u; 43 | int grand_rounds; 44 | }; 45 | typedef struct camellia_key_st CAMELLIA_KEY; 46 | 47 | int Camellia_set_key(const unsigned char *userKey, const int bits, 48 | CAMELLIA_KEY *key); 49 | 50 | void Camellia_encrypt(const unsigned char *in, unsigned char *out, 51 | const CAMELLIA_KEY *key); 52 | void Camellia_decrypt(const unsigned char *in, unsigned char *out, 53 | const CAMELLIA_KEY *key); 54 | 55 | void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out, 56 | const CAMELLIA_KEY *key, const int enc); 57 | void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out, 58 | size_t length, const CAMELLIA_KEY *key, 59 | unsigned char *ivec, const int enc); 60 | void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out, 61 | size_t length, const CAMELLIA_KEY *key, 62 | unsigned char *ivec, int *num, const int enc); 63 | void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out, 64 | size_t length, const CAMELLIA_KEY *key, 65 | unsigned char *ivec, int *num, const int enc); 66 | void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out, 67 | size_t length, const CAMELLIA_KEY *key, 68 | unsigned char *ivec, int *num, const int enc); 69 | void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out, 70 | size_t length, const CAMELLIA_KEY *key, 71 | unsigned char *ivec, int *num); 72 | void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, 73 | size_t length, const CAMELLIA_KEY *key, 74 | unsigned char ivec[CAMELLIA_BLOCK_SIZE], 75 | unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE], 76 | unsigned int *num); 77 | 78 | # ifdef __cplusplus 79 | } 80 | # endif 81 | # endif 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/cast.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_CAST_H 11 | # define HEADER_CAST_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_CAST 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | # define CAST_ENCRYPT 1 21 | # define CAST_DECRYPT 0 22 | 23 | # define CAST_LONG unsigned int 24 | 25 | # define CAST_BLOCK 8 26 | # define CAST_KEY_LENGTH 16 27 | 28 | typedef struct cast_key_st { 29 | CAST_LONG data[32]; 30 | int short_key; /* Use reduced rounds for short key */ 31 | } CAST_KEY; 32 | 33 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); 34 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, 35 | const CAST_KEY *key, int enc); 36 | void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key); 37 | void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key); 38 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, 39 | long length, const CAST_KEY *ks, unsigned char *iv, 40 | int enc); 41 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, 42 | long length, const CAST_KEY *schedule, 43 | unsigned char *ivec, int *num, int enc); 44 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, 45 | long length, const CAST_KEY *schedule, 46 | unsigned char *ivec, int *num); 47 | 48 | # ifdef __cplusplus 49 | } 50 | # endif 51 | # endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/cmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_CMAC_H 11 | # define HEADER_CMAC_H 12 | 13 | # ifndef OPENSSL_NO_CMAC 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | # include 20 | 21 | /* Opaque */ 22 | typedef struct CMAC_CTX_st CMAC_CTX; 23 | 24 | CMAC_CTX *CMAC_CTX_new(void); 25 | void CMAC_CTX_cleanup(CMAC_CTX *ctx); 26 | void CMAC_CTX_free(CMAC_CTX *ctx); 27 | EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); 28 | int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); 29 | 30 | int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, 31 | const EVP_CIPHER *cipher, ENGINE *impl); 32 | int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); 33 | int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); 34 | int CMAC_resume(CMAC_CTX *ctx); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | # endif 41 | #endif 42 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/comp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_COMP_H 11 | # define HEADER_COMP_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_COMP 16 | # include 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | 22 | 23 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 24 | const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx); 25 | int COMP_CTX_get_type(const COMP_CTX* comp); 26 | int COMP_get_type(const COMP_METHOD *meth); 27 | const char *COMP_get_name(const COMP_METHOD *meth); 28 | void COMP_CTX_free(COMP_CTX *ctx); 29 | 30 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 31 | unsigned char *in, int ilen); 32 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 33 | unsigned char *in, int ilen); 34 | 35 | COMP_METHOD *COMP_zlib(void); 36 | 37 | #if OPENSSL_API_COMPAT < 0x10100000L 38 | #define COMP_zlib_cleanup() while(0) continue 39 | #endif 40 | 41 | # ifdef HEADER_BIO_H 42 | # ifdef ZLIB 43 | const BIO_METHOD *BIO_f_zlib(void); 44 | # endif 45 | # endif 46 | 47 | /* BEGIN ERROR CODES */ 48 | /* 49 | * The following lines are auto generated by the script mkerr.pl. Any changes 50 | * made after this point may be overwritten when the script is next run. 51 | */ 52 | 53 | int ERR_load_COMP_strings(void); 54 | 55 | /* Error codes for the COMP functions. */ 56 | 57 | /* Function codes. */ 58 | # define COMP_F_BIO_ZLIB_FLUSH 99 59 | # define COMP_F_BIO_ZLIB_NEW 100 60 | # define COMP_F_BIO_ZLIB_READ 101 61 | # define COMP_F_BIO_ZLIB_WRITE 102 62 | 63 | /* Reason codes. */ 64 | # define COMP_R_ZLIB_DEFLATE_ERROR 99 65 | # define COMP_R_ZLIB_INFLATE_ERROR 100 66 | # define COMP_R_ZLIB_NOT_SUPPORTED 101 67 | 68 | # ifdef __cplusplus 69 | } 70 | # endif 71 | # endif 72 | #endif 73 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/conf_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_CONF_API_H 11 | # define HEADER_CONF_API_H 12 | 13 | # include 14 | # include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Up until OpenSSL 0.9.5a, this was new_section */ 21 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); 22 | /* Up until OpenSSL 0.9.5a, this was get_section */ 23 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); 24 | /* Up until OpenSSL 0.9.5a, this was CONF_get_section */ 25 | STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, 26 | const char *section); 27 | 28 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); 29 | char *_CONF_get_string(const CONF *conf, const char *section, 30 | const char *name); 31 | long _CONF_get_number(const CONF *conf, const char *section, 32 | const char *name); 33 | 34 | int _CONF_new_data(CONF *conf); 35 | void _CONF_free_data(CONF *conf); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/des.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_DES_H 11 | # define HEADER_DES_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_DES 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | # include 20 | 21 | typedef unsigned int DES_LONG; 22 | 23 | # ifdef OPENSSL_BUILD_SHLIBCRYPTO 24 | # undef OPENSSL_EXTERN 25 | # define OPENSSL_EXTERN OPENSSL_EXPORT 26 | # endif 27 | 28 | typedef unsigned char DES_cblock[8]; 29 | typedef /* const */ unsigned char const_DES_cblock[8]; 30 | /* 31 | * With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * and 32 | * const_DES_cblock * are incompatible pointer types. 33 | */ 34 | 35 | typedef struct DES_ks { 36 | union { 37 | DES_cblock cblock; 38 | /* 39 | * make sure things are correct size on machines with 8 byte longs 40 | */ 41 | DES_LONG deslong[2]; 42 | } ks[16]; 43 | } DES_key_schedule; 44 | 45 | # define DES_KEY_SZ (sizeof(DES_cblock)) 46 | # define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) 47 | 48 | # define DES_ENCRYPT 1 49 | # define DES_DECRYPT 0 50 | 51 | # define DES_CBC_MODE 0 52 | # define DES_PCBC_MODE 1 53 | 54 | # define DES_ecb2_encrypt(i,o,k1,k2,e) \ 55 | DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) 56 | 57 | # define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ 58 | DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) 59 | 60 | # define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ 61 | DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) 62 | 63 | # define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ 64 | DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) 65 | 66 | OPENSSL_DECLARE_GLOBAL(int, DES_check_key); /* defaults to false */ 67 | # define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key) 68 | 69 | const char *DES_options(void); 70 | void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output, 71 | DES_key_schedule *ks1, DES_key_schedule *ks2, 72 | DES_key_schedule *ks3, int enc); 73 | DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output, 74 | long length, DES_key_schedule *schedule, 75 | const_DES_cblock *ivec); 76 | /* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */ 77 | void DES_cbc_encrypt(const unsigned char *input, unsigned char *output, 78 | long length, DES_key_schedule *schedule, 79 | DES_cblock *ivec, int enc); 80 | void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output, 81 | long length, DES_key_schedule *schedule, 82 | DES_cblock *ivec, int enc); 83 | void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output, 84 | long length, DES_key_schedule *schedule, 85 | DES_cblock *ivec, const_DES_cblock *inw, 86 | const_DES_cblock *outw, int enc); 87 | void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, 88 | long length, DES_key_schedule *schedule, 89 | DES_cblock *ivec, int enc); 90 | void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output, 91 | DES_key_schedule *ks, int enc); 92 | 93 | /* 94 | * This is the DES encryption function that gets called by just about every 95 | * other DES routine in the library. You should not use this function except 96 | * to implement 'modes' of DES. I say this because the functions that call 97 | * this routine do the conversion from 'char *' to long, and this needs to be 98 | * done to make sure 'non-aligned' memory access do not occur. The 99 | * characters are loaded 'little endian'. Data is a pointer to 2 unsigned 100 | * long's and ks is the DES_key_schedule to use. enc, is non zero specifies 101 | * encryption, zero if decryption. 102 | */ 103 | void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc); 104 | 105 | /* 106 | * This functions is the same as DES_encrypt1() except that the DES initial 107 | * permutation (IP) and final permutation (FP) have been left out. As for 108 | * DES_encrypt1(), you should not use this function. It is used by the 109 | * routines in the library that implement triple DES. IP() DES_encrypt2() 110 | * DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1() 111 | * DES_encrypt1() DES_encrypt1() except faster :-). 112 | */ 113 | void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc); 114 | 115 | void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1, 116 | DES_key_schedule *ks2, DES_key_schedule *ks3); 117 | void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1, 118 | DES_key_schedule *ks2, DES_key_schedule *ks3); 119 | void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output, 120 | long length, 121 | DES_key_schedule *ks1, DES_key_schedule *ks2, 122 | DES_key_schedule *ks3, DES_cblock *ivec, int enc); 123 | void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out, 124 | long length, DES_key_schedule *ks1, 125 | DES_key_schedule *ks2, DES_key_schedule *ks3, 126 | DES_cblock *ivec, int *num, int enc); 127 | void DES_ede3_cfb_encrypt(const unsigned char *in, unsigned char *out, 128 | int numbits, long length, DES_key_schedule *ks1, 129 | DES_key_schedule *ks2, DES_key_schedule *ks3, 130 | DES_cblock *ivec, int enc); 131 | void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out, 132 | long length, DES_key_schedule *ks1, 133 | DES_key_schedule *ks2, DES_key_schedule *ks3, 134 | DES_cblock *ivec, int *num); 135 | char *DES_fcrypt(const char *buf, const char *salt, char *ret); 136 | char *DES_crypt(const char *buf, const char *salt); 137 | void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits, 138 | long length, DES_key_schedule *schedule, 139 | DES_cblock *ivec); 140 | void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output, 141 | long length, DES_key_schedule *schedule, 142 | DES_cblock *ivec, int enc); 143 | DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[], 144 | long length, int out_count, DES_cblock *seed); 145 | int DES_random_key(DES_cblock *ret); 146 | void DES_set_odd_parity(DES_cblock *key); 147 | int DES_check_key_parity(const_DES_cblock *key); 148 | int DES_is_weak_key(const_DES_cblock *key); 149 | /* 150 | * DES_set_key (= set_key = DES_key_sched = key_sched) calls 151 | * DES_set_key_checked if global variable DES_check_key is set, 152 | * DES_set_key_unchecked otherwise. 153 | */ 154 | int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule); 155 | int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule); 156 | int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule); 157 | void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule); 158 | void DES_string_to_key(const char *str, DES_cblock *key); 159 | void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2); 160 | void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out, 161 | long length, DES_key_schedule *schedule, 162 | DES_cblock *ivec, int *num, int enc); 163 | void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out, 164 | long length, DES_key_schedule *schedule, 165 | DES_cblock *ivec, int *num); 166 | 167 | # define DES_fixup_key_parity DES_set_odd_parity 168 | 169 | # ifdef __cplusplus 170 | } 171 | # endif 172 | # endif 173 | 174 | #endif 175 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/dtls1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_DTLS1_H 11 | # define HEADER_DTLS1_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | # define DTLS1_VERSION 0xFEFF 18 | # define DTLS1_2_VERSION 0xFEFD 19 | # define DTLS_MIN_VERSION DTLS1_VERSION 20 | # define DTLS_MAX_VERSION DTLS1_2_VERSION 21 | # define DTLS1_VERSION_MAJOR 0xFE 22 | 23 | # define DTLS1_BAD_VER 0x0100 24 | 25 | /* Special value for method supporting multiple versions */ 26 | # define DTLS_ANY_VERSION 0x1FFFF 27 | 28 | /* lengths of messages */ 29 | # define DTLS1_COOKIE_LENGTH 256 30 | 31 | # define DTLS1_RT_HEADER_LENGTH 13 32 | 33 | # define DTLS1_HM_HEADER_LENGTH 12 34 | 35 | # define DTLS1_HM_BAD_FRAGMENT -2 36 | # define DTLS1_HM_FRAGMENT_RETRY -3 37 | 38 | # define DTLS1_CCS_HEADER_LENGTH 1 39 | 40 | # ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE 41 | # define DTLS1_AL_HEADER_LENGTH 7 42 | # else 43 | # define DTLS1_AL_HEADER_LENGTH 2 44 | # endif 45 | 46 | 47 | /* Timeout multipliers (timeout slice is defined in apps/timeouts.h */ 48 | # define DTLS1_TMO_READ_COUNT 2 49 | # define DTLS1_TMO_WRITE_COUNT 2 50 | 51 | # define DTLS1_TMO_ALERT_COUNT 12 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | #endif 57 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_EBCDIC_H 11 | # define HEADER_EBCDIC_H 12 | 13 | # include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /* Avoid name clashes with other applications */ 20 | # define os_toascii _openssl_os_toascii 21 | # define os_toebcdic _openssl_os_toebcdic 22 | # define ebcdic2ascii _openssl_ebcdic2ascii 23 | # define ascii2ebcdic _openssl_ascii2ebcdic 24 | 25 | extern const unsigned char os_toascii[256]; 26 | extern const unsigned char os_toebcdic[256]; 27 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 28 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/ecdh.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/ecdsa.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/hmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_HMAC_H 11 | # define HEADER_HMAC_H 12 | 13 | # include 14 | 15 | # include 16 | 17 | # define HMAC_MAX_MD_CBLOCK 128/* largest known is SHA512 */ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | size_t HMAC_size(const HMAC_CTX *e); 24 | HMAC_CTX *HMAC_CTX_new(void); 25 | int HMAC_CTX_reset(HMAC_CTX *ctx); 26 | void HMAC_CTX_free(HMAC_CTX *ctx); 27 | 28 | DEPRECATEDIN_1_1_0(__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, 29 | const EVP_MD *md)) 30 | 31 | /*__owur*/ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, 32 | const EVP_MD *md, ENGINE *impl); 33 | /*__owur*/ int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, 34 | size_t len); 35 | /*__owur*/ int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, 36 | unsigned int *len); 37 | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, 38 | const unsigned char *d, size_t n, unsigned char *md, 39 | unsigned int *md_len); 40 | __owur int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); 41 | 42 | void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); 43 | const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/idea.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_IDEA_H 11 | # define HEADER_IDEA_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_IDEA 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | typedef unsigned int IDEA_INT; 21 | 22 | # define IDEA_ENCRYPT 1 23 | # define IDEA_DECRYPT 0 24 | 25 | # define IDEA_BLOCK 8 26 | # define IDEA_KEY_LENGTH 16 27 | 28 | typedef struct idea_key_st { 29 | IDEA_INT data[9][6]; 30 | } IDEA_KEY_SCHEDULE; 31 | 32 | const char *IDEA_options(void); 33 | void IDEA_ecb_encrypt(const unsigned char *in, unsigned char *out, 34 | IDEA_KEY_SCHEDULE *ks); 35 | void IDEA_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); 36 | void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); 37 | void IDEA_cbc_encrypt(const unsigned char *in, unsigned char *out, 38 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 39 | int enc); 40 | void IDEA_cfb64_encrypt(const unsigned char *in, unsigned char *out, 41 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 42 | int *num, int enc); 43 | void IDEA_ofb64_encrypt(const unsigned char *in, unsigned char *out, 44 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 45 | int *num); 46 | void IDEA_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); 47 | 48 | # if OPENSSL_API_COMPAT < 0x10100000L 49 | # define idea_options IDEA_options 50 | # define idea_ecb_encrypt IDEA_ecb_encrypt 51 | # define idea_set_encrypt_key IDEA_set_encrypt_key 52 | # define idea_set_decrypt_key IDEA_set_decrypt_key 53 | # define idea_cbc_encrypt IDEA_cbc_encrypt 54 | # define idea_cfb64_encrypt IDEA_cfb64_encrypt 55 | # define idea_ofb64_encrypt IDEA_ofb64_encrypt 56 | # define idea_encrypt IDEA_encrypt 57 | # endif 58 | 59 | # ifdef __cplusplus 60 | } 61 | # endif 62 | # endif 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/kdf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_KDF_H 11 | # define HEADER_KDF_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | # define EVP_PKEY_CTRL_TLS_MD (EVP_PKEY_ALG_CTRL) 18 | # define EVP_PKEY_CTRL_TLS_SECRET (EVP_PKEY_ALG_CTRL + 1) 19 | # define EVP_PKEY_CTRL_TLS_SEED (EVP_PKEY_ALG_CTRL + 2) 20 | # define EVP_PKEY_CTRL_HKDF_MD (EVP_PKEY_ALG_CTRL + 3) 21 | # define EVP_PKEY_CTRL_HKDF_SALT (EVP_PKEY_ALG_CTRL + 4) 22 | # define EVP_PKEY_CTRL_HKDF_KEY (EVP_PKEY_ALG_CTRL + 5) 23 | # define EVP_PKEY_CTRL_HKDF_INFO (EVP_PKEY_ALG_CTRL + 6) 24 | 25 | # define EVP_PKEY_CTX_set_tls1_prf_md(pctx, md) \ 26 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 27 | EVP_PKEY_CTRL_TLS_MD, 0, (void *)md) 28 | 29 | # define EVP_PKEY_CTX_set1_tls1_prf_secret(pctx, sec, seclen) \ 30 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 31 | EVP_PKEY_CTRL_TLS_SECRET, seclen, (void *)sec) 32 | 33 | # define EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, seed, seedlen) \ 34 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 35 | EVP_PKEY_CTRL_TLS_SEED, seedlen, (void *)seed) 36 | 37 | # define EVP_PKEY_CTX_set_hkdf_md(pctx, md) \ 38 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 39 | EVP_PKEY_CTRL_HKDF_MD, 0, (void *)md) 40 | 41 | # define EVP_PKEY_CTX_set1_hkdf_salt(pctx, salt, saltlen) \ 42 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 43 | EVP_PKEY_CTRL_HKDF_SALT, saltlen, (void *)salt) 44 | 45 | # define EVP_PKEY_CTX_set1_hkdf_key(pctx, key, keylen) \ 46 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 47 | EVP_PKEY_CTRL_HKDF_KEY, keylen, (void *)key) 48 | 49 | # define EVP_PKEY_CTX_add1_hkdf_info(pctx, info, infolen) \ 50 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 51 | EVP_PKEY_CTRL_HKDF_INFO, infolen, (void *)info) 52 | 53 | /* BEGIN ERROR CODES */ 54 | /* 55 | * The following lines are auto generated by the script mkerr.pl. Any changes 56 | * made after this point may be overwritten when the script is next run. 57 | */ 58 | 59 | int ERR_load_KDF_strings(void); 60 | 61 | /* Error codes for the KDF functions. */ 62 | 63 | /* Function codes. */ 64 | # define KDF_F_PKEY_TLS1_PRF_CTRL_STR 100 65 | # define KDF_F_PKEY_TLS1_PRF_DERIVE 101 66 | 67 | /* Reason codes. */ 68 | # define KDF_R_INVALID_DIGEST 100 69 | # define KDF_R_MISSING_PARAMETER 101 70 | # define KDF_R_VALUE_MISSING 102 71 | 72 | # ifdef __cplusplus 73 | } 74 | # endif 75 | #endif 76 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/md2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_MD2_H 11 | # define HEADER_MD2_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_MD2 16 | # include 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | typedef unsigned char MD2_INT; 22 | 23 | # define MD2_DIGEST_LENGTH 16 24 | # define MD2_BLOCK 16 25 | 26 | typedef struct MD2state_st { 27 | unsigned int num; 28 | unsigned char data[MD2_BLOCK]; 29 | MD2_INT cksm[MD2_BLOCK]; 30 | MD2_INT state[MD2_BLOCK]; 31 | } MD2_CTX; 32 | 33 | const char *MD2_options(void); 34 | int MD2_Init(MD2_CTX *c); 35 | int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); 36 | int MD2_Final(unsigned char *md, MD2_CTX *c); 37 | unsigned char *MD2(const unsigned char *d, size_t n, unsigned char *md); 38 | 39 | # ifdef __cplusplus 40 | } 41 | # endif 42 | # endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/md4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_MD4_H 11 | # define HEADER_MD4_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_MD4 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | /*- 23 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 24 | * ! MD4_LONG has to be at least 32 bits wide. ! 25 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 26 | */ 27 | # define MD4_LONG unsigned int 28 | 29 | # define MD4_CBLOCK 64 30 | # define MD4_LBLOCK (MD4_CBLOCK/4) 31 | # define MD4_DIGEST_LENGTH 16 32 | 33 | typedef struct MD4state_st { 34 | MD4_LONG A, B, C, D; 35 | MD4_LONG Nl, Nh; 36 | MD4_LONG data[MD4_LBLOCK]; 37 | unsigned int num; 38 | } MD4_CTX; 39 | 40 | int MD4_Init(MD4_CTX *c); 41 | int MD4_Update(MD4_CTX *c, const void *data, size_t len); 42 | int MD4_Final(unsigned char *md, MD4_CTX *c); 43 | unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); 44 | void MD4_Transform(MD4_CTX *c, const unsigned char *b); 45 | 46 | # ifdef __cplusplus 47 | } 48 | # endif 49 | # endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_MD5_H 11 | # define HEADER_MD5_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_MD5 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | /* 23 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 24 | * ! MD5_LONG has to be at least 32 bits wide. ! 25 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 26 | */ 27 | # define MD5_LONG unsigned int 28 | 29 | # define MD5_CBLOCK 64 30 | # define MD5_LBLOCK (MD5_CBLOCK/4) 31 | # define MD5_DIGEST_LENGTH 16 32 | 33 | typedef struct MD5state_st { 34 | MD5_LONG A, B, C, D; 35 | MD5_LONG Nl, Nh; 36 | MD5_LONG data[MD5_LBLOCK]; 37 | unsigned int num; 38 | } MD5_CTX; 39 | 40 | int MD5_Init(MD5_CTX *c); 41 | int MD5_Update(MD5_CTX *c, const void *data, size_t len); 42 | int MD5_Final(unsigned char *md, MD5_CTX *c); 43 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); 44 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); 45 | # ifdef __cplusplus 46 | } 47 | # endif 48 | # endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/mdc2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_MDC2_H 11 | # define HEADER_MDC2_H 12 | 13 | # include 14 | 15 | #ifndef OPENSSL_NO_MDC2 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | # define MDC2_BLOCK 8 23 | # define MDC2_DIGEST_LENGTH 16 24 | 25 | typedef struct mdc2_ctx_st { 26 | unsigned int num; 27 | unsigned char data[MDC2_BLOCK]; 28 | DES_cblock h, hh; 29 | int pad_type; /* either 1 or 2, default 1 */ 30 | } MDC2_CTX; 31 | 32 | int MDC2_Init(MDC2_CTX *c); 33 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); 34 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); 35 | unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md); 36 | 37 | # ifdef __cplusplus 38 | } 39 | # endif 40 | # endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/opensslconf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING: do not edit! 3 | * Generated by makefile from ..\..\openssl-1.1.0f\include\openssl\opensslconf.h.in 4 | * 5 | * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. 6 | * 7 | * Licensed under the OpenSSL license (the "License"). You may not use 8 | * this file except in compliance with the License. You can obtain a copy 9 | * in the file LICENSE in the source distribution or at 10 | * https://www.openssl.org/source/license.html 11 | */ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #ifdef OPENSSL_ALGORITHM_DEFINES 18 | # error OPENSSL_ALGORITHM_DEFINES no longer supported 19 | #endif 20 | 21 | /* 22 | * OpenSSL was configured with the following options: 23 | */ 24 | 25 | #ifndef OPENSSL_SYS_WIN32 26 | # define OPENSSL_SYS_WIN32 1 27 | #endif 28 | #ifndef OPENSSL_NO_MD2 29 | # define OPENSSL_NO_MD2 30 | #endif 31 | #ifndef OPENSSL_NO_RC5 32 | # define OPENSSL_NO_RC5 33 | #endif 34 | #ifndef OPENSSL_THREADS 35 | # define OPENSSL_THREADS 36 | #endif 37 | #ifndef OPENSSL_NO_ASAN 38 | # define OPENSSL_NO_ASAN 39 | #endif 40 | #ifndef OPENSSL_NO_ASM 41 | # define OPENSSL_NO_ASM 42 | #endif 43 | #ifndef OPENSSL_NO_CRYPTO_MDEBUG 44 | # define OPENSSL_NO_CRYPTO_MDEBUG 45 | #endif 46 | #ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE 47 | # define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE 48 | #endif 49 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 50 | # define OPENSSL_NO_EC_NISTP_64_GCC_128 51 | #endif 52 | #ifndef OPENSSL_NO_EGD 53 | # define OPENSSL_NO_EGD 54 | #endif 55 | #ifndef OPENSSL_NO_FUZZ_AFL 56 | # define OPENSSL_NO_FUZZ_AFL 57 | #endif 58 | #ifndef OPENSSL_NO_FUZZ_LIBFUZZER 59 | # define OPENSSL_NO_FUZZ_LIBFUZZER 60 | #endif 61 | #ifndef OPENSSL_NO_HEARTBEATS 62 | # define OPENSSL_NO_HEARTBEATS 63 | #endif 64 | #ifndef OPENSSL_NO_MSAN 65 | # define OPENSSL_NO_MSAN 66 | #endif 67 | #ifndef OPENSSL_NO_SCTP 68 | # define OPENSSL_NO_SCTP 69 | #endif 70 | #ifndef OPENSSL_NO_SSL_TRACE 71 | # define OPENSSL_NO_SSL_TRACE 72 | #endif 73 | #ifndef OPENSSL_NO_SSL3 74 | # define OPENSSL_NO_SSL3 75 | #endif 76 | #ifndef OPENSSL_NO_SSL3_METHOD 77 | # define OPENSSL_NO_SSL3_METHOD 78 | #endif 79 | #ifndef OPENSSL_NO_UBSAN 80 | # define OPENSSL_NO_UBSAN 81 | #endif 82 | #ifndef OPENSSL_NO_UNIT_TEST 83 | # define OPENSSL_NO_UNIT_TEST 84 | #endif 85 | #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS 86 | # define OPENSSL_NO_WEAK_SSL_CIPHERS 87 | #endif 88 | #ifndef OPENSSL_NO_AFALGENG 89 | # define OPENSSL_NO_AFALGENG 90 | #endif 91 | 92 | 93 | /* 94 | * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers 95 | * don't like that. This will hopefully silence them. 96 | */ 97 | #define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; 98 | 99 | /* 100 | * Applications should use -DOPENSSL_API_COMPAT= to suppress the 101 | * declarations of functions deprecated in or before . Otherwise, they 102 | * still won't see them if the library has been built to disable deprecated 103 | * functions. 104 | */ 105 | #if defined(OPENSSL_NO_DEPRECATED) 106 | # define DECLARE_DEPRECATED(f) 107 | #elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) 108 | # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); 109 | #else 110 | # define DECLARE_DEPRECATED(f) f; 111 | #endif 112 | 113 | #ifndef OPENSSL_FILE 114 | # ifdef OPENSSL_NO_FILENAMES 115 | # define OPENSSL_FILE "" 116 | # define OPENSSL_LINE 0 117 | # else 118 | # define OPENSSL_FILE __FILE__ 119 | # define OPENSSL_LINE __LINE__ 120 | # endif 121 | #endif 122 | 123 | #ifndef OPENSSL_MIN_API 124 | # define OPENSSL_MIN_API 0 125 | #endif 126 | 127 | #if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API 128 | # undef OPENSSL_API_COMPAT 129 | # define OPENSSL_API_COMPAT OPENSSL_MIN_API 130 | #endif 131 | 132 | #if OPENSSL_API_COMPAT < 0x10100000L 133 | # define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) 134 | #else 135 | # define DEPRECATEDIN_1_1_0(f) 136 | #endif 137 | 138 | #if OPENSSL_API_COMPAT < 0x10000000L 139 | # define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) 140 | #else 141 | # define DEPRECATEDIN_1_0_0(f) 142 | #endif 143 | 144 | #if OPENSSL_API_COMPAT < 0x00908000L 145 | # define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) 146 | #else 147 | # define DEPRECATEDIN_0_9_8(f) 148 | #endif 149 | 150 | 151 | 152 | /* Generate 80386 code? */ 153 | #undef I386_ONLY 154 | 155 | #undef OPENSSL_UNISTD 156 | #define OPENSSL_UNISTD 157 | 158 | #define OPENSSL_EXPORT_VAR_AS_FUNCTION 159 | 160 | /* 161 | * The following are cipher-specific, but are part of the public API. 162 | */ 163 | #if !defined(OPENSSL_SYS_UEFI) 164 | # define BN_LLONG 165 | /* Only one for the following should be defined */ 166 | # undef SIXTY_FOUR_BIT_LONG 167 | # undef SIXTY_FOUR_BIT 168 | # define THIRTY_TWO_BIT 169 | #endif 170 | 171 | #define RC4_INT unsigned int 172 | 173 | #ifdef __cplusplus 174 | } 175 | #endif 176 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/opensslv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_OPENSSLV_H 11 | # define HEADER_OPENSSLV_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /*- 18 | * Numeric release version identifier: 19 | * MNNFFPPS: major minor fix patch status 20 | * The status nibble has one of the values 0 for development, 1 to e for betas 21 | * 1 to 14, and f for release. The patch level is exactly that. 22 | * For example: 23 | * 0.9.3-dev 0x00903000 24 | * 0.9.3-beta1 0x00903001 25 | * 0.9.3-beta2-dev 0x00903002 26 | * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) 27 | * 0.9.3 0x0090300f 28 | * 0.9.3a 0x0090301f 29 | * 0.9.4 0x0090400f 30 | * 1.2.3z 0x102031af 31 | * 32 | * For continuity reasons (because 0.9.5 is already out, and is coded 33 | * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level 34 | * part is slightly different, by setting the highest bit. This means 35 | * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start 36 | * with 0x0090600S... 37 | * 38 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) 39 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for 40 | * major minor fix final patch/beta) 41 | */ 42 | # define OPENSSL_VERSION_NUMBER 0x1010006fL 43 | # ifdef OPENSSL_FIPS 44 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0f-fips 25 May 2017" 45 | # else 46 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0f 25 May 2017" 47 | # endif 48 | 49 | /*- 50 | * The macros below are to be used for shared library (.so, .dll, ...) 51 | * versioning. That kind of versioning works a bit differently between 52 | * operating systems. The most usual scheme is to set a major and a minor 53 | * number, and have the runtime loader check that the major number is equal 54 | * to what it was at application link time, while the minor number has to 55 | * be greater or equal to what it was at application link time. With this 56 | * scheme, the version number is usually part of the file name, like this: 57 | * 58 | * libcrypto.so.0.9 59 | * 60 | * Some unixen also make a softlink with the major version number only: 61 | * 62 | * libcrypto.so.0 63 | * 64 | * On Tru64 and IRIX 6.x it works a little bit differently. There, the 65 | * shared library version is stored in the file, and is actually a series 66 | * of versions, separated by colons. The rightmost version present in the 67 | * library when linking an application is stored in the application to be 68 | * matched at run time. When the application is run, a check is done to 69 | * see if the library version stored in the application matches any of the 70 | * versions in the version string of the library itself. 71 | * This version string can be constructed in any way, depending on what 72 | * kind of matching is desired. However, to implement the same scheme as 73 | * the one used in the other unixen, all compatible versions, from lowest 74 | * to highest, should be part of the string. Consecutive builds would 75 | * give the following versions strings: 76 | * 77 | * 3.0 78 | * 3.0:3.1 79 | * 3.0:3.1:3.2 80 | * 4.0 81 | * 4.0:4.1 82 | * 83 | * Notice how version 4 is completely incompatible with version, and 84 | * therefore give the breach you can see. 85 | * 86 | * There may be other schemes as well that I haven't yet discovered. 87 | * 88 | * So, here's the way it works here: first of all, the library version 89 | * number doesn't need at all to match the overall OpenSSL version. 90 | * However, it's nice and more understandable if it actually does. 91 | * The current library version is stored in the macro SHLIB_VERSION_NUMBER, 92 | * which is just a piece of text in the format "M.m.e" (Major, minor, edit). 93 | * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, 94 | * we need to keep a history of version numbers, which is done in the 95 | * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and 96 | * should only keep the versions that are binary compatible with the current. 97 | */ 98 | # define SHLIB_VERSION_HISTORY "" 99 | # define SHLIB_VERSION_NUMBER "1.1" 100 | 101 | 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | #endif /* HEADER_OPENSSLV_H */ 106 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/ossl_typ.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_OPENSSL_TYPES_H 11 | # define HEADER_OPENSSL_TYPES_H 12 | 13 | #include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | # include 20 | 21 | # ifdef NO_ASN1_TYPEDEFS 22 | # define ASN1_INTEGER ASN1_STRING 23 | # define ASN1_ENUMERATED ASN1_STRING 24 | # define ASN1_BIT_STRING ASN1_STRING 25 | # define ASN1_OCTET_STRING ASN1_STRING 26 | # define ASN1_PRINTABLESTRING ASN1_STRING 27 | # define ASN1_T61STRING ASN1_STRING 28 | # define ASN1_IA5STRING ASN1_STRING 29 | # define ASN1_UTCTIME ASN1_STRING 30 | # define ASN1_GENERALIZEDTIME ASN1_STRING 31 | # define ASN1_TIME ASN1_STRING 32 | # define ASN1_GENERALSTRING ASN1_STRING 33 | # define ASN1_UNIVERSALSTRING ASN1_STRING 34 | # define ASN1_BMPSTRING ASN1_STRING 35 | # define ASN1_VISIBLESTRING ASN1_STRING 36 | # define ASN1_UTF8STRING ASN1_STRING 37 | # define ASN1_BOOLEAN int 38 | # define ASN1_NULL int 39 | # else 40 | typedef struct asn1_string_st ASN1_INTEGER; 41 | typedef struct asn1_string_st ASN1_ENUMERATED; 42 | typedef struct asn1_string_st ASN1_BIT_STRING; 43 | typedef struct asn1_string_st ASN1_OCTET_STRING; 44 | typedef struct asn1_string_st ASN1_PRINTABLESTRING; 45 | typedef struct asn1_string_st ASN1_T61STRING; 46 | typedef struct asn1_string_st ASN1_IA5STRING; 47 | typedef struct asn1_string_st ASN1_GENERALSTRING; 48 | typedef struct asn1_string_st ASN1_UNIVERSALSTRING; 49 | typedef struct asn1_string_st ASN1_BMPSTRING; 50 | typedef struct asn1_string_st ASN1_UTCTIME; 51 | typedef struct asn1_string_st ASN1_TIME; 52 | typedef struct asn1_string_st ASN1_GENERALIZEDTIME; 53 | typedef struct asn1_string_st ASN1_VISIBLESTRING; 54 | typedef struct asn1_string_st ASN1_UTF8STRING; 55 | typedef struct asn1_string_st ASN1_STRING; 56 | typedef int ASN1_BOOLEAN; 57 | typedef int ASN1_NULL; 58 | # endif 59 | 60 | typedef struct asn1_object_st ASN1_OBJECT; 61 | 62 | typedef struct ASN1_ITEM_st ASN1_ITEM; 63 | typedef struct asn1_pctx_st ASN1_PCTX; 64 | typedef struct asn1_sctx_st ASN1_SCTX; 65 | 66 | # ifdef _WIN32 67 | # undef X509_NAME 68 | # undef X509_EXTENSIONS 69 | # undef PKCS7_ISSUER_AND_SERIAL 70 | # undef PKCS7_SIGNER_INFO 71 | # undef OCSP_REQUEST 72 | # undef OCSP_RESPONSE 73 | # endif 74 | 75 | # ifdef BIGNUM 76 | # undef BIGNUM 77 | # endif 78 | struct dane_st; 79 | typedef struct bio_st BIO; 80 | typedef struct bignum_st BIGNUM; 81 | typedef struct bignum_ctx BN_CTX; 82 | typedef struct bn_blinding_st BN_BLINDING; 83 | typedef struct bn_mont_ctx_st BN_MONT_CTX; 84 | typedef struct bn_recp_ctx_st BN_RECP_CTX; 85 | typedef struct bn_gencb_st BN_GENCB; 86 | 87 | typedef struct buf_mem_st BUF_MEM; 88 | 89 | typedef struct evp_cipher_st EVP_CIPHER; 90 | typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; 91 | typedef struct evp_md_st EVP_MD; 92 | typedef struct evp_md_ctx_st EVP_MD_CTX; 93 | typedef struct evp_pkey_st EVP_PKEY; 94 | 95 | typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD; 96 | 97 | typedef struct evp_pkey_method_st EVP_PKEY_METHOD; 98 | typedef struct evp_pkey_ctx_st EVP_PKEY_CTX; 99 | 100 | typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX; 101 | 102 | typedef struct hmac_ctx_st HMAC_CTX; 103 | 104 | typedef struct dh_st DH; 105 | typedef struct dh_method DH_METHOD; 106 | 107 | typedef struct dsa_st DSA; 108 | typedef struct dsa_method DSA_METHOD; 109 | 110 | typedef struct rsa_st RSA; 111 | typedef struct rsa_meth_st RSA_METHOD; 112 | 113 | typedef struct ec_key_st EC_KEY; 114 | typedef struct ec_key_method_st EC_KEY_METHOD; 115 | 116 | typedef struct rand_meth_st RAND_METHOD; 117 | 118 | typedef struct ssl_dane_st SSL_DANE; 119 | typedef struct x509_st X509; 120 | typedef struct X509_algor_st X509_ALGOR; 121 | typedef struct X509_crl_st X509_CRL; 122 | typedef struct x509_crl_method_st X509_CRL_METHOD; 123 | typedef struct x509_revoked_st X509_REVOKED; 124 | typedef struct X509_name_st X509_NAME; 125 | typedef struct X509_pubkey_st X509_PUBKEY; 126 | typedef struct x509_store_st X509_STORE; 127 | typedef struct x509_store_ctx_st X509_STORE_CTX; 128 | 129 | typedef struct x509_object_st X509_OBJECT; 130 | typedef struct x509_lookup_st X509_LOOKUP; 131 | typedef struct x509_lookup_method_st X509_LOOKUP_METHOD; 132 | typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM; 133 | 134 | typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO; 135 | 136 | typedef struct v3_ext_ctx X509V3_CTX; 137 | typedef struct conf_st CONF; 138 | typedef struct ossl_init_settings_st OPENSSL_INIT_SETTINGS; 139 | 140 | typedef struct ui_st UI; 141 | typedef struct ui_method_st UI_METHOD; 142 | 143 | typedef struct engine_st ENGINE; 144 | typedef struct ssl_st SSL; 145 | typedef struct ssl_ctx_st SSL_CTX; 146 | 147 | typedef struct comp_ctx_st COMP_CTX; 148 | typedef struct comp_method_st COMP_METHOD; 149 | 150 | typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; 151 | typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; 152 | typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; 153 | typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE; 154 | 155 | typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID; 156 | typedef struct DIST_POINT_st DIST_POINT; 157 | typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT; 158 | typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS; 159 | 160 | typedef struct crypto_ex_data_st CRYPTO_EX_DATA; 161 | 162 | typedef struct ocsp_req_ctx_st OCSP_REQ_CTX; 163 | typedef struct ocsp_response_st OCSP_RESPONSE; 164 | typedef struct ocsp_responder_id_st OCSP_RESPID; 165 | 166 | typedef struct sct_st SCT; 167 | typedef struct sct_ctx_st SCT_CTX; 168 | typedef struct ctlog_st CTLOG; 169 | typedef struct ctlog_store_st CTLOG_STORE; 170 | typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX; 171 | 172 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \ 173 | defined(INTMAX_MAX) && defined(UINTMAX_MAX) 174 | typedef intmax_t ossl_intmax_t; 175 | typedef uintmax_t ossl_uintmax_t; 176 | #else 177 | /* 178 | * Not long long, because the C-library can only be expected to provide 179 | * strtoll(), strtoull() at the same time as intmax_t and strtoimax(), 180 | * strtoumax(). Since we use these for parsing arguments, we need the 181 | * conversion functions, not just the sizes. 182 | */ 183 | typedef long ossl_intmax_t; 184 | typedef unsigned long ossl_uintmax_t; 185 | #endif 186 | 187 | #ifdef __cplusplus 188 | } 189 | #endif 190 | #endif /* def HEADER_OPENSSL_TYPES_H */ 191 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/pem2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifndef HEADER_PEM_H 15 | int ERR_load_PEM_strings(void); 16 | #endif 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/rand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RAND_H 11 | # define HEADER_RAND_H 12 | 13 | # include 14 | # include 15 | # include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Already defined in ossl_typ.h */ 22 | /* typedef struct rand_meth_st RAND_METHOD; */ 23 | 24 | struct rand_meth_st { 25 | int (*seed) (const void *buf, int num); 26 | int (*bytes) (unsigned char *buf, int num); 27 | void (*cleanup) (void); 28 | int (*add) (const void *buf, int num, double entropy); 29 | int (*pseudorand) (unsigned char *buf, int num); 30 | int (*status) (void); 31 | }; 32 | 33 | # ifdef BN_DEBUG 34 | extern int rand_predictable; 35 | # endif 36 | 37 | int RAND_set_rand_method(const RAND_METHOD *meth); 38 | const RAND_METHOD *RAND_get_rand_method(void); 39 | # ifndef OPENSSL_NO_ENGINE 40 | int RAND_set_rand_engine(ENGINE *engine); 41 | # endif 42 | RAND_METHOD *RAND_OpenSSL(void); 43 | #if OPENSSL_API_COMPAT < 0x10100000L 44 | # define RAND_cleanup() while(0) continue 45 | #endif 46 | int RAND_bytes(unsigned char *buf, int num); 47 | DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num)) 48 | void RAND_seed(const void *buf, int num); 49 | #if defined(__ANDROID__) && defined(__NDK_FPABI__) 50 | __NDK_FPABI__ /* __attribute__((pcs("aapcs"))) on ARM */ 51 | #endif 52 | void RAND_add(const void *buf, int num, double entropy); 53 | int RAND_load_file(const char *file, long max_bytes); 54 | int RAND_write_file(const char *file); 55 | const char *RAND_file_name(char *file, size_t num); 56 | int RAND_status(void); 57 | # ifndef OPENSSL_NO_EGD 58 | int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); 59 | int RAND_egd(const char *path); 60 | int RAND_egd_bytes(const char *path, int bytes); 61 | # endif 62 | int RAND_poll(void); 63 | 64 | #if defined(_WIN32) && (defined(BASETYPES) || defined(_WINDEF_H)) 65 | /* application has to include in order to use these */ 66 | DEPRECATEDIN_1_1_0(void RAND_screen(void)) 67 | DEPRECATEDIN_1_1_0(int RAND_event(UINT, WPARAM, LPARAM)) 68 | #endif 69 | 70 | /* BEGIN ERROR CODES */ 71 | /* 72 | * The following lines are auto generated by the script mkerr.pl. Any changes 73 | * made after this point may be overwritten when the script is next run. 74 | */ 75 | 76 | int ERR_load_RAND_strings(void); 77 | 78 | /* Error codes for the RAND functions. */ 79 | 80 | /* Function codes. */ 81 | # define RAND_F_RAND_BYTES 100 82 | 83 | /* Reason codes. */ 84 | # define RAND_R_PRNG_NOT_SEEDED 100 85 | 86 | # ifdef __cplusplus 87 | } 88 | # endif 89 | #endif 90 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/rc2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RC2_H 11 | # define HEADER_RC2_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_RC2 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | typedef unsigned int RC2_INT; 21 | 22 | # define RC2_ENCRYPT 1 23 | # define RC2_DECRYPT 0 24 | 25 | # define RC2_BLOCK 8 26 | # define RC2_KEY_LENGTH 16 27 | 28 | typedef struct rc2_key_st { 29 | RC2_INT data[64]; 30 | } RC2_KEY; 31 | 32 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits); 33 | void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out, 34 | RC2_KEY *key, int enc); 35 | void RC2_encrypt(unsigned long *data, RC2_KEY *key); 36 | void RC2_decrypt(unsigned long *data, RC2_KEY *key); 37 | void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 38 | RC2_KEY *ks, unsigned char *iv, int enc); 39 | void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, 40 | long length, RC2_KEY *schedule, unsigned char *ivec, 41 | int *num, int enc); 42 | void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, 43 | long length, RC2_KEY *schedule, unsigned char *ivec, 44 | int *num); 45 | 46 | # ifdef __cplusplus 47 | } 48 | # endif 49 | # endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/rc4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RC4_H 11 | # define HEADER_RC4_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_RC4 16 | # include 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | typedef struct rc4_key_st { 22 | RC4_INT x, y; 23 | RC4_INT data[256]; 24 | } RC4_KEY; 25 | 26 | const char *RC4_options(void); 27 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 28 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, 29 | unsigned char *outdata); 30 | 31 | # ifdef __cplusplus 32 | } 33 | # endif 34 | # endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/rc5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RC5_H 11 | # define HEADER_RC5_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_RC5 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | # define RC5_ENCRYPT 1 21 | # define RC5_DECRYPT 0 22 | 23 | # define RC5_32_INT unsigned int 24 | 25 | # define RC5_32_BLOCK 8 26 | # define RC5_32_KEY_LENGTH 16/* This is a default, max is 255 */ 27 | 28 | /* 29 | * This are the only values supported. Tweak the code if you want more The 30 | * most supported modes will be RC5-32/12/16 RC5-32/16/8 31 | */ 32 | # define RC5_8_ROUNDS 8 33 | # define RC5_12_ROUNDS 12 34 | # define RC5_16_ROUNDS 16 35 | 36 | typedef struct rc5_key_st { 37 | /* Number of rounds */ 38 | int rounds; 39 | RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)]; 40 | } RC5_32_KEY; 41 | 42 | void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data, 43 | int rounds); 44 | void RC5_32_ecb_encrypt(const unsigned char *in, unsigned char *out, 45 | RC5_32_KEY *key, int enc); 46 | void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key); 47 | void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key); 48 | void RC5_32_cbc_encrypt(const unsigned char *in, unsigned char *out, 49 | long length, RC5_32_KEY *ks, unsigned char *iv, 50 | int enc); 51 | void RC5_32_cfb64_encrypt(const unsigned char *in, unsigned char *out, 52 | long length, RC5_32_KEY *schedule, 53 | unsigned char *ivec, int *num, int enc); 54 | void RC5_32_ofb64_encrypt(const unsigned char *in, unsigned char *out, 55 | long length, RC5_32_KEY *schedule, 56 | unsigned char *ivec, int *num); 57 | 58 | # ifdef __cplusplus 59 | } 60 | # endif 61 | # endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/ripemd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RIPEMD_H 11 | # define HEADER_RIPEMD_H 12 | 13 | # include 14 | 15 | #ifndef OPENSSL_NO_RMD160 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | # define RIPEMD160_LONG unsigned int 23 | 24 | # define RIPEMD160_CBLOCK 64 25 | # define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) 26 | # define RIPEMD160_DIGEST_LENGTH 20 27 | 28 | typedef struct RIPEMD160state_st { 29 | RIPEMD160_LONG A, B, C, D, E; 30 | RIPEMD160_LONG Nl, Nh; 31 | RIPEMD160_LONG data[RIPEMD160_LBLOCK]; 32 | unsigned int num; 33 | } RIPEMD160_CTX; 34 | 35 | int RIPEMD160_Init(RIPEMD160_CTX *c); 36 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); 37 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); 38 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md); 39 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); 40 | 41 | # ifdef __cplusplus 42 | } 43 | # endif 44 | # endif 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/safestack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_SAFESTACK_H 11 | # define HEADER_SAFESTACK_H 12 | 13 | # include 14 | # include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | # define STACK_OF(type) struct stack_st_##type 21 | 22 | # define SKM_DEFINE_STACK_OF(t1, t2, t3) \ 23 | STACK_OF(t1); \ 24 | typedef int (*sk_##t1##_compfunc)(const t3 * const *a, const t3 *const *b); \ 25 | typedef void (*sk_##t1##_freefunc)(t3 *a); \ 26 | typedef t3 * (*sk_##t1##_copyfunc)(const t3 *a); \ 27 | static ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk) \ 28 | { \ 29 | return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \ 30 | } \ 31 | static ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1) *sk, int idx) \ 32 | { \ 33 | return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \ 34 | } \ 35 | static ossl_inline STACK_OF(t1) *sk_##t1##_new(sk_##t1##_compfunc compare) \ 36 | { \ 37 | return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \ 38 | } \ 39 | static ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void) \ 40 | { \ 41 | return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \ 42 | } \ 43 | static ossl_inline void sk_##t1##_free(STACK_OF(t1) *sk) \ 44 | { \ 45 | OPENSSL_sk_free((OPENSSL_STACK *)sk); \ 46 | } \ 47 | static ossl_inline void sk_##t1##_zero(STACK_OF(t1) *sk) \ 48 | { \ 49 | OPENSSL_sk_zero((OPENSSL_STACK *)sk); \ 50 | } \ 51 | static ossl_inline t2 *sk_##t1##_delete(STACK_OF(t1) *sk, int i) \ 52 | { \ 53 | return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \ 54 | } \ 55 | static ossl_inline t2 *sk_##t1##_delete_ptr(STACK_OF(t1) *sk, t2 *ptr) \ 56 | { \ 57 | return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, \ 58 | (const void *)ptr); \ 59 | } \ 60 | static ossl_inline int sk_##t1##_push(STACK_OF(t1) *sk, t2 *ptr) \ 61 | { \ 62 | return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \ 63 | } \ 64 | static ossl_inline int sk_##t1##_unshift(STACK_OF(t1) *sk, t2 *ptr) \ 65 | { \ 66 | return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); \ 67 | } \ 68 | static ossl_inline t2 *sk_##t1##_pop(STACK_OF(t1) *sk) \ 69 | { \ 70 | return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); \ 71 | } \ 72 | static ossl_inline t2 *sk_##t1##_shift(STACK_OF(t1) *sk) \ 73 | { \ 74 | return (t2 *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); \ 75 | } \ 76 | static ossl_inline void sk_##t1##_pop_free(STACK_OF(t1) *sk, sk_##t1##_freefunc freefunc) \ 77 | { \ 78 | OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \ 79 | } \ 80 | static ossl_inline int sk_##t1##_insert(STACK_OF(t1) *sk, t2 *ptr, int idx) \ 81 | { \ 82 | return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); \ 83 | } \ 84 | static ossl_inline t2 *sk_##t1##_set(STACK_OF(t1) *sk, int idx, t2 *ptr) \ 85 | { \ 86 | return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); \ 87 | } \ 88 | static ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr) \ 89 | { \ 90 | return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \ 91 | } \ 92 | static ossl_inline int sk_##t1##_find_ex(STACK_OF(t1) *sk, t2 *ptr) \ 93 | { \ 94 | return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); \ 95 | } \ 96 | static ossl_inline void sk_##t1##_sort(STACK_OF(t1) *sk) \ 97 | { \ 98 | OPENSSL_sk_sort((OPENSSL_STACK *)sk); \ 99 | } \ 100 | static ossl_inline int sk_##t1##_is_sorted(const STACK_OF(t1) *sk) \ 101 | { \ 102 | return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); \ 103 | } \ 104 | static ossl_inline STACK_OF(t1) * sk_##t1##_dup(const STACK_OF(t1) *sk) \ 105 | { \ 106 | return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \ 107 | } \ 108 | static ossl_inline STACK_OF(t1) *sk_##t1##_deep_copy(const STACK_OF(t1) *sk, \ 109 | sk_##t1##_copyfunc copyfunc, \ 110 | sk_##t1##_freefunc freefunc) \ 111 | { \ 112 | return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \ 113 | (OPENSSL_sk_copyfunc)copyfunc, \ 114 | (OPENSSL_sk_freefunc)freefunc); \ 115 | } \ 116 | static ossl_inline sk_##t1##_compfunc sk_##t1##_set_cmp_func(STACK_OF(t1) *sk, sk_##t1##_compfunc compare) \ 117 | { \ 118 | return (sk_##t1##_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); \ 119 | } 120 | 121 | # define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2) 122 | # define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t) 123 | # define DEFINE_SPECIAL_STACK_OF_CONST(t1, t2) \ 124 | SKM_DEFINE_STACK_OF(t1, const t2, t2) 125 | # define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t) 126 | 127 | /*- 128 | * Strings are special: normally an lhash entry will point to a single 129 | * (somewhat) mutable object. In the case of strings: 130 | * 131 | * a) Instead of a single char, there is an array of chars, NUL-terminated. 132 | * b) The string may have be immutable. 133 | * 134 | * So, they need their own declarations. Especially important for 135 | * type-checking tools, such as Deputy. 136 | * 137 | * In practice, however, it appears to be hard to have a const 138 | * string. For now, I'm settling for dealing with the fact it is a 139 | * string at all. 140 | */ 141 | typedef char *OPENSSL_STRING; 142 | typedef const char *OPENSSL_CSTRING; 143 | 144 | /*- 145 | * Confusingly, LHASH_OF(STRING) deals with char ** throughout, but 146 | * STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned 147 | * above, instead of a single char each entry is a NUL-terminated array of 148 | * chars. So, we have to implement STRING specially for STACK_OF. This is 149 | * dealt with in the autogenerated macros below. 150 | */ 151 | DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char) 152 | DEFINE_SPECIAL_STACK_OF_CONST(OPENSSL_CSTRING, char) 153 | 154 | /* 155 | * Similarly, we sometimes use a block of characters, NOT nul-terminated. 156 | * These should also be distinguished from "normal" stacks. 157 | */ 158 | typedef void *OPENSSL_BLOCK; 159 | DEFINE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) 160 | 161 | # ifdef __cplusplus 162 | } 163 | # endif 164 | #endif 165 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/seed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | /* 11 | * Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved. 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions 15 | * are met: 16 | * 1. Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * 2. Neither the name of author nor the names of its contributors may 19 | * be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 | * SUCH DAMAGE. 33 | */ 34 | 35 | #ifndef HEADER_SEED_H 36 | # define HEADER_SEED_H 37 | 38 | # include 39 | 40 | # ifndef OPENSSL_NO_SEED 41 | # include 42 | # include 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | /* look whether we need 'long' to get 32 bits */ 49 | # ifdef AES_LONG 50 | # ifndef SEED_LONG 51 | # define SEED_LONG 1 52 | # endif 53 | # endif 54 | 55 | # if !defined(NO_SYS_TYPES_H) 56 | # include 57 | # endif 58 | 59 | # define SEED_BLOCK_SIZE 16 60 | # define SEED_KEY_LENGTH 16 61 | 62 | typedef struct seed_key_st { 63 | # ifdef SEED_LONG 64 | unsigned long data[32]; 65 | # else 66 | unsigned int data[32]; 67 | # endif 68 | } SEED_KEY_SCHEDULE; 69 | 70 | void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], 71 | SEED_KEY_SCHEDULE *ks); 72 | 73 | void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE], 74 | unsigned char d[SEED_BLOCK_SIZE], 75 | const SEED_KEY_SCHEDULE *ks); 76 | void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE], 77 | unsigned char d[SEED_BLOCK_SIZE], 78 | const SEED_KEY_SCHEDULE *ks); 79 | 80 | void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out, 81 | const SEED_KEY_SCHEDULE *ks, int enc); 82 | void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len, 83 | const SEED_KEY_SCHEDULE *ks, 84 | unsigned char ivec[SEED_BLOCK_SIZE], int enc); 85 | void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out, 86 | size_t len, const SEED_KEY_SCHEDULE *ks, 87 | unsigned char ivec[SEED_BLOCK_SIZE], int *num, 88 | int enc); 89 | void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out, 90 | size_t len, const SEED_KEY_SCHEDULE *ks, 91 | unsigned char ivec[SEED_BLOCK_SIZE], int *num); 92 | 93 | # ifdef __cplusplus 94 | } 95 | # endif 96 | # endif 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/sha.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_SHA_H 11 | # define HEADER_SHA_H 12 | 13 | # include 14 | # include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /*- 21 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 22 | * ! SHA_LONG has to be at least 32 bits wide. ! 23 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 24 | */ 25 | # define SHA_LONG unsigned int 26 | 27 | # define SHA_LBLOCK 16 28 | # define SHA_CBLOCK (SHA_LBLOCK*4)/* SHA treats input data as a 29 | * contiguous array of 32 bit wide 30 | * big-endian values. */ 31 | # define SHA_LAST_BLOCK (SHA_CBLOCK-8) 32 | # define SHA_DIGEST_LENGTH 20 33 | 34 | typedef struct SHAstate_st { 35 | SHA_LONG h0, h1, h2, h3, h4; 36 | SHA_LONG Nl, Nh; 37 | SHA_LONG data[SHA_LBLOCK]; 38 | unsigned int num; 39 | } SHA_CTX; 40 | 41 | int SHA1_Init(SHA_CTX *c); 42 | int SHA1_Update(SHA_CTX *c, const void *data, size_t len); 43 | int SHA1_Final(unsigned char *md, SHA_CTX *c); 44 | unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); 45 | void SHA1_Transform(SHA_CTX *c, const unsigned char *data); 46 | 47 | # define SHA256_CBLOCK (SHA_LBLOCK*4)/* SHA-256 treats input data as a 48 | * contiguous array of 32 bit wide 49 | * big-endian values. */ 50 | 51 | typedef struct SHA256state_st { 52 | SHA_LONG h[8]; 53 | SHA_LONG Nl, Nh; 54 | SHA_LONG data[SHA_LBLOCK]; 55 | unsigned int num, md_len; 56 | } SHA256_CTX; 57 | 58 | int SHA224_Init(SHA256_CTX *c); 59 | int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); 60 | int SHA224_Final(unsigned char *md, SHA256_CTX *c); 61 | unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md); 62 | int SHA256_Init(SHA256_CTX *c); 63 | int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); 64 | int SHA256_Final(unsigned char *md, SHA256_CTX *c); 65 | unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md); 66 | void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); 67 | 68 | # define SHA224_DIGEST_LENGTH 28 69 | # define SHA256_DIGEST_LENGTH 32 70 | # define SHA384_DIGEST_LENGTH 48 71 | # define SHA512_DIGEST_LENGTH 64 72 | 73 | /* 74 | * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64 75 | * being exactly 64-bit wide. See Implementation Notes in sha512.c 76 | * for further details. 77 | */ 78 | /* 79 | * SHA-512 treats input data as a 80 | * contiguous array of 64 bit 81 | * wide big-endian values. 82 | */ 83 | # define SHA512_CBLOCK (SHA_LBLOCK*8) 84 | # if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) 85 | # define SHA_LONG64 unsigned __int64 86 | # define U64(C) C##UI64 87 | # elif defined(__arch64__) 88 | # define SHA_LONG64 unsigned long 89 | # define U64(C) C##UL 90 | # else 91 | # define SHA_LONG64 unsigned long long 92 | # define U64(C) C##ULL 93 | # endif 94 | 95 | typedef struct SHA512state_st { 96 | SHA_LONG64 h[8]; 97 | SHA_LONG64 Nl, Nh; 98 | union { 99 | SHA_LONG64 d[SHA_LBLOCK]; 100 | unsigned char p[SHA512_CBLOCK]; 101 | } u; 102 | unsigned int num, md_len; 103 | } SHA512_CTX; 104 | 105 | int SHA384_Init(SHA512_CTX *c); 106 | int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); 107 | int SHA384_Final(unsigned char *md, SHA512_CTX *c); 108 | unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md); 109 | int SHA512_Init(SHA512_CTX *c); 110 | int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); 111 | int SHA512_Final(unsigned char *md, SHA512_CTX *c); 112 | unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md); 113 | void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); 114 | 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/srp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_SRP_H 11 | # define HEADER_SRP_H 12 | 13 | #include 14 | 15 | #ifndef OPENSSL_NO_SRP 16 | # include 17 | # include 18 | # include 19 | # include 20 | # include 21 | 22 | # ifdef __cplusplus 23 | extern "C" { 24 | # endif 25 | 26 | typedef struct SRP_gN_cache_st { 27 | char *b64_bn; 28 | BIGNUM *bn; 29 | } SRP_gN_cache; 30 | 31 | 32 | DEFINE_STACK_OF(SRP_gN_cache) 33 | 34 | typedef struct SRP_user_pwd_st { 35 | /* Owned by us. */ 36 | char *id; 37 | BIGNUM *s; 38 | BIGNUM *v; 39 | /* Not owned by us. */ 40 | const BIGNUM *g; 41 | const BIGNUM *N; 42 | /* Owned by us. */ 43 | char *info; 44 | } SRP_user_pwd; 45 | 46 | void SRP_user_pwd_free(SRP_user_pwd *user_pwd); 47 | 48 | DEFINE_STACK_OF(SRP_user_pwd) 49 | 50 | typedef struct SRP_VBASE_st { 51 | STACK_OF(SRP_user_pwd) *users_pwd; 52 | STACK_OF(SRP_gN_cache) *gN_cache; 53 | /* to simulate a user */ 54 | char *seed_key; 55 | const BIGNUM *default_g; 56 | const BIGNUM *default_N; 57 | } SRP_VBASE; 58 | 59 | /* 60 | * Internal structure storing N and g pair 61 | */ 62 | typedef struct SRP_gN_st { 63 | char *id; 64 | const BIGNUM *g; 65 | const BIGNUM *N; 66 | } SRP_gN; 67 | 68 | DEFINE_STACK_OF(SRP_gN) 69 | 70 | SRP_VBASE *SRP_VBASE_new(char *seed_key); 71 | void SRP_VBASE_free(SRP_VBASE *vb); 72 | int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file); 73 | 74 | /* This method ignores the configured seed and fails for an unknown user. */ 75 | DEPRECATEDIN_1_1_0(SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username)) 76 | /* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/ 77 | SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username); 78 | 79 | char *SRP_create_verifier(const char *user, const char *pass, char **salt, 80 | char **verifier, const char *N, const char *g); 81 | int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, 82 | BIGNUM **verifier, const BIGNUM *N, 83 | const BIGNUM *g); 84 | 85 | # define SRP_NO_ERROR 0 86 | # define SRP_ERR_VBASE_INCOMPLETE_FILE 1 87 | # define SRP_ERR_VBASE_BN_LIB 2 88 | # define SRP_ERR_OPEN_FILE 3 89 | # define SRP_ERR_MEMORY 4 90 | 91 | # define DB_srptype 0 92 | # define DB_srpverifier 1 93 | # define DB_srpsalt 2 94 | # define DB_srpid 3 95 | # define DB_srpgN 4 96 | # define DB_srpinfo 5 97 | # undef DB_NUMBER 98 | # define DB_NUMBER 6 99 | 100 | # define DB_SRP_INDEX 'I' 101 | # define DB_SRP_VALID 'V' 102 | # define DB_SRP_REVOKED 'R' 103 | # define DB_SRP_MODIF 'v' 104 | 105 | /* see srp.c */ 106 | char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N); 107 | SRP_gN *SRP_get_default_gN(const char *id); 108 | 109 | /* server side .... */ 110 | BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u, 111 | const BIGNUM *b, const BIGNUM *N); 112 | BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g, 113 | const BIGNUM *v); 114 | int SRP_Verify_A_mod_N(const BIGNUM *A, const BIGNUM *N); 115 | BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N); 116 | 117 | /* client side .... */ 118 | BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass); 119 | BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g); 120 | BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g, 121 | const BIGNUM *x, const BIGNUM *a, const BIGNUM *u); 122 | int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N); 123 | 124 | # define SRP_MINIMAL_N 1024 125 | 126 | # ifdef __cplusplus 127 | } 128 | # endif 129 | # endif 130 | 131 | #endif 132 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/srtp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | /* 11 | * DTLS code by Eric Rescorla 12 | * 13 | * Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc. 14 | */ 15 | 16 | #ifndef HEADER_D1_SRTP_H 17 | # define HEADER_D1_SRTP_H 18 | 19 | # include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | # define SRTP_AES128_CM_SHA1_80 0x0001 26 | # define SRTP_AES128_CM_SHA1_32 0x0002 27 | # define SRTP_AES128_F8_SHA1_80 0x0003 28 | # define SRTP_AES128_F8_SHA1_32 0x0004 29 | # define SRTP_NULL_SHA1_80 0x0005 30 | # define SRTP_NULL_SHA1_32 0x0006 31 | 32 | /* AEAD SRTP protection profiles from RFC 7714 */ 33 | # define SRTP_AEAD_AES_128_GCM 0x0007 34 | # define SRTP_AEAD_AES_256_GCM 0x0008 35 | 36 | # ifndef OPENSSL_NO_SRTP 37 | 38 | __owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); 39 | __owur int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles); 40 | 41 | __owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); 42 | __owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); 43 | 44 | # endif 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/ssl2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_SSL2_H 11 | # define HEADER_SSL2_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | # define SSL2_VERSION 0x0002 18 | 19 | # define SSL2_MT_CLIENT_HELLO 1 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_STACK_H 11 | # define HEADER_STACK_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | typedef struct stack_st OPENSSL_STACK; /* Use STACK_OF(...) instead */ 18 | 19 | typedef int (*OPENSSL_sk_compfunc)(const void *, const void *); 20 | typedef void (*OPENSSL_sk_freefunc)(void *); 21 | typedef void *(*OPENSSL_sk_copyfunc)(const void *); 22 | 23 | int OPENSSL_sk_num(const OPENSSL_STACK *); 24 | void *OPENSSL_sk_value(const OPENSSL_STACK *, int); 25 | 26 | void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data); 27 | 28 | OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc cmp); 29 | OPENSSL_STACK *OPENSSL_sk_new_null(void); 30 | void OPENSSL_sk_free(OPENSSL_STACK *); 31 | void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *)); 32 | OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *, OPENSSL_sk_copyfunc c, OPENSSL_sk_freefunc f); 33 | int OPENSSL_sk_insert(OPENSSL_STACK *sk, const void *data, int where); 34 | void *OPENSSL_sk_delete(OPENSSL_STACK *st, int loc); 35 | void *OPENSSL_sk_delete_ptr(OPENSSL_STACK *st, const void *p); 36 | int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data); 37 | int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data); 38 | int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data); 39 | int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data); 40 | void *OPENSSL_sk_shift(OPENSSL_STACK *st); 41 | void *OPENSSL_sk_pop(OPENSSL_STACK *st); 42 | void OPENSSL_sk_zero(OPENSSL_STACK *st); 43 | OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk, OPENSSL_sk_compfunc cmp); 44 | OPENSSL_STACK *OPENSSL_sk_dup(const OPENSSL_STACK *st); 45 | void OPENSSL_sk_sort(OPENSSL_STACK *st); 46 | int OPENSSL_sk_is_sorted(const OPENSSL_STACK *st); 47 | 48 | # if OPENSSL_API_COMPAT < 0x10100000L 49 | # define _STACK OPENSSL_STACK 50 | # define sk_num OPENSSL_sk_num 51 | # define sk_value OPENSSL_sk_value 52 | # define sk_set OPENSSL_sk_set 53 | # define sk_new OPENSSL_sk_new 54 | # define sk_new_null OPENSSL_sk_new_null 55 | # define sk_free OPENSSL_sk_free 56 | # define sk_pop_free OPENSSL_sk_pop_free 57 | # define sk_deep_copy OPENSSL_sk_deep_copy 58 | # define sk_insert OPENSSL_sk_insert 59 | # define sk_delete OPENSSL_sk_delete 60 | # define sk_delete_ptr OPENSSL_sk_delete_ptr 61 | # define sk_find OPENSSL_sk_find 62 | # define sk_find_ex OPENSSL_sk_find_ex 63 | # define sk_push OPENSSL_sk_push 64 | # define sk_unshift OPENSSL_sk_unshift 65 | # define sk_shift OPENSSL_sk_shift 66 | # define sk_pop OPENSSL_sk_pop 67 | # define sk_zero OPENSSL_sk_zero 68 | # define sk_set_cmp_func OPENSSL_sk_set_cmp_func 69 | # define sk_dup OPENSSL_sk_dup 70 | # define sk_sort OPENSSL_sk_sort 71 | # define sk_is_sorted OPENSSL_sk_is_sorted 72 | # endif 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/symhacks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_SYMHACKS_H 11 | # define HEADER_SYMHACKS_H 12 | 13 | # include 14 | 15 | /* Case insensitive linking causes problems.... */ 16 | # if defined(OPENSSL_SYS_VMS) 17 | # undef ERR_load_CRYPTO_strings 18 | # define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings 19 | # undef OCSP_crlID_new 20 | # define OCSP_crlID_new OCSP_crlID2_new 21 | 22 | # undef d2i_ECPARAMETERS 23 | # define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS 24 | # undef i2d_ECPARAMETERS 25 | # define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS 26 | # undef d2i_ECPKPARAMETERS 27 | # define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS 28 | # undef i2d_ECPKPARAMETERS 29 | # define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS 30 | 31 | /* 32 | * These functions do not seem to exist! However, I'm paranoid... Original 33 | * command in x509v3.h: These functions are being redefined in another 34 | * directory, and clash when the linker is case-insensitive, so let's hide 35 | * them a little, by giving them an extra 'o' at the beginning of the name... 36 | */ 37 | # undef X509v3_cleanup_extensions 38 | # define X509v3_cleanup_extensions oX509v3_cleanup_extensions 39 | # undef X509v3_add_extension 40 | # define X509v3_add_extension oX509v3_add_extension 41 | # undef X509v3_add_netscape_extensions 42 | # define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions 43 | # undef X509v3_add_standard_extensions 44 | # define X509v3_add_standard_extensions oX509v3_add_standard_extensions 45 | 46 | /* This one clashes with CMS_data_create */ 47 | # undef cms_Data_create 48 | # define cms_Data_create priv_cms_Data_create 49 | 50 | # endif 51 | 52 | #endif /* ! defined HEADER_VMS_IDHACKS_H */ 53 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/txt_db.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_TXT_DB_H 11 | # define HEADER_TXT_DB_H 12 | 13 | # include 14 | # include 15 | # include 16 | # include 17 | 18 | # define DB_ERROR_OK 0 19 | # define DB_ERROR_MALLOC 1 20 | # define DB_ERROR_INDEX_CLASH 2 21 | # define DB_ERROR_INDEX_OUT_OF_RANGE 3 22 | # define DB_ERROR_NO_INDEX 4 23 | # define DB_ERROR_INSERT_INDEX_CLASH 5 24 | # define DB_ERROR_WRONG_NUM_FIELDS 6 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef OPENSSL_STRING *OPENSSL_PSTRING; 31 | DEFINE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) 32 | 33 | typedef struct txt_db_st { 34 | int num_fields; 35 | STACK_OF(OPENSSL_PSTRING) *data; 36 | LHASH_OF(OPENSSL_STRING) **index; 37 | int (**qual) (OPENSSL_STRING *); 38 | long error; 39 | long arg1; 40 | long arg2; 41 | OPENSSL_STRING *arg_row; 42 | } TXT_DB; 43 | 44 | TXT_DB *TXT_DB_read(BIO *in, int num); 45 | long TXT_DB_write(BIO *out, TXT_DB *db); 46 | int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *), 47 | OPENSSL_LH_HASHFUNC hash, OPENSSL_LH_COMPFUNC cmp); 48 | void TXT_DB_free(TXT_DB *db); 49 | OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, 50 | OPENSSL_STRING *value); 51 | int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /VS Project/openssl/include/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_WHRLPOOL_H 11 | # define HEADER_WHRLPOOL_H 12 | 13 | #include 14 | 15 | # ifndef OPENSSL_NO_WHIRLPOOL 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | # define WHIRLPOOL_DIGEST_LENGTH (512/8) 23 | # define WHIRLPOOL_BBLOCK 512 24 | # define WHIRLPOOL_COUNTER (256/8) 25 | 26 | typedef struct { 27 | union { 28 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 29 | /* double q is here to ensure 64-bit alignment */ 30 | double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)]; 31 | } H; 32 | unsigned char data[WHIRLPOOL_BBLOCK / 8]; 33 | unsigned int bitoff; 34 | size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)]; 35 | } WHIRLPOOL_CTX; 36 | 37 | int WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 38 | int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes); 39 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits); 40 | int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c); 41 | unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md); 42 | 43 | # ifdef __cplusplus 44 | } 45 | # endif 46 | # endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /VS Project/openssl/lib/libcryptoMT.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/openssl/lib/libcryptoMT.lib -------------------------------------------------------------------------------- /VS Project/openssl/lib/libcryptoMTd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/openssl/lib/libcryptoMTd.lib -------------------------------------------------------------------------------- /VS Project/openssl/lib/libsslMT.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/openssl/lib/libsslMT.lib -------------------------------------------------------------------------------- /VS Project/openssl/lib/libsslMTd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/VS Project/openssl/lib/libsslMTd.lib -------------------------------------------------------------------------------- /VS Project/zip/adler32.c: -------------------------------------------------------------------------------- 1 | /* adler32.c -- compute the Adler-32 checksum of a data stream 2 | * Copyright (C) 1995-2011, 2016 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #include "zutil.h" 9 | 10 | local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); 11 | 12 | #define BASE 65521U /* largest prime smaller than 65536 */ 13 | #define NMAX 5552 14 | /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ 15 | 16 | #define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} 17 | #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); 18 | #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); 19 | #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); 20 | #define DO16(buf) DO8(buf,0); DO8(buf,8); 21 | 22 | /* use NO_DIVIDE if your processor does not do division in hardware -- 23 | try it both ways to see which is faster */ 24 | #ifdef NO_DIVIDE 25 | /* note that this assumes BASE is 65521, where 65536 % 65521 == 15 26 | (thank you to John Reiser for pointing this out) */ 27 | # define CHOP(a) \ 28 | do { \ 29 | unsigned long tmp = a >> 16; \ 30 | a &= 0xffffUL; \ 31 | a += (tmp << 4) - tmp; \ 32 | } while (0) 33 | # define MOD28(a) \ 34 | do { \ 35 | CHOP(a); \ 36 | if (a >= BASE) a -= BASE; \ 37 | } while (0) 38 | # define MOD(a) \ 39 | do { \ 40 | CHOP(a); \ 41 | MOD28(a); \ 42 | } while (0) 43 | # define MOD63(a) \ 44 | do { /* this assumes a is not negative */ \ 45 | z_off64_t tmp = a >> 32; \ 46 | a &= 0xffffffffL; \ 47 | a += (tmp << 8) - (tmp << 5) + tmp; \ 48 | tmp = a >> 16; \ 49 | a &= 0xffffL; \ 50 | a += (tmp << 4) - tmp; \ 51 | tmp = a >> 16; \ 52 | a &= 0xffffL; \ 53 | a += (tmp << 4) - tmp; \ 54 | if (a >= BASE) a -= BASE; \ 55 | } while (0) 56 | #else 57 | # define MOD(a) a %= BASE 58 | # define MOD28(a) a %= BASE 59 | # define MOD63(a) a %= BASE 60 | #endif 61 | 62 | /* ========================================================================= */ 63 | uLong ZEXPORT adler32_z(adler, buf, len) 64 | uLong adler; 65 | const Bytef *buf; 66 | z_size_t len; 67 | { 68 | unsigned long sum2; 69 | unsigned n; 70 | 71 | /* split Adler-32 into component sums */ 72 | sum2 = (adler >> 16) & 0xffff; 73 | adler &= 0xffff; 74 | 75 | /* in case user likes doing a byte at a time, keep it fast */ 76 | if (len == 1) { 77 | adler += buf[0]; 78 | if (adler >= BASE) 79 | adler -= BASE; 80 | sum2 += adler; 81 | if (sum2 >= BASE) 82 | sum2 -= BASE; 83 | return adler | (sum2 << 16); 84 | } 85 | 86 | /* initial Adler-32 value (deferred check for len == 1 speed) */ 87 | if (buf == Z_NULL) 88 | return 1L; 89 | 90 | /* in case short lengths are provided, keep it somewhat fast */ 91 | if (len < 16) { 92 | while (len--) { 93 | adler += *buf++; 94 | sum2 += adler; 95 | } 96 | if (adler >= BASE) 97 | adler -= BASE; 98 | MOD28(sum2); /* only added so many BASE's */ 99 | return adler | (sum2 << 16); 100 | } 101 | 102 | /* do length NMAX blocks -- requires just one modulo operation */ 103 | while (len >= NMAX) { 104 | len -= NMAX; 105 | n = NMAX / 16; /* NMAX is divisible by 16 */ 106 | do { 107 | DO16(buf); /* 16 sums unrolled */ 108 | buf += 16; 109 | } while (--n); 110 | MOD(adler); 111 | MOD(sum2); 112 | } 113 | 114 | /* do remaining bytes (less than NMAX, still just one modulo) */ 115 | if (len) { /* avoid modulos if none remaining */ 116 | while (len >= 16) { 117 | len -= 16; 118 | DO16(buf); 119 | buf += 16; 120 | } 121 | while (len--) { 122 | adler += *buf++; 123 | sum2 += adler; 124 | } 125 | MOD(adler); 126 | MOD(sum2); 127 | } 128 | 129 | /* return recombined sums */ 130 | return adler | (sum2 << 16); 131 | } 132 | 133 | /* ========================================================================= */ 134 | uLong ZEXPORT adler32(adler, buf, len) 135 | uLong adler; 136 | const Bytef *buf; 137 | uInt len; 138 | { 139 | return adler32_z(adler, buf, len); 140 | } 141 | 142 | /* ========================================================================= */ 143 | local uLong adler32_combine_(adler1, adler2, len2) 144 | uLong adler1; 145 | uLong adler2; 146 | z_off64_t len2; 147 | { 148 | unsigned long sum1; 149 | unsigned long sum2; 150 | unsigned rem; 151 | 152 | /* for negative len, return invalid adler32 as a clue for debugging */ 153 | if (len2 < 0) 154 | return 0xffffffffUL; 155 | 156 | /* the derivation of this formula is left as an exercise for the reader */ 157 | MOD63(len2); /* assumes len2 >= 0 */ 158 | rem = (unsigned)len2; 159 | sum1 = adler1 & 0xffff; 160 | sum2 = rem * sum1; 161 | MOD(sum2); 162 | sum1 += (adler2 & 0xffff) + BASE - 1; 163 | sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; 164 | if (sum1 >= BASE) sum1 -= BASE; 165 | if (sum1 >= BASE) sum1 -= BASE; 166 | if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1); 167 | if (sum2 >= BASE) sum2 -= BASE; 168 | return sum1 | (sum2 << 16); 169 | } 170 | 171 | /* ========================================================================= */ 172 | uLong ZEXPORT adler32_combine(adler1, adler2, len2) 173 | uLong adler1; 174 | uLong adler2; 175 | z_off_t len2; 176 | { 177 | return adler32_combine_(adler1, adler2, len2); 178 | } 179 | 180 | uLong ZEXPORT adler32_combine64(adler1, adler2, len2) 181 | uLong adler1; 182 | uLong adler2; 183 | z_off64_t len2; 184 | { 185 | return adler32_combine_(adler1, adler2, len2); 186 | } 187 | -------------------------------------------------------------------------------- /VS Project/zip/compress.c: -------------------------------------------------------------------------------- 1 | /* compress.c -- compress a memory buffer 2 | * Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Compresses the source buffer into the destination buffer. The level 13 | parameter has the same meaning as in deflateInit. sourceLen is the byte 14 | length of the source buffer. Upon entry, destLen is the total size of the 15 | destination buffer, which must be at least 0.1% larger than sourceLen plus 16 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. 17 | 18 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 19 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, 20 | Z_STREAM_ERROR if the level parameter is invalid. 21 | */ 22 | int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) 23 | Bytef *dest; 24 | uLongf *destLen; 25 | const Bytef *source; 26 | uLong sourceLen; 27 | int level; 28 | { 29 | z_stream stream; 30 | int err; 31 | const uInt max = (uInt)-1; 32 | uLong left; 33 | 34 | left = *destLen; 35 | *destLen = 0; 36 | 37 | stream.zalloc = (alloc_func)0; 38 | stream.zfree = (free_func)0; 39 | stream.opaque = (voidpf)0; 40 | 41 | err = deflateInit(&stream, level); 42 | if (err != Z_OK) return err; 43 | 44 | stream.next_out = dest; 45 | stream.avail_out = 0; 46 | stream.next_in = (z_const Bytef *)source; 47 | stream.avail_in = 0; 48 | 49 | do { 50 | if (stream.avail_out == 0) { 51 | stream.avail_out = left > (uLong)max ? max : (uInt)left; 52 | left -= stream.avail_out; 53 | } 54 | if (stream.avail_in == 0) { 55 | stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen; 56 | sourceLen -= stream.avail_in; 57 | } 58 | err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH); 59 | } while (err == Z_OK); 60 | 61 | *destLen = stream.total_out; 62 | deflateEnd(&stream); 63 | return err == Z_STREAM_END ? Z_OK : err; 64 | } 65 | 66 | /* =========================================================================== 67 | */ 68 | int ZEXPORT compress (dest, destLen, source, sourceLen) 69 | Bytef *dest; 70 | uLongf *destLen; 71 | const Bytef *source; 72 | uLong sourceLen; 73 | { 74 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 75 | } 76 | 77 | /* =========================================================================== 78 | If the default memLevel or windowBits for deflateInit() is changed, then 79 | this function needs to be updated. 80 | */ 81 | uLong ZEXPORT compressBound (sourceLen) 82 | uLong sourceLen; 83 | { 84 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 85 | (sourceLen >> 25) + 13; 86 | } 87 | -------------------------------------------------------------------------------- /VS Project/zip/crypt.h: -------------------------------------------------------------------------------- 1 | /* crypt.h -- base code for crypt/uncrypt ZIPfile 2 | 3 | 4 | Version 1.01e, February 12th, 2005 5 | 6 | Copyright (C) 1998-2005 Gilles Vollant 7 | 8 | This code is a modified version of crypting code in Infozip distribution 9 | 10 | The encryption/decryption parts of this source code (as opposed to the 11 | non-echoing password parts) were originally written in Europe. The 12 | whole source package can be freely distributed, including from the USA. 13 | (Prior to January 2000, re-export from the US was a violation of US law.) 14 | 15 | This encryption code is a direct transcription of the algorithm from 16 | Roger Schlafly, described by Phil Katz in the file appnote.txt. This 17 | file (appnote.txt) is distributed with the PKZIP program (even in the 18 | version without encryption capabilities). 19 | 20 | If you don't need crypting in your application, just define symbols 21 | NOCRYPT and NOUNCRYPT. 22 | 23 | This code support the "Traditional PKWARE Encryption". 24 | 25 | The new AES encryption added on Zip format by Winzip (see the page 26 | http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong 27 | Encryption is not supported. 28 | */ 29 | 30 | #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) 31 | 32 | /*********************************************************************** 33 | * Return the next byte in the pseudo-random sequence 34 | */ 35 | static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) 36 | { 37 | unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an 38 | * unpredictable manner on 16-bit systems; not a problem 39 | * with any known compiler so far, though */ 40 | 41 | temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; 42 | return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); 43 | } 44 | 45 | /*********************************************************************** 46 | * Update the encryption keys with the next byte of plain text 47 | */ 48 | static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) 49 | { 50 | (*(pkeys+0)) = CRC32((*(pkeys+0)), c); 51 | (*(pkeys+1)) += (*(pkeys+0)) & 0xff; 52 | (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; 53 | { 54 | register int keyshift = (int)((*(pkeys+1)) >> 24); 55 | (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); 56 | } 57 | return c; 58 | } 59 | 60 | 61 | /*********************************************************************** 62 | * Initialize the encryption keys and the random header according to 63 | * the given password. 64 | */ 65 | static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) 66 | { 67 | *(pkeys+0) = 305419896L; 68 | *(pkeys+1) = 591751049L; 69 | *(pkeys+2) = 878082192L; 70 | while (*passwd != '\0') { 71 | update_keys(pkeys,pcrc_32_tab,(int)*passwd); 72 | passwd++; 73 | } 74 | } 75 | 76 | #define zdecode(pkeys,pcrc_32_tab,c) \ 77 | (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) 78 | 79 | #define zencode(pkeys,pcrc_32_tab,c,t) \ 80 | (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) 81 | 82 | #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED 83 | 84 | #define RAND_HEAD_LEN 12 85 | /* "last resort" source for second part of crypt seed pattern */ 86 | # ifndef ZCR_SEED2 87 | # define ZCR_SEED2 3141592654UL /* use PI as default pattern */ 88 | # endif 89 | 90 | static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) 91 | const char *passwd; /* password string */ 92 | unsigned char *buf; /* where to write header */ 93 | int bufSize; 94 | unsigned long* pkeys; 95 | const unsigned long* pcrc_32_tab; 96 | unsigned long crcForCrypting; 97 | { 98 | int n; /* index in random header */ 99 | int t; /* temporary */ 100 | int c; /* random byte */ 101 | unsigned char header[RAND_HEAD_LEN-2]; /* random header */ 102 | static unsigned calls = 0; /* ensure different random header each time */ 103 | 104 | if (bufSize> 7) & 0xff; 119 | header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); 120 | } 121 | /* Encrypt random header (last two bytes is high word of crc) */ 122 | init_keys(passwd, pkeys, pcrc_32_tab); 123 | for (n = 0; n < RAND_HEAD_LEN-2; n++) 124 | { 125 | buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); 126 | } 127 | buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); 128 | buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); 129 | return n; 130 | } 131 | 132 | #endif 133 | -------------------------------------------------------------------------------- /VS Project/zip/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /VS Project/zip/gzguts.h: -------------------------------------------------------------------------------- 1 | /* gzguts.h -- zlib internal header definitions for gz* operations 2 | * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #ifdef _LARGEFILE64_SOURCE 7 | # ifndef _LARGEFILE_SOURCE 8 | # define _LARGEFILE_SOURCE 1 9 | # endif 10 | # ifdef _FILE_OFFSET_BITS 11 | # undef _FILE_OFFSET_BITS 12 | # endif 13 | #endif 14 | 15 | #ifdef HAVE_HIDDEN 16 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) 17 | #else 18 | # define ZLIB_INTERNAL 19 | #endif 20 | 21 | #include 22 | #include "zlib.h" 23 | #ifdef STDC 24 | # include 25 | # include 26 | # include 27 | #endif 28 | 29 | #ifndef _POSIX_SOURCE 30 | # define _POSIX_SOURCE 31 | #endif 32 | #include 33 | 34 | #ifdef _WIN32 35 | # include 36 | #endif 37 | 38 | #if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32) 39 | # include 40 | #endif 41 | 42 | #if defined(_WIN32) || defined(__CYGWIN__) 43 | # define WIDECHAR 44 | #endif 45 | 46 | #ifdef WINAPI_FAMILY 47 | # define open _open 48 | # define read _read 49 | # define write _write 50 | # define close _close 51 | #endif 52 | 53 | #ifdef NO_DEFLATE /* for compatibility with old definition */ 54 | # define NO_GZCOMPRESS 55 | #endif 56 | 57 | #if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) 58 | # ifndef HAVE_VSNPRINTF 59 | # define HAVE_VSNPRINTF 60 | # endif 61 | #endif 62 | 63 | #if defined(__CYGWIN__) 64 | # ifndef HAVE_VSNPRINTF 65 | # define HAVE_VSNPRINTF 66 | # endif 67 | #endif 68 | 69 | #if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410) 70 | # ifndef HAVE_VSNPRINTF 71 | # define HAVE_VSNPRINTF 72 | # endif 73 | #endif 74 | 75 | #ifndef HAVE_VSNPRINTF 76 | # ifdef MSDOS 77 | /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), 78 | but for now we just assume it doesn't. */ 79 | # define NO_vsnprintf 80 | # endif 81 | # ifdef __TURBOC__ 82 | # define NO_vsnprintf 83 | # endif 84 | # ifdef WIN32 85 | /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ 86 | # if !defined(vsnprintf) && !defined(NO_vsnprintf) 87 | # if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 ) 88 | # define vsnprintf _vsnprintf 89 | # endif 90 | # endif 91 | # endif 92 | # ifdef __SASC 93 | # define NO_vsnprintf 94 | # endif 95 | # ifdef VMS 96 | # define NO_vsnprintf 97 | # endif 98 | # ifdef __OS400__ 99 | # define NO_vsnprintf 100 | # endif 101 | # ifdef __MVS__ 102 | # define NO_vsnprintf 103 | # endif 104 | #endif 105 | 106 | /* unlike snprintf (which is required in C99), _snprintf does not guarantee 107 | null termination of the result -- however this is only used in gzlib.c where 108 | the result is assured to fit in the space provided */ 109 | #if defined(_MSC_VER) && _MSC_VER < 1900 110 | # define snprintf _snprintf 111 | #endif 112 | 113 | #ifndef local 114 | # define local static 115 | #endif 116 | /* since "static" is used to mean two completely different things in C, we 117 | define "local" for the non-static meaning of "static", for readability 118 | (compile with -Dlocal if your debugger can't find static symbols) */ 119 | 120 | /* gz* functions always use library allocation functions */ 121 | #ifndef STDC 122 | extern voidp malloc OF((uInt size)); 123 | extern void free OF((voidpf ptr)); 124 | #endif 125 | 126 | /* get errno and strerror definition */ 127 | #if defined UNDER_CE 128 | # include 129 | # define zstrerror() gz_strwinerror((DWORD)GetLastError()) 130 | #else 131 | # ifndef NO_STRERROR 132 | # include 133 | # define zstrerror() strerror(errno) 134 | # else 135 | # define zstrerror() "stdio error (consult errno)" 136 | # endif 137 | #endif 138 | 139 | /* provide prototypes for these when building zlib without LFS */ 140 | #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 141 | ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); 142 | ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); 143 | ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); 144 | ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); 145 | #endif 146 | 147 | /* default memLevel */ 148 | #if MAX_MEM_LEVEL >= 8 149 | # define DEF_MEM_LEVEL 8 150 | #else 151 | # define DEF_MEM_LEVEL MAX_MEM_LEVEL 152 | #endif 153 | 154 | /* default i/o buffer size -- double this for output when reading (this and 155 | twice this must be able to fit in an unsigned type) */ 156 | #define GZBUFSIZE 8192 157 | 158 | /* gzip modes, also provide a little integrity check on the passed structure */ 159 | #define GZ_NONE 0 160 | #define GZ_READ 7247 161 | #define GZ_WRITE 31153 162 | #define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */ 163 | 164 | /* values for gz_state how */ 165 | #define LOOK 0 /* look for a gzip header */ 166 | #define COPY 1 /* copy input directly */ 167 | #define GZIP 2 /* decompress a gzip stream */ 168 | 169 | /* internal gzip file state data structure */ 170 | typedef struct { 171 | /* exposed contents for gzgetc() macro */ 172 | struct gzFile_s x; /* "x" for exposed */ 173 | /* x.have: number of bytes available at x.next */ 174 | /* x.next: next output data to deliver or write */ 175 | /* x.pos: current position in uncompressed data */ 176 | /* used for both reading and writing */ 177 | int mode; /* see gzip modes above */ 178 | int fd; /* file descriptor */ 179 | char *path; /* path or fd for error messages */ 180 | unsigned size; /* buffer size, zero if not allocated yet */ 181 | unsigned want; /* requested buffer size, default is GZBUFSIZE */ 182 | unsigned char *in; /* input buffer (double-sized when writing) */ 183 | unsigned char *out; /* output buffer (double-sized when reading) */ 184 | int direct; /* 0 if processing gzip, 1 if transparent */ 185 | /* just for reading */ 186 | int how; /* 0: get header, 1: copy, 2: decompress */ 187 | z_off64_t start; /* where the gzip data started, for rewinding */ 188 | int eof; /* true if end of input file reached */ 189 | int past; /* true if read requested past end */ 190 | /* just for writing */ 191 | int level; /* compression level */ 192 | int strategy; /* compression strategy */ 193 | /* seek request */ 194 | z_off64_t skip; /* amount to skip (already rewound if backwards) */ 195 | int seek; /* true if seek request pending */ 196 | /* error information */ 197 | int err; /* error code */ 198 | char *msg; /* error message */ 199 | /* zlib inflate or deflate stream */ 200 | z_stream strm; /* stream structure in-place (not a pointer) */ 201 | } gz_state; 202 | typedef gz_state FAR *gz_statep; 203 | 204 | /* shared functions */ 205 | void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); 206 | #if defined UNDER_CE 207 | char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); 208 | #endif 209 | 210 | /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t 211 | value -- needed when comparing unsigned to z_off64_t, which is signed 212 | (possible z_off64_t types off_t, off64_t, and long are all signed) */ 213 | #ifdef INT_MAX 214 | # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) 215 | #else 216 | unsigned ZLIB_INTERNAL gz_intmax OF((void)); 217 | # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) 218 | #endif 219 | -------------------------------------------------------------------------------- /VS Project/zip/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /VS Project/zip/inffixed.h: -------------------------------------------------------------------------------- 1 | /* inffixed.h -- table for decoding fixed codes 2 | * Generated automatically by makefixed(). 3 | */ 4 | 5 | /* WARNING: this file should *not* be used by applications. 6 | It is part of the implementation of this library and is 7 | subject to change. Applications should only use zlib.h. 8 | */ 9 | 10 | static const code lenfix[512] = { 11 | {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, 12 | {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, 13 | {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, 14 | {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, 15 | {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, 16 | {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, 17 | {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, 18 | {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, 19 | {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, 20 | {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, 21 | {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, 22 | {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, 23 | {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, 24 | {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, 25 | {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, 26 | {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, 27 | {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, 28 | {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, 29 | {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, 30 | {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, 31 | {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, 32 | {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, 33 | {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, 34 | {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, 35 | {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, 36 | {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, 37 | {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, 38 | {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, 39 | {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, 40 | {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, 41 | {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, 42 | {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, 43 | {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, 44 | {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, 45 | {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, 46 | {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, 47 | {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, 48 | {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, 49 | {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, 50 | {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, 51 | {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, 52 | {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, 53 | {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, 54 | {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, 55 | {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, 56 | {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, 57 | {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, 58 | {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, 59 | {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, 60 | {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, 61 | {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, 62 | {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, 63 | {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, 64 | {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, 65 | {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, 66 | {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, 67 | {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, 68 | {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, 69 | {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, 70 | {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, 71 | {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, 72 | {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, 73 | {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, 74 | {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, 75 | {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, 76 | {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, 77 | {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, 78 | {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, 79 | {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, 80 | {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, 81 | {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, 82 | {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, 83 | {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, 84 | {0,9,255} 85 | }; 86 | 87 | static const code distfix[32] = { 88 | {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, 89 | {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, 90 | {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, 91 | {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, 92 | {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, 93 | {22,5,193},{64,5,0} 94 | }; 95 | -------------------------------------------------------------------------------- /VS Project/zip/inflate.h: -------------------------------------------------------------------------------- 1 | /* inflate.h -- internal inflate state definition 2 | * Copyright (C) 1995-2016 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* define NO_GZIP when compiling if you want to disable gzip header and 12 | trailer decoding by inflate(). NO_GZIP would be used to avoid linking in 13 | the crc code when it is not needed. For shared libraries, gzip decoding 14 | should be left enabled. */ 15 | #ifndef NO_GZIP 16 | # define GUNZIP 17 | #endif 18 | 19 | /* Possible inflate modes between inflate() calls */ 20 | typedef enum { 21 | HEAD = 16180, /* i: waiting for magic header */ 22 | FLAGS, /* i: waiting for method and flags (gzip) */ 23 | TIME, /* i: waiting for modification time (gzip) */ 24 | OS, /* i: waiting for extra flags and operating system (gzip) */ 25 | EXLEN, /* i: waiting for extra length (gzip) */ 26 | EXTRA, /* i: waiting for extra bytes (gzip) */ 27 | NAME, /* i: waiting for end of file name (gzip) */ 28 | COMMENT, /* i: waiting for end of comment (gzip) */ 29 | HCRC, /* i: waiting for header crc (gzip) */ 30 | DICTID, /* i: waiting for dictionary check value */ 31 | DICT, /* waiting for inflateSetDictionary() call */ 32 | TYPE, /* i: waiting for type bits, including last-flag bit */ 33 | TYPEDO, /* i: same, but skip check to exit inflate on new block */ 34 | STORED, /* i: waiting for stored size (length and complement) */ 35 | COPY_, /* i/o: same as COPY below, but only first time in */ 36 | COPY, /* i/o: waiting for input or output to copy stored block */ 37 | TABLE, /* i: waiting for dynamic block table lengths */ 38 | LENLENS, /* i: waiting for code length code lengths */ 39 | CODELENS, /* i: waiting for length/lit and distance code lengths */ 40 | LEN_, /* i: same as LEN below, but only first time in */ 41 | LEN, /* i: waiting for length/lit/eob code */ 42 | LENEXT, /* i: waiting for length extra bits */ 43 | DIST, /* i: waiting for distance code */ 44 | DISTEXT, /* i: waiting for distance extra bits */ 45 | MATCH, /* o: waiting for output space to copy string */ 46 | LIT, /* o: waiting for output space to write literal */ 47 | CHECK, /* i: waiting for 32-bit check value */ 48 | LENGTH, /* i: waiting for 32-bit length (gzip) */ 49 | DONE, /* finished check, done -- remain here until reset */ 50 | BAD, /* got a data error -- remain here until reset */ 51 | MEM, /* got an inflate() memory error -- remain here until reset */ 52 | SYNC /* looking for synchronization bytes to restart inflate() */ 53 | } inflate_mode; 54 | 55 | /* 56 | State transitions between above modes - 57 | 58 | (most modes can go to BAD or MEM on error -- not shown for clarity) 59 | 60 | Process header: 61 | HEAD -> (gzip) or (zlib) or (raw) 62 | (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT -> 63 | HCRC -> TYPE 64 | (zlib) -> DICTID or TYPE 65 | DICTID -> DICT -> TYPE 66 | (raw) -> TYPEDO 67 | Read deflate blocks: 68 | TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK 69 | STORED -> COPY_ -> COPY -> TYPE 70 | TABLE -> LENLENS -> CODELENS -> LEN_ 71 | LEN_ -> LEN 72 | Read deflate codes in fixed or dynamic block: 73 | LEN -> LENEXT or LIT or TYPE 74 | LENEXT -> DIST -> DISTEXT -> MATCH -> LEN 75 | LIT -> LEN 76 | Process trailer: 77 | CHECK -> LENGTH -> DONE 78 | */ 79 | 80 | /* State maintained between inflate() calls -- approximately 7K bytes, not 81 | including the allocated sliding window, which is up to 32K bytes. */ 82 | struct inflate_state { 83 | z_streamp strm; /* pointer back to this zlib stream */ 84 | inflate_mode mode; /* current inflate mode */ 85 | int last; /* true if processing last block */ 86 | int wrap; /* bit 0 true for zlib, bit 1 true for gzip, 87 | bit 2 true to validate check value */ 88 | int havedict; /* true if dictionary provided */ 89 | int flags; /* gzip header method and flags (0 if zlib) */ 90 | unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ 91 | unsigned long check; /* protected copy of check value */ 92 | unsigned long total; /* protected copy of output count */ 93 | gz_headerp head; /* where to save gzip header information */ 94 | /* sliding window */ 95 | unsigned wbits; /* log base 2 of requested window size */ 96 | unsigned wsize; /* window size or zero if not using window */ 97 | unsigned whave; /* valid bytes in the window */ 98 | unsigned wnext; /* window write index */ 99 | unsigned char FAR *window; /* allocated sliding window, if needed */ 100 | /* bit accumulator */ 101 | unsigned long hold; /* input bit accumulator */ 102 | unsigned bits; /* number of bits in "in" */ 103 | /* for string and stored block copying */ 104 | unsigned length; /* literal or length of data to copy */ 105 | unsigned offset; /* distance back to copy string from */ 106 | /* for table and code decoding */ 107 | unsigned extra; /* extra bits needed */ 108 | /* fixed and dynamic code tables */ 109 | code const FAR *lencode; /* starting table for length/literal codes */ 110 | code const FAR *distcode; /* starting table for distance codes */ 111 | unsigned lenbits; /* index bits for lencode */ 112 | unsigned distbits; /* index bits for distcode */ 113 | /* dynamic table building */ 114 | unsigned ncode; /* number of code length code lengths */ 115 | unsigned nlen; /* number of length code lengths */ 116 | unsigned ndist; /* number of distance code lengths */ 117 | unsigned have; /* number of code lengths in lens[] */ 118 | code FAR *next; /* next available space in codes[] */ 119 | unsigned short lens[320]; /* temporary storage for code lengths */ 120 | unsigned short work[288]; /* work area for code table building */ 121 | code codes[ENOUGH]; /* space for code tables */ 122 | int sane; /* if false, allow invalid distance too far */ 123 | int back; /* bits back of last unprocessed length/lit */ 124 | unsigned was; /* initial length of match */ 125 | }; 126 | -------------------------------------------------------------------------------- /VS Project/zip/inftrees.h: -------------------------------------------------------------------------------- 1 | /* inftrees.h -- header to use inftrees.c 2 | * Copyright (C) 1995-2005, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 0001eeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of the dynamic table. The maximum number of code structures is 39 | 1444, which is the sum of 852 for literal/length codes and 592 for distance 40 | codes. These values were found by exhaustive searches using the program 41 | examples/enough.c found in the zlib distribtution. The arguments to that 42 | program are the number of symbols, the initial root table size, and the 43 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 44 | returns returns 852, and "enough 30 6 15" for distance codes returns 592. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in inflate.c and infback.c. If the root table size is 47 | changed, then these maximum sizes would be need to be recalculated and 48 | updated. */ 49 | #define ENOUGH_LENS 852 50 | #define ENOUGH_DISTS 592 51 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 52 | 53 | /* Type of code to build for inflate_table() */ 54 | typedef enum { 55 | CODES, 56 | LENS, 57 | DISTS 58 | } codetype; 59 | 60 | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, 61 | unsigned codes, code FAR * FAR *table, 62 | unsigned FAR *bits, unsigned short FAR *work)); 63 | -------------------------------------------------------------------------------- /VS Project/zip/ioapi.c: -------------------------------------------------------------------------------- 1 | /* ioapi.c -- IO base function header for compress/uncompress .zip 2 | files using zlib + zip or unzip API 3 | 4 | Version 1.01e, February 12th, 2005 5 | 6 | Copyright (C) 1998-2005 Gilles Vollant 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include "zlib.h" 14 | #include "ioapi.h" 15 | 16 | 17 | 18 | /* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ 19 | 20 | #ifndef SEEK_CUR 21 | #define SEEK_CUR 1 22 | #endif 23 | 24 | #ifndef SEEK_END 25 | #define SEEK_END 2 26 | #endif 27 | 28 | #ifndef SEEK_SET 29 | #define SEEK_SET 0 30 | #endif 31 | 32 | voidpf ZCALLBACK fopen_file_func OF(( 33 | voidpf opaque, 34 | const char* filename, 35 | int mode)); 36 | 37 | uLong ZCALLBACK fread_file_func OF(( 38 | voidpf opaque, 39 | voidpf stream, 40 | void* buf, 41 | uLong size)); 42 | 43 | uLong ZCALLBACK fwrite_file_func OF(( 44 | voidpf opaque, 45 | voidpf stream, 46 | const void* buf, 47 | uLong size)); 48 | 49 | long ZCALLBACK ftell_file_func OF(( 50 | voidpf opaque, 51 | voidpf stream)); 52 | 53 | long ZCALLBACK fseek_file_func OF(( 54 | voidpf opaque, 55 | voidpf stream, 56 | uLong offset, 57 | int origin)); 58 | 59 | int ZCALLBACK fclose_file_func OF(( 60 | voidpf opaque, 61 | voidpf stream)); 62 | 63 | int ZCALLBACK ferror_file_func OF(( 64 | voidpf opaque, 65 | voidpf stream)); 66 | 67 | 68 | voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) 69 | voidpf opaque; 70 | const char* filename; 71 | int mode; 72 | { 73 | FILE* file = NULL; 74 | const char* mode_fopen = NULL; 75 | if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) 76 | mode_fopen = "rb"; 77 | else 78 | if (mode & ZLIB_FILEFUNC_MODE_EXISTING) 79 | mode_fopen = "r+b"; 80 | else 81 | if (mode & ZLIB_FILEFUNC_MODE_CREATE) 82 | mode_fopen = "wb"; 83 | 84 | if ((filename!=NULL) && (mode_fopen != NULL)) 85 | file = fopen(filename, mode_fopen); 86 | return file; 87 | } 88 | 89 | 90 | uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) 91 | voidpf opaque; 92 | voidpf stream; 93 | void* buf; 94 | uLong size; 95 | { 96 | uLong ret; 97 | ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); 98 | return ret; 99 | } 100 | 101 | 102 | uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) 103 | voidpf opaque; 104 | voidpf stream; 105 | const void* buf; 106 | uLong size; 107 | { 108 | uLong ret; 109 | ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); 110 | return ret; 111 | } 112 | 113 | long ZCALLBACK ftell_file_func (opaque, stream) 114 | voidpf opaque; 115 | voidpf stream; 116 | { 117 | long ret; 118 | ret = ftell((FILE *)stream); 119 | return ret; 120 | } 121 | 122 | long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) 123 | voidpf opaque; 124 | voidpf stream; 125 | uLong offset; 126 | int origin; 127 | { 128 | int fseek_origin=0; 129 | long ret; 130 | switch (origin) 131 | { 132 | case ZLIB_FILEFUNC_SEEK_CUR : 133 | fseek_origin = SEEK_CUR; 134 | break; 135 | case ZLIB_FILEFUNC_SEEK_END : 136 | fseek_origin = SEEK_END; 137 | break; 138 | case ZLIB_FILEFUNC_SEEK_SET : 139 | fseek_origin = SEEK_SET; 140 | break; 141 | default: return -1; 142 | } 143 | ret = 0; 144 | fseek((FILE *)stream, offset, fseek_origin); 145 | return ret; 146 | } 147 | 148 | int ZCALLBACK fclose_file_func (opaque, stream) 149 | voidpf opaque; 150 | voidpf stream; 151 | { 152 | int ret; 153 | ret = fclose((FILE *)stream); 154 | return ret; 155 | } 156 | 157 | int ZCALLBACK ferror_file_func (opaque, stream) 158 | voidpf opaque; 159 | voidpf stream; 160 | { 161 | int ret; 162 | ret = ferror((FILE *)stream); 163 | return ret; 164 | } 165 | 166 | void fill_fopen_filefunc (pzlib_filefunc_def) 167 | zlib_filefunc_def* pzlib_filefunc_def; 168 | { 169 | pzlib_filefunc_def->zopen_file = fopen_file_func; 170 | pzlib_filefunc_def->zread_file = fread_file_func; 171 | pzlib_filefunc_def->zwrite_file = fwrite_file_func; 172 | pzlib_filefunc_def->ztell_file = ftell_file_func; 173 | pzlib_filefunc_def->zseek_file = fseek_file_func; 174 | pzlib_filefunc_def->zclose_file = fclose_file_func; 175 | pzlib_filefunc_def->zerror_file = ferror_file_func; 176 | pzlib_filefunc_def->opaque = NULL; 177 | } 178 | -------------------------------------------------------------------------------- /VS Project/zip/ioapi.h: -------------------------------------------------------------------------------- 1 | /* ioapi.h -- IO base function header for compress/uncompress .zip 2 | files using zlib + zip or unzip API 3 | 4 | Version 1.01e, February 12th, 2005 5 | 6 | Copyright (C) 1998-2005 Gilles Vollant 7 | */ 8 | 9 | #ifndef _ZLIBIOAPI_H 10 | #define _ZLIBIOAPI_H 11 | 12 | 13 | #define ZLIB_FILEFUNC_SEEK_CUR (1) 14 | #define ZLIB_FILEFUNC_SEEK_END (2) 15 | #define ZLIB_FILEFUNC_SEEK_SET (0) 16 | 17 | #define ZLIB_FILEFUNC_MODE_READ (1) 18 | #define ZLIB_FILEFUNC_MODE_WRITE (2) 19 | #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) 20 | 21 | #define ZLIB_FILEFUNC_MODE_EXISTING (4) 22 | #define ZLIB_FILEFUNC_MODE_CREATE (8) 23 | 24 | 25 | #ifndef ZCALLBACK 26 | 27 | #if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) 28 | #define ZCALLBACK CALLBACK 29 | #else 30 | #define ZCALLBACK 31 | #endif 32 | #endif 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); 39 | typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); 40 | typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); 41 | typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); 42 | typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); 43 | typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); 44 | typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); 45 | 46 | typedef struct zlib_filefunc_def_s 47 | { 48 | open_file_func zopen_file; 49 | read_file_func zread_file; 50 | write_file_func zwrite_file; 51 | tell_file_func ztell_file; 52 | seek_file_func zseek_file; 53 | close_file_func zclose_file; 54 | testerror_file_func zerror_file; 55 | voidpf opaque; 56 | } zlib_filefunc_def; 57 | 58 | 59 | 60 | void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); 61 | 62 | #define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) 63 | #define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) 64 | #define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) 65 | #define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) 66 | #define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) 67 | #define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) 68 | 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif 75 | 76 | -------------------------------------------------------------------------------- /VS Project/zip/iowin32.c: -------------------------------------------------------------------------------- 1 | /* iowin32.c -- IO base function header for compress/uncompress .zip 2 | files using zlib + zip or unzip API 3 | This IO API version uses the Win32 API (for Microsoft Windows) 4 | 5 | Version 1.01e, February 12th, 2005 6 | 7 | Copyright (C) 1998-2005 Gilles Vollant 8 | */ 9 | 10 | #include 11 | 12 | #include "zlib.h" 13 | #include "ioapi.h" 14 | #include "iowin32.h" 15 | 16 | #ifndef INVALID_HANDLE_VALUE 17 | #define INVALID_HANDLE_VALUE (0xFFFFFFFF) 18 | #endif 19 | 20 | #ifndef INVALID_SET_FILE_POINTER 21 | #define INVALID_SET_FILE_POINTER ((DWORD)-1) 22 | #endif 23 | 24 | voidpf ZCALLBACK win32_open_file_func OF(( 25 | voidpf opaque, 26 | const char* filename, 27 | int mode)); 28 | 29 | uLong ZCALLBACK win32_read_file_func OF(( 30 | voidpf opaque, 31 | voidpf stream, 32 | void* buf, 33 | uLong size)); 34 | 35 | uLong ZCALLBACK win32_write_file_func OF(( 36 | voidpf opaque, 37 | voidpf stream, 38 | const void* buf, 39 | uLong size)); 40 | 41 | long ZCALLBACK win32_tell_file_func OF(( 42 | voidpf opaque, 43 | voidpf stream)); 44 | 45 | long ZCALLBACK win32_seek_file_func OF(( 46 | voidpf opaque, 47 | voidpf stream, 48 | uLong offset, 49 | int origin)); 50 | 51 | int ZCALLBACK win32_close_file_func OF(( 52 | voidpf opaque, 53 | voidpf stream)); 54 | 55 | int ZCALLBACK win32_error_file_func OF(( 56 | voidpf opaque, 57 | voidpf stream)); 58 | 59 | typedef struct 60 | { 61 | HANDLE hf; 62 | int error; 63 | } WIN32FILE_IOWIN; 64 | 65 | voidpf ZCALLBACK win32_open_file_func (opaque, filename, mode) 66 | voidpf opaque; 67 | const char* filename; 68 | int mode; 69 | { 70 | const char* mode_fopen = NULL; 71 | DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; 72 | HANDLE hFile = 0; 73 | voidpf ret=NULL; 74 | 75 | dwDesiredAccess = dwShareMode = dwFlagsAndAttributes = 0; 76 | 77 | if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) 78 | { 79 | dwDesiredAccess = GENERIC_READ; 80 | dwCreationDisposition = OPEN_EXISTING; 81 | dwShareMode = FILE_SHARE_READ; 82 | } 83 | else 84 | if (mode & ZLIB_FILEFUNC_MODE_EXISTING) 85 | { 86 | dwDesiredAccess = GENERIC_WRITE | GENERIC_READ; 87 | dwCreationDisposition = OPEN_EXISTING; 88 | } 89 | else 90 | if (mode & ZLIB_FILEFUNC_MODE_CREATE) 91 | { 92 | dwDesiredAccess = GENERIC_WRITE | GENERIC_READ; 93 | dwCreationDisposition = CREATE_ALWAYS; 94 | } 95 | 96 | if ((filename!=NULL) && (dwDesiredAccess != 0)) 97 | hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, 98 | dwCreationDisposition, dwFlagsAndAttributes, NULL); 99 | 100 | if (hFile == INVALID_HANDLE_VALUE) 101 | hFile = NULL; 102 | 103 | if (hFile != NULL) 104 | { 105 | WIN32FILE_IOWIN w32fiow; 106 | w32fiow.hf = hFile; 107 | w32fiow.error = 0; 108 | ret = malloc(sizeof(WIN32FILE_IOWIN)); 109 | if (ret==NULL) 110 | CloseHandle(hFile); 111 | else *((WIN32FILE_IOWIN*)ret) = w32fiow; 112 | } 113 | return ret; 114 | } 115 | 116 | 117 | uLong ZCALLBACK win32_read_file_func (opaque, stream, buf, size) 118 | voidpf opaque; 119 | voidpf stream; 120 | void* buf; 121 | uLong size; 122 | { 123 | uLong ret=0; 124 | HANDLE hFile = NULL; 125 | if (stream!=NULL) 126 | hFile = ((WIN32FILE_IOWIN*)stream) -> hf; 127 | if (hFile != NULL) 128 | if (!ReadFile(hFile, buf, size, &ret, NULL)) 129 | { 130 | DWORD dwErr = GetLastError(); 131 | if (dwErr == ERROR_HANDLE_EOF) 132 | dwErr = 0; 133 | ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; 134 | } 135 | 136 | return ret; 137 | } 138 | 139 | 140 | uLong ZCALLBACK win32_write_file_func (opaque, stream, buf, size) 141 | voidpf opaque; 142 | voidpf stream; 143 | const void* buf; 144 | uLong size; 145 | { 146 | uLong ret=0; 147 | HANDLE hFile = NULL; 148 | if (stream!=NULL) 149 | hFile = ((WIN32FILE_IOWIN*)stream) -> hf; 150 | 151 | if (hFile !=NULL) 152 | if (!WriteFile(hFile, buf, size, &ret, NULL)) 153 | { 154 | DWORD dwErr = GetLastError(); 155 | if (dwErr == ERROR_HANDLE_EOF) 156 | dwErr = 0; 157 | ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; 158 | } 159 | 160 | return ret; 161 | } 162 | 163 | long ZCALLBACK win32_tell_file_func (opaque, stream) 164 | voidpf opaque; 165 | voidpf stream; 166 | { 167 | long ret=-1; 168 | HANDLE hFile = NULL; 169 | if (stream!=NULL) 170 | hFile = ((WIN32FILE_IOWIN*)stream) -> hf; 171 | if (hFile != NULL) 172 | { 173 | DWORD dwSet = SetFilePointer(hFile, 0, NULL, FILE_CURRENT); 174 | if (dwSet == INVALID_SET_FILE_POINTER) 175 | { 176 | DWORD dwErr = GetLastError(); 177 | ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; 178 | ret = -1; 179 | } 180 | else 181 | ret=(long)dwSet; 182 | } 183 | return ret; 184 | } 185 | 186 | long ZCALLBACK win32_seek_file_func (opaque, stream, offset, origin) 187 | voidpf opaque; 188 | voidpf stream; 189 | uLong offset; 190 | int origin; 191 | { 192 | DWORD dwMoveMethod=0xFFFFFFFF; 193 | HANDLE hFile = NULL; 194 | 195 | long ret=-1; 196 | if (stream!=NULL) 197 | hFile = ((WIN32FILE_IOWIN*)stream) -> hf; 198 | switch (origin) 199 | { 200 | case ZLIB_FILEFUNC_SEEK_CUR : 201 | dwMoveMethod = FILE_CURRENT; 202 | break; 203 | case ZLIB_FILEFUNC_SEEK_END : 204 | dwMoveMethod = FILE_END; 205 | break; 206 | case ZLIB_FILEFUNC_SEEK_SET : 207 | dwMoveMethod = FILE_BEGIN; 208 | break; 209 | default: return -1; 210 | } 211 | 212 | if (hFile != NULL) 213 | { 214 | DWORD dwSet = SetFilePointer(hFile, offset, NULL, dwMoveMethod); 215 | if (dwSet == INVALID_SET_FILE_POINTER) 216 | { 217 | DWORD dwErr = GetLastError(); 218 | ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; 219 | ret = -1; 220 | } 221 | else 222 | ret=0; 223 | } 224 | return ret; 225 | } 226 | 227 | int ZCALLBACK win32_close_file_func (opaque, stream) 228 | voidpf opaque; 229 | voidpf stream; 230 | { 231 | int ret=-1; 232 | 233 | if (stream!=NULL) 234 | { 235 | HANDLE hFile; 236 | hFile = ((WIN32FILE_IOWIN*)stream) -> hf; 237 | if (hFile != NULL) 238 | { 239 | CloseHandle(hFile); 240 | ret=0; 241 | } 242 | free(stream); 243 | } 244 | return ret; 245 | } 246 | 247 | int ZCALLBACK win32_error_file_func (opaque, stream) 248 | voidpf opaque; 249 | voidpf stream; 250 | { 251 | int ret=-1; 252 | if (stream!=NULL) 253 | { 254 | ret = ((WIN32FILE_IOWIN*)stream) -> error; 255 | } 256 | return ret; 257 | } 258 | 259 | void fill_win32_filefunc (pzlib_filefunc_def) 260 | zlib_filefunc_def* pzlib_filefunc_def; 261 | { 262 | pzlib_filefunc_def->zopen_file = win32_open_file_func; 263 | pzlib_filefunc_def->zread_file = win32_read_file_func; 264 | pzlib_filefunc_def->zwrite_file = win32_write_file_func; 265 | pzlib_filefunc_def->ztell_file = win32_tell_file_func; 266 | pzlib_filefunc_def->zseek_file = win32_seek_file_func; 267 | pzlib_filefunc_def->zclose_file = win32_close_file_func; 268 | pzlib_filefunc_def->zerror_file = win32_error_file_func; 269 | pzlib_filefunc_def->opaque=NULL; 270 | } 271 | -------------------------------------------------------------------------------- /VS Project/zip/iowin32.h: -------------------------------------------------------------------------------- 1 | /* iowin32.h -- IO base function header for compress/uncompress .zip 2 | files using zlib + zip or unzip API 3 | This IO API version uses the Win32 API (for Microsoft Windows) 4 | 5 | Version 1.01e, February 12th, 2005 6 | 7 | Copyright (C) 1998-2005 Gilles Vollant 8 | */ 9 | 10 | #include 11 | 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /VS Project/zip/mztools.h: -------------------------------------------------------------------------------- 1 | /* 2 | Additional tools for Minizip 3 | Code: Xavier Roche '2004 4 | License: Same as ZLIB (www.gzip.org) 5 | */ 6 | 7 | #ifndef _zip_tools_H 8 | #define _zip_tools_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifndef _ZLIB_H 15 | #include "zlib.h" 16 | #endif 17 | 18 | #include "unzip.h" 19 | 20 | /* Repair a ZIP file (missing central directory) 21 | file: file to recover 22 | fileOut: output file after recovery 23 | fileOutTmp: temporary file name used for recovery 24 | */ 25 | extern int ZEXPORT unzRepair(const char* file, 26 | const char* fileOut, 27 | const char* fileOutTmp, 28 | uLong* nRecovered, 29 | uLong* bytesRecovered); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /VS Project/zip/zutil.h: -------------------------------------------------------------------------------- 1 | /* zutil.h -- internal interface and configuration of the compression library 2 | * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* @(#) $Id$ */ 12 | 13 | #ifndef ZUTIL_H 14 | #define ZUTIL_H 15 | 16 | #ifdef HAVE_HIDDEN 17 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) 18 | #else 19 | # define ZLIB_INTERNAL 20 | #endif 21 | 22 | #include "zlib.h" 23 | 24 | #if defined(STDC) && !defined(Z_SOLO) 25 | # if !(defined(_WIN32_WCE) && defined(_MSC_VER)) 26 | # include 27 | # endif 28 | # include 29 | # include 30 | #endif 31 | 32 | #ifdef Z_SOLO 33 | typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */ 34 | #endif 35 | 36 | #ifndef local 37 | # define local static 38 | #endif 39 | /* since "static" is used to mean two completely different things in C, we 40 | define "local" for the non-static meaning of "static", for readability 41 | (compile with -Dlocal if your debugger can't find static symbols) */ 42 | 43 | typedef unsigned char uch; 44 | typedef uch FAR uchf; 45 | typedef unsigned short ush; 46 | typedef ush FAR ushf; 47 | typedef unsigned long ulg; 48 | 49 | extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ 50 | /* (size given to avoid silly warnings with Visual C++) */ 51 | 52 | #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] 53 | 54 | #define ERR_RETURN(strm,err) \ 55 | return (strm->msg = ERR_MSG(err), (err)) 56 | /* To be used only when the state is known to be valid */ 57 | 58 | /* common constants */ 59 | 60 | #ifndef DEF_WBITS 61 | # define DEF_WBITS MAX_WBITS 62 | #endif 63 | /* default windowBits for decompression. MAX_WBITS is for compression only */ 64 | 65 | #if MAX_MEM_LEVEL >= 8 66 | # define DEF_MEM_LEVEL 8 67 | #else 68 | # define DEF_MEM_LEVEL MAX_MEM_LEVEL 69 | #endif 70 | /* default memLevel */ 71 | 72 | #define STORED_BLOCK 0 73 | #define STATIC_TREES 1 74 | #define DYN_TREES 2 75 | /* The three kinds of block type */ 76 | 77 | #define MIN_MATCH 3 78 | #define MAX_MATCH 258 79 | /* The minimum and maximum match lengths */ 80 | 81 | #define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ 82 | 83 | /* target dependencies */ 84 | 85 | #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) 86 | # define OS_CODE 0x00 87 | # ifndef Z_SOLO 88 | # if defined(__TURBOC__) || defined(__BORLANDC__) 89 | # if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) 90 | /* Allow compilation with ANSI keywords only enabled */ 91 | void _Cdecl farfree( void *block ); 92 | void *_Cdecl farmalloc( unsigned long nbytes ); 93 | # else 94 | # include 95 | # endif 96 | # else /* MSC or DJGPP */ 97 | # include 98 | # endif 99 | # endif 100 | #endif 101 | 102 | #ifdef AMIGA 103 | # define OS_CODE 1 104 | #endif 105 | 106 | #if defined(VAXC) || defined(VMS) 107 | # define OS_CODE 2 108 | # define F_OPEN(name, mode) \ 109 | fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") 110 | #endif 111 | 112 | #ifdef __370__ 113 | # if __TARGET_LIB__ < 0x20000000 114 | # define OS_CODE 4 115 | # elif __TARGET_LIB__ < 0x40000000 116 | # define OS_CODE 11 117 | # else 118 | # define OS_CODE 8 119 | # endif 120 | #endif 121 | 122 | #if defined(ATARI) || defined(atarist) 123 | # define OS_CODE 5 124 | #endif 125 | 126 | #ifdef OS2 127 | # define OS_CODE 6 128 | # if defined(M_I86) && !defined(Z_SOLO) 129 | # include 130 | # endif 131 | #endif 132 | 133 | #if defined(MACOS) || defined(TARGET_OS_MAC) 134 | # define OS_CODE 7 135 | # ifndef Z_SOLO 136 | # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os 137 | # include /* for fdopen */ 138 | # else 139 | # ifndef fdopen 140 | # define fdopen(fd,mode) NULL /* No fdopen() */ 141 | # endif 142 | # endif 143 | # endif 144 | #endif 145 | 146 | #ifdef __acorn 147 | # define OS_CODE 13 148 | #endif 149 | 150 | #if defined(WIN32) && !defined(__CYGWIN__) 151 | # define OS_CODE 10 152 | #endif 153 | 154 | #ifdef _BEOS_ 155 | # define OS_CODE 16 156 | #endif 157 | 158 | #ifdef __TOS_OS400__ 159 | # define OS_CODE 18 160 | #endif 161 | 162 | #ifdef __APPLE__ 163 | # define OS_CODE 19 164 | #endif 165 | 166 | #if defined(_BEOS_) || defined(RISCOS) 167 | # define fdopen(fd,mode) NULL /* No fdopen() */ 168 | #endif 169 | 170 | #if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX 171 | # if defined(_WIN32_WCE) 172 | # define fdopen(fd,mode) NULL /* No fdopen() */ 173 | # ifndef _PTRDIFF_T_DEFINED 174 | typedef int ptrdiff_t; 175 | # define _PTRDIFF_T_DEFINED 176 | # endif 177 | # else 178 | # define fdopen(fd,type) _fdopen(fd,type) 179 | # endif 180 | #endif 181 | 182 | #if defined(__BORLANDC__) && !defined(MSDOS) 183 | #pragma warn -8004 184 | #pragma warn -8008 185 | #pragma warn -8066 186 | #endif 187 | 188 | /* provide prototypes for these when building zlib without LFS */ 189 | #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 190 | ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); 191 | ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); 192 | #endif 193 | 194 | /* common defaults */ 195 | 196 | #ifndef OS_CODE 197 | # define OS_CODE 3 /* assume Unix */ 198 | #endif 199 | 200 | #ifndef F_OPEN 201 | # define F_OPEN(name, mode) fopen((name), (mode)) 202 | #endif 203 | 204 | /* functions */ 205 | 206 | #if defined(pyr) || defined(Z_SOLO) 207 | # define NO_MEMCPY 208 | #endif 209 | #if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) 210 | /* Use our own functions for small and medium model with MSC <= 5.0. 211 | * You may have to use the same strategy for Borland C (untested). 212 | * The __SC__ check is for Symantec. 213 | */ 214 | # define NO_MEMCPY 215 | #endif 216 | #if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) 217 | # define HAVE_MEMCPY 218 | #endif 219 | #ifdef HAVE_MEMCPY 220 | # ifdef SMALL_MEDIUM /* MSDOS small or medium model */ 221 | # define zmemcpy _fmemcpy 222 | # define zmemcmp _fmemcmp 223 | # define zmemzero(dest, len) _fmemset(dest, 0, len) 224 | # else 225 | # define zmemcpy memcpy 226 | # define zmemcmp memcmp 227 | # define zmemzero(dest, len) memset(dest, 0, len) 228 | # endif 229 | #else 230 | void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); 231 | int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); 232 | void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len)); 233 | #endif 234 | 235 | /* Diagnostic functions */ 236 | #ifdef ZLIB_DEBUG 237 | # include 238 | extern int ZLIB_INTERNAL z_verbose; 239 | extern void ZLIB_INTERNAL z_error OF((char *m)); 240 | # define Assert(cond,msg) {if(!(cond)) z_error(msg);} 241 | # define Trace(x) {if (z_verbose>=0) fprintf x ;} 242 | # define Tracev(x) {if (z_verbose>0) fprintf x ;} 243 | # define Tracevv(x) {if (z_verbose>1) fprintf x ;} 244 | # define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} 245 | # define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} 246 | #else 247 | # define Assert(cond,msg) 248 | # define Trace(x) 249 | # define Tracev(x) 250 | # define Tracevv(x) 251 | # define Tracec(c,x) 252 | # define Tracecv(c,x) 253 | #endif 254 | 255 | #ifndef Z_SOLO 256 | voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, 257 | unsigned size)); 258 | void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); 259 | #endif 260 | 261 | #define ZALLOC(strm, items, size) \ 262 | (*((strm)->zalloc))((strm)->opaque, (items), (size)) 263 | #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) 264 | #define TRY_FREE(s, p) {if (p) ZFREE(s, p);} 265 | 266 | /* Reverse the bytes in a 32-bit value */ 267 | #define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ 268 | (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) 269 | 270 | #endif /* ZUTIL_H */ 271 | -------------------------------------------------------------------------------- /extension_changesearchengine.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secware-debug/ChromeExtensionSetupTool/86d16c25393cf7cb10fa8605fbf396d2caa94cc7/extension_changesearchengine.zip --------------------------------------------------------------------------------