Browse Source

Merge branch 'master' into virtualize-editor

pull/96/head
nike4613 9 months ago
committed by GitHub
parent
commit
1909332332
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
106 changed files with 3772 additions and 2214 deletions
  1. +246
    -0
      .editorconfig
  2. +11
    -9
      .github/workflows/build.yml
  3. +6
    -1
      .github/workflows/docs.yml
  4. +7
    -2
      .github/workflows/tag_docs.yml
  5. +12
    -0
      .vscode/launch.json
  6. +5
    -2
      BSIPA-Meta/BSIPA-Meta.csproj
  7. +21
    -57
      BSIPA.sln
  8. +1
    -1
      BuildTools
  9. +12
    -0
      Common.props
  10. +0
    -4
      Common.targets
  11. +13
    -4
      Doorstop/Proxy/main.c
  12. +2
    -0
      Doorstop/Proxy/mono.h
  13. +4
    -3
      IPA.Injector/GameVersionEarly.cs
  14. +38
    -17
      IPA.Injector/IPA.Injector.csproj
  15. +38
    -44
      IPA.Injector/Injector.cs
  16. +67
    -67
      IPA.Injector/PermissionFix.cs
  17. +38
    -36
      IPA.Injector/Properties/AssemblyInfo.cs
  18. +31
    -15
      IPA.Injector/Updates.cs
  19. +14
    -0
      IPA.Loader/AntiMalware/AmsiConstants.cs
  20. +13
    -0
      IPA.Loader/AntiMalware/AmsiResult.cs
  21. +46
    -0
      IPA.Loader/AntiMalware/AntiMalwareEngine.cs
  22. +25
    -0
      IPA.Loader/AntiMalware/IAntiMalware.cs
  23. +15
    -0
      IPA.Loader/AntiMalware/NoopAntiMalware.cs
  24. +27
    -0
      IPA.Loader/AntiMalware/ScanResult.cs
  25. +111
    -0
      IPA.Loader/AntiMalware/WindowsWin32AntiMalware.cs
  26. +113
    -0
      IPA.Loader/AntiMalware/_HideInNet3/ComAPI/AmsiFileStream.cs
  27. +114
    -0
      IPA.Loader/AntiMalware/_HideInNet3/ComAPI/AmsiMemoryStream.cs
  28. +52
    -0
      IPA.Loader/AntiMalware/_HideInNet3/ComAPI/IAntimalware.cs
  29. +88
    -0
      IPA.Loader/AntiMalware/_HideInNet3/WindowsCOMAntiMalware.cs
  30. +1
    -1
      IPA.Loader/Config/Config.cs
  31. +6
    -6
      IPA.Loader/Config/ConfigRuntime.cs
  32. +16
    -14
      IPA.Loader/Config/Data/List.cs
  33. +19
    -18
      IPA.Loader/Config/Data/Map.cs
  34. +83
    -7
      IPA.Loader/Config/Data/Primitives.cs
  35. +146
    -145
      IPA.Loader/Config/Data/Value.cs
  36. +9
    -9
      IPA.Loader/Config/Providers/JsonConfigProvider.cs
  37. +58
    -7
      IPA.Loader/Config/SelfConfig.cs
  38. +15
    -5
      IPA.Loader/Config/Stores/Attributes.cs
  39. +17
    -16
      IPA.Loader/Config/Stores/CollectionConverter.cs
  40. +76
    -75
      IPA.Loader/Config/Stores/Converters.cs
  41. +17
    -14
      IPA.Loader/Config/Stores/CustomObjectConverter.cs
  42. +5
    -4
      IPA.Loader/Config/Stores/GeneratedStoreImpl/ConversionDelegates.cs
  43. +2
    -1
      IPA.Loader/Config/Stores/GeneratedStoreImpl/Correction.cs
  44. +8
    -3
      IPA.Loader/Config/Stores/GeneratedStoreImpl/Deserialization.cs
  45. +15
    -11
      IPA.Loader/Config/Stores/GeneratedStoreImpl/GeneratedStoreImpl.cs
  46. +25
    -24
      IPA.Loader/Config/Stores/GeneratedStoreImpl/IGeneratedStore.cs
  47. +9
    -8
      IPA.Loader/Config/Stores/GeneratedStoreImpl/MakeCreator.cs
  48. +25
    -20
      IPA.Loader/Config/Stores/GeneratedStoreImpl/ObjectStructure.cs
  49. +16
    -4
      IPA.Loader/Config/Stores/GeneratedStoreImpl/Serialization.cs
  50. +21
    -18
      IPA.Loader/Config/Stores/GeneratedStoreImpl/Utility.cs
  51. +2
    -1
      IPA.Loader/Config/Stores/GeneratedStorePublicInterface.cs
  52. +8
    -7
      IPA.Loader/Config/Stores/ValueConverter.cs
  53. +22
    -10
      IPA.Loader/IPA.Loader.csproj
  54. +30
    -8
      IPA.Loader/JsonConverters/FeaturesFieldConverter.cs
  55. +20
    -15
      IPA.Loader/JsonConverters/SemverRangeConverter.cs
  56. +19
    -17
      IPA.Loader/JsonConverters/SemverVersionConverter.cs
  57. +1
    -1
      IPA.Loader/Loader/Composite/CompositeBSPlugin.cs
  58. +1
    -1
      IPA.Loader/Loader/Composite/CompositeIPAPlugin.cs
  59. +21
    -0
      IPA.Loader/Loader/DependencyResolutionLoopException.cs
  60. +3
    -3
      IPA.Loader/Loader/DisabledConfig.cs
  61. +4
    -3
      IPA.Loader/Loader/Features/ConfigProviderFeature.cs
  62. +13
    -12
      IPA.Loader/Loader/Features/DefineFeature.cs
  63. +0
    -1
      IPA.Loader/Loader/HarmonyProtector.cs
  64. +233
    -244
      IPA.Loader/Loader/LibLoader.cs
  65. +9
    -5
      IPA.Loader/Loader/PluginExecutor.cs
  66. +120
    -51
      IPA.Loader/Loader/PluginInitInjector.cs
  67. +224
    -374
      IPA.Loader/Loader/PluginLoader.cs
  68. +25
    -27
      IPA.Loader/Loader/PluginManager.cs
  69. +7
    -6
      IPA.Loader/Loader/PluginManifest.cs
  70. +11
    -3
      IPA.Loader/Loader/PluginMetadata.cs
  71. +24
    -24
      IPA.Loader/Loader/StateTransitionTransaction.cs
  72. +1
    -5
      IPA.Loader/Loader/description.md
  73. +9
    -7
      IPA.Loader/Loader/manifest.json
  74. +39
    -38
      IPA.Loader/Logging/LogPrinter.cs
  75. +15
    -12
      IPA.Loader/Logging/Logger.cs
  76. +159
    -116
      IPA.Loader/Logging/Printers/ColoredConsolePrinter.cs
  77. +169
    -157
      IPA.Loader/Logging/Printers/GZFilePrinter.cs
  78. +8
    -5
      IPA.Loader/Logging/StandardLogger.cs
  79. +51
    -21
      IPA.Loader/Logging/StdoutInterceptor.cs
  80. +16
    -0
      IPA.Loader/PluginInterfaces/Attributes/LifecycleAttributes.cs
  81. +3
    -1
      IPA.Loader/Properties/AssemblyInfo.cs
  82. +323
    -270
      IPA.Loader/Utilities/AlmostVersion.cs
  83. +4
    -4
      IPA.Loader/Utilities/Async/Coroutines.cs
  84. +28
    -10
      IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs
  85. +9
    -12
      IPA.Loader/Utilities/CriticalSection.cs
  86. +2
    -0
      IPA.Loader/Utilities/EnumerableExtensions.cs
  87. +13
    -0
      IPA.Loader/Utilities/ReflectionUtil.cs
  88. +82
    -18
      IPA.Loader/Utilities/UnityGame.cs
  89. +68
    -23
      IPA.Loader/Utilities/Utils.cs
  90. +1
    -1
      IPA/IPA.csproj
  91. +1
    -1
      IPA/Program.cs
  92. +0
    -10
      IPA/_Attributes.cs
  93. BIN
      Libs/netstandard.dll
  94. +2
    -2
      README.md
  95. BIN
      Refs/UnityEngine.CoreModule.Net4.dll
  96. BIN
      Refs/UnityEngine.CoreModule.net3.dll
  97. BIN
      Refs/UnityEngine.Net4.dll
  98. BIN
      Refs/UnityEngine.UnityWebRequestModule.Net4.dll
  99. BIN
      Refs/UnityEngine.UnityWebRequestModule.net3.dll
  100. BIN
      Refs/UnityEngine.net3.dll

