V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
xzpjerry731
V2EX  ›  C#

反编译 c#遇到 unmanaged 的代码还能继续下去吗?

  •  
  •   xzpjerry731 · Jul 14, 2021 · 2277 views
    This topic created in 1753 days ago, the information mentioned may be changed or developed.

    用 ILSpy 反编译一个 dll 遇到这样一段代码

    long num = *(long*)((ulong)(nint)ptr + 8uL);
    int num2 = *(int*)ptr;
    CFile* file;
    CFile.Open(&file, some_path, 36898u, null);
    
    // 以下我猜是调用了一个函数
    (
        (delegate* unmanaged[Cdecl, Cdecl]<IntPtr, void*, uint, void>)
        (*(ulong*)(*(long*)file + 136))
    )(
        (nint)file, (void*)num, (uint)num2
    );
    

    🙏

    1 replies    2021-07-14 10:13:59 +08:00
    32uKHwVJ179qCmPj
        1
    32uKHwVJ179qCmPj  
       Jul 14, 2021   ❤️ 1
    调用了 CFile 结构体 136 偏移的一个函数
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2372 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 04:22 · PVG 12:22 · LAX 21:22 · JFK 00:22
    ♥ Do have faith in what you're doing.