├── .editorconfig ├── .gitignore └── src ├── Extensions └── StringExtensions.cs ├── Program.cs ├── Steps ├── Program.Step.DownloadCabinetFile.cs ├── Program.Step.ExtractCabinetFile.cs ├── Program.Step.GetDllPath.cs ├── Program.Step.GetOutputDirectory.cs └── Program.Step.GetPdbInfo.cs └── Unity PDB Downloader.csproj /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | # All files 4 | [*] 5 | 6 | #### Core EditorConfig Options #### 7 | 8 | # Indentation and spacing 9 | indent_style = space 10 | indent_size = 4 11 | tab_width = 4 12 | trim_trailing_whitespace = true 13 | 14 | # New line preferences 15 | end_of_line = crlf 16 | insert_final_newline = true 17 | 18 | # Json, Xml, Yaml files 19 | [*.{json,xml,yml,yaml}] 20 | indent_size = 2 21 | 22 | # XML project files 23 | [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] 24 | indent_size = 2 25 | 26 | # Markdown files 27 | [*.md] 28 | indent_size = 1 29 | trim_trailing_whitespace = false 30 | 31 | #### .NET Coding Conventions #### 32 | [*.{cs,vb}] 33 | 34 | # Organize usings 35 | dotnet_separate_import_directive_groups = false 36 | dotnet_sort_system_directives_first = true 37 | file_header_template = unset 38 | 39 | # this. and Me. preferences 40 | dotnet_style_qualification_for_event = false:error 41 | dotnet_style_qualification_for_field = false:error 42 | dotnet_style_qualification_for_method = false:error 43 | dotnet_style_qualification_for_property = false:error 44 | 45 | # Language keywords vs BCL types preferences 46 | dotnet_style_predefined_type_for_locals_parameters_members = true:error 47 | dotnet_style_predefined_type_for_member_access = true:error 48 | 49 | # Parentheses preferences 50 | dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion 51 | dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion 52 | dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion 53 | dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion 54 | 55 | # Modifier preferences 56 | dotnet_style_require_accessibility_modifiers = for_non_interface_members:error 57 | 58 | # Expression-level preferences 59 | dotnet_style_coalesce_expression = true:suggestion 60 | dotnet_style_collection_initializer = true:suggestion 61 | dotnet_style_explicit_tuple_names = true:warning 62 | dotnet_style_null_propagation = true:suggestion 63 | dotnet_style_object_initializer = true:suggestion 64 | dotnet_style_operator_placement_when_wrapping = beginning_of_line:warning 65 | dotnet_style_prefer_auto_properties = true:error 66 | dotnet_style_prefer_compound_assignment = true:error 67 | dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion 68 | dotnet_style_prefer_conditional_expression_over_return = true:suggestion 69 | dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed 70 | dotnet_style_prefer_inferred_anonymous_type_member_names = false:warning 71 | dotnet_style_prefer_inferred_tuple_names = false:warning 72 | dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error 73 | dotnet_style_prefer_simplified_boolean_expressions = true:suggestion 74 | dotnet_style_prefer_simplified_interpolation = true:suggestion 75 | 76 | # Field preferences 77 | dotnet_style_readonly_field = true:error 78 | 79 | # Parameter preferences 80 | dotnet_code_quality_unused_parameters = all:suggestion 81 | 82 | # Suppression preferences 83 | dotnet_remove_unnecessary_suppression_exclusions = all 84 | 85 | # New line preferences 86 | dotnet_style_allow_multiple_blank_lines_experimental = false:error 87 | dotnet_style_allow_statement_immediately_after_block_experimental = false:error 88 | 89 | #### C# Coding Conventions #### 90 | [*.cs] 91 | 92 | # var preferences 93 | csharp_style_var_elsewhere = false:none 94 | csharp_style_var_for_built_in_types = false:none 95 | csharp_style_var_when_type_is_apparent = false:none 96 | 97 | # Expression-bodied members 98 | csharp_style_expression_bodied_accessors = when_on_single_line:suggestion 99 | csharp_style_expression_bodied_constructors = false:error 100 | csharp_style_expression_bodied_indexers = false:error 101 | csharp_style_expression_bodied_lambdas = when_on_single_line:suggestion 102 | csharp_style_expression_bodied_local_functions = false:error 103 | csharp_style_expression_bodied_methods = false:error 104 | csharp_style_expression_bodied_operators = false:error 105 | csharp_style_expression_bodied_properties = false:none 106 | 107 | # Pattern matching preferences 108 | csharp_style_pattern_matching_over_as_with_null_check = true:suggestion 109 | csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion 110 | csharp_style_prefer_extended_property_pattern = true:suggestion 111 | csharp_style_prefer_not_pattern = true:suggestion 112 | csharp_style_prefer_pattern_matching = true:suggestion 113 | csharp_style_prefer_switch_expression = true:error 114 | 115 | # Null-checking preferences 116 | csharp_style_conditional_delegate_call = true:error 117 | 118 | # Modifier preferences 119 | csharp_prefer_static_local_function = true:error 120 | csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error 121 | 122 | # Code-block preferences 123 | csharp_prefer_braces = true:error 124 | csharp_prefer_simple_using_statement = true:error 125 | csharp_style_namespace_declarations = file_scoped:error 126 | csharp_style_prefer_method_group_conversion = true:suggestion 127 | csharp_style_prefer_top_level_statements = true:suggestion 128 | 129 | # Expression-level preferences 130 | csharp_prefer_simple_default_expression = true:error 131 | csharp_style_deconstructed_variable_declaration = true:error 132 | csharp_style_inlined_variable_declaration = true:error 133 | csharp_style_pattern_local_over_anonymous_function = true:error 134 | csharp_style_prefer_index_operator = true:error 135 | csharp_style_prefer_local_over_anonymous_function = true:suggestion 136 | csharp_style_prefer_null_check_over_type_check = true:suggestion 137 | csharp_style_prefer_range_operator = true:error 138 | csharp_style_prefer_tuple_swap = true:suggestion 139 | csharp_style_prefer_utf8_string_literals = false:silent 140 | csharp_style_throw_expression = false:silent 141 | csharp_style_unused_value_assignment_preference = discard_variable:silent 142 | csharp_style_unused_value_expression_statement_preference = discard_variable:silent 143 | 144 | # 'using' directive preferences 145 | csharp_using_directive_placement = outside_namespace:error 146 | 147 | # New line preferences 148 | csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false:error 149 | csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false:error 150 | csharp_style_allow_embedded_statements_on_same_line_experimental = false:error 151 | 152 | #### C# Formatting Rules #### 153 | 154 | # New line preferences 155 | csharp_new_line_before_catch = true 156 | csharp_new_line_before_else = true 157 | csharp_new_line_before_finally = true 158 | csharp_new_line_before_members_in_anonymous_types = true 159 | csharp_new_line_before_members_in_object_initializers = true 160 | csharp_new_line_before_open_brace = all 161 | csharp_new_line_between_query_expression_clauses = true 162 | 163 | # Indentation preferences 164 | csharp_indent_block_contents = true 165 | csharp_indent_braces = false 166 | csharp_indent_case_contents = true 167 | csharp_indent_case_contents_when_block = false 168 | csharp_indent_labels = one_less_than_current 169 | csharp_indent_switch_labels = true 170 | 171 | # Space preferences 172 | csharp_space_after_cast = false 173 | csharp_space_after_colon_in_inheritance_clause = true 174 | csharp_space_after_comma = true 175 | csharp_space_after_dot = false 176 | csharp_space_after_keywords_in_control_flow_statements = true 177 | csharp_space_after_semicolon_in_for_statement = true 178 | csharp_space_around_binary_operators = before_and_after 179 | csharp_space_around_declaration_statements = false 180 | csharp_space_before_colon_in_inheritance_clause = true 181 | csharp_space_before_comma = false 182 | csharp_space_before_dot = false 183 | csharp_space_before_open_square_brackets = false 184 | csharp_space_before_semicolon_in_for_statement = false 185 | csharp_space_between_empty_square_brackets = false 186 | csharp_space_between_method_call_empty_parameter_list_parentheses = false 187 | csharp_space_between_method_call_name_and_opening_parenthesis = false 188 | csharp_space_between_method_call_parameter_list_parentheses = false 189 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false 190 | csharp_space_between_method_declaration_name_and_open_parenthesis = false 191 | csharp_space_between_method_declaration_parameter_list_parentheses = false 192 | csharp_space_between_parentheses = false 193 | csharp_space_between_square_brackets = false 194 | 195 | # Wrapping preferences 196 | csharp_preserve_single_line_blocks = true 197 | csharp_preserve_single_line_statements = true 198 | 199 | #### Naming styles #### 200 | [*.{cs,vb}] 201 | 202 | # Naming rules 203 | 204 | dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.severity = warning 205 | dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.symbols = types_and_namespaces 206 | dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.style = pascalcase 207 | 208 | dotnet_naming_rule.interfaces_should_be_ipascalcase.severity = warning 209 | dotnet_naming_rule.interfaces_should_be_ipascalcase.symbols = interfaces 210 | dotnet_naming_rule.interfaces_should_be_ipascalcase.style = ipascalcase 211 | 212 | dotnet_naming_rule.non_field_members_should_be_pascalcase.severity = warning 213 | dotnet_naming_rule.non_field_members_should_be_pascalcase.symbols = non_field_members 214 | dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase 215 | 216 | dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = warning 217 | dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields 218 | dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case 219 | 220 | dotnet_naming_rule.public_static_fields_should_be_pascalcase.severity = warning 221 | dotnet_naming_rule.public_static_fields_should_be_pascalcase.symbols = public_static_fields 222 | dotnet_naming_rule.public_static_fields_should_be_pascalcase.style = pascalcase 223 | 224 | dotnet_naming_rule.private_static_fields_should_be__camelcase.severity = warning 225 | dotnet_naming_rule.private_static_fields_should_be__camelcase.symbols = private_static_fields 226 | dotnet_naming_rule.private_static_fields_should_be__camelcase.style = _camelcase 227 | 228 | dotnet_naming_rule.public_fields_should_be_pascalcase.severity = warning 229 | dotnet_naming_rule.public_fields_should_be_pascalcase.symbols = public_fields 230 | dotnet_naming_rule.public_fields_should_be_pascalcase.style = pascalcase 231 | 232 | dotnet_naming_rule.private_fields_should_be__camelcase.severity = warning 233 | dotnet_naming_rule.private_fields_should_be__camelcase.symbols = private_fields 234 | dotnet_naming_rule.private_fields_should_be__camelcase.style = _camelcase 235 | 236 | dotnet_naming_rule.type_parameters_should_be_tpascalcase.severity = warning 237 | dotnet_naming_rule.type_parameters_should_be_tpascalcase.symbols = type_parameters 238 | dotnet_naming_rule.type_parameters_should_be_tpascalcase.style = tpascalcase 239 | 240 | dotnet_naming_rule.parameters_should_be_camelcase.severity = warning 241 | dotnet_naming_rule.parameters_should_be_camelcase.symbols = parameters 242 | dotnet_naming_rule.parameters_should_be_camelcase.style = camelcase 243 | 244 | dotnet_naming_rule.local_constants_should_be_pascal_case.severity = warning 245 | dotnet_naming_rule.local_constants_should_be_pascal_case.symbols = local_constants 246 | dotnet_naming_rule.local_constants_should_be_pascal_case.style = pascal_case 247 | 248 | dotnet_naming_rule.local_variables_should_be_camelcase.severity = warning 249 | dotnet_naming_rule.local_variables_should_be_camelcase.symbols = local_variables 250 | dotnet_naming_rule.local_variables_should_be_camelcase.style = camelcase 251 | 252 | dotnet_naming_rule.local_functions_should_be_camelcase.severity = warning 253 | dotnet_naming_rule.local_functions_should_be_camelcase.symbols = local_functions 254 | dotnet_naming_rule.local_functions_should_be_camelcase.style = camelcase 255 | 256 | # Symbol specifications 257 | 258 | dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum 259 | dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected 260 | dotnet_naming_symbols.types_and_namespaces.required_modifiers = 261 | 262 | dotnet_naming_symbols.interfaces.applicable_kinds = interface 263 | dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected 264 | dotnet_naming_symbols.interfaces.required_modifiers = 265 | 266 | dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, delegate, method 267 | dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected 268 | dotnet_naming_symbols.non_field_members.required_modifiers = 269 | 270 | dotnet_naming_symbols.constant_fields.applicable_kinds = field 271 | dotnet_naming_symbols.constant_fields.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected 272 | dotnet_naming_symbols.constant_fields.required_modifiers = const 273 | 274 | dotnet_naming_symbols.public_static_fields.applicable_kinds = field 275 | dotnet_naming_symbols.public_static_fields.applicable_accessibilities = public, internal 276 | dotnet_naming_symbols.public_static_fields.required_modifiers = static 277 | 278 | dotnet_naming_symbols.private_static_fields.applicable_kinds = field 279 | dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected 280 | dotnet_naming_symbols.private_static_fields.required_modifiers = static 281 | 282 | dotnet_naming_symbols.public_fields.applicable_kinds = field 283 | dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal 284 | dotnet_naming_symbols.public_fields.required_modifiers = 285 | 286 | dotnet_naming_symbols.private_fields.applicable_kinds = field 287 | dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected 288 | dotnet_naming_symbols.private_fields.required_modifiers = 289 | 290 | dotnet_naming_symbols.type_parameters.applicable_kinds = type_parameter 291 | dotnet_naming_symbols.type_parameters.applicable_accessibilities = * 292 | dotnet_naming_symbols.type_parameters.required_modifiers = 293 | 294 | dotnet_naming_symbols.parameters.applicable_kinds = parameter 295 | dotnet_naming_symbols.parameters.applicable_accessibilities = * 296 | dotnet_naming_symbols.parameters.required_modifiers = 297 | 298 | dotnet_naming_symbols.local_constants.applicable_kinds = local 299 | dotnet_naming_symbols.local_constants.applicable_accessibilities = local 300 | dotnet_naming_symbols.local_constants.required_modifiers = const 301 | 302 | dotnet_naming_symbols.local_variables.applicable_kinds = local 303 | dotnet_naming_symbols.local_variables.applicable_accessibilities = local 304 | dotnet_naming_symbols.local_variables.required_modifiers = 305 | 306 | dotnet_naming_symbols.local_functions.applicable_kinds = local_function 307 | dotnet_naming_symbols.local_functions.applicable_accessibilities = local 308 | dotnet_naming_symbols.local_functions.required_modifiers = 309 | 310 | # Naming styles 311 | 312 | dotnet_naming_style.pascalcase.required_prefix = 313 | dotnet_naming_style.pascalcase.required_suffix = 314 | dotnet_naming_style.pascalcase.word_separator = 315 | dotnet_naming_style.pascalcase.capitalization = pascal_case 316 | 317 | dotnet_naming_style.ipascalcase.required_prefix = I 318 | dotnet_naming_style.ipascalcase.required_suffix = 319 | dotnet_naming_style.ipascalcase.word_separator = 320 | dotnet_naming_style.ipascalcase.capitalization = pascal_case 321 | 322 | dotnet_naming_style.tpascalcase.required_prefix = T 323 | dotnet_naming_style.tpascalcase.required_suffix = 324 | dotnet_naming_style.tpascalcase.word_separator = 325 | dotnet_naming_style.tpascalcase.capitalization = pascal_case 326 | 327 | dotnet_naming_style.camelcase.required_prefix = 328 | dotnet_naming_style.camelcase.required_suffix = 329 | dotnet_naming_style.camelcase.word_separator = 330 | dotnet_naming_style.camelcase.capitalization = camel_case 331 | 332 | dotnet_naming_style._camelcase.required_prefix = _ 333 | dotnet_naming_style._camelcase.required_suffix = 334 | dotnet_naming_style._camelcase.word_separator = 335 | dotnet_naming_style._camelcase.capitalization = camel_case 336 | -------------------------------------------------------------------------------- /.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 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # Tye 66 | .tye/ 67 | 68 | # ASP.NET Scaffolding 69 | ScaffoldingReadMe.txt 70 | 71 | # StyleCop 72 | StyleCopReport.xml 73 | 74 | # Files built by Visual Studio 75 | *_i.c 76 | *_p.c 77 | *_h.h 78 | *.ilk 79 | *.meta 80 | *.obj 81 | *.iobj 82 | *.pch 83 | *.pdb 84 | *.ipdb 85 | *.pgc 86 | *.pgd 87 | *.rsp 88 | *.sbr 89 | *.tlb 90 | *.tli 91 | *.tlh 92 | *.tmp 93 | *.tmp_proj 94 | *_wpftmp.csproj 95 | *.log 96 | *.tlog 97 | *.vspscc 98 | *.vssscc 99 | .builds 100 | *.pidb 101 | *.svclog 102 | *.scc 103 | 104 | # Chutzpah Test files 105 | _Chutzpah* 106 | 107 | # Visual C++ cache files 108 | ipch/ 109 | *.aps 110 | *.ncb 111 | *.opendb 112 | *.opensdf 113 | *.sdf 114 | *.cachefile 115 | *.VC.db 116 | *.VC.VC.opendb 117 | 118 | # Visual Studio profiler 119 | *.psess 120 | *.vsp 121 | *.vspx 122 | *.sap 123 | 124 | # Visual Studio Trace Files 125 | *.e2e 126 | 127 | # TFS 2012 Local Workspace 128 | $tf/ 129 | 130 | # Guidance Automation Toolkit 131 | *.gpState 132 | 133 | # ReSharper is a .NET coding add-in 134 | _ReSharper*/ 135 | *.[Rr]e[Ss]harper 136 | *.DotSettings.user 137 | 138 | # TeamCity is a build add-in 139 | _TeamCity* 140 | 141 | # DotCover is a Code Coverage Tool 142 | *.dotCover 143 | 144 | # AxoCover is a Code Coverage Tool 145 | .axoCover/* 146 | !.axoCover/settings.json 147 | 148 | # Coverlet is a free, cross platform Code Coverage Tool 149 | coverage*.json 150 | coverage*.xml 151 | coverage*.info 152 | 153 | # Visual Studio code coverage results 154 | *.coverage 155 | *.coveragexml 156 | 157 | # NCrunch 158 | _NCrunch_* 159 | .*crunch*.local.xml 160 | nCrunchTemp_* 161 | 162 | # MightyMoose 163 | *.mm.* 164 | AutoTest.Net/ 165 | 166 | # Web workbench (sass) 167 | .sass-cache/ 168 | 169 | # Installshield output folder 170 | [Ee]xpress/ 171 | 172 | # DocProject is a documentation generator add-in 173 | DocProject/buildhelp/ 174 | DocProject/Help/*.HxT 175 | DocProject/Help/*.HxC 176 | DocProject/Help/*.hhc 177 | DocProject/Help/*.hhk 178 | DocProject/Help/*.hhp 179 | DocProject/Help/Html2 180 | DocProject/Help/html 181 | 182 | # Click-Once directory 183 | publish/ 184 | 185 | # Publish Web Output 186 | *.[Pp]ublish.xml 187 | *.azurePubxml 188 | # Note: Comment the next line if you want to checkin your web deploy settings, 189 | # but database connection strings (with potential passwords) will be unencrypted 190 | *.pubxml 191 | *.publishproj 192 | 193 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 194 | # checkin your Azure Web App publish settings, but sensitive information contained 195 | # in these scripts will be unencrypted 196 | PublishScripts/ 197 | 198 | # NuGet Packages 199 | *.nupkg 200 | # NuGet Symbol Packages 201 | *.snupkg 202 | # The packages folder can be ignored because of Package Restore 203 | **/[Pp]ackages/* 204 | # except build/, which is used as an MSBuild target. 205 | !**/[Pp]ackages/build/ 206 | # Uncomment if necessary however generally it will be regenerated when needed 207 | #!**/[Pp]ackages/repositories.config 208 | # NuGet v3's project.json files produces more ignorable files 209 | *.nuget.props 210 | *.nuget.targets 211 | 212 | # Microsoft Azure Build Output 213 | csx/ 214 | *.build.csdef 215 | 216 | # Microsoft Azure Emulator 217 | ecf/ 218 | rcf/ 219 | 220 | # Windows Store app package directories and files 221 | AppPackages/ 222 | BundleArtifacts/ 223 | Package.StoreAssociation.xml 224 | _pkginfo.txt 225 | *.appx 226 | *.appxbundle 227 | *.appxupload 228 | 229 | # Visual Studio cache files 230 | # files ending in .cache can be ignored 231 | *.[Cc]ache 232 | # but keep track of directories ending in .cache 233 | !?*.[Cc]ache/ 234 | 235 | # Others 236 | ClientBin/ 237 | ~$* 238 | *~ 239 | *.dbmdl 240 | *.dbproj.schemaview 241 | *.jfm 242 | *.pfx 243 | *.publishsettings 244 | orleans.codegen.cs 245 | 246 | # Including strong name files can present a security risk 247 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 248 | #*.snk 249 | 250 | # Since there are multiple workflows, uncomment next line to ignore bower_components 251 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 252 | #bower_components/ 253 | 254 | # RIA/Silverlight projects 255 | Generated_Code/ 256 | 257 | # Backup & report files from converting an old project file 258 | # to a newer Visual Studio version. Backup files are not needed, 259 | # because we have git ;-) 260 | _UpgradeReport_Files/ 261 | Backup*/ 262 | UpgradeLog*.XML 263 | UpgradeLog*.htm 264 | ServiceFabricBackup/ 265 | *.rptproj.bak 266 | 267 | # SQL Server files 268 | *.mdf 269 | *.ldf 270 | *.ndf 271 | 272 | # Business Intelligence projects 273 | *.rdl.data 274 | *.bim.layout 275 | *.bim_*.settings 276 | *.rptproj.rsuser 277 | *- [Bb]ackup.rdl 278 | *- [Bb]ackup ([0-9]).rdl 279 | *- [Bb]ackup ([0-9][0-9]).rdl 280 | 281 | # Microsoft Fakes 282 | FakesAssemblies/ 283 | 284 | # GhostDoc plugin setting file 285 | *.GhostDoc.xml 286 | 287 | # Node.js Tools for Visual Studio 288 | .ntvs_analysis.dat 289 | node_modules/ 290 | 291 | # Visual Studio 6 build log 292 | *.plg 293 | 294 | # Visual Studio 6 workspace options file 295 | *.opt 296 | 297 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 298 | *.vbw 299 | 300 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 301 | *.vbp 302 | 303 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 304 | *.dsw 305 | *.dsp 306 | 307 | # Visual Studio 6 technical files 308 | *.ncb 309 | *.aps 310 | 311 | # Visual Studio LightSwitch build output 312 | **/*.HTMLClient/GeneratedArtifacts 313 | **/*.DesktopClient/GeneratedArtifacts 314 | **/*.DesktopClient/ModelManifest.xml 315 | **/*.Server/GeneratedArtifacts 316 | **/*.Server/ModelManifest.xml 317 | _Pvt_Extensions 318 | 319 | # Paket dependency manager 320 | .paket/paket.exe 321 | paket-files/ 322 | 323 | # FAKE - F# Make 324 | .fake/ 325 | 326 | # CodeRush personal settings 327 | .cr/personal 328 | 329 | # Python Tools for Visual Studio (PTVS) 330 | __pycache__/ 331 | *.pyc 332 | 333 | # Cake - Uncomment if you are using it 334 | # tools/** 335 | # !tools/packages.config 336 | 337 | # Tabs Studio 338 | *.tss 339 | 340 | # Telerik's JustMock configuration file 341 | *.jmconfig 342 | 343 | # BizTalk build output 344 | *.btp.cs 345 | *.btm.cs 346 | *.odx.cs 347 | *.xsd.cs 348 | 349 | # OpenCover UI analysis results 350 | OpenCover/ 351 | 352 | # Azure Stream Analytics local run output 353 | ASALocalRun/ 354 | 355 | # MSBuild Binary and Structured Log 356 | *.binlog 357 | 358 | # NVidia Nsight GPU debugger configuration file 359 | *.nvuser 360 | 361 | # MFractors (Xamarin productivity tool) working folder 362 | .mfractor/ 363 | 364 | # Local History for Visual Studio 365 | .localhistory/ 366 | 367 | # Visual Studio History (VSHistory) files 368 | .vshistory/ 369 | 370 | # BeatPulse healthcheck temp database 371 | healthchecksdb 372 | 373 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 374 | MigrationBackup/ 375 | 376 | # Ionide (cross platform F# VS Code tools) working folder 377 | .ionide/ 378 | 379 | # Fody - auto-generated XML schema 380 | FodyWeavers.xsd 381 | 382 | # VS Code files for those working on multiple tools 383 | .vscode/* 384 | !.vscode/settings.json 385 | !.vscode/tasks.json 386 | !.vscode/launch.json 387 | !.vscode/extensions.json 388 | *.code-workspace 389 | 390 | # Local History for Visual Studio Code 391 | .history/ 392 | 393 | # Windows Installer files from build outputs 394 | *.cab 395 | *.msi 396 | *.msix 397 | *.msm 398 | *.msp 399 | 400 | # JetBrains Rider 401 | *.sln.iml 402 | 403 | ## 404 | ## Visual studio for Mac 405 | ## 406 | 407 | 408 | # globs 409 | Makefile.in 410 | *.userprefs 411 | *.usertasks 412 | config.make 413 | config.status 414 | aclocal.m4 415 | install-sh 416 | autom4te.cache/ 417 | *.tar.gz 418 | tarballs/ 419 | test-results/ 420 | 421 | # Mac bundle stuff 422 | *.dmg 423 | *.app 424 | 425 | # content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore 426 | # General 427 | .DS_Store 428 | .AppleDouble 429 | .LSOverride 430 | 431 | # Icon must end with two \r 432 | Icon 433 | 434 | 435 | # Thumbnails 436 | ._* 437 | 438 | # Files that might appear in the root of a volume 439 | .DocumentRevisions-V100 440 | .fseventsd 441 | .Spotlight-V100 442 | .TemporaryItems 443 | .Trashes 444 | .VolumeIcon.icns 445 | .com.apple.timemachine.donotpresent 446 | 447 | # Directories potentially created on remote AFP share 448 | .AppleDB 449 | .AppleDesktop 450 | Network Trash Folder 451 | Temporary Items 452 | .apdisk 453 | 454 | # content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore 455 | # Windows thumbnail cache files 456 | Thumbs.db 457 | ehthumbs.db 458 | ehthumbs_vista.db 459 | 460 | # Dump file 461 | *.stackdump 462 | 463 | # Folder config file 464 | [Dd]esktop.ini 465 | 466 | # Recycle Bin used on file shares 467 | $RECYCLE.BIN/ 468 | 469 | # Windows Installer files 470 | *.cab 471 | *.msi 472 | *.msix 473 | *.msm 474 | *.msp 475 | 476 | # Windows shortcuts 477 | *.lnk 478 | -------------------------------------------------------------------------------- /src/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace UnityPdbDl.Extensions; 4 | 5 | internal static class StringExtensions 6 | { 7 | public static string Strip(this string source, string value) 8 | { 9 | return source.Replace(value, ""); 10 | } 11 | 12 | public static string Strip(this string source, char value) 13 | { 14 | return string.Concat(source.Where(c => c != value)); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Spectre.Console; 3 | 4 | var dllPath = GetDllPath(args); 5 | 6 | if (!TryGetPdbInfo(dllPath, out var guid, out var pdbFileName)) 7 | { 8 | goto End; 9 | } 10 | 11 | var outputDirectory = GetOutputDirectory(dllPath); 12 | 13 | var pdbDownloadUrl = $"http://symbolserver.unity3d.com/{pdbFileName}.pdb/{guid}/{pdbFileName}.pd_"; 14 | var cabFilePath = $"{outputDirectory}/{pdbFileName}.cab"; 15 | 16 | if (!await TryDownloadCabFile(pdbDownloadUrl, cabFilePath)) 17 | { 18 | goto End; 19 | } 20 | 21 | if (!TryExtractCabinetFile(cabFilePath, outputDirectory)) 22 | { 23 | goto End; 24 | } 25 | 26 | AnsiConsole.WriteLine(); 27 | AnsiConsole.MarkupLine("[LightGreen]Done![/]"); 28 | 29 | End: 30 | AnsiConsole.WriteLine(); 31 | AnsiConsole.MarkupLine("Press any key to exit..."); 32 | Console.ReadKey(true); 33 | -------------------------------------------------------------------------------- /src/Steps/Program.Step.DownloadCabinetFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Buffers; 3 | using System.IO; 4 | using System.Net.Http; 5 | using System.Threading.Tasks; 6 | using Spectre.Console; 7 | 8 | internal partial class Program 9 | { 10 | private static async Task TryDownloadCabFile(string pdbDownloadUrl, string cabOutputPath) 11 | { 12 | return await AnsiConsole.Progress() 13 | .StartAsync(ctx => DownloadFile_Progress(ctx, pdbDownloadUrl, cabOutputPath)); 14 | } 15 | 16 | private static async Task DownloadFile_Progress(ProgressContext ctx, string pdbDownloadUrl, string cabOutputPath) 17 | { 18 | using var client = new HttpClient(); 19 | using var response = await client.GetAsync(pdbDownloadUrl, HttpCompletionOption.ResponseHeadersRead); 20 | 21 | if (!response.IsSuccessStatusCode 22 | || response.Content.Headers.ContentLength is not long contentLength) 23 | { 24 | AnsiConsole.MarkupLine($"[IndianRed_1]Web request failed: {(int)response.StatusCode} {response.StatusCode}.[/]"); 25 | return false; 26 | } 27 | 28 | var downloadTask = ctx.AddTask("[Yellow]Downloading archive...[/]", maxValue: contentLength); 29 | 30 | byte[] buffer = ArrayPool.Shared.Rent(81920); 31 | try 32 | { 33 | using var source = await response.Content.ReadAsStreamAsync(); 34 | using var destination = File.OpenWrite(cabOutputPath); 35 | 36 | int bytesRead; 37 | while ((bytesRead = await source.ReadAsync(buffer)) != 0) 38 | { 39 | await destination.WriteAsync(buffer.AsMemory(0, bytesRead)); 40 | downloadTask.Increment(bytesRead); 41 | } 42 | } 43 | catch (Exception ex) 44 | { 45 | AnsiConsole.WriteException(ex); 46 | return false; 47 | } 48 | finally 49 | { 50 | ArrayPool.Shared.Return(buffer); 51 | } 52 | 53 | return true; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Steps/Program.Step.ExtractCabinetFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Microsoft.Deployment.Compression.Cab; 4 | using Spectre.Console; 5 | 6 | internal partial class Program 7 | { 8 | private static bool TryExtractCabinetFile(string cabFilePath, string outputDirectory) 9 | { 10 | AnsiConsole.MarkupLine("[Yellow]Unpacking PDB...[/]"); 11 | 12 | try 13 | { 14 | new CabInfo(cabFilePath).Unpack(outputDirectory); 15 | } 16 | catch (NotSupportedException) { } 17 | catch (Exception ex) 18 | { 19 | AnsiConsole.WriteException(ex); 20 | } 21 | 22 | return TryDeleteCabinetFile(cabFilePath); 23 | } 24 | 25 | private static bool TryDeleteCabinetFile(string cabFilePath) 26 | { 27 | AnsiConsole.MarkupLine("[Yellow]Deleting archive...[/]"); 28 | 29 | try 30 | { 31 | File.Delete(cabFilePath); 32 | return true; 33 | } 34 | catch (Exception ex) 35 | { 36 | AnsiConsole.WriteException(ex); 37 | return false; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Steps/Program.Step.GetDllPath.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Diagnostics.CodeAnalysis; 4 | using System.IO; 5 | using System.Linq; 6 | using Spectre.Console; 7 | using UnityPdbDl.Extensions; 8 | 9 | internal partial class Program 10 | { 11 | private static string GetDllPath(string[] args) 12 | { 13 | if (args.FirstOrDefault() is string dllPath) 14 | { 15 | dllPath = Path.GetFullPath(dllPath); 16 | 17 | if (File.Exists(dllPath) 18 | && Path.GetFileName(dllPath).Equals("UnityPlayer.dll", StringComparison.OrdinalIgnoreCase)) 19 | { 20 | return dllPath; 21 | } 22 | else 23 | { 24 | AnsiConsole.MarkupLine("[IndianRed_1]Provided path was not a valid UnityPlayer.dll path![/]"); 25 | } 26 | } 27 | else 28 | { 29 | AnsiConsole.MarkupLine("[IndianRed_1]Path to game's UnityPlayer.dll file was not provided![/]"); 30 | } 31 | 32 | AnsiConsole.MarkupLine("[LightGreen]Note:[/] you can simply drag the file onto the executable."); 33 | 34 | if (TryFindModuleFromRunningGame(out var gameDllPath)) 35 | { 36 | if (AnsiConsole.Confirm("[Yellow]Is this correct?[/]", true)) 37 | { 38 | dllPath = gameDllPath; 39 | } 40 | else 41 | { 42 | dllPath = GetDllPathFromPrompt(); 43 | } 44 | 45 | AnsiConsole.WriteLine(); 46 | } 47 | else 48 | { 49 | dllPath = GetDllPathFromPrompt(); 50 | } 51 | 52 | return dllPath; 53 | } 54 | 55 | private static bool TryFindModuleFromRunningGame([NotNullWhen(true)] out string? dllPath) 56 | { 57 | AnsiConsole.WriteLine(); 58 | AnsiConsole.MarkupLine("[Yellow]Looking for open Unity games instead...[/]"); 59 | 60 | var (found, dll, gameName) = AnsiConsole.Progress() 61 | .AutoClear(true) 62 | .HideCompleted(true) 63 | .Start(FindModule_Progress); 64 | 65 | if (found) 66 | { 67 | AnsiConsole.MarkupLine($"[Yellow]Found [LightGreen]{gameName!}[/].[/]"); 68 | 69 | dllPath = dll!; 70 | return true; 71 | } 72 | else 73 | { 74 | AnsiConsole.MarkupLine("[IndianRed_1]None found![/]"); 75 | AnsiConsole.WriteLine(); 76 | 77 | dllPath = null; 78 | return false; 79 | } 80 | } 81 | 82 | private static (bool, string?, string?) FindModule_Progress(ProgressContext ctx) 83 | { 84 | bool found = false; 85 | string? dll = null, gameName = null; 86 | 87 | var processes = Process.GetProcesses(); 88 | var processesTask = ctx.AddTask("[Yellow]Polling open processes...[/]", maxValue: processes.Length); 89 | 90 | for (int i = 0; i < processes.Length; i++) 91 | { 92 | var process = processes[i]; 93 | 94 | if (found || process.MainWindowHandle == 0) 95 | { 96 | goto Next; 97 | } 98 | 99 | var modules = process.Modules; 100 | var modulesTask = ctx.AddTask("[Yellow]Polling process' modules...[/]", maxValue: modules.Count); 101 | 102 | for (int j = 0; j < modules.Count; j++) 103 | { 104 | var module = modules[j]; 105 | 106 | if (!found && module.ModuleName.Equals("UnityPlayer.dll", StringComparison.OrdinalIgnoreCase)) 107 | { 108 | gameName = process.ProcessName; 109 | dll = module.FileName; 110 | 111 | found = true; 112 | } 113 | 114 | module.Dispose(); 115 | modulesTask.Increment(1); 116 | } 117 | 118 | Next: 119 | process.Dispose(); 120 | processesTask.Increment(1); 121 | } 122 | 123 | return (found, dll, gameName); 124 | } 125 | 126 | private static string GetDllPathFromPrompt() 127 | { 128 | var relativeDllPath = AnsiConsole.Prompt( 129 | new TextPrompt("[CornflowerBlue]Enter the full path to the game's UnityPlayer.dll:[/]") 130 | .Validate(static path => 131 | { 132 | path = Path.GetFullPath(path.Strip('"')); 133 | 134 | if (!File.Exists(path)) 135 | { 136 | return ValidationResult.Error("[IndianRed_1]File does not exist![/]"); 137 | } 138 | 139 | if (!Path.GetFileName(path).Equals("UnityPlayer.dll", StringComparison.OrdinalIgnoreCase)) 140 | { 141 | return ValidationResult.Error("[IndianRed_1]File is not a UnityPlayer.dll![/]"); 142 | } 143 | 144 | return ValidationResult.Success(); 145 | })); 146 | 147 | return Path.GetFullPath(relativeDllPath.Strip('"')); 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /src/Steps/Program.Step.GetOutputDirectory.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Spectre.Console; 3 | 4 | internal partial class Program 5 | { 6 | private static string GetOutputDirectory(string dllPath) 7 | { 8 | var defaultDirectory = Path.GetDirectoryName(dllPath)!; 9 | 10 | return AnsiConsole.Prompt( 11 | new TextPrompt("[CornflowerBlue]Specify an output directory (leave blank to place PDB in DLL's directory):[/]") 12 | .DefaultValue(defaultDirectory) 13 | .HideDefaultValue() 14 | .Validate(Directory.Exists) 15 | .AllowEmpty()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Steps/Program.Step.GetPdbInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Linq; 3 | using System.Text.RegularExpressions; 4 | using PeNet; 5 | using Spectre.Console; 6 | using UnityPdbDl.Extensions; 7 | 8 | internal partial class Program 9 | { 10 | private static bool TryGetPdbInfo(string dllPath, [NotNullWhen(true)] out string? guid, [NotNullWhen(true)] out string? pdbFileName) 11 | { 12 | guid = null; 13 | pdbFileName = null; 14 | 15 | var peFile = new PeFile(dllPath); 16 | var debugDirectory = peFile.ImageDebugDirectory; 17 | 18 | if (debugDirectory is null) 19 | { 20 | AnsiConsole.MarkupLine("[IndianRed_1]Could not retrieve debug directory information from PE header![/]"); 21 | return false; 22 | } 23 | 24 | var cvInfoPdb70 = debugDirectory.FirstOrDefault()?.CvInfoPdb70; 25 | 26 | if (cvInfoPdb70 is null) 27 | { 28 | AnsiConsole.MarkupLine("[IndianRed_1]Could not retrieve PDB information from debug directory![/]"); 29 | return false; 30 | } 31 | 32 | var matches = GetPdbFileNameRegex().Matches(cvInfoPdb70.PdbFileName); 33 | var match = matches.FirstOrDefault(); 34 | 35 | if (match is null) 36 | { 37 | AnsiConsole.MarkupLine("[IndianRed_1]Could not find PDB file name in PDB information.[/]"); 38 | return false; 39 | } 40 | 41 | guid = cvInfoPdb70.Signature.ToString().Strip('-').ToUpper() + '1'; 42 | pdbFileName = match.Value; 43 | 44 | return true; 45 | } 46 | 47 | [GeneratedRegex(@"[^\\]*(?=[.][\w]+$)", RegexOptions.IgnoreCase | RegexOptions.Compiled, "en-US")] 48 | private static partial Regex GetPdbFileNameRegex(); 49 | } 50 | -------------------------------------------------------------------------------- /src/Unity PDB Downloader.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net7.0 6 | UnityPdbDl 7 | 8 | enable 9 | 10 | true 11 | true 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | --------------------------------------------------------------------------------