clrtype.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:EdgeHTTP2Fuzzer 作者: sirusdv 项目源码 文件源码
def get_dynamic_operations_field():
        if ClrClass.dynamic_operations_field: 
            return ClrClass.dynamic_operations_field
        python_context = clr.GetCurrentRuntime().GetLanguage(PythonContext)
        dynamic_operations = DynamicOperations(python_context)

        typegen = Snippets.Shared.DefineType(
            "DynamicOperationsHolder" + str(hash(python_context)), 
            object, 
            True, 
            False)
        typebld = typegen.TypeBuilder
        typebld.DefineField(
            "DynamicOperations",
            DynamicOperations,
            FieldAttributes.Public | FieldAttributes.Static)
        new_type = typebld.CreateType()
        ClrClass.dynamic_operations_field = new_type.GetField("DynamicOperations")

        ClrClass.dynamic_operations_field.SetValue(None, dynamic_operations)

        return ClrClass.dynamic_operations_field
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号