mirror of https://github.com/Xpl0itR/protodec.git
bugfixes
This commit is contained in:
parent
3fe8077e7f
commit
253983430d
|
@ -6,13 +6,13 @@ using protodec;
|
|||
|
||||
const string indent = " ";
|
||||
const string help = """
|
||||
Usage: protodec(.exe) [options] <target_assembly_path> <out_path>
|
||||
Options:
|
||||
--skip_enums Skip parsing enums and replace references to then with int32.
|
||||
--include_runtime_assemblies Add the assemblies of the current runtime to the search path.
|
||||
Usage: protodec(.exe) <target_assembly_path> <out_path> [options]
|
||||
Arguments:
|
||||
target_assembly_path Either a single assembly or a directory of assemblies to be parsed.
|
||||
out_path An existing directory to output into individual files, otherwise output to a single file.
|
||||
Options:
|
||||
--skip_enums Skip parsing enums and replace references to then with int32.
|
||||
--include_runtime_assemblies Add the assemblies of the current runtime to the search path.
|
||||
""";
|
||||
|
||||
if (args.Length < 2)
|
||||
|
|
11
Protodec.cs
11
Protodec.cs
|
@ -97,9 +97,9 @@ public sealed class Protodec
|
|||
else
|
||||
{
|
||||
ParseMessage(type, skipEnums);
|
||||
message.Imports.Add(type.Name);
|
||||
}
|
||||
|
||||
message.Imports.Add(type.Name);
|
||||
return type.Name;
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public sealed class Protodec
|
|||
?.ConstructorArguments[0]
|
||||
.Value
|
||||
as string
|
||||
?? TranslateEnumFieldName(field.Name);
|
||||
?? TranslateEnumFieldName(enumEnum.Name, field.Name);
|
||||
|
||||
protoEnum.Fields.Add(enumFieldId, enumFieldName);
|
||||
}
|
||||
|
@ -131,7 +131,6 @@ public sealed class Protodec
|
|||
}
|
||||
else
|
||||
{
|
||||
message.Imports.Add(protoEnum.Name);
|
||||
Enums.Add(protoEnum.Name, protoEnum);
|
||||
}
|
||||
}
|
||||
|
@ -161,8 +160,10 @@ public sealed class Protodec
|
|||
name.IsBeebyted() ? name : name.ToSnakeCaseLower();
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static string TranslateEnumFieldName(string name) =>
|
||||
name.IsBeebyted() ? name : name.ToSnakeCaseUpper();
|
||||
private static string TranslateEnumFieldName(string enumName, string fieldName) =>
|
||||
enumName.IsBeebyted()
|
||||
? enumName + '_' + fieldName.ToSnakeCaseUpper()
|
||||
: (enumName + fieldName).ToSnakeCaseUpper();
|
||||
|
||||
private bool TryParseWriteToMethod(Type targetClass)
|
||||
{
|
||||
|
|
10
README.md
10
README.md
|
@ -5,14 +5,14 @@ A tool to decompile protobuf parser/serializer classes compiled by [protoc](http
|
|||
Usage
|
||||
-----
|
||||
```
|
||||
Usage: protodec(.exe) [options] <target_assembly_path> <out_path>
|
||||
Options:
|
||||
--skip_enums Skip parsing enums and replace references to then with int32.
|
||||
--include_runtime_assemblies Add the assemblies of the current runtime to the search path.
|
||||
Usage: protodec(.exe) <target_assembly_path> <out_path> [options]
|
||||
Arguments:
|
||||
target_assembly_path Either a single assembly or a directory of assemblies to be parsed.
|
||||
out_path An existing directory to output into individual files, otherwise output to a single file.
|
||||
```
|
||||
Options:
|
||||
--skip_enums Skip parsing enums and replace references to then with int32.
|
||||
--include_runtime_assemblies Add the assemblies of the current runtime to the search path.
|
||||
```
|
||||
|
||||
Limitations
|
||||
-----------
|
||||
|
|
Loading…
Reference in New Issue