none
Need help with this code. I'm 1st time in C#? but this code is decompiled. RRS feed

  • Question

  • byte[,] byte0;
    fixed (byte* pByte_0 = &^((byte0 = byte_0) == null || byte0.Length == 0 ? (byte&) IntPtr.Zero : ref byte0.Address(0, 0)))        this.method_9(gclass95_1, rectangle_0, pByte_0, this.byte_0.GetLength(1));

    IDE said to me about expected System.Index, but in Visual Studio 2019 absent System.Index and how solve this i dont' know.

    Or any1 can say to me where get System.Index for Visual Studio 2019 ?

    Friday, March 20, 2020 5:22 PM

Answers

  • Maybe you can write something like this:

       int len1 = byte_0 == null || byte_0.Length == 0 ? 0 : byte_0.GetLength( 1 );

       byte[,] byte0 = null;

       ref var a = ref byte_0 == null || byte_0.Length == 0 ? ref byte0 : ref byte_0;

       this.method_9( gclass95_1, rectangle_0, a, len1 );

    Or describe the purpose of such disassembling.

    • Marked as answer by Torokh Tuesday, March 24, 2020 1:29 PM
    Saturday, March 21, 2020 10:30 AM

All replies

  • A lot of unknowns here.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Friday, March 20, 2020 5:28 PM
    Moderator
  • Problem at &^ and (byte &)
    • Edited by Torokh Friday, March 20, 2020 6:32 PM
    Friday, March 20, 2020 5:47 PM
  • Maybe you can write something like this:

       int len1 = byte_0 == null || byte_0.Length == 0 ? 0 : byte_0.GetLength( 1 );

       byte[,] byte0 = null;

       ref var a = ref byte_0 == null || byte_0.Length == 0 ? ref byte0 : ref byte_0;

       this.method_9( gclass95_1, rectangle_0, a, len1 );

    Or describe the purpose of such disassembling.

    • Marked as answer by Torokh Tuesday, March 24, 2020 1:29 PM
    Saturday, March 21, 2020 10:30 AM
  • I'll try. Thank you
    Saturday, March 21, 2020 11:26 AM
  • I need translate .EXE, but i have no source code. Then i'm decompiling .EXE and get this code.
    Saturday, March 21, 2020 11:36 AM

  • IDE said to me about expected System.Index, but in Visual Studio 2019 absent System.Index and how solve this i dont' know.

    Or any1 can say to me where get System.Index for Visual Studio 2019 ?

    Your Subject line says: "I'm 1st time in C#"

    If that means that you have not programmed in C# before then you will NEVER
    be able to understand and correct the output from a decompilation or
    disassembler which tries to generate C# source code from an EXE.

    These tools have mixed levels of success, and often require a lot of manual
    corrections to the output.

    You have not told us anything about what kind of project you are trying
    to build, which versions of .NET and C# you are using in the project, etc.

    For some background info on System.Index see:

    C# 8 - System.Index #2148
    https://github.com/dotnet/csharplang/issues/2148

    - Wayne

    Saturday, March 21, 2020 10:13 PM
  • byte* numPtr1 = (byte*)((IntPtr)gclass95_1.method_0().ToPointer() + (IntPtr)num4 * top + (IntPtr)num1 * left);

    This one CS0019: CS0019 Operator cannot be applied to operands of type 'bool' and 'int'

    What need to do ?


    Tuesday, March 24, 2020 1:32 PM