+ 246
- 0
.editorconfig View File

@ -0,0 +1,246 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
tab_width = 4
# New line preferences
end_of_line = crlf
insert_final_newline = false
#### .NET Coding Conventions ####
# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false
file_header_template = unset
# this. and Me. preferences
dotnet_style_qualification_for_event = false
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_property = false
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members
# Expression-level preferences
dotnet_style_coalesce_expression = true
dotnet_style_collection_initializer = true
dotnet_style_explicit_tuple_names = true
dotnet_style_namespace_match_folder = true
dotnet_style_null_propagation = true
dotnet_style_object_initializer = true
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_auto_properties = true:warning
dotnet_style_prefer_compound_assignment = true:warning
dotnet_style_prefer_conditional_expression_over_assignment = true:warning
dotnet_style_prefer_conditional_expression_over_return = true:warning
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
dotnet_style_prefer_inferred_anonymous_type_member_names = true
dotnet_style_prefer_inferred_tuple_names = true
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
dotnet_style_prefer_simplified_boolean_expressions = true:warning
dotnet_style_prefer_simplified_interpolation = true
# Field preferences
dotnet_style_readonly_field = true
# Parameter preferences
dotnet_code_quality_unused_parameters = all
# Suppression preferences
dotnet_remove_unnecessary_suppression_exclusions = none
# New line preferences
dotnet_style_allow_multiple_blank_lines_experimental = true
dotnet_style_allow_statement_immediately_after_block_experimental = true
#### C# Coding Conventions ####
# var preferences
csharp_style_var_elsewhere = false
csharp_style_var_for_built_in_types = false
csharp_style_var_when_type_is_apparent = false
# Expression-bodied members
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_lambdas = true:suggestion
csharp_style_expression_bodied_local_functions = when_on_single_line:suggestion
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true
csharp_style_pattern_matching_over_is_with_cast_check = true
csharp_style_prefer_extended_property_pattern = true
csharp_style_prefer_not_pattern = true:warning
csharp_style_prefer_pattern_matching = true:warning
csharp_style_prefer_switch_expression = true
# Null-checking preferences
csharp_style_conditional_delegate_call = true
# Modifier preferences
csharp_prefer_static_local_function = true:warning
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
# Code-block preferences
csharp_prefer_braces = true:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
# Expression-level preferences
csharp_prefer_simple_default_expression = true
csharp_style_deconstructed_variable_declaration = true
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
csharp_style_inlined_variable_declaration = true
csharp_style_prefer_index_operator = true:warning
csharp_style_prefer_local_over_anonymous_function = true:warning
csharp_style_prefer_null_check_over_type_check = true
csharp_style_prefer_range_operator = true
csharp_style_prefer_tuple_swap = true
csharp_style_prefer_utf8_string_literals = true
csharp_style_throw_expression = true
csharp_style_unused_value_assignment_preference = discard_variable:warning
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
# 'using' directive preferences
csharp_using_directive_placement = outside_namespace:warning
# New line preferences
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
csharp_style_allow_embedded_statements_on_same_line_experimental = true
#### C# Formatting Rules ####
# New line preferences
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
#### Naming styles ####
# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
# Symbol specifications
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
# Naming styles
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
[*.{cs,vb}]
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
dotnet_style_prefer_auto_properties = true:warning
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:warning
dotnet_style_prefer_conditional_expression_over_assignment = true:warning
dotnet_style_prefer_conditional_expression_over_return = true:warning
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:warning
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion

+ 11
- 9
.github/workflows/build.yml View File

@ -12,6 +12,8 @@ defaults:
run:
shell: pwsh
permissions: read-all
jobs:
build:
runs-on: windows-latest
@ -33,20 +35,20 @@ jobs:
uses: actions/setup-dotnet@v1
with:
# As usual, obtained from: https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/5.0/releases.json
dotnet-version: "3.1.404" # since we now use this
dotnet-version: "6.0.100" # since we now use this
- name: Log in to package source
shell: pwsh
run: |
dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} `
--store-password-in-clear-text --name github "https://nuget.pkg.github.com/Atlas-Rhythm/index.json"
- name: Clear Nuget Cache
run: dotnet nuget locals all --clear
- name: Restore
run: msbuild -t:Restore -m
- name: Build
run: msbuild -t:Build -m
- name: Upload net461
uses: actions/upload-artifact@v2
with:
name: BSIPA-net461-${{ env.Platform }}
path: BSIPA-Meta/bin/${{ env.Platform }}/${{ env.Configuration }}/net461/
- name: Upload net35
- name: Upload net472
uses: actions/upload-artifact@v2
with:
name: BSIPA-net35-${{ env.Platform }}
path: BSIPA-Meta/bin/${{ env.Platform }}/${{ env.Configuration }}/net35/
name: BSIPA-net472-${{ env.Platform }}
path: BSIPA-Meta/bin/${{ env.Platform }}/${{ env.Configuration }}/net472/

+ 6
- 1
.github/workflows/docs.yml View File

@ -30,7 +30,12 @@ jobs:
uses: actions/setup-dotnet@v1
with:
# As usual, obtained from: https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/5.0/releases.json
dotnet-version: "3.1.404" # since we now use this
dotnet-version: "6.0.100" # since we now use this
- name: Log in to package source
shell: pwsh
run: |
dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} `
--store-password-in-clear-text --name github "https://nuget.pkg.github.com/Atlas-Rhythm/index.json"
- name: Clear Nuget Cache
run: dotnet nuget locals all --clear
- name: Nuget Restore


