• 大小: 80.76MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2022-08-29
  • 语言: 其他
  • 标签: unity  mono  反编译  

资源简介

官网下载比较慢,这里提供一份下载,测试win7+vs2010编译成功,win10编译失败

资源截图

代码片段和文件信息

#
# Author: Zoltan Varga (vargaz@gmail.com)
# License: MIT/X11
#

#
# This is a mono support mode for gdb 7.0 and later
# Usage:
# - copy/symlink this file to the directory where the mono executable lives.
# - run mono under gdb or attach to a mono process started with --debug=gdb using gdb.
#

import os

class StringPrinter:
    “Print a C# string“

    def __init__(self val):
        self.val = val

    def to_string(self):
        if int(self.val.cast (gdb.lookup_type (“guint64“))) == 0:
            return “null“

        obj = self.val.cast (gdb.lookup_type (“MonoString“).pointer ()).dereference ()
        len = obj [‘length‘]
        chars = obj [‘chars‘]
        i = 0
        res = [‘“‘]
        while i < len:
            val = (chars.cast(gdb.lookup_type (“gint64“)) + (i * 2)).cast(gdb.lookup_type (“gunichar2“).pointer ()).dereference ()
            if val >= 256:
                c = “\u%X“ % val
            else:
                c = chr (val)
            res.append (c)
            i = i + 1
        res.append (‘“‘)
        return ‘‘.join (res)

def stringify_class_name(ns name):
    if ns == “System“:
        if name == “Byte“:
            return “byte“
        if name == “String“:
            return “string“
    if ns == ““:
        return name
    else:
        return “%s.%s“ % (ns name)

class ArrayPrinter:
    “Print a C# array“

    def __init__(self val class_ns class_name):
        self.val = val
        self.class_ns = class_ns
        self.class_name = class_name

    def to_string(self):
        obj = self.val.cast (gdb.lookup_type (“MonoArray“).pointer ()).dereference ()
        length = obj [‘max_length‘]
        return “%s [%d]“ % (stringify_class_name (self.class_ns self.class_name [0:len(self.class_name) - 2]) int(length))
        
class objectPrinter:
    “Print a C# object“

    def __init__(self val):
        if str(val.type)[-1] == “&“:
            self.val = val.address.cast (gdb.lookup_type (“Monoobject“).pointer ())
        else:
            self.val = val.cast (gdb.lookup_type (“Monoobject“).pointer ())

    class _iterator:
        def __init__(selfobj):
            self.obj = obj
            self.iter = self.obj.type.fields ().__iter__ ()
            pass

        def __iter__(self):
            return self

        def next(self):
            field = self.iter.next ()
            try:
                if str(self.obj [field.name].type) == “object“:
                    # Avoid recursion
                    return (field.name self.obj [field.name].cast (gdb.lookup_type (“void“).pointer ()))
                else:
                    return (field.name self.obj [field.name])
            except:
                # Superclass
                return (field.name self.obj.cast (gdb.lookup_type (“%s“ % (field.name))))

    def children(self):
        # FIXME: It would be easier if gdb.Value would support iteration itself
        # It would also be better if we could return None
        if int(self.val.cast (gdb

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-03-11 17:19  mono-unity-2017.4\
     文件       24324  2019-03-11 17:19  mono-unity-2017.4\.cproject
     文件         902  2019-03-11 17:19  mono-unity-2017.4\.gitignore
     文件         799  2019-03-11 17:19  mono-unity-2017.4\.project
     文件         104  2019-03-11 17:19  mono-unity-2017.4\AUTHORS
     文件       94016  2019-03-11 17:19  mono-unity-2017.4\CMakeLists.txt
     文件       25369  2019-03-11 17:19  mono-unity-2017.4\COPYING.LIB
     文件      162717  2019-03-11 17:19  mono-unity-2017.4\ChangeLog
     文件        3727  2019-03-11 17:19  mono-unity-2017.4\LICENSE
     文件        4591  2019-03-11 17:19  mono-unity-2017.4\Makefile.am
     文件         205  2019-03-11 17:19  mono-unity-2017.4\NEWS
     文件       13883  2019-03-11 17:19  mono-unity-2017.4\README
     文件        4556  2019-03-11 17:19  mono-unity-2017.4\README.vsnet
     文件        5495  2019-03-11 17:19  mono-unity-2017.4\acinclude.m4
     目录           0  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\
     目录           0  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\
     目录           0  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\
     文件          48  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\cli
     文件         176  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\cli.bat
     文件          54  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\cli_unity
     文件         178  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\cli_unity.bat
     文件          68  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\gmcs
     文件          92  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\gmcs.bat
     文件         214  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\mono-env
     文件         177  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\mono-env-unity
     文件         197  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\monobin-env
     文件          74  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\monolinker
     文件          98  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\monolinker.bat
     文件          85  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\nunit-console2
     文件         212  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\nunit-console2.bat
     文件          74  2019-03-11 17:19  mono-unity-2017.4\add_to_build_results\monodistribution\bin\smcs
............此处省略43286个文件信息

评论

共有 条评论