Esempio n. 1
0
    int GenPinvokeTable(String[] args)
    {
        var modules = new Dictionary <string, string> ();

        foreach (var module in args[1].Split(','))
        {
            modules [module] = module;
        }

        args = args.Skip(2).ToArray();

#if NETFRAMEWORK
        var assemblies = new List <AssemblyDefinition> ();
        foreach (var fname in args)
        {
            assemblies.Add(AssemblyDefinition.ReadAssembly(fname));
        }

        var generator = new PInvokeTableGenerator();
        generator.Run(assemblies, modules);
#else
        var generator = new PInvokeTableGenerator();

        generator.OutputPath = Path.GetTempFileName();
        generator.GenPInvokeTable(modules.Keys.ToArray(), args.ToArray());

        Console.WriteLine(File.ReadAllText(generator.OutputPath));
#endif

        return(0);
    }
Esempio n. 2
0
    int GenPinvokeTable(String[] args)
    {
        var modules = new Dictionary <string, string> ();

        foreach (var module in args[1].Split(','))
        {
            modules [module] = module;
        }

        args = args.Skip(2).ToArray();
        var assemblies = new List <AssemblyDefinition> ();

        foreach (var fname in args)
        {
            assemblies.Add(AssemblyDefinition.ReadAssembly(fname));
        }

        var generator = new PInvokeTableGenerator();

        generator.Run(assemblies, modules);

        return(0);
    }