dnspyex / dnspy Goto Github PK
View Code? Open in Web Editor NEWThis project forked from dnspy/dnspy
Unofficial revival of the well known .NET debugger and assembly editor, dnSpy
License: GNU General Public License v3.0
This project forked from dnspy/dnspy
Unofficial revival of the well known .NET debugger and assembly editor, dnSpy
License: GNU General Public License v3.0
Hello, thank you for forking the now archived dnSpy. Do you have information for donations or how to contribute monetarily? It may be nice to provide this so people like myself can help support this project to avoid it ending like dnSpy did!
Before clicking Submit new issue
, try the latest build
<p0>, <p1>
string
which should be used.I guess this will be resolved with the update of ilspy lib?
The file: https://download.osufx.com/release/osu!.exe
.NET supports publishing an application into a single native executable file. This executable contains the actual .net assembly, runtime configuration files, symbols, etc. Currently dnSpyEx shows these assemblies as regular native assemblies. dnSpyEx should be able to unpack these types of files and display their contents in the treeview. An option to extract these files into a directory specified by the user could also be implemented.
dnSpy currently runs on .NET Framework 4.8 and .NET 5.0. We should upgrade and replace .NET 5.0 with .NET 6.0.
Allow the user to start a binary at any supported method by invoking it with a bootstrap executable and reflection. This allows for debugging specific methods of a binary or DLLs.
Inspired by this repo.
Not something I'm waiting for, but a neat idea in case you want to add significant features over dnSpy.
Currently, dnSpy relies on quite old versions of certain libraries. For obvious reasons, the dependencies should be updated.
List of outdated dependencies:
i would LOVE to see dnSpyEx
appear in search results of pamac-manager
, or at least, in AUR.
What version did you use?
Current master branch built from source (https://github.com/dnSpyEx/dnSpy/tree/3302df9216b0e4a05d444b13a65a33adaa610fee)
Write down all steps needed to reproduce this issue. Also attach any needed files.
Attached is a zip archive with the password 'infected'. The contained file is malware, do not execute it, the .exe extension has been removed for safety. Open this file in dnSpy and navigate through the file, multiple functions will fail to decompile with a 'Inconsistent stack size at' in the file ICSharpCode.Decompiler.ILAst.ILAstBuilder.cs
This exposes a larger issue, which is that dnSpy still uses the ILAstBuilder from an old version of ILSpy (v2.4 i think?). This appears to have been replaced with a 'new decompiler' in commit icsharpcode/ILSpy@0cd8e21 which deletes the file ILAstBuilder.cs. The last commit to contain this file is: https://github.com/icsharpcode/ILSpy/blob/19800c3b162dd003f88c3171861912f9e77f1f41/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs
Details:
// Token: 0x0600003A RID: 58 RVA: 0x000027C0 File Offset: 0x000009C0
public static IntPtr \u202A\u202D\u206A\u200B\u206A\u202D\u202E\u202C\u206C\u202C\u206E\u200D\u206C\u202B\u206F\u206A\u206A\u202E\u206F\u206C\u206A\u200E\u206C\u202A\u202B\u200E\u206B\u200F\u200B\u202B\u202C\u206F\u202E\u202C\u200E\u206A\u200D\u200B\u206F\u200D\u202E(string)
{
/*
An exception occurred when decompiling this method (0600003A)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.IntPtr โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ::โชโญโชโโชโญโฎโฌโฌโฌโฎโโฌโซโฏโชโชโฎโฏโฌโชโโฌโชโซโโซโโโซโฌโฏโฎโฌโโชโโโฏโโฎ(System.String)
---> System.Exception: Inconsistent stack size at IL_D8
at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackAnalysis(MethodDef methodDef) in C:\Users\steve\source\repos\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 443
at ICSharpCode.Decompiler.ILAst.ILAstBuilder.Build(MethodDef methodDef, Boolean optimize, DecompilerContext context) in C:\Users\steve\source\repos\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 269
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in C:\Users\steve\source\repos\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 112
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in C:\Users\steve\source\repos\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in C:\Users\steve\source\repos\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.<>c__DisplayClass90_0.<AddMethodBody>b__0() in C:\Users\steve\source\repos\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1519
*/;
}
IL code:
// Token: 0x0600003A RID: 58 RVA: 0x000027C0 File Offset: 0x000009C0
.method public hidebysig static
native int 'โชโญโชโโชโญโฎโฌโฌโฌโฎโโฌโซโฏโชโชโฎโฏโฌโชโโฌโชโซโโซโโโซโฌโฏโฎโฌโโชโโโฏโโฎ' (
string ''
) cil managed
{
// Header Size: 12 bytes
// Code Size: 347 (0x15B) bytes
// LocalVarSig Token: 0x11000009 RID: 9
.maxstack 4
.locals init (
[0] class [mscorlib]System.Collections.IEnumerator,
[1] class [System]System.Diagnostics.ProcessModule,
[2] native int,
[3] class [mscorlib]System.IDisposable,
[4] uint32
)
/* 0x000009CC 2841000006 */ IL_0000: call class [System]System.Diagnostics.Process 'โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ'::'โฎโฎโญโโโโชโฌโญโชโโฌโโฎโโญโฏโโซโฏโญโฏโโฎโฏโชโชโชโชโโซโฎโโญโฏโญโซโชโฌโซโฎ$PST06000041'()
/* 0x000009D1 2842000006 */ IL_0005: call class [System]System.Diagnostics.ProcessModuleCollection 'โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ'::'โซโฎโโโฌโฌโฎโโฌโโโโโฏโฏโฎโชโฌโญโชโฌโโโฌโฎโโฎโชโโโโฏโญโโชโฎโโฎโญโซโฎ$PST06000042'(class [System]System.Diagnostics.Process)
/* 0x000009D6 2843000006 */ IL_000A: call class [mscorlib]System.Collections.IEnumerator 'โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ'::'โฌโชโโฌโโฎโโโซโโซโโฌโซโฎโฏโชโโญโฌโชโโโซโโญโโซโโซโญโฎโชโฎโโซโฎโฎโชโฌโฎ$PST06000043'(class [mscorlib]System.Collections.ReadOnlyCollectionBase)
/* 0x000009DB 0A */ IL_000F: stloc.0
.try
{
/* 0x000009DC 38AB000000 */ IL_0010: br IL_00C0
/* 0x000009E1 2008D4990C */ IL_0015: ldc.i4 211407880
// loop start (head: IL_001A)
/* 0x000009E6 2001B57E13 */ IL_001A: ldc.i4 327070977
/* 0x000009EB 61 */ IL_001F: xor
/* 0x000009EC 25 */ IL_0020: dup
/* 0x000009ED 1304 */ IL_0021: stloc.s V_4
/* 0x000009EF 1C */ IL_0023: ldc.i4.6
/* 0x000009F0 5E */ IL_0024: rem.un
/* 0x000009F1 4506000000D3FFFFFF490000007E0000009F0000001E0000000A000000 */ IL_0025: switch (IL_0015, IL_008B, IL_00C0, IL_00E1, IL_0060, IL_004C)
/* 0x00000A0E 17 */ IL_0042: ldc.i4.1
/* 0x00000A0F 2CD0 */ IL_0043: brfalse.s IL_0015
/* 0x00000A11 3897000000 */ IL_0045: br IL_00E1
/* 0x00000A16 11FF */ IL_004A: ldloc.s <null>
/* 0x00000A18 06 */ IL_004C: ldloc.0
/* 0x00000A19 2844000006 */ IL_004D: call object 'โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ'::'โโฌโฎโญโฌโโโฎโซโโญโญโโโซโโชโชโโชโฌโฌโฎโซโซโโโโโฌโญโซโญโโซโโชโโชโฌโฎ$PST06000044'(class [mscorlib]System.Collections.IEnumerator)
/* 0x00000A1E 7416000001 */ IL_0052: castclass [System]System.Diagnostics.ProcessModule
/* 0x00000A23 0B */ IL_0057: stloc.1
/* 0x00000A24 20408CE034 */ IL_0058: ldc.i4 887131200
/* 0x00000A29 2BBB */ IL_005D: br.s IL_001A
/* 0x00000A2B 25 */ IL_005F: dup
// loop start (head: IL_0060)
/* 0x00000A2C 07 */ IL_0060: ldloc.1
/* 0x00000A2D 2848000006 */ IL_0061: call native int 'โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ'::'โซโฎโฌโโซโญโซโญโโญโโซโโชโฎโซโฎโฎโชโซโโฌโชโชโชโโญโชโฌโฌโโซโชโฏโชโฎโโญโชโชโฎ$PST06000048'(class [System]System.Diagnostics.ProcessModule)
/* 0x00000A32 0C */ IL_0066: stloc.2
/* 0x00000A33 DDED000000 */ IL_0067: leave IL_0159
/* 0x00000A38 1104 */ IL_006C: ldloc.s V_4
/* 0x00000A3A 20BA0D0AF3 */ IL_006E: ldc.i4 -217444934
/* 0x00000A3F 5A */ IL_0073: mul
/* 0x00000A40 208D1EE375 */ IL_0074: ldc.i4 1977818765
/* 0x00000A45 61 */ IL_0079: xor
/* 0x00000A46 D005000006 */ IL_007A: ldtoken method string 'โโญโโชโชโญโชโโญโโโซโโชโโซโชโโญโฏโญโญโฌโโฌโฏโฎโโฌโโโชโฎโฎโโโโโญโชโฎ'::'โโฎโโโชโญโญโญโซโโฎโโโโโโชโโโโญโโโฏโซโโฎโซโชโญโโโโโโฏโฎโซโฌโซโฎ'()
/* 0x00000A4B 8C28000001 */ IL_007F: box [mscorlib]System.RuntimeMethodHandle
/* 0x00000A50 2CDA */ IL_0084: brfalse.s IL_0060
// end loop
/* 0x00000A52 16 */ IL_0086: ldc.i4.0
/* 0x00000A53 26 */ IL_0087: pop
/* 0x00000A54 2B90 */ IL_0088: br.s IL_001A
/* 0x00000A56 26 */ IL_008A: pop
/* 0x00000A57 07 */ IL_008B: ldloc.1
/* 0x00000A58 2845000006 */ IL_008C: call string 'โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ'::'โโฌโซโฎโฌโฌโซโฎโโซโโฏโญโชโโโชโญโฌโซโชโซโโฏโชโโชโซโซโญโโฎโโฌโชโชโซโโฌโฌโฎ$PST06000045'(class [System]System.Diagnostics.ProcessModule)
/* 0x00000A5D 2846000006 */ IL_0091: call string 'โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ'::'โฎโโชโฎโญโโฌโซโฏโซโชโญโซโญโญโซโฌโฏโญโซโชโฎโฌโชโฌโซโโฎโฏโฏโญโฌโญโฎโชโฎโฎโฎโฎโฌโฎ$PST06000046'(string)
/* 0x00000A62 02 */ IL_0096: ldarg.0
/* 0x00000A63 2846000006 */ IL_0097: call string 'โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ'::'โฎโโชโฎโญโโฌโซโฏโซโชโญโซโญโญโซโฌโฏโญโซโชโฎโฌโชโฌโซโโฎโฏโฏโญโฌโญโฎโชโฎโฎโฎโฎโฌโฎ$PST06000046'(string)
/* 0x00000A68 2847000006 */ IL_009C: call bool 'โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ'::'โฎโซโโซโญโโญโโโฏโซโฌโฎโโโฎโฎโโฎโโฌโซโฎโโโญโโญโชโฌโโฎโฌโฎโญโโโฌโฌโฌโฎ$PST06000047'(string, string)
/* 0x00000A6D 2D08 */ IL_00A1: brtrue.s IL_00AB
/* 0x00000A6F 208479EDBA */ IL_00A3: ldc.i4 -1158841980
/* 0x00000A74 25 */ IL_00A8: dup
/* 0x00000A75 2B06 */ IL_00A9: br.s IL_00B1
/* 0x00000A77 20E03A4DBA */ IL_00AB: ldc.i4 -1169343776
/* 0x00000A7C 25 */ IL_00B0: dup
/* 0x00000A7D 26 */ IL_00B1: pop
/* 0x00000A7E 1104 */ IL_00B2: ldloc.s V_4
/* 0x00000A80 20399E4318 */ IL_00B4: ldc.i4 407084601
/* 0x00000A85 5A */ IL_00B9: mul
/* 0x00000A86 61 */ IL_00BA: xor
/* 0x00000A87 385AFFFFFF */ IL_00BB: br IL_001A
// end loop
// loop start (head: IL_00C0)
/* 0x00000A8C 06 */ IL_00C0: ldloc.0
/* 0x00000A8D 2849000006 */ IL_00C1: call bool 'โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ'::'โโฌโโซโโญโโชโซโโชโชโโโชโฌโโญโญโฌโญโญโโญโโชโญโซโซโชโโชโฎโฌโโโญโซโชโชโฎ$PST06000049'(class [mscorlib]System.Collections.IEnumerator)
/* 0x00000A92 2C08 */ IL_00C6: brfalse.s IL_00D0
/* 0x00000A94 2008D4990C */ IL_00C8: ldc.i4 211407880
/* 0x00000A99 25 */ IL_00CD: dup
/* 0x00000A9A 2B06 */ IL_00CE: br.s IL_00D6
/* 0x00000A9C 20CA75476C */ IL_00D0: ldc.i4 1816622538
/* 0x00000AA1 25 */ IL_00D5: dup
/* 0x00000AA2 26 */ IL_00D6: pop
/* 0x00000AA3 17 */ IL_00D7: ldc.i4.1
/* 0x00000AA4 2CE6 */ IL_00D8: brfalse.s IL_00C0
// end loop
/* 0x00000AA6 383BFFFFFF */ IL_00DA: br IL_001A
/* 0x00000AAB 0EFF */ IL_00DF: ldarg.s <null>
/* 0x00000AAD DE70 */ IL_00E1: leave.s IL_0153
} // end .try
finally
{
/* 0x00000AAF 06 */ IL_00E3: ldloc.0
/* 0x00000AB0 7507000001 */ IL_00E4: isinst [mscorlib]System.IDisposable
/* 0x00000AB5 0D */ IL_00E9: stloc.3
/* 0x00000AB6 20E4BDDB51 */ IL_00EA: ldc.i4 1373355492
// loop start (head: IL_00EF)
/* 0x00000ABB 2001B57E13 */ IL_00EF: ldc.i4 327070977
/* 0x00000AC0 61 */ IL_00F4: xor
/* 0x00000AC1 25 */ IL_00F5: dup
/* 0x00000AC2 1304 */ IL_00F6: stloc.s V_4
/* 0x00000AC4 1A */ IL_00F8: ldc.i4.4
/* 0x00000AC5 5E */ IL_00F9: rem.un
/* 0x00000AC6 4504000000290000000700000043000000DBFFFFFF */ IL_00FA: switch (IL_0138, IL_0116, IL_0152, IL_00EA)
/* 0x00000ADB 17 */ IL_010F: ldc.i4.1
/* 0x00000ADC 2CD8 */ IL_0110: brfalse.s IL_00EA
/* 0x00000ADE 2B3E */ IL_0112: br.s IL_0152
/* 0x00000AE0 0EFF */ IL_0114: ldarg.s <null>
// loop start (head: IL_0116)
/* 0x00000AE2 09 */ IL_0116: ldloc.3
/* 0x00000AE3 2C08 */ IL_0117: brfalse.s IL_0121
/* 0x00000AE5 20C0946FCA */ IL_0119: ldc.i4 -898657088
/* 0x00000AEA 25 */ IL_011E: dup
/* 0x00000AEB 2B06 */ IL_011F: br.s IL_0127
/* 0x00000AED 2092F723A0 */ IL_0121: ldc.i4 -1608255598
/* 0x00000AF2 25 */ IL_0126: dup
/* 0x00000AF3 26 */ IL_0127: pop
/* 0x00000AF4 1104 */ IL_0128: ldloc.s V_4
/* 0x00000AF6 20D5444BDC */ IL_012A: ldc.i4 -599046955
/* 0x00000AFB 5A */ IL_012F: mul
/* 0x00000AFC 61 */ IL_0130: xor
/* 0x00000AFD 16 */ IL_0131: ldc.i4.0
/* 0x00000AFE 2DE2 */ IL_0132: brtrue.s IL_0116
// end loop
/* 0x00000B00 2BB9 */ IL_0134: br.s IL_00EF
/* 0x00000B02 11FF */ IL_0136: ldloc.s <null>
// loop start (head: IL_0138)
/* 0x00000B04 09 */ IL_0138: ldloc.3
/* 0x00000B05 284A000006 */ IL_0139: call void 'โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ'::'โซโโโโซโโโฌโโซโโญโโฏโชโชโโฌโโซโโญโโฎโโซโโฎโโฎโญโโญโโซโฌโฌโซโฎโฌโฎ$PST0600004A'(class [mscorlib]System.IDisposable)
/* 0x00000B0A 1104 */ IL_013E: ldloc.s V_4
/* 0x00000B0C 20E968E190 */ IL_0140: ldc.i4 -1864275735
/* 0x00000B11 5A */ IL_0145: mul
/* 0x00000B12 2093D9B470 */ IL_0146: ldc.i4 1890900371
/* 0x00000B17 61 */ IL_014B: xor
/* 0x00000B18 17 */ IL_014C: ldc.i4.1
/* 0x00000B19 2CE9 */ IL_014D: brfalse.s IL_0138
// end loop
/* 0x00000B1B 2B9E */ IL_014F: br.s IL_00EF
// end loop
/* 0x00000B1D 7A */ IL_0151: throw
/* 0x00000B1E DC */ IL_0152: endfinally
} // end handler
/* 0x00000B1F 7E0B00000A */ IL_0153: ldsfld native int [mscorlib]System.IntPtr::Zero
/* 0x00000B24 2A */ IL_0158: ret
/* 0x00000B25 08 */ IL_0159: ldloc.2
/* 0x00000B26 2A */ IL_015A: ret
} // end of method 'โโฏโโโฎโฌโซโซโชโโชโญโญโโฏโญโโญโชโฏโฌโซโโโญโโฌโฌโฌโโฏโโญโโฌโฏโโโฌโฏโฎ'::'โชโญโชโโชโญโฎโฌโฌโฌโฎโโฌโซโฏโชโชโฎโฏโฌโชโโฌโชโซโโซโโโซโฌโฏโฎโฌโโชโโโฏโโฎ'
File to decompile:
malware_file.zip
I want to get EntityHandle through dnlib's IMethod.
Do you know what should I do?
I'm trying to compile a module but there are a number of variables that are named like this:
CS$<>8__locals1
CS$<>8__locals2
CS$<>8__locals4.CS$<>8__locals3.CS$<>8__locals2.CS$<>8__locals1.<>4__this
Class.<>c__DisplayClass4_0 CS$<>8__locals1 = new Class.<>c__DisplayClass4_0();
Is there a way I can fix these so I can make edits & recompile the module?
Please add Vietnamese Language
When I enable trace mode for some ASP.NET binary, it started to print out enormous number of traces into console
which slows down stratup greatly!
After some seconds dnSpyEx shows this error box and quits
Could not start the debugger. Make sure you have access to the file 'C:\temp\my_sw.exe'
Error: Waiting for CoreCLR timed out. Debug 32-bit .NET apps with 32-bit dnSpy (dnSpy-x86.exe), and 64-bit .NET apps with 64-bit dnSpy (dnSpy.exe).
Note; my .exe is 64 bit and I'm using dnSpyEx 64 bit. So the only reason it very small timeout...
Idea is either to more this timeout or make it configurable in Options Window for Debugger
It seems that after #13 was merged the artifacts have significantly grown in size. The .net core artifacts have gone from around 80MB to around 200MB and the .net framework artifact has gone from 20MB to 60MB. This is probably caused by the fact that GitHub actions doesnโt compress the artifacts or uses a different algorithm. This wasnโt a problem before as the compression was handled by powershell.
Goal: Find a way to shrink the artifacts in size so people with slower connections and or data caps have a easier time downloading dnSpySx.
Yah, the 0xd4d even deleted the old releases of the dnspy, if possible include that unity debug files as well in the next releases :)
Hello I'm a very new C# learner, recently I wrote some demo code with dynamic objects, which I just learn.
But code in dnspy becomes very hard to read.
"dynamic" becomes "object" and many lines about
dynamic object broken like "myclass_<>p50_<>o7"
I tried latest release but same
I tried latest ILSpy, the code is correct
I tried compare code between ilspy and dnspy , want to find something about it. But .sln is too big and too hard for me to read
So that's all I know, pls tell me if my issue is(maybe) a part of other one or it's already planned to fix
.NET obfuscators and protectors like to employ "Anti Debug" measures to prevent debugging. dnSpy is currently able to bypass the following methods of checking for a debugger:
IsAttached
and IsLogging
properties/methods from the System.Diagnostics.Debugger
class.CheckRemoteDebuggerPresent
native API.IsDebuggerPresent
native API.Other known ways that can detect the dnSpy debugger:
CheckRemoteDebuggerPresent
and IsDebuggerPresent
.CloseHandle
native API - passing an invalid handle that is not zero will cause the API to throw an exception only if the process is running under a debugger.NtQueryInformationProcess
native API - Used to retrieve the parent process and is often compared to an internal table of known debugger tools.dnSpy
- Very rarely used in software that is not UnpackMes.%APPDATA%\dnSpy\dnSpy.xml
file - Very rarely used in software that is not UnpackMes.Potential solutions:
Currently, the "Autos" tool window displays a temporary "NYI" node to signal that it's not implemented.
Looking at VS, the Autos window should display all variables and class members before and on the current line when a breakpoint is hit.
Before clicking Submit new issue
, try the latest build
What version did you use?
Latest 6.1.9 Compiled at 19 December 2021 .NET 6.0
Write down all steps needed to reproduce this issue. Also attach any needed files.
After compiling the .NET 6.0 version the Microsoft.CodeAnalysis.Scripting library is missing
Regards
A zipception.
PS: nice work on updating this lovely product.
Some computer mice come with the ability to tilt the scroll wheel to the left or right in order to scroll in horizontal directions. Moreover, Some pieces of mice software also allow users to bind other buttons to horizontal/tilt scrolling. Horizontal/tilt scrolling is currently not supported by dnSpyEx.
Please add this Vietnamese language pack. I have finished translating it. Thanks
dnSpy Language Files (vi) RESX.zip
Inspired by IDA, rename those symbols can help us to understand code.
I suppose to use Ctrl+R, Ctrl+R
as hotkey.
I can't find the patched mono.dll in the Releases page or anything. Not even on the official dnSpy repo!
I just need a build of mono.dll (patched) for Unity 2019.4.15f1
What version did you use?
6.1.9
Write down all steps needed to reproduce this issue. Also attach any needed files.
This assembly is obfuscated by 'Virbox'. You can see raw address of pe section '.text' is zero. The data will be restored at runtime.
I used to fix that by changing dnspy rva conversion. Maybe it is helpful.
wwh1004@503a665#diff-ff1abfce4050a43e302006c993e2c3fbf6bb9db7cbcdbf1f7d12cb65aacd7c25L47
Single assembly:
1.zip
Recently I wanted to decompile 2 versions of an application to diff them, and the compiler-generated code always seems to move classes around in the file. An option to sort decompiled methods/classes in the decompiled code would prevent this.
Currently dnSpy does not warn the user before attempting to debug a file with a different CPU architecture then the current dnSpy process. When starting to debug dnSpy just starts the process and fails to attach. This can cause unwanted execution of the fileโs code. A potential solution would be to create display warning before the process is started stating that the architecture is mismatched and that proceeding will most likely leed to a failed attachment.
Since dnSpy relies on NRefactory to output the CSharp code, it is possible to customize the code style of the output to some degree. A settings panel under the Decompiler -> C#/VB (ILSpy) with all the available and working options would be ideal. Moreover, NRefactory offers some pre-configured styles for which we could offer a dropdown list.
Hi, is it possible to implement dnspy on new windows 11 contex menu?
I know there are sources but only in c ++ here:
https://github.com/microsoft/AppModelSamples/tree/master/Samples/SparsePackages
the only option possibly use a P / invok functions.?
Other possible source...
https://github.com/ikas-mc/ContextMenuForWindows11
Best Regards
Hi,
Latest avaiable source for dnlib is date 11 Nov 2020
https://github.com/0xd4d/dnlib
can update repository for dnspyEx?
Regards
This is not an easy feature to add but a lot of people are looking forward to this. Being able to compare two assemblies and find differences. There are tools for this already like JustAssembly from Telerik. Or there are recommendation like exporting both assemblies to project files and then use a binary diff tool. However doing this within dnSpy would be a lot easier.
using System;
using System.Runtime.CompilerServices;
public class Foo
{
private static Bar bars;
[CompilerGenerated]
private static Action<string> <>f__mg$cache0;
public static void Action(string str)
{
}
// Note: this type is marked as 'beforefieldinit'.
static Foo()
{
if (Foo.<>f__mg$cache0 == null)
{
Foo.<>f__mg$cache0 = new Action<string>(Foo.Action);
}
Foo.bars = new Bar(Foo.<>f__mg$cache0, false);
}
}
Currently, dnSpyEx uses a heavily modified and patched version of ICSharpCode.Decompiler version 2.4 and NRefactory to decompile C# code. However, with the continuous updates of the C# language and the Roslyn compiler the decompilation output is slowly becoming more and more unreadable and inaccurate. The rather dated 2.4 version of ILSpy has a hard time dealing with newer code for features such as async
, yield return
, nullable, Span<T>
, etc. Moreover, the version 2.4 decompiler engine and codebase are hard to work with, so pushing updates to it is rather hard and painful.
Originally the ILSpy 2.4 engine was based on Mono.Cecil but due to cecil's poor ability to load obfuscated assemblies, it was ported to dnlib by Ki (yck1509). Moreover, the way it prints the decompiled code was heavily modified to match dnSpy together with several other changes.
Possible approaches of taking on this problem:
It is worth noting that approaches 1 and 2 also will require a considerable amount of changes to the decompiler and dnSpy to properly function with the dnSpy frontend, debugger, and other dnSpy features on top of the port to dnlib.
Suggestions, discussions, and novel approach ideas are welcome in the comments!
Attached is the file that the issue has been occurring on, although I don't know if that has anything to do with the issue as I haven't really decompiled other files.
Assembly-CSharp.zip
commit 68c0ee0
dotnet build
nexis@rob-laptop:~/dnSpy-dev$ dotnet build
Microsoft (R) Build Engine version 16.10.2+857e5a733 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Contracts.DnSpy/dnSpy.Contracts.DnSpy.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/Roslyn/dnSpy.Roslyn/dnSpy.Roslyn.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger/dnSpy.Debugger.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Decompiler/dnSpy.Decompiler.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/Examples/Example1.Extension/Example1.Extension.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Scripting.Roslyn/dnSpy.Scripting.Roslyn.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Libraries/ICSharpCode.TreeView/ICSharpCode.TreeView.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy/dnSpy.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Images/dnSpy.Images.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.AsmEditor/dnSpy.AsmEditor.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dnSpy.Debugger.DotNet.CorDebug.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/dnSpy.Debugger.DotNet.Mono.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/Examples/Example2.Extension/Example2.Extension.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.BamlDecompiler/dnSpy.BamlDecompiler.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/ILSpy.Decompiler/dnSpy.Decompiler.ILSpy/dnSpy.Decompiler.ILSpy.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Console/dnSpy.Console.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Analyzer/dnSpy.Analyzer.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/dnSpy.Debugger.DotNet.csproj]
Build FAILED.
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Contracts.DnSpy/dnSpy.Contracts.DnSpy.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/Roslyn/dnSpy.Roslyn/dnSpy.Roslyn.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger/dnSpy.Debugger.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Decompiler/dnSpy.Decompiler.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/Examples/Example1.Extension/Example1.Extension.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Scripting.Roslyn/dnSpy.Scripting.Roslyn.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Libraries/ICSharpCode.TreeView/ICSharpCode.TreeView.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy/dnSpy.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Images/dnSpy.Images.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.AsmEditor/dnSpy.AsmEditor.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dnSpy.Debugger.DotNet.CorDebug.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/dnSpy.Debugger.DotNet.Mono.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/Examples/Example2.Extension/Example2.Extension.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.BamlDecompiler/dnSpy.BamlDecompiler.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/ILSpy.Decompiler/dnSpy.Decompiler.ILSpy/dnSpy.Decompiler.ILSpy.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/dnSpy/dnSpy.Console/dnSpy.Console.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Analyzer/dnSpy.Analyzer.csproj]
/usr/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/nexis/dnSpy-dev/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/dnSpy.Debugger.DotNet.csproj]
0 Warning(s)
18 Error(s)
Time Elapsed 00:00:03.41
I know this is a huge PITA to unravel and fix, but it would be nice to at least have the CLI app build on Linux.
It is recommended to add save code in file menu in the new version, This function has been implemented in the previous V4.5, but now it has been deleted.
Currently, dnSpy only allows exporting to the old C# project format which shouldn't be used with .NET Core, .NET Standard, .NET 5, and any new version going forward. The new format is much less cluttered and easier to work with.
dnSpy should, ideally, be able to export projects in both formats.
Reference of SDK style project format: https://docs.microsoft.com/en-us/dotnet/core/project-sdk/overview
Specifying msbuild path with https://github.com/microsoft/setup-msbuild.
This change will make the file easier to read; will add an explicit dependency on msbuild.
Sorry about the other issue I made, I was just really in a rush. Anyways, I found the pre-compiled DLLs but, the game I am playing just stays on the first scene which is a screen with rolling text at the top and bottom saying Playtest then a couple seconds later IT SHOULD fade into the MAIN scene but it doesn't. It just stays looping on that scene FOREVER.
Right so:
Running the game normally works but with this it doesn't.
Before clicking Submit new issue
, try the latest build
What version did you use?
latest
Write down all steps needed to reproduce this issue. Also attach any needed files.
I loaded up the assembly-csharp.dll from the game Detention
I tried to edit a method from TextDialogueInterface
I had this error
then I moved vector3 parameter to the left to be first
it did compile
then when I save the module this happens:
For both versions:
the console client is not working. 6.1.7 is working fine.
Just to let you know, there are links to the wiki and elsewhere in the README that lead to the now-archived dnspy/dnspy repo.
dnSpy currently supports some of the expression evaluator intrinsics defined here: https://github.com/Microsoft/ConcordExtensibilitySamples/wiki/CLR-Expression-Evaluator-Intrinsics. These intrinsic methods are used throughout the expression compiler used by dnSpy's debugger component.
List of intrinsics and their support status:
Some files compiled by Xamarin are compressed with LZ4 (see dotnet/android#4686) - would it be possible to add support for this? Another Github user has provided a Python file to decompress it, but it would be nice if it was built in to dnSpy.
A lot of people ask about string window in dnspy ala x64dbg or olly, some had developed a plugin without good results though.
Here is an easy solution for this feature.
You can search for strings with regex pattern /./ (all). but then cant see which strings are found. The solution is just add a column to the search results in string mode. This is really useful when using regex. Maybe can add a button all strings which inserts this regex query /./.
Unfortunately I lost my source code but the mod is very simple.
Hey, I am trying to create dnSpy-Unity-mono for version 2020.3, when using the umpatcher i get an error for copying eglib because it is in mono/mono instead of mono.
ANy help would be appreciated.
Being able to save your modifications, load and apply them is extremely powerful. Even tools like Ollydb had these feature. If you for example patch a file and this file receives a new update. You dont have to go to each location and redo all your changes. You could instead just load your patch and apply. Even for logging purpose this has a high value, no need to write down all your steps in notepad.
I've made a feature request on original dnSpy and it got many votes but then dnSpy has retired.
Like original dnSpy you can only find references (Analyze - Used by) for the whole enum but not for a specific enum value. However if its a large and used by many functions but you are only interested in where is a specific value of this enum being used you have to go through all of them which takes a lot of time.
My request is being able to find references where a specifc enum value is being used.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.