dotnet-inspect-decompiler
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedotnet-inspect: decompiler and IL
dotnet-inspect:反编译器与IL工具
Use this skill to understand how code actually works from the assembly you have.
The decompiler runs locally against the acquired assembly, and the IL and
annotated views can reveal more than the original source. Package and PDB
acquisition can use the network; add to prohibit network access.
For authored original source, use the skill and follow its
checksum-verification boundaries before treating fetched content as
authoritative.
--offlinesourcelinkbash
dnx dotnet-inspect -y -- <command>使用此技能可以从你拥有的程序集中了解代码的实际运行机制。反编译器会针对获取到的程序集在本地运行,IL视图和注释视图能展示比原始源码更多的信息。包和PDB文件的获取可以使用网络;添加参数可禁止网络访问。如果需要查看作者提供的原始源码,请使用技能,并在将获取的内容视为权威内容之前遵循其校验和验证规则。
--offlinesourcelinkbash
dnx dotnet-inspect -y -- <command>Decompiled source and IL
反编译源码与IL
A selected overload and bare both render its bounded overview.
Select explicitly when implementation evidence is the
question. Use for the
full zero-network evidence set:
-SSignatureDecompiled Source-S "Decompiled Source,Annotated Source,IL" --offline- — raised, lowered C# (readable best-effort); locals without PDB names use byte-preserving type/role-derived names by default.
Decompiled Source - — C# with hidden-fact comments and interleaved IL.
Annotated Source - — raw IL, the highest-fidelity view.
IL
Use or when exact opcodes, offsets, branches, tokens, or
calls matter. Use for a whole-type listing.
is broader and may fetch network content when
SourceLink is available; that network body is not checksum-verified by default.
reads existing restored assets; restore/build first if dependencies
changed.
Annotated SourceIL--bare-S @SourceOriginal Source--projectbash
dnx dotnet-inspect -y -- member JsonSerializer --platform System.Text.Json \
Serialize:1 -S "Decompiled Source,Annotated Source,IL" --offline
dnx dotnet-inspect -y -- member JsonSerializer --platform System.Text.Json Serialize:1 -S "Annotated Source"
dnx dotnet-inspect -y -- type JsonSerializer --platform System.Text.Json -S "Decompiled Source" --bare
dnx dotnet-inspect -y -- member Command --project ./src/App Add:1 -S "Decompiled Source,Annotated Source,IL"选择特定重载或仅使用参数都会生成其对应的概览。当需要查看实现细节时,请明确选择。使用可获取完整的无网络依赖证据集:
-SSignatureDecompiled Source-S "Decompiled Source,Annotated Source,IL" --offline- ——经过转换的C#代码(尽可能保证可读性);默认情况下,没有PDB名称的局部变量会使用保留字节信息的类型/角色派生名称。
Decompiled Source - ——带有隐藏信息注释和交错IL代码的C#代码。
Annotated Source - ——原始IL代码,是保真度最高的视图。
IL
当需要关注精确的操作码、偏移量、分支、标记或调用时,请使用或视图。使用参数可查看完整类型列表。
的范围更广,当SourceLink可用时可能会通过网络获取内容;默认情况下,该网络获取的内容不进行校验和验证。
参数会读取已恢复的现有资源;如果依赖项发生变化,请先执行恢复/构建操作。
Annotated SourceIL--bare-S @SourceOriginal Source--projectbash
dnx dotnet-inspect -y -- member JsonSerializer --platform System.Text.Json \
Serialize:1 -S "Decompiled Source,Annotated Source,IL" --offline
dnx dotnet-inspect -y -- member JsonSerializer --platform System.Text.Json Serialize:1 -S "Annotated Source"
dnx dotnet-inspect -y -- type JsonSerializer --platform System.Text.Json -S "Decompiled Source" --bare
dnx dotnet-inspect -y -- member Command --project ./src/App Add:1 -S "Decompiled Source,Annotated Source,IL"Readability and taste
可读性与风格偏好
--readable-namesV_0.dotnet-inspectconfig--tasteApplied Tastebash
dnx dotnet-inspect -y -- member MyType Method:1 --library MyLib.dll \
-S "Decompiled Source,Applied Taste" --taste --readable-names--readable-namesV_0.dotnet-inspectconfig--tasteApplied Tastebash
dnx dotnet-inspect -y -- member MyType Method:1 --library MyLib.dll \
-S "Decompiled Source,Applied Taste" --taste --readable-namesFocusing annotations
聚焦注释信息
By default every hidden fact renders as a trailing comment. A fact with a
long detail can push that comment far off the right edge. promotes
matching facts to a underline beneath the statement, wrapped into a
readable block:
//--focus^^^^bash
dnx dotnet-inspect -y -- member Cache --project ./src/App Pump:1 -S "Annotated Source" --focus allocationThe value matches an annotation category, an exact id, or a dotted-id prefix on
a segment boundary ( selects , not ). It
promotes, it never filters — facts that do not match keep the trailing form,
so narrows attention without hiding anything. A focus that matches
nothing says so and names the families the member does have.
allocalloc.boxallocator.x--focus默认情况下,所有隐藏信息都会以尾部注释的形式呈现。包含长细节的信息可能会导致注释被推到右侧很远的位置。参数会将匹配的信息提升为语句下方的下划线注释,并整理为可读的块:
//--focus^^^^bash
dnx dotnet-inspect -y -- member Cache --project ./src/App Pump:1 -S "Annotated Source" --focus allocation参数值可以匹配注释类别、精确ID或分段边界上的点分ID前缀(会选中,但不会选中)。该参数仅提升显示优先级,不会过滤内容——不匹配的信息仍会保留尾部注释形式,因此可以缩小关注范围但不会隐藏任何内容。如果没有匹配到任何信息,工具会提示这一点并列出该成员包含的信息类别。
allocalloc.boxallocator.x--focusFidelity model
保真度模型
The decompiler degrades honestly: IL with no faithful C# spelling renders as a
visible comment and lowers the result's fidelity level
( -> -> -> -> ) instead of
emitting plausible-but-wrong source, with a stable diagnostic on every
degradation. is lowered C#; raw/annotated is highest
fidelity.
FullPartialStructuredOnlyIlOnlyFailedDEC####Decompiled SourceILIf decompiled output looks wrong, capture , , , (via the skill), and
together; maintainers diagnose pipeline state with DecompilerHarness.
Decompiled SourceAnnotated SourceOriginal SourceSource DiffsourcelinkILSelect for the typed cause census behind that
fidelity grade. It distinguishes a Full method (complete, no causes), a method
without a body (absent), and a failed inspection.
Fidelity CausesDEC####bash
dnx dotnet-inspect -y -- member MyType MyMethod:1 --library MyLib.dll -S "Fidelity Causes"反编译器会如实呈现降级情况:无法转换为可信C#代码的IL会显示为可见注释,并降低结果的保真度级别( → → → → ),而不是生成看似合理但错误的源码,每次降级都会附带稳定的诊断信息。是经过转换的C#代码;原始/注释版是保真度最高的视图。
FullPartialStructuredOnlyIlOnlyFailedDEC####Decompiled SourceIL如果反编译输出看起来有问题,请同时收集、、、(通过技能获取)和内容;维护人员会使用DecompilerHarness诊断流水线状态。
Decompiled SourceAnnotated SourceOriginal SourceSource DiffsourcelinkIL选择可查看该保真度级别背后的类型原因统计。它会区分完整方法(无问题)、无方法体的方法(缺失)和检查失败的情况。
Fidelity CausesDEC####bash
dnx dotnet-inspect -y -- member MyType MyMethod:1 --library MyLib.dll -S "Fidelity Causes"Locate code by IL offset
通过IL偏移量定位代码
bash
dnx dotnet-inspect -y -- library Foo --il-offset 0x06000001+0x5Use (MethodDef token plus IL offset) to
compose its default source-location, member, instruction, exception, callsite,
and return-address sections. Allocation, safety, and cost are opt-in; request
them with . Use
for a sparse batch. For call edges (what a method
calls, who calls it), see the skill.
library Foo --il-offset 0x06000001+0x5-S "Context: Allocation,Context: Safety,Context: Cost"--il-offsets coordinates.txtrelationshipsbash
dnx dotnet-inspect -y -- library Foo --il-offset 0x06000001+0x5使用(MethodDef标记加IL偏移量)可生成默认的源码位置、成员、指令、异常、调用点和返回地址部分内容。分配、安全性和成本是可选内容;可通过请求获取这些信息。使用可进行批量查询。如需查看调用关系(方法调用的对象以及调用该方法的对象),请使用技能。
library Foo --il-offset 0x06000001+0x5-S "Context: Allocation,Context: Safety,Context: Cost"--il-offsets coordinates.txtrelationships