+ 7
- 2
.github/workflows/tag_docs.yml View File

@ -29,7 +29,12 @@ jobs:
uses: actions/setup-dotnet@v1
with:
# As usual, obtained from: https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/5.0/releases.json
dotnet-version: "3.1.404" # since we now use this
dotnet-version: "6.0.100" # since we now use this
- name: Log in to package source
shell: pwsh
run: |
dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} `
--store-password-in-clear-text --name github "https://nuget.pkg.github.com/Atlas-Rhythm/index.json"
- name: Clear Nuget Cache
run: dotnet nuget locals all --clear
- name: Nuget Restore
@ -37,7 +42,7 @@ jobs:
- name: Install DocFX
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install docfx --version 2.48 -y
args: install docfx -y
- name: Checkout current pages
uses: actions/checkout@v2
with:


+ 12
- 0
.vscode/launch.json View File

@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to BSIPA",
"type": "mono",
"request": "attach",
"address": "localhost",
"port": 10000
}
]
}

+ 5
- 2
BSIPA-Meta/BSIPA-Meta.csproj View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Build">
<PropertyGroup>
<TargetFrameworks>net35;net461</TargetFrameworks>
<TargetFrameworks>net472</TargetFrameworks>
<Platforms>x86;x64</Platforms>
<Configurations>Debug;Release;Verbose;Verbose_Release</Configurations>
@ -59,9 +59,11 @@
</ItemGroup>
<Delete Files="@(Files)" />
</Target>
<Target Name="CoreCompile">
<CallTarget Targets="Assemble" />
</Target>
<Target Name="Assemble" Returns="$(OutputPath)">
<Message Text="Packing..." Importance="High" />
<Message Text="Results will be put in $(OutputPath)" Importance="High" />
@ -69,7 +71,7 @@
<InputDlls Include="$(SolutionDir)IPA.Injector\bin\$(NoVerboseConfig)\$(TargetFramework)\**\*" Exclude="$(SolutionDir)IPA.Injector\bin\$(NoVerboseConfig)\$(TargetFramework)\Libraries\**\*" />
<InputDlls Include="$(SolutionDir)Doorstop\Proxy\bin\$(ProxyPlatform)\$(ProxyConfig)\**\*.dll" />
<InputDlls Include="$(SolutionDir)Doorstop\Proxy\bin\$(ProxyPlatform)\$(ProxyConfig)\**\*.pdb" />
<InputIPAFiles Include="$(SolutionDir)IPA\bin\$(Configuration)\net461\**\*" Exclude="$(SolutionDir)IPA\bin\$(Configuration)\net461\*.runtimeconfig.*" />
<InputIPAFiles Include="$(SolutionDir)IPA\bin\$(Configuration)\net472\**\*" Exclude="$(SolutionDir)IPA\bin\$(Configuration)\net472\*.runtimeconfig.*" />
<InputIPAFiles Include="$(SolutionDir)IPA\bin\$(Configuration)\netcoreapp3.1\IPA.runtimeconfig.json" />
</ItemGroup>
<Copy SourceFiles="@(InputDlls)" DestinationFolder="$(OutputPath)IPA\%(RecursiveDir)" />
@ -87,3 +89,4 @@
</Target>
</Project>

+ 21
- 57
BSIPA.sln View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28729.10
# Visual Studio Version 17
VisualStudioVersion = 17.1.31911.260
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IPA", "IPA\IPA.csproj", "{14092533-98BB-40A4-9AFC-27BB75672A70}"
ProjectSection(ProjectDependencies) = postProject
@ -18,13 +18,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{C79C2C3A
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4D6639A2-BD39-4F9B-AF7F-8E5F3B88243D}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.github\workflows\build.yml = .github\workflows\build.yml
Common.props = Common.props
Common.targets = Common.targets
.github\workflows\docs.yml = .github\workflows\docs.yml
README.md = README.md
.github\release_draft.yml = .github\release_draft.yml
System.Diagnostics.CodeAnalysis.cs = System.Diagnostics.CodeAnalysis.cs
.github\workflows\tag_docs.yml = .github\workflows\tag_docs.yml
EndProjectSection
EndProject
@ -50,180 +50,144 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IPA.Loader", "IPA.Loader\IP
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Net3-Proxy", "Net3-Proxy\Net3-Proxy.csproj", "{0DEDB099-9A26-4069-A4C1-A76CEB16283B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SemVer", "SemVer\SemVer.csproj", "{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
Verbose_Release|Any CPU = Verbose_Release|Any CPU
Verbose_Release|x64 = Verbose_Release|x64
Verbose_Release|x86 = Verbose_Release|x86
Verbose|Any CPU = Verbose|Any CPU
Verbose|x64 = Verbose|x64
Verbose|x86 = Verbose|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{14092533-98BB-40A4-9AFC-27BB75672A70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Debug|x64.ActiveCfg = Debug|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Debug|x64.Build.0 = Debug|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Debug|x86.ActiveCfg = Debug|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Debug|x86.Build.0 = Debug|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Release|Any CPU.Build.0 = Release|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Release|x64.ActiveCfg = Release|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Release|x64.Build.0 = Release|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Release|x86.ActiveCfg = Release|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Release|x86.Build.0 = Release|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Verbose_Release|Any CPU.ActiveCfg = Verbose_Release|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Verbose_Release|Any CPU.Build.0 = Verbose_Release|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Verbose_Release|x64.ActiveCfg = Verbose_Release|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Verbose_Release|x64.Build.0 = Verbose_Release|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Verbose_Release|x86.ActiveCfg = Verbose_Release|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Verbose_Release|x86.Build.0 = Verbose_Release|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Verbose|Any CPU.ActiveCfg = Verbose|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Verbose|Any CPU.Build.0 = Verbose|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Verbose|x64.ActiveCfg = Verbose|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Verbose|x64.Build.0 = Verbose|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Verbose|x86.ActiveCfg = Verbose|Any CPU
{14092533-98BB-40A4-9AFC-27BB75672A70}.Verbose|x86.Build.0 = Verbose|Any CPU
{88609E16-731F-46C9-8139-6B1A7A83240D}.Debug|Any CPU.ActiveCfg = Verbose_Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Debug|Any CPU.Build.0 = Verbose_Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Debug|x64.ActiveCfg = Release|x64
{88609E16-731F-46C9-8139-6B1A7A83240D}.Debug|x64.Build.0 = Release|x64
{88609E16-731F-46C9-8139-6B1A7A83240D}.Debug|x86.ActiveCfg = Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Debug|x86.Build.0 = Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Release|Any CPU.ActiveCfg = Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Release|x64.ActiveCfg = Release|x64
{88609E16-731F-46C9-8139-6B1A7A83240D}.Release|x64.Build.0 = Release|x64
{88609E16-731F-46C9-8139-6B1A7A83240D}.Release|x86.ActiveCfg = Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Release|x86.Build.0 = Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Verbose_Release|Any CPU.ActiveCfg = Verbose_Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Verbose_Release|x64.ActiveCfg = Verbose_Release|x64
{88609E16-731F-46C9-8139-6B1A7A83240D}.Verbose_Release|x64.Build.0 = Verbose_Release|x64
{88609E16-731F-46C9-8139-6B1A7A83240D}.Verbose_Release|x86.ActiveCfg = Verbose_Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Verbose_Release|x86.Build.0 = Verbose_Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Verbose|Any CPU.ActiveCfg = Verbose_Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Verbose|Any CPU.Build.0 = Verbose_Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Verbose|x64.ActiveCfg = Verbose_Release|x64
{88609E16-731F-46C9-8139-6B1A7A83240D}.Verbose|x64.Build.0 = Verbose_Release|x64
{88609E16-731F-46C9-8139-6B1A7A83240D}.Verbose|x86.ActiveCfg = Verbose_Release|Win32
{88609E16-731F-46C9-8139-6B1A7A83240D}.Verbose|x86.Build.0 = Verbose_Release|Win32
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Debug|x64.ActiveCfg = Debug|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Debug|x64.Build.0 = Debug|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Debug|x86.ActiveCfg = Debug|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Debug|x86.Build.0 = Debug|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Release|Any CPU.Build.0 = Release|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Release|x64.ActiveCfg = Release|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Release|x86.ActiveCfg = Release|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Verbose_Release|Any CPU.ActiveCfg = Release|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Verbose_Release|Any CPU.Build.0 = Release|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Verbose_Release|x64.ActiveCfg = Release|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Verbose_Release|x86.ActiveCfg = Release|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Verbose|Any CPU.Build.0 = Release|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Verbose|x64.ActiveCfg = Debug|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Verbose|x64.Build.0 = Debug|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Verbose|x86.ActiveCfg = Debug|Any CPU
{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}.Verbose|x86.Build.0 = Debug|Any CPU
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Debug|Any CPU.ActiveCfg = Debug|x86
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Debug|x64.ActiveCfg = Debug|x64
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Debug|x64.Build.0 = Debug|x64
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Debug|x86.ActiveCfg = Debug|x86
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Debug|x86.Build.0 = Debug|x86
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Release|Any CPU.ActiveCfg = Release|x86
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Release|x64.ActiveCfg = Release|x64
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Release|x64.Build.0 = Release|x64
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Release|x86.ActiveCfg = Release|x86
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Release|x86.Build.0 = Release|x86
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Verbose_Release|Any CPU.ActiveCfg = Verbose_Release|x86
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Verbose_Release|x64.ActiveCfg = Verbose_Release|x64
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Verbose_Release|x64.Build.0 = Verbose_Release|x64
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Verbose_Release|x86.ActiveCfg = Verbose_Release|x86
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Verbose_Release|x86.Build.0 = Verbose_Release|x86
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Verbose|Any CPU.ActiveCfg = Verbose|x86
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Verbose|x64.ActiveCfg = Verbose|x64
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Verbose|x64.Build.0 = Verbose|x64
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Verbose|x86.ActiveCfg = Verbose|x86
{880A3560-82CD-4836-996B-11BEFE6B44DB}.Verbose|x86.Build.0 = Verbose|x86
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Debug|x64.ActiveCfg = Debug|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Debug|x64.Build.0 = Debug|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Debug|x86.ActiveCfg = Debug|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Debug|x86.Build.0 = Debug|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Release|Any CPU.Build.0 = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Release|x64.ActiveCfg = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Release|x64.Build.0 = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Release|x86.ActiveCfg = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Release|x86.Build.0 = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Verbose_Release|Any CPU.ActiveCfg = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Verbose_Release|Any CPU.Build.0 = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Verbose_Release|x64.ActiveCfg = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Verbose_Release|x64.Build.0 = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Verbose_Release|x86.ActiveCfg = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Verbose_Release|x86.Build.0 = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Verbose|Any CPU.Build.0 = Release|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Verbose|x64.ActiveCfg = Debug|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Verbose|x64.Build.0 = Debug|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Verbose|x86.ActiveCfg = Debug|Any CPU
{10F0057C-6C1E-41AA-A4DE-2F9D2EABE55C}.Verbose|x86.Build.0 = Debug|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Debug|x64.ActiveCfg = Debug|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Debug|x64.Build.0 = Debug|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Debug|x86.ActiveCfg = Debug|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Debug|x86.Build.0 = Debug|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Release|Any CPU.Build.0 = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Release|x64.ActiveCfg = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Release|x64.Build.0 = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Release|x86.ActiveCfg = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Release|x86.Build.0 = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Verbose_Release|Any CPU.ActiveCfg = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Verbose_Release|Any CPU.Build.0 = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Verbose_Release|x64.ActiveCfg = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Verbose_Release|x64.Build.0 = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Verbose_Release|x86.ActiveCfg = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Verbose_Release|x86.Build.0 = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Verbose|Any CPU.Build.0 = Release|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Verbose|x64.ActiveCfg = Debug|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Verbose|x64.Build.0 = Debug|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Verbose|x86.ActiveCfg = Debug|Any CPU
{BBBA5CAD-B40E-4565-AE96-E8EC468DB54B}.Verbose|x86.Build.0 = Debug|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Debug|x64.ActiveCfg = Debug|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Debug|x64.Build.0 = Debug|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Debug|x86.ActiveCfg = Debug|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Debug|x86.Build.0 = Debug|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Release|Any CPU.Build.0 = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Release|x64.ActiveCfg = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Release|x64.Build.0 = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Release|x86.ActiveCfg = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Release|x86.Build.0 = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Verbose_Release|Any CPU.ActiveCfg = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Verbose_Release|Any CPU.Build.0 = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Verbose_Release|x64.ActiveCfg = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Verbose_Release|x64.Build.0 = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Verbose_Release|x86.ActiveCfg = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Verbose_Release|x86.Build.0 = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Verbose|Any CPU.Build.0 = Release|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Verbose|x64.ActiveCfg = Debug|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Verbose|x64.Build.0 = Debug|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Verbose|x86.ActiveCfg = Debug|Any CPU
{0DEDB099-9A26-4069-A4C1-A76CEB16283B}.Verbose|x86.Build.0 = Debug|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Debug|x64.ActiveCfg = Debug|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Debug|x64.Build.0 = Debug|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Debug|x86.ActiveCfg = Debug|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Debug|x86.Build.0 = Debug|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Release|x64.ActiveCfg = Release|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Release|x64.Build.0 = Release|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Release|x86.ActiveCfg = Release|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Release|x86.Build.0 = Release|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Verbose_Release|x64.ActiveCfg = Release|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Verbose_Release|x64.Build.0 = Release|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Verbose_Release|x86.ActiveCfg = Release|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Verbose_Release|x86.Build.0 = Release|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Verbose|x64.ActiveCfg = Debug|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Verbose|x64.Build.0 = Debug|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Verbose|x86.ActiveCfg = Debug|Any CPU
{B25EEC48-A5D0-4A63-BA73-5DD43F7F592A}.Verbose|x86.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE


+ 1
- 1
BuildTools

@ -1 +1 @@
Subproject commit 41c3a12d56de96a3495893d1fea4a485a98c67af
Subproject commit b04769a3aebdd111b81f5a59d438907310e83207

+ 12
- 0
Common.props View File

@ -11,5 +11,17 @@
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<AnalysisLevel>latest</AnalysisLevel>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" />
<PackageReference Include="Nullable" Version="1.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="IsExternalInit" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>

+ 0
- 4
Common.targets View File

@ -1,8 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)\System.Diagnostics.CodeAnalysis.cs"/>
</ItemGroup>
</Project>

+ 13
- 4
Doorstop/Proxy/main.c View File

@ -111,6 +111,13 @@ void unhandledException(void* exc, void* data)
// We use this since it will always be called once to initialize Mono's JIT
void *ownMonoJitInitVersion(const char *root_domain_name, const char *runtime_version)
{
const BOOL debugger_already_initialized = mono_debug_enabled();
if(debugger_already_initialized)
{
LOG("Debugger was already initialized\n");
}
// Call the original mono_jit_init_version to initialize the Unity Root Domain
if (debug) {
char* opts[1];
@ -118,14 +125,14 @@ void *ownMonoJitInitVersion(const char *root_domain_name, const char *runtime_ve
ownMonoJitParseOptions(0, opts);
}
#ifdef WIN32
if (debug_info) {
if (debug_info && !debugger_already_initialized) {
mono_debug_init(MONO_DEBUG_FORMAT_MONO);
}
#endif
void *domain = mono_jit_init_version(root_domain_name, runtime_version);
if (debug_info) {
if (debug_info && !debugger_already_initialized) {
#ifdef WIN64
mono_debug_init(MONO_DEBUG_FORMAT_MONO);
#endif
@ -194,8 +201,10 @@ void *ownMonoJitInitVersion(const char *root_domain_name, const char *runtime_ve
wchar_t* dll_path_w; // self path
size_t dll_path_len = get_module_path((HINSTANCE)&__ImageBase, &dll_path_w, NULL, 0);
char* self_dll_path = memalloc(dll_path_len + 1);
WideCharToMultiByte(CP_UTF8, 0, dll_path_w, -1, self_dll_path, dll_path_len + 1, NULL, NULL);
size_t multibyte_path_len = WideCharToMultiByte(CP_UTF8, 0, dll_path_w, dll_path_len, NULL, 0, NULL, NULL);
char* self_dll_path = memalloc(multibyte_path_len + 1);
WideCharToMultiByte(CP_UTF8, 0, dll_path_w, dll_path_len, self_dll_path, multibyte_path_len + 1, NULL, NULL);
self_dll_path[multibyte_path_len] = 0;
mono_dllmap_insert(NULL, "i:bsipa-doorstop", NULL, self_dll_path, NULL); // remap `bsipa-doorstop` to this assembly


+ 2
- 0
Doorstop/Proxy/mono.h View File

@ -40,6 +40,7 @@ typedef enum {
void (*mono_jit_parse_options)(int argc, char * argv[]);
void (*mono_debug_init)(MonoDebugFormat format);
BOOL (*mono_debug_enabled)(void);
void (*mono_debug_domain_create)(void*);
void *(*mono_jit_init_version)(const char *root_domain_name, const char *runtime_version);
@ -90,6 +91,7 @@ inline void loadMonoFunctions(HMODULE monoLib)
GET_MONO_PROC(mono_assembly_get_image);
GET_MONO_PROC(mono_runtime_invoke);
GET_MONO_PROC(mono_debug_init);
GET_MONO_PROC(mono_debug_enabled);
GET_MONO_PROC(mono_jit_init_version);
GET_MONO_PROC(mono_jit_parse_options);
GET_MONO_PROC(mono_method_desc_new);


+ 4
- 3
IPA.Injector/GameVersionEarly.cs View File

@ -1,4 +1,5 @@
using IPA.Utilities;
#nullable enable
using IPA.Utilities;
using System;
using System.Collections.Generic;
using System.IO;
@ -48,7 +49,7 @@ namespace IPA.Injector
}
var rewind = -sizeof(int) - sizeof(byte);
stream.Seek(rewind, SeekOrigin.Current); // rewind to the string length
_ = stream.Seek(rewind, SeekOrigin.Current); // rewind to the string length
var strlen = reader.ReadInt32();
var strbytes = reader.ReadBytes(strlen);
@ -57,7 +58,7 @@ namespace IPA.Injector
}
}
internal static AlmostVersion SafeParseVersion() => new AlmostVersion(GetGameVersion());
internal static AlmostVersion SafeParseVersion() => new(GetGameVersion());
private static void _Load()
{


+ 38
- 17
IPA.Injector/IPA.Injector.csproj View File

@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Common.props"/>
<Import Project="..\Common.props" />
<PropertyGroup>
<TargetFrameworks>net461;net35</TargetFrameworks>
<TargetFramework>net472</TargetFramework>
<RootNamespace>IPA.Injector</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<BuildForBeatSaber Condition=" '$(BuildForBeatSaber)' == '' And '$(TargetFramework)' == 'net461' ">true</BuildForBeatSaber>
<BuildForBeatSaber Condition=" '$(BuildForBeatSaber)' == '' And '$(TargetFramework)' == 'net472' ">true</BuildForBeatSaber>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
<DefineConstants>$(DefineConstants);NET4</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net35'">
@ -21,14 +21,14 @@
<PropertyGroup Condition="'$(BuildForBeatSaber)' == 'true'">
<DefineConstants>$(DefineConstants);BeatSaber</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\IPA.Loader\IPA.Loader.csproj" />
<ProjectReference Include="..\Net3-Proxy\Net3-Proxy.csproj" Condition=" '$(TargetFramework)' == 'net35' " />
</ItemGroup>
<ItemGroup>
<Reference Include="UnityEngine.CoreModule" Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="UnityEngine.CoreModule" Condition=" '$(TargetFramework)' == 'net472' ">
<HintPath>..\Refs\UnityEngine.CoreModule.Net4.dll</HintPath>
<Private>False</Private>
</Reference>
@ -37,8 +37,8 @@
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Content Include="..\Libs\I18N.Net4.dll">
<Link>Libraries\Mono\I18N.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
@ -55,7 +55,19 @@
<Link>Libraries\Mono\System.Runtime.Serialization.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\Libs\netstandard.dll">
<Link>Libraries\Mono\netstandard.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="..\Libs\thirdparty\*">
<Link>Libraries\Thirdparty\%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
<Content Include="..\Libs\I18N.Net3.dll">
<Link>Libraries\Mono\I18N.dll</Link>
@ -70,13 +82,22 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Mono.Cecil" Version="0.10.4" />
<PackageReference Include="SemanticVersioning" Version="1.2.2" />
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
<PackageReference Include="AsyncBridge" Version="0.3.1" />
<ProjectReference Include="..\SemVer\SemVer.csproj" />
</ItemGroup>
<Target Name="CopyDocumentation" BeforeTargets="Build">
<ItemGroup>
<ReferenceFiles Include="%(Reference.RelativeDir)%(Reference.Filename).xml" />
</ItemGroup>
<Message Text="Copying documentation" />
<Copy SourceFiles="@(ReferenceFiles)" DestinationFolder="$(OutputPath)Libs" Condition="Exists('%(RootDir)%(Directory)%(Filename)%(Extension)')" />
</Target>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Message Text="Relocating" Importance="normal" />
<ItemGroup>
@ -91,7 +112,7 @@
</ItemGroup>
<Move SourceFiles="@(SystemFiles)" DestinationFolder="$(OutputPath)Data\Managed" />
<RemoveDir Directories="$(OutputPath)Libraries\Mono" />
<Delete Files="@(OldLibFiles)" />
<RemoveDir Directories="$(OutputPath)Libs" />
<ItemGroup>
@ -102,6 +123,6 @@
<RemoveDir Directories="$(OutputPath)Libraries" />
</Target>
<Import Project="..\Common.targets"/>
<Import Project="..\Common.targets" />
</Project>

+ 38
- 44
IPA.Injector/Injector.cs View File

@ -1,4 +1,6 @@
using IPA.Config;
#nullable enable
using IPA.AntiMalware;
using IPA.Config;
using IPA.Injector.Backups;
using IPA.Loader;
using IPA.Logging;
@ -29,8 +31,8 @@ namespace IPA.Injector
// ReSharper disable once UnusedMember.Global
internal static class Injector
{
private static Task pluginAsyncLoadTask;
private static Task permissionFixTask;
private static Task? pluginAsyncLoadTask;
private static Task? permissionFixTask;
//private static string otherNewtonsoftJson = null;
// ReSharper disable once UnusedParameter.Global
@ -40,7 +42,7 @@ namespace IPA.Injector
// and since this class doesn't have any static fields that
// aren't defined in mscorlib, we can control exactly what
// gets loaded.
_ = args;
try
{
if (Environment.GetCommandLineArgs().Contains("--verbose"))
@ -48,16 +50,6 @@ namespace IPA.Injector
SetupLibraryLoading();
/*var otherNewtonsoft = Path.Combine(
Directory.EnumerateDirectories(Environment.CurrentDirectory, "*_Data").First(),
"Managed",
"Newtonsoft.Json.dll");
if (File.Exists(otherNewtonsoft))
{ // this game ships its own Newtonsoft; force load ours and flag loading theirs
LibLoader.LoadLibrary(new AssemblyName("Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"));
otherNewtonsoftJson = otherNewtonsoft;
}*/
EnsureDirectories();
// this is weird, but it prevents Mono from having issues loading the type.
@ -71,7 +63,7 @@ namespace IPA.Injector
*/
#endregion
log.Debug("Initializing logger");
Default.Debug("Initializing logger");
SelfConfig.ReadCommandLine(Environment.GetCommandLineArgs());
SelfConfig.Load();
@ -79,23 +71,27 @@ namespace IPA.Injector
if (AntiPiracy.IsInvalid(Environment.CurrentDirectory))
{
log.Error("Invalid installation; please buy the game to run BSIPA.");
Default.Error("Invalid installation; please buy the game to run BSIPA.");
return;
}
CriticalSection.Configure();
injector.Debug("Prepping bootstrapper");
Logging.Logger.Injector.Debug("Prepping bootstrapper");
// make sure to load the game version and check boundaries before installing the bootstrap, because that uses the game assemblies property
GameVersionEarly.Load();
SelfConfig.Instance.CheckVersionBoundary();
// updates backup
InstallBootstrapPatch();
GameVersionEarly.Load();
AntiMalwareEngine.Initialize();
Updates.InstallPendingUpdates();
LibLoader.SetupAssemblyFilenames(true);
Loader.LibLoader.SetupAssemblyFilenames(true);
pluginAsyncLoadTask = PluginLoader.LoadTask();
permissionFixTask = PermissionFix.FixPermissions(new DirectoryInfo(Environment.CurrentDirectory));
@ -110,16 +106,16 @@ namespace IPA.Injector
{
string path;
if (!Directory.Exists(path = Path.Combine(Environment.CurrentDirectory, "UserData")))
Directory.CreateDirectory(path);
_ = Directory.CreateDirectory(path);
if (!Directory.Exists(path = Path.Combine(Environment.CurrentDirectory, "Plugins")))
Directory.CreateDirectory(path);
_ = Directory.CreateDirectory(path);
}
private static void SetupLibraryLoading()
{
if (loadingDone) return;
loadingDone = true;
LibLoader.Configure();
Loader.LibLoader.Configure();
}
private static void InstallHarmonyProtections()
@ -137,13 +133,13 @@ namespace IPA.Injector
var dataDir = new DirectoryInfo(managedPath).Parent.Name;
var gameName = dataDir.Substring(0, dataDir.Length - 5);
injector.Debug("Finding backup");
Logging.Logger.Injector.Debug("Finding backup");
var backupPath = Path.Combine(Environment.CurrentDirectory, "IPA", "Backups", gameName);
var bkp = BackupManager.FindLatestBackup(backupPath);
if (bkp == null)
injector.Warn("No backup found! Was BSIPA installed using the installer?");
Logging.Logger.Injector.Warn("No backup found! Was BSIPA installed using the installer?");
injector.Debug("Ensuring patch on UnityEngine.CoreModule exists");
Logging.Logger.Injector.Debug("Ensuring patch on UnityEngine.CoreModule exists");
#region Insert patch into UnityEngine.CoreModule.dll
@ -179,12 +175,12 @@ namespace IPA.Injector
if (application == null)
{
injector.Critical("UnityEngine.CoreModule doesn't have a definition for UnityEngine.Camera!"
Logging.Logger.Injector.Critical("UnityEngine.CoreModule doesn't have a definition for UnityEngine.Camera!"
+ "Nothing to patch to get ourselves into the Unity run cycle!");
goto endPatchCoreModule;
}
MethodDefinition cctor = null;
MethodDefinition? cctor = null;
foreach (var m in application.Methods)
if (m.IsRuntimeSpecialName && m.Name == ".cctor")
cctor = m;
@ -244,7 +240,7 @@ namespace IPA.Injector
endPatchCoreModule:
#endregion Insert patch into UnityEngine.CoreModule.dll
injector.Debug("Ensuring game assemblies are virtualized");
Logging.Logger.Injector.Debug("Ensuring game assemblies are virtualized");
#region Virtualize game assemblies
bool isFirst = true;
@ -256,15 +252,15 @@ namespace IPA.Injector
try
{
injector.Debug($"Virtualizing {name}");
Logging.Logger.Injector.Debug($"Virtualizing {name}");
using var ascModule = VirtualizedModule.Load(ascPath);
ascModule.Virtualize(cAsmName, () => bkp?.Add(ascPath));
}
catch (Exception e)
{
injector.Error($"Could not virtualize {ascPath}");
Logging.Logger.Injector.Error($"Could not virtualize {ascPath}");
if (SelfConfig.Debug_.ShowHandledErrorStackTraces_)
injector.Error(e);
Logging.Logger.Injector.Error(e);
}
#if BeatSaber
@ -272,7 +268,7 @@ namespace IPA.Injector
{
try
{
injector.Debug("Applying anti-yeet patch");
Logging.Logger.Injector.Debug("Applying anti-yeet patch");
using var ascAsmDef = AssemblyDefinition.ReadAssembly(ascPath, new ReaderParameters
{
@ -291,9 +287,9 @@ namespace IPA.Injector
}
catch (Exception e)
{
injector.Warn($"Could not apply anti-yeet patch to {ascPath}");
Logging.Logger.Injector.Warn($"Could not apply anti-yeet patch to {ascPath}");
if (SelfConfig.Debug_.ShowHandledErrorStackTraces_)
injector.Warn(e);
Logging.Logger.Injector.Warn(e);
}
}
#endif
@ -301,7 +297,7 @@ namespace IPA.Injector
#endregion
sw.Stop();
injector.Info($"Installing bootstrapper took {sw.Elapsed}");
Logging.Logger.Injector.Info($"Installing bootstrapper took {sw.Elapsed}");
}
private static bool bootstrapped;
@ -311,10 +307,6 @@ namespace IPA.Injector
if (bootstrapped) return;
bootstrapped = true;
/*if (otherNewtonsoftJson != null)
Assembly.LoadFrom(otherNewtonsoftJson);*/
Application.logMessageReceived += delegate (string condition, string stackTrace, LogType type)
{
var level = UnityLogRedirector.LogTypeToLevel(type);
@ -322,6 +314,8 @@ namespace IPA.Injector
UnityLogProvider.UnityLogger.Log(level, $"{stackTrace}");
};
StdoutInterceptor.EnsureHarmonyLogging();
// need to reinit streams singe Unity seems to redirect stdout
StdoutInterceptor.RedirectConsole();
@ -336,12 +330,12 @@ namespace IPA.Injector
private static void Bootstrapper_Destroyed()
{
// wait for plugins to finish loading
pluginAsyncLoadTask.Wait();
permissionFixTask.Wait();
pluginAsyncLoadTask?.Wait();
permissionFixTask?.Wait();
log.Debug("Plugins loaded");
log.Debug(string.Join(", ", PluginLoader.PluginsMetadata.StrJP()));
PluginComponent.Create();
Default.Debug("Plugins loaded");
Default.Debug(string.Join(", ", PluginLoader.PluginsMetadata.StrJP()));
_ = PluginComponent.Create();
}
}
}

+ 67
- 67
IPA.Injector/PermissionFix.cs View File

@ -1,73 +1,73 @@
using IPA.Logging;
using System;
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Security.AccessControl;
using System.Security.Principal;
using System.Threading.Tasks;
#if NET3
using Net3_Proxy;
#endif
namespace IPA.Injector
{
internal static class PermissionFix
using System.IO;
using System.Security.AccessControl;
using System.Security.Principal;
using System.Threading.Tasks;
#if NET3
using Net3_Proxy;
#endif
namespace IPA.Injector
{
internal static class PermissionFix
{
[SuppressMessage("Reliability", "CA2008:Do not create tasks without passing a TaskScheduler",
Justification = "I very explicitly want the default scheduler")]
public static Task FixPermissions(DirectoryInfo root)
{
if (!root.Exists) return new Task(() => { });
return Task.Factory.StartNew(() =>
{
var sw = Stopwatch.StartNew();
try
{
var acl = root.GetAccessControl();
var rules = acl.GetAccessRules(true, true, typeof(SecurityIdentifier));
var requestedRights = FileSystemRights.Modify;
var requestedInheritance = InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit;
var requestedPropagation = PropagationFlags.InheritOnly;
bool hasRule = false;
for (var i = 0; i < rules.Count; i++)
{
var rule = rules[i];
if (rule is FileSystemAccessRule fsrule
&& fsrule.AccessControlType == AccessControlType.Allow
&& fsrule.InheritanceFlags.HasFlag(requestedInheritance)
&& fsrule.PropagationFlags == requestedPropagation
&& fsrule.FileSystemRights.HasFlag(requestedRights))
{ hasRule = true; break; }
}
if (!hasRule)
{ // this is *sooo* fucking slow on first run
acl.AddAccessRule(
new FileSystemAccessRule(
new SecurityIdentifier(WellKnownSidType.WorldSid, null),
requestedRights,
requestedInheritance,
requestedPropagation,
AccessControlType.Allow
)
);
root.SetAccessControl(acl);
}
}
catch (Exception e)
{
Logger.log.Warn("Error configuring permissions in the game install dir");
Logger.log.Warn(e);
}
sw.Stop();
Logger.log.Info($"Configuring permissions took {sw.Elapsed}");
});
}
}
}
public static Task FixPermissions(DirectoryInfo root)
{
if (!root.Exists) return new Task(() => { });
return Task.Factory.StartNew(() =>
{
var sw = Stopwatch.StartNew();
try
{
var acl = root.GetAccessControl();
var rules = acl.GetAccessRules(true, true, typeof(SecurityIdentifier));
var requestedRights = FileSystemRights.Modify;
var requestedInheritance = InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit;
var requestedPropagation = PropagationFlags.InheritOnly;
bool hasRule = false;
for (var i = 0; i < rules.Count; i++)
{
var rule = rules[i];
if (rule is FileSystemAccessRule fsrule
&& fsrule.AccessControlType == AccessControlType.Allow
&& fsrule.InheritanceFlags.HasFlag(requestedInheritance)
&& fsrule.PropagationFlags == requestedPropagation
&& fsrule.FileSystemRights.HasFlag(requestedRights))
{ hasRule = true; break; }
}
if (!hasRule)
{ // this is *sooo* fucking slow on first run
acl.AddAccessRule(
new FileSystemAccessRule(
new SecurityIdentifier(WellKnownSidType.WorldSid, null),
requestedRights,
requestedInheritance,
requestedPropagation,
AccessControlType.Allow
)
);
root.SetAccessControl(acl);
}
}
catch (Exception e)
{
Logger.Default.Warn("Error configuring permissions in the game install dir");
Logger.Default.Warn(e);
}
sw.Stop();
Logger.Default.Info($"Configuring permissions took {sw.Elapsed}");
});
}
}
}

+ 38
- 36
IPA.Injector/Properties/AssemblyInfo.cs View File

@ -1,37 +1,39 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("IPA.Injector")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IPA.Injector")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2a1af16b-27f1-46e0-9a95-181516bc1cb7")]
[assembly: InternalsVisibleTo("IPA.Loader")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion(IPA.Config.SelfConfig.IPAVersion)]
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("IPA.Injector")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IPA.Injector")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2a1af16b-27f1-46e0-9a95-181516bc1cb7")]
[assembly: InternalsVisibleTo("IPA.Loader")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion(IPA.Config.SelfConfig.IPAVersion)]
[assembly: AssemblyFileVersion(IPA.Config.SelfConfig.IPAVersion)]

+ 31
- 15
IPA.Injector/Updates.cs View File

@ -1,4 +1,7 @@
using IPA.Utilities;
#nullable enable
using IPA.AntiMalware;
using IPA.Config;
using IPA.Utilities;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@ -36,14 +39,27 @@ namespace IPA.Injector
if (ipaVersion > selfVersion)
{
var scanResult = AntiMalwareEngine.Engine.ScanFile(new FileInfo(path));
if (scanResult == ScanResult.Detected)
{
Updater.Error("Scan of BSIPA installer found malware; not updating");
return;
}
if (!SelfConfig.AntiMalware_.RunPartialThreatCode_ && scanResult is not ScanResult.KnownSafe and not ScanResult.NotDetected)
{
Updater.Error("Scan of BSIPA installer returned partial threat; not updating. To allow this, enable AntiMalware.RunPartialThreatCode in the config.");
return;
}
_ = Process.Start(new ProcessStartInfo
{
FileName = path,
Arguments = $"\"-nw={Process.GetCurrentProcess().Id},s={string.Join(" ", Environment.GetCommandLineArgs().Skip(1).StrJP()).Replace("\\", "\\\\").Replace(",", "\\,")}\"",
Arguments = $"\"-nw={Process.GetCurrentProcess().Id}," +
$"s={string.Join(" ", Environment.GetCommandLineArgs().Skip(1).StrJP()).Replace("\\", "\\\\").Replace(",", "\\,")}\"",
UseShellExecute = false
});
updater.Info("Updating BSIPA...");
Updater.Info("Updating BSIPA...");
Environment.Exit(0);
}
}
@ -54,7 +70,7 @@ namespace IPA.Injector
if (!Directory.Exists(pendingDir)) return;
// there are pending updates, install
updater.Info("Installing pending updates");
Updater.Info("Installing pending updates");
var toDelete = Array.Empty<string>();
var delFn = Path.Combine(pendingDir, DeleteFileName);
@ -72,8 +88,8 @@ namespace IPA.Injector
}
catch (Exception e)
{
updater.Error("While trying to install pending updates: Error deleting file marked for deletion");
updater.Error(e);
Updater.Error("While trying to install pending updates: Error deleting file marked for deletion");
Updater.Error(e);
}
}
@ -98,12 +114,12 @@ namespace IPA.Injector
}
catch (UnauthorizedAccessException e)
{
updater.Error(e);
Updater.Error(e);
continue;
}
catch (DirectoryNotFoundException e)
{
updater.Error(e);
Updater.Error(e);
continue;
}
@ -116,7 +132,7 @@ namespace IPA.Injector
}
catch (FileNotFoundException e)
{
updater.Error(e);
Updater.Error(e);
}
}
@ -137,15 +153,15 @@ namespace IPA.Injector
{
Utils.CopyAll(new DirectoryInfo(pendingDir), new DirectoryInfo(UnityGame.InstallPath), onCopyException: (e, f) =>
{
updater.Error($"Error copying file {Utils.GetRelativePath(f.FullName, pendingDir)} from Pending:");
updater.Error(e);
Updater.Error($"Error copying file {Utils.GetRelativePath(f.FullName, pendingDir)} from Pending:");
Updater.Error(e);
return true;
});
}
catch (Exception e)
{
updater.Error("While trying to install pending updates: Error copying files in");
updater.Error(e);
Updater.Error("While trying to install pending updates: Error copying files in");
Updater.Error(e);
}
try
@ -154,8 +170,8 @@ namespace IPA.Injector
}
catch (Exception e)
{
updater.Error("Something went wrong performing an operation that should never fail!");
updater.Error(e);
Updater.Error("Something went wrong performing an operation that should never fail!");
Updater.Error(e);
}
}
}


+ 14
- 0
IPA.Loader/AntiMalware/AmsiConstants.cs View File

@ -0,0 +1,14 @@
#nullable enable
using System;
namespace IPA.AntiMalware
{
internal static class AmsiConstants
{
public const string AppName = "BSIPA/" + Config.SelfConfig.IPAVersion;
public const string IAntimalwareGuidStr = "82d29c2e-f062-44e6-b5c9-3d9a2f24a2df";
public static readonly Guid IAntimalwareGuid = new(IAntimalwareGuidStr);
public static readonly Guid CAntimalwareGuid = new("fdb00e52-a214-4aa1-8fba-4357bb0072ec");
public static readonly Guid IUnknownGuid = new("00000000-0000-0000-C000-000000000046");
}
}

+ 13
- 0
IPA.Loader/AntiMalware/AmsiResult.cs View File

@ -0,0 +1,13 @@
#nullable enable
namespace IPA.AntiMalware
{
internal enum AmsiResult
{
Clean = 0,
NotDetected = 1,
BlockedByAdminStart = 0x4000,
BlockedByAdminEnd = 0x4fff,
Detected = 32768
}
}

+ 46
- 0
IPA.Loader/AntiMalware/AntiMalwareEngine.cs View File

@ -0,0 +1,46 @@
#nullable enable
using IPA.Config;
using IPA.Logging;
using System;
namespace IPA.AntiMalware
{
/// <summary>
/// Provides a way to access BSIPA's Anti-Malware engine.
/// </summary>
/// <see cref="Engine"/>
/// <see cref="IAntiMalware"/>
public static class AntiMalwareEngine
{
private static IAntiMalware? engine;
/// <summary>
/// Gets the current Anti-Malware engine.
/// </summary>
public static IAntiMalware Engine => engine ?? throw new InvalidOperationException();
internal static bool IsInitialized => engine != null;
internal static void Initialize()
{
engine = CreateEngine();
}
private static IAntiMalware CreateEngine()
{
IAntiMalware? engine = null;
if (SelfConfig.AntiMalware_.UseIfAvailable_)
{
#if !NET35
engine = WindowsCOMAntiMalware.TryInitialize();
#endif
engine ??= WindowsWin32AntiMalware.TryInitialize();
}
engine ??= new NoopAntiMalware();
Logger.AntiMalware.Debug($"Antimalware engine initialized with {engine.GetType()}");
return engine;
}
}
}

+ 25
- 0
IPA.Loader/AntiMalware/IAntiMalware.cs View File

@ -0,0 +1,25 @@
#nullable enable
using System.IO;
namespace IPA.AntiMalware
{
/// <summary>
/// An Anti-Malware engine that can be used to scan and detect potentially harmful files.
/// </summary>
public interface IAntiMalware
{
/// <summary>
/// Scans a particular file for malware.
/// </summary>
/// <param name="file">The file to scan.</param>
/// <returns>A <see cref="ScanResult"/> indicating whether the file is safe or not.</returns>
ScanResult ScanFile(FileInfo file);
/// <summary>
/// Scans a particular in-memory blob for malware.
/// </summary>
/// <param name="data">The binary blob to scan.</param>
/// <param name="contentName">The name of the content. If this is left <see langword="null"/>, one will be automatically generated.</param>
/// <returns>A <see cref="ScanResult"/> indicating whether the file is safe or not.</returns>
ScanResult ScanData(byte[] data, string? contentName = null);
}
}

+ 15
- 0
IPA.Loader/AntiMalware/NoopAntiMalware.cs View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IPA.AntiMalware
{
internal class NoopAntiMalware : IAntiMalware
{
public ScanResult ScanData(byte[] data, string contentName = null) => ScanResult.NotDetected;
public ScanResult ScanFile(FileInfo file) => ScanResult.NotDetected;